org.objectweb.jonas.ear.internal
Class EarDeployer

java.lang.Object
  extended by org.objectweb.jonas.ear.internal.EarDeployer
All Implemented Interfaces:
org.ow2.util.ee.deploy.api.deployer.IDeployer

public class EarDeployer
extends Object
implements org.ow2.util.ee.deploy.api.deployer.IDeployer

This deployer will deploy EAR by using the other services.

Author:
Florent BENOIT

Field Summary
static String DEFAULT_FOLDER
          Folder to create in tmp folder.
 
Constructor Summary
EarDeployer()
          Build a new instance of the EAR deployer.
 
Method Summary
protected  void applyWSGenIfNeeded(org.ow2.util.ee.deploy.api.archive.IArchive archive)
          Apply WSGen of the given archive.
 void deploy(org.ow2.util.ee.deploy.api.deployable.IDeployable<?> deployable)
          Deploy a deployable.
protected  void deployEAR(org.ow2.util.ee.deploy.api.deployable.EARDeployable earDeployable)
          Deploy the given deployable.
protected  void deployEJB21s(org.ow2.util.ee.deploy.api.deployable.EARDeployable earDeployable, URL earURL, URLClassLoader earClassLoader, ClassLoader ejbClassLoader, String[] roleNames)
          Deploy the EJB 2.1 of the given EAR.
protected  void deployRARs(org.ow2.util.ee.deploy.api.deployable.EARDeployable earDeployable, URL earURL, ClassLoader earClassLoader)
          Deploy the RARs of the given EAR.
protected  void deployWARs(org.ow2.util.ee.deploy.api.deployable.EARDeployable earDeployable, URL earURL, ClassLoader earClassLoader, ClassLoader parentClassLoader)
          Deploy the WAR files present in the given EAR.
 org.ow2.easybeans.api.EZBServer getEmbedded()
           
 boolean isDeployed(org.ow2.util.ee.deploy.api.deployable.IDeployable<?> deployable)
          Checks if the given deployable is deployed or not.
 void setAppsClassLoader(ClassLoader appsClassLoader)
          Sets the classloader to use for all deployed applications.
 void setEjb21Service(EJBService ejb21Service)
          Sets the EJB 2.1 service.
 void setEmbedded(org.ow2.easybeans.api.EZBServer embedded)
          Receive Embedded instance for this deployer.
 void setResourceService(ResourceService resourceService)
          Sets the RAR service.
 void setWebContainerService(JWebContainerService webContainerService)
          Sets the WEB container service.
 void setWsService(WebServicesService wsService)
          Sets the WS service.
 boolean supports(org.ow2.util.ee.deploy.api.deployable.IDeployable<?> deployable)
          Checks if the given deployable is supported by the Deployer.
 void undeploy(org.ow2.util.ee.deploy.api.deployable.IDeployable<?> deployable)
          Undeploy the given deployable.
protected  void undeployEAR(org.ow2.util.ee.deploy.api.deployable.EARDeployable tmpEARDeployable)
          Undeploy the given EAR.
protected  void undeployEJB3FromEAR(org.ow2.util.ee.deploy.api.deployable.EARDeployable earDeployable)
          Undeploy EJB3s of an EAR (called by the undeploy method).
protected  org.ow2.util.ee.deploy.api.deployable.EARDeployable unpackEARDeployable(org.ow2.util.ee.deploy.api.deployable.EARDeployable earDeployable)
          Unpack the given archive in a temp folder, then build a local EARDeployable and fill it with submodules and then return it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_FOLDER

public static final String DEFAULT_FOLDER
Folder to create in tmp folder.

See Also:
Constant Field Values
Constructor Detail

EarDeployer

public EarDeployer()
Build a new instance of the EAR deployer.

Method Detail

getEmbedded

public org.ow2.easybeans.api.EZBServer getEmbedded()
Returns:
the embedded instance used by this server.

setEmbedded

public void setEmbedded(org.ow2.easybeans.api.EZBServer embedded)
Receive Embedded instance for this deployer.

Parameters:
embedded - the given instance of the embedded server.

deploy

public void deploy(org.ow2.util.ee.deploy.api.deployable.IDeployable<?> deployable)
            throws org.ow2.util.ee.deploy.api.deployer.DeployerException
Deploy a deployable. It can be an EJB jar, EAR, WAR, etc.

Specified by:
deploy in interface org.ow2.util.ee.deploy.api.deployer.IDeployer
Parameters:
deployable - a given deployable
Throws:
org.ow2.util.ee.deploy.api.deployer.DeployerException - if the deployment is not done.

applyWSGenIfNeeded

protected void applyWSGenIfNeeded(org.ow2.util.ee.deploy.api.archive.IArchive archive)
                           throws org.ow2.util.ee.deploy.api.deployer.DeployerException
Apply WSGen of the given archive.

Parameters:
archive - the archive to check
Throws:
org.ow2.util.ee.deploy.api.deployer.DeployerException - if WSGen cannot be applied.

deployEAR

protected void deployEAR(org.ow2.util.ee.deploy.api.deployable.EARDeployable earDeployable)
                  throws org.ow2.util.ee.deploy.api.deployer.DeployerException
Deploy the given deployable.

Parameters:
earDeployable - the EAR deployable.
Throws:
org.ow2.util.ee.deploy.api.deployer.DeployerException - if the EAR is not deployed.

undeployEAR

protected void undeployEAR(org.ow2.util.ee.deploy.api.deployable.EARDeployable tmpEARDeployable)
                    throws org.ow2.util.ee.deploy.api.deployer.DeployerException
Undeploy the given EAR.

Parameters:
tmpEARDeployable - the deployable to remove.
Throws:
org.ow2.util.ee.deploy.api.deployer.DeployerException - if the EAR is not deployed.

undeployEJB3FromEAR

protected void undeployEJB3FromEAR(org.ow2.util.ee.deploy.api.deployable.EARDeployable earDeployable)
                            throws org.ow2.util.ee.deploy.api.deployer.DeployerException
Undeploy EJB3s of an EAR (called by the undeploy method).

Parameters:
earDeployable - a given EAR deployable
Throws:
org.ow2.util.ee.deploy.api.deployer.DeployerException - if the deployment is not done.

undeploy

public void undeploy(org.ow2.util.ee.deploy.api.deployable.IDeployable<?> deployable)
              throws org.ow2.util.ee.deploy.api.deployer.DeployerException
Undeploy the given deployable. It can be an EJB jar, EAR, WAR, etc.

Specified by:
undeploy in interface org.ow2.util.ee.deploy.api.deployer.IDeployer
Parameters:
deployable - a given deployable to undeploy
Throws:
org.ow2.util.ee.deploy.api.deployer.DeployerException - if the undeploy operation fails.

isDeployed

public boolean isDeployed(org.ow2.util.ee.deploy.api.deployable.IDeployable<?> deployable)
                   throws org.ow2.util.ee.deploy.api.deployer.DeployerException
Checks if the given deployable is deployed or not.

Specified by:
isDeployed in interface org.ow2.util.ee.deploy.api.deployer.IDeployer
Parameters:
deployable - test if a given deployable is already deployed.
Returns:
true if the deployable is deployed.
Throws:
org.ow2.util.ee.deploy.api.deployer.DeployerException - if the undeploy operation fails.

supports

public boolean supports(org.ow2.util.ee.deploy.api.deployable.IDeployable<?> deployable)
Checks if the given deployable is supported by the Deployer.

Specified by:
supports in interface org.ow2.util.ee.deploy.api.deployer.IDeployer
Parameters:
deployable - the deployable to be checked
Returns:
true if it is supported, else false.

deployWARs

protected void deployWARs(org.ow2.util.ee.deploy.api.deployable.EARDeployable earDeployable,
                          URL earURL,
                          ClassLoader earClassLoader,
                          ClassLoader parentClassLoader)
                   throws org.ow2.util.ee.deploy.api.deployer.DeployerException
Deploy the WAR files present in the given EAR.

Parameters:
earDeployable - the EAR containing the WARs
earURL - the EAR URL
earClassLoader - the EAR classloader
parentClassLoader - the parent classloader (EJB) to use
Throws:
org.ow2.util.ee.deploy.api.deployer.DeployerException - if the wars are not deployed.

deployEJB21s

protected void deployEJB21s(org.ow2.util.ee.deploy.api.deployable.EARDeployable earDeployable,
                            URL earURL,
                            URLClassLoader earClassLoader,
                            ClassLoader ejbClassLoader,
                            String[] roleNames)
                     throws org.ow2.util.ee.deploy.api.deployer.DeployerException
Deploy the EJB 2.1 of the given EAR.

Parameters:
earDeployable - the EAR that contains the EJB files
earURL - the URL of the EAR
earClassLoader - the classloader of the EAR
ejbClassLoader - the given EJB ClassLoader
roleNames - the name of the roles to use for security
Throws:
org.ow2.util.ee.deploy.api.deployer.DeployerException - if the EJB 2.1 filse can't be deployed

deployRARs

protected void deployRARs(org.ow2.util.ee.deploy.api.deployable.EARDeployable earDeployable,
                          URL earURL,
                          ClassLoader earClassLoader)
                   throws org.ow2.util.ee.deploy.api.deployer.DeployerException
Deploy the RARs of the given EAR.

Parameters:
earDeployable - the EAR that contains the war files
earURL - the URL of the EAR
earClassLoader - the classloader of the EAR
Throws:
org.ow2.util.ee.deploy.api.deployer.DeployerException - if the RARs file can't be deployed

unpackEARDeployable

protected org.ow2.util.ee.deploy.api.deployable.EARDeployable unpackEARDeployable(org.ow2.util.ee.deploy.api.deployable.EARDeployable earDeployable)
                                                                           throws org.ow2.util.ee.deploy.api.deployer.DeployerException
Unpack the given archive in a temp folder, then build a local EARDeployable and fill it with submodules and then return it.

Parameters:
earDeployable - the archive to unpack.
Returns:
a new deployable (which is unpacked)
Throws:
org.ow2.util.ee.deploy.api.deployer.DeployerException - if the EAR can't be unpacked

setWsService

public void setWsService(WebServicesService wsService)
Sets the WS service.

Parameters:
wsService - WS service

setResourceService

public void setResourceService(ResourceService resourceService)
Sets the RAR service.

Parameters:
resourceService - RAR service.

setEjb21Service

public void setEjb21Service(EJBService ejb21Service)
Sets the EJB 2.1 service.

Parameters:
ejb21Service - the EJB 2.1 service.

setWebContainerService

public void setWebContainerService(JWebContainerService webContainerService)
Sets the WEB container service.

Parameters:
webContainerService - the web container service.

setAppsClassLoader

public void setAppsClassLoader(ClassLoader appsClassLoader)
Sets the classloader to use for all deployed applications.

Parameters:
appsClassLoader - the given classloader.


Copyright © 2007 OW2 Consortium. All Rights Reserved.