The properties available for use are defined in the {@link com.ibm.websphere.objectgrid.client.ClientProperties} interface.
There are two ways to configure client properties:
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