com.hazelcast.config
Class Config

java.lang.Object
  extended by com.hazelcast.config.Config
Direct Known Subclasses:
ClasspathXmlConfig, FileSystemXmlConfig, InMemoryXmlConfig, UrlXmlConfig

public class Config
extends Object

Contains all the configuration to start a HazelcastInstance. A Config can be created programmatically, but can also be configured using XML, see XmlConfigBuilder. Config instances can be shared between threads, but should not be modified after they are used to create HazelcastInstances.


Constructor Summary
Config()
           
Config(String instanceName)
           
 
Method Summary
 Config addExecutorConfig(ExecutorConfig executorConfig)
          Adds a new ExecutorConfig by name
 Config addJobTrackerConfig(JobTrackerConfig jobTrackerConfig)
           
 Config addListConfig(ListConfig listConfig)
           
 Config addListenerConfig(ListenerConfig listenerConfig)
           
 Config addMapConfig(MapConfig mapConfig)
           
 Config addMultiMapConfig(MultiMapConfig multiMapConfig)
           
 Config addQueueConfig(QueueConfig queueConfig)
           
 Config addSemaphoreConfig(SemaphoreConfig semaphoreConfig)
          Adds a new SemaphoreConfig by name
 Config addSetConfig(SetConfig setConfig)
           
 Config addTopicConfig(TopicConfig topicConfig)
           
 Config addWanReplicationConfig(WanReplicationConfig wanReplicationConfig)
           
 ExecutorConfig findExecutorConfig(String name)
           
 JobTrackerConfig findJobTrackerConfig(String name)
           
 ListConfig findListConfig(String name)
           
 MapConfig findMapConfig(String name)
           
 MultiMapConfig findMultiMapConfig(String name)
           
 QueueConfig findQueueConfig(String name)
           
 SemaphoreConfig findSemaphoreConfig(String name)
           
 SetConfig findSetConfig(String name)
           
 TopicConfig findTopicConfig(String name)
           
 ClassLoader getClassLoader()
          Returns the class-loader that will be used in serialization.
 File getConfigurationFile()
           
 URL getConfigurationUrl()
           
 ExecutorConfig getExecutorConfig(String name)
          Returns the ExecutorConfig for the given name
 Map<String,ExecutorConfig> getExecutorConfigs()
           
 GroupConfig getGroupConfig()
           
 String getInstanceName()
           
 JobTrackerConfig getJobTrackerConfig(String name)
           
 Map<String,JobTrackerConfig> getJobTrackerConfigs()
           
 String getLicenseKey()
           
 ListConfig getListConfig(String name)
           
 Map<String,ListConfig> getListConfigs()
           
 List<ListenerConfig> getListenerConfigs()
           
 ManagedContext getManagedContext()
           
 ManagementCenterConfig getManagementCenterConfig()
           
 MapConfig getMapConfig(String name)
           
 Map<String,MapConfig> getMapConfigs()
           
 MemberAttributeConfig getMemberAttributeConfig()
           
 MultiMapConfig getMultiMapConfig(String name)
           
 Map<String,MultiMapConfig> getMultiMapConfigs()
           
 NetworkConfig getNetworkConfig()
           
 PartitionGroupConfig getPartitionGroupConfig()
           
 Properties getProperties()
           
 String getProperty(String name)
           
 QueueConfig getQueueConfig(String name)
           
 Map<String,QueueConfig> getQueueConfigs()
           
 SecurityConfig getSecurityConfig()
           
 SemaphoreConfig getSemaphoreConfig(String name)
          Returns the SemaphoreConfig for the given name
 Collection<SemaphoreConfig> getSemaphoreConfigs()
          Returns the collection of semaphore configs.
 SerializationConfig getSerializationConfig()
           
 ServicesConfig getServicesConfig()
           
 SetConfig getSetConfig(String name)
           
 Map<String,SetConfig> getSetConfigs()
           
 TopicConfig getTopicConfig(String name)
           
 Map<String,TopicConfig> getTopicConfigs()
           
 ConcurrentMap<String,Object> getUserContext()
           
 WanReplicationConfig getWanReplicationConfig(String name)
           
 Map<String,WanReplicationConfig> getWanReplicationConfigs()
           
 boolean isCompatible(Config config)
           
static boolean nameMatches(String name, String pattern)
           
 Config setClassLoader(ClassLoader classLoader)
          Sets the class-loader to be used during de-serialization and as context class-loader of Hazelcast internal threads.
 Config setConfigurationFile(File configurationFile)
           
 Config setConfigurationUrl(URL configurationUrl)
           
 Config setExecutorConfigs(Map<String,ExecutorConfig> executorConfigs)
           
 Config setGroupConfig(GroupConfig groupConfig)
           
 Config setInstanceName(String instanceName)
           
 Config setJobTrackerConfigs(Map<String,JobTrackerConfig> jobTrackerConfigs)
           
 Config setLicenseKey(String licenseKey)
           
 Config setListConfigs(Map<String,ListConfig> listConfigs)
           
 Config setListenerConfigs(List<ListenerConfig> listenerConfigs)
           
 Config setManagedContext(ManagedContext managedContext)
           
 Config setManagementCenterConfig(ManagementCenterConfig managementCenterConfig)
           
 Config setMapConfigs(Map<String,MapConfig> mapConfigs)
           
 void setMemberAttributeConfig(MemberAttributeConfig memberAttributeConfig)
           
 Config setMultiMapConfigs(Map<String,MultiMapConfig> multiMapConfigs)
           
 Config setNetworkConfig(NetworkConfig networkConfig)
           
 Config setPartitionGroupConfig(PartitionGroupConfig partitionGroupConfig)
           
 Config setProperties(Properties properties)
           
 Config setProperty(String name, String value)
           
 Config setQueueConfigs(Map<String,QueueConfig> queueConfigs)
           
 Config setSecurityConfig(SecurityConfig securityConfig)
           
 Config setSemaphoreConfigs(Map<String,SemaphoreConfig> semaphoreConfigs)
           
 Config setSerializationConfig(SerializationConfig serializationConfig)
           
 Config setServicesConfig(ServicesConfig servicesConfig)
           
 Config setSetConfigs(Map<String,SetConfig> setConfigs)
           
 Config setTopicConfigs(Map<String,TopicConfig> mapTopicConfigs)
           
 Config setUserContext(ConcurrentMap<String,Object> userContext)
           
 Config setWanReplicationConfigs(Map<String,WanReplicationConfig> wanReplicationConfigs)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Config

public Config()

Config

public Config(String instanceName)
Method Detail

getClassLoader

public ClassLoader getClassLoader()
Returns the class-loader that will be used in serialization.

If null, then thread context class-loader will be used instead.

Returns:
the class-loader

setClassLoader

public Config setClassLoader(ClassLoader classLoader)
Sets the class-loader to be used during de-serialization and as context class-loader of Hazelcast internal threads.

If not set (or set to null); thread context class-loader will be used in required places.

Default value is null.

Parameters:
classLoader - class-loader to be used during de-serialization
Returns:
Config instance

getProperty

public String getProperty(String name)

setProperty

public Config setProperty(String name,
                          String value)

getMemberAttributeConfig

public MemberAttributeConfig getMemberAttributeConfig()

setMemberAttributeConfig

public void setMemberAttributeConfig(MemberAttributeConfig memberAttributeConfig)

getProperties

public Properties getProperties()

setProperties

public Config setProperties(Properties properties)

getInstanceName

public String getInstanceName()

setInstanceName

public Config setInstanceName(String instanceName)

getGroupConfig

public GroupConfig getGroupConfig()

setGroupConfig

public Config setGroupConfig(GroupConfig groupConfig)

getNetworkConfig

public NetworkConfig getNetworkConfig()

setNetworkConfig

public Config setNetworkConfig(NetworkConfig networkConfig)

findMapConfig

public MapConfig findMapConfig(String name)

getMapConfig

public MapConfig getMapConfig(String name)

addMapConfig

public Config addMapConfig(MapConfig mapConfig)

getMapConfigs

public Map<String,MapConfig> getMapConfigs()
Returns:
the mapConfigs

setMapConfigs

public Config setMapConfigs(Map<String,MapConfig> mapConfigs)
Parameters:
mapConfigs - the mapConfigs to set

findQueueConfig

public QueueConfig findQueueConfig(String name)

getQueueConfig

public QueueConfig getQueueConfig(String name)

addQueueConfig

public Config addQueueConfig(QueueConfig queueConfig)

getQueueConfigs

public Map<String,QueueConfig> getQueueConfigs()

setQueueConfigs

public Config setQueueConfigs(Map<String,QueueConfig> queueConfigs)

findListConfig

public ListConfig findListConfig(String name)

getListConfig

public ListConfig getListConfig(String name)

addListConfig

public Config addListConfig(ListConfig listConfig)

getListConfigs

public Map<String,ListConfig> getListConfigs()

setListConfigs

public Config setListConfigs(Map<String,ListConfig> listConfigs)

findSetConfig

public SetConfig findSetConfig(String name)

getSetConfig

public SetConfig getSetConfig(String name)

addSetConfig

public Config addSetConfig(SetConfig setConfig)

getSetConfigs

public Map<String,SetConfig> getSetConfigs()

setSetConfigs

public Config setSetConfigs(Map<String,SetConfig> setConfigs)

findMultiMapConfig

public MultiMapConfig findMultiMapConfig(String name)

getMultiMapConfig

public MultiMapConfig getMultiMapConfig(String name)

addMultiMapConfig

public Config addMultiMapConfig(MultiMapConfig multiMapConfig)

getMultiMapConfigs

public Map<String,MultiMapConfig> getMultiMapConfigs()

setMultiMapConfigs

public Config setMultiMapConfigs(Map<String,MultiMapConfig> multiMapConfigs)

findTopicConfig

public TopicConfig findTopicConfig(String name)

getTopicConfig

public TopicConfig getTopicConfig(String name)

addTopicConfig

public Config addTopicConfig(TopicConfig topicConfig)

getTopicConfigs

public Map<String,TopicConfig> getTopicConfigs()
Returns:
the topicConfigs

setTopicConfigs

public Config setTopicConfigs(Map<String,TopicConfig> mapTopicConfigs)
Parameters:
mapTopicConfigs - the topicConfigs to set

findExecutorConfig

public ExecutorConfig findExecutorConfig(String name)

getExecutorConfig

public ExecutorConfig getExecutorConfig(String name)
Returns the ExecutorConfig for the given name

Parameters:
name - name of the executor config
Returns:
ExecutorConfig

addExecutorConfig

public Config addExecutorConfig(ExecutorConfig executorConfig)
Adds a new ExecutorConfig by name

Parameters:
executorConfig - executor config to add
Returns:
this config instance

getExecutorConfigs

public Map<String,ExecutorConfig> getExecutorConfigs()

setExecutorConfigs

public Config setExecutorConfigs(Map<String,ExecutorConfig> executorConfigs)

findSemaphoreConfig

public SemaphoreConfig findSemaphoreConfig(String name)

getSemaphoreConfig

public SemaphoreConfig getSemaphoreConfig(String name)
Returns the SemaphoreConfig for the given name

Parameters:
name - name of the semaphore config
Returns:
SemaphoreConfig

addSemaphoreConfig

public Config addSemaphoreConfig(SemaphoreConfig semaphoreConfig)
Adds a new SemaphoreConfig by name

Parameters:
semaphoreConfig - semaphore config to add
Returns:
this config instance

getSemaphoreConfigs

public Collection<SemaphoreConfig> getSemaphoreConfigs()
Returns the collection of semaphore configs.

Returns:
collection of semaphore configs.

setSemaphoreConfigs

public Config setSemaphoreConfigs(Map<String,SemaphoreConfig> semaphoreConfigs)

getWanReplicationConfig

public WanReplicationConfig getWanReplicationConfig(String name)

addWanReplicationConfig

public Config addWanReplicationConfig(WanReplicationConfig wanReplicationConfig)

getWanReplicationConfigs

public Map<String,WanReplicationConfig> getWanReplicationConfigs()

setWanReplicationConfigs

public Config setWanReplicationConfigs(Map<String,WanReplicationConfig> wanReplicationConfigs)

findJobTrackerConfig

public JobTrackerConfig findJobTrackerConfig(String name)

getJobTrackerConfig

public JobTrackerConfig getJobTrackerConfig(String name)

addJobTrackerConfig

public Config addJobTrackerConfig(JobTrackerConfig jobTrackerConfig)

getJobTrackerConfigs

public Map<String,JobTrackerConfig> getJobTrackerConfigs()

setJobTrackerConfigs

public Config setJobTrackerConfigs(Map<String,JobTrackerConfig> jobTrackerConfigs)

getManagementCenterConfig

public ManagementCenterConfig getManagementCenterConfig()

setManagementCenterConfig

public Config setManagementCenterConfig(ManagementCenterConfig managementCenterConfig)

getServicesConfig

public ServicesConfig getServicesConfig()

setServicesConfig

public Config setServicesConfig(ServicesConfig servicesConfig)

getSecurityConfig

public SecurityConfig getSecurityConfig()

setSecurityConfig

public Config setSecurityConfig(SecurityConfig securityConfig)

addListenerConfig

public Config addListenerConfig(ListenerConfig listenerConfig)

getListenerConfigs

public List<ListenerConfig> getListenerConfigs()

setListenerConfigs

public Config setListenerConfigs(List<ListenerConfig> listenerConfigs)

getSerializationConfig

public SerializationConfig getSerializationConfig()

setSerializationConfig

public Config setSerializationConfig(SerializationConfig serializationConfig)

getPartitionGroupConfig

public PartitionGroupConfig getPartitionGroupConfig()

setPartitionGroupConfig

public Config setPartitionGroupConfig(PartitionGroupConfig partitionGroupConfig)

getManagedContext

public ManagedContext getManagedContext()

setManagedContext

public Config setManagedContext(ManagedContext managedContext)

getUserContext

public ConcurrentMap<String,Object> getUserContext()

setUserContext

public Config setUserContext(ConcurrentMap<String,Object> userContext)

getConfigurationUrl

public URL getConfigurationUrl()
Returns:
the configurationUrl

setConfigurationUrl

public Config setConfigurationUrl(URL configurationUrl)
Parameters:
configurationUrl - the configurationUrl to set

getConfigurationFile

public File getConfigurationFile()
Returns:
the configurationFile

setConfigurationFile

public Config setConfigurationFile(File configurationFile)
Parameters:
configurationFile - the configurationFile to set

getLicenseKey

public String getLicenseKey()

setLicenseKey

public Config setLicenseKey(String licenseKey)

nameMatches

public static boolean nameMatches(String name,
                                  String pattern)

isCompatible

public boolean isCompatible(Config config)
Parameters:
config -
Returns:
true if config is compatible with this one, false if config belongs to another group
Throws:
RuntimeException - if map, queue, topic configs are incompatible

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2014 Hazelcast, Inc.. All Rights Reserved.