public interface OtpTransportFactory
OtpSocketTransportFactory.
JInterface user can specify custom transport factory implementing this
interface in the following ways:
System.getProperty("sun.java.command"), user can define static
class OtpErlangSystemTuner internal to the main class, providing at
least one static method with the name getOtpTransportFactory, with no
parameters, returning object of class implementing
OtpTransportFactory, for example:
public class MyMainClass {
public static class OtpErlangSystemTuner {
...
public static OtpTransportFactory getOtpTransportFactory() {
return new MyTransportFactory();
}
}
public static class MyTransportFactory implements OtpTransportFactory {
...
}
public static void main(String[] args) {
...
}
}
package com.my.company;
public static class MyTransportFactory implements OtpTransportFactory {
...
}
In such case program may be run with
-DOtpTransportFactory=com.my.company.MyTransportFactory, or other way of
setting system property before execution of static initializers may be
used.| Modifier and Type | Method and Description |
|---|---|
OtpServerTransport |
createServerTransport(int port)
Create instance of
OtpServerTransport |
OtpTransport |
createTransport(java.net.InetAddress addr,
int port)
Create instance of
OtpTransport |
OtpTransport |
createTransport(java.lang.String addr,
int port)
Create instance of
OtpTransport |
OtpTransport createTransport(java.lang.String addr, int port) throws java.io.IOException
OtpTransportaddr - host name or IP address stringport - port numberjava.io.IOExceptionOtpTransport createTransport(java.net.InetAddress addr, int port) throws java.io.IOException
OtpTransportaddr - peer addressport - port numberjava.io.IOExceptionOtpServerTransport createServerTransport(int port) throws java.io.IOException
OtpServerTransportport - port number to listen onjava.io.IOException