com.sun.enterprise.v3.server
Class ApplicationLifecycle

java.lang.Object
  extended by com.sun.enterprise.v3.server.ApplicationLifecycle
All Implemented Interfaces:
org.glassfish.hk2.PostConstruct, Deployment

@Service
@Scoped(value=org.jvnet.hk2.component.Singleton.class)
public class ApplicationLifecycle
extends Object
implements Deployment, org.jvnet.hk2.component.PostConstruct

Application Loader is providing useful methods to load applications

Author:
Jerome Dochez, Sanjeeb Sahoo

Nested Class Summary
 class ApplicationLifecycle.DeploymentContextBuidlerImpl
           
 
Nested classes/interfaces inherited from interface org.glassfish.internal.deployment.Deployment
Deployment.DeploymentContextBuilder
 
Field Summary
protected  Applications applications
           
 ApplicationRegistry appRegistry
           
protected  DeploymentLifecycleProbeProvider deploymentLifecycleProbeProvider
           
protected  Domain domain
           
protected  Logger logger
           
protected  SnifferManagerImpl snifferManager
           
 
Fields inherited from interface org.glassfish.internal.deployment.Deployment
ALL_APPLICATIONS_PROCESSED, APPLICATION_CLEANED, APPLICATION_DISABLED, APPLICATION_LOADED, APPLICATION_PREPARED, APPLICATION_STARTED, APPLICATION_STOPPED, APPLICATION_UNLOADED, DEPLOYMENT_BEFORE_CLASSLOADER_CREATION, DEPLOYMENT_FAILURE, DEPLOYMENT_START, DEPLOYMENT_SUCCESS, MODULE_CLEANED, MODULE_LOADED, MODULE_PREPARED, MODULE_STARTED, MODULE_STOPPED, MODULE_UNLOADED, UNDEPLOYMENT_FAILURE, UNDEPLOYMENT_START, UNDEPLOYMENT_SUCCESS, UNDEPLOYMENT_VALIDATION
 
Constructor Summary
ApplicationLifecycle()
           
 
Method Summary
 ApplicationInfo deploy(Collection<Sniffer> sniffers, ExtendedDeploymentContext context)
           
 ApplicationInfo deploy(ExtendedDeploymentContext context)
           
 ExtendedDeploymentContext disable(UndeployCommandParameters commandParams, Application app, ApplicationInfo appInfo, ActionReport report, Logger logger)
           
 ExtendedDeploymentContext enable(String target, Application app, ApplicationRef appRef, ActionReport report, Logger logger)
           
 ApplicationInfo get(String appName)
           
 ArchiveHandler getArchiveHandler(ReadableArchive archive)
          Returns the ArchiveHandler for the passed archive abstraction or null if there are none.
 ArchiveHandler getArchiveHandler(ReadableArchive archive, String type)
          Returns the ArchiveHandler for the passed archive abstraction or null if there are none.
 Deployment.DeploymentContextBuilder getBuilder(Logger logger, OpsParams params, ActionReport report)
           
 String getDefaultTarget()
           
 String getDefaultTarget(String appName, OpsParams.Origin origin)
           
 org.glassfish.hk2.classmodel.reflect.Types getDeployableTypes(DeploymentContext context)
           
protected
<T extends Container,U extends ApplicationContainer>
Deployer<T,U>
getDeployer(EngineInfo<T,U> engineInfo)
           
 List<Sniffer> getSniffersFromApp(Application app)
           
 boolean isAppEnabled(Application app)
           
 boolean isRegistered(String appName)
           
 void postConstruct()
           
 org.jvnet.hk2.config.Transaction prepareAppConfigChanges(DeploymentContext context)
           
 ParameterMap prepareInstanceDeployParamMap(DeploymentContext dc)
           
 ModuleInfo prepareModule(List<EngineInfo> sortedEngineInfos, String moduleName, DeploymentContext context, ProgressTracker tracker)
           
 List<Sniffer> prepareSniffersForOSGiDeployment(String type, DeploymentContext context)
           
 void registerAppInDomainXML(ApplicationInfo applicationInfo, DeploymentContext context, org.jvnet.hk2.config.Transaction t)
           
 void registerAppInDomainXML(ApplicationInfo applicationInfo, DeploymentContext context, org.jvnet.hk2.config.Transaction t, boolean appRefOnly)
           
 boolean resume(String appName)
          Resumes this application.
protected  Collection<EngineInfo> setupContainer(Sniffer sniffer, Logger logger, DeploymentContext context)
           
 List<EngineInfo> setupContainerInfos(ArchiveHandler handler, Collection<? extends Sniffer> sniffers, DeploymentContext context)
           
 List<EngineInfo> setupContainerInfos(DeploymentContext context)
           
protected  boolean startContainers(Collection<EngineInfo> containersInfo, Logger logger, DeploymentContext context)
           
protected  void stopContainers(EngineInfo[] ctrInfos, Logger logger)
           
 boolean suspend(String appName)
          Suspends this application.
 void undeploy(String appName, ExtendedDeploymentContext context)
           
 ApplicationInfo unload(ApplicationInfo info, ExtendedDeploymentContext context)
           
 void unregisterAppFromDomainXML(String appName, String target)
           
 void unregisterAppFromDomainXML(String appName, String tgt, boolean appRefOnly)
           
 void updateAppEnabledAttributeInDomainXML(String appName, String target, boolean enabled)
           
 void validateDeploymentTarget(String target, String name, boolean isRedeploy)
           
 void validateSpecifiedTarget(String target)
           
 void validateUndeploymentTarget(String target, String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

snifferManager

protected SnifferManagerImpl snifferManager

appRegistry

public ApplicationRegistry appRegistry

applications

protected Applications applications

domain

protected Domain domain

logger

protected Logger logger

deploymentLifecycleProbeProvider

protected DeploymentLifecycleProbeProvider deploymentLifecycleProbeProvider
Constructor Detail

ApplicationLifecycle

public ApplicationLifecycle()
Method Detail

getDeployer

protected <T extends Container,U extends ApplicationContainer> Deployer<T,U> getDeployer(EngineInfo<T,U> engineInfo)

postConstruct

public void postConstruct()
Specified by:
postConstruct in interface org.glassfish.hk2.PostConstruct

getArchiveHandler

public ArchiveHandler getArchiveHandler(ReadableArchive archive)
                                 throws IOException
Returns the ArchiveHandler for the passed archive abstraction or null if there are none.

Specified by:
getArchiveHandler in interface Deployment
Parameters:
archive - the archive to find the handler for
Returns:
the archive handler or null if not found.
Throws:
IOException - when an error occur

getArchiveHandler

public ArchiveHandler getArchiveHandler(ReadableArchive archive,
                                        String type)
                                 throws IOException
Returns the ArchiveHandler for the passed archive abstraction or null if there are none.

Specified by:
getArchiveHandler in interface Deployment
Parameters:
archive - the archive to find the handler for
type - the type of the archive
Returns:
the archive handler or null if not found.
Throws:
IOException - when an error occur

deploy

public ApplicationInfo deploy(ExtendedDeploymentContext context)
Specified by:
deploy in interface Deployment

deploy

public ApplicationInfo deploy(Collection<Sniffer> sniffers,
                              ExtendedDeploymentContext context)
Specified by:
deploy in interface Deployment

getDeployableTypes

public org.glassfish.hk2.classmodel.reflect.Types getDeployableTypes(DeploymentContext context)
                                                              throws IOException
Specified by:
getDeployableTypes in interface Deployment
Throws:
IOException

suspend

public boolean suspend(String appName)
Suspends this application.

Parameters:
appName - the registration application ID
Returns:
true if suspending was successful, false otherwise.

resume

public boolean resume(String appName)
Resumes this application.

Parameters:
appName - the registration application ID
Returns:
true if resumption was successful, false otherwise.

setupContainerInfos

public List<EngineInfo> setupContainerInfos(DeploymentContext context)
                                     throws Exception
Specified by:
setupContainerInfos in interface Deployment
Throws:
Exception

setupContainerInfos

public List<EngineInfo> setupContainerInfos(ArchiveHandler handler,
                                            Collection<? extends Sniffer> sniffers,
                                            DeploymentContext context)
                                     throws Exception
Specified by:
setupContainerInfos in interface Deployment
Throws:
Exception

prepareModule

public ModuleInfo prepareModule(List<EngineInfo> sortedEngineInfos,
                                String moduleName,
                                DeploymentContext context,
                                ProgressTracker tracker)
                         throws Exception
Specified by:
prepareModule in interface Deployment
Throws:
Exception

setupContainer

protected Collection<EngineInfo> setupContainer(Sniffer sniffer,
                                                Logger logger,
                                                DeploymentContext context)

startContainers

protected boolean startContainers(Collection<EngineInfo> containersInfo,
                                  Logger logger,
                                  DeploymentContext context)

stopContainers

protected void stopContainers(EngineInfo[] ctrInfos,
                              Logger logger)

unload

public ApplicationInfo unload(ApplicationInfo info,
                              ExtendedDeploymentContext context)
Specified by:
unload in interface Deployment

undeploy

public void undeploy(String appName,
                     ExtendedDeploymentContext context)
Specified by:
undeploy in interface Deployment

prepareAppConfigChanges

public org.jvnet.hk2.config.Transaction prepareAppConfigChanges(DeploymentContext context)
                                                         throws org.jvnet.hk2.config.TransactionFailure
Specified by:
prepareAppConfigChanges in interface Deployment
Throws:
org.jvnet.hk2.config.TransactionFailure

registerAppInDomainXML

public void registerAppInDomainXML(ApplicationInfo applicationInfo,
                                   DeploymentContext context,
                                   org.jvnet.hk2.config.Transaction t)
                            throws org.jvnet.hk2.config.TransactionFailure
Specified by:
registerAppInDomainXML in interface Deployment
Throws:
org.jvnet.hk2.config.TransactionFailure

registerAppInDomainXML

public void registerAppInDomainXML(ApplicationInfo applicationInfo,
                                   DeploymentContext context,
                                   org.jvnet.hk2.config.Transaction t,
                                   boolean appRefOnly)
                            throws org.jvnet.hk2.config.TransactionFailure
Specified by:
registerAppInDomainXML in interface Deployment
Throws:
org.jvnet.hk2.config.TransactionFailure

unregisterAppFromDomainXML

public void unregisterAppFromDomainXML(String appName,
                                       String target)
                                throws org.jvnet.hk2.config.TransactionFailure
Specified by:
unregisterAppFromDomainXML in interface Deployment
Throws:
org.jvnet.hk2.config.TransactionFailure

unregisterAppFromDomainXML

public void unregisterAppFromDomainXML(String appName,
                                       String tgt,
                                       boolean appRefOnly)
                                throws org.jvnet.hk2.config.TransactionFailure
Specified by:
unregisterAppFromDomainXML in interface Deployment
Throws:
org.jvnet.hk2.config.TransactionFailure

updateAppEnabledAttributeInDomainXML

public void updateAppEnabledAttributeInDomainXML(String appName,
                                                 String target,
                                                 boolean enabled)
                                          throws org.jvnet.hk2.config.TransactionFailure
Specified by:
updateAppEnabledAttributeInDomainXML in interface Deployment
Throws:
org.jvnet.hk2.config.TransactionFailure

isRegistered

public boolean isRegistered(String appName)
Specified by:
isRegistered in interface Deployment

get

public ApplicationInfo get(String appName)
Specified by:
get in interface Deployment

getDefaultTarget

public String getDefaultTarget()
Specified by:
getDefaultTarget in interface Deployment

getDefaultTarget

public String getDefaultTarget(String appName,
                               OpsParams.Origin origin)
Specified by:
getDefaultTarget in interface Deployment

getBuilder

public Deployment.DeploymentContextBuilder getBuilder(Logger logger,
                                                      OpsParams params,
                                                      ActionReport report)
Specified by:
getBuilder in interface Deployment

prepareSniffersForOSGiDeployment

public List<Sniffer> prepareSniffersForOSGiDeployment(String type,
                                                      DeploymentContext context)
Specified by:
prepareSniffersForOSGiDeployment in interface Deployment

prepareInstanceDeployParamMap

public ParameterMap prepareInstanceDeployParamMap(DeploymentContext dc)
                                           throws Exception
Specified by:
prepareInstanceDeployParamMap in interface Deployment
Throws:
Exception

validateDeploymentTarget

public void validateDeploymentTarget(String target,
                                     String name,
                                     boolean isRedeploy)
Specified by:
validateDeploymentTarget in interface Deployment

validateUndeploymentTarget

public void validateUndeploymentTarget(String target,
                                       String name)
Specified by:
validateUndeploymentTarget in interface Deployment

validateSpecifiedTarget

public void validateSpecifiedTarget(String target)
Specified by:
validateSpecifiedTarget in interface Deployment

isAppEnabled

public boolean isAppEnabled(Application app)
Specified by:
isAppEnabled in interface Deployment

disable

public ExtendedDeploymentContext disable(UndeployCommandParameters commandParams,
                                         Application app,
                                         ApplicationInfo appInfo,
                                         ActionReport report,
                                         Logger logger)
                                  throws Exception
Specified by:
disable in interface Deployment
Throws:
Exception

enable

public ExtendedDeploymentContext enable(String target,
                                        Application app,
                                        ApplicationRef appRef,
                                        ActionReport report,
                                        Logger logger)
                                 throws Exception
Specified by:
enable in interface Deployment
Throws:
Exception

getSniffersFromApp

public List<Sniffer> getSniffersFromApp(Application app)
Specified by:
getSniffersFromApp in interface Deployment


Copyright © 2012. All Rights Reserved.