Removed unused InitEvent

This commit is contained in:
selva.andre
2014-08-17 17:09:18 +02:00
parent 9f3d7baf05
commit b737cde803
2 changed files with 8 additions and 15 deletions
@@ -30,8 +30,6 @@ public interface IMessaging {
void stop(); void stop();
void disconnect(ServerChannel session);
void lostConnection(String clientID); void lostConnection(String clientID);
void handleProtocolMessage(ServerChannel session, AbstractMessage msg); void handleProtocolMessage(ServerChannel session, AbstractMessage msg);
@@ -65,12 +65,11 @@ public class SimpleMessaging implements IMessaging, EventHandler<ValueEvent> {
private static SimpleMessaging INSTANCE; private static SimpleMessaging INSTANCE;
private ProtocolProcessor m_processor = new ProtocolProcessor(); private final ProtocolProcessor m_processor = new ProtocolProcessor();
private final AnnotationHelper annotationHelper = new AnnotationHelper();
CountDownLatch m_stopLatch; CountDownLatch m_stopLatch;
private AnnotationHelper annotationHelper = new AnnotationHelper();
private SimpleMessaging() { private SimpleMessaging() {
} }
@@ -109,19 +108,17 @@ public class SimpleMessaging implements IMessaging, EventHandler<ValueEvent> {
m_ringBuffer.publish(sequence); m_ringBuffer.publish(sequence);
} }
@Override
public void disconnect(ServerChannel session) {
disruptorPublish(new DisconnectEvent(session));
}
public void lostConnection(String clientID) { public void lostConnection(String clientID) {
disruptorPublish(new LostConnectionEvent(clientID)); disruptorPublish(new LostConnectionEvent(clientID));
} }
@Override
public void handleProtocolMessage(ServerChannel session, AbstractMessage msg) { public void handleProtocolMessage(ServerChannel session, AbstractMessage msg) {
disruptorPublish(new ProtocolEvent(session, msg)); disruptorPublish(new ProtocolEvent(session, msg));
} }
@Override
public void stop() { public void stop() {
m_stopLatch = new CountDownLatch(1); m_stopLatch = new CountDownLatch(1);
disruptorPublish(new StopEvent()); disruptorPublish(new StopEvent());
@@ -143,11 +140,11 @@ public class SimpleMessaging implements IMessaging, EventHandler<ValueEvent> {
m_processor.processPublish((PublishEvent) evt); m_processor.processPublish((PublishEvent) evt);
} else if (evt instanceof StopEvent) { } else if (evt instanceof StopEvent) {
processStop(); processStop();
} else if (evt instanceof DisconnectEvent) { } /*else if (evt instanceof DisconnectEvent) {
DisconnectEvent disEvt = (DisconnectEvent) evt; DisconnectEvent disEvt = (DisconnectEvent) evt;
String clientID = (String) disEvt.getSession().getAttribute(Constants.ATTR_CLIENTID); String clientID = (String) disEvt.getSession().getAttribute(Constants.ATTR_CLIENTID);
m_processor.processDisconnect(disEvt.getSession(), clientID, false); m_processor.processDisconnect(disEvt.getSession(), clientID, false);
} else if (evt instanceof ProtocolEvent) { } */else if (evt instanceof ProtocolEvent) {
ServerChannel session = ((ProtocolEvent) evt).getSession(); ServerChannel session = ((ProtocolEvent) evt).getSession();
AbstractMessage message = ((ProtocolEvent) evt).getMessage(); AbstractMessage message = ((ProtocolEvent) evt).getMessage();
if (message instanceof ConnectMessage || if (message instanceof ConnectMessage ||
@@ -174,9 +171,7 @@ public class SimpleMessaging implements IMessaging, EventHandler<ValueEvent> {
throw new RuntimeException("Illegal message received " + message); throw new RuntimeException("Illegal message received " + message);
} }
} /*else if (evt instanceof InitEvent) { } else if (evt instanceof LostConnectionEvent) {
processInit(((InitEvent) evt).getConfig());
} */else if (evt instanceof LostConnectionEvent) {
LostConnectionEvent lostEvt = (LostConnectionEvent) evt; LostConnectionEvent lostEvt = (LostConnectionEvent) evt;
m_processor.proccessConnectionLost(lostEvt.getClientID()); m_processor.proccessConnectionLost(lostEvt.getClientID());
} }