org.mule.module.launcher.artifact
Class ArtifactWrapper<T extends Artifact>

java.lang.Object
  extended by org.mule.module.launcher.artifact.ArtifactWrapper<T>
All Implemented Interfaces:
Artifact
Direct Known Subclasses:
ApplicationWrapper, DomainWrapper

public class ArtifactWrapper<T extends Artifact>
extends Object
implements Artifact

Decorates the target deployer to properly switch out context classloader for deployment one where applicable. E.g. init() phase may load custom classes for an application, which must be executed with deployment (app) classloader in the context, and not Mule system classloader.


Constructor Summary
protected ArtifactWrapper(T artifact)
           
 
Method Summary
 void dispose()
          Dispose the artifact.
 String getAppName()
           
 ArtifactClassLoader getArtifactClassLoader()
           
 String getArtifactName()
           
 T getDelegate()
           
 MuleContext getMuleContext()
           
 File[] getResourceFiles()
           
 void init()
          Initialise the artifact resources
 void install()
          Install the artifact.
 void start()
          Starts the artifact execution
 void stop()
          Stops the artifact execution
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ArtifactWrapper

protected ArtifactWrapper(T artifact)
                   throws IOException
Throws:
IOException
Method Detail

dispose

public void dispose()
Description copied from interface: Artifact
Dispose the artifact. Most commonly this includes the release of the resources held by the artifact

Specified by:
dispose in interface Artifact

getArtifactClassLoader

public ArtifactClassLoader getArtifactClassLoader()
Specified by:
getArtifactClassLoader in interface Artifact
Returns:
class loader responsible for loading resources for this artifact.

getMuleContext

public MuleContext getMuleContext()
Specified by:
getMuleContext in interface Artifact
Returns:
MuleContext created from the artifact configurations files.

init

public void init()
Description copied from interface: Artifact
Initialise the artifact resources

Specified by:
init in interface Artifact

install

public void install()
             throws InstallException
Description copied from interface: Artifact
Install the artifact. Most commonly this includes the creation of the class loader and validation of resources.

Specified by:
install in interface Artifact
Throws:
InstallException

getArtifactName

public String getArtifactName()
Specified by:
getArtifactName in interface Artifact
Returns:
the artifact identifier

getResourceFiles

public File[] getResourceFiles()
Specified by:
getResourceFiles in interface Artifact
Returns:
an array with the configuration files of the artifact. Never returns null. If there's no configuration file then returns an empty array.

start

public void start()
           throws DeploymentStartException
Description copied from interface: Artifact
Starts the artifact execution

Specified by:
start in interface Artifact
Throws:
DeploymentStartException

stop

public void stop()
Description copied from interface: Artifact
Stops the artifact execution

Specified by:
stop in interface Artifact

getAppName

public String getAppName()

toString

public String toString()
Overrides:
toString in class Object

getDelegate

public T getDelegate()


Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.