|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--disciple.core.Controller
The main task for the Controller is to act as the interface between the application and the middleware. It receives commands from the application and from the remote sites, executes them, and propagates to either remote sites or the application (depending on the source of the command). Possible listeners to the commands from the Controller are Repository, CommandHistory, and archiving and replay modules. Listener list should be implemented as an array for performance reasons.
Copyright (c) 2002 Rutgers, The State University of New Jersey
| Field Summary | |
protected DataDistributor |
distributor_
|
protected Repository |
repository_
|
| Constructor Summary | |
Controller()
|
|
| Method Summary | |
void |
addCommandListener(CommandListener listener)
Add a listener for incoming commands from all connections. |
void |
addConnection(Connection connection)
Adds a connection (this is delegated to the DataDistributor) and adds the controller as a listener to the connection. |
void |
addConnectionListener(ConnectionListener listener)
Add a listener for incoming connections. |
void |
addService(java.lang.String name,
Service service)
Adds a service to the list of services. |
void |
commandReceived(Command command)
Implementation of the CommandListener interface. |
void |
connectionAdded(Connection connection,
org.w3c.dom.Element status)
|
void |
connectionChanged(Connection connection,
org.w3c.dom.Element status)
|
void |
connectionRemoved(Connection connection)
|
Connection |
getConnection(java.lang.Object destination)
Returns a connection by id. |
Connection[] |
getConnections()
Returns all connections. |
DataDistributor |
getDataDistributor()
|
javax.xml.parsers.DocumentBuilder |
getDocumentBuilder()
Returns the DOM document builder instance. |
java.lang.Object |
getId()
Gets the ID of this controller. |
Repository |
getRepository()
Returns a handle to the repository. |
Service |
getService(java.lang.String name)
Returns a handle to a service by name. |
void |
removeCommandListener(CommandListener listener)
Removes a command listener. |
void |
removeConnection(Connection connection)
Removes a connection and removes the controller as listener to the connection. |
void |
removeConnectionListener(ConnectionListener listener)
Removes a Connection listener. |
void |
removeService(java.lang.String name)
Removes a service. |
void |
sendCommand(Command command)
The entry point for the application to send commands into the Disciple middleware. |
void |
sendCommand(Command command,
Connection connection,
int priority)
The entry point for the application to send commands into the Disciple middleware. |
void |
setDataDistributor(DataDistributor distributor)
|
void |
setDocumentBuilder(javax.xml.parsers.DocumentBuilder documentBuilder)
Sets the DOM document builder. |
void |
setId(java.lang.Object id)
Sets the ID of this controller. |
void |
setRepository(Repository repository)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected Repository repository_
protected DataDistributor distributor_
| Constructor Detail |
public Controller()
| Method Detail |
public void setId(java.lang.Object id)
public java.lang.Object getId()
public void sendCommand(Command command)
public void sendCommand(Command command,
Connection connection,
int priority)
connection - priority - public void addCommandListener(CommandListener listener)
listener - public void removeCommandListener(CommandListener listener)
listener - public void addConnectionListener(ConnectionListener listener)
listener - public void removeConnectionListener(ConnectionListener listener)
listener - public Repository getRepository()
public void setRepository(Repository repository)
repository - public void setDataDistributor(DataDistributor distributor)
distributor - public DataDistributor getDataDistributor()
public Service getService(java.lang.String name)
name - the name of the service
public void addService(java.lang.String name,
Service service)
name - the name of the serviceservice - the servicepublic void removeService(java.lang.String name)
name - the name of the service to removepublic void addConnection(Connection connection)
connection - the connection to be addedpublic void removeConnection(Connection connection)
connection - the connection to be removedpublic Connection getConnection(java.lang.Object destination)
public Connection[] getConnections()
public javax.xml.parsers.DocumentBuilder getDocumentBuilder()
public void setDocumentBuilder(javax.xml.parsers.DocumentBuilder documentBuilder)
public void commandReceived(Command command)
Clones the command, executes the original, notifies the controllers command listeners, and send the cloned command to the DataDistributor.
commandReceived in interface CommandListenercommand - the received command.
public void connectionChanged(Connection connection,
org.w3c.dom.Element status)
connectionChanged in interface ConnectionListenerconnection - status -
public void connectionAdded(Connection connection,
org.w3c.dom.Element status)
connectionAdded in interface ConnectionListenerconnection - status - public void connectionRemoved(Connection connection)
connectionRemoved in interface ConnectionListenerconnection -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||