Class InProcessServer

    • Field Detail

      • registry

        private static final java.util.concurrent.ConcurrentMap<java.lang.String,​InProcessServer> registry
      • listenAddress

        private final java.net.SocketAddress listenAddress
      • maxInboundMetadataSize

        private final int maxInboundMetadataSize
      • shutdown

        private boolean shutdown
      • schedulerPool

        private final ObjectPool<java.util.concurrent.ScheduledExecutorService> schedulerPool
        Defaults to be a SharedResourcePool.
      • scheduler

        private java.util.concurrent.ScheduledExecutorService scheduler
        Only used to make sure the scheduler has at least one reference. Since child transports can outlive this server, they must get their own reference.
    • Method Detail

      • findServer

        static InProcessServer findServer​(java.net.SocketAddress addr)
      • start

        public void start​(ServerListener serverListener)
                   throws java.io.IOException
        Description copied from interface: InternalServer
        Starts transport. Implementations must not call listener until after start() returns. The method only returns after it has done the equivalent of bind()ing, so it will be able to service any connections created after returning.
        Specified by:
        start in interface InternalServer
        Parameters:
        serverListener - non-null listener of server events
        Throws:
        java.io.IOException - if unable to bind
      • registerInstance

        private void registerInstance()
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • shutdown

        public void shutdown()
        Description copied from interface: InternalServer
        Initiates an orderly shutdown of the server. Existing transports continue, but new transports will not be created (once ServerListener.serverShutdown() callback is called). This method may only be called once. Blocks until the listening socket(s) have been closed. If interrupted, this method will not wait for the close to complete, but it will happen asynchronously.
        Specified by:
        shutdown in interface InternalServer
      • unregisterInstance

        private void unregisterInstance()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getScheduledExecutorServicePool

        ObjectPool<java.util.concurrent.ScheduledExecutorService> getScheduledExecutorServicePool()
      • getMaxInboundMetadataSize

        int getMaxInboundMetadataSize()