org.apache.geronimo.deployment.plugin
Class ConfigIDExtractor

java.lang.Object
  extended by org.apache.geronimo.deployment.plugin.ConfigIDExtractor
Direct Known Subclasses:
DeployUtils

public class ConfigIDExtractor
extends Object

Knows how to suck a Config ID out of a module and/or plan


Constructor Summary
ConfigIDExtractor()
           
 
Method Summary
static String extractModuleIdFromArchive(File module)
          Attempt to calculate the Geronimo ModuleID for a J2EE application module.
static String extractModuleIdFromPlan(File plan)
          Attempt to calculate the Geronimo ModuleID for a Geronimo deployment plan.
static Collection identifyTargetModuleIDs(TargetModuleID[] allModules, String name, boolean fromPlan)
          Given a list of all available TargetModuleIDs and the name of a module, find the TargetModuleIDs that represent that module.
static boolean isJarFile(File file)
          Deprecated. See org.apache.geronimo.common.FileUtils.isJarFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigIDExtractor

public ConfigIDExtractor()
Method Detail

extractModuleIdFromArchive

public static String extractModuleIdFromArchive(File module)
                                         throws IOException,
                                                DeploymentException
Attempt to calculate the Geronimo ModuleID for a J2EE application module. Given a File representing an archive (which may be a JAR file or a directory laid out like a JAR file), identify it's J2EE module type based on which (if any) deployment descriptor is present, and then look for a Geronimo deployment plan in the usual place, and if one is found, retrieve the configId from the Geronimo deployment plan. todo: Handle Spring and other weird deployment types?

Parameters:
module - A Jar file or directory representing a J2EE module
Returns:
The configId in the Geronimo deployment plan for this module, or null if no Geronimo deployment plan was identified.
Throws:
IOException
DeploymentException

extractModuleIdFromPlan

public static String extractModuleIdFromPlan(File plan)
                                      throws IOException
Attempt to calculate the Geronimo ModuleID for a Geronimo deployment plan.

Parameters:
plan - A Geronimo deployment plan (which must be an XML file).
Returns:
The configId in the Geronimo deployment plan for this module.
Throws:
IOException

identifyTargetModuleIDs

public static Collection identifyTargetModuleIDs(TargetModuleID[] allModules,
                                                 String name,
                                                 boolean fromPlan)
                                          throws DeploymentException
Given a list of all available TargetModuleIDs and the name of a module, find the TargetModuleIDs that represent that module.

Parameters:
allModules - The list of all available modules
name - The module name to search for
fromPlan - Should be true if the module name was loaded from a deployment plan (thus no group means the default group) or false if the module name was provided by the user (thus no group means any group).
Throws:
DeploymentException - If no TargetModuleIDs have that module.

isJarFile

public static boolean isJarFile(File file)
                         throws DeploymentException
Deprecated. See org.apache.geronimo.common.FileUtils.isJarFile

Try to determine whether a file is a JAR File (or, at least, a ZIP file).

Throws:
DeploymentException


Copyright © 2003-2007 Apache Software Foundation. All Rights Reserved.