org.gcube.smartgears.context.application
Class DefaultApplicationContext

java.lang.Object
  extended by org.gcube.smartgears.context.application.DefaultApplicationContext
All Implemented Interfaces:
ApplicationContext

public class DefaultApplicationContext
extends Object
implements ApplicationContext

Default ApplicationContext implementation.

Author:
Fabio Simeoni

Constructor Summary
DefaultApplicationContext(ApplicationContext context)
          Creates an instance by copying the configuration of another.
DefaultApplicationContext(ContainerContext container, javax.servlet.ServletContext sctx, ApplicationConfiguration configuration, org.gcube.common.events.Hub hub, ApplicationLifecycle lifecycle, Properties properties)
          Crates an intance with mandatory parameters
 
Method Summary
 javax.servlet.ServletContext application()
          Returns the servlet context of the application.
 ApplicationConfiguration configuration()
          Returns the configuration of the application.
 ContainerContext container()
          Returns the management context of the container.
 org.gcube.common.events.Hub events()
          Returns the event hub of the application
 ApplicationLifecycle lifecycle()
          Returns the lifecycle of the application.
 String name()
          Returns the name of the application.
 Persistence persistence()
          Returns the persistence manager of the application.
<T> T
profile(Class<T> type)
           
 Properties properties()
          Returns the properties of the application
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultApplicationContext

public DefaultApplicationContext(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 context
sctx - the servlet context
configuration - the configuration
hub - the event hub
lifecycle - the lifecycle
properties - 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: ApplicationContext
Returns the servlet context of the application.

Specified by:
application in interface ApplicationContext
Returns:
the context

container

public ContainerContext container()
Description copied from interface: ApplicationContext
Returns the management context of the container.

Specified by:
container in interface ApplicationContext
Returns:
the context

profile

public <T> T profile(Class<T> type)
Specified by:
profile in interface ApplicationContext

name

public String name()
Description copied from interface: ApplicationContext
Returns the name of the application.

Specified by:
name in interface ApplicationContext
Returns:
the name

configuration

public ApplicationConfiguration configuration()
Description copied from interface: ApplicationContext
Returns the configuration of the application.

Specified by:
configuration in interface ApplicationContext
Returns:
the configuration

lifecycle

public ApplicationLifecycle lifecycle()
Description copied from interface: ApplicationContext
Returns the lifecycle of the application.

Specified by:
lifecycle in interface ApplicationContext
Returns:
the lifecycle

events

public org.gcube.common.events.Hub events()
Description copied from interface: ApplicationContext
Returns the event hub of the application

Specified by:
events in interface ApplicationContext
Returns:
the hub

persistence

public Persistence persistence()
Description copied from interface: ApplicationContext
Returns the persistence manager of the application.

Specified by:
persistence in interface ApplicationContext
Returns:
the manager

properties

public Properties properties()
Description copied from interface: ApplicationContext
Returns the properties of the application

Specified by:
properties in interface ApplicationContext
Returns:
the properties


Copyright © 2013. All Rights Reserved.