org.ow2.util.ee.deploy.impl.deployer
Class AbsDeployer

java.lang.Object
  extended by org.ow2.util.ee.deploy.impl.deployer.AbsDeployer
All Implemented Interfaces:
org.ow2.util.ee.deploy.api.deployer.IDeployer

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

Abstract class that defines common methods for deployer.

Author:
Francois Fornaciari

Field Summary
protected  Map<URL,org.ow2.util.ee.deploy.api.deployable.IDeployable<?>> deployedDeployables
          Map between an URL and the associated Deployable that has been deployed.
 
Constructor Summary
AbsDeployer()
          Default constructor.
 
Method Summary
protected  void check(org.ow2.util.ee.deploy.api.deployable.IDeployable<?> deployable)
          Check if the given deployable is supported.
 void deploy(org.ow2.util.ee.deploy.api.deployable.IDeployable<?> deployable)
          
abstract  void doDeploy(org.ow2.util.ee.deploy.api.deployable.IDeployable<?> deployable)
          Deploy a deployable.
abstract  void doUndeploy(org.ow2.util.ee.deploy.api.deployable.IDeployable<?> deployable)
          Undeploy a deployable.
 Map<URL,org.ow2.util.ee.deploy.api.deployable.IDeployable<?>> getDeployedDeployables()
          Returns a map between an URL and the associated deployable that has been deployed.
protected  File getFile(org.ow2.util.ee.deploy.api.deployable.IDeployable<?> deployable)
          Allows to get a File from the given Deployable.
protected  URL getURL(org.ow2.util.ee.deploy.api.deployable.IDeployable<?> deployable)
          Allows to get the URL from the given deployable.
 boolean isDeployed(org.ow2.util.ee.deploy.api.deployable.IDeployable<?> deployable)
          Checks if the given deployable is deployed or not.
 void stop()
          Undeploy all previously deployed deployables.
abstract  boolean supports(org.ow2.util.ee.deploy.api.deployable.IDeployable<?> deployable)
          
 void undeploy(org.ow2.util.ee.deploy.api.deployable.IDeployable<?> deployable)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

deployedDeployables

protected Map<URL,org.ow2.util.ee.deploy.api.deployable.IDeployable<?>> deployedDeployables
Map between an URL and the associated Deployable that has been deployed.

Constructor Detail

AbsDeployer

public AbsDeployer()
Default constructor.

Method Detail

doDeploy

public abstract void doDeploy(org.ow2.util.ee.deploy.api.deployable.IDeployable<?> deployable)
                       throws org.ow2.util.ee.deploy.api.deployer.DeployerException
Deploy a deployable.

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

doUndeploy

public abstract void doUndeploy(org.ow2.util.ee.deploy.api.deployable.IDeployable<?> deployable)
                         throws org.ow2.util.ee.deploy.api.deployer.DeployerException
Undeploy a deployable.

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

supports

public abstract boolean supports(org.ow2.util.ee.deploy.api.deployable.IDeployable<?> deployable)

Specified by:
supports in interface org.ow2.util.ee.deploy.api.deployer.IDeployer

deploy

public void deploy(org.ow2.util.ee.deploy.api.deployable.IDeployable<?> deployable)
            throws org.ow2.util.ee.deploy.api.deployer.DeployerException

Specified by:
deploy in interface org.ow2.util.ee.deploy.api.deployer.IDeployer
Throws:
org.ow2.util.ee.deploy.api.deployer.DeployerException

undeploy

public void undeploy(org.ow2.util.ee.deploy.api.deployable.IDeployable<?> deployable)
              throws org.ow2.util.ee.deploy.api.deployer.DeployerException

Specified by:
undeploy in interface org.ow2.util.ee.deploy.api.deployer.IDeployer
Throws:
org.ow2.util.ee.deploy.api.deployer.DeployerException

stop

public void stop()
Undeploy all previously deployed deployables.


getURL

protected URL getURL(org.ow2.util.ee.deploy.api.deployable.IDeployable<?> deployable)
              throws org.ow2.util.ee.deploy.api.deployer.DeployerException
Allows to get the URL from the given deployable.

Parameters:
deployable - the given deployable.
Returns:
an URL object of this deployable
Throws:
org.ow2.util.ee.deploy.api.deployer.DeployerException - if the URL can't be obtained.

getFile

protected File getFile(org.ow2.util.ee.deploy.api.deployable.IDeployable<?> deployable)
                throws org.ow2.util.ee.deploy.api.deployer.DeployerException
Allows to get a File from the given Deployable.

Parameters:
deployable - the given deployable.
Returns:
a File object of this deployable
Throws:
org.ow2.util.ee.deploy.api.deployer.DeployerException - if the File can't be obtained.

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.

getDeployedDeployables

public Map<URL,org.ow2.util.ee.deploy.api.deployable.IDeployable<?>> getDeployedDeployables()
Returns a map between an URL and the associated deployable that has been deployed.

Returns:
A map between an URL and the associated deployable that has been deployed.

check

protected void check(org.ow2.util.ee.deploy.api.deployable.IDeployable<?> deployable)
              throws org.ow2.util.ee.deploy.api.deployer.DeployerException
Check if the given deployable is supported.

Parameters:
deployable - the deployable to check.
Throws:
org.ow2.util.ee.deploy.api.deployer.DeployerException - if the deployable is not supported.


Copyright © 2007-2011 OW2 Consortium. All Rights Reserved.