| IBM WebSphere Extended Deployment (XD)TM
Release 6.0 |
ObjectGridManager is responsible for creating or getting an ObjectGrid instance and getting the ObjectGrid configurations.
Users can use the method #createObjectGrid(String, URL, boolean, boolean) to create an ObjectGrid instance. Users can choose to cache the created ObjectGrid instance. If users want to cache the ObjectGrid instance, they cannot create an ObjectGrid with the same name again unless they remove the previous created ObjectGrid using #removeObjectGrid(String). Users can also choose to validate the XML or not.
Users can also use other overloaded createObjectGrid
and createObjectGrids
methods to create
ObjectGrid instances. Please look at individual methods for details.
Method Summary | |
---|---|
public
ObjectGrid | createObjectGrid()
A simple factory method to return an instance of an
Object Grid.
|
public
ObjectGrid | createObjectGrid(java.lang.String, boolean)
A simple factory method to return an instance of an ObjectGrid with the
specified name.
|
public
ObjectGrid | createObjectGrid(java.lang.String)
Create an ObjectGrid instance with the specified ObjectGrid name. The ObjectGrid .
|
public
ObjectGrid | createObjectGrid(java.lang.String, java.net.URL, boolean, boolean)
Create an ObjectGrid instance based on the specified ObjectGrid name and the XML file. |
public
List | createObjectGrids(java.net.URL, boolean, boolean)
Process an XML file and create a List of ObjectGrid objects based upon the file..
|
public
List | createObjectGrids(java.net.URL)
Create all ObjectGrids that are found in the XML file. The XML file will be .
|
public
ObjectGrid | createObjectGrid(java.lang.String, java.net.URL)
Process the XML file and create a single ObjectGrid instance with the objectGridName specified only if
an ObjectGrid with that name is found in the file.
|
public
void | removeObjectGrid(java.lang.String)
|
public
void | removeObjectGrid(java.lang.String, boolean)
|
public
List | getObjectGrids()
Get a List of the ObjectGrid instances that have been previously cached. Returns null.
|
public
ObjectGrid | getObjectGrid(java.lang.String)
Use this if a ObjectGrid already exists. It returns a cached ObjectGrid instance by name. .
|
public
void | setTraceSpecification(java.lang.String)
Use this method to set the trace specification for the current
JVM.
|
public
void | setTraceFileName(java.lang.String)
Use this method to have trace output to go file instead of System.out..
|
public
ClientClusterContext | connect(com.ibm.websphere.objectgrid.security.config.ClientSecurityConfiguration, java.net.URL)
This method can be used only if a client is co-located with objectgrid server,
especially in a J2EE environment with IBM WebSphere Application Server, which supports the
embedded objectgrid server.
|
public
ClientClusterContext | connect(java.net.URL, java.lang.String, com.ibm.websphere.objectgrid.security.config.ClientSecurityConfiguration, java.net.URL)
|
public
ClientClusterContext | connect(java.lang.String, com.ibm.websphere.objectgrid.HostPortConnectionAttributes[], com.ibm.websphere.objectgrid.security.config.ClientSecurityConfiguration, java.net.URL)
|
public
ClientClusterContext | connect(java.lang.String, java.lang.String, java.lang.String, com.ibm.websphere.objectgrid.security.config.ClientSecurityConfiguration, java.net.URL)
This allows client to connect to a Remote ObjectGrid
|
public
ObjectGrid | getObjectGrid(com.ibm.websphere.objectgrid.ClientClusterContext, java.lang.String)
Use this if a Remote ObjectGrid already exists. .
|
public
ObjectGridAdministrator | getObjectGridAdministrator(com.ibm.websphere.objectgrid.ClientClusterContext)
Return an ObjectGridAdministrator instance for this cluster. Each.
|
public
Cluster | getCluster(java.lang.String)
|
Method Detail |
public ObjectGrid createObjectGrid( | ) |
com.ibm.websphere.objectgrid.ObjectGridException
public ObjectGrid createObjectGrid( | String objectGridName , | boolean cacheInstance )
|
objectGridName
-
the name of the ObjectGrid to be created.
cacheInstance
-
true, if the ObjectGrid instance should be cached
com.ibm.websphere.objectgrid.ObjectGridException
public ObjectGrid createObjectGrid( | String objectGridName )
|
objectGridName
-
the Name of the ObjectGrid instance to be created.
com.ibm.websphere.objectgrid.ObjectGridException
public ObjectGrid createObjectGrid( | String objectGridName , | URL xmlFile ,
| boolean enableXmlValidation ,
| boolean cacheInstance )
|
Create an ObjectGrid instance based on the specified ObjectGrid name and the XML file. The ObjectGrid instance defined in the XML file with the specified ObjectGrid name will be created and returned. If such an ObjectGrid cannot be found in the xml file, an exception will be thrown.
This ObjecGrid instance can be cached.
If the URL is null, it will be simply ignored. In this case, this method behaves the same as #createObjectGrid(String, boolean).
ObjectGrid
objectGridName
-
the Name of the ObjectGrid instance to be returned. Must not be null.
xmlFile
-
a URL to a wellformed xml file based on the ObjectGrid schema.
enableXmlValidation
-
if true the XML is validated
cacheInstance
-
a boolean value indicating whether the ObjectGrid instance(s)
defined in the XML will be cached or not. If true, the instance(s) will be cached.
com.ibm.websphere.objectgrid.ObjectGridException
public List createObjectGrids( | URL xmlFile , | boolean enableXmlValidation ,
| boolean cacheInstances )
|
xmlFile
-
the file that defines an ObjectGrid or multiple ObjectGrids
enableXmlValidation
-
setting to true will validate the XML file against the schema
cacheInstances
-
set to true to cache all ObjectGrid instances created based on the file
com.ibm.websphere.objectgrid.ObjectGridException
public List createObjectGrids( | URL xmlFile )
|
xmlFile
-
The XML file to process. ObjectGrids will be created based on what is in the file.
com.ibm.websphere.objectgrid.ObjectGridException
public ObjectGrid createObjectGrid( | String objectGridName , | URL xmlFile )
|
objectGridName
-
name of the ObjectGrid to create. This ObjectGrid should be defined in the XML file.
xmlFile
-
the XML file to process
com.ibm.websphere.objectgrid.ObjectGridException
public void removeObjectGrid( | String objectGridName )
|
objectGridName
-
the name of the ObjectGrid instance to remove from the cache
com.ibm.websphere.objectgrid.ObjectGridException
public void removeObjectGrid( | String objectGridName , | boolean destroy )
|
objectGridName
-
the name of the ObjectGrid instance to remove from the cache
destroy
-
destroy the objectgrid instance and its associated resources
com.ibm.websphere.objectgrid.ObjectGridException
public List getObjectGrids( | ) |
public ObjectGrid getObjectGrid( | String objectGridName )
|
objectGridName
-
the cached objectgrid name.
public void setTraceSpecification( | String traceSpec )
|
For example, com.ibm.websphere.objectgrid.*=all=enabled
traceSpec
-
Trace specification
public void setTraceFileName( | String traceFileName )
|
traceFileName
-
Name of trace file
public ClientClusterContext connect( | ClientSecurityConfiguration securityProps , | URL overRideObjectGrid )
|
securityProps
-
It can be null if not running in secure mode.
overRideObjectGrid
-
xml. This parameter can be null. If it is not null, the client side configuration of objectgrid plugin is overridden.
Not all plugins can be overridden. For details please see the ObjectGrid documents
com.ibm.websphere.objectgrid.ConnectException
public ClientClusterContext connect( | URL clusterConfigFile , | String serverName ,
| ClientSecurityConfiguration securityProps ,
| URL overRideObjectGrid )
|
clusterConfigFile
-
A URL to the clusterConfig File. This is the same file that is used to start servers.
This is used to retrieve host port information. It cannot be null. If it is null IllegalArgumentException is thrown.
serverName
-
A String, the name of the specific server to connect to. If the server name is not in the configuration, 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
xml file. If an attempt fails to connect to one, another server is picked, It is done, until such time the list is exhausted.
overRideObjectGrid
-
xml. This parameter can be null. If it is not null, the client side configuration of objectgrid plugin is overridden.
Not all plugins can be overridden. For details please see the ObjectGrid documents
com.ibm.websphere.objectgrid.ConnectException
public ClientClusterContext connect( | String clusterName , | HostPortConnectionAttributes[] attributes ,
| ClientSecurityConfiguration securityProps ,
| URL overRideObjectGrid )
|
attributes
-
Host and Port pair attributes which are tried in sequential order to connect. If an attempt to connect fails to one server, the next pair of host/port
attribute is picked to re-try the connect.
securityProps
-
Security configuration. It can be null if security is not configured.
overRideObjectGrid
-
xml. This parameter can be null. If it is not null, the client side configuration of objectgrid plugin is overridden.
Not all plugins can be overridden. For details please see the ObjectGrid documents
com.ibm.websphere.objectgrid.ConnectException
public ClientClusterContext connect( | String clusterName , | String host ,
| String port ,
| ClientSecurityConfiguration securityProps ,
| URL overRideObjectGrid )
|
clusterName
-
The name of the cluster to which this client will attach iteself
host
-
The host on which to connect to
port
-
The clientAceess port which is listening.
securityProps
-
Security configuration. It can be null if security is not configured
overRideObjectGrid
-
xml. This parameter can be null. If it is not null, the client side configuration of objectgrid plugin is overridden.
Not all plugins can be overridden. For details please see the ObjectGrid documents
com.ibm.websphere.objectgrid.ConnectException
public ObjectGrid getObjectGrid( | ClientClusterContext context , | String objectGridName )
|
context
-
A unique cluster context, with which the client needs to
interact.
objectGridName
-
the cached objectgrid name.
public ObjectGridAdministrator getObjectGridAdministrator( | ClientClusterContext context )
|
context
-
A unique cluster context, with which the client needs to
interact.
public Cluster getCluster( | String name )
|
name
-
Name of the cluster
| IBM WebSphere Extended Deployment (XD)TM
Release 6.0 |