|
Oracle® Coherence Java API Reference Release 12.1.2.0.3 E26043-02 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.application.ContainerAdapter
public class ContainerAdapter
ContainerAdapter
is a facility intended for use by application servers to host Coherence applications. This facility manages the application life cycle and configuration.
The application descriptor file (coherence-application.xml) contains the location of a cache configuration file and (optionally) a POF configuration file. It may also specify the name of a ConfigurableCacheFactory
class to be used to create caches instead of the system-wide default (Note that this class must implement ExtensibleConfigurableCacheFactory
).
After creating an instance of ContainerAdapter
. the container should call activate()
to start the application and deactivate()
to stop it.
Nested Class Summary | |
---|---|
static class |
ContainerAdapter.ApplicationScopeResolver The ContainerAdapter.ApplicationScopeResolver is a ScopeResolver typically used to make sure the Coherence Services are scoped to the name passed in the constructor. |
protected class |
ContainerAdapter.ContainerCacheFactoryBuilder ContainerCacheFactoryBuilder creates a ConfigurableCacheFactory instance using the knowledge from this ContainerAdapter instance. |
static class |
ContainerAdapter.DefaultContext The ContainerAdapter.DefaultContext represents the context for an application. |
static class |
ContainerAdapter.DefaultExtendedContext The ContainerAdapter.DefaultContext represents the context for an application. |
Field Summary | |
---|---|
protected static java.lang.String |
CACHE_URI_DEFAULT Internally used "default" URI identifier. |
protected ContainerAdapter.ContainerCacheFactoryBuilder |
m_builder The ContainerAdapter.ContainerCacheFactoryBuilder used to create a ConfigurableCacheFactory for the application. |
protected Context |
m_context The ContainerAdapter.DefaultContext for the application. |
protected boolean |
m_fActivated Indicates whether the ContainerAdapter has been activated or not. |
protected ConfigurableCacheFactory |
m_factory The ConfigurableCacheFactory for the application. |
protected boolean |
m_fExclusiveMonitor Indicates whether the ServiceMonitor has been exclusively created for this ContainerAdapter. |
protected LifecycleListener |
m_listener The LifecycleListener used for lifecycle callbacks to the application. |
protected java.lang.ClassLoader |
m_loader The ClassLoader for the application. |
protected java.lang.ClassLoader |
m_loaderCtx The caller's thread context ClassLoader . |
protected java.util.Map |
m_mapStartedServices |
protected java.lang.String |
m_sAppDescriptorURI The URI to the coherence-application.xml file. |
protected java.lang.String |
m_sAppName The name of the application. |
protected ScopeResolver |
m_scopeResolver The ScopeResolver to use. |
protected ServiceMonitor |
m_serviceMonitor The ServiceMonitor to use. |
protected XmlElement |
m_xmlAppDescriptor The XmlElement representing the application descriptor. |
Constructor Summary | |
---|---|
ContainerAdapter(java.lang.ClassLoader loader, java.lang.String sAppDescriptorURI, java.lang.String sAppName) Construct the ContainerAdapter. |
|
ContainerAdapter(java.lang.ClassLoader loader, java.lang.String sAppDescriptorURI, java.lang.String sAppName, CacheFactoryBuilder builder, ScopeResolver scopeResolver, XmlElement xmlAppDescriptor, ServiceMonitor serviceMonitor) Construct the ContainerAdapter. |
|
ContainerAdapter(java.lang.ClassLoader loader, java.lang.String sAppDescriptorURI, java.lang.String sAppName, XmlElement xmlAppDescriptor) Construct the ContainerAdapter. |
Method Summary | |
---|---|
void |
activate() Initialize and start the application that is hosted by this ContainerAdapter . |
void |
associateWithClassLoader(java.lang.ClassLoader[] aClassLoaders) Associates the application hosted by this ContainerAdapter with specified ClassLoader s. |
void |
deactivate() Deactivate the application hosted by this ContainerAdapter . |
void |
deactivate(boolean fShutdown) Deactivate the application hosted by this ContainerAdapter . |
protected void |
ensureContextClassLoader() Ensure that the thread context ClassLoader is set to the ContainerAdapter ClassLoader ; save the current thread context ClassLoader if necessary. |
protected static XmlElement |
extractFactoryConfig(XmlElement xmlAppDescriptor) Extract the XmlElement representing the factory for the ConfigurableCacheFactory instance. |
java.lang.ClassLoader |
getContextClassLoader() Return the ClassLoader used by this ContainerAdapter. |
protected void |
restoreContextClassLoader() Restore the thread context ClassLoader for the caller. |
Field Detail |
---|
protected static final java.lang.String CACHE_URI_DEFAULT
protected final ServiceMonitor m_serviceMonitor
ServiceMonitor
to use.protected ContainerAdapter.ContainerCacheFactoryBuilder m_builder
ContainerAdapter.ContainerCacheFactoryBuilder
used to create a ConfigurableCacheFactory
for the application.protected ConfigurableCacheFactory m_factory
ConfigurableCacheFactory
for the application.protected java.lang.ClassLoader m_loader
ClassLoader
for the application.protected java.lang.String m_sAppDescriptorURI
protected XmlElement m_xmlAppDescriptor
XmlElement
representing the application descriptor.protected java.lang.String m_sAppName
protected ScopeResolver m_scopeResolver
ScopeResolver
to use.protected LifecycleListener m_listener
LifecycleListener
used for lifecycle callbacks to the application.protected Context m_context
ContainerAdapter.DefaultContext
for the application.protected java.lang.ClassLoader m_loaderCtx
ClassLoader
.protected boolean m_fActivated
ContainerAdapter
has been activated or not.protected boolean m_fExclusiveMonitor
protected java.util.Map m_mapStartedServices
Constructor Detail |
---|
public ContainerAdapter(java.lang.ClassLoader loader, java.lang.String sAppDescriptorURI, java.lang.String sAppName)
loader
- the ClassLoader
for the applicationsAppDescriptorURI
- the URI to coherence-application.xmlsAppName
- the name of the applicationpublic ContainerAdapter(java.lang.ClassLoader loader, java.lang.String sAppDescriptorURI, java.lang.String sAppName, XmlElement xmlAppDescriptor)
loader
- the ClassLoader
for the applicationsAppDescriptorURI
- the URI to coherence-application.xmlsAppName
- the name of the applicationxmlAppDescriptor
- the XmlElement
containing the application descriptor; if not null it will be used instead of the configuration specified by sAppDescriptorURIpublic ContainerAdapter(java.lang.ClassLoader loader, java.lang.String sAppDescriptorURI, java.lang.String sAppName, CacheFactoryBuilder builder, ScopeResolver scopeResolver, XmlElement xmlAppDescriptor, ServiceMonitor serviceMonitor)
loader
- the ClassLoader
for the applicationsAppDescriptorURI
- the URI to the application configuration descriptorsAppName
- the name of the applicationbuilder
- the CacheFactoryBuilder
to usescopeResolver
- the ScopeResolver
to use for services used by this applicationxmlAppDescriptor
- the XmlElement
containing the application descriptor; if not null it will be used instead of the configuration specified by sAppDescriptorURIserviceMonitor
- the ServiceMonitor
to use for the applicationMethod Detail |
---|
public void activate()
ContainerAdapter
. If activate throws an exception, the caller is NOT required to call deactivate()
.java.lang.IllegalStateException
- if the application has already been activatedpublic void deactivate()
ContainerAdapter
. This method will shutdown any resources / Coherence services that were used by the application.java.lang.IllegalStateException
- if the application is not activepublic void deactivate(boolean fShutdown)
ContainerAdapter
. If fShutdown
is true shutdown any resources / Coherence services that were used by the application otherwise clear local references.fShutdown
- whether to shutdown the resources, incl. any services, that were started as a part of this applicationjava.lang.IllegalStateException
- if the application is not activepublic void associateWithClassLoader(java.lang.ClassLoader[] aClassLoaders)
ContainerAdapter
with specified ClassLoader
s.aClassLoaders
- an array of ClassLoader
s to associate this adapter withpublic java.lang.ClassLoader getContextClassLoader()
protected static XmlElement extractFactoryConfig(XmlElement xmlAppDescriptor)
XmlElement
representing the factory for the ConfigurableCacheFactory
instance.xmlAppDescriptor
- the application descriptor XML elementXmlElement
representing the factory or null if no element exists.protected void ensureContextClassLoader()
ClassLoader
is set to the ContainerAdapter
ClassLoader
; save the current thread context ClassLoader
if necessary.protected void restoreContextClassLoader()
ClassLoader
for the caller.
|
Oracle® Coherence Java API Reference Release 12.1.2.0.3 E26043-02 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |