Class DefaultApplicationContext
- java.lang.Object
-
- org.gcube.smartgears.context.application.DefaultApplicationContext
-
- All Implemented Interfaces:
ApplicationContext
public class DefaultApplicationContext extends Object implements ApplicationContext
DefaultApplicationContextimplementation.- Author:
- Fabio Simeoni
-
-
Constructor Summary
Constructors Constructor Description DefaultApplicationContext(String id, ContainerContext container, javax.servlet.ServletContext sctx, ApplicationConfiguration configuration, org.gcube.common.events.Hub hub, ApplicationLifecycle lifecycle, Properties properties)Crates an intance with mandatory parametersDefaultApplicationContext(ApplicationContext context)Creates an instance by copying the configuration of another.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.servlet.ServletContextapplication()Returns the servlet context of the application.ApplicationConfigurationconfiguration()Returns the configuration of the application.ContainerContextcontainer()Returns the management context of the container.org.gcube.common.events.Hubevents()Returns the event hub of the applicationStringid()ApplicationLifecyclelifecycle()Returns the lifecycle of the application.Stringname()Returns the name of the application.Persistencepersistence()Returns the persistence manager of the application.<T> Tprofile(Class<T> type)Propertiesproperties()Returns the properties of the application
-
-
-
Constructor Detail
-
DefaultApplicationContext
public DefaultApplicationContext(String id, ContainerContext container, javax.servlet.ServletContext sctx, ApplicationConfiguration configuration, org.gcube.common.events.Hub hub, ApplicationLifecycle lifecycle, Properties properties)
Crates an intance with mandatory parameters- Parameters:
container- the container contextsctx- the servlet contextconfiguration- the configurationhub- the event hublifecycle- the lifecycleproperties- the properties
-
DefaultApplicationContext
public DefaultApplicationContext(ApplicationContext context)
Creates an instance by copying the configuration of another.- Parameters:
context- the other instance
-
-
Method Detail
-
application
public javax.servlet.ServletContext application()
Description copied from interface:ApplicationContextReturns the servlet context of the application.- Specified by:
applicationin interfaceApplicationContext- Returns:
- the context
-
container
public ContainerContext container()
Description copied from interface:ApplicationContextReturns the management context of the container.- Specified by:
containerin interfaceApplicationContext- Returns:
- the context
-
profile
public <T> T profile(Class<T> type)
- Specified by:
profilein interfaceApplicationContext
-
name
public String name()
Description copied from interface:ApplicationContextReturns the name of the application.- Specified by:
namein interfaceApplicationContext- Returns:
- the name
-
configuration
public ApplicationConfiguration configuration()
Description copied from interface:ApplicationContextReturns the configuration of the application.- Specified by:
configurationin interfaceApplicationContext- Returns:
- the configuration
-
lifecycle
public ApplicationLifecycle lifecycle()
Description copied from interface:ApplicationContextReturns the lifecycle of the application.- Specified by:
lifecyclein interfaceApplicationContext- Returns:
- the lifecycle
-
events
public org.gcube.common.events.Hub events()
Description copied from interface:ApplicationContextReturns the event hub of the application- Specified by:
eventsin interfaceApplicationContext- Returns:
- the hub
-
persistence
public Persistence persistence()
Description copied from interface:ApplicationContextReturns the persistence manager of the application.- Specified by:
persistencein interfaceApplicationContext- Returns:
- the manager
-
properties
public Properties properties()
Description copied from interface:ApplicationContextReturns the properties of the application- Specified by:
propertiesin interfaceApplicationContext- Returns:
- the properties
-
id
public String id()
- Specified by:
idin interfaceApplicationContext
-
-