protected MessageStore createStore() throws Exception {
   String storeClass = System.getProperty(MESSAGE_STORE_CLASS_NAME_KEY);
   if (storeClass == null) {
     storeClass = DerbyMessageStore.class.getName();
   }
   CurrentActor.set(new TestLogActor(new SystemOutMessageLogger()));
   MessageStore messageStore = (MessageStore) Class.forName(storeClass).newInstance();
   return messageStore;
 }
Beispiel #2
0
  @Override
  public void received(ProtocolEvent event) {
    _lastIoTime.set(System.currentTimeMillis());
    if (event.isConnectionControl()) {
      CurrentActor.set(_actor);
    } else {
      ServerSession channel = (ServerSession) getSession(event.getChannel());
      LogActor channelActor = null;

      if (channel != null) {
        channelActor = channel.getLogActor();
      }

      CurrentActor.set(channelActor == null ? _actor : channelActor);
    }

    try {
      super.received(event);
    } finally {
      CurrentActor.remove();
    }
  }
Beispiel #3
0
 protected void logClosed() {
   if (_logClosed.compareAndSet(false, true)) {
     CurrentActor.get().message(this, ConnectionMessages.CLOSE());
   }
 }