Class DefaultDeployableFactory
- java.lang.Object
- 
- org.codehaus.cargo.util.log.LoggedObject
- 
- org.codehaus.cargo.generic.spi.AbstractGenericHintFactory<T>
- 
- org.codehaus.cargo.generic.spi.AbstractIntrospectionGenericHintFactory<Deployable>
- 
- org.codehaus.cargo.generic.deployable.DefaultDeployableFactory
 
 
 
 
- 
- All Implemented Interfaces:
- DeployableFactory,- Loggable
 
 public class DefaultDeployableFactory extends AbstractIntrospectionGenericHintFactory<Deployable> implements DeployableFactory Default deployable factory that returns deployables for a given container. The reason deployable can be different for different containers is because for some container Cargo understand container-specific files. For example for Tomcat Cargo understand the context.xml file.
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class org.codehaus.cargo.generic.spi.AbstractGenericHintFactoryAbstractGenericHintFactory.GenericParameters
 
- 
 - 
Constructor SummaryConstructors Constructor Description DefaultDeployableFactory()Register deployable classes mappings.DefaultDeployableFactory(ClassLoader classLoader)Register deployable classes mappings.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description DeployablecreateDeployable(String containerId, String deployableLocation, DeployableType deployableType)Creates an Deployable instance, wrapping a file or a directory.protected DeployablecreateInstance(Constructor<? extends Deployable> constructor, String hint, AbstractGenericHintFactory.GenericParameters parameters)Create an implementation class instance.protected Constructor<? extends Deployable>getConstructor(Class<? extends Deployable> deployableClass, String hint, AbstractGenericHintFactory.GenericParameters parameters)Create a constructor.booleanisDeployableRegistered(String containerId, DeployableType deployableType)Checks if the deployable specified by the deployable type is registered for a specific container.voidregisterDeployable(String containerId, DeployableType deployableType, Class<? extends Deployable> deployableClass)Registers a deployable implementation against a container.voidregisterDeployable(String containerId, DeployableType deployableType, String deployableClassName)Registers a deployable using a class specified as a String.- 
Methods inherited from class org.codehaus.cargo.generic.spi.AbstractIntrospectionGenericHintFactorycreateImplementation, registerImplementation
 - 
Methods inherited from class org.codehaus.cargo.generic.spi.AbstractGenericHintFactorygetMapping, getMappings, hasMapping, registerImplementation
 - 
Methods inherited from class org.codehaus.cargo.util.log.LoggedObjectgetLogger, setLogger
 
- 
 
- 
- 
- 
Constructor Detail- 
DefaultDeployableFactorypublic DefaultDeployableFactory() Register deployable classes mappings.
 - 
DefaultDeployableFactorypublic DefaultDeployableFactory(ClassLoader classLoader) Register deployable classes mappings.- Parameters:
- classLoader- ClassLoader to discover implementations from. See- AbstractFactoryRegistry.register(ClassLoader, DeployableFactory)for the details of what this value means.
 
 
- 
 - 
Method Detail- 
registerDeployablepublic void registerDeployable(String containerId, DeployableType deployableType, Class<? extends Deployable> deployableClass) Registers a deployable implementation against a container.- Specified by:
- registerDeployablein interface- DeployableFactory
- Parameters:
- containerId- the container id attached to this deployable class
- deployableType- the type to differentiate this deployable from others for the specified container
- deployableClass- the deployable implementation class to register
 
 - 
registerDeployablepublic void registerDeployable(String containerId, DeployableType deployableType, String deployableClassName) Registers a deployable using a class specified as a String.- Parameters:
- containerId- Container id.
- deployableType- Deployable type.
- deployableClassName- Deployable implementation class to register as a String
- See Also:
- registerDeployable(String, DeployableType, Class)
 
 - 
isDeployableRegisteredpublic boolean isDeployableRegistered(String containerId, DeployableType deployableType) Checks if the deployable specified by the deployable type is registered for a specific container.- Specified by:
- isDeployableRegisteredin interface- DeployableFactory
- Parameters:
- containerId- the container id attached to the deployable type class
- deployableType- the type to differentiate this deployable from others for the specified container
- Returns:
- true if the specified deployable is already registered or false otherwise
 
 - 
createDeployablepublic Deployable createDeployable(String containerId, String deployableLocation, DeployableType deployableType) Creates an Deployable instance, wrapping a file or a directory.- Specified by:
- createDeployablein interface- DeployableFactory
- Parameters:
- containerId- the container id for which to create the deployable for
- deployableLocation- the location of the deployable being wrapped, which must point to a file or a directory (for an expanded deployable)
- deployableType- the deployable type to create
- Returns:
- the Deployableinstance
 
 - 
getConstructorprotected Constructor<? extends Deployable> getConstructor(Class<? extends Deployable> deployableClass, String hint, AbstractGenericHintFactory.GenericParameters parameters) throws NoSuchMethodException Create a constructor.- Specified by:
- getConstructorin class- AbstractGenericHintFactory<Deployable>
- Parameters:
- deployableClass- implementation class for which to create the constructor
- hint- the hint to differentiate this implementation class from others
- parameters- additional parameters necessary to create the constructor object
- Returns:
- the constructor to use for creating an instance
- Throws:
- NoSuchMethodException- in case of error
 
 - 
createInstanceprotected Deployable createInstance(Constructor<? extends Deployable> constructor, String hint, AbstractGenericHintFactory.GenericParameters parameters) throws Exception Create an implementation class instance.- Specified by:
- createInstancein class- AbstractGenericHintFactory<Deployable>
- Parameters:
- constructor- the constructor to use for creating the instance
- hint- the hint to differentiate this implementation class from others
- parameters- additional parameters necessary to create the instance
- Returns:
- the created instance
- Throws:
- Exception- in case of error
 
 
- 
 
-