com.sun.jaw.impl.agent.services.cascading
Class RemoteAgent

java.lang.Object
  |
  +--com.sun.jaw.impl.agent.services.cascading.RemoteAgent

public class RemoteAgent
extends java.lang.Object
implements java.io.Serializable, FrameworkListenerMO, ActivatableIf

This class implements the cascading agent service.

Cascading agents enable you to implement a hierarchy of master agents and subagents.The m-beans in a subagent is mirrored in the master agent. A master agent can contain more than one remote agent, but must contain one remote agent for each subagent it communicates with.

When instantiating the remote agent, the following properties can be specified in the object name or non-default constructor:

See Also:
AdaptorMO, Serialized Form

Constructor Summary
RemoteAgent()
          Constructs a RemoteAgent.
RemoteAgent(java.lang.String host, java.lang.String adpName, java.lang.String protocol, int port)
          Constructs a RemoteAgent.
 
Method Summary
 void deleteCmf()
          Unregisters all the objects cascaded by the remote agent.
 java.lang.String getAdpName()
          Getter for the "AdpName" property.
 java.lang.String getClassVersion()
          Returns the version of this class.
 java.lang.Boolean getConnected()
          Getter for the "Connected" property.
 java.lang.String getHost()
          Getter for the "Host" property.
 AdaptorMO getMOFactory()
          Getter for the "MOFactory" property.
 java.lang.Integer getNbOfRemoteObjects()
          Getter for the "NbOfRemoteObjects" property.
 java.lang.Integer getPort()
          Getter for the "Port" property.
 java.lang.String getProtocol()
          Getter for the "Protocol" property.
 java.lang.String getServerAdpName()
          Getter for the "ServerAdpName" property.
 void handleFrameworkEvent(FrameworkEventMO ev)
          Processes a framework event emitted by the core management framework.
 void initCmf(Framework cmf, ObjectName name, boolean db, ModificationList list)
          Initializes the remote agent.
 boolean isActive()
          Tests if the RemoteAgent is active.
 void performSetup(java.lang.Object param)
          Configures the Adaptor.
 void performStart()
          Activates the RemoteAgent service.
 void performStop()
          Deactivates the RemoteAgent service.
 void setServerAdpName(java.lang.String servName)
          Setter for the "ServerAdpName" property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteAgent

public RemoteAgent()
Constructs a RemoteAgent.

Initializes a newly created RemoteAgent with the following default values:


RemoteAgent

public RemoteAgent(java.lang.String host,
                   java.lang.String adpName,
                   java.lang.String protocol,
                   int port)
Constructs a RemoteAgent.

In order to initialize the remote agent, implementation names of the different services required by the core management framework must be provided.

Parameters:
host - name of the host of the remote agent.
adpName - name of the client adaptor to connect to the remote agent.
protocol - the connection protocol.
port - the connection port number.
Method Detail

initCmf

public void initCmf(Framework cmf,
                    ObjectName name,
                    boolean db,
                    ModificationList list)
             throws InstanceAlreadyExistException
Initializes the remote agent.

The method declares the object to the core management framework.
For internal use only.

Parameters:
agent - The core management framework to register the service with.
name - Object name containing configuration information.
db - Indicates if persistent storage is required.
list - The modification list to use for setting up parameters.
Throws:
InstanceAlreadyExistException - The m-bean is already registered in the repository.

getMOFactory

public AdaptorMO getMOFactory()
Getter for the "MOFactory" property.
Returns:
the current value of the "MOFactory" property.

getHost

public java.lang.String getHost()
Getter for the "Host" property.
Returns:
the current value of the "Host" property.

getAdpName

public java.lang.String getAdpName()
Getter for the "AdpName" property.
Returns:
the current value of the "AdpName" property.

setServerAdpName

public void setServerAdpName(java.lang.String servName)
Setter for the "ServerAdpName" property.

getServerAdpName

public java.lang.String getServerAdpName()
Getter for the "ServerAdpName" property.
Returns:
the current value of the "ServerAdpName" property.

getProtocol

public java.lang.String getProtocol()
Getter for the "Protocol" property. The method is compliant with the Bean design pattern.
Returns:
the current value of the "Protocol" property.

getPort

public java.lang.Integer getPort()
Getter for the "Port" property.
Returns:
the current value of the "Port" property.

getConnected

public java.lang.Boolean getConnected()
Getter for the "Connected" property.
Returns:
the current value of the "Connected" property.

getNbOfRemoteObjects

public java.lang.Integer getNbOfRemoteObjects()
Getter for the "NbOfRemoteObjects" property.
Returns:
the current value of the "NbOfRemoteObjects" property.

handleFrameworkEvent

public void handleFrameworkEvent(FrameworkEventMO ev)
Processes a framework event emitted by the core management framework.

Specified by:
handleFrameworkEvent in interface FrameworkListenerMO
Parameters:
ev - The framework event to be processed.

deleteCmf

public void deleteCmf()
Unregisters all the objects cascaded by the remote agent.

performSetup

public void performSetup(java.lang.Object param)
Configures the Adaptor.
Parameters:
param - Parameters to be set.
See Also:
AdaptorMO.setup(java.lang.Object)

performStart

public void performStart()
Activates the RemoteAgent service.
Specified by:
performStart in interface ActivatableIf

performStop

public void performStop()
Deactivates the RemoteAgent service.
Specified by:
performStop in interface ActivatableIf

isActive

public boolean isActive()
Tests if the RemoteAgent is active.
Specified by:
isActive in interface ActivatableIf

getClassVersion

public java.lang.String getClassVersion()
Returns the version of this class.