|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.adventnet.services.discovery.DiscoveryService
The DiscoveryService is the mbean responds to the discovery requests. JMX agent that needs to be discovered must instantiate and register this mbean. When startService is called it broadcasts discoveryPacket in the multicast group
| Field Summary | |
(package private) DiscoverySocket |
dsock
|
(package private) MBeanServer |
server
the MBeanServer |
(package private) java.util.Properties |
userData
|
| Constructor Summary | |
DiscoveryService()
Default constructor |
|
DiscoveryService(java.lang.String multicastGroup,
int multicastPort)
Constructor which takes multicast group and multicast port as parameters |
|
DiscoveryService(java.lang.String multicastGroup,
int multicastPort,
java.lang.String hostName)
Constructor which takes multicast group , multicast port and hostName as parameters |
|
| Method Summary | |
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 |
getMulticastGroup()
Gets the multicast group. |
int |
getMulticastPort()
gets the multicast port used by this discovery service. |
java.lang.Integer |
getState()
Returns the state, whether ON_STATE/OFF_STATE, of this service. |
int |
getTimeToLive()
Gets the time to live (hop count). |
java.util.Properties |
getUserData()
Gets the user defined data which will be sent in the discovery packet |
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. |
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)
Allows the MBean to perform any operations it needs before being registered in the MBean server. |
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 |
setHostAddress(java.lang.String host)
This method is used to set the host address on which this service is running. |
void |
setMulticastGroup(java.lang.String multicastGroup)
Sets the multicast group. |
void |
setMulticastPort(int multicastPort)
sets the multicast port used by this discovery service. |
void |
setMulticastPort(java.lang.Integer multicastPort)
sets the multicast port used by this discovery service. |
void |
setTimeToLive(int timeToLive)
Sets the time to live. |
void |
setTimeToLive(java.lang.Integer timeToLive)
Sets the time to live. |
void |
setUserData(java.util.Properties userData)
Sets the user defined data which will be sent in the discovery packet |
void |
startService()
Allows the service to get started. |
void |
stopService()
Allows the service to get stopped. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
DiscoverySocket dsock
transient MBeanServer server
java.util.Properties userData
| Constructor Detail |
public DiscoveryService()
public DiscoveryService(java.lang.String multicastGroup,
int multicastPort)
public DiscoveryService(java.lang.String multicastGroup,
int multicastPort,
java.lang.String hostName)
| Method Detail |
public MBeanInfo getMBeanInfo()
public void setHostAddress(java.lang.String host)
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 java.lang.String getMulticastGroup()
public void setMulticastGroup(java.lang.String multicastGroup)
throws java.lang.Exception
public int getMulticastPort()
public void setMulticastPort(int multicastPort)
throws java.lang.Exception
public void setMulticastPort(java.lang.Integer multicastPort)
throws java.lang.Exception
public int getTimeToLive()
public void setTimeToLive(int timeToLive)
public void setTimeToLive(java.lang.Integer timeToLive)
public java.util.Properties getUserData()
public void setUserData(java.util.Properties userData)
public void startService()
public void stopService()
public java.lang.Integer getState()
com.adventnet.adaptors.common.SimpleAdaptor.ON_STATE,
com.adventnet.adaptors.common.SimpleAdaptor.OFF_STATE
public ObjectName preRegister(MBeanServer server,
ObjectName name)
throws java.lang.Exception
server - The MBean server in which the MBean will be registered.name - The object name of the MBean. This name is null if
the name parameter to one of the createMBean or
registerMBean methods in the MBeanServer
interface is null. In that case, this method must return a
non-null ObjectName for the new MBean.name
parameter is not null, it will usually but not necessarily be
the returned value.MBeanRegistrationException or a RuntimeMBeanException.public 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.registrationDone - indicates whether the mbean is registered properly
with the server.
public void preDeregister()
throws java.lang.Exception
public void postDeregister()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||