/** * 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); }
/** * @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; }
/** * Gets the extra info for the event log. * <p> * @return disk location */ @Override public String getEventLoggingExtraInfo() { return getIPAddressForService(); }
public void testParseServerAndPort() { RemoteLocation loc = RemoteLocation.parseServerAndPort("server1:1234"); assertEquals("server1", loc.getHost()); assertEquals(1234, loc.getPort()); loc = RemoteLocation.parseServerAndPort(" server2 : 4567 "); assertEquals("server2", loc.getHost()); assertEquals(4567, loc.getPort()); loc = RemoteLocation.parseServerAndPort("server2 : port"); assertNull(loc); } }
/** * @see junit.framework.TestCase#setUp() */ @Override protected void setUp() throws Exception { super.setUp(); cattr = new RemoteCacheAttributes(); service = new MockRemoteCacheService<String, String>(); listener = new MockRemoteCacheListener<String, String>(); monitor = new RemoteCacheMonitor(); }
/** * 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); }
public void testGetNamingURL() { assertEquals("//host:1/servicename", RemoteUtils.getNamingURL("host",1,"servicename")); assertEquals("//127.0.0.1:2/servicename", RemoteUtils.getNamingURL("127.0.0.1",2,"servicename")); assertEquals("//[0:0:0:0:0:0:0:1%251]:3/servicename", RemoteUtils.getNamingURL("0:0:0:0:0:0:0:1%1",3,"servicename")); }
/** * @param cb * @throws IOException */ @Override public void handlePut( ICacheElement<String, String> cb ) throws IOException { p( "handlePut> cb=" + cb ); }
/** * Allows other member of this package to access the listener. This is mainly needed for * deregistering a listener. * <p> * @return IRemoteCacheListener, the listener for this remote server */ @Override public IRemoteCacheListener<K, V> getListener() { return getRemoteCacheListener(); }
/** * @return Returns the AuxiliaryCacheAttributes. */ @Override public AuxiliaryCacheAttributes getAuxiliaryCacheAttributes() { return getRemoteCacheAttributes(); }
/** * @param cacheName * @param key * @return null */ @Override public ICacheElement<K, V> get( String cacheName, K key ) { return get( cacheName, key, 0 ); }
/** junk */ public MockCacheEventQueue() { super( new MockRemoteCacheListener<K, V>(), 1, null, 1, 1 ); } }
/** * @param cacheName * @param keys * @return empty map */ @Override public Map<K, ICacheElement<K, V>> getMultiple( String cacheName, Set<K> keys ) { return getMultiple( cacheName, keys, 0 ); }
/** * Sets the location attribute of the RemoteCacheAttributes object. * <p> * @param host The new remoteHost value * @param port The new remotePort value */ @Override public void setRemoteLocation( String host, int port ) { this.location = new RemoteLocation(host, port); }
/** * 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); }
public void testGetNamingURL() { assertEquals("//host:1/servicename", RemoteUtils.getNamingURL("host",1,"servicename")); assertEquals("//127.0.0.1:2/servicename", RemoteUtils.getNamingURL("127.0.0.1",2,"servicename")); assertEquals("//[0:0:0:0:0:0:0:1%251]:3/servicename", RemoteUtils.getNamingURL("0:0:0:0:0:0:0:1%1",3,"servicename")); }
/** * Sets the listenerId attribute of the RemoteCacheClientTest object * @param id The new listenerId value * @throws IOException */ @Override public void setListenerId( long id ) throws IOException { listenerId = id; p( "listenerId = " + id ); }
/** * Allows other member of this package to access the listener. This is mainly needed for * deregistering a listener. * <p> * @return IRemoteCacheListener, the listener for this remote server */ @Override public IRemoteCacheListener<K, V> getListener() { return getRemoteCacheListener(); }
/** * @param cb * @throws IOException */ @Override public void handlePut( ICacheElement<String, String> cb ) throws IOException { p( "handlePut> cb=" + cb ); }
/** * @param cacheName * @throws IOException */ @Override public void handleRemoveAll( String cacheName ) throws IOException { p( "handleRemove> cacheName=" + cacheName ); }