org.infinispan.spring.support.remote
Class InfinispanRemoteCacheManagerFactoryBean

java.lang.Object
  extended by org.infinispan.spring.AbstractRemoteCacheManagerFactory
      extended by org.infinispan.spring.support.remote.InfinispanRemoteCacheManagerFactoryBean
All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<RemoteCacheManager>, org.springframework.beans.factory.InitializingBean

public class InfinispanRemoteCacheManagerFactoryBean
extends AbstractRemoteCacheManagerFactory
implements org.springframework.beans.factory.FactoryBean<RemoteCacheManager>, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean

A FactoryBean for creating an Infinispan RemoteCacheManager instance.

Configuration

A RemoteCacheManager is configured through a Properties object. For an exhaustive list of valid properties to be used see RemoteCacheManager's javadocs. This FactoryBean provides means to either inject a user-defined Properties instance or to set the location of a properties file to load those properties from. Note that it is illegal to use both mechanisms simultaneously.

Alternatively or in combination with setting the location of a Properties file to load the configuration from, this FactoryBean provides (typed) setters for all configuration settings. Settings thus defined take precedence over those defined in the injected Properties instance. This flexibility enables users to use e.g. a company-wide Properties file containing default settings while simultaneously overriding select settings whenever special requirements warrant this.
Note that it is illegal to use setters in conjunction with injecting a Properties instance.

In addition to creating a RemoteCacheManager this FactoryBean does also control that RemoteCacheManagers's lifecycle by shutting it down when the enclosing Spring application context is closed. It is therefore advisable to always use this FactoryBean when creating a RemoteCacheManager.

Author:
Olaf Bergner
See Also:
RemoteCacheManager, destroy()

Field Summary
 
Fields inherited from class org.infinispan.spring.AbstractRemoteCacheManagerFactory
logger, startAutomatically
 
Constructor Summary
InfinispanRemoteCacheManagerFactoryBean()
           
 
Method Summary
 void afterPropertiesSet()
           
 void destroy()
          stop the RemoteCacheManager created by this factory.
 RemoteCacheManager getObject()
           
 Class<? extends RemoteCacheManager> getObjectType()
           
 boolean isSingleton()
          Always return true.
 
Methods inherited from class org.infinispan.spring.AbstractRemoteCacheManagerFactory
assertCorrectlyConfigured, configurationProperties, setAsyncExecutorFactory, setConfigurationProperties, setConfigurationPropertiesFileLocation, setForceReturnValues, setKeySizeEstimate, setMarshaller, setPingOnStartup, setRequestBalancingStrategy, setServerList, setStartAutomatically, setTcpNoDelay, setTransportFactory, setValueSizeEstimate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InfinispanRemoteCacheManagerFactoryBean

public InfinispanRemoteCacheManagerFactoryBean()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception
See Also:
InitializingBean.afterPropertiesSet()

getObject

public RemoteCacheManager getObject()
                             throws Exception
Specified by:
getObject in interface org.springframework.beans.factory.FactoryBean<RemoteCacheManager>
Throws:
Exception
See Also:
FactoryBean.getObject()

getObjectType

public Class<? extends RemoteCacheManager> getObjectType()
Specified by:
getObjectType in interface org.springframework.beans.factory.FactoryBean<RemoteCacheManager>
See Also:
FactoryBean.getObjectType()

isSingleton

public boolean isSingleton()
Always return true.

Specified by:
isSingleton in interface org.springframework.beans.factory.FactoryBean<RemoteCacheManager>
See Also:
FactoryBean.isSingleton()

destroy

public void destroy()
             throws Exception
stop the RemoteCacheManager created by this factory.

Specified by:
destroy in interface org.springframework.beans.factory.DisposableBean
Throws:
Exception
See Also:
DisposableBean.destroy()

-->

Copyright © 2011 JBoss, a division of Red Hat. All Rights Reserved.