Class VmPipeAcceptor

All Implemented Interfaces:
IoAcceptor, IoService

public final class VmPipeAcceptor extends AbstractIoAcceptor
Binds the specified IoHandler to the specified VmPipeAddress.
  • Field Details

  • Constructor Details

    • VmPipeAcceptor

      public VmPipeAcceptor()
      Creates a new instance.
    • VmPipeAcceptor

      public VmPipeAcceptor(Executor executor)
      Creates a new instance.
      Parameters:
      executor - The executor to use
  • Method Details

    • getTransportMetadata

      public TransportMetadata getTransportMetadata()
      Returns:
      the TransportMetadata that this service runs on.
    • getSessionConfig

      public VmPipeSessionConfig getSessionConfig()
      Returns:
      the default configuration of the new IoSessions created by this service.
    • getLocalAddress

      public VmPipeAddress getLocalAddress()
      Returns the local address which is bound currently. If more than one address are bound, only one of them will be returned, but it's not necessarily the firstly bound address.
      Specified by:
      getLocalAddress in interface IoAcceptor
      Overrides:
      getLocalAddress in class AbstractIoAcceptor
      Returns:
      The bound LocalAddress
    • getDefaultLocalAddress

      public VmPipeAddress getDefaultLocalAddress()
      Returns the default local address to bind when no argument is specified in IoAcceptor.bind() method. Please note that the default will not be used if any local address is specified. If more than one address are set, only one of them will be returned, but it's not necessarily the firstly specified address in IoAcceptor.setDefaultLocalAddresses(List).
      Specified by:
      getDefaultLocalAddress in interface IoAcceptor
      Overrides:
      getDefaultLocalAddress in class AbstractIoAcceptor
      Returns:
      The default bound LocalAddress
    • setDefaultLocalAddress

      public void setDefaultLocalAddress(VmPipeAddress localAddress)
      Sets the local Address for this acceptor
      Parameters:
      localAddress - The local address to use
    • dispose0

      protected void dispose0() throws Exception
      Implement this method to release any acquired resources. This method is invoked only once by AbstractIoService.dispose().
      Specified by:
      dispose0 in class AbstractIoService
      Throws:
      Exception - If the dispose failed
    • bindInternal

      protected Set<SocketAddress> bindInternal(List<? extends SocketAddress> localAddresses) throws IOException
      Starts the acceptor, and register the given addresses
      Specified by:
      bindInternal in class AbstractIoAcceptor
      Parameters:
      localAddresses - The address to bind to
      Returns:
      the Set of the local addresses which is bound actually
      Throws:
      IOException
    • unbind0

      protected void unbind0(List<? extends SocketAddress> localAddresses)
      Description copied from class: AbstractIoAcceptor
      Implement this method to perform the actual unbind operation.
      Specified by:
      unbind0 in class AbstractIoAcceptor
      Parameters:
      localAddresses - The address to unbind from
    • newSession

      public IoSession newSession(SocketAddress remoteAddress, SocketAddress localAddress)
      (Optional) Returns an IoSession that is bound to the specified localAddress and the specified remoteAddress which reuses the local address that is already bound by this service.

      This operation is optional. Please throw UnsupportedOperationException if the transport type doesn't support this operation. This operation is usually implemented for connectionless transport types.

      Parameters:
      remoteAddress - The remote address bound to the service
      localAddress - The local address the session will be bound to
      Returns:
      The session bound to the the given localAddress and remote address
    • doFinishSessionInitialization

      void doFinishSessionInitialization(IoSession session, IoFuture future)