Package org.glassfish.internal.data
Class ApplicationInfo
- java.lang.Object
-
- org.glassfish.internal.data.ModuleInfo
-
- org.glassfish.internal.data.ApplicationInfo
-
public class ApplicationInfo extends ModuleInfo
Information about a running application. Applications are composed of modules. Modules run in an individual container.- Author:
- Jerome Dochez
-
-
Field Summary
Fields Modifier and Type Field Description static String
APP_SERVICE_LOCATOR_PREFIX
The prefix that will be given to the service locator, followed by the name of the application-
Fields inherited from class org.glassfish.internal.data.ModuleInfo
engines, events, metaData, name, reversedEngines
-
-
Constructor Summary
Constructors Constructor Description ApplicationInfo(Events events, ReadableArchive source, String name)
Creates a new instance of an ApplicationInfo
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(EngineRef ref)
void
addModule(ModuleInfo info)
void
addTransientAppMetaData(String metaDataKey, Object metaDataValue)
void
clean(ExtendedDeploymentContext context)
ClassLoader
getAppClassLoader()
Returns the application classloader for this application.org.glassfish.hk2.api.ServiceLocator
getAppServiceLocator()
Returns the application scoped ServiceLocator<T extends Container>
Collection<EngineRef>getEngineRefsForContainer(Class<T> type)
String
getLibraries()
Returns the deployment time libraries for this applicationCollection<ModuleInfo>
getModuleInfos()
Returns the modules of this applicationString
getName()
Returns the registration name for this applicationCollection<Sniffer>
getSniffers()
Returns the list of sniffers that participated in loaded this applicationReadableArchive
getSource()
Returns the directory where the application bits are locatedprotected ExtendedDeploymentContext
getSubContext(ModuleInfo info, ExtendedDeploymentContext context)
<T> T
getTransientAppMetaData(String key, Class<T> metadataType)
void
initialize()
boolean
isJavaEEApp()
Returns whether this application is a JavaEE applicationboolean
isLoaded()
void
load(ExtendedDeploymentContext context, ProgressTracker tracker)
void
reload(ExtendedDeploymentContext context, ProgressTracker tracker)
void
removeTransientAppMetaData(String metaDataKey)
void
reset(ReadableArchive source)
boolean
resume(Logger logger)
void
save(Application app)
Saves its state to the configuration.void
setAppClassLoader(ClassLoader cLoader)
Sets the application classloader for this applicationvoid
setIsJavaEEApp(List<EngineInfo> engineInfos)
Sets whether this application is a JavaEE applicationvoid
setLibraries(String libraries)
Sets the deployment time libraries for this applicationvoid
start(ExtendedDeploymentContext context, ProgressTracker tracker)
void
stop(ExtendedDeploymentContext context, Logger logger)
boolean
suspend(Logger logger)
void
unload(ExtendedDeploymentContext context)
-
Methods inherited from class org.glassfish.internal.data.ModuleInfo
_getEngineRefs, addMetaData, cleanClassLoaders, getClassLoaders, getEngineRefForContainer, getEngineRefs, getMetaData, getMetaData, getModuleClassLoader, getModuleProps, isRunning, reload, reset, save, start
-
-
-
-
Field Detail
-
APP_SERVICE_LOCATOR_PREFIX
public static final String APP_SERVICE_LOCATOR_PREFIX
The prefix that will be given to the service locator, followed by the name of the application- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ApplicationInfo
public ApplicationInfo(Events events, ReadableArchive source, String name)
Creates a new instance of an ApplicationInfo- Parameters:
events
-source
- the archive for this applicationname
- name of the application
-
-
Method Detail
-
add
public void add(EngineRef ref)
-
removeTransientAppMetaData
public void removeTransientAppMetaData(String metaDataKey)
-
addTransientAppMetaData
public void addTransientAppMetaData(String metaDataKey, Object metaDataValue)
-
getName
public String getName()
Returns the registration name for this application- Overrides:
getName
in classModuleInfo
- Returns:
- the application registration name
-
getLibraries
public String getLibraries()
Returns the deployment time libraries for this application- Returns:
- the libraries
-
setLibraries
public void setLibraries(String libraries)
Sets the deployment time libraries for this application- Parameters:
libraries
- the libraries
-
getAppClassLoader
public ClassLoader getAppClassLoader()
Returns the application classloader for this application.- Returns:
- The application classloader for this application.
-
setAppClassLoader
public void setAppClassLoader(ClassLoader cLoader)
Sets the application classloader for this application- Parameters:
cLoader
- application classloader
-
getAppServiceLocator
public org.glassfish.hk2.api.ServiceLocator getAppServiceLocator()
Returns the application scoped ServiceLocator- Returns:
- The application scoped ServiceLocator
-
isJavaEEApp
public boolean isJavaEEApp()
Returns whether this application is a JavaEE application- Returns:
- the isJavaEEApp flag
-
setIsJavaEEApp
public void setIsJavaEEApp(List<EngineInfo> engineInfos)
Sets whether this application is a JavaEE application- Parameters:
engineInfos
- the engine info list
-
getSource
public ReadableArchive getSource()
Returns the directory where the application bits are located- Returns:
- the application bits directory
-
getModuleInfos
public Collection<ModuleInfo> getModuleInfos()
Returns the modules of this application- Returns:
- the modules of this application
-
getSniffers
public Collection<Sniffer> getSniffers()
Returns the list of sniffers that participated in loaded this application- Overrides:
getSniffers
in classModuleInfo
- Returns:
- array of sniffer that loaded the application's module
-
getEngineRefsForContainer
public <T extends Container> Collection<EngineRef> getEngineRefsForContainer(Class<T> type)
-
getSubContext
protected ExtendedDeploymentContext getSubContext(ModuleInfo info, ExtendedDeploymentContext context)
-
load
public void load(ExtendedDeploymentContext context, ProgressTracker tracker) throws Exception
- Overrides:
load
in classModuleInfo
- Throws:
Exception
-
start
public void start(ExtendedDeploymentContext context, ProgressTracker tracker) throws Exception
- Throws:
Exception
-
reload
public void reload(ExtendedDeploymentContext context, ProgressTracker tracker) throws Exception
- Throws:
Exception
-
initialize
public void initialize()
-
stop
public void stop(ExtendedDeploymentContext context, Logger logger)
- Overrides:
stop
in classModuleInfo
-
unload
public void unload(ExtendedDeploymentContext context)
- Overrides:
unload
in classModuleInfo
-
suspend
public boolean suspend(Logger logger)
- Overrides:
suspend
in classModuleInfo
-
resume
public boolean resume(Logger logger)
- Overrides:
resume
in classModuleInfo
-
reset
public void reset(ReadableArchive source)
-
clean
public void clean(ExtendedDeploymentContext context) throws Exception
- Overrides:
clean
in classModuleInfo
- Throws:
Exception
-
save
public void save(Application app) throws TransactionFailure, PropertyVetoException
Saves its state to the configuration. this method must be called within a transaction to the configured Application instance.- Parameters:
app
- the application being persisted- Throws:
TransactionFailure
PropertyVetoException
-
addModule
public void addModule(ModuleInfo info)
-
isLoaded
public boolean isLoaded()
- Overrides:
isLoaded
in classModuleInfo
-
-