Interface Deployment
-
- All Known Implementing Classes:
ApplicationLifecycle
@Contract public interface Deployment
Deployment facility- Author:
- Jerome Dochez
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Deployment.ApplicationDeployment
static interface
Deployment.DeploymentContextBuilder
-
Field Summary
Fields Modifier and Type Field Description static EventTypes<DeploymentContext>
AFTER_APPLICATION_CLASSLOADER_CREATION
This synchronous event is sent after creation of application classloader.static EventTypes<DeploymentContext>
AFTER_DEPLOYMENT_CLASSLOADER_CREATION
This synchronous event is sent after creation of deployment classloader.static EventTypes<DeploymentContext>
ALL_APPLICATIONS_LOADED
triggered when all applications are loaded, but not yet initialized Useful to find out when all classes are available in the class loaderstatic EventTypes<DeploymentContext>
ALL_APPLICATIONS_PROCESSED
The following asynchronous event is sent after all applications are started in server start up.static EventTypes<DeploymentContext>
ALL_APPLICATIONS_STOPPED
All applications are now stopped / unloaded in the process of server shutdownstatic EventTypes<DeploymentContext>
APPLICATION_CLEANED
static EventTypes<ApplicationInfo>
APPLICATION_DISABLED
static EventTypes<ApplicationInfo>
APPLICATION_LOADED
static EventTypes<DeploymentContext>
APPLICATION_PREPARED
The following synchronous events are sent after each change in an application stated (An application contains 1 to many modules)static EventTypes<ApplicationInfo>
APPLICATION_STARTED
static EventTypes<ApplicationInfo>
APPLICATION_STOPPED
static EventTypes<ApplicationInfo>
APPLICATION_UNLOADED
static EventTypes<DeploymentContext>
DEPLOYMENT_BEFORE_CLASSLOADER_CREATION
This synchronous event is sent before prepare phase of deployment.static EventTypes<ApplicationInfo>
DEPLOYMENT_COMMAND_FINISH
This synchronous event is sent at the end of deployment command processstatic EventTypes<DeploymentContext>
DEPLOYMENT_FAILURE
This asynchronous event is sent when a deployment activity (first time deploy or loading of an already deployed application) failed.static String
DEPLOYMENT_FAILURE_NAME
The name of the Deployment Failure eventstatic EventTypes<DeploymentContext>
DEPLOYMENT_START
This synchronous event is sent when a new deployment or loading of an already deployed application start.static EventTypes<ApplicationInfo>
DEPLOYMENT_SUCCESS
This asynchronous event is sent when a deployment activity (first time deploy or loading of an already deployed application) succeeded.static EventTypes<ApplicationInfo>
DISABLE_START
This event is thrown before the STOP deployment phase, notably from the disable and undeploy asadmin commands.static EventTypes<DeploymentContext>
INITIAL_CONTEXT_CREATED
This synchronous event is sent right after initial deployment context is createdstatic EventTypes<DeploymentContext>
MODULE_CLEANED
static EventTypes<ModuleInfo>
MODULE_LOADED
static EventTypes<DeploymentContext>
MODULE_PREPARED
The following synchronous events are sent after each change in a module state.static EventTypes<ModuleInfo>
MODULE_STARTED
static EventTypes<ModuleInfo>
MODULE_STOPPED
static EventTypes<ModuleInfo>
MODULE_UNLOADED
static EventTypes<DeploymentContext>
UNDEPLOYMENT_FAILURE
This asynchronous event is sent when a deployment activity (first time deploy or loading of an already deployed application) failed.static EventTypes<ApplicationInfo>
UNDEPLOYMENT_START
This asynchronous event is sent when a new deployment or loading of an already deployed application start.static EventTypes<DeploymentContext>
UNDEPLOYMENT_SUCCESS
This asynchronous event is sent when a deployment activity (first time deploy or loading of an already deployed application) succeeded.static EventTypes<DeploymentContext>
UNDEPLOYMENT_VALIDATION
The following synchronous event is sent before the application is undeployed so various listeners could validate the undeploy operation and decide whether to abort undeployment
-
Method Summary
-
-
-
Field Detail
-
INITIAL_CONTEXT_CREATED
static final EventTypes<DeploymentContext> INITIAL_CONTEXT_CREATED
This synchronous event is sent right after initial deployment context is created
-
DEPLOYMENT_START
static final EventTypes<DeploymentContext> DEPLOYMENT_START
This synchronous event is sent when a new deployment or loading of an already deployed application start. It is invoked once before any sniffer is invoked.
-
DEPLOYMENT_FAILURE_NAME
static final String DEPLOYMENT_FAILURE_NAME
The name of the Deployment Failure event- See Also:
- Constant Field Values
-
DEPLOYMENT_FAILURE
static final EventTypes<DeploymentContext> DEPLOYMENT_FAILURE
This asynchronous event is sent when a deployment activity (first time deploy or loading of an already deployed application) failed.
-
AFTER_DEPLOYMENT_CLASSLOADER_CREATION
static final EventTypes<DeploymentContext> AFTER_DEPLOYMENT_CLASSLOADER_CREATION
This synchronous event is sent after creation of deployment classloader.
-
DEPLOYMENT_BEFORE_CLASSLOADER_CREATION
static final EventTypes<DeploymentContext> DEPLOYMENT_BEFORE_CLASSLOADER_CREATION
This synchronous event is sent before prepare phase of deployment.
-
AFTER_APPLICATION_CLASSLOADER_CREATION
static final EventTypes<DeploymentContext> AFTER_APPLICATION_CLASSLOADER_CREATION
This synchronous event is sent after creation of application classloader.
-
DEPLOYMENT_SUCCESS
static final EventTypes<ApplicationInfo> DEPLOYMENT_SUCCESS
This asynchronous event is sent when a deployment activity (first time deploy or loading of an already deployed application) succeeded.
-
DEPLOYMENT_COMMAND_FINISH
static final EventTypes<ApplicationInfo> DEPLOYMENT_COMMAND_FINISH
This synchronous event is sent at the end of deployment command process
-
UNDEPLOYMENT_START
static final EventTypes<ApplicationInfo> UNDEPLOYMENT_START
This asynchronous event is sent when a new deployment or loading of an already deployed application start. It is invoked once before any sniffer is invoked.
-
UNDEPLOYMENT_FAILURE
static final EventTypes<DeploymentContext> UNDEPLOYMENT_FAILURE
This asynchronous event is sent when a deployment activity (first time deploy or loading of an already deployed application) failed.
-
UNDEPLOYMENT_SUCCESS
static final EventTypes<DeploymentContext> UNDEPLOYMENT_SUCCESS
This asynchronous event is sent when a deployment activity (first time deploy or loading of an already deployed application) succeeded.
-
MODULE_PREPARED
static final EventTypes<DeploymentContext> MODULE_PREPARED
The following synchronous events are sent after each change in a module state.
-
MODULE_LOADED
static final EventTypes<ModuleInfo> MODULE_LOADED
-
MODULE_STARTED
static final EventTypes<ModuleInfo> MODULE_STARTED
-
MODULE_STOPPED
static final EventTypes<ModuleInfo> MODULE_STOPPED
-
MODULE_UNLOADED
static final EventTypes<ModuleInfo> MODULE_UNLOADED
-
MODULE_CLEANED
static final EventTypes<DeploymentContext> MODULE_CLEANED
-
APPLICATION_PREPARED
static final EventTypes<DeploymentContext> APPLICATION_PREPARED
The following synchronous events are sent after each change in an application stated (An application contains 1 to many modules)
-
APPLICATION_LOADED
static final EventTypes<ApplicationInfo> APPLICATION_LOADED
-
APPLICATION_STARTED
static final EventTypes<ApplicationInfo> APPLICATION_STARTED
-
APPLICATION_STOPPED
static final EventTypes<ApplicationInfo> APPLICATION_STOPPED
-
APPLICATION_UNLOADED
static final EventTypes<ApplicationInfo> APPLICATION_UNLOADED
-
APPLICATION_CLEANED
static final EventTypes<DeploymentContext> APPLICATION_CLEANED
-
APPLICATION_DISABLED
static final EventTypes<ApplicationInfo> APPLICATION_DISABLED
-
UNDEPLOYMENT_VALIDATION
static final EventTypes<DeploymentContext> UNDEPLOYMENT_VALIDATION
The following synchronous event is sent before the application is undeployed so various listeners could validate the undeploy operation and decide whether to abort undeployment
-
DISABLE_START
static final EventTypes<ApplicationInfo> DISABLE_START
This event is thrown before the STOP deployment phase, notably from the disable and undeploy asadmin commands. It is used to mark the context unavailable before stopping the application and its engines, in cases where implementing the ApplicationLifecycleInterceptor interface will cause a circular dependency
-
ALL_APPLICATIONS_LOADED
static final EventTypes<DeploymentContext> ALL_APPLICATIONS_LOADED
triggered when all applications are loaded, but not yet initialized Useful to find out when all classes are available in the class loader
-
ALL_APPLICATIONS_PROCESSED
static final EventTypes<DeploymentContext> ALL_APPLICATIONS_PROCESSED
The following asynchronous event is sent after all applications are started in server start up.
-
ALL_APPLICATIONS_STOPPED
static final EventTypes<DeploymentContext> ALL_APPLICATIONS_STOPPED
All applications are now stopped / unloaded in the process of server shutdown
-
-
Method Detail
-
getBuilder
Deployment.DeploymentContextBuilder getBuilder(Logger loggger, OpsParams params, ActionReport report)
-
getArchiveHandler
ArchiveHandler getArchiveHandler(ReadableArchive archive) throws IOException
- Throws:
IOException
-
getArchiveHandler
ArchiveHandler getArchiveHandler(ReadableArchive archive, String type) throws IOException
- Throws:
IOException
-
prepareModule
ModuleInfo prepareModule(List<EngineInfo> sortedEngineInfos, String moduleName, DeploymentContext context, ProgressTracker tracker) throws Exception
- Throws:
Exception
-
prepare
Deployment.ApplicationDeployment prepare(Collection<? extends Sniffer> sniffers, ExtendedDeploymentContext context)
-
initialize
void initialize(ApplicationInfo appInfo, Collection<? extends Sniffer> sniffers, ExtendedDeploymentContext context)
-
deploy
ApplicationInfo deploy(ExtendedDeploymentContext context)
-
deploy
ApplicationInfo deploy(Collection<? extends Sniffer> sniffers, ExtendedDeploymentContext context)
-
undeploy
void undeploy(String appName, ExtendedDeploymentContext context)
-
prepareAppConfigChanges
Transaction prepareAppConfigChanges(DeploymentContext context) throws TransactionFailure
- Throws:
TransactionFailure
-
registerAppInDomainXML
void registerAppInDomainXML(ApplicationInfo applicationInfo, DeploymentContext context, Transaction t) throws TransactionFailure
- Throws:
TransactionFailure
-
unregisterAppFromDomainXML
void unregisterAppFromDomainXML(String appName, String target) throws TransactionFailure
- Throws:
TransactionFailure
-
registerAppInDomainXML
void registerAppInDomainXML(ApplicationInfo applicationInfo, DeploymentContext context, Transaction t, boolean appRefOnly) throws TransactionFailure
- Throws:
TransactionFailure
-
unregisterAppFromDomainXML
void unregisterAppFromDomainXML(String appName, String target, boolean appRefOnly) throws TransactionFailure
- Throws:
TransactionFailure
-
registerTenantWithAppInDomainXML
void registerTenantWithAppInDomainXML(String appName, ExtendedDeploymentContext context) throws TransactionFailure
- Throws:
TransactionFailure
-
unregisterTenantWithAppInDomainXML
void unregisterTenantWithAppInDomainXML(String appName, String tenantName) throws TransactionFailure, RetryableException
- Throws:
TransactionFailure
RetryableException
-
updateAppEnabledAttributeInDomainXML
void updateAppEnabledAttributeInDomainXML(String appName, String target, boolean enabled) throws TransactionFailure
- Throws:
TransactionFailure
-
setupContainerInfos
List<EngineInfo> setupContainerInfos(DeploymentContext context) throws Exception
- Throws:
Exception
-
setupContainerInfos
List<EngineInfo> setupContainerInfos(ArchiveHandler handler, Collection<? extends Sniffer> sniffers, DeploymentContext context) throws Exception
- Throws:
Exception
-
getTypeByProvider
Map<Class,ApplicationMetaDataProvider> getTypeByProvider()
-
isRegistered
boolean isRegistered(String appName)
-
get
ApplicationInfo get(String appName)
-
prepareInstanceDeployParamMap
ParameterMap prepareInstanceDeployParamMap(DeploymentContext dc) throws Exception
- Throws:
Exception
-
validateDeploymentTarget
void validateDeploymentTarget(String target, String name, boolean isRedeploy)
-
validateSpecifiedTarget
void validateSpecifiedTarget(String target)
-
isAppEnabled
boolean isAppEnabled(Application app)
-
unload
ApplicationInfo unload(ApplicationInfo appInfo, ExtendedDeploymentContext context)
-
disable
DeploymentContext disable(UndeployCommandParameters commandParams, Application app, ApplicationInfo appInfo, ActionReport report, Logger logger) throws Exception
- Throws:
Exception
-
enable
DeploymentContext enable(String target, Application app, ApplicationRef appRef, ActionReport report, Logger logger) throws Exception
- Throws:
Exception
-
getDeployableTypes
org.glassfish.hk2.classmodel.reflect.Types getDeployableTypes(DeploymentContext context) throws IOException
Scans the source of the deployment operation for all types and store the result in the deployment context. Subsequent calls will return the cached copy from the context- Parameters:
context
- deployment context- Returns:
- the types information from the deployment artifacts
- Throws:
IOException
- if the scanning fails due to an I/O exception
-
getSniffersFromApp
List<Sniffer> getSniffersFromApp(Application app)
-
getSniffers
Collection<? extends Sniffer> getSniffers(ArchiveHandler archiveHandler, Collection<? extends Sniffer> sniffers, DeploymentContext context)
-
getDefaultTarget
String getDefaultTarget(String appName, OpsParams.Origin origin, Boolean isClassicStyle)
-
getCurrentDeploymentContext
ExtendedDeploymentContext getCurrentDeploymentContext()
Returns thread-local deployment, which is the currently-executing deployment context, or null if none- Returns:
- Currently-executing deployment context
-
-