Class OtpGenericTransportFactory

  • All Implemented Interfaces:
    OtpTransportFactory

    public abstract class OtpGenericTransportFactory
    extends java.lang.Object
    implements OtpTransportFactory
    Transport factory abstract class used to create client-side and server-side transport instances defined using generic peers and local nodes (instead of a host + port combination as expected in the base OtpTransportFactory). It allows the creation of a transport using Unix Domain Sockets for example. OtpGenericTransportFactory is created as a subclass of OtpTransportFactory to keep backwards compatibility and ease the integration within existing Jinterface code, but in practice it doesn't support the 3 original methods.
    • Constructor Detail

      • OtpGenericTransportFactory

        public OtpGenericTransportFactory()
    • Method Detail

      • createTransport

        public abstract OtpTransport createTransport​(OtpPeer peer)
                                              throws java.io.IOException
        Create an instance of a client-side OtpTransport
        Parameters:
        peer - the peer identifying the server to connect to
        Returns:
        a new transport object
        Throws:
        java.io.IOException
      • createServerTransport

        public abstract OtpServerTransport createServerTransport​(OtpLocalNode node)
                                                          throws java.io.IOException
        Create an instance of a server-side OtpServerTransport
        Parameters:
        node - the local node identifying the transport to create server-side
        Returns:
        a new transport object
        Throws:
        java.io.IOException
      • createTransport

        public OtpTransport createTransport​(java.lang.String addr,
                                            int port)
                                     throws java.io.IOException
        Implement the 3 original methods by throwing an exception as the usage of a port is not supported by this subclass of OtpTransportFactory.
        Specified by:
        createTransport in interface OtpTransportFactory
        Parameters:
        addr - host name or IP address string
        port - port number
        Returns:
        new socket object
        Throws:
        java.io.IOException