Interface Deployer<T extends Container,U extends ApplicationContainer>

Type Parameters:
T - is the container type associated with this deployer
U - is the ApplicationContainer implementation for this deployer

public interface Deployer<T extends Container,U extends ApplicationContainer>
A deployer is capable of deploying one type of applications. Deployers should use the ArchiveHandler to get a ClassLoader capable of loading classes and resources from the archive type that is being deployed. In all cases the ApplicationContainer subclass must return the class loader associated with the application. In case the application is deployed to more than one container the class loader can be shared and therefore should be retrieved from the ArchiveHandler
Author:
Jerome Dochez
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clean any files and artifacts that were created during the execution of the prepare method.
    Returns the meta data associated with this Deployer
    load(T container, DeploymentContext context)
    Loads a previously prepared application in its execution environment and return a ContractProvider instance that will identify this environment in future communications with the application's container runtime.
    <V> V
    Loads the meta date associated with the application.
    boolean
    Prepares the application bits for running in the application server.
    void
    unload(U appContainer, DeploymentContext context)
    Unload or stop a previously running application identified with the ContractProvider instance.
  • Method Details

    • getMetaData

      MetaData getMetaData()
      Returns the meta data associated with this Deployer
      Returns:
      the meta data for this Deployer
    • loadMetaData

      <V> V loadMetaData(Class<V> type, DeploymentContext context)
      Loads the meta date associated with the application.
      Parameters:
      type - type of meta-data that this deployer has declared providing.
      Returns:
      the meta-data of type V
    • prepare

      boolean prepare(DeploymentContext context)
      Prepares the application bits for running in the application server. For certain cases, this is generating non portable artifacts and other application specific tasks. Failure to prepare should throw an exception which will cause the overall deployment to fail.
      Parameters:
      context - of the deployment
      Returns:
      true if the prepare phase executed successfully
    • load

      U load(T container, DeploymentContext context)
      Loads a previously prepared application in its execution environment and return a ContractProvider instance that will identify this environment in future communications with the application's container runtime.
      Parameters:
      container - in which the application will reside
      context - of the deployment
      Returns:
      an ApplicationContainer instance identifying the running application
    • unload

      void unload(U appContainer, DeploymentContext context)
      Unload or stop a previously running application identified with the ContractProvider instance. The container will be stop upon return from this method.
      Parameters:
      appContainer - instance to be stopped
      context - of the undeployment
    • clean

      void clean(DeploymentContext context)
      Clean any files and artifacts that were created during the execution of the prepare method.
      Parameters:
      context - deployment context