org.xsocket.stream
Interface IServerContext

Package class diagram package IServerContext

public interface IServerContext

Represents the handler`s server context. The context object will be set by using dependency injection. To do this the Resource annotation has to be used.
E.g.

 
  class MyHandler implements IDataHandler {

     @Resource
     private IServerContext ctx;
     
     public boolean onData(INonBlockingConnection connection) throws IOException, BufferUnderflowException {
         ...
         int srvPort = ctx.getLocalePort();
         ...
         
         return true;
     }
  }
 


Method Summary
 java.net.InetAddress getLocaleAddress()
          get the local server address
 int getLocalePort()
          get the local server port
 int getNumberOfOpenConnections()
          get the number of the open server connections
 java.util.concurrent.Executor getWorkerpool()
          return the worker pool
 

Method Detail

getLocalePort

int getLocalePort()
get the local server port

Returns:
the local server port

getLocaleAddress

java.net.InetAddress getLocaleAddress()
get the local server address

Returns:
the local server address

getNumberOfOpenConnections

int getNumberOfOpenConnections()
get the number of the open server connections

Returns:
the number of the open connections

getWorkerpool

java.util.concurrent.Executor getWorkerpool()
return the worker pool

Returns:
the worker pool