Interface TransportFactory

All Known Implementing Classes:
ClientSocketTransportFactory, ServerSocketTransportFactory
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface TransportFactory
Factory for creating new Transport instances.

Each call to create() should return a new, ready-to-use transport. For example, a server-side factory might accept incoming connections via serverSocket.accept(), while a client-side factory might open a new socket to a remote address.

  • Method Summary

    Modifier and Type
    Method
    Description
    Creates a new transport.
  • Method Details

    • create

      Transport create() throws IOException
      Creates a new transport.
      Returns:
      the new transport
      Throws:
      IOException - if the transport cannot be created