/** * Return the JVM-level configured {@code RMISocketFactory}. * <p> * If a global socket factory has been set via the * {@link RMISocketFactory#setSocketFactory(RMISocketFactory)} method then * that factory will be returned. Otherwise the default socket factory as * returned by {@link RMISocketFactory#getDefaultSocketFactory()} is used * instead. * * @return the configured @{code {@link RMISocketFactory} */ public static RMISocketFactory getConfiguredRMISocketFactory() { RMISocketFactory globalSocketFactory = RMISocketFactory.getSocketFactory(); if (globalSocketFactory == null) { return RMISocketFactory.getDefaultSocketFactory(); } else { return globalSocketFactory; } } }
/** * Build a new registry on a given port * @param port given port number * @throws RemoteException if the registry cannot be built */ private ManageableRegistry(int port) throws RemoteException { this(port, RMISocketFactory.getSocketFactory(), RMISocketFactory.getSocketFactory()); }
/** * Return the JVM-level configured {@code RMISocketFactory}. * <p> * If a global socket factory has been set via the * {@link RMISocketFactory#setSocketFactory(RMISocketFactory)} method then * that factory will be returned. Otherwise the default socket factory as * returned by {@link RMISocketFactory#getDefaultSocketFactory()} is used * instead. * * @return the configured @{code {@link RMISocketFactory} */ public static RMISocketFactory getConfiguredRMISocketFactory() { RMISocketFactory globalSocketFactory = RMISocketFactory.getSocketFactory(); if (globalSocketFactory == null) { return RMISocketFactory.getDefaultSocketFactory(); } else { return globalSocketFactory; } } }
/** * Return the JVM-level configured {@code RMISocketFactory}. * <p> * If a global socket factory has been set via the * {@link RMISocketFactory#setSocketFactory(RMISocketFactory)} method then * that factory will be returned. Otherwise the default socket factory as * returned by {@link RMISocketFactory#getDefaultSocketFactory()} is used * instead. * * @return the configured @{code {@link RMISocketFactory} */ public static RMISocketFactory getConfiguredRMISocketFactory() { RMISocketFactory globalSocketFactory = RMISocketFactory.getSocketFactory(); if (globalSocketFactory == null) { return RMISocketFactory.getDefaultSocketFactory(); } else { return globalSocketFactory; } } }
/** * Return the JVM-level configured {@code RMISocketFactory}. * <p> * If a global socket factory has been set via the * {@link RMISocketFactory#setSocketFactory(RMISocketFactory)} method then * that factory will be returned. Otherwise the default socket factory as * returned by {@link RMISocketFactory#getDefaultSocketFactory()} is used * instead. * * @return the configured @{code {@link RMISocketFactory} */ public static RMISocketFactory getConfiguredRMISocketFactory() { RMISocketFactory globalSocketFactory = RMISocketFactory.getSocketFactory(); if (globalSocketFactory == null) { return RMISocketFactory.getDefaultSocketFactory(); } else { return globalSocketFactory; } } }
public void init() { try { RMISocketFactory currentFactory = RMISocketFactory.getSocketFactory(); if (currentFactory != null) { verifyCurrentFactory(currentFactory); } else { RMISocketFactory.setSocketFactory(this); } } catch (Exception e) { LOGGER.error("Exeception occurred during set socket factory form RMI protocol - note, that this can cause problem with RMI connection" + " - especially when firewall is running between client and server.", e); } }
public static RMIClientSocketFactory getDefaultClientSocketFactory() { return isTLSRequired() ? new SslRMIClientSocketFactory() : RMISocketFactory.getSocketFactory(); }
RMISocketFactory factoryInUse = RMISocketFactory.getSocketFactory(); if ( factoryInUse != null && !factoryInUse.getClass().getName().startsWith( "org.apache.commons.jcs" ) ) + RMISocketFactory.getSocketFactory() );
RMISocketFactory factoryInUse = RMISocketFactory.getSocketFactory(); if (factoryInUse != null && !factoryInUse.getClass().getName().startsWith("org.apache.commons.jcs")) + RMISocketFactory.getSocketFactory());
private static void ensureRmiUseFixedPort(final int port) throws IOException, IllegalStateException { final RMISocketFactory prevSocketFactory = RMISocketFactory.getSocketFactory(); if (prevSocketFactory == null) { RMISocketFactory.setSocketFactory(new FixedPortRmiSocketFactory(port)); } else if (prevSocketFactory instanceof FixedPortRmiSocketFactory) { ((FixedPortRmiSocketFactory) prevSocketFactory).setFixedPort(port); } else { throw new IllegalStateException("Invalid RMI socket factory was set"); } }
public static RMIServerSocketFactory getDefaultServerSocketFactory() { return isTLSRequired() ? new SslRMIServerSocketFactory(null, null, require_client_auth) : RMISocketFactory.getSocketFactory(); }
private static void ensureRmiUseFixedPort(final int port) throws IOException, IllegalStateException { final RMISocketFactory prevSocketFactory = RMISocketFactory.getSocketFactory(); if(prevSocketFactory == null) { RMISocketFactory.setSocketFactory(new FixedPortRmiSocketFactory(port)); } else if(prevSocketFactory instanceof FixedPortRmiSocketFactory) { ((FixedPortRmiSocketFactory) prevSocketFactory).setFixedPort(port); } else { throw new IllegalStateException("Invalid RMI socket factory was set"); } }