IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

com.ibm.websphere.objectgrid.config
Class ObjectGridConfigFactory

java.lang.Object
  extended by com.ibm.websphere.objectgrid.config.ObjectGridConfigFactory

public final class ObjectGridConfigFactory
extends Object

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:

Below 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

to set configuration objects, prior to connecting.

 // 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);
 

Since:
WAS XD 6.0.1.2, XC10
See Also:
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

ObjectGridConfigFactory

public ObjectGridConfigFactory()
Method Detail

createPlugin

public static Plugin createPlugin(PluginType pluginType,
                                  String className)
Create a Plugin for a BackingMapConfiguration or an ObjectGridConfiguration

Parameters:
pluginType - the PluginType.
className - of the Plugin implementation class to instantiate
Returns:
a Plugin instance
See Also:
PluginType.OBJECTGRID_EVENT_LISTENER, PluginType.TRANSACTION_CALLBACK, PluginType.COLLISION_ARBITER, PluginType.EVICTOR, PluginType.MAP_EVENT_LISTENER, PluginType.OBJECTGRID_LIFECYCLE_LISTENER, PluginType.MAP_LIFECYCLE_LISTENER

createObjectGridConfiguration

public static ObjectGridConfiguration createObjectGridConfiguration(String objectGridConfigName)
Create an ObjectGridConfiguration object.

Parameters:
objectGridConfigName - the name that will be assigned to this ObjectGridConfiguration object
Returns:
the ObjectGridConfiguration object

createBackingMapConfiguration

public static BackingMapConfiguration createBackingMapConfiguration(String backingMapConfigName)
Create a BackingMapConfiguration object

Parameters:
backingMapConfigName - the name to assign to this BackingMapConfiguration
Returns:
the BackingMapConfiguration object

createConfigProperty

public static ConfigProperty createConfigProperty(ConfigPropertyType configPropType,
                                                  String name,
                                                  String value)
Create a ConfigPropety object for use on a Plugin.

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.

Parameters:
configPropType - ConfigPropertyType of the ConfigProperty. Part of the set method's signature, the type of parameter the set method requires. Valid
name - 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.
Returns:
the ConfigProperty object
See Also:
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

createOSGiServicePlugin

public static Plugin createOSGiServicePlugin(PluginType pluginType,
                                             String osgiServiceName)
Create an OSGi Service Plugin for a BackingMapConfiguration or an ObjectGridConfiguration

Parameters:
pluginType - the PluginType.
osgiServiceName - the OSGi service name
Returns:
a Plugin instance
Since:
7.1.1
See Also:
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

© Copyright International Business Machines Corp 2005,2012. All rights reserved.