Application servers can use this interface to start an ObjectGrid container or catalog server in the current JVM.
In the following example we expect a catalog service is running on the localhost with the default listener port, 2809.
// Set initial server properties, in this case just the server name. ServerFactory.getServerProperties().setServerName("ObjectGridServer"); // First touch of getInstance initializes the server. Server server = ServerFactory.getInstance(); // Get the policy for the object grid we want to run. DeploymentPolicy policy = DeploymentPolicyFactory.createDeploymentPolicy( new File("deploymentPolicy.xml").toURL(), new File("objectGrid.xml").toURL()); // Start the container with the given object grid configuration. Container container = server.createContainer(policy); // Do something with it... // Now shut it down. container.teardown(); // Stop the server to bring down the process. server.stopServer();