|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
js.ea.EventAgentImpl
public class EventAgentImpl
The EventAgent manages the event mechanism of JavaSymphony (event registering and production).
| Field Summary |
|---|
| Fields inherited from class java.rmi.server.RemoteObject |
|---|
ref |
| Method Summary | |
|---|---|
static EventAgentImpl |
create(java.lang.String hostname,
int port,
NetworkAgentImpl na)
Creates an instance of EventAgentImpl. |
boolean |
equals(EventAgent ea)
|
static EventAgent |
getInstance()
|
java.util.Properties |
getProperties()
|
java.lang.String |
getUrl()
|
void |
globalRegister(JSConsumerEvent event)
Used to register an event on the EventAgent where the event will be produced. |
void |
globalUnregister(JSConsumerEvent event)
Used to unregister an event on the EventAgent where the event will be produced. |
void |
informAddedNA(NetworkAgent na,
boolean propagate)
Informs about the adding of a network agent to the physical architecture. |
void |
informRemovedAll()
Informs about the removal of all network agents of the physical architecture. |
void |
informRemovedNA(NetworkAgent na,
boolean propagate)
Informs aboout the removal of a network agent from the physical architecture. |
void |
produceEvent(JSProducerEvent event,
java.lang.Object[] args)
Produces the specified event. |
void |
receiveEvent(JSProducerEvent event,
java.lang.Object[] args,
java.lang.Class[] paramTypes)
Receives events from the EventAgent that produced the event. |
void |
registerConsumerEvent(JSConsumerEvent event)
Registers the specified event. |
void |
remoteInit(java.util.HashSet eaList,
EventAgent parent)
When a new network agent has been added to the physical architecture, the event agent of the parent NA calls this method of the event agent of the new NA. |
void |
remoteRegisterConsumer(EventAgent ea,
JSConsumerEvent event)
Invokes globalRegister
for the specified EventAgent. |
void |
remoteUnregisterConsumer(EventAgent ea,
JSConsumerEvent event)
Invokes globalUnregister
for the specified EventAgent. |
void |
sendEvent(EventAgent ea,
JSProducerEvent event,
java.util.HashSet destEAs,
java.lang.Object[] args,
java.lang.Class[] paramTypes)
Sends an event to the specified EventAgent. |
void |
setProperties(java.util.Properties props,
boolean propagate)
Sets the properties that store which event types are enabled/disabled. |
void |
setPubOA(PubOA pubOA)
Sets the PubOA of the NetworkAgent where the EventAgent is located. |
java.lang.String |
toString()
|
void |
unregisterConsumerEvent(JSConsumerEvent event)
Removes the specified event from the registeredEvents-list and
calls remoteUnregisterConsumer
to unregister the event at the EventAgents where the VAs are located that produce the desired event. |
| Methods inherited from class java.rmi.server.UnicastRemoteObject |
|---|
clone, exportObject, exportObject, exportObject, unexportObject |
| Methods inherited from class java.rmi.server.RemoteServer |
|---|
getClientHost, getLog, setLog |
| Methods inherited from class java.rmi.server.RemoteObject |
|---|
equals, getRef, hashCode, toStub |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static EventAgentImpl create(java.lang.String hostname,
int port,
NetworkAgentImpl na)
throws java.rmi.RemoteException
hostname - name of local hostport - port of NetworkAgent and PubOA, EventAgent will be bound to this portna - NetworkAgent that creates the EventAgent
java.rmi.RemoteException
public boolean equals(EventAgent ea)
throws java.rmi.RemoteException
equals in interface EventAgentea - js.ea.EventAgent
java.rmi.RemoteExceptionpublic static EventAgent getInstance()
public java.util.Properties getProperties()
throws java.rmi.RemoteException
getProperties in interface EventMonitorInterfacejava.rmi.RemoteException
public java.lang.String getUrl()
throws java.rmi.RemoteException
getUrl in interface EventAgentjava.rmi.RemoteException
public void globalRegister(JSConsumerEvent event)
throws java.rmi.RemoteException
consumerEvents-list.
globalRegister in interface EventAgentevent - the event to be registered
java.rmi.RemoteException
public void globalUnregister(JSConsumerEvent event)
throws java.rmi.RemoteException
consumerEvents-list.
globalUnregister in interface EventAgentevent - the event to be unregistered
java.rmi.RemoteException
public void informAddedNA(NetworkAgent na,
boolean propagate)
throws java.rmi.RemoteException
informAddedNA in interface AdminEAna - the network agent that has been addedpropagate - true, if the information shall be propagated to other event agents
java.rmi.RemoteException
public void informRemovedAll()
throws java.rmi.RemoteException
informRemovedAll in interface AdminEAjava.rmi.RemoteException
public void informRemovedNA(NetworkAgent na,
boolean propagate)
throws java.rmi.RemoteException
informRemovedNA in interface AdminEAna - the network agent that has been removedpropagate - true, if the information shall be propagated to other event agents
java.rmi.RemoteException
public void produceEvent(JSProducerEvent event,
java.lang.Object[] args)
throws java.rmi.RemoteException
registeredEvents-list and invokes
sendEvent
for matching consumer.
produceEvent in interface EventAgentevent - the event to be producedargs - the arguments of the method that handles the event
java.rmi.RemoteException
public void receiveEvent(JSProducerEvent event,
java.lang.Object[] args,
java.lang.Class[] paramTypes)
throws java.rmi.RemoteException
registeredEvents-list and calls
invokeMethod
for matching consumers.
receiveEvent in interface EventAgentevent - produced eventarguments - for the method that handles the eventparamTypes - signature of the method
java.rmi.RemoteException
public void registerConsumerEvent(JSConsumerEvent event)
throws java.rmi.RemoteException
registeredEvents-list and registers it
(using remoteRegisterConsumer
at the EventAgents where the VAs are located that produce the desired event.
registerConsumerEvent in interface EventAgentevent - event to register
java.rmi.RemoteException
public void remoteInit(java.util.HashSet eaList,
EventAgent parent)
remoteInit in interface AdminEAeaList - list of all NAs in the physical architectureparent - event agent of the parent NA
public void remoteRegisterConsumer(EventAgent ea,
JSConsumerEvent event)
throws java.rmi.RemoteException
globalRegister
for the specified EventAgent.
remoteRegisterConsumer in interface EventAgentea - EventAgent where the event should be registeredevent - evtnt to be registered
java.rmi.RemoteException
public void remoteUnregisterConsumer(EventAgent ea,
JSConsumerEvent event)
throws java.rmi.RemoteException
globalUnregister
for the specified EventAgent.
remoteUnregisterConsumer in interface EventAgentea - EventAgent where the event should be unregisteredevent - event to be unregistered
java.rmi.RemoteException
public void sendEvent(EventAgent ea,
JSProducerEvent event,
java.util.HashSet destEAs,
java.lang.Object[] args,
java.lang.Class[] paramTypes)
throws java.rmi.RemoteException
sendEvent in interface EventAgentea - EventAgent where the event should be sent toevent - the event to be sent furtherdestEAs - stores EventAgent where the event has been sent to to avoid sending events to the same EventAgent twiceargs - arguments for the method that handles the eventparamTypes - signature of the method
java.rmi.RemoteException
public void setProperties(java.util.Properties props,
boolean propagate)
throws java.rmi.RemoteException
setProperties in interface EventMonitorInterfaceprops - new properties for EventAgentpropagate - true if the properties should be propagated to other EventAgents
java.rmi.RemoteExceptionpublic void setPubOA(PubOA pubOA)
setPubOA in interface EventAgentpubOA - reference to the pubOA of the NetworkAgentpublic java.lang.String toString()
toString in class java.rmi.server.RemoteObject
public void unregisterConsumerEvent(JSConsumerEvent event)
throws java.rmi.RemoteException
registeredEvents-list and
calls remoteUnregisterConsumer
to unregister the event at the EventAgents where the VAs are located that produce the desired event.
unregisterConsumerEvent in interface EventAgentevent - event to unregister
java.rmi.RemoteException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||