org.eclipse.corona.collaboration.ecf.container
Class EventRouter
java.lang.Object
org.eclipse.corona.collaboration.CollaborationEventRouter
org.eclipse.corona.collaboration.ecf.ECFEventRouter
org.eclipse.corona.collaboration.ecf.container.EventRouter
- All Implemented Interfaces:
- ICoronaEventRouter, IServerEventRouter, org.osgi.service.event.EventHandler
public class EventRouter
- extends ECFEventRouter
- implements IServerEventRouter
Constructor Summary |
EventRouter(org.osgi.framework.BundleContext context,
java.lang.String protocol,
java.lang.String hostName,
int port)
Class constructor. |
Method Summary |
ITopicUser |
createTopic(java.lang.String topicName)
Create new topic. |
void |
handleEvent(org.osgi.service.event.Event osgiEvent)
Handle the event from OSGI. |
void |
processEvent(java.lang.Object event)
Process events. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TEST_TOPIC
public static final java.lang.String TEST_TOPIC
- See Also:
- Constant Field Values
EventRouter
public EventRouter(org.osgi.framework.BundleContext context,
java.lang.String protocol,
java.lang.String hostName,
int port)
throws java.lang.Exception
- Class constructor. Performs basic initialization for the class
instance.
- Parameters:
context
- Bundle context associated with the bundle that
created the class instance.
- Throws:
java.lang.Exception
processEvent
public void processEvent(java.lang.Object event)
- Process events. The event are received from ALL defined groups and members.
- Specified by:
processEvent
in interface ICoronaEventRouter
- Specified by:
processEvent
in class ECFEventRouter
- Parameters:
event
- The event to be processed.
handleEvent
public void handleEvent(org.osgi.service.event.Event osgiEvent)
- Handle the event from OSGI. The event topic will be examined to determine
what group is being used to send events to members of that topic. If a
group does not exist for the topic a group will be created.
- Specified by:
handleEvent
in interface org.osgi.service.event.EventHandler
- Specified by:
handleEvent
in class ECFEventRouter
- Parameters:
osgiEvent
- The OSGI event to be handled.- See Also:
Event
createTopic
public ITopicUser createTopic(java.lang.String topicName)
- Create new topic. This method can be invoked from the server instance of the
shared object.
- Specified by:
createTopic
in interface IServerEventRouter
- Parameters:
topicName
- Name of topic.