IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

Package com.ibm.websphere.objectgrid.client

This package contains the primary interfaces and classes for setting behaviors for ObjectGrid clients for this process.

See:
          Description

Interface Summary
ClientProperties The set of properties used to define various preference for ObjectGrid clients.
 

Package com.ibm.websphere.objectgrid.client Description

This package contains the primary interfaces and classes for setting behaviors for ObjectGrid clients for this process.

Overview

The interfaces in this package should not be implemented directly but are used by the ClientClusterContext to set default behaviors for application clients for an ObjectGrid instance.

The properties available for use are defined in the ClientProperties interface.

There are two ways to configure client properties:

  1. Create a properties file named objectGridClient.properties and store it in the root of your classpath.
  2. Create a properties file on your file system in the directory where the client is started from named objectGridClient.properties.
  3. Create a properties file with any path and name and use the following system property to detect it: -Dcom.ibm.websphere.objectgrid.ClientProperties=<fileName>
  4. Create a properties file with any path and name and set load it programmatically and pass url to ClientClusterContext.getClientProperties(ogname, url).
  5. Programmatically define the properties the ClientProperties set methods.
In the following example we set the proximity routing defaults for all clients that use this ClientClusterContext:
    ObjectGridManager ogMgr = ObjectGridManagerFactory.getObjectGridManager();
    ClientClusterContext ccc = ogMgr.connect(...);
    ClientProperties props = ccc.getClientProperties("myOGName");
    props.setPreferLocalHost(true);
    props.setPreferLocalProcess(true);
    props.setPreferZones(new String[]{"New York", "Texas"});

    // The ClientProperites are now applied to the ObjectGrid client connection:
    ObjectGrid og=ogMgr.get(ccc, "myOGName");
The following example uses a custom client properties file:
    ClientClusterContext ccc = ogMgr.connect(...);
    URL clientPropsURL = Thread.currentThread().getContextClassLoader().getResource("etc/myObjectGridClient.properties");
    ClientProperties props = ccc.setClientProperties("myOGName", clientPropsURL);

    // The ClientProperites are now applied to the ObjectGrid client connection:
    ObjectGrid og=ogMgr.get(ccc, "myOGName");
The following file is an example of a properties file that matches the proceeding API:
    preferLocalProcess=true
    preferLocalhost=true
    preferZones=New York,Texas


IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

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