|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.adventnet.adaptors.AbstractAdaptor
|
+--com.adventnet.adaptors.rmi.RMIAdaptor
This class acts as a JMX adaptor for RMI protocol.
It itself acts as a mbean for exposing the RMI properties. This class extends the SimpleAdaptor which provides the implementation of ServiceInfo interface and acts as the RMI server.
The port number of the service can be specified in the ObjectName with key-value pair as, port=1099(by default)
For example, to start the RMI server at 1150, you can specify the following object name:
| Inner classes inherited from class com.adventnet.adaptors.AbstractAdaptor |
AbstractAdaptor.ProcessNotification |
| Field Summary | |
java.rmi.registry.Registry |
registry
|
| Fields inherited from class com.adventnet.adaptors.AbstractAdaptor |
handleNotificationinNewThread,
notifications,
port,
processnotification,
state |
| Constructor Summary | |
RMIAdaptor()
The NoArg constructor used to initialize the RMIAdaptor in forming the MBeanInfo and getting the reference of the MBeanServer using the MBeanServer.findJMXAgent(...) method. |
|
| Method Summary | |
void |
addUser(com.adventnet.agent.security.UserContext userContext)
Adds the users specified in the UserContext to the Authentication List of the Adaptor |
void |
bind()
Binds the rmi server at the specified port |
void |
destroyAdaptor()
Removes the RemoteMBeanServerImpl from the RMI runtime |
void |
enableAuthentication(boolean authenticate)
Enables Authentication for the RMI Adaptor |
void |
enableAuthorisation(boolean authorise)
Enables Authorisation for the RMI Adaptor |
ObjectName |
getAdaptorObjectName()
Returns the ObjectName of this adaptor with which it has been registered with the MBeanServer. |
java.lang.Object |
getAttribute(java.lang.String attribute)
Gets the value of a specific attribute of this MBean. |
AttributeList |
getAttributes(java.lang.String[] attributes)
Enables the values of several attributes of this MBean. |
MBeanInfo |
getMBeanInfo()
This method discovers the attributes and operations this MBean exposes for management. |
java.lang.String |
getObjectName()
Returns the ObjectName of this adaptor with which it has been registered with the MBeanServer. |
java.lang.String |
getPersistantName()
Returns the name of the serialized file in which the User Context details are stored. |
java.lang.String |
getProtocol()
Gets the protocol supported by this adaptor. |
void |
instantiateAdaptor()
Instantiates the RMI Adaptor |
java.lang.Object |
invoke(java.lang.String actionName,
java.lang.Object[] params,
java.lang.String[] signature)
Invokes an action on the original MBean associated with this MBean. |
boolean |
isNotificationEnabled(Notification notification)
Invoked before sending the specified notification to the listener |
void |
postDeregister()
Allows this MBean to perform any operations needed after having been de-registered in the MBeanServer. |
void |
postRegister(java.lang.Boolean registrationDone)
Allows this MBean to perform any operations needed after having been registered in the MBeanServer or after the registration has failed. |
void |
preDeregister()
Allows this MBean to perform any operations it needs before being de-registered by the MBeanServer. |
ObjectName |
preRegister(MBeanServer server,
ObjectName name)
This method is an implementation of MBeanRegistration interface. |
void |
processNotification(Notification notification,
java.lang.Object handback)
Invoked when an JMX notification occurs. |
void |
removeUser(com.adventnet.agent.security.UserContext userContext)
Removes the users specified in the UserContext from the Authentication List of the Adaptor |
void |
setAttribute(Attribute attribute)
Sets the value of a specific attribute of this MBean. |
AttributeList |
setAttributes(AttributeList attributes)
Sets the values of several attributes of this MBean. |
void |
setPersistantName(java.lang.String fileName)
Sets the name of the serialized file in which the User Context details are stored |
void |
setPort(java.lang.Integer port)
|
void |
setSSLEnabled(boolean bool)
|
void |
setSSLProps(java.util.Hashtable hash)
|
java.rmi.registry.Registry |
startRegistry(int port)
Starts the RMI Registry at the specified port. |
void |
unbind()
Allows the service to get stopped. |
| Methods inherited from class com.adventnet.adaptors.AbstractAdaptor |
addNotificationListener,
changeState,
getAdaptorVersion,
getHost,
getNotificationInfo,
getPort,
getState,
getStateInString,
handleNotification,
isActive,
isSecure,
removeNotificationListener,
setPort,
startService,
stopService |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
public java.rmi.registry.Registry registry
| Constructor Detail |
public RMIAdaptor()
| Method Detail |
public void setPort(java.lang.Integer port)
throws java.lang.Exception
public void setSSLEnabled(boolean bool)
public void setSSLProps(java.util.Hashtable hash)
public void setPersistantName(java.lang.String fileName)
fileName - The name of the file in which the User Context details are to be storedpublic java.lang.String getPersistantName()
public MBeanInfo getMBeanInfo()
public java.lang.Object getAttribute(java.lang.String attribute)
throws AttributeNotFoundException,
MBeanException,
ReflectionException
attribute - A String specifying the name of the
attribute to be retrieved.public AttributeList getAttributes(java.lang.String[] attributes)
attributes - A list of attributes to be retrieved.
public java.lang.Object invoke(java.lang.String actionName,
java.lang.Object[] params,
java.lang.String[] signature)
throws MBeanException,
ReflectionException
actionName - The name of the action to be invoked.params - An array containing the parameters to be
set when the action is invokedsignature - An array containing the signature of
the action. The class objects will be loaded using the
same class loader as the one used for loading the MBean
on which the action was invoked.public void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException
attribute - The identification of the attribute to
be set and the value it is to be set to.public AttributeList setAttributes(AttributeList attributes)
attributes - A list of attributes: The identification
of the attributes to be set and the values they are to be set to.public ObjectName preRegister(MBeanServer server, ObjectName name) throws java.lang.Exception
This method is called by the MBeanServer before this mbean getting registered with the server. If the passed objectName is invalid, the returned objectName is taken as valid name to get registered with the server.
The service gets actually started only inside this method at the specified port mentioned in the key "port". If the key "port" is absent, then the service(RMI) gets started at the default port 1099. The rmiregistry gets created here. If suppose the port is already occupied, the server creation gets failed. If registry is started already in the same port, inorder to use it ,the already started registry should have the classpath to the rmi skeleton files.
server - The MBeanServer in which the MBean will be registered.name - The object name of the MBean.
public void instantiateAdaptor()
throws java.lang.InstantiationException
public void bind()
public java.rmi.registry.Registry startRegistry(int port)
throws java.rmi.RemoteException
port - The port at which the RMI Registry has to be startedpublic void postRegister(java.lang.Boolean registrationDone)
registrationDone - Indicates whether or not the MBean has been successfully
registered in the MBeanServer. The value false means that either the registration phase
has failed.
public void preDeregister()
throws java.lang.Exception
public void postDeregister()
public void unbind()
public ObjectName getAdaptorObjectName()
public java.lang.String getObjectName()
public java.lang.String getProtocol()
public void enableAuthentication(boolean authenticate)
authenticate - Enables Authentication if the value is truepublic void enableAuthorisation(boolean authorise)
authorise - Enables Authentication if the value is truepublic void addUser(com.adventnet.agent.security.UserContext userContext)
userContext - The UserContext which has to be addedpublic void removeUser(com.adventnet.agent.security.UserContext userContext)
userContext - The UserContext which has to be removedpublic void destroyAdaptor()
RemoteMBeanServerImplpublic boolean isNotificationEnabled(Notification notification)
notification - - The notification to be sent.public void processNotification(Notification notification, java.lang.Object handback)
notification - - The notification.handback - - An opaque object which helps the listener to associate information
regarding the MBean emitter. This object was passed to the MBean during the
addListener call and resend, without modification, to the listener. The MBean object
should to use or modify the object.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||