See the WebSphere eXtreme Scale Wiki for links to eXtreme Scale Version 7.0 documentation.
If you log in
with your developerWorks ID, you can leave comments and feedback for the development team.
Issue the ServerFactory.getInstance method so that any JVM can host the ObjectGrid server run time. This method returns the server singleton and starts the server run time. You must set the server properties before you issue the getInstance method. Otherwise, any modifications that you make after you issue the method do not affect the run time.
Server server = ServerFactory.getInstance();
You can use several properties to configure the ObjectGrid server instance, which you can retrieve from the ServerFactory.getServerProperties method. The ServerProperties object is a singleton, therefore, each call to the getServerProperties method retrieves the same instance. All properties set at the first invocation of getInstance are used to initialize the server.
 | Setting Server Properties
You can set the server properties until the ServerFactory.getInstance is called for the first time. The first call of the getInstance method instantiates the ObjectGrid server, and reads all the configured properties. Setting the properties after creation has no effect. |
ServerProperties serverProperties = ServerFactory.getServerProperties();
serverProperties.setServerName("EmbeddedServerA");
serverProperties.setZoneName("EmbeddedZone1");
serverProperties.setCatalogServiceBootstrap("localhost:2809");
serverProperties.setListenerHost("host.local.domain");
serverProperties.setListenerPort(9010);
serverProperties.setMBeansEnabled(false);
Server server = ServerFactory.getInstance();
Embedding the catalog service
Any JVM setting that is flagged by the CatalogServerProperties.setCatalogServer method can host the catalog service for ObjectGrid. This method indicates to the ObjectGrid server run time to instantiate the catalog service when the server is started.
CatalogServerProperties catalogServerProperties = ServerFactory.getCatalogProperties();
catalogServerProperties.setCatalogServer(true);
Server server = ServerFactory.getInstance();
Embedding the ObjectGrid container
Issue the Server.createContainer method for any JVM to host multiple ObjectGrid containers.
Server server = ServerFactory.getInstance();
DeploymentPolicy policy = DeploymentPolicyFactory.createDeploymentPolicy(
new File("META-INF/embeddedDeploymentPolicy.xml").toURL(),
new File("META-INF/embeddedObjectGrid.xml").toURL());
Container container = server.createContainer(policy);
Self-contained server process
You can start all the services together, which is useful for development and practical in production. By starting the services together, a single process starts the catalog service, and some set of containers and run client connection logic, to sort out programming issues prior to deploying in a distributed environment.
CatalogServerProperties catalogServerProperties = ServerFactory.getCatalogProperties();
catalogServerProperties.setCatalogServer(true);
Server server = ServerFactory.getInstance();
DeploymentPolicy policy = DeploymentPolicyFactory.createDeploymentPolicy(
new File("META-INF/embeddedDeploymentPolicy.xml").toURL(),
new File("META-INF/embeddedObjectGrid.xml").toURL());
Container container = server.createContainer(policy);
Embedding ObjectGrid in WebSphere Application Server
The configuration for ObjectGrid is set up automatically when you install WebSphere Extended Deployment DataGrid in a WebSphere Application Server environment. You are not required to set any properties before you access the server to create a container.
Server server = ServerFactory.getInstance();
DeploymentPolicy policy = DeploymentPolicyFactory.createDeploymentPolicy(
new File("META-INF/embeddedDeploymentPolicy.xml").toURL(),
new File("META-INF/embeddedObjectGrid.xml").toURL());
Container container = server.createContainer(policy);
© Copyright IBM Corporation 2007,2009. All Rights Reserved.