/** * Tries to lookup the server. If unsuccessful it will rebind the server using the factory * rebind method. * <p> */ @Override public void run() { checkAndRestoreIfNeeded(); }
/** * @param item * @throws IOException */ @Override public void update( ICacheElement<K, V> item ) throws IOException { update( item, 0 ); }
/** * Return the keys in the cache. * <p> * @param cacheName the name of the cache region * @see org.apache.commons.jcs.auxiliary.AuxiliaryCache#getKeySet() */ @Override public Set<K> getKeySet(String cacheName) throws IOException { return processGetKeySet( cacheName ); }
/** * Verify that the type is set correctly and that the correct name is returned for the type. */ public void testSetRemoteTypeName_cluster() { RemoteCacheServerAttributes attributes = new RemoteCacheServerAttributes(); attributes.setRemoteTypeName( "CLUSTER" ); assertEquals( "Wrong type.", RemoteType.CLUSTER, attributes.getRemoteType() ); assertEquals( "Wrong name", "CLUSTER", attributes.getRemoteTypeName() ); } }
/** verify that we get the timeout value */ public void testConfigureRemoteCacheServerAttributes_eventQueuePoolName() { // SETUP String eventQueuePoolName = "specialName"; Properties props = new Properties(); props.put( IRemoteCacheConstants.CACHE_SERVER_ATTRIBUTES_PROPERTY_PREFIX + ".EventQueuePoolName", eventQueuePoolName ); // DO WORK RemoteCacheServerAttributes result = RemoteCacheServerFactory.configureRemoteCacheServerAttributes( props ); // VERIFY assertEquals( "Wrong eventQueuePoolName", eventQueuePoolName, result.getEventQueuePoolName() ); }
/** verify that we get the timeout value */ public void testConfigureRemoteCacheServerAttributes_timeoutNotPresent() { // SETUP Properties props = new Properties(); // DO WORK RemoteCacheServerAttributes result = RemoteCacheServerFactory.configureRemoteCacheServerAttributes( props ); // VERIFY assertEquals( "Wrong timeout", ICommonRemoteCacheAttributes.DEFAULT_RMI_SOCKET_FACTORY_TIMEOUT_MILLIS, result.getRmiSocketFactoryTimeoutMillis() ); }
/** verify that we get the startRegistry value */ public void testConfigureRemoteCacheServerAttributes_allowClusterGetPresent() { // SETUP boolean allowClusterGet = false; Properties props = new Properties(); props.put( IRemoteCacheConstants.CACHE_SERVER_ATTRIBUTES_PROPERTY_PREFIX + ".allowClusterGet", String.valueOf( allowClusterGet ) ); // DO WORK RemoteCacheServerAttributes result = RemoteCacheServerFactory.configureRemoteCacheServerAttributes( props ); // VERIFY assertEquals( "Wrong allowClusterGet", allowClusterGet, result.isAllowClusterGet() ); }
/** * Verify that we get a string, even if not attributes are set. */ public void testToString() { RemoteCacheServerAttributes attributes = new RemoteCacheServerAttributes(); assertNotNull( "Should have a string.", attributes.toString() ); }
/** * Creates the registry and registers the server. * <p> * @param registry */ protected void createAndRegister( String registry ) { createReqistry( registry ); registerServer( registry ); }
/** * Remove all keys from the specified remote cache. * <p> * @param cacheName * @throws IOException */ @Override public void removeAll( String cacheName ) throws IOException { removeAll( cacheName, 0 ); }
/** * Verify that the type is set correctly and that the correct name is returned for the type. */ public void testSetRemoteTypeName_local() { RemoteCacheServerAttributes attributes = new RemoteCacheServerAttributes(); attributes.setRemoteTypeName( "LOCAL" ); assertEquals( "Wrong type.", RemoteType.LOCAL, attributes.getRemoteType() ); assertEquals( "Wrong name", "LOCAL", attributes.getRemoteTypeName() ); }
/** verify that we get the timeout value */ public void testConfigureRemoteCacheServerAttributes_eventQueuePoolName() { // SETUP String eventQueuePoolName = "specialName"; Properties props = new Properties(); props.put( IRemoteCacheConstants.CACHE_SERVER_ATTRIBUTES_PROPERTY_PREFIX + ".EventQueuePoolName", eventQueuePoolName ); // DO WORK RemoteCacheServerAttributes result = RemoteCacheServerFactory.configureRemoteCacheServerAttributes( props ); // VERIFY assertEquals( "Wrong eventQueuePoolName", eventQueuePoolName, result.getEventQueuePoolName() ); }
/** verify that we get the timeout value */ public void testConfigureRemoteCacheServerAttributes_timeoutNotPresent() { // SETUP Properties props = new Properties(); // DO WORK RemoteCacheServerAttributes result = RemoteCacheServerFactory.configureRemoteCacheServerAttributes( props ); // VERIFY assertEquals( "Wrong timeout", ICommonRemoteCacheAttributes.DEFAULT_RMI_SOCKET_FACTORY_TIMEOUT_MILLIS, result.getRmiSocketFactoryTimeoutMillis() ); }
/** * Verify that we get a string, even if not attributes are set. */ public void testToString() { RemoteCacheServerAttributes attributes = new RemoteCacheServerAttributes(); assertNotNull( "Should have a string.", attributes.toString() ); }
/** * Tries to lookup the server. If unsuccessful it will rebind the server using the factory * rebind method. * <p> */ @Override public void run() { checkAndRestoreIfNeeded(); }
/** * @param item * @throws IOException */ @Override public void update( ICacheElement<K, V> item ) throws IOException { update( item, 0 ); }
/** * Creates the registry and registers the server. * <p> * @param serviceName the service name */ protected void createAndRegister( String serviceName ) { createReqistry( serviceName ); registerServer( serviceName ); }
/** * Return the keys in the cache. * <p> * @param cacheName the name of the cache region * @see org.apache.commons.jcs.auxiliary.AuxiliaryCache#getKeySet() */ @Override public Set<K> getKeySet(String cacheName) throws IOException { return processGetKeySet( cacheName ); }
/** * Verify that the type is set correctly and that the correct name is returned for the type. */ public void testSetRemoteTypeName_local() { RemoteCacheServerAttributes attributes = new RemoteCacheServerAttributes(); attributes.setRemoteTypeName( "LOCAL" ); assertEquals( "Wrong type.", RemoteType.LOCAL, attributes.getRemoteType() ); assertEquals( "Wrong name", "LOCAL", attributes.getRemoteTypeName() ); }
/** * Verify that the type is set correctly and that the correct name is returned for the type. */ public void testSetRemoteTypeName_cluster() { RemoteCacheServerAttributes attributes = new RemoteCacheServerAttributes(); attributes.setRemoteTypeName( "CLUSTER" ); assertEquals( "Wrong type.", RemoteType.CLUSTER, attributes.getRemoteType() ); assertEquals( "Wrong name", "CLUSTER", attributes.getRemoteTypeName() ); } }