@Service @Singleton public class ApplicationLifecycle extends Object implements Deployment, org.glassfish.hk2.api.PostConstruct
Modifier and Type | Class and Description |
---|---|
class |
ApplicationLifecycle.DeploymentContextBuidlerImpl |
Deployment.ApplicationDeployment, Deployment.DeploymentContextBuilder
Modifier and Type | Field and Description |
---|---|
protected Applications |
applications |
ApplicationRegistry |
appRegistry |
protected DeploymentLifecycleProbeProvider |
deploymentLifecycleProbeProvider |
protected Domain |
domain |
protected Logger |
logger |
protected SnifferManagerImpl |
snifferManager |
AFTER_APPLICATION_CLASSLOADER_CREATION, AFTER_DEPLOYMENT_CLASSLOADER_CREATION, ALL_APPLICATIONS_LOADED, ALL_APPLICATIONS_PROCESSED, ALL_APPLICATIONS_STOPPED, APPLICATION_CLEANED, APPLICATION_DISABLED, APPLICATION_LOADED, APPLICATION_PREPARED, APPLICATION_STARTED, APPLICATION_STOPPED, APPLICATION_UNLOADED, DEPLOYMENT_BEFORE_CLASSLOADER_CREATION, DEPLOYMENT_FAILURE, DEPLOYMENT_FAILURE_NAME, DEPLOYMENT_START, DEPLOYMENT_SUCCESS, DISABLE_START, INITIAL_CONTEXT_CREATED, MODULE_CLEANED, MODULE_LOADED, MODULE_PREPARED, MODULE_STARTED, MODULE_STOPPED, MODULE_UNLOADED, UNDEPLOYMENT_FAILURE, UNDEPLOYMENT_START, UNDEPLOYMENT_SUCCESS, UNDEPLOYMENT_VALIDATION
Constructor and Description |
---|
ApplicationLifecycle() |
@Inject protected SnifferManagerImpl snifferManager
@Inject public ApplicationRegistry appRegistry
@Inject protected Applications applications
@Inject protected Domain domain
protected Logger logger
protected DeploymentLifecycleProbeProvider deploymentLifecycleProbeProvider
public void postConstruct()
postConstruct
in interface org.glassfish.hk2.api.PostConstruct
public ArchiveHandler getArchiveHandler(ReadableArchive archive) throws IOException
getArchiveHandler
in interface Deployment
archive
- the archive to find the handler forIOException
- when an error occurpublic ArchiveHandler getArchiveHandler(ReadableArchive archive, String type) throws IOException
getArchiveHandler
in interface Deployment
archive
- the archive to find the handler fortype
- the type of the archiveIOException
- when an error occurpublic Deployment.ApplicationDeployment prepare(Collection<? extends Sniffer> sniffers, ExtendedDeploymentContext context)
prepare
in interface Deployment
public void initialize(ApplicationInfo appInfo, Collection<? extends Sniffer> sniffers, ExtendedDeploymentContext context)
initialize
in interface Deployment
public ApplicationInfo deploy(ExtendedDeploymentContext context)
deploy
in interface Deployment
public ApplicationInfo deploy(Collection<? extends Sniffer> sniffers, ExtendedDeploymentContext context)
deploy
in interface Deployment
public org.glassfish.hk2.classmodel.reflect.Types getDeployableTypes(DeploymentContext context) throws IOException
Deployment
getDeployableTypes
in interface Deployment
context
- deployment contextIOException
- if the scanning fails due to an I/O exceptionpublic org.glassfish.hk2.classmodel.reflect.Parser getDeployableParser(ReadableArchive source, boolean skipScanExternalLibProp, boolean modelUnAnnotatedMembers, StructuredDeploymentTracing tracing, Logger logger) throws IOException
IOException
public boolean suspend(String appName)
appName
- the registration application IDpublic boolean resume(String appName)
appName
- the registration application IDpublic List<EngineInfo> setupContainerInfos(DeploymentContext context) throws Exception
setupContainerInfos
in interface Deployment
Exception
public Collection<? extends Sniffer> getSniffers(ArchiveHandler handler, Collection<? extends Sniffer> sniffers, DeploymentContext context)
getSniffers
in interface Deployment
public List<EngineInfo> setupContainerInfos(ArchiveHandler handler, Collection<? extends Sniffer> sniffers, DeploymentContext context) throws Exception
setupContainerInfos
in interface Deployment
handler
- sniffers
- context
- Exception
public ModuleInfo prepareModule(List<EngineInfo> sortedEngineInfos, String moduleName, DeploymentContext context, ProgressTracker tracker) throws Exception
prepareModule
in interface Deployment
Exception
protected Collection<EngineInfo> setupContainer(Sniffer sniffer, Logger logger, DeploymentContext context)
protected boolean startContainers(Collection<EngineInfo> containersInfo, Logger logger, DeploymentContext context)
protected void stopContainers(EngineInfo[] ctrInfos, Logger logger)
public ApplicationInfo unload(ApplicationInfo info, ExtendedDeploymentContext context)
unload
in interface Deployment
public void undeploy(String appName, ExtendedDeploymentContext context)
undeploy
in interface Deployment
public Transaction prepareAppConfigChanges(DeploymentContext context) throws TransactionFailure
prepareAppConfigChanges
in interface Deployment
TransactionFailure
public void registerAppInDomainXML(ApplicationInfo applicationInfo, DeploymentContext context, Transaction t) throws TransactionFailure
registerAppInDomainXML
in interface Deployment
TransactionFailure
public void registerAppInDomainXML(ApplicationInfo applicationInfo, DeploymentContext context, Transaction t, boolean appRefOnly) throws TransactionFailure
registerAppInDomainXML
in interface Deployment
TransactionFailure
public void registerTenantWithAppInDomainXML(String appName, ExtendedDeploymentContext context) throws TransactionFailure
registerTenantWithAppInDomainXML
in interface Deployment
TransactionFailure
public void unregisterTenantWithAppInDomainXML(String appName, String tenantName) throws TransactionFailure, RetryableException
unregisterTenantWithAppInDomainXML
in interface Deployment
TransactionFailure
RetryableException
public void unregisterAppFromDomainXML(String appName, String target) throws TransactionFailure
unregisterAppFromDomainXML
in interface Deployment
TransactionFailure
public void unregisterAppFromDomainXML(String appName, String tgt, boolean appRefOnly) throws TransactionFailure
unregisterAppFromDomainXML
in interface Deployment
TransactionFailure
public void updateAppEnabledAttributeInDomainXML(String appName, String target, boolean enabled) throws TransactionFailure
updateAppEnabledAttributeInDomainXML
in interface Deployment
TransactionFailure
public boolean isRegistered(String appName)
isRegistered
in interface Deployment
public ApplicationInfo get(String appName)
get
in interface Deployment
public String getDefaultTarget(Boolean isClassicStyle)
getDefaultTarget
in interface Deployment
public String getDefaultTarget(String appName, OpsParams.Origin origin, Boolean isClassicStyle)
getDefaultTarget
in interface Deployment
public Deployment.DeploymentContextBuilder getBuilder(Logger logger, OpsParams params, ActionReport report)
getBuilder
in interface Deployment
public ParameterMap prepareInstanceDeployParamMap(DeploymentContext dc) throws Exception
prepareInstanceDeployParamMap
in interface Deployment
Exception
public void validateDeploymentTarget(String target, String name, boolean isRedeploy)
validateDeploymentTarget
in interface Deployment
public void validateUndeploymentTarget(String target, String name)
validateUndeploymentTarget
in interface Deployment
public void validateSpecifiedTarget(String target)
validateSpecifiedTarget
in interface Deployment
public boolean isAppEnabled(Application app)
isAppEnabled
in interface Deployment
public ExtendedDeploymentContext disable(UndeployCommandParameters commandParams, Application app, ApplicationInfo appInfo, ActionReport report, Logger logger) throws Exception
disable
in interface Deployment
Exception
public ExtendedDeploymentContext enable(String target, Application app, ApplicationRef appRef, ActionReport report, Logger logger) throws Exception
enable
in interface Deployment
Exception
public List<Sniffer> getSniffersFromApp(Application app)
getSniffersFromApp
in interface Deployment
public ExtendedDeploymentContext getCurrentDeploymentContext()
Deployment
getCurrentDeploymentContext
in interface Deployment
Copyright © 2021. All rights reserved.