throws Exception Properties prop = args.length > 0 ? RemoteUtils.loadProps( args[args.length - 1] ) : new Properties(); String registry = RemoteUtils.getNamingURL("", port, remoteServiceName); String registry = RemoteUtils.getNamingURL("", port, sz); log.debug( "looking up server " + registry ); Object obj = Naming.lookup( registry ); RemoteUtils.createRegistry( port );
/** * Constructor for the RemoteCache object. This object communicates with a remote cache server. * One of these exists for each region. This also holds a reference to a listener. The same * listener is used for all regions for one remote server. Holding a reference to the listener * allows this object to know the listener id assigned by the remote cache. * <p> * @param cattr * @param remote * @param listener */ public RemoteCache( IRemoteCacheAttributes cattr, ICacheServiceNonLocal<K, V> remote, IRemoteCacheListener<K, V> listener ) { super( cattr, remote, listener ); RemoteUtils.configureGlobalCustomSocketFactory( getRemoteCacheAttributes().getRmiSocketFactoryTimeoutMillis() ); }
/** * @param registryHost - Hostname of the registry * @param registryPort - the port on which to start the registry * @param serviceName */ public RegistryKeepAliveRunner( String registryHost, int registryPort, String serviceName ) { this.namingURL = RemoteUtils.getNamingURL(registryHost, registryPort, serviceName); this.serviceName = serviceName; this.registryPort = registryPort; }
RemoteUtils.configureGlobalCustomSocketFactory( rcsa.getRmiSocketFactoryTimeoutMillis() ); registry = RemoteUtils.createRegistry(port); registerServer( RemoteUtils.getNamingURL(host, port, serviceName), remoteCacheServer );
throws Exception Properties prop = args.length > 0 ? RemoteUtils.loadProps( args[args.length - 1] ) : new Properties(); RemoteUtils.createRegistry( port );
/** * Try to create the registry. Log errors * <p> * @param serviceName the service name */ protected void createReqistry( String serviceName ) { // TODO: Refactor method signature. This is ugly but required to keep the binary API compatibility this.registry = RemoteUtils.createRegistry(registryPort); if ( cacheEventLogger != null ) { if (this.registry != null) { cacheEventLogger.logApplicationEvent( "RegistryKeepAliveRunner", "createRegistry", "Successfully created registry [" + serviceName + "]." ); } else { cacheEventLogger.logError( "RegistryKeepAliveRunner", "createRegistry", "Could not start registry [" + serviceName + "]." ); } } }
/** * Initialize the RMI Cache Server from a properties file. * <p> * @param prop * @throws RemoteException if the configuration of the cache manager instance fails * * @deprecated Use version with Properties parameter instead */ @Deprecated private void init( String propFile ) throws RemoteException { String propFileName = propFile == null ? DFEAULT_REMOTE_CONFIGURATION_FILE : propFile; Properties prop = null; try { prop = RemoteUtils.loadProps(propFileName); } catch (IOException e) { throw new RemoteException(e.getMessage(), e); } init(prop); }
RemoteUtils.configureGlobalCustomSocketFactory( rcsa.getRmiSocketFactoryTimeoutMillis() ); registry = RemoteUtils.createRegistry(port);
failovers.add( server ); RemoteUtils.parseServerAndPort(server, rca); RemoteCacheManager rcm = RemoteCacheManager.getInstance( rca, cacheMgr, cacheEventLogger, elementSerializer );
/** * @param registryHost - Hostname of the registry * @param registryPort - the port on which to start the registry * @param serviceName */ public RegistryKeepAliveRunner( String registryHost, int registryPort, String serviceName ) { this.namingURL = RemoteUtils.getNamingURL(registryHost, registryPort, serviceName); this.registryPort = registryPort; }
/** * Start the cache. */ public TestRemoteCache() { super(); try { System.out.println( "main> creating registry on the localhost" ); RemoteUtils.createRegistry( 1101 ); Properties config = RemoteUtils.loadProps("/TestRemoteServer.ccf"); RemoteCacheServerFactory.startup( "localhost", 1101, config); } catch ( Exception e ) { e.printStackTrace(); } }
/** * Try to create the registry. Log errors * <p> * @param registry */ protected void createReqistry( String registry ) { Registry reg = RemoteUtils.createRegistry(registryPort); if ( cacheEventLogger != null ) { if (reg != null) { cacheEventLogger.logApplicationEvent( "RegistryKeepAliveRunner", "createRegistry", "Successfully created registry [" + registry + "]." ); } else { cacheEventLogger.logError( "RegistryKeepAliveRunner", "createRegistry", "Could not start registry [" + registry + "]." ); } } }
/** * Load configuration values from config file if possible */ private Properties loadPropertiesFromFile() { Properties props = null; try { props = RemoteUtils.loadProps(propsFileName); if (props != null) { registryHost = props.getProperty("registry.host", registryHost); String portS = props.getProperty("registry.port", String.valueOf(registryPort)); setRegistryPort(portS); } } catch (IOException e) { log.error("Problem loading props.", e); } return props; }
RemoteUtils.parseServerAndPort(server, rca); RemoteCacheManager rcm = RemoteCacheManager.getInstance( rca, cacheMgr, cacheEventLogger, elementSerializer );
/** * Look up the remote cache service admin instance * * @param config the configuration properties * @param port the local port * @return the admin object instance * * @throws Exception if lookup fails */ private static ICacheServiceAdmin lookupCacheServiceAdmin(Properties config, int port) throws Exception { String remoteServiceName = config.getProperty( REMOTE_CACHE_SERVICE_NAME, REMOTE_CACHE_SERVICE_VAL ).trim(); String registry = RemoteUtils.getNamingURL("", port, remoteServiceName); if ( log.isDebugEnabled() ) { log.debug( "looking up server " + registry ); } Object obj = Naming.lookup( registry ); if ( log.isDebugEnabled() ) { log.debug( "server found" ); } return (ICacheServiceAdmin) obj; }
/** * Call create registry. * <p> * The exception is in the security manager setting. */ public void testCreateRegistry() { Registry registry = RemoteUtils.createRegistry( 1102 ); assertNotNull("Registry should not be null", registry); }
/** * Starts up the remote cache server on this JVM, and binds it to the registry on the given host * and port. * <p> * A remote cache is either a local cache or a cluster cache. * <p> * @param host the host name * @param port the port number * @param propFile the remote cache hub configuration file * @throws IOException * * @deprecated Use startup(String, int, Properties) instead */ @Deprecated public static void startup( String host, int port, String propFile ) throws IOException { if ( log.isInfoEnabled() ) { log.info( "ConfigFileName = [" + propFile + "]" ); } Properties props = RemoteUtils.loadProps( propFile ); startup(host, port, props); }
RemoteUtils.parseServerAndPort(server, rca); RemoteCacheManager rcm = RemoteCacheManager.getInstance( rca, cacheMgr, cacheEventLogger, elementSerializer ); RemoteUtils.parseServerAndPort(serverOld, rcaOld); RemoteCacheManager rcmOld = RemoteCacheManager.getInstance( rcaOld, cacheMgr, cacheEventLogger, elementSerializer );
/** * Constructor for the RemoteCache object. This object communicates with a remote cache server. * One of these exists for each region. This also holds a reference to a listener. The same * listener is used for all regions for one remote server. Holding a reference to the listener * allows this object to know the listener id assigned by the remote cache. * <p> * @param cattr the cache configuration * @param remote the remote cache server handle * @param listener a listener * @param monitor the cache monitor */ public RemoteCache( IRemoteCacheAttributes cattr, ICacheServiceNonLocal<K, V> remote, IRemoteCacheListener<K, V> listener, RemoteCacheMonitor monitor ) { super( cattr, remote, listener ); this.monitor = monitor; RemoteUtils.configureGlobalCustomSocketFactory( getRemoteCacheAttributes().getRmiSocketFactoryTimeoutMillis() ); }
/** * Get the naming url used for RMI registration * * @param location * the remote location * @param serviceName * the remote service name * @return the URL for RMI lookup */ public static String getNamingURL(final RemoteLocation location, final String serviceName) { return getNamingURL(location.getHost(), location.getPort(), serviceName); }