/** * Construct a new remote peer. * * @param cache The cache attached to the peer * @param hostName The host name the peer is running on. * @param rmiRegistryPort The port number on which the RMI Registry listens. Should be an unused port in * the range 1025 - 65536 * @param remoteObjectPort the port number on which the remote objects bound in the registry receive calls. * This defaults to a free port if not specified. * Should be an unused port in the range 1025 - 65536 * @param socketTimeoutMillis * @throws RemoteException */ public RMICachePeer(Ehcache cache, String hostName, Integer rmiRegistryPort, Integer remoteObjectPort, Integer socketTimeoutMillis) throws RemoteException { super(remoteObjectPort.intValue(), new ConfigurableRMIClientSocketFactory(socketTimeoutMillis), ConfigurableRMIClientSocketFactory.getConfiguredRMISocketFactory()); this.remoteObjectPort = remoteObjectPort; this.hostname = hostName; this.rmiRegistryPort = rmiRegistryPort; this.cache = cache; }
/** * Create a client socket connected to the specified host and port. * <p> * If necessary this implementation can be changed to specify the outbound address to use * e.g. <code>Socket socket = new Socket(host, port, localInterface , 0);</code> * * @param host the host name * @param port the port number * @return a socket connected to the specified host and port. * @throws java.io.IOException if an I/O error occurs during socket creation * @since 1.2 */ public Socket createSocket(String host, int port) throws IOException { Socket socket = getConfiguredRMISocketFactory().createSocket(host, port); socket.setSoTimeout(socketTimeoutMillis); return socket; }
/** * Create a client socket connected to the specified host and port. * <p> * If necessary this implementation can be changed to specify the outbound address to use * e.g. <code>Socket socket = new Socket(host, port, localInterface , 0);</code> * * @param host the host name * @param port the port number * @return a socket connected to the specified host and port. * @throws java.io.IOException if an I/O error occurs during socket creation * @since 1.2 */ public Socket createSocket(String host, int port) throws IOException { Socket socket = getConfiguredRMISocketFactory().createSocket(host, port); socket.setSoTimeout(socketTimeoutMillis); return socket; }
/** * Construct a new remote peer. * * @param cache The cache attached to the peer * @param hostName The host name the peer is running on. * @param rmiRegistryPort The port number on which the RMI Registry listens. Should be an unused port in * the range 1025 - 65536 * @param remoteObjectPort the port number on which the remote objects bound in the registry receive calls. * This defaults to a free port if not specified. * Should be an unused port in the range 1025 - 65536 * @param socketTimeoutMillis * @throws RemoteException */ public RMICachePeer(Ehcache cache, String hostName, Integer rmiRegistryPort, Integer remoteObjectPort, Integer socketTimeoutMillis) throws RemoteException { super(remoteObjectPort.intValue(), new ConfigurableRMIClientSocketFactory(socketTimeoutMillis), ConfigurableRMIClientSocketFactory.getConfiguredRMISocketFactory()); this.remoteObjectPort = remoteObjectPort; this.hostname = hostName; this.rmiRegistryPort = rmiRegistryPort; this.cache = cache; }
/** * Create a client socket connected to the specified host and port. * <p/> * If necessary this implementation can be changed to specify the outbound address to use * e.g. <code>Socket socket = new Socket(host, port, localInterface , 0);</code> * * @param host the host name * @param port the port number * @return a socket connected to the specified host and port. * @throws java.io.IOException if an I/O error occurs during socket creation * @since 1.2 */ public Socket createSocket(String host, int port) throws IOException { Socket socket = getConfiguredRMISocketFactory().createSocket(host, port); socket.setSoTimeout(socketTimeoutMillis); return socket; }
/** * Construct a new remote peer. * * @param cache The cache attached to the peer * @param hostName The host name the peer is running on. * @param rmiRegistryPort The port number on which the RMI Registry listens. Should be an unused port in * the range 1025 - 65536 * @param remoteObjectPort the port number on which the remote objects bound in the registry receive calls. * This defaults to a free port if not specified. * Should be an unused port in the range 1025 - 65536 * @param socketTimeoutMillis * @throws RemoteException */ public RMICachePeer(Ehcache cache, String hostName, Integer rmiRegistryPort, Integer remoteObjectPort, Integer socketTimeoutMillis) throws RemoteException { super(remoteObjectPort.intValue(), new ConfigurableRMIClientSocketFactory(socketTimeoutMillis), ConfigurableRMIClientSocketFactory.getConfiguredRMISocketFactory()); this.remoteObjectPort = remoteObjectPort; this.hostname = hostName; this.rmiRegistryPort = rmiRegistryPort; this.cache = cache; }
/** * Create a client socket connected to the specified host and port. * <p/> * If necessary this implementation can be changed to specify the outbound address to use * e.g. <code>Socket socket = new Socket(host, port, localInterface , 0);</code> * * @param host the host name * @param port the port number * @return a socket connected to the specified host and port. * @throws java.io.IOException if an I/O error occurs during socket creation * @since 1.2 */ public Socket createSocket(String host, int port) throws IOException { Socket socket = getConfiguredRMISocketFactory().createSocket(host, port); socket.setSoTimeout(socketTimeoutMillis); return socket; }
/** * Construct a new remote peer. * * @param cache The cache attached to the peer * @param hostName The host name the peer is running on. * @param rmiRegistryPort The port number on which the RMI Registry listens. Should be an unused port in * the range 1025 - 65536 * @param remoteObjectPort the port number on which the remote objects bound in the registry receive calls. * This defaults to a free port if not specified. * Should be an unused port in the range 1025 - 65536 * @param socketTimeoutMillis * @throws RemoteException */ public RMICachePeer(Ehcache cache, String hostName, Integer rmiRegistryPort, Integer remoteObjectPort, Integer socketTimeoutMillis) throws RemoteException { super(remoteObjectPort.intValue(), new ConfigurableRMIClientSocketFactory(socketTimeoutMillis), ConfigurableRMIClientSocketFactory.getConfiguredRMISocketFactory()); this.remoteObjectPort = remoteObjectPort; this.hostname = hostName; this.rmiRegistryPort = rmiRegistryPort; this.cache = cache; }