Package org.glassfish.deployment.common
Class DeploymentContextImpl
java.lang.Object
org.glassfish.deployment.common.DeploymentContextImpl
- All Implemented Interfaces:
org.glassfish.api.deployment.ApplicationContext,org.glassfish.api.deployment.DeploymentContext,org.glassfish.api.ExecutionContext,org.glassfish.hk2.api.PreDestroy,org.glassfish.internal.deployment.ExtendedDeploymentContext
public class DeploymentContextImpl
extends Object
implements org.glassfish.internal.deployment.ExtendedDeploymentContext, org.glassfish.hk2.api.PreDestroy
- Author:
- dochez
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.glassfish.internal.deployment.ExtendedDeploymentContext
org.glassfish.internal.deployment.ExtendedDeploymentContext.Phase -
Field Summary
FieldsFields inherited from interface org.glassfish.internal.deployment.ExtendedDeploymentContext
IS_TEMP_CLASSLOADER, TRACKER -
Constructor Summary
ConstructorsConstructorDescriptionDeploymentContextImpl(org.glassfish.api.ActionReport actionReport, Logger logger, org.glassfish.api.deployment.archive.ReadableArchive source, org.glassfish.api.deployment.OpsParams params, org.glassfish.api.admin.ServerEnvironment env) DeploymentContextImpl(org.glassfish.api.ActionReport actionReport, org.glassfish.api.deployment.archive.ReadableArchive source, org.glassfish.api.deployment.OpsParams params, org.glassfish.api.admin.ServerEnvironment env) DeploymentContextImpl(org.glassfish.internal.deployment.Deployment.DeploymentContextBuilder builder, org.glassfish.api.admin.ServerEnvironment env) Creates a new instance of DeploymentContext -
Method Summary
Modifier and TypeMethodDescriptionvoidaddModuleMetaData(Object metaData) voidaddTransformer(ClassFileTransformer transformer) Add a new ClassFileTransformer to the contextvoidaddTransientAppMetaData(String metaDataKey, Object metaData) voidclean()voidcreateApplicationClassLoader(org.glassfish.internal.api.ClassLoaderHierarchy classLoaderHierarchy, org.glassfish.api.deployment.archive.ArchiveHandler handler) voidcreateDeploymentClassLoader(org.glassfish.internal.api.ClassLoaderHierarchy clh, org.glassfish.api.deployment.archive.ArchiveHandler handler) org.glassfish.api.ActionReportGets the action report for this contextReturns the application level properties that will be persisted as a key value pair at then end of deployment.org.glassfish.api.deployment.archive.ArchiveHandlerReturns the class loader associated to this deployment request.getClassLoader(boolean sharable) <U extends org.glassfish.api.deployment.OpsParams>
UgetCommandParameters(Class<U> commandParametersType) Returns the class loader associated to this deployment request.Gets the archive handlers for modulesGets the deployment context for modules<T> TgetModuleMetaData(Class<T> metadataType) Returns the module level properties that will be persisted as a key value pair at then end of deployment.Gets the module properties for modulesGets the module uri for this module contextorg.glassfish.api.deployment.archive.ReadableArchiveorg.glassfish.internal.deployment.ExtendedDeploymentContextGets the parent context of the moduleorg.glassfish.internal.deployment.ExtendedDeploymentContext.PhasegetPhase()getScratchDir(String subDirName) Returns a scratch directory that can be used to store things in.org.glassfish.api.deployment.archive.ReadableArchiveReturns the list of transformers registered to this context.<T> TgetTransientAppMetaData(String key, Class<T> metadataType) voidpostDeployClean(boolean isFinalClean) voidvoidPrepare the scratch directories, creating the directories if they do not existvoidsetArchiveHandler(org.glassfish.api.deployment.archive.ArchiveHandler archiveHandler) voidsetClassLoader(ClassLoader cloader) voidsetModulePropsMap(Map<String, Properties> modulePropsMap) Sets the module properties for modulesvoidsetModuleUri(String moduleUri) Sets the module uri for this module contextvoidsetParentContext(org.glassfish.internal.deployment.ExtendedDeploymentContext parentContext) Sets the parent context for the modulevoidsetPhase(org.glassfish.internal.deployment.ExtendedDeploymentContext.Phase newPhase) voidsetSource(org.glassfish.api.deployment.archive.ReadableArchive source) voidtoString()
-
Field Details
-
deplLogger
-
-
Constructor Details
-
DeploymentContextImpl
public DeploymentContextImpl(org.glassfish.internal.deployment.Deployment.DeploymentContextBuilder builder, org.glassfish.api.admin.ServerEnvironment env) Creates a new instance of DeploymentContext -
DeploymentContextImpl
public DeploymentContextImpl(org.glassfish.api.ActionReport actionReport, Logger logger, org.glassfish.api.deployment.archive.ReadableArchive source, org.glassfish.api.deployment.OpsParams params, org.glassfish.api.admin.ServerEnvironment env) -
DeploymentContextImpl
public DeploymentContextImpl(org.glassfish.api.ActionReport actionReport, org.glassfish.api.deployment.archive.ReadableArchive source, org.glassfish.api.deployment.OpsParams params, org.glassfish.api.admin.ServerEnvironment env)
-
-
Method Details
-
getPhase
public org.glassfish.internal.deployment.ExtendedDeploymentContext.Phase getPhase()- Specified by:
getPhasein interfaceorg.glassfish.internal.deployment.ExtendedDeploymentContext
-
setPhase
public void setPhase(org.glassfish.internal.deployment.ExtendedDeploymentContext.Phase newPhase) - Specified by:
setPhasein interfaceorg.glassfish.internal.deployment.ExtendedDeploymentContext
-
getSource
public org.glassfish.api.deployment.archive.ReadableArchive getSource()- Specified by:
getSourcein interfaceorg.glassfish.api.deployment.DeploymentContext
-
setSource
public void setSource(org.glassfish.api.deployment.archive.ReadableArchive source) - Specified by:
setSourcein interfaceorg.glassfish.internal.deployment.ExtendedDeploymentContext
-
getCommandParameters
public <U extends org.glassfish.api.deployment.OpsParams> U getCommandParameters(Class<U> commandParametersType) - Specified by:
getCommandParametersin interfaceorg.glassfish.api.deployment.DeploymentContext
-
getLogger
- Specified by:
getLoggerin interfaceorg.glassfish.api.ExecutionContext
-
preDestroy
public void preDestroy()- Specified by:
preDestroyin interfaceorg.glassfish.hk2.api.PreDestroy
-
getFinalClassLoader
Returns the class loader associated to this deployment request. ClassLoader instances are usually obtained by the getClassLoader API on the associated ArchiveHandler for the archive type being deployed. This can return null and the container should allocate a ClassLoader while loading the application.- Specified by:
getFinalClassLoaderin interfaceorg.glassfish.api.deployment.DeploymentContext- Returns:
- a class loader capable of loading classes and resources from the source
-
getClassLoader
Returns the class loader associated to this deployment request. ClassLoader instances are usually obtained by the getClassLoader API on the associated ArchiveHandler for the archive type being deployed. This can return null and the container should allocate a ClassLoader while loading the application.- Specified by:
getClassLoaderin interfaceorg.glassfish.api.deployment.ApplicationContext- Returns:
- a class loader capable of loading classes and resources from the source
-
setClassLoader
- Specified by:
setClassLoaderin interfaceorg.glassfish.internal.deployment.ExtendedDeploymentContext
-
createDeploymentClassLoader
public void createDeploymentClassLoader(org.glassfish.internal.api.ClassLoaderHierarchy clh, org.glassfish.api.deployment.archive.ArchiveHandler handler) throws URISyntaxException, MalformedURLException - Specified by:
createDeploymentClassLoaderin interfaceorg.glassfish.internal.deployment.ExtendedDeploymentContext- Throws:
URISyntaxExceptionMalformedURLException
-
createApplicationClassLoader
public void createApplicationClassLoader(org.glassfish.internal.api.ClassLoaderHierarchy classLoaderHierarchy, org.glassfish.api.deployment.archive.ArchiveHandler handler) throws URISyntaxException, MalformedURLException - Specified by:
createApplicationClassLoaderin interfaceorg.glassfish.internal.deployment.ExtendedDeploymentContext- Throws:
URISyntaxExceptionMalformedURLException
-
getClassLoader
-
getScratchDir
Returns a scratch directory that can be used to store things in. The scratch directory will be persisted accross server restart but not accross redeployment of the same application- Specified by:
getScratchDirin interfaceorg.glassfish.api.deployment.DeploymentContext- Parameters:
subDirName- the sub directory name of the scratch dir- Returns:
- the scratch directory for this application based on passed in subDirName. Returns the root scratch dir if the passed in value is null.
-
getSourceDir
- Specified by:
getSourceDirin interfaceorg.glassfish.api.deployment.DeploymentContext
-
addModuleMetaData
- Specified by:
addModuleMetaDatain interfaceorg.glassfish.api.deployment.DeploymentContext
-
getModuleMetaData
- Specified by:
getModuleMetaDatain interfaceorg.glassfish.api.deployment.DeploymentContext
-
getModuleMetadata
- Specified by:
getModuleMetadatain interfaceorg.glassfish.api.deployment.DeploymentContext
-
getTransientAppMetadata
- Specified by:
getTransientAppMetadatain interfaceorg.glassfish.api.deployment.DeploymentContext
-
addTransientAppMetaData
- Specified by:
addTransientAppMetaDatain interfaceorg.glassfish.api.deployment.DeploymentContext
-
getTransientAppMetaData
- Specified by:
getTransientAppMetaDatain interfaceorg.glassfish.api.deployment.DeploymentContext
-
getAppProps
Returns the application level properties that will be persisted as a key value pair at then end of deployment. That allows individual Deployers implementation to store some information at the application level that should be available upon server restart. Application level propertries are shared by all the modules.- Specified by:
getAppPropsin interfaceorg.glassfish.api.deployment.ApplicationContext- Returns:
- the application's properties.
-
getModuleProps
Returns the module level properties that will be persisted as a key value pair at then end of deployment. That allows individual Deployers implementation to store some information at the module level that should be available upon server restart. Module level properties are only visible to the current module.- Specified by:
getModulePropsin interfaceorg.glassfish.api.deployment.ApplicationContext- Returns:
- the module's properties.
-
addTransformer
Add a new ClassFileTransformer to the context- Specified by:
addTransformerin interfaceorg.glassfish.api.deployment.DeploymentContext- Parameters:
transformer- the new class file transformer to register to the new application class loader- Throws:
UnsupportedOperationException- if the class loader we use does not support the registration of a ClassFileTransformer. In such case, the deployer should either fail deployment or revert to a mode without the byteocode enhancement feature.
-
getTransformers
Returns the list of transformers registered to this context.- Specified by:
getTransformersin interfaceorg.glassfish.internal.deployment.ExtendedDeploymentContext- Returns:
- the transformers list
-
getAppLibs
- Specified by:
getAppLibsin interfaceorg.glassfish.api.deployment.DeploymentContext- Throws:
URISyntaxException
-
clean
public void clean()- Specified by:
cleanin interfaceorg.glassfish.internal.deployment.ExtendedDeploymentContext
-
getArchiveHandler
public org.glassfish.api.deployment.archive.ArchiveHandler getArchiveHandler()- Specified by:
getArchiveHandlerin interfaceorg.glassfish.api.deployment.DeploymentContext
-
setArchiveHandler
public void setArchiveHandler(org.glassfish.api.deployment.archive.ArchiveHandler archiveHandler) - Specified by:
setArchiveHandlerin interfaceorg.glassfish.internal.deployment.ExtendedDeploymentContext
-
getOriginalSource
public org.glassfish.api.deployment.archive.ReadableArchive getOriginalSource()- Specified by:
getOriginalSourcein interfaceorg.glassfish.api.deployment.DeploymentContext
-
getModulePropsMap
Gets the module properties for modules- Specified by:
getModulePropsMapin interfaceorg.glassfish.api.deployment.DeploymentContext- Returns:
- a map containing module properties
-
setModulePropsMap
Sets the module properties for modules- Specified by:
setModulePropsMapin interfaceorg.glassfish.internal.deployment.ExtendedDeploymentContext- Parameters:
modulePropsMap-
-
setParentContext
public void setParentContext(org.glassfish.internal.deployment.ExtendedDeploymentContext parentContext) Sets the parent context for the module- Specified by:
setParentContextin interfaceorg.glassfish.internal.deployment.ExtendedDeploymentContext- Parameters:
parentContext-
-
getParentContext
public org.glassfish.internal.deployment.ExtendedDeploymentContext getParentContext()Gets the parent context of the module- Specified by:
getParentContextin interfaceorg.glassfish.internal.deployment.ExtendedDeploymentContext- Returns:
- the parent context
-
getModuleUri
Gets the module uri for this module context- Specified by:
getModuleUriin interfaceorg.glassfish.internal.deployment.ExtendedDeploymentContext- Returns:
- the module uri
-
setModuleUri
Sets the module uri for this module context- Specified by:
setModuleUriin interfaceorg.glassfish.internal.deployment.ExtendedDeploymentContext- Parameters:
moduleUri-
-
getModuleArchiveHandlers
Gets the archive handlers for modules- Specified by:
getModuleArchiveHandlersin interfaceorg.glassfish.api.deployment.DeploymentContext- Returns:
- a map containing module archive handlers
-
getModuleDeploymentContexts
public Map<String,org.glassfish.internal.deployment.ExtendedDeploymentContext> getModuleDeploymentContexts()Gets the deployment context for modules- Specified by:
getModuleDeploymentContextsin interfaceorg.glassfish.internal.deployment.ExtendedDeploymentContext- Returns:
- a map containing module deployment contexts
-
getActionReport
public org.glassfish.api.ActionReport getActionReport()Gets the action report for this context- Specified by:
getActionReportin interfaceorg.glassfish.api.deployment.DeploymentContext- Returns:
- an action report
-
getAppInternalDir
- Specified by:
getAppInternalDirin interfaceorg.glassfish.internal.deployment.ExtendedDeploymentContext
-
getAppAltDDDir
- Specified by:
getAppAltDDDirin interfaceorg.glassfish.internal.deployment.ExtendedDeploymentContext
-
setTenant
- Specified by:
setTenantin interfaceorg.glassfish.internal.deployment.ExtendedDeploymentContext
-
getTenant
- Specified by:
getTenantin interfaceorg.glassfish.internal.deployment.ExtendedDeploymentContext
-
getTenantDir
- Specified by:
getTenantDirin interfaceorg.glassfish.internal.deployment.ExtendedDeploymentContext
-
postDeployClean
public void postDeployClean(boolean isFinalClean) - Specified by:
postDeployCleanin interfaceorg.glassfish.internal.deployment.ExtendedDeploymentContext
-
toString
-
prepareScratchDirs
Prepare the scratch directories, creating the directories if they do not exist- Specified by:
prepareScratchDirsin interfaceorg.glassfish.internal.deployment.ExtendedDeploymentContext- Throws:
IOException
-