Class OortService.ServerContext

Enclosing class:

public static class OortService.ServerContext extends Object

Utility context that stores the ServerSession and the ServerMessage.

CometD services that extend OortService may register themselves as listeners for messages sent by remote clients. In such case, this class will come handy in this way:

 class MyService extends OortService<Boolean, ServerContext>
     public void processSome(ServerSession remote, ServerMessage message)
         String ownerOortURL = findOwnerOortURL();
         forward(ownerOortURL, "some", new ServerContext(remote, message));

     protected Boolean onForward(Object forwardedData)
         return "some".equals(forwardedData);

     protected void onForwardSucceeded(Boolean result, ServerContext context)
         context.getServerSession().deliver(getLocalSession(), "/service/some", result, null);