@Override public ServerSocket createServerSocket(int port) throws IOException { if (securityManager.getConfiguration().isSslEnabled()) { return securityManager.newSSLContext().getServerSocketFactory().createServerSocket(port); } return ServerSocketFactory.getDefault().createServerSocket(port); } }
public static IAsterixStateProxy registerRemoteObject(INetworkSecurityManager networkSecurityManager, int metadataCallbackPort) throws RemoteException { final RMIServerFactory serverSocketFactory = new RMIServerFactory(networkSecurityManager); final RMIClientFactory clientSocketFactory = new RMIClientFactory(networkSecurityManager.getConfiguration().isSslEnabled()); final IAsterixStateProxy stub = (IAsterixStateProxy) UnicastRemoteObject.exportObject(cc, metadataCallbackPort, clientSocketFactory, serverSocketFactory); LOGGER.info("Asterix Distributed State Proxy Bound"); return stub; }
@Override public synchronized void exportMetadataNodeStub() throws RemoteException { if (metadataNodeStub == null) { final INetworkSecurityManager networkSecurityManager = ncServiceContext.getControllerService().getNetworkSecurityManager(); final RMIServerFactory serverSocketFactory = new RMIServerFactory(networkSecurityManager); final RMIClientFactory clientSocketFactory = new RMIClientFactory(networkSecurityManager.getConfiguration().isSslEnabled()); metadataNodeStub = (IMetadataNode) UnicastRemoteObject.exportObject(MetadataNode.INSTANCE, getMetadataProperties().getMetadataPort(), clientSocketFactory, serverSocketFactory); } }