|
IBM WebSphereTM eXtreme Scale, Release 8.6 API Specification |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.websphere.objectgrid.config.ObjectGridConfigFactory
public final class ObjectGridConfigFactory
This is the configuration factory for ObjectGrid configuration entities. Users are expected to use static methods of this factory to create ObjectGrid configuration objects.
Here is a list of static methods used to create configuration objects:
createObjectGridConfiguration(String)
: create an ObjectGridConfiguration objectcreateBackingMapConfiguration(String)
: create a BackingMapConfiguration
object by passing a backing map namecreateConfigProperty(ConfigPropertyType, String, String)
: create a ConfigProperty
objectcreatePlugin(PluginType, String)
: create a Plugin
objectBelow is an example of creating an ObjectGrid configuration.
A Plugin is added to the ObjectGridConfiguration
object:
com.ibm.websphere.objectgrid.plugins.ObjectGridEventListener
plugin.
A BackingMapConfiguration
called "myBackingMap" is then created and added to the ObjectGridConfiguration
.
This BackingMapConfiguration
also has an Evictor Plugin configured.
Once the ObjectGridConfiguration object has been created , it can be used to call either of these methods
com.ibm.websphere.objectgrid.ObjectGridManager.putOverrideObjectGridConfigurations(String, List)
com.ibm.websphere.objectgrid.ObjectGridManager.setOverrideObjectGridConfigurations(Map)
// Create an ObjectGridConfiguration object ObjectGridConfiguration ogConfig = ObjectGridConfigFactory.createObjectGridConfiguration(ogName); // create ObjectGridEventListener plugin Plugin eventListener = ObjectGridConfigFactory.createPlugin(PluginType.OBJECTGRID_EVENT_LISTENER,"com.ibm.test.MyOgEventListener"); // Add plugin to ObjectGridConfiguration object ogConfig.addPlugin(eventListener); // Create a BackingMapConfiguration object BackingMapConfiguration bmConfig = ObjectGridConfigFactory.createBackingMapConfiguration("mybackingMap"); // Add BackingMapConfiguration object to ObjectGridConfiguration object ogConfig.addBackingMapConfiguration(bmConfig); // Set the number of buckets to 1000 bmConfig.setNumberOfBuckets(1000); // Create a Evictor plugin for this backing map. Plugin evictor = ObjectGridConfigFactory.createPlugin( BackingMapConfiguration.PLUGIN_EVICTOR, com.acme.myEvictorImpl.class.getName()); // add Evictor Plugin to the BackingMapConfiguration bmConfig.addPlugin(evictor); // Create a ConfigProperty for the Evictor plugin ConfigProperty sizeProperty = ObjectGridConfigFactory.createConfigProperty( ConfigPropertyType.INT_PRIM, "size", "153"); // Add the ConfigProperty to the Evictor plugin evictor.setConfigProperty(sizeProperty);
ObjectGridConfiguration
,
BackingMapConfiguration
,
Plugin
,
ConfigProperty
Constructor Summary | |
---|---|
ObjectGridConfigFactory()
|
Method Summary | |
---|---|
static BackingMapConfiguration |
createBackingMapConfiguration(String backingMapConfigName)
Create a BackingMapConfiguration object |
static ConfigProperty |
createConfigProperty(ConfigPropertyType configPropType,
String name,
String value)
Create a ConfigPropety object for use on a Plugin. |
static ObjectGridConfiguration |
createObjectGridConfiguration(String objectGridConfigName)
Create an ObjectGridConfiguration object. |
static Plugin |
createOSGiServicePlugin(PluginType pluginType,
String osgiServiceName)
Create an OSGi Service Plugin for a BackingMapConfiguration or an ObjectGridConfiguration |
static Plugin |
createPlugin(PluginType pluginType,
String className)
Create a Plugin for a BackingMapConfiguration or an ObjectGridConfiguration |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ObjectGridConfigFactory()
Method Detail |
---|
public static Plugin createPlugin(PluginType pluginType, String className)
pluginType
- the PluginType.className
- of the Plugin implementation class to instantiate
PluginType.OBJECTGRID_EVENT_LISTENER
,
PluginType.TRANSACTION_CALLBACK
,
PluginType.COLLISION_ARBITER
,
PluginType.EVICTOR
,
PluginType.MAP_EVENT_LISTENER
,
PluginType.OBJECTGRID_LIFECYCLE_LISTENER
,
PluginType.MAP_LIFECYCLE_LISTENER
public static ObjectGridConfiguration createObjectGridConfiguration(String objectGridConfigName)
objectGridConfigName
- the name that will be assigned to this ObjectGridConfiguration object
public static BackingMapConfiguration createBackingMapConfiguration(String backingMapConfigName)
backingMapConfigName
- the name to assign to this BackingMapConfiguration
public static ConfigProperty createConfigProperty(ConfigPropertyType configPropType, String name, String value)
The Plugin should have a set method that corresponds to the name of this ConfigProperty.
The method must accept a parameter of the ConfigPropertyType that is specified on this ConfigProperty.
For example, if the name of this ConfigProperty is set to "size", and the type is
ConfigPropertyType.INT_PRIM
,
then the Plugin must have the method setSize(int). The value of the ConfigProperty will be passed
to the setter of the Plugin when an ObjectGrid is created based on this configuration.
configPropType
- ConfigPropertyType of the ConfigProperty. Part of the set method's signature, the type of parameter the set method requires. Validname
- of the ConfigProperty. It must correspond to the name of a set method on the Plugin.value
- of the ConfigProperty. This value will be passed to the set method on the Plugin.
ConfigPropertyType.STRING_JAVA_LANG
,
ConfigPropertyType.BOOLEAN_JAVA_LANG
,
ConfigPropertyType.BOOLEAN_PRIM
,
ConfigPropertyType.BYTE_JAVA_LANG
,
ConfigPropertyType.BYTE_PRIM
,
ConfigPropertyType.CHARACTER_JAVA_LANG
,
ConfigPropertyType.CHAR_PRIM
,
ConfigPropertyType.DOUBLE_JAVA_LANG
,
ConfigPropertyType.DOUBLE_PRIM
,
ConfigPropertyType.FLOAT_JAVA_LANG
,
ConfigPropertyType.FLOAT_PRIM
,
ConfigPropertyType.INTEGER_JAVA_LANG
,
ConfigPropertyType.INT_PRIM
,
ConfigPropertyType.LONG_JAVA_LANG
,
ConfigPropertyType.LONG_PRIM
,
ConfigPropertyType.SHORT_JAVA_LANG
public static Plugin createOSGiServicePlugin(PluginType pluginType, String osgiServiceName)
pluginType
- the PluginType.osgiServiceName
- the OSGi service name
PluginType.OBJECTGRID_EVENT_LISTENER
,
PluginType.TRANSACTION_CALLBACK
,
PluginType.COLLISION_ARBITER
,
PluginType.EVICTOR
,
PluginType.MAP_EVENT_LISTENER
,
PluginType.OBJECTGRID_LIFECYCLE_LISTENER
,
PluginType.MAP_LIFECYCLE_LISTENER
|
IBM WebSphereTM eXtreme Scale, Release 8.6 API Specification |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |