|
IBM WebSphere Extended Deployment (XD)TM, Release 6.1 ObjectGrid API Specification |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface ObjectGridManager
ObjectGridManager is responsible for creating or getting an ObjectGrid instance and getting the ObjectGrid configurations.
You can use the createObjectGrid(String, URL, boolean, boolean) method to create an ObjectGrid
instance. The createObjectGrid method gives you the choice of caching the created ObjectGrid instance.
If you choose to cache the instance, you cannot create an ObjectGrid with the same name unless you remove the
previously created ObjectGrid using the removeObjectGrid(String) method. A cached
ObjectGrid instance can later be retrieved using the getObjectGrid(String) method. The
createObjectGrid method also gives you the choice to validate the ObjectGrid XML configure or not.
You can also use other overloaded createObjectGrid and createObjectGrids methods to
create ObjectGrid instances. Please look at the individual methods for more details.
| Method Summary | |
|---|---|
ClientClusterContext |
connect(ClientSecurityConfiguration securityProps,
java.net.URL overRideObjectGridXml)
This method can be used only if an ObjectGrid client is colocated with an ObjectGrid server, especially in a J2EE environment with IBM WebSphere Application Server, which supports the embedded ObjectGrid server. |
ClientClusterContext |
connect(java.lang.String catalogServerAddresses,
ClientSecurityConfiguration securityProps,
java.net.URL overRideObjectGridXml)
Connects a client process to a remote ObjectGrid catalog server cluster. |
ClientClusterContext |
connect(java.lang.String clusterName,
HostPortConnectionAttributes[] attributes,
ClientSecurityConfiguration securityProps,
java.net.URL overRideObjectGridXml)
Connects a client process to a remote ObjectGrid server using an array of HostPortConnectionAttributes's. |
ClientClusterContext |
connect(java.lang.String clusterName,
java.lang.String host,
java.lang.String port,
ClientSecurityConfiguration securityProps,
java.net.URL overRideObjectGridXml)
Connects a client process to a remote ObjectGrid server using a host name and port number. |
ClientClusterContext |
connect(java.net.URL clusterConfigFile,
java.lang.String serverName,
ClientSecurityConfiguration securityProps,
java.net.URL overRideObjectGridXml)
Connects a client process to a remote ObjectGrid server using an ObjectGrid cluster configuration XML file. |
ObjectGrid |
createObjectGrid()
A simple factory method to return an instance of an ObjectGrid. |
ObjectGrid |
createObjectGrid(java.lang.String objectGridName)
Creates an ObjectGrid instance with the specified ObjectGrid name. |
ObjectGrid |
createObjectGrid(java.lang.String objectGridName,
boolean cacheInstance)
A simple factory method to return an instance of an ObjectGrid with the specified name. |
ObjectGrid |
createObjectGrid(java.lang.String objectGridName,
java.net.URL xmlFile)
Creates an ObjectGrid instance based on the specified ObjectGrid name and the ObjectGrid XML configuration file. |
ObjectGrid |
createObjectGrid(java.lang.String objectGridName,
java.net.URL xmlFile,
boolean enableXmlValidation,
boolean cacheInstance)
Creates an ObjectGrid instance based on the specified ObjectGrid name and the ObjectGrid XML configuration file. |
java.util.List |
createObjectGrids(java.net.URL xmlFile)
Creates all ObjectGrids that are found in the XML file. |
java.util.List |
createObjectGrids(java.net.URL xmlFile,
boolean enableXmlValidation,
boolean cacheInstances)
Processes an XML file and creates a List of ObjectGrid objects based upon the
ObjectGrid configurations in the XML file. |
boolean |
disconnect(ClientClusterContext context)
Disconnects a client process from an ObjectGrid server |
ObjectGrid |
getObjectGrid(ClientClusterContext context,
java.lang.String objectGridName)
Returns a client ObjectGrid instance corresponding to an ObjectGrid on an
ObjectGrid cluster. |
ObjectGrid |
getObjectGrid(java.lang.String objectGridName)
Returns a cached ObjectGrid instance by name. |
ObjectGridAdministrator |
getObjectGridAdministrator(ClientClusterContext context)
Return an ObjectGridAdministrator instance for this cluster. |
java.util.List |
getObjectGrids()
Gets a List of the ObjectGrid instances that have been previously cached. |
java.util.Map |
getOverrideObjectGridConfigurations()
Get the Map that is used to override client side ObjectGrid and BackingMap plugins. |
void |
putOverrideObjectGridConfigurations(java.lang.String clusterName,
java.util.List objectGridConfigList)
Put an entry into the Map that is used to override client side ObjectGrid and BackingMap plugins. |
void |
removeObjectGrid(java.lang.String objectGridName)
Removes an ObjectGrid from the cache of ObjectGrid instances. |
void |
removeObjectGrid(java.lang.String objectGridName,
boolean destroy)
Removes an ObjectGrid from the cache of ObjectGrid instances and optionally destroys its associated resources. |
void |
setOverrideObjectGridConfigurations(java.util.Map overrideMap)
Override ObjectGrid settings on client side ObjectGrids by passing in a Map where each key corresponds to a cluster name or domain name and each value is a List of ObjectGridConfiguration objects to be
overridden. |
void |
setTraceEnabled(boolean enabledFlag)
Enables or disables ObjectGrid trace for the JVM. |
void |
setTraceFileName(java.lang.String traceFileName)
Sets the trace output to go to a file instead of System.out. |
void |
setTraceSpecification(java.lang.String traceSpec)
Set the trace specification for the current JVM. |
| Method Detail |
|---|
ObjectGrid createObjectGrid()
throws ObjectGridException
ObjectGrid.
The created ObjectGrid returned by this method is assigned a unique name is not cached by the
ObjectGridManager. Use the ObjectGrid.setName(String) method to change the ObjectGrid name.
ObjectGridException - if any error occurs during the ObjectGrid creationObjectGrid,
ObjectGrid.setName(String)
ObjectGrid createObjectGrid(java.lang.String objectGridName,
boolean cacheInstance)
throws ObjectGridException
The instance of ObjectGrid created can optionally be cached. If an ObjectGrid with the specified name was previously created and cached, an ObjectGridException will be thrown.
objectGridName - the name of the ObjectGrid to be created. Must not be null.cacheInstance - true, if the ObjectGrid instance should be cached
java.lang.IllegalArgumentException - if objectGridName is null
ObjectGridException - if an ObjectGrid with this name has already been cached or any error occurs during the ObjectGrid
creation.ObjectGrid
ObjectGrid createObjectGrid(java.lang.String objectGridName)
throws ObjectGridException
The ObjectGrid instance created by this method will be cached. Invoking this method is equivalent to invoke
createObjectGrid(String, true)
objectGridName - the Name of the ObjectGrid instance to be created. Must not be null.
java.lang.IllegalArgumentException - if objectGridName is null
ObjectGridException - if an ObjectGrid with this name has already been cached, or any error occurs during the ObjectGrid
creationcreateObjectGrid(String, boolean),
ObjectGrid
ObjectGrid createObjectGrid(java.lang.String objectGridName,
java.net.URL xmlFile,
boolean enableXmlValidation,
boolean cacheInstance)
throws ObjectGridException
Creates an ObjectGrid instance based on the specified ObjectGrid name and the ObjectGrid XML configuration file.
An ObjectGrid instance is created for the ObjectGrid configuration in the XML file corresponding to the specified ObjectGrid name. If the specified ObjectGrid name cannot be found in the XML file, an exception will be thrown.
This returned ObjectGrid instance optionally can be cached.
If the URL is null, it will be simply ignored. In this case, this method behaves the same as the
createObjectGrid(String, boolean).
objectGridName - the Name of the ObjectGrid instance to be returned. Must not be null.xmlFile - a URL to a well formed xml file based on the ObjectGrid schema.enableXmlValidation - if true the XML is validatedcacheInstance - a boolean value indicating whether the returned ObjectGrid instance defined in the XML will be cached
or not. If true, the instance will be cached.
java.lang.IllegalArgumentException - if objectGridName is null
ObjectGridException - if an ObjectGrid with the same name has been previously cached, an ObjectGrid configuration with the
specified name can be found in the xml file, or any other error occurs during ObjectGrid creation.createObjectGrid(String, boolean),
ObjectGrid
java.util.List createObjectGrids(java.net.URL xmlFile,
boolean enableXmlValidation,
boolean cacheInstances)
throws ObjectGridException
List of ObjectGrid objects based upon the
ObjectGrid configurations in the XML file.
The returned ObjecGrid instances can be cached. An ObjectGridException will be thrown when attempting to cache a newly created ObjectGrid that has the same name as an ObjectGrid that has already been cached.
xmlFile - the file that defines an ObjectGrid or multiple ObjectGridsenableXmlValidation - setting to true will validate the XML file against the schemacacheInstances - set to true to cache all ObjectGrid instances created based on the file
ObjectGridException - if attempting to create and cache an ObjectGrid with the same name as an ObjectGrid that has already
been cached, or any other error occurs during ObjectGrid creationObjectGrid
java.util.List createObjectGrids(java.net.URL xmlFile)
throws ObjectGridException
ObjectGrids that are found in the XML file.
The XML file will be validated against the schema and each ObjectGrid instance that is created will be cached. An
ObjectGridException will be thrown when attempting to cache a newly created ObjectGrid that has the same name as
an ObjectGrid that has already been cached. Using this method is equivalent to calling the
createObjectGrids(URL, true, true) method.
xmlFile - The XML file to process. ObjectGrid(s) will be created based on the configurations what is in the
file.
ObjectGridException - if attempting to create and cache an ObjectGrid with the same name as an ObjectGrid that has already
been cached, or any other error occurs during ObjectGrid creationcreateObjectGrids(URL, boolean, boolean),
ObjectGrid
ObjectGrid createObjectGrid(java.lang.String objectGridName,
java.net.URL xmlFile)
throws ObjectGridException
Creates an ObjectGrid instance based on the specified ObjectGrid name and the ObjectGrid XML configuration file.
If there is no ObjectGrid with this name defined in the XML file, an ObjectGridException will be thrown. The XML
file will be validated against the schema and the ObjectGrid instance created will be cached. Using this method
is equivalent to calling the createObjectGrid(String, URL, true, true) method.
objectGridName - name of the ObjectGrid to create. This ObjectGrid should be defined in the XML file. Must not be
null.xmlFile - the XML file to process
java.lang.IllegalArgumentException - if objectGridName is null
ObjectGridException - if an ObjectGrid with the same name has been previously cached, an ObjectGrid configuration with the
specified name can be found in the xml file, or any other error occurs during ObjectGrid creation.createObjectGrid(String, URL, boolean, boolean),
ObjectGrid
void removeObjectGrid(java.lang.String objectGridName)
throws ObjectGridException
Invoking this method is equivalent to calling removeObjectGrid(String, false)
objectGridName - the name of the ObjectGrid instance to remove from the cache
ObjectGridException - if an ObjectGrid with the objectGridName was not found in the cacheremoveObjectGrid(String, boolean)
void removeObjectGrid(java.lang.String objectGridName,
boolean destroy)
throws ObjectGridException
objectGridName - the name of the ObjectGrid instance to remove from the cachedestroy - if true, destroy the objectgrid instance and its associated resources
ObjectGridException - if an ObjectGrid with the objectGridName was not found in the cacheObjectGrid.destroy()java.util.List getObjectGrids()
List of the ObjectGrid instances that have been previously cached.
This method returns null if no ObjectGrid instances have been cached.
null if there are no
cached ObjectGrid instancesObjectGrid getObjectGrid(java.lang.String objectGridName)
ObjectGrid instance by name.
This method returns null if no ObjectGrid with the specified name is currently
cached.
objectGridName - the cached objectgrid name.
void setTraceSpecification(java.lang.String traceSpec)
This operation is a replace operation, not an append operation. The specification should be of the form:
For example, ObjectGrid=all=enabled
traceSpec - the new trace specificationvoid setTraceFileName(java.lang.String traceFileName)
System.out.
The supplied file name can be relative to the working directory or a fully-qualified file name.
traceFileName - Name of trace filevoid setTraceEnabled(boolean enabledFlag)
Disabling trace improves the performance when ObjectGrid runs on processors whose L2 caches are not large enough
to contain the trace enabled code paths. If this is set to false, ObjectGrid trace is suppressed even if it is
enabled using setTraceSpecification(String). By default ObjectGrid trace is enabled.
enabledFlag - true to enable tracesetTraceSpecification(String)
ClientClusterContext connect(ClientSecurityConfiguration securityProps,
java.net.URL overRideObjectGridXml)
throws ConnectException
This method connects the client to the ObjectGrid Server which is running in the same JVM.
securityProps - client security configuration. The value can be null if not running in secure mode.overRideObjectGridXml - This parameter can be null. If it is not null, the client side
configuration of the ObjectGrid plugins are overridden with the ObjectGrid configuration using this
URL. If this parameter is null, client side ObjectGrid plugins can be
overridden by providing an overrideMap to setOverrideObjectGridConfigurations(Map) or
by calling putOverrideObjectGridConfigurations(String, List).
In cases where this parameter is not null, and overriding configuration objects have been provided to
the ObjectGridManager by setOverrideObjectGridConfigurations(Map) or
putOverrideObjectGridConfigurations(String, List), the configuration based on the XML
file will be used to override ObjectGrid settings. Overriding objects provided to
setOverrideObjectGridConfigurations(Map) or
putOverrideObjectGridConfigurations(String, List) will be ignored.
Not all plugins can be overridden. For details please see the ObjectGrid documentation.
ConnectException - if any error occurs connecting to the serverClientClusterContext,
ClientSecurityConfiguration
ClientClusterContext connect(java.lang.String catalogServerAddresses,
ClientSecurityConfiguration securityProps,
java.net.URL overRideObjectGridXml)
throws ConnectException
catalogServerAddresses - A concatenated list of host/port pairs belonging to the catalog servers in the form "host:port<,host:port>".
This list can be arbitrarily long and is used for bootstrapping only. The first viable address will be
used.securityProps - This parameter may be null if the client does not wish to establish a secure connection with the
server.overRideObjectGridXml - This parameter can be null. If it is not null, the client side
configuration of the ObjectGrid plugins are overridden with the ObjectGrid configuration using this
URL. If this parameter is null, client side ObjectGrid plugins can be
overridden by providing an overrideMap to setOverrideObjectGridConfigurations(Map) or by
calling putOverrideObjectGridConfigurations(String, List).
In cases where this parameter is not null, and overriding configuration objects have been provided to
the ObjectGridManager by setOverrideObjectGridConfigurations(Map) or
putOverrideObjectGridConfigurations(String, List), the configuration based on the XML
file will be used to override ObjectGrid settings. Overriding objects provided to
setOverrideObjectGridConfigurations(Map) or
putOverrideObjectGridConfigurations(String, List) will be ignored.
Not all plugins can be overridden. For details please see the ObjectGrid documentation.
ConnectException - If there is a problem connecting to the addresses given.
ClientClusterContext connect(java.net.URL clusterConfigFile,
java.lang.String serverName,
ClientSecurityConfiguration securityProps,
java.net.URL overRideObjectGridXml)
throws ConnectException
clusterConfigFile - A URL to the ObjectGrid cluster configuration XML file. This URL is the same file that is used to
start the servers. The cluster configuration is used to retrieve the servers' host and port
information. This parameter cannot be null.serverName - the name of the specific server to connect to. If the server name is not in the configuration, an
IllegalArgumentException is thrown. This parameter can be null, in
which case an attempt is made to connect to one of servers specified in the cluster configuration XML
file. If an attempt fails to connect to one, each defined server in the XML configuration is attempted
until a connection is established or the list is exhausted.securityProps - client security configuration. The value can be null if not running in secure mode.overRideObjectGridXml - This parameter can be null. If it is not null, the client side
configuration of the ObjectGrid plugins are overridden with the ObjectGrid configuration using this
URL. If this parameter is null, client side ObjectGrid plugins can be
overridden by providing an overrideMap to setOverrideObjectGridConfigurations(Map) or by
calling putOverrideObjectGridConfigurations(String, List).
In cases where this parameter is not null, and overriding configuration objects have been provided to
the ObjectGridManager by setOverrideObjectGridConfigurations(Map) or
putOverrideObjectGridConfigurations(String, List), the configuration based on the XML
file will be used to override ObjectGrid settings. Overriding objects provided to
setOverrideObjectGridConfigurations(Map) or
putOverrideObjectGridConfigurations(String, List) will be ignored.
Not all plugins can be overridden. For details please see the ObjectGrid documentation.
java.lang.IllegalArgumentException - if clusterConfigFile is null or serverName is not found in the cluster configuration.
ConnectException - if any error occurs connecting to the serverClientClusterContext,
ClientSecurityConfiguration
ClientClusterContext connect(java.lang.String clusterName,
HostPortConnectionAttributes[] attributes,
ClientSecurityConfiguration securityProps,
java.net.URL overRideObjectGridXml)
throws ConnectException
HostPortConnectionAttributes's.
clusterName - the name of the cluster to which this client will attach itselfattributes - host and port attribute pairs which are used sequentially to attempt to connect to the cluster. If an
attempt fails to connect to one server, each pair of host/port attribute is attempted until a
connection is established or the array is exhausted.securityProps - client security configuration. The value can be null if not running in secure mode.overRideObjectGridXml - This parameter can be null. If it is not null, the client side
configuration of the ObjectGrid plugins are overridden with the ObjectGrid configuration using this
URL. If this parameter is null, client side ObjectGrid plugins can be
overridden by providing an overrideMap to setOverrideObjectGridConfigurations(Map) or by
calling putOverrideObjectGridConfigurations(String, List).
In cases where this parameter is not null, and overriding configuration objects have been provided to
the ObjectGridManager by setOverrideObjectGridConfigurations(Map) or
putOverrideObjectGridConfigurations(String, List), the configuration based on the XML
file will be used to override ObjectGrid settings. Overriding objects provided to
setOverrideObjectGridConfigurations(Map) or
putOverrideObjectGridConfigurations(String, List) will be ignored.
Not all plugins can be overridden. For details please see the ObjectGrid documentation.
java.lang.IllegalArgumentException - if clusterName is null or either the host or port attribute in a
HostPortConnectionAttributes object is null.
ConnectException - if any error occurs connecting to the serverClientClusterContext,
ClientSecurityConfiguration,
HostPortConnectionAttributes
ClientClusterContext connect(java.lang.String clusterName,
java.lang.String host,
java.lang.String port,
ClientSecurityConfiguration securityProps,
java.net.URL overRideObjectGridXml)
throws ConnectException
clusterName - the name of the cluster to which this client will attach itselfhost - the host on which to connect toport - the client access port which is listeningsecurityProps - client security configuration. The value can be null if not running in secure mode.overRideObjectGridXml - This parameter can be null. If it is not null, the client side
configuration of the ObjectGrid plugins are overridden with the ObjectGrid configuration using this
URL. If this parameter is null, client side ObjectGrid plugins can be
overridden by providing an overrideMap to setOverrideObjectGridConfigurations(Map) or by
calling putOverrideObjectGridConfigurations(String, List).
In cases where this parameter is not null, and overriding configuration objects have been provided to
the ObjectGridManager by setOverrideObjectGridConfigurations(Map) or
putOverrideObjectGridConfigurations(String, List), the configuration based on the XML
file will be used to override ObjectGrid settings. Overriding objects provided to
setOverrideObjectGridConfigurations(Map) or
putOverrideObjectGridConfigurations(String, List) will be ignored.
Not all plugins can be overridden. For details please see the ObjectGrid documentation.
java.lang.IllegalArgumentException - if clusterName, host, or port is null
ConnectException - if any error occurs connecting to the serverClientClusterContext,
ClientSecurityConfigurationboolean disconnect(ClientClusterContext context)
context - the ClientClusterContext object returned from a previous call to one of the
connect methods The caller must guarantee this parameter is not null.
true if the disconnect was successful, false if the supplied context was
not connectedClientClusterContext
ObjectGrid getObjectGrid(ClientClusterContext context,
java.lang.String objectGridName)
ObjectGrid instance corresponding to an ObjectGrid on an
ObjectGrid cluster.
This method returns null if no ObjectGrid with the specified name is hosted on the
ObjectGrid cluster the provided ClientClusterContext is associated with.
context - the ClientClusterContext object returned from a previous call to one of the
connect methods The caller must guarantee this parameter is not null.objectGridName - the name of the requested client ObjectGrid
ClientClusterContext,
ObjectGridObjectGridAdministrator getObjectGridAdministrator(ClientClusterContext context)
ObjectGridAdministrator instance for this cluster. Each cluster requires the use of a
different ObjectGridAdministrator.
context - the ClientClusterContext object returned from a previous call to one of the
connect methods The caller must guarantee this parameter is not null.
ObjectGridAdministrator instance to perform administrative operations against an
ObjectGrid clusterClientClusterContext,
ObjectGridAdministratorvoid setOverrideObjectGridConfigurations(java.util.Map overrideMap)
List of ObjectGridConfiguration objects to be
overridden.
Client side configuration of ObjectGrid and BackingMap plugins are overridden using the ObjectGridConfiguration
values provided in the List. To override a Plugin, each ObjectGridConfiguration object must have a
name that matches the name of the ObjectGrid to be overridden. BackingMapConfiguration objects
must have the same name as a BackingMap and be associated with the properObjectGridConfiguration.
Not all plugins can be overridden. ObjectGrid plugins that can be overridden on the client side are TransactionCallback and ObjectGridEventListener. BackingMap plugins that can be overridden on the client side are Evictor and MapEventListener. Settings for the builtin Evictor can also be altered on the BackingMap. These settings include numberOfBuckets, timeToLive, and ttlEvictorType.
overrideMap - a Map that will be used to override ObjectGrid settings on the client side. To override client side
settings, each key of the Map must be a String with a value that corresponds to a cluster name or domain name. Each
value of the overrideMap must be a java.util.List. The List elements must be
ObjectGridConfiguration objects. Each call to a connect method with a clusterName that
matches a key in the overrideMap will result in the client side settings being overridden using the
List of ObjectGridConfiguration objects provided in the key's corresponding value. Pass in
null to clear an overrideMap that was previously set and thereby remove any overriding
settings from future connect calls.
java.lang.IllegalArgumentException - if any keys or values are null or if keys or values are of the wrong typeconnect(ClientSecurityConfiguration, URL),
connect(String, HostPortConnectionAttributes[], ClientSecurityConfiguration, URL),
connect(String, String, String, ClientSecurityConfiguration, URL),
connect(URL, String, ClientSecurityConfiguration, URL),
ObjectGridConfiguration,
BackingMapConfiguration
void putOverrideObjectGridConfigurations(java.lang.String clusterName,
java.util.List objectGridConfigList)
clusterName - to be used as a key in the Map used to override client side ObjectGrid plugins. If a connect method is
called with a matching clusterName, the client side ObjectGrid and BackingMap plugins can be
overridden using the objectGridConfigList.
In the dynamic environment, use the domain name to override ObjectGrid settings.objectGridConfigList - a List of ObjectGridConfiguration objects that will be used to override client side
ObjectGrid settings if a connect method is called with a cluster name that matches the clusterName on
this method
java.lang.IllegalArgumentException - if the clusterName or objectGridConfigList is nulljava.util.Map getOverrideObjectGridConfigurations()
setOverrideObjectGridConfigurations. The Map may also
have entries that were put there using the putOverrideObjectGridConfigurations method.
|
IBM WebSphere Extended Deployment (XD)TM, Release 6.1 ObjectGrid API Specification |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||