public class SpringBasedCoherenceSession extends Object implements org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener<org.springframework.context.event.ApplicationContextEvent>
Spring-based Applications will typically use this to access resources (NamedCaches) provided by Coherence. Using this class allows Spring to both inject values into Coherence and Coherence to request Beans from Spring, all without requiring the use of static member variables or methods.
Typically developers will instantiate an instance of a session to share across their application from with in their application configuration class. ie: the class(es) annotated with @Configuration
For Example:
| Constructor and Description |
|---|
SpringBasedCoherenceSession()
Constructs a
SpringBasedCoherenceSession that will
auto-detect the cache configuration. |
SpringBasedCoherenceSession(String cacheConfigURI)
Constructs a
SpringBasedCoherenceSession using the specified
cache configuration. |
| Modifier and Type | Method and Description |
|---|---|
com.tangosol.net.NamedCache |
getCache(String name)
Acquire the specified
NamedCache. |
com.tangosol.util.ResourceRegistry |
getResourceRegistry()
Obtain the
ResourceRegistry for the SpringBasedCoherenceSession. |
com.tangosol.net.Service |
getService(String name)
Acquire the specified
Service. |
void |
onApplicationEvent(org.springframework.context.event.ApplicationContextEvent event) |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
public SpringBasedCoherenceSession()
SpringBasedCoherenceSession that will
auto-detect the cache configuration.public SpringBasedCoherenceSession(String cacheConfigURI)
SpringBasedCoherenceSession using the specified
cache configuration.cacheConfigURI - the URI of the cache configurationpublic com.tangosol.net.NamedCache getCache(String name)
NamedCache.name - the name of the cacheNamedCachepublic com.tangosol.net.Service getService(String name)
Service.name - the name of the ServiceServicepublic com.tangosol.util.ResourceRegistry getResourceRegistry()
ResourceRegistry for the SpringBasedCoherenceSession.ResourceRegistrypublic void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansExceptionpublic void onApplicationEvent(org.springframework.context.event.ApplicationContextEvent event)
onApplicationEvent in interface org.springframework.context.ApplicationListener<org.springframework.context.event.ApplicationContextEvent>Copyright © 2017. All rights reserved.