See: Description
Interface | Description |
---|---|
RhinoConnection |
Rhino-specific connection interface.
|
RhinoVersion |
Class | Description |
---|---|
CompositeX509KeyManager |
Wrap multiple key managers to allow more than one keystore to be used.
|
CompositeX509TrustManager |
Wrap multiple trust managers to allow more than one truststore to be used.
|
ConnectionImpl |
Implementation class for connections to Rhino.
|
ProxyUtil |
Basic proxy utility methods.
|
RemoteHousekeeping |
Create proxies for Rhino housekeeping MBeans.
|
RemoteProfiles |
Create proxies for Profile-related MBeans, create new profiles, set attributes, etc.
|
RemoteProfiles.UncommittedProfile<T> |
Contains references and exposes utility methods needed to update and commit a newly-created profile.
|
RemoteUsage |
Create proxies for Usage-related MBeans and helper classes to read usage parameters.
|
RemoteUsage.Profiles |
Create proxies for Profile Table Usage MBeans and helper classes to read usage parameters.
|
RemoteUsage.Resources |
Create proxies for Resource Adaptor Entity Usage MBeans and helper classes to read usage parameters.
|
RemoteUsage.Sbbs |
Create proxies for SBB Usage MBeans and helper classes to read usage parameters.
|
RemoteUsage.Subsystems |
Create proxies for SLEE Subsystem Usage MBeans and helper classes to read usage parameters.
|
RemoteUsage.UsageNotificationManager |
Helps enabling/disabling notifications for usage parameters.
|
RemoteUsage.UsageReader |
Helps obtaining usage parameters by name.
|
RhinoConnectionFactory |
Factory class to create connections to Rhino.
|
RhinoManagement |
Create Rhino extension proxy instances for MBeans with well-known Object Names.
|
RhinoSsl | |
SleeManagement |
Create SLEE standard proxy instances for MBeans with well-known Object Names.
|
VersionImpl |
Enum | Description |
---|---|
ExecutionContext |
Defines execution contexts for MBean operations.
|
Exception | Description |
---|---|
ConnectionException |
Thrown to indicate connection failures.
|
IllegalExecutionContextException |
Thrown if a command could not be executed within the requested context.
|
Create remote management connections to Rhino and proxies for MBeans on the server.
The RhinoConnectionFactory
class is used to create connections to Rhino. The class has connect methods that allow connection parameters
to be specified in several different ways (see the class documentation for more details).
The objects returned by the connection factory implement RhinoConnection
, which
is a subinterface of MBeanServerConnection. The connection objects can therefore be used directly in other JMX
Remote API calls. Also, MBeanServerConnection objects obtained via other means (e.g., from a local MBeanServer)
can be used by the rest of the Rhino Remote library classes (but will obviously not have the extra features
described below).
If multiple servers are provided when creating a connection, they will be tried in the order given. Exceptions indicating a connection failure are only thrown when all servers are unreachable. If a previously active connection is found to have failed when attempting to execute a command, the other servers provided will be tried. The pending command will be executed if a connection can be made.
In some cases, it may be desirable to control whether or not a particular operation or set of operations is allowed
to failover to another node. This control is available via the Execution Context mechanism. See
RhinoConnection.setAllowedExecutionContext(ExecutionContext)
and ExecutionContext
.
If Rhino is configured to require SSL connections to the JMX-Remote interface (the default setting) then the SSL connection factory used by the JMX client must be provided with a keystore and a trust store, and a password for each. There are two ways of providing these settings. One is by setting system properties when starting the JVM that is running the JMX client:
-Djavax.net.ssl.keyStore=$RHINO_CLIENT_HOME/rhino-public.keystore -Djavax.net.ssl.keyStorePassword=xxxxxxxx \ -Djavax.net.ssl.trustStore=$RHINO_CLIENT_HOME/rhino-public.keystore -Djavax.net.ssl.trustStorePassword=xxxxxxxxThe other is to put these settings into a properties file or properties object, and use one of the connection factory methods that takes such a parameter. For example, in a properties file you could have the following lines:
javax.net.ssl.trustStore=rhino-public.keystore javax.net.ssl.trustStorePassword=xxxxxxxx javax.net.ssl.keyStore=rhino-public.keystore javax.net.ssl.keyStorePassword=xxxxxxxxand then create a connection as follows:
File propertiesFile = new File("remote.properties"); MBeanServerConnection connection = RhinoConnectionFactory.connect(propertiesFile);
Exceptions thrown by the connection factory methods generally will contain sufficient detail to determine the cause of any connection problems. If more fine-grained tracing is needed, then a PrintWriter can be provided to the connection factory, and all connection objects will write trace messages to it while trying to connect.
For examples of how to write connection trace messages to stdout or a Log4J logger, see
RhinoConnectionFactory.setLogWriter(PrintWriter)
.
The SleeManagement
class is used to create proxy instances for SLEE-standard MBeans with well-known Object Names. An MBeanServerConnection
must be obtained first, then one of the methods on this class can be called.
MBeanServerConnection connection = RhinoConnectionFactory.connect( ... ); SleeManagementMBean sleeManagement = SleeManagement.getSleeManagementMBean(connection);
The RhinoManagement
class is used to create proxy instances for Rhino-specific MBeans. An MBeanServerConnection
must be obtained first, then one of the methods on this class can be called.
MBeanServerConnection connection = RhinoConnectionFactory.connect( ... ); RhinoHousekeepingMBean rhinoHousekeeping = RhinoManagement.getRhinoHousekeepingMBean(connection);
The RemoteProfiles
class contains a number of utility methods to
greatly ease working with SLEE profile management operations. There are methods to: get proxies to ProfileMBeans;
create and commit a new profile; create an uncommitted profile that can have its attributes set before it is committed;
get attribute names, values and types. These methods are in addition to the standard management operations available
on ProfileProvisioningMBean
.
This can be done using the ProfileProvisioningMBean
, but RemoteProfiles
has a utility
method to check if a profile table exists:
ProfileSpecificationID profileSpecificationID = new ProfileSpecificationID("AddressProfileSpec", "javax.slee", "1.0"); if(RemoteProfiles.profileTableExists(connection, "TestProfileTable")) { profileProvisioning.removeProfileTable("TestProfileTable"); } profileProvisioning.createProfileTable(profileSpecificationID, "TestProfileTable");
Option 1: Supply the attributes when creating the profile and have it committed.
AttributeList list = new AttributeList(); list.add(new Attribute("Addresses", new Address[] { new Address(AddressPlan.IP, "127.0.0.1") })); RemoteProfiles.createCommittedProfile(connection, "TestProfileTable", "TestProfile1", list);
Option 2: Create the profile in the uncommitted state, and use a proxy to the Profile Management interface to set the attributes, then call commitProfile.
RemoteProfiles.UncommittedProfile<AddressProfileManagement> uncommittedProfile1; uncommittedProfile1 = RemoteProfiles.createUncommittedProfile(connection, "TestProfileTable", "TestProfile2", AddressProfileManagement.class); AddressProfileManagement addressProfile = uncommittedProfile1.getProfileProxy(); addressProfile.setAddresses(new Address[] { new Address(AddressPlan.IP, "127.0.0.2") }); uncommittedProfile1.getProfileMBean().commitProfile();
Option 3: Create the profile in the uncommitted state, and use the setAttribute method on the connection, then call commitProfile.
RemoteProfiles.UncommittedProfile uncommittedProfile2; uncommittedProfile2 = RemoteProfiles.createUncommittedProfile(connection, "TestProfileTable", "TestProfile3"); connection.setAttribute(uncommittedProfile2.getObjectName(), new Attribute("Addresses", new Address[] { new Address(AddressPlan.IP, "127.0.0.3") })); uncommittedProfile2.getProfileMBean().commitProfile();
Using the profile management interface as a proxy to the profile object allows set methods to be invoked directly:
ProfileMBean profileMBean = RemoteProfiles.getProfileMBean(connection, "TestProfileTable", profileName); profileMBean.editProfile(); AddressProfileManagement addressProfileManagement = RemoteProfiles.getProfile(connection, "TestProfileTable", profileName, AddressProfileManagement.class); addressProfileManagement.setAddresses(new Address[] { new Address(AddressPlan.IP, "127.0.1.1") }); profileMBean.commitProfile();
Using RemoteProfiles
methods to get the attribute names and types for a given profile table:
String[] names = RemoteProfiles.getAttributeNames(connection, "TestProfileTable"); System.out.println("Profile attributes:"); for (String name : names) { String type = RemoteProfiles.getAttributeType(connection, "TestProfileTable", name); System.out.println(" " + name + " (" + type + ")"); }
The RemoteUsage
class contains a number of utility methods to assist
working with MBeans related to SLEE Usage.
The RemoteHousekeeping
class methods to get a Rhino housekeeping
MBean for a cluster or for a particular node.