net.sf.sasl.distributed.lock.hazelcast
Class HazelcastInstanceFactoryBean

java.lang.Object
  extended by net.sf.sasl.distributed.lock.hazelcast.HazelcastInstanceFactoryBean
All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean, org.springframework.beans.factory.InitializingBean

public class HazelcastInstanceFactoryBean
extends Object
implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.FactoryBean, org.springframework.beans.factory.DisposableBean

Factory bean for creating a singleton hazelcast instance over a hazelcast configuration file. The hazelcast cluster member instance will be nicely shutdown, if the application context is going down.

Since:
0.0.1 (sasl-distributed-lock-library)
Author:
Philipp Förmer

Constructor Summary
HazelcastInstanceFactoryBean()
           
 
Method Summary
 void afterPropertiesSet()
           
 void destroy()
           
 com.hazelcast.config.GroupConfig getGroupConfig()
           
 Object getObject()
           
 Class<?> getObjectType()
           
 String getXmlConfigurationFile()
           
 boolean isSingleton()
           
 void setGroupConfig(com.hazelcast.config.GroupConfig groupConfig)
          Sets a hazelcast group configuration, which will override the hazelcast group configuration of the xmlConfigurationFile, if the group configuration is not null.
 void setXmlConfigurationFile(String xmlConfigurationFile)
          Sets the hazelcast xml configuration which will be used to create a new singleton hazelcast instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HazelcastInstanceFactoryBean

public HazelcastInstanceFactoryBean()
Method Detail

getXmlConfigurationFile

public String getXmlConfigurationFile()
Returns:
null or non null
Since:
0.0.1 (sasl-distributed-lock-library)
See Also:
setXmlConfigurationFile(String)

setXmlConfigurationFile

public void setXmlConfigurationFile(String xmlConfigurationFile)
Sets the hazelcast xml configuration which will be used to create a new singleton hazelcast instance. If the xmlConfigurationFile parameter is null, than the default hazelcast configuration file will be used.

Parameters:
xmlConfigurationFile - null or non null
Since:
0.0.1 (sasl-distributed-lock-library)

getGroupConfig

public com.hazelcast.config.GroupConfig getGroupConfig()
Returns:
null or non null
Since:
0.0.1 (sasl-distributed-lock-library)
See Also:
setGroupConfig(GroupConfig)

setGroupConfig

public void setGroupConfig(com.hazelcast.config.GroupConfig groupConfig)
Sets a hazelcast group configuration, which will override the hazelcast group configuration of the xmlConfigurationFile, if the group configuration is not null.

Parameters:
groupConfig - null or non null
Since:
0.0.1 (sasl-distributed-lock-library)

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception
Since:
0.0.1 (sasl-distributed-lock-library)
See Also:
InitializingBean.afterPropertiesSet()

getObject

public Object getObject()
                 throws Exception
Specified by:
getObject in interface org.springframework.beans.factory.FactoryBean
Throws:
Exception
Since:
0.0.1 (sasl-distributed-lock-library)
See Also:
FactoryBean.getObject()

getObjectType

public Class<?> getObjectType()
Specified by:
getObjectType in interface org.springframework.beans.factory.FactoryBean
Since:
0.0.1 (sasl-distributed-lock-library)
See Also:
FactoryBean.getObjectType()

isSingleton

public boolean isSingleton()
Specified by:
isSingleton in interface org.springframework.beans.factory.FactoryBean
Since:
0.0.1 (sasl-distributed-lock-library)
See Also:
FactoryBean.isSingleton()

destroy

public void destroy()
             throws Exception
Specified by:
destroy in interface org.springframework.beans.factory.DisposableBean
Throws:
Exception
Since:
0.0.1 (sasl-distributed-lock-library)
See Also:
DisposableBean.destroy()


Copyright © 2010. All Rights Reserved.