org.codehaus.cargo.generic.deployer
Class DefaultDeployerFactory

java.lang.Object
  extended by org.codehaus.cargo.util.log.LoggedObject
      extended by org.codehaus.cargo.generic.spi.AbstractGenericHintFactory
          extended by org.codehaus.cargo.generic.spi.AbstractIntrospectionGenericHintFactory
              extended by org.codehaus.cargo.generic.deployer.DefaultDeployerFactory
All Implemented Interfaces:
DeployerFactory, Loggable

public class DefaultDeployerFactory
extends AbstractIntrospectionGenericHintFactory
implements DeployerFactory

Default DeployerFactory implementation that has all the known container deployers registered against their containers. It also supports registering new deployers against any container.

Version:
$Id: DefaultDeployerFactory.java 1915 2009-03-03 22:11:42Z mwringe $

Nested Class Summary
 
Nested classes/interfaces inherited from class org.codehaus.cargo.generic.spi.AbstractGenericHintFactory
AbstractGenericHintFactory.GenericParameters
 
Constructor Summary
DefaultDeployerFactory()
          Register default deployers.
DefaultDeployerFactory(java.lang.ClassLoader classLoader)
          Register deployer name mappings.
 
Method Summary
 Deployer createDeployer(Container container)
          Create a Deployer instance whose type matches the container's type.
 Deployer createDeployer(Container container, DeployerType deployerType)
          Create a Deployer instance matching the specified container and type.
protected  java.lang.Object createInstance(java.lang.reflect.Constructor constructor, java.lang.String hint, AbstractGenericHintFactory.GenericParameters parameters)
          Create an implementation class instance.
protected  java.lang.reflect.Constructor getConstructor(java.lang.Class deployerClass, java.lang.String hint, AbstractGenericHintFactory.GenericParameters parameters)
          Create a constructor.
 java.lang.Class getDeployerClass(java.lang.String containerId, DeployerType deployerType)
          
 boolean isDeployerRegistered(java.lang.String containerId, DeployerType deployerType)
          
 void registerDeployer(java.lang.String containerId, DeployerType deployerType, java.lang.Class deployerClass)
          Registers a Deployer implementation.
 void registerDeployer(java.lang.String containerId, DeployerType deployerType, java.lang.String deployerClassName)
          Registers a deployer using a class specified as a String.
 void registerGeronimo()
          Register Apache Geronimo
 void registerJBoss()
          Register JBoss
 void registerJetty()
          Register Jetty
 void registerJO()
          Register JO!
 void registerJOnAS()
          Register OW2 JOnAS
 void registerJRun()
          Register JRun
 void registerOrion()
          Register Orion
 void registerResin()
          Register Resin
 void registerTomcat()
          Register Tomcat
 void registerWeblogic()
          Register BEA/Oracle Weblogic
 
Methods inherited from class org.codehaus.cargo.generic.spi.AbstractIntrospectionGenericHintFactory
createImplementation, registerImplementation
 
Methods inherited from class org.codehaus.cargo.generic.spi.AbstractGenericHintFactory
getMapping, getMappings, hasMapping, registerImplementation
 
Methods inherited from class org.codehaus.cargo.util.log.LoggedObject
getLogger, setLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDeployerFactory

public DefaultDeployerFactory()
Register default deployers.


DefaultDeployerFactory

public DefaultDeployerFactory(java.lang.ClassLoader classLoader)
Register deployer name mappings.

Parameters:
classLoader - ClassLoader to discover implementations from. See AbstractFactoryRegistry.register(ClassLoader, DeployerFactory) for the details of what this value means.
Method Detail

registerGeronimo

public void registerGeronimo()
Register Apache Geronimo


registerJBoss

public void registerJBoss()
Register JBoss


registerJetty

public void registerJetty()
Register Jetty


registerJO

public void registerJO()
Register JO!


registerJOnAS

public void registerJOnAS()
Register OW2 JOnAS


registerJRun

public void registerJRun()
Register JRun


registerOrion

public void registerOrion()
Register Orion


registerResin

public void registerResin()
Register Resin


registerTomcat

public void registerTomcat()
Register Tomcat


registerWeblogic

public void registerWeblogic()
Register BEA/Oracle Weblogic


registerDeployer

public void registerDeployer(java.lang.String containerId,
                             DeployerType deployerType,
                             java.lang.Class deployerClass)
Registers a Deployer implementation.

Specified by:
registerDeployer in interface DeployerFactory
Parameters:
containerId - the container attached to this deployerClass
deployerType - the deployer's type (local, remote, etc)
deployerClass - the deployer implementation class to register
See Also:
DeployerFactory.registerDeployer(String, DeployerType, Class)

registerDeployer

public void registerDeployer(java.lang.String containerId,
                             DeployerType deployerType,
                             java.lang.String deployerClassName)
Registers a deployer using a class specified as a String.

Parameters:
containerId -
deployerType -
deployerClassName - the deployer implementation class to register as a String
See Also:
registerDeployer(String, DeployerType, Class)

isDeployerRegistered

public boolean isDeployerRegistered(java.lang.String containerId,
                                    DeployerType deployerType)

Specified by:
isDeployerRegistered in interface DeployerFactory
Parameters:
containerId - the container attached to this deployer class
deployerType - the type to differentiate this deployer from others for the specified container
Returns:
true if the specified deployer is already registered or false otherwise
See Also:
DeployerFactory.isDeployerRegistered(String, DeployerType)

getDeployerClass

public java.lang.Class getDeployerClass(java.lang.String containerId,
                                        DeployerType deployerType)

Specified by:
getDeployerClass in interface DeployerFactory
Parameters:
containerId - the container attached to this deployer class
deployerType - the deployer's type
Returns:
the deployer implementation class
See Also:
DeployerFactory.getDeployerClass(String, org.codehaus.cargo.container.deployer.DeployerType)

createDeployer

public Deployer createDeployer(Container container,
                               DeployerType deployerType)
Create a Deployer instance matching the specified container and type.

Specified by:
createDeployer in interface DeployerFactory
Parameters:
container - the container for which we need to create a deployer instance
deployerType - the deployer's type (local, remote, etc)
Returns:
the deployer instance
See Also:
DeployerFactory.createDeployer(Container, DeployerType)

createDeployer

public Deployer createDeployer(Container container)
Create a Deployer instance whose type matches the container's type. For example this creates a local deployer when the container's instance passed is a local container and a remote deployer when the container's instance passed is a remote container.

Specified by:
createDeployer in interface DeployerFactory
Parameters:
container - the container for which we need to create a deployer instance
Returns:
the deployer instance
See Also:
DeployerFactory.createDeployer(Container)

getConstructor

protected java.lang.reflect.Constructor getConstructor(java.lang.Class deployerClass,
                                                       java.lang.String hint,
                                                       AbstractGenericHintFactory.GenericParameters parameters)
                                                throws java.lang.NoSuchMethodException
Create a constructor.

Specified by:
getConstructor in class AbstractGenericHintFactory
Parameters:
deployerClass - 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:
java.lang.NoSuchMethodException - in case of error
See Also:
AbstractGenericHintFactory.getConstructor(Class, String, GenericParameters)

createInstance

protected java.lang.Object createInstance(java.lang.reflect.Constructor constructor,
                                          java.lang.String hint,
                                          AbstractGenericHintFactory.GenericParameters parameters)
                                   throws java.lang.Exception
Create an implementation class instance.

Specified by:
createInstance in class AbstractGenericHintFactory
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:
java.lang.Exception - in case of error
See Also:
AbstractGenericHintFactory.createInstance(java.lang.reflect.Constructor, java.lang.String, org.codehaus.cargo.generic.spi.AbstractGenericHintFactory.GenericParameters)


Copyright © 2004-2011 Codehaus. All Rights Reserved.