Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorddunne2010-05-25 18:53:00 -0400
committerddunne2010-05-25 18:53:00 -0400
commit3c59b4cb2384b0ef0e5f52efe922e7ca91bf8fa0 (patch)
tree40a97759d58ddf4bad7fbd9351ff35725041c44e /plugins/org.eclipse.osee.framework.messaging.event.res
parent83037ca727359bdb3e6dfce73a156e92a22b108f (diff)
downloadorg.eclipse.osee-3c59b4cb2384b0ef0e5f52efe922e7ca91bf8fa0.tar.gz
org.eclipse.osee-3c59b4cb2384b0ef0e5f52efe922e7ca91bf8fa0.tar.xz
org.eclipse.osee-3c59b4cb2384b0ef0e5f52efe922e7ca91bf8fa0.zip
events - branch
Diffstat (limited to 'plugins/org.eclipse.osee.framework.messaging.event.res')
-rw-r--r--plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/ResEventManager.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/ResEventManager.java b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/ResEventManager.java
index bdb0c401b5..1fc951be24 100644
--- a/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/ResEventManager.java
+++ b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/ResEventManager.java
@@ -12,6 +12,7 @@ import org.eclipse.osee.framework.messaging.ConnectionNode;
import org.eclipse.osee.framework.messaging.OseeMessagingListener;
import org.eclipse.osee.framework.messaging.OseeMessagingStatusCallback;
import org.eclipse.osee.framework.messaging.ReplyConnection;
+import org.eclipse.osee.framework.messaging.event.res.msgs.RemoteBranchEvent1;
import org.eclipse.osee.framework.messaging.event.res.msgs.RemoteTransactionEvent1;
/**
@@ -64,11 +65,14 @@ public class ResEventManager implements OseeMessagingStatusCallback {
public void addingRemoteEventService(ConnectionNode connectionNode) {
this.connectionNode = connectionNode;
connectionNode.subscribe(ResMessages.RemoteTransactionEvent1, new RemoteTransactionEvent1Listener(), instance);
+ connectionNode.subscribe(ResMessages.RemoteBranchEvent1, new RemoteBranchEvent1Listener(), instance);
}
public void kick(RemoteEvent remoteEvent) throws Exception {
if (remoteEvent instanceof RemoteTransactionEvent1) {
sendRemoteEvent(ResMessages.RemoteTransactionEvent1, remoteEvent);
+ } else if (remoteEvent instanceof RemoteBranchEvent1) {
+ sendRemoteEvent(ResMessages.RemoteBranchEvent1, remoteEvent);
} else {
System.out.println("ResEventManager: Unhandled remote event " + remoteEvent);
}
@@ -121,4 +125,23 @@ public class ResEventManager implements OseeMessagingStatusCallback {
}
}
+ public class RemoteBranchEvent1Listener extends OseeMessagingListener {
+
+ public RemoteBranchEvent1Listener() {
+ super(RemoteBranchEvent1.class);
+ }
+
+ @Override
+ public void process(final Object message, Map<String, Object> headers, ReplyConnection replyConnection) {
+ RemoteBranchEvent1 remoteBranchEvent1 = (RemoteBranchEvent1) message;
+ System.err.println(String.format(getClass().getSimpleName() + " - received [%s]",
+ message.getClass().getSimpleName()));
+ try {
+ frameworkEventListener.onEvent(remoteBranchEvent1);
+ } catch (RemoteException ex) {
+ System.err.println(getClass().getSimpleName() + " - process: " + ex.getLocalizedMessage());
+ }
+ }
+ }
+
}

Back to the top