org.almendra.janet.cas.node
Class NodeAccessor

java.lang.Object
  extended by org.almendra.janet.cas.node.NodeAccessor

public class NodeAccessor
extends java.lang.Object

Author:
Oliver Plohmann

Field Summary
protected  Node node
           
 
Constructor Summary
protected NodeAccessor()
           
  NodeAccessor(Node node)
           
 
Method Summary
 void deregisterApplication(java.lang.String name)
           
 IAgentDispatcher getAgentDispatcher()
           
 AgentPath getAgentPath(java.lang.String applicationName, java.lang.String capabilityName, java.lang.String agentName)
           
 java.util.List getAllNodeNames()
           
 ApplicationAccessor getApplication(java.lang.String applicationName)
           
 BillboardPanelController getBillboard()
           
 ILocalClusterEventRegistry getClusterEventRegistry(java.lang.String name)
           
 ISerializableObjectSpace getClusterObjectSpace()
           
 ISerializableObjectSpace getClusterObjectSpace(java.lang.String name)
           
 TextAreaPanelController getFreeTextArea()
           
 LoggerAccessor getLogAccessor()
           
 java.lang.String getName()
           
 IObjectSpace getNodeObjectSpace()
           
 java.lang.String getRMIName()
           
protected  SystemApplication getSystemApplication()
           
 IVetoableEventRegistry getVetoableEventRegistry()
           
 boolean hasApplication(java.lang.String nodeName, java.lang.String applicationName)
           
 boolean isApplicationRegistered(java.lang.String applicationName)
           
 boolean isForeignApplicationRegistered(java.lang.String applicationName, java.lang.String nodeName)
           
 boolean isForeignCapabilityRegistered(CapabilityPath path)
           
 boolean isIdle()
           
 ApplicationAccessor registerApplication(Application app)
           
 ApplicationAccessor registerApplication(Application app, java.util.List nodeNames)
          Register the application in the node's application registry, create all agents, and start their schedulers.
 boolean shutdown()
          Shuts down the node.
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

node

protected Node node
Constructor Detail

NodeAccessor

protected NodeAccessor()

NodeAccessor

public NodeAccessor(Node node)
Method Detail

registerApplication

public ApplicationAccessor registerApplication(Application app)
                                        throws java.lang.IllegalArgumentException,
                                               java.rmi.RemoteException,
                                               AlreadyRegisteredException
Throws:
java.lang.IllegalArgumentException
java.rmi.RemoteException
AlreadyRegisteredException

registerApplication

public ApplicationAccessor registerApplication(Application app,
                                               java.util.List nodeNames)
                                        throws AlreadyRegisteredException,
                                               java.lang.IllegalArgumentException,
                                               java.rmi.RemoteException
Register the application in the node's application registry, create all agents, and start their schedulers. Send a notifications to all nodes in the cluster that a new application has been registered at this node.

Parameters:
app -
nodeNames - names of all nodes where to register, all foreign nodes if null.
Returns:
@throws AlreadyRegisteredException
Throws:
java.lang.IllegalArgumentException
AlreadyRegisteredException
java.rmi.RemoteException

getBillboard

public BillboardPanelController getBillboard()

getFreeTextArea

public TextAreaPanelController getFreeTextArea()

deregisterApplication

public void deregisterApplication(java.lang.String name)
                           throws java.util.NoSuchElementException
Parameters:
name -
Throws:
java.util.NoSuchElementException

getAgentDispatcher

public IAgentDispatcher getAgentDispatcher()

getAgentPath

public AgentPath getAgentPath(java.lang.String applicationName,
                              java.lang.String capabilityName,
                              java.lang.String agentName)
Parameters:
applicationName -
capabilityName -
agentName -
Returns:

getApplication

public ApplicationAccessor getApplication(java.lang.String applicationName)
                                   throws java.util.NoSuchElementException,
                                          java.rmi.RemoteException,
                                          InsufficientPrivilegeException
Parameters:
applicationName -
Returns:
Throws:
java.util.NoSuchElementException
java.rmi.RemoteException
InsufficientPrivilegeException

getClusterEventRegistry

public ILocalClusterEventRegistry getClusterEventRegistry(java.lang.String name)
                                                   throws java.util.NoSuchElementException,
                                                          java.rmi.RemoteException
Parameters:
name -
app -
Returns:
Throws:
java.util.NoSuchElementException
java.rmi.RemoteException

getClusterObjectSpace

public ISerializableObjectSpace getClusterObjectSpace()
                                               throws java.util.NoSuchElementException
Returns:
Throws:
java.util.NoSuchElementException

getClusterObjectSpace

public ISerializableObjectSpace getClusterObjectSpace(java.lang.String name)
                                               throws java.util.NoSuchElementException
Parameters:
name -
Returns:
Throws:
java.util.NoSuchElementException

getLogAccessor

public LoggerAccessor getLogAccessor()
Returns:

getName

public java.lang.String getName()
Returns:

getNodeObjectSpace

public IObjectSpace getNodeObjectSpace()
Returns:

getRMIName

public java.lang.String getRMIName()
Returns:

getSystemApplication

protected SystemApplication getSystemApplication()

isApplicationRegistered

public boolean isApplicationRegistered(java.lang.String applicationName)

isForeignApplicationRegistered

public boolean isForeignApplicationRegistered(java.lang.String applicationName,
                                              java.lang.String nodeName)

isForeignCapabilityRegistered

public boolean isForeignCapabilityRegistered(CapabilityPath path)

isIdle

public boolean isIdle()
Returns:

shutdown

public boolean shutdown()
Shuts down the node. Strictly speaking would require very high permission and therefore NodeAccessor should not allow the user to shut down a node. But somewhen some user must be able to shut down node. Left to the responsibility of the Java VM owner not to call shutdown mistakenly.


start

public void start()

stop

public void stop()

getVetoableEventRegistry

public IVetoableEventRegistry getVetoableEventRegistry()
Returns:

getAllNodeNames

public java.util.List getAllNodeNames()
Returns:

hasApplication

public boolean hasApplication(java.lang.String nodeName,
                              java.lang.String applicationName)
Parameters:
string -