Interface ExtendedDeploymentContext
-
- All Superinterfaces:
ApplicationContext
,DeploymentContext
,ExecutionContext
- All Known Implementing Classes:
DeploymentContextImpl
public interface ExtendedDeploymentContext extends DeploymentContext
semi-private interface to the deployment context- Author:
- Jerome Dochez
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ExtendedDeploymentContext.Phase
-
Field Summary
Fields Modifier and Type Field Description static String
IS_TEMP_CLASSLOADER
static String
TRACKER
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clean()
void
createApplicationClassLoader(ClassLoaderHierarchy clh, ArchiveHandler handler)
Create the final class loader.It will be used to load and start application.void
createDeploymentClassLoader(ClassLoaderHierarchy clh, ArchiveHandler handler)
Create the deployment class loader.It will be used for sniffer retrieval, metadata parsing and deployer prepare.File
getAppAltDDDir()
Returns the alternate deployment descriptor directory for the application (used for holding the external alternate deployment descriptors).File
getAppInternalDir()
Returns the internal directory for the application (used for holding the uploaded archive, for example).Map<String,ExtendedDeploymentContext>
getModuleDeploymentContexts()
Gets the deployment context for modulesString
getModuleUri()
Gets the module uri for this module contextExtendedDeploymentContext
getParentContext()
Gets the parent context for this contextExtendedDeploymentContext.Phase
getPhase()
String
getTenant()
Returns the tenant, if one is valid for this DeploymentContext.File
getTenantDir()
Returns the directory containing the expanded tenant customization archive, if this DC is for a tenant and if a customization archive was specified when the tenant was provisioned.List<ClassFileTransformer>
getTransformers()
Returns the list of transformers registered to this context.void
postDeployClean(boolean isFinalClean)
Performs any clean-up of the deployment context after deployment has finished.void
prepareScratchDirs()
Prepare the scratch directories, creating the directories if they do not existvoid
setArchiveHandler(ArchiveHandler archiveHandler)
Sets the archive handler that's associated with this contextvoid
setClassLoader(ClassLoader cloader)
Sets the application classloadervoid
setModulePropsMap(Map<String,Properties> modulePropsMap)
Sets the module properties for modulesvoid
setModuleUri(String moduleUri)
Sets the module uri for this module contextvoid
setParentContext(ExtendedDeploymentContext parentContext)
Sets the parent contextvoid
setPhase(ExtendedDeploymentContext.Phase newPhase)
Sets the phase of the deployment activity.void
setSource(ReadableArchive source)
Sets the source archivevoid
setTenant(String tenant, String appName)
Sets the tenant to which this deployment context applies.-
Methods inherited from interface org.glassfish.api.deployment.ApplicationContext
getAppProps, getClassLoader, getModuleProps
-
Methods inherited from interface org.glassfish.api.deployment.DeploymentContext
addModuleMetaData, addTransformer, addTransientAppMetaData, getActionReport, getAppLibs, getArchiveHandler, getCommandParameters, getFinalClassLoader, getModuleArchiveHandlers, getModuleMetadata, getModuleMetaData, getModulePropsMap, getOriginalSource, getScratchDir, getSource, getSourceDir, getTransientAppMetadata, getTransientAppMetaData, removeTransientAppMetaData, resetModuleMetaData
-
Methods inherited from interface org.glassfish.api.ExecutionContext
getLogger
-
-
-
-
Field Detail
-
IS_TEMP_CLASSLOADER
static final String IS_TEMP_CLASSLOADER
- See Also:
- Constant Field Values
-
TRACKER
static final String TRACKER
- See Also:
- Constant Field Values
-
-
Method Detail
-
setPhase
void setPhase(ExtendedDeploymentContext.Phase newPhase)
Sets the phase of the deployment activity.- Parameters:
newPhase
-
-
getPhase
ExtendedDeploymentContext.Phase getPhase()
-
getTransformers
List<ClassFileTransformer> getTransformers()
Returns the list of transformers registered to this context.- Returns:
- the transformers list
-
createDeploymentClassLoader
void createDeploymentClassLoader(ClassLoaderHierarchy clh, ArchiveHandler handler) throws URISyntaxException, MalformedURLException
Create the deployment class loader.It will be used for sniffer retrieval, metadata parsing and deployer prepare.- Parameters:
clh
- the hierarchy of class loader for the parenthandler
- the archive handler for the source archive- Throws:
URISyntaxException
MalformedURLException
-
createApplicationClassLoader
void createApplicationClassLoader(ClassLoaderHierarchy clh, ArchiveHandler handler) throws URISyntaxException, MalformedURLException
Create the final class loader.It will be used to load and start application.- Parameters:
clh
- the hierarchy of class loader for the parenthandler
- the archive handler for the source archive- Throws:
URISyntaxException
MalformedURLException
-
clean
void clean()
-
setArchiveHandler
void setArchiveHandler(ArchiveHandler archiveHandler)
Sets the archive handler that's associated with this context- Parameters:
archiveHandler
-
-
setSource
void setSource(ReadableArchive source)
Sets the source archive- Parameters:
source
-
-
setModulePropsMap
void setModulePropsMap(Map<String,Properties> modulePropsMap)
Sets the module properties for modules- Parameters:
modulePropsMap
-
-
getModuleDeploymentContexts
Map<String,ExtendedDeploymentContext> getModuleDeploymentContexts()
Gets the deployment context for modules- Returns:
- a map containing module deployment contexts
-
setClassLoader
void setClassLoader(ClassLoader cloader)
Sets the application classloader- Parameters:
cloader
-
-
setParentContext
void setParentContext(ExtendedDeploymentContext parentContext)
Sets the parent context- Parameters:
parentContext
-
-
getModuleUri
String getModuleUri()
Gets the module uri for this module context- Returns:
- the module uri
-
setModuleUri
void setModuleUri(String moduleUri)
Sets the module uri for this module context- Parameters:
moduleUri
-
-
getParentContext
ExtendedDeploymentContext getParentContext()
Gets the parent context for this context- Returns:
- the parent context
-
getAppInternalDir
File getAppInternalDir()
Returns the internal directory for the application (used for holding the uploaded archive, for example).- Returns:
- location of the internal directory for the application
-
getAppAltDDDir
File getAppAltDDDir()
Returns the alternate deployment descriptor directory for the application (used for holding the external alternate deployment descriptors).- Returns:
- location of the alternate deployment descriptor directory for the application
-
getTenant
String getTenant()
Returns the tenant, if one is valid for this DeploymentContext.- Returns:
- tenant name if applicable, null if no tenant is set for this DC
-
setTenant
void setTenant(String tenant, String appName)
Sets the tenant to which this deployment context applies. Also initializes the tenant directory.- Parameters:
tenant
- the name of the tenantappName
- the name of the application
-
getTenantDir
File getTenantDir()
Returns the directory containing the expanded tenant customization archive, if this DC is for a tenant and if a customization archive was specified when the tenant was provisioned.- Returns:
- directory containing the expanded customization archive; null if none
-
postDeployClean
void postDeployClean(boolean isFinalClean)
Performs any clean-up of the deployment context after deployment has finished.This method can be invoked either with "true", meaning that this is the final clean-up for the DC, or with "false," meaning that the DC implementation should be selective. (Some data is used, for instance, in the DeployCommand logic after ApplicationLifeCycle.deploy has completed.)
- Parameters:
isFinalClean
- whether this clean is the final clean or a selective one.
-
prepareScratchDirs
void prepareScratchDirs() throws IOException
Prepare the scratch directories, creating the directories if they do not exist- Throws:
IOException
-
-