Module swim.io
Package swim.io

Class AbstractService

    • Constructor Detail

      • AbstractService

        public AbstractService()
    • Method Detail

      • serviceContext

        public ServiceContext serviceContext()
        Description copied from interface: Service
        Returns the network listener context to which this Service is bound; returns null if this Service is unbound.
        Specified by:
        serviceContext in interface Service
      • setServiceContext

        public void setServiceContext​(ServiceContext context)
        Description copied from interface: Service
        Sets the network listener context to which this Service is bound.
        Specified by:
        setServiceContext in interface Service
      • createSocket

        public Socket createSocket()
        Description copied from interface: Service
        Returns a new Socket binding to handle an incoming network connection.
        Specified by:
        createSocket in interface Service
      • createModem

        public Modem<?,​?> createModem()
      • didBind

        public void didBind()
        Description copied from interface: Service
        Lifecycle callback invoked by the service context after the underlying network listener has bound to a port.
        Specified by:
        didBind in interface Service
      • didAccept

        public void didAccept​(Socket socket)
        Description copied from interface: Service
        Lifecycle callback invoked by the service context after the underlying network listener has accepted a new socket connection.
        Specified by:
        didAccept in interface Service
      • didUnbind

        public void didUnbind()
        Description copied from interface: Service
        Lifecycle callback invoked by the service context after the underlying network listener has been unbound.
        Specified by:
        didUnbind in interface Service
      • didFail

        public void didFail​(Throwable error)
        Description copied from interface: Service
        Lifecycle callback invoked by the service context when the underlying network listener fails by throwing an error. The listener will automatically be closed.
        Specified by:
        didFail in interface Service
      • flowControl

        public FlowControl flowControl()
        Description copied from interface: FlowContext
        Returns the current FlowControl state of the underlying network channel.
        Specified by:
        flowControl in interface FlowContext
      • flowControl

        public void flowControl​(FlowControl flowControl)
        Description copied from interface: FlowContext
        Enqueues an atomic replacement of the underlying network channel's flow control state with a new flowControl.
        Specified by:
        flowControl in interface FlowContext
      • flowControl

        public FlowControl flowControl​(FlowModifier flowModifier)
        Description copied from interface: FlowContext
        Enqueues an atomic modification to the underlying network channel's flow control state by applying a flowModifier delta.
        Specified by:
        flowControl in interface FlowContext
      • unbind

        public void unbind()