org.jboss.varia.deployment
Class FoeDeployer

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src) 
      extended byorg.jboss.system.ServiceMBeanSupport (src) 
          extended byorg.jboss.deployment.SubDeployerSupport (src) 
              extended byorg.jboss.varia.deployment.FoeDeployer
All Implemented Interfaces:
MBeanRegistration (src) , NotificationBroadcaster (src) , NotificationEmitter (src) , Service (src) , ServiceMBean (src) , SubDeployer (src)

public class FoeDeployer
extends SubDeployerSupport (src)
implements SubDeployer (src)

This is the deployer for other vendor's applications with dynamic migration of vendor-specific DDs to JBoss specific DDs.

See Also:
Convertor (src)

Nested Class Summary
 
Nested classes inherited from class org.jboss.deployment.SubDeployerSupport (src)
SubDeployerSupport.ClassConfiguration (src)
 
Field Summary
 
Fields inherited from class org.jboss.deployment.SubDeployerSupport (src)
CONFIGURATION, mainDeployer, nativePrefix, nativeSuffix, relativeOrder, suffixes, tempDeployDir
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport (src)
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.deployment.SubDeployer (src)
CREATE_NOTIFICATION, DESTROY_NOTIFICATION, INIT_NOTIFICATION, RELATIVE_ORDER_100, RELATIVE_ORDER_200, RELATIVE_ORDER_300, RELATIVE_ORDER_400, RELATIVE_ORDER_500, RELATIVE_ORDER_600, RELATIVE_ORDER_700, RELATIVE_ORDER_800, RELATIVE_ORDER_900, START_NOTIFICATION, STOP_NOTIFICATION
 
Fields inherited from interface org.jboss.system.ServiceMBean (src)
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
FoeDeployer()
           
 
Method Summary
 boolean accepts(DeploymentInfo (src)  di)
          Returns true if the there is a converter available to convert the deployment unit.
 boolean accepts(java.net.URL url)
          Returns true if the there is a converter available to convert the deployment unit.
 void addConvertor(Convertor (src)  converter)
          Add a new conveter to the list.
protected  void addDeployableJar(DeploymentInfo (src)  di, java.util.jar.JarFile jarFile)
          This method is called in SubDeployerSupport.processNestedDeployments() The method is overriden to deploy the deployments acceptable by FoeDeployer only.
 void create(DeploymentInfo (src)  di)
          At the create phase, the conversion and packing is done.
 void destroy(DeploymentInfo (src)  di)
          The destroy method removes individual components
protected  ObjectName (src) getObjectName(MBeanServer (src)  server, ObjectName (src)  name)
          Returns the ObjectName
protected  void inflateJar(java.net.URL fileURL, java.io.File destinationDirectory)
          The inflateJar copies the jar entries from the jar url jarUrl to the directory destDir.
 void init(DeploymentInfo (src)  di)
          At the init phase the deployment unit and its subdeployment units are unpacked.
 void removeConvertor(Convertor (src)  converter)
          Removes a conveter from the list of converters.
 void start(DeploymentInfo (src)  di)
          This method stops this deployment because it is not of any use anymore (conversion is done)
protected  void startService()
          The startService method - gets the mbeanProxies for MainDeployer and ServiceController; - creates scratch directory for foe work.
 void stop(DeploymentInfo (src)  di)
          The stop method removes relationships between components.
 
Methods inherited from class org.jboss.deployment.SubDeployerSupport (src)
addDeployableFiles, createService, deployUrl, destroyService, emitNotification, getRelativeOrder, getSuffixes, isDeployable, processNestedDeployments, setRelativeOrder, setSuffixes, stopService
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport (src)
create, destroy, getLog, getName, getNextNotificationSequenceNumber, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport (src)
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.deployment.SubDeployer (src)
getRelativeOrder, getServiceName, getSuffixes, setRelativeOrder, setSuffixes
 

Constructor Detail

FoeDeployer

public FoeDeployer()
Method Detail

accepts

public boolean accepts(DeploymentInfo (src)  di)
Returns true if the there is a converter available to convert the deployment unit.

Specified by:
accepts in interface SubDeployer (src)
Parameters:
di - a DeploymentInfo value
Returns:
a boolean value

accepts

public boolean accepts(java.net.URL url)
Returns true if the there is a converter available to convert the deployment unit.


init

public void init(DeploymentInfo (src)  di)
          throws DeploymentException (src) 
At the init phase the deployment unit and its subdeployment units are unpacked.

Specified by:
init in interface SubDeployer (src)
Overrides:
init in class SubDeployerSupport (src)
Throws:
DeploymentException (src)

create

public void create(DeploymentInfo (src)  di)
            throws DeploymentException (src) 
At the create phase, the conversion and packing is done.

Specified by:
create in interface SubDeployer (src)
Overrides:
create in class SubDeployerSupport (src)
Throws:
DeploymentException (src)

start

public void start(DeploymentInfo (src)  di)
           throws DeploymentException (src) 
This method stops this deployment because it is not of any use anymore (conversion is done)

Specified by:
start in interface SubDeployer (src)
Overrides:
start in class SubDeployerSupport (src)
Throws:
DeploymentException (src)

stop

public void stop(DeploymentInfo (src)  di)
Description copied from interface: SubDeployer (src)
The stop method removes relationships between components.

Specified by:
stop in interface SubDeployer (src)
Overrides:
stop in class SubDeployerSupport (src)

destroy

public void destroy(DeploymentInfo (src)  di)
Description copied from interface: SubDeployer (src)
The destroy method removes individual components

Specified by:
destroy in interface SubDeployer (src)
Overrides:
destroy in class SubDeployerSupport (src)

addDeployableJar

protected void addDeployableJar(DeploymentInfo (src)  di,
                                java.util.jar.JarFile jarFile)
                         throws DeploymentException (src) 
This method is called in SubDeployerSupport.processNestedDeployments() The method is overriden to deploy the deployments acceptable by FoeDeployer only.

Overrides:
addDeployableJar in class SubDeployerSupport (src)
Parameters:
di - the DeploymentInfo
jarFile - the jar file to process.
Throws:
DeploymentException (src)

startService

protected void startService()
                     throws java.lang.Exception
The startService method - gets the mbeanProxies for MainDeployer and ServiceController; - creates scratch directory for foe work.

Overrides:
startService in class SubDeployerSupport (src)
Throws:
java.lang.Exception - if an error occurs

getObjectName

protected ObjectName (src)  getObjectName(MBeanServer (src)  server,
                                   ObjectName (src)  name)
                            throws MalformedObjectNameException (src) 
Returns the ObjectName

Overrides:
getObjectName in class ServiceMBeanSupport (src)
Throws:
MalformedObjectNameException (src)

addConvertor

public void addConvertor(Convertor (src)  converter)
Add a new conveter to the list. If the same converter is added, this new one won't be added, meaning everything stays the same. This method is normally called by a Converter to be called by this deployer to convert.

Parameters:
converter - New Converter to be added

removeConvertor

public void removeConvertor(Convertor (src)  converter)
Removes a conveter from the list of converters. If the converter does not exist nothing happens. This method is normally called by a Converter to be removed from the list if not serving anymore.

Parameters:
converter - Conveter to be removed from the list

inflateJar

protected void inflateJar(java.net.URL fileURL,
                          java.io.File destinationDirectory)
                   throws DeploymentException (src) ,
                          java.io.IOException
The inflateJar copies the jar entries from the jar url jarUrl to the directory destDir.

Parameters:
fileURL - URL pointing to the file to be inflated
destinationDirectory - Directory to which the content shall be inflated to
Throws:
DeploymentException (src) - if an error occurs
java.io.IOException - if an error occurs