commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject svn commit: r1408056 [1/2] - in /commons/proper/jcs/trunk/src: java/org/apache/jcs/auxiliary/remote/ java/org/apache/jcs/auxiliary/remote/behavior/ java/org/apache/jcs/auxiliary/remote/http/client/ java/org/apache/jcs/auxiliary/remote/server/ java/org/...
Date Sun, 11 Nov 2012 17:49:57 GMT
Author: tv
Date: Sun Nov 11 17:49:54 2012
New Revision: 1408056

URL: http://svn.apache.org/viewvc?rev=1408056&view=rev
Log:
More type-safe enums and code re-use

Added:
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/CommonRemoteCacheAttributes.java   (with props)
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/ICommonRemoteCacheAttributes.java   (with props)
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/behavior/RemoteType.java   (with props)
Modified:
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbsractRemoteCacheListener.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbstractRemoteAuxiliaryCache.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCache.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheAttributes.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheFactory.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheNoWaitFacade.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheAttributes.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheListener.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheFactory.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServer.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerAttributes.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerFactory.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/behavior/IRemoteCacheServerAttributes.java
    commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/MockRemoteCacheListener.java
    commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheClientTester.java
    commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerAttributesUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerFactoryUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerUnitTest.java

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbsractRemoteCacheListener.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbsractRemoteCacheListener.java?rev=1408056&r1=1408055&r2=1408056&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbsractRemoteCacheListener.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbsractRemoteCacheListener.java Sun Nov 11 17:49:54 2012
@@ -28,6 +28,7 @@ import org.apache.commons.logging.LogFac
 import org.apache.jcs.access.exception.CacheException;
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheAttributes;
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheListener;
+import org.apache.jcs.auxiliary.remote.server.behavior.RemoteType;
 import org.apache.jcs.engine.behavior.ICacheElement;
 import org.apache.jcs.engine.behavior.ICacheElementSerialized;
 import org.apache.jcs.engine.behavior.ICompositeCacheManager;
@@ -131,7 +132,7 @@ public abstract class AbsractRemoteCache
      * @return The remoteType value
      * @throws IOException
      */
-    public int getRemoteType()
+    public RemoteType getRemoteType()
         throws IOException
     {
         if ( log.isDebugEnabled() )

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbstractRemoteAuxiliaryCache.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbstractRemoteAuxiliaryCache.java?rev=1408056&r1=1408055&r2=1408056&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbstractRemoteAuxiliaryCache.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbstractRemoteAuxiliaryCache.java Sun Nov 11 17:49:54 2012
@@ -39,6 +39,7 @@ import org.apache.jcs.auxiliary.Auxiliar
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheAttributes;
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheClient;
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheListener;
+import org.apache.jcs.auxiliary.remote.server.behavior.RemoteType;
 import org.apache.jcs.engine.CacheStatus;
 import org.apache.jcs.engine.ZombieCacheServiceNonLocal;
 import org.apache.jcs.engine.behavior.ICacheElement;
@@ -189,8 +190,8 @@ public abstract class AbstractRemoteAuxi
             {
                 // Never try to deserialize if you are a cluster client. Cluster
                 // clients are merely intra-remote cache communicators. Remote caches are assumed
-                // to have no ability to deserialze the objects.
-                if ( this.getRemoteCacheAttributes().getRemoteType() != IRemoteCacheAttributes.CLUSTER )
+                // to have no ability to deserialize the objects.
+                if ( this.getRemoteCacheAttributes().getRemoteType() != RemoteType.CLUSTER )
                 {
                     retVal = SerializationConversionUtil.getDeSerializedCacheElement( (ICacheElementSerialized<K, V>) retVal,
                                                                                       this.elementSerializer );
@@ -291,7 +292,7 @@ public abstract class AbstractRemoteAuxi
                         // Never try to deserialize if you are a cluster client. Cluster
                         // clients are merely intra-remote cache communicators. Remote caches are assumed
                         // to have no ability to deserialize the objects.
-                        if ( this.getRemoteCacheAttributes().getRemoteType() != IRemoteCacheAttributes.CLUSTER )
+                        if ( this.getRemoteCacheAttributes().getRemoteType() != RemoteType.CLUSTER )
                         {
                             unwrappedResult = SerializationConversionUtil
                                 .getDeSerializedCacheElement( (ICacheElementSerialized<K, V>) entry.getValue(),
@@ -457,7 +458,7 @@ public abstract class AbstractRemoteAuxi
     {
         return getRemoteCacheService().getGroupKeys( cacheName, groupName );
     }
-    
+
     /**
      * Returns all the group names for a cache.
      * <p>
@@ -581,7 +582,7 @@ public abstract class AbstractRemoteAuxi
         se.setData( this.getRemoteCacheAttributes().getRemoteTypeName() + "" );
         elems.add( se );
 
-        if ( this.getRemoteCacheAttributes().getRemoteType() == IRemoteCacheAttributes.CLUSTER )
+        if ( this.getRemoteCacheAttributes().getRemoteType() == RemoteType.CLUSTER )
         {
             // something cluster specific
         }

Added: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/CommonRemoteCacheAttributes.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/CommonRemoteCacheAttributes.java?rev=1408056&view=auto
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/CommonRemoteCacheAttributes.java (added)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/CommonRemoteCacheAttributes.java Sun Nov 11 17:49:54 2012
@@ -0,0 +1,302 @@
+package org.apache.jcs.auxiliary.remote;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.jcs.auxiliary.AbstractAuxiliaryCacheAttributes;
+import org.apache.jcs.auxiliary.AuxiliaryCacheAttributes;
+import org.apache.jcs.auxiliary.remote.behavior.ICommonRemoteCacheAttributes;
+import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheConstants;
+import org.apache.jcs.auxiliary.remote.server.behavior.RemoteType;
+
+/**
+ * Attributes common to remote cache client and server.
+ */
+public class CommonRemoteCacheAttributes
+    extends AbstractAuxiliaryCacheAttributes
+    implements ICommonRemoteCacheAttributes
+{
+    /** Don't change */
+    private static final long serialVersionUID = -1555143736942374000L;
+
+    /** The service name */
+    private String remoteServiceName = IRemoteCacheConstants.REMOTE_CACHE_SERVICE_VAL;
+
+    /** server host */
+    private String remoteHost;
+
+    /** server port */
+    private int remotePort;
+
+    /** Cluster chain */
+    private String clusterServers = "";
+
+    /** THe type of remote cache, local or cluster */
+    private RemoteType remoteType = RemoteType.LOCAL;
+
+    /** Should we issue a local remove if we get a put from a remote server */
+    private boolean removeUponRemotePut = true;
+
+    /** Can we receive from or put to the remote. this probably shouldn't be used. Use receive. */
+    private boolean getOnly = false;
+
+    /** Should we put and get from the clusters. */
+    private boolean localClusterConsistency = false;
+
+    /** read and connect timeout */
+    private int rmiSocketFactoryTimeoutMillis = DEFAULT_RMI_SOCKET_FACTORY_TIMEOUT_MILLIS;
+
+    /** Default constructor for the RemoteCacheAttributes object */
+    public CommonRemoteCacheAttributes()
+    {
+        super();
+    }
+
+    /**
+     * Gets the remoteTypeName attribute of the RemoteCacheAttributes object.
+     * <p>
+     * @return The remoteTypeName value
+     */
+    public String getRemoteTypeName()
+    {
+        return remoteType != null ? remoteType.toString() : RemoteType.LOCAL.toString();
+    }
+
+    /**
+     * Sets the remoteTypeName attribute of the RemoteCacheAttributes object.
+     * <p>
+     * @param s The new remoteTypeName value
+     */
+    public void setRemoteTypeName( String s )
+    {
+        RemoteType rt = RemoteType.valueOf(s);
+        if (rt != null)
+        {
+            this.remoteType = rt;
+        }
+    }
+
+    /**
+     * Gets the remoteType attribute of the RemoteCacheAttributes object.
+     * <p>
+     * @return The remoteType value
+     */
+    public RemoteType getRemoteType()
+    {
+        return remoteType;
+    }
+
+    /**
+     * Sets the remoteType attribute of the RemoteCacheAttributes object.
+     * <p>
+     * @param p The new remoteType value
+     */
+    public void setRemoteType( RemoteType p )
+    {
+        this.remoteType = p;
+    }
+
+    /**
+     * @return AuxiliaryCacheAttributes
+     */
+    public AuxiliaryCacheAttributes copy()
+    {
+        try
+        {
+            return (AuxiliaryCacheAttributes) this.clone();
+        }
+        catch ( Exception e )
+        {
+            // swallow
+        }
+        return this;
+    }
+
+    /**
+     * Gets the remoteServiceName attribute of the RemoteCacheAttributes object.
+     * <p>
+     * @return The remoteServiceName value
+     */
+    public String getRemoteServiceName()
+    {
+        return this.remoteServiceName;
+    }
+
+    /**
+     * Sets the remoteServiceName attribute of the RemoteCacheAttributes object.
+     * <p>
+     * @param s The new remoteServiceName value
+     */
+    public void setRemoteServiceName( String s )
+    {
+        this.remoteServiceName = s;
+    }
+
+    /**
+     * Gets the remoteHost attribute of the RemoteCacheAttributes object.
+     * <p>
+     * @return The remoteHost value
+     */
+    public String getRemoteHost()
+    {
+        return this.remoteHost;
+    }
+
+    /**
+     * Sets the remoteHost attribute of the RemoteCacheAttributes object.
+     * <p>
+     * @param s The new remoteHost value
+     */
+    public void setRemoteHost( String s )
+    {
+        this.remoteHost = s;
+    }
+
+    /**
+     * Gets the remotePort attribute of the RemoteCacheAttributes object.
+     * <p>
+     * @return The remotePort value
+     */
+    public int getRemotePort()
+    {
+        return this.remotePort;
+    }
+
+    /**
+     * Sets the remotePort attribute of the RemoteCacheAttributes object.
+     * <p>
+     * @param p The new remotePort value
+     */
+    public void setRemotePort( int p )
+    {
+        this.remotePort = p;
+    }
+
+    /**
+     * Gets the clusterServers attribute of the RemoteCacheAttributes object.
+     * <p>
+     * @return The clusterServers value
+     */
+    public String getClusterServers()
+    {
+        return this.clusterServers;
+    }
+
+    /**
+     * Sets the clusterServers attribute of the RemoteCacheAttributes object.
+     * <p>
+     * @param s The new clusterServers value
+     */
+    public void setClusterServers( String s )
+    {
+        this.clusterServers = s;
+    }
+
+    /**
+     * Gets the removeUponRemotePut attribute of the RemoteCacheAttributes object.
+     * <p>
+     * @return The removeUponRemotePut value
+     */
+    public boolean getRemoveUponRemotePut()
+    {
+        return this.removeUponRemotePut;
+    }
+
+    /**
+     * Sets the removeUponRemotePut attribute of the RemoteCacheAttributes object.
+     * <p>
+     * @param r The new removeUponRemotePut value
+     */
+    public void setRemoveUponRemotePut( boolean r )
+    {
+        this.removeUponRemotePut = r;
+    }
+
+    /**
+     * Gets the getOnly attribute of the RemoteCacheAttributes object.
+     * <p>
+     * @return The getOnly value
+     */
+    public boolean getGetOnly()
+    {
+        return this.getOnly;
+    }
+
+    /**
+     * Sets the getOnly attribute of the RemoteCacheAttributes object
+     * @param r The new getOnly value
+     */
+    public void setGetOnly( boolean r )
+    {
+        this.getOnly = r;
+    }
+
+    /**
+     * Should cluster updates be propagated to the locals.
+     * <p>
+     * @return The localClusterConsistency value
+     */
+    public boolean isLocalClusterConsistency()
+    {
+        return localClusterConsistency;
+    }
+
+    /**
+     * Should cluster updates be propagated to the locals.
+     * <p>
+     * @param r The new localClusterConsistency value
+     */
+    public void setLocalClusterConsistency( boolean r )
+    {
+        this.localClusterConsistency = r;
+    }
+
+    /**
+     * @param rmiSocketFactoryTimeoutMillis The rmiSocketFactoryTimeoutMillis to set.
+     */
+    public void setRmiSocketFactoryTimeoutMillis( int rmiSocketFactoryTimeoutMillis )
+    {
+        this.rmiSocketFactoryTimeoutMillis = rmiSocketFactoryTimeoutMillis;
+    }
+
+    /**
+     * @return Returns the rmiSocketFactoryTimeoutMillis.
+     */
+    public int getRmiSocketFactoryTimeoutMillis()
+    {
+        return rmiSocketFactoryTimeoutMillis;
+    }
+
+    /**
+     * @return String, all the important values that can be configured
+     */
+    @Override
+    public String toString()
+    {
+        StringBuffer buf = new StringBuffer();
+        buf.append( "\n RemoteCacheAttributes " );
+        buf.append( "\n remoteHost = [" + this.remoteHost + "]" );
+        buf.append( "\n remotePort = [" + this.remotePort + "]" );
+        buf.append( "\n cacheName = [" + this.cacheName + "]" );
+        buf.append( "\n remoteType = [" + remoteType + "]" );
+        buf.append( "\n removeUponRemotePut = [" + this.removeUponRemotePut + "]" );
+        buf.append( "\n getOnly = [" + getOnly + "]" );
+        return buf.toString();
+    }
+}

Propchange: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/CommonRemoteCacheAttributes.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCache.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCache.java?rev=1408056&r1=1408055&r2=1408056&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCache.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCache.java Sun Nov 11 17:49:54 2012
@@ -29,6 +29,7 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheAttributes;
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheListener;
+import org.apache.jcs.auxiliary.remote.server.behavior.RemoteType;
 import org.apache.jcs.engine.ZombieCacheServiceNonLocal;
 import org.apache.jcs.engine.behavior.ICacheServiceNonLocal;
 import org.apache.jcs.engine.stats.StatElement;
@@ -91,7 +92,7 @@ public class RemoteCache<K extends Seria
         se.setData( this.getRemoteCacheAttributes().getRemoteTypeName() + "" );
         elems.add( se );
 
-        if ( this.getRemoteCacheAttributes().getRemoteType() == IRemoteCacheAttributes.CLUSTER )
+        if ( this.getRemoteCacheAttributes().getRemoteType() == RemoteType.CLUSTER )
         {
             // something cluster specific
         }
@@ -149,7 +150,7 @@ public class RemoteCache<K extends Seria
             log.debug( "Initiating failover, rcnf = " + rcnwf );
         }
 
-        if ( rcnwf != null && rcnwf.remoteCacheAttributes.getRemoteType() == RemoteCacheAttributes.LOCAL )
+        if ( rcnwf != null && rcnwf.remoteCacheAttributes.getRemoteType() == RemoteType.LOCAL )
         {
             if ( log.isDebugEnabled() )
             {

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheAttributes.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheAttributes.java?rev=1408056&r1=1408055&r2=1408056&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheAttributes.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheAttributes.java Sun Nov 11 17:49:54 2012
@@ -19,30 +19,18 @@ package org.apache.jcs.auxiliary.remote;
  * under the License.
  */
 
-import org.apache.jcs.auxiliary.AbstractAuxiliaryCacheAttributes;
-import org.apache.jcs.auxiliary.AuxiliaryCacheAttributes;
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheAttributes;
-import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheConstants;
 
 /**
  * These objects are used to configure the remote cache client.
  */
 public class RemoteCacheAttributes
-    extends AbstractAuxiliaryCacheAttributes
+    extends CommonRemoteCacheAttributes
     implements IRemoteCacheAttributes
 {
     /** Don't change */
     private static final long serialVersionUID = -1555143736942374000L;
 
-    /** The service name */
-    private String remoteServiceName = IRemoteCacheConstants.REMOTE_CACHE_SERVICE_VAL;
-
-    /** server host */
-    private String remoteHost;
-
-    /** server port */
-    private int remotePort;
-
     /**
      * Failover servers will be used by local caches one at a time. Listeners will be registered
      * with all cluster servers. If we add a get from cluster attribute we will have the ability to
@@ -50,39 +38,21 @@ public class RemoteCacheAttributes
      */
     private String failoverServers = "";
 
-    /** Cluster chain */
-    private String clusterServers = "";
-
     /** callback */
     private int localPort = 0;
 
-    /** THe type of remote cache, local or cluster */
-    private int remoteType = LOCAL;
-
     /** what failover server we are connected to. */
     private int failoverIndex = 0;
 
     /** Array of failover server addresses */
     private String[] failovers;
 
-    /** Should we issue a local remove if we get a put from a remote server */
-    private boolean removeUponRemotePut = true;
-
-    /** Can we receive from or put to the remote. this probably shouldn't be used. Use receive. */
-    private boolean getOnly = false;
-
-    /** Should we put and get from the clusters. */
-    private boolean localClusterConsistency = false;
-
     /** default name is remote_cache_client */
     private String threadPoolName = "remote_cache_client";
 
     /** must be greater than 0 for a pool to be used. */
     private int getTimeoutMillis = -1;
 
-    /** read and connect timeout */
-    private int rmiSocketFactoryTimeoutMillis = DEFAULT_RMI_SOCKET_FACTORY_TIMEOUT_MILLIS;
-
     /**
      * Can we receive from the server. You might have a 0 local store and keep everything on the
      * remote. If so, you don't want to be notified of updates.
@@ -99,41 +69,6 @@ public class RemoteCacheAttributes
     }
 
     /**
-     * Gets the remoteTypeName attribute of the RemoteCacheAttributes object.
-     * <p>
-     * @return The remoteTypeName value
-     */
-    public String getRemoteTypeName()
-    {
-        if ( remoteType == LOCAL )
-        {
-            return "LOCAL";
-        }
-        else if ( remoteType == CLUSTER )
-        {
-            return "CLUSTER";
-        }
-        return "LOCAL";
-    }
-
-    /**
-     * Sets the remoteTypeName attribute of the RemoteCacheAttributes object.
-     * <p>
-     * @param s The new remoteTypeName value
-     */
-    public void setRemoteTypeName( String s )
-    {
-        if ( s.equals( "LOCAL" ) )
-        {
-            remoteType = LOCAL;
-        }
-        else if ( s.equals( "CLUSTER" ) )
-        {
-            remoteType = CLUSTER;
-        }
-    }
-
-    /**
      * Gets the failoverIndex attribute of the RemoteCacheAttributes object.
      * <p>
      * @return The failoverIndex value
@@ -174,122 +109,6 @@ public class RemoteCacheAttributes
     }
 
     /**
-     * Gets the remoteType attribute of the RemoteCacheAttributes object.
-     * <p>
-     * @return The remoteType value
-     */
-    public int getRemoteType()
-    {
-        return remoteType;
-    }
-
-    /**
-     * Sets the remoteType attribute of the RemoteCacheAttributes object.
-     * <p>
-     * @param p The new remoteType value
-     */
-    public void setRemoteType( int p )
-    {
-        this.remoteType = p;
-    }
-
-    /**
-     * @return AuxiliaryCacheAttributes
-     */
-    public AuxiliaryCacheAttributes copy()
-    {
-        try
-        {
-            return (AuxiliaryCacheAttributes) this.clone();
-        }
-        catch ( Exception e )
-        {
-            // swallow
-        }
-        return this;
-    }
-
-    /**
-     * Gets the remoteServiceName attribute of the RemoteCacheAttributes object.
-     * <p>
-     * @return The remoteServiceName value
-     */
-    public String getRemoteServiceName()
-    {
-        return this.remoteServiceName;
-    }
-
-    /**
-     * Sets the remoteServiceName attribute of the RemoteCacheAttributes object.
-     * <p>
-     * @param s The new remoteServiceName value
-     */
-    public void setRemoteServiceName( String s )
-    {
-        this.remoteServiceName = s;
-    }
-
-    /**
-     * Gets the remoteHost attribute of the RemoteCacheAttributes object.
-     * <p>
-     * @return The remoteHost value
-     */
-    public String getRemoteHost()
-    {
-        return this.remoteHost;
-    }
-
-    /**
-     * Sets the remoteHost attribute of the RemoteCacheAttributes object.
-     * <p>
-     * @param s The new remoteHost value
-     */
-    public void setRemoteHost( String s )
-    {
-        this.remoteHost = s;
-    }
-
-    /**
-     * Gets the remotePort attribute of the RemoteCacheAttributes object.
-     * <p>
-     * @return The remotePort value
-     */
-    public int getRemotePort()
-    {
-        return this.remotePort;
-    }
-
-    /**
-     * Sets the remotePort attribute of the RemoteCacheAttributes object.
-     * <p>
-     * @param p The new remotePort value
-     */
-    public void setRemotePort( int p )
-    {
-        this.remotePort = p;
-    }
-
-    /**
-     * Gets the clusterServers attribute of the RemoteCacheAttributes object.
-     * <p>
-     * @return The clusterServers value
-     */
-    public String getClusterServers()
-    {
-        return this.clusterServers;
-    }
-
-    /**
-     * Sets the clusterServers attribute of the RemoteCacheAttributes object.
-     * <p>
-     * @param s The new clusterServers value
-     */
-    public void setClusterServers( String s )
-    {
-        this.clusterServers = s;
-    }
-
-    /**
      * Gets the failoverServers attribute of the RemoteCacheAttributes object.
      * <p>
      * @return The failoverServers value
@@ -329,65 +148,6 @@ public class RemoteCacheAttributes
     }
 
     /**
-     * Gets the removeUponRemotePut attribute of the RemoteCacheAttributes object.
-     * <p>
-     * @return The removeUponRemotePut value
-     */
-    public boolean getRemoveUponRemotePut()
-    {
-        return this.removeUponRemotePut;
-    }
-
-    /**
-     * Sets the removeUponRemotePut attribute of the RemoteCacheAttributes object.
-     * <p>
-     * @param r The new removeUponRemotePut value
-     */
-    public void setRemoveUponRemotePut( boolean r )
-    {
-        this.removeUponRemotePut = r;
-    }
-
-    /**
-     * Gets the getOnly attribute of the RemoteCacheAttributes object.
-     * <p>
-     * @return The getOnly value
-     */
-    public boolean getGetOnly()
-    {
-        return this.getOnly;
-    }
-
-    /**
-     * Sets the getOnly attribute of the RemoteCacheAttributes object
-     * @param r The new getOnly value
-     */
-    public void setGetOnly( boolean r )
-    {
-        this.getOnly = r;
-    }
-
-    /**
-     * Should cluster updates be propogated to the locals.
-     * <p>
-     * @return The localClusterConsistency value
-     */
-    public boolean getLocalClusterConsistency()
-    {
-        return localClusterConsistency;
-    }
-
-    /**
-     * Should cluster updates be propogated to the locals.
-     * <p>
-     * @param r The new localClusterConsistency value
-     */
-    public void setLocalClusterConsistency( boolean r )
-    {
-        this.localClusterConsistency = r;
-    }
-
-    /**
      * @return the name of the pool
      */
     public String getThreadPoolName()
@@ -420,22 +180,6 @@ public class RemoteCacheAttributes
     }
 
     /**
-     * @param rmiSocketFactoryTimeoutMillis The rmiSocketFactoryTimeoutMillis to set.
-     */
-    public void setRmiSocketFactoryTimeoutMillis( int rmiSocketFactoryTimeoutMillis )
-    {
-        this.rmiSocketFactoryTimeoutMillis = rmiSocketFactoryTimeoutMillis;
-    }
-
-    /**
-     * @return Returns the rmiSocketFactoryTimeoutMillis.
-     */
-    public int getRmiSocketFactoryTimeoutMillis()
-    {
-        return rmiSocketFactoryTimeoutMillis;
-    }
-
-    /**
      * By default this option is true. If you set it to false, you will not receive updates or
      * removes from the remote server.
      * <p>
@@ -449,10 +193,10 @@ public class RemoteCacheAttributes
     /**
      * If RECEIVE is false then the remote cache will not register a listener with the remote
      * server. This allows you to configure a remote server as a repository from which you can get
-     * and to which you put, but from which you do not reveive any notifications. That is, you will
+     * and to which you put, but from which you do not receive any notifications. That is, you will
      * not receive updates or removes.
      * <p>
-     * If you set this option to false, you should set your locl memory size to 0.
+     * If you set this option to false, you should set your local memory size to 0.
      * <p>
      * The remote cache manager uses this value to decide whether or not to register a listener.
      * @return the receive value.
@@ -490,18 +234,11 @@ public class RemoteCacheAttributes
     @Override
     public String toString()
     {
-        StringBuffer buf = new StringBuffer();
-        buf.append( "\n RemoteCacheAttributes " );
-        buf.append( "\n remoteHost = [" + this.remoteHost + "]" );
-        buf.append( "\n remotePort = [" + this.remotePort + "]" );
-        buf.append( "\n cacheName = [" + this.cacheName + "]" );
-        buf.append( "\n removeUponRemotePut = [" + this.removeUponRemotePut + "]" );
-        buf.append( "\n getOnly = [" + getOnly + "]" );
+        StringBuffer buf = new StringBuffer(super.toString());
         buf.append( "\n receive = [" + isReceive() + "]" );
         buf.append( "\n getTimeoutMillis = [" + getGetTimeoutMillis() + "]" );
         buf.append( "\n threadPoolName = [" + getThreadPoolName() + "]" );
-        buf.append( "\n remoteType = [" + remoteType + "]" );
-        buf.append( "\n localClusterConsistency = [" + getLocalClusterConsistency() + "]" );
+        buf.append( "\n localClusterConsistency = [" + isLocalClusterConsistency() + "]" );
         buf.append( "\n zombieQueueMaxSize = [" + getZombieQueueMaxSize() + "]" );
         return buf.toString();
     }

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheFactory.java?rev=1408056&r1=1408055&r2=1408056&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheFactory.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheFactory.java Sun Nov 11 17:49:54 2012
@@ -29,6 +29,7 @@ import org.apache.commons.logging.LogFac
 import org.apache.jcs.auxiliary.AuxiliaryCache;
 import org.apache.jcs.auxiliary.AuxiliaryCacheAttributes;
 import org.apache.jcs.auxiliary.AuxiliaryCacheFactory;
+import org.apache.jcs.auxiliary.remote.server.behavior.RemoteType;
 import org.apache.jcs.engine.behavior.ICache;
 import org.apache.jcs.engine.behavior.ICompositeCacheManager;
 import org.apache.jcs.engine.behavior.IElementSerializer;
@@ -75,7 +76,7 @@ public class RemoteCacheFactory
         ArrayList<ICache<K, V>> noWaits = new ArrayList<ICache<K, V>>();
 
         // if LOCAL
-        if ( rca.getRemoteType() == RemoteCacheAttributes.LOCAL )
+        if ( rca.getRemoteType() == RemoteType.LOCAL )
         {
             // a list to be turned into an array of failover server information
             ArrayList<String> failovers = new ArrayList<String>();
@@ -143,7 +144,7 @@ public class RemoteCacheFactory
 
             // if CLUSTER
         }
-        else if ( rca.getRemoteType() == RemoteCacheAttributes.CLUSTER )
+        else if ( rca.getRemoteType() == RemoteType.CLUSTER )
         {
             // REGISTER LISTENERS FOR EACH SYSTEM CLUSTERED CACHEs
             StringTokenizer it = new StringTokenizer( rca.getClusterServers(), "," );
@@ -156,7 +157,7 @@ public class RemoteCacheFactory
                 rca.setRemotePort( Integer.parseInt( server.substring( server.indexOf( ":" ) + 1 ) ) );
                 RemoteCacheManager rcm = RemoteCacheManager.getInstance( rca, cacheMgr, cacheEventLogger,
                                                                          elementSerializer );
-                rca.setRemoteType( RemoteCacheAttributes.CLUSTER );
+                rca.setRemoteType( RemoteType.CLUSTER );
                 ICache<K, V> ic = rcm.getCache( rca );
                 if ( ic != null )
                 {

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheNoWaitFacade.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheNoWaitFacade.java?rev=1408056&r1=1408055&r2=1408056&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheNoWaitFacade.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheNoWaitFacade.java Sun Nov 11 17:49:54 2012
@@ -23,6 +23,7 @@ import java.io.Serializable;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.jcs.auxiliary.remote.server.behavior.RemoteType;
 import org.apache.jcs.engine.CacheStatus;
 import org.apache.jcs.engine.behavior.ICompositeCacheManager;
 import org.apache.jcs.engine.behavior.IElementSerializer;
@@ -74,7 +75,7 @@ public class RemoteCacheNoWaitFacade<K e
             log.info( "in failover for " + i );
         }
 
-        if ( remoteCacheAttributes.getRemoteType() == RemoteCacheAttributes.LOCAL )
+        if ( remoteCacheAttributes.getRemoteType() == RemoteType.LOCAL )
         {
             if ( noWaits[i].getStatus() == CacheStatus.ERROR )
             {

Added: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/ICommonRemoteCacheAttributes.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/ICommonRemoteCacheAttributes.java?rev=1408056&view=auto
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/ICommonRemoteCacheAttributes.java (added)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/ICommonRemoteCacheAttributes.java Sun Nov 11 17:49:54 2012
@@ -0,0 +1,177 @@
+package org.apache.jcs.auxiliary.remote.behavior;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.jcs.auxiliary.AuxiliaryCacheAttributes;
+import org.apache.jcs.auxiliary.remote.server.behavior.RemoteType;
+
+/**
+ * This specifies what a remote cache configuration object should look like.
+ */
+public interface ICommonRemoteCacheAttributes
+    extends AuxiliaryCacheAttributes
+{
+    /** The default timeout for the custom RMI socket factory */
+    int DEFAULT_RMI_SOCKET_FACTORY_TIMEOUT_MILLIS = 10000;
+
+    /**
+     * Gets the remoteTypeName attribute of the IRemoteCacheAttributes object
+     * <p>
+     * @return The remoteTypeName value
+     */
+    String getRemoteTypeName();
+
+    /**
+     * Sets the remoteTypeName attribute of the IRemoteCacheAttributes object
+     * <p>
+     * @param s The new remoteTypeName value
+     */
+    void setRemoteTypeName( String s );
+
+    /**
+     * Gets the remoteType attribute of the IRemoteCacheAttributes object
+     * <p>
+     * @return The remoteType value
+     */
+    RemoteType getRemoteType();
+
+    /**
+     * Sets the remoteType attribute of the IRemoteCacheAttributes object
+     * <p>
+     * @param p The new remoteType value
+     */
+    void setRemoteType( RemoteType p );
+
+    /**
+     * Gets the remoteServiceName attribute of the IRemoteCacheAttributes object
+     * <p>
+     * @return The remoteServiceName value
+     */
+    String getRemoteServiceName();
+
+    /**
+     * Sets the remoteServiceName attribute of the IRemoteCacheAttributes object
+     * <p>
+     * @param s The new remoteServiceName value
+     */
+    void setRemoteServiceName( String s );
+
+    /**
+     * Gets the remoteHost attribute of the IRemoteCacheAttributes object
+     * <p>
+     * @return The remoteHost value
+     */
+    String getRemoteHost();
+
+    /**
+     * Sets the remoteHost attribute of the IRemoteCacheAttributes object
+     * <p>
+     * @param s The new remoteHost value
+     */
+    void setRemoteHost( String s );
+
+    /**
+     * Gets the remotePort attribute of the IRemoteCacheAttributes object
+     * <p>
+     * @return The remotePort value
+     */
+    int getRemotePort();
+
+    /**
+     * Sets the remotePort attribute of the IRemoteCacheAttributes object
+     * <p>
+     * @param p The new remotePort value
+     */
+    void setRemotePort( int p );
+
+    /**
+     * Gets the clusterServers attribute of the IRemoteCacheAttributes object
+     * <p>
+     * @return The clusterServers value
+     */
+    String getClusterServers();
+
+    /**
+     * Sets the clusterServers attribute of the IRemoteCacheAttributes object
+     * <p>
+     * @param s The new clusterServers value
+     */
+    void setClusterServers( String s );
+
+    /**
+     * Gets the removeUponRemotePut attribute of the IRemoteCacheAttributes object
+     * <p>
+     * @return The removeUponRemotePut value
+     */
+    boolean getRemoveUponRemotePut();
+
+    /**
+     * Sets the removeUponRemotePut attribute of the IRemoteCacheAttributes object
+     * <p>
+     * @param r The new removeUponRemotePut value
+     */
+    void setRemoveUponRemotePut( boolean r );
+
+    /**
+     * Gets the getOnly attribute of the IRemoteCacheAttributes object
+     * <p>
+     * @return The getOnly value
+     */
+    boolean getGetOnly();
+
+    /**
+     * Sets the getOnly attribute of the IRemoteCacheAttributes object
+     * <p>
+     * @param r The new getOnly value
+     */
+    void setGetOnly( boolean r );
+
+    /**
+     * Should cluster updates be propagated to the locals
+     * <p>
+     * @return The localClusterConsistency value
+     */
+    boolean isLocalClusterConsistency();
+
+    /**
+     * Should cluster updates be propagated to the locals
+     * <p>
+     * @param r The new localClusterConsistency value
+     */
+    void setLocalClusterConsistency( boolean r );
+
+    /**
+     * This sets a general timeout on the rmi socket factory. By default the socket factory will
+     * block forever.
+     * <p>
+     * We have a default setting. The default rmi behavior should never be used.
+     * <p>
+     * @return int milliseconds
+     */
+    int getRmiSocketFactoryTimeoutMillis();
+
+    /**
+     * This sets a general timeout on the RMI socket factory. By default the socket factory will
+     * block forever.
+     * <p>
+     * @param rmiSocketFactoryTimeoutMillis
+     */
+    void setRmiSocketFactoryTimeoutMillis( int rmiSocketFactoryTimeoutMillis );
+}

Propchange: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/ICommonRemoteCacheAttributes.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheAttributes.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheAttributes.java?rev=1408056&r1=1408055&r2=1408056&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheAttributes.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheAttributes.java Sun Nov 11 17:49:54 2012
@@ -19,66 +19,28 @@ package org.apache.jcs.auxiliary.remote.
  * under the License.
  */
 
-import org.apache.jcs.auxiliary.AuxiliaryCacheAttributes;
 
 /**
  * This specifies what a remote cache configuration object should look like.
  */
 public interface IRemoteCacheAttributes
-    extends AuxiliaryCacheAttributes
+    extends ICommonRemoteCacheAttributes
 {
-    /** A remote cache is either a local cache or a cluster cache.  */
-    public static final int LOCAL = 0;
-
-    /** A remote cache is either a local cache or a cluster cache. */
-    public static final int CLUSTER = 1;
-
-    /** The default timeout for the custom RMI socket facfory */
-    public static final int DEFAULT_RMI_SOCKET_FACTORY_TIMEOUT_MILLIS = 10000;
-
     /**
      * If RECEIVE is false then the remote cache will not register a listener with the remote
      * server. This allows you to configure a remote server as a repository from which you can get
-     * and to which you put, but from which you do not reveive any notifications. That is, you will
+     * and to which you put, but from which you do not receive any notifications. That is, you will
      * not receive updates or removes.
      * <p>
-     * If you set this option to false, you should set your locl memory size to 0.
+     * If you set this option to false, you should set your local memory size to 0.
      */
-    public static final boolean DEFAULT_RECEIVE = true;
+    boolean DEFAULT_RECEIVE = true;
 
     /**
      * The number of elements the zombie queue will hold. This queue is used to store events if we
-     * loose our conenction with the server.
-     */
-    public static final int DEFAULT_ZOMBIE_QUEUE_MAX_SIZE = 1000;
-
-    /**
-     * Gets the remoteTypeName attribute of the IRemoteCacheAttributes object
-     * <p>
-     * @return The remoteTypeName value
-     */
-    public String getRemoteTypeName();
-
-    /**
-     * Sets the remoteTypeName attribute of the IRemoteCacheAttributes object
-     * <p>
-     * @param s The new remoteTypeName value
-     */
-    public void setRemoteTypeName( String s );
-
-    /**
-     * Gets the remoteType attribute of the IRemoteCacheAttributes object
-     * <p>
-     * @return The remoteType value
-     */
-    public int getRemoteType();
-
-    /**
-     * Sets the remoteType attribute of the IRemoteCacheAttributes object
-     * <p>
-     * @param p The new remoteType value
+     * loose our connection with the server.
      */
-    public void setRemoteType( int p );
+    int DEFAULT_ZOMBIE_QUEUE_MAX_SIZE = 1000;
 
     /**
      * Gets the failoverIndex attribute of the IRemoteCacheAttributes object.
@@ -88,154 +50,56 @@ public interface IRemoteCacheAttributes
      * <p>
      * @return The failoverIndex value
      */
-    public int getFailoverIndex();
+    int getFailoverIndex();
 
     /**
      * Sets the failoverIndex attribute of the IRemoteCacheAttributes object
      * <p>
      * @param p The new failoverIndex value
      */
-    public void setFailoverIndex( int p );
+    void setFailoverIndex( int p );
 
     /**
      * Gets the failovers attribute of the IRemoteCacheAttributes object
      * <p>
      * @return The failovers value
      */
-    public String[] getFailovers();
+    String[] getFailovers();
 
     /**
      * Sets the failovers attribute of the IRemoteCacheAttributes object
      * <p>
      * @param f The new failovers value
      */
-    public void setFailovers( String[] f );
-
-    /**
-     * Gets the remoteServiceName attribute of the IRemoteCacheAttributes object
-     * <p>
-     * @return The remoteServiceName value
-     */
-    public String getRemoteServiceName();
-
-    /**
-     * Sets the remoteServiceName attribute of the IRemoteCacheAttributes object
-     * <p>
-     * @param s The new remoteServiceName value
-     */
-    public void setRemoteServiceName( String s );
-
-    /**
-     * Gets the remoteHost attribute of the IRemoteCacheAttributes object
-     * <p>
-     * @return The remoteHost value
-     */
-    public String getRemoteHost();
-
-    /**
-     * Sets the remoteHost attribute of the IRemoteCacheAttributes object
-     * <p>
-     * @param s The new remoteHost value
-     */
-    public void setRemoteHost( String s );
-
-    /**
-     * Gets the remotePort attribute of the IRemoteCacheAttributes object
-     * <p>
-     * @return The remotePort value
-     */
-    public int getRemotePort();
-
-    /**
-     * Sets the remotePort attribute of the IRemoteCacheAttributes object
-     * <p>
-     * @param p The new remotePort value
-     */
-    public void setRemotePort( int p );
+    void setFailovers( String[] f );
 
     /**
      * Gets the localPort attribute of the IRemoteCacheAttributes object
      * <p>
      * @return The localPort value
      */
-    public int getLocalPort();
+    int getLocalPort();
 
     /**
      * Sets the localPort attribute of the IRemoteCacheAttributes object
      * <p>
      * @param p The new localPort value
      */
-    public void setLocalPort( int p );
-
-    /**
-     * Gets the clusterServers attribute of the IRemoteCacheAttributes object
-     * <p>
-     * @return The clusterServers value
-     */
-    public String getClusterServers();
-
-    /**
-     * Sets the clusterServers attribute of the IRemoteCacheAttributes object
-     * <p>
-     * @param s The new clusterServers value
-     */
-    public void setClusterServers( String s );
+    void setLocalPort( int p );
 
     /**
      * Gets the failoverServers attribute of the IRemoteCacheAttributes object
      * <p>
      * @return The failoverServers value
      */
-    public String getFailoverServers();
+    String getFailoverServers();
 
     /**
      * Sets the failoverServers attribute of the IRemoteCacheAttributes object
      * <p>
      * @param s The new failoverServers value
      */
-    public void setFailoverServers( String s );
-
-    /**
-     * Gets the removeUponRemotePut attribute of the IRemoteCacheAttributes object
-     * <p>
-     * @return The removeUponRemotePut value
-     */
-    public boolean getRemoveUponRemotePut();
-
-    /**
-     * Sets the removeUponRemotePut attribute of the IRemoteCacheAttributes object
-     * <p>
-     * @param r The new removeUponRemotePut value
-     */
-    public void setRemoveUponRemotePut( boolean r );
-
-    /**
-     * Gets the getOnly attribute of the IRemoteCacheAttributes object
-     * <p>
-     * @return The getOnly value
-     */
-    public boolean getGetOnly();
-
-    /**
-     * Sets the getOnly attribute of the IRemoteCacheAttributes object
-     * <p>
-     * @param r The new getOnly value
-     */
-    public void setGetOnly( boolean r );
-
-    /**
-     * Should cluster updates be propogated to the locals
-     * <p>
-     * @return The localClusterConsistency value
-     */
-    public boolean getLocalClusterConsistency();
-
-    /**
-     * Should cluster updates be propogated to the locals
-     * <p>
-     * @param r The new localClusterConsistency value
-     */
-    public void setLocalClusterConsistency( boolean r );
+    void setFailoverServers( String s );
 
     /**
      * The thread pool the remote cache should use. At first this will only be for gets.
@@ -244,14 +108,14 @@ public interface IRemoteCacheAttributes
      * <p>
      * @return the name of the pool
      */
-    public abstract String getThreadPoolName();
+    String getThreadPoolName();
 
     /**
-     * Set the anme of the pool to use. Pools should be defined in the cache.ccf.
+     * Set the name of the pool to use. Pools should be defined in the cache.ccf.
      * <p>
      * @param name
      */
-    public abstract void setThreadPoolName( String name );
+    void setThreadPoolName( String name );
 
     /**
      * -1 and 0 mean no timeout, this is the default if the timeout is -1 or 0, no threadpool will
@@ -259,7 +123,7 @@ public interface IRemoteCacheAttributes
      * <p>
      * @return the time in millis
      */
-    public abstract int getGetTimeoutMillis();
+    int getGetTimeoutMillis();
 
     /**
      * -1 means no timeout, this is the default if the timeout is -1 or 0, no threadpool will be
@@ -267,25 +131,7 @@ public interface IRemoteCacheAttributes
      * <p>
      * @param millis
      */
-    public abstract void setGetTimeoutMillis( int millis );
-
-    /**
-     * This sets a general timeout on the rmi socket factory. By default the socket factory will
-     * block forever.
-     * <p>
-     * We have a default setting. The default rmi behavior should never be used.
-     * <p>
-     * @return int milliseconds
-     */
-    public abstract int getRmiSocketFactoryTimeoutMillis();
-
-    /**
-     * This sets a general timeout on the RMI socket factory. By default the socket factory will
-     * block forever.
-     * <p>
-     * @param rmiSocketFactoryTimeoutMillis
-     */
-    public abstract void setRmiSocketFactoryTimeoutMillis( int rmiSocketFactoryTimeoutMillis );
+    void setGetTimeoutMillis( int millis );
 
     /**
      * By default this option is true. If you set it to false, you will not receive updates or
@@ -293,15 +139,15 @@ public interface IRemoteCacheAttributes
      * <p>
      * @param receive
      */
-    public void setReceive( boolean receive );
+    void setReceive( boolean receive );
 
     /**
      * If RECEIVE is false then the remote cache will not register a listener with the remote
      * server. This allows you to configure a remote server as a repository from which you can get
-     * and to which you put, but from which you do not reveive any notifications. That is, you will
+     * and to which you put, but from which you do not receive any notifications. That is, you will
      * not receive updates or removes.
      * <p>
-     * If you set this option to false, you should set your locl memory size to 0.
+     * If you set this option to false, you should set your local memory size to 0.
      * <p>
      * The remote cache manager uses this value to decide whether or not to register a listener.
      * <p>
@@ -313,7 +159,7 @@ public interface IRemoteCacheAttributes
      * <p>
      * @return the receive value.
      */
-    public boolean isReceive();
+    boolean isReceive();
 
     /**
      * The number of elements the zombie queue will hold. This queue is used to store events if we
@@ -321,7 +167,7 @@ public interface IRemoteCacheAttributes
      * <p>
      * @param zombieQueueMaxSize The zombieQueueMaxSize to set.
      */
-    public void setZombieQueueMaxSize( int zombieQueueMaxSize );
+    void setZombieQueueMaxSize( int zombieQueueMaxSize );
 
     /**
      * The number of elements the zombie queue will hold. This queue is used to store events if we
@@ -329,5 +175,5 @@ public interface IRemoteCacheAttributes
      * <p>
      * @return Returns the zombieQueueMaxSize.
      */
-    public int getZombieQueueMaxSize();
+    int getZombieQueueMaxSize();
 }

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheListener.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheListener.java?rev=1408056&r1=1408055&r2=1408056&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheListener.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheListener.java Sun Nov 11 17:49:54 2012
@@ -23,6 +23,7 @@ import java.io.IOException;
 import java.io.Serializable;
 import java.rmi.Remote;
 
+import org.apache.jcs.auxiliary.remote.server.behavior.RemoteType;
 import org.apache.jcs.engine.behavior.ICacheListener;
 
 /**
@@ -62,7 +63,7 @@ public interface IRemoteCacheListener<K 
      * @return The remoteType value
      * @throws IOException
      */
-    public int getRemoteType()
+    public RemoteType getRemoteType()
         throws IOException;
 
     /**

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheFactory.java?rev=1408056&r1=1408055&r2=1408056&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheFactory.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheFactory.java Sun Nov 11 17:49:54 2012
@@ -28,9 +28,9 @@ import org.apache.commons.logging.LogFac
 import org.apache.jcs.auxiliary.AuxiliaryCache;
 import org.apache.jcs.auxiliary.AuxiliaryCacheAttributes;
 import org.apache.jcs.auxiliary.AuxiliaryCacheFactory;
-import org.apache.jcs.auxiliary.remote.RemoteCacheAttributes;
 import org.apache.jcs.auxiliary.remote.RemoteCacheNoWait;
 import org.apache.jcs.auxiliary.remote.RemoteCacheNoWaitFacade;
+import org.apache.jcs.auxiliary.remote.server.behavior.RemoteType;
 import org.apache.jcs.engine.behavior.ICache;
 import org.apache.jcs.engine.behavior.ICompositeCacheManager;
 import org.apache.jcs.engine.behavior.IElementSerializer;
@@ -77,7 +77,7 @@ public class RemoteHttpCacheFactory
 
         RemoteHttpCacheManager rcm = RemoteHttpCacheManager.getInstance( cacheMgr, cacheEventLogger, elementSerializer );
         // TODO, use the configured value.
-        rca.setRemoteType( RemoteCacheAttributes.LOCAL );
+        rca.setRemoteType( RemoteType.LOCAL );
         ICache<K, V> ic = rcm.getCache( rca );
         if ( ic != null )
         {

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServer.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServer.java?rev=1408056&r1=1408055&r2=1408056&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServer.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServer.java Sun Nov 11 17:49:54 2012
@@ -31,11 +31,11 @@ import java.util.Set;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.jcs.access.exception.CacheException;
-import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheAttributes;
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheListener;
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheObserver;
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheServiceAdmin;
 import org.apache.jcs.auxiliary.remote.server.behavior.IRemoteCacheServerAttributes;
+import org.apache.jcs.auxiliary.remote.server.behavior.RemoteType;
 import org.apache.jcs.engine.CacheEventQueueFactory;
 import org.apache.jcs.engine.CacheListeners;
 import org.apache.jcs.engine.behavior.ICacheElement;
@@ -91,7 +91,7 @@ public class RemoteCacheServer<K extends
     private CompositeCacheManager cacheManager;
 
     /** relates listener id with a type */
-    private final Hashtable<Long, Integer> idTypeMap = new Hashtable<Long, Integer>();
+    private final Hashtable<Long, RemoteType> idTypeMap = new Hashtable<Long, RemoteType>();
 
     /** relates listener id with an ip address */
     private final Hashtable<Long, String> idIPMap = new Hashtable<Long, String>();
@@ -334,7 +334,7 @@ public class RemoteCacheServer<K extends
 
                 // UPDATE LOCALS IF A REQUEST COMES FROM A CLUSTER
                 // IF LOCAL CLUSTER CONSISTENCY IS CONFIGURED
-                if ( !fromCluster || ( fromCluster && remoteCacheServerAttributes.getLocalClusterConsistency() ) )
+                if ( !fromCluster || ( fromCluster && remoteCacheServerAttributes.isLocalClusterConsistency() ) )
                 {
                     ICacheEventQueue<K, V>[] qlist = getEventQList( cacheDesc, requesterId );
 
@@ -522,12 +522,12 @@ public class RemoteCacheServer<K extends
             // data from those that were up when the failed server comes back o
             // line.
 
-            if ( !fromCluster && this.remoteCacheServerAttributes.getAllowClusterGet() )
+            if ( !fromCluster && this.remoteCacheServerAttributes.isAllowClusterGet() )
             {
                 if ( log.isDebugEnabled() )
                 {
                     log.debug( "NonLocalGet. fromCluster [" + fromCluster + "] AllowClusterGet ["
-                        + this.remoteCacheServerAttributes.getAllowClusterGet() + "]" );
+                        + this.remoteCacheServerAttributes.isAllowClusterGet() + "]" );
                 }
                 returnElement = c.get( key );
             }
@@ -540,7 +540,7 @@ public class RemoteCacheServer<K extends
                 if ( log.isDebugEnabled() )
                 {
                     log.debug( "LocalGet.  fromCluster [" + fromCluster + "] AllowClusterGet ["
-                        + this.remoteCacheServerAttributes.getAllowClusterGet() + "]" );
+                        + this.remoteCacheServerAttributes.isAllowClusterGet() + "]" );
                 }
                 returnElement = c.localGet( key );
             }
@@ -643,12 +643,12 @@ public class RemoteCacheServer<K extends
             // failover recovery.  Removed items may show up.  There is no good way to prevent this.
             // We should make it configurable.
 
-            if ( !fromCluster && this.remoteCacheServerAttributes.getAllowClusterGet() )
+            if ( !fromCluster && this.remoteCacheServerAttributes.isAllowClusterGet() )
             {
                 if ( log.isDebugEnabled() )
                 {
                     log.debug( "NonLocalGetMatching. fromCluster [" + fromCluster + "] AllowClusterGet ["
-                        + this.remoteCacheServerAttributes.getAllowClusterGet() + "]" );
+                        + this.remoteCacheServerAttributes.isAllowClusterGet() + "]" );
                 }
                 elements = c.getMatching( pattern );
             }
@@ -661,7 +661,7 @@ public class RemoteCacheServer<K extends
                 if ( log.isDebugEnabled() )
                 {
                     log.debug( "LocalGetMatching.  fromCluster [" + fromCluster + "] AllowClusterGet ["
-                        + this.remoteCacheServerAttributes.getAllowClusterGet() + "]" );
+                        + this.remoteCacheServerAttributes.isAllowClusterGet() + "]" );
                 }
                 elements = c.localGetMatching( pattern );
             }
@@ -756,14 +756,8 @@ public class RemoteCacheServer<K extends
      */
     private boolean isRequestFromCluster( long requesterId )
     {
-        Integer remoteTypeL = idTypeMap.get( Long.valueOf( requesterId ) );
-
-        boolean fromCluster = false;
-        if ( remoteTypeL != null && remoteTypeL.intValue() == IRemoteCacheAttributes.CLUSTER )
-        {
-            fromCluster = true;
-        }
-        return fromCluster;
+        RemoteType remoteTypeL = idTypeMap.get( Long.valueOf( requesterId ) );
+        return remoteTypeL == RemoteType.CLUSTER;
     }
 
     /**
@@ -797,12 +791,12 @@ public class RemoteCacheServer<K extends
             // data from those that were up when the failed server comes back on
             // line.
 
-            if ( !fromCluster && this.remoteCacheServerAttributes.getAllowClusterGet() )
+            if ( !fromCluster && this.remoteCacheServerAttributes.isAllowClusterGet() )
             {
                 if ( log.isDebugEnabled() )
                 {
                     log.debug( "NonLocalGetMultiple. fromCluster [" + fromCluster + "] AllowClusterGet ["
-                        + this.remoteCacheServerAttributes.getAllowClusterGet() + "]" );
+                        + this.remoteCacheServerAttributes.isAllowClusterGet() + "]" );
                 }
 
                 returnElements = c.getMultiple( keys );
@@ -816,7 +810,7 @@ public class RemoteCacheServer<K extends
                 if ( log.isDebugEnabled() )
                 {
                     log.debug( "LocalGetMultiple.  fromCluster [" + fromCluster + "] AllowClusterGet ["
-                        + this.remoteCacheServerAttributes.getAllowClusterGet() + "]" );
+                        + this.remoteCacheServerAttributes.isAllowClusterGet() + "]" );
                 }
 
                 returnElements = c.localGetMultiple( keys );
@@ -997,7 +991,7 @@ public class RemoteCacheServer<K extends
 
                 // UPDATE LOCALS IF A REQUEST COMES FROM A CLUSTER
                 // IF LOCAL CLUSTER CONSISTENCY IS CONFIGURED
-                if ( !fromCluster || ( fromCluster && remoteCacheServerAttributes.getLocalClusterConsistency() ) )
+                if ( !fromCluster || ( fromCluster && remoteCacheServerAttributes.isLocalClusterConsistency() ) )
                 {
                     ICacheEventQueue<K, V>[] qlist = getEventQList( cacheDesc, requesterId );
 
@@ -1086,7 +1080,7 @@ public class RemoteCacheServer<K extends
                 }
 
                 // update registered listeners
-                if ( !fromCluster || ( fromCluster && remoteCacheServerAttributes.getLocalClusterConsistency() ) )
+                if ( !fromCluster || ( fromCluster && remoteCacheServerAttributes.isLocalClusterConsistency() ) )
                 {
                     ICacheEventQueue<K, V>[] qlist = getEventQList( cacheDesc, requesterId );
 
@@ -1354,8 +1348,8 @@ public class RemoteCacheServer<K extends
 
         String listenerAddress = ircl.getLocalHostAddress();
 
-        int remoteType = ircl.getRemoteType();
-        if ( remoteType == IRemoteCacheAttributes.CLUSTER )
+        RemoteType remoteType = ircl.getRemoteType();
+        if ( remoteType == RemoteType.CLUSTER )
         {
             log.debug( "adding cluster listener, listenerAddress [" + listenerAddress + "]" );
             cacheListeners = (CacheListeners<KK, VV>)getClusterListeners( cacheName );
@@ -1411,7 +1405,7 @@ public class RemoteCacheServer<K extends
                 }
 
                 // relate the type to an id
-                this.idTypeMap.put( Long.valueOf( id ), Integer.valueOf( remoteType ) );
+                this.idTypeMap.put( Long.valueOf( id ), remoteType);
                 if ( listenerAddress != null )
                 {
                     this.idIPMap.put( Long.valueOf( id ), listenerAddress );

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerAttributes.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerAttributes.java?rev=1408056&r1=1408055&r2=1408056&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerAttributes.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerAttributes.java Sun Nov 11 17:49:54 2012
@@ -6,88 +6,52 @@ package org.apache.jcs.auxiliary.remote.
  * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance with the License. You may obtain a
  * copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software distributed under the License
  * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
 
-import org.apache.jcs.auxiliary.AbstractAuxiliaryCacheAttributes;
-import org.apache.jcs.auxiliary.AuxiliaryCacheAttributes;
-import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheConstants;
+import org.apache.jcs.auxiliary.remote.CommonRemoteCacheAttributes;
 import org.apache.jcs.auxiliary.remote.server.behavior.IRemoteCacheServerAttributes;
 
 /**
  * These attributes are used to configure the remote cache server.
  */
 public class RemoteCacheServerAttributes
-    extends AbstractAuxiliaryCacheAttributes
+    extends CommonRemoteCacheAttributes
     implements IRemoteCacheServerAttributes
 {
     /** Don't change */
     private static final long serialVersionUID = -2741662082869155365L;
 
-    /** Name of the remote service. */
-    private String remoteServiceName = IRemoteCacheConstants.REMOTE_CACHE_SERVICE_VAL;
-
-    /** The remote host. */
-    private String remoteHost;
-
-    /** The registry remote port. */
-    private int remotePort;
-
-    /**
-     * Failover servers will be used by local caches one at a time. Listeners will be registered
-     * with all cluster servers. If we add a get from cluster attribute we will have the ability to
-     * chain clusters and have them get from each other.
-     */
-    private String clusterServers = "";
-
     /** port the server will listen to */
     private int servicePort = 0;
 
-    /** Cluster or local */
-    private int remoteType = LOCAL;
-
-    /** Remove item when put */
-    private boolean removeUponRemotePut = true;
-
-    /** Ony get, don't put */
-    private boolean getOnly = false;
-
-    /** Can a cluster remote put to other remotes */
-    private boolean localClusterConsistency = true;
-
     /** Can a cluster remote get from other remotes */
     private boolean allowClusterGet = true;
 
-    /** The config file, the initializationis multistage. Remote cache then composite cache. */
+    /** The config file, the initialization is multistage. Remote cache then composite cache. */
     private String configFileName = "";
 
-    /** Factory socket time out. */
-    public static final int DEFAULT_RMI_SOCKET_FACTORY_TIMEOUT_MS = 10000;
-
-    /** Connect and read timeout. */
-    private int rmiSocketFactoryTimeoutMillis = DEFAULT_RMI_SOCKET_FACTORY_TIMEOUT_MS;
-    
     /** Should we start the registry */
     private boolean DEFAULT_START_REGISTRY = true;
-    
+
     /** Should we start the registry */
     private boolean startRegistry = DEFAULT_START_REGISTRY;
-    
+
     /** Should we try to keep the registry alive */
     private boolean DEFAULT_USE_REGISTRY_KEEP_ALIVE = true;
-    
+
     /** Should we try to keep the registry alive */
     private boolean useRegistryKeepAlive = DEFAULT_USE_REGISTRY_KEEP_ALIVE;
 
     /** The delay between runs */
     private long registryKeepAliveDelayMillis = 15 * 1000;
-    
+
     /** Default constructor for the RemoteCacheAttributes object */
     public RemoteCacheServerAttributes()
     {
@@ -95,159 +59,6 @@ public class RemoteCacheServerAttributes
     }
 
     /**
-     * Gets the remoteTypeName attribute of the RemoteCacheAttributes object
-     * <p>
-     * @return The remoteTypeName value
-     */
-    public String getRemoteTypeName()
-    {
-        if ( remoteType == LOCAL )
-        {
-            return "LOCAL";
-        }
-        else if ( remoteType == CLUSTER )
-        {
-            return "CLUSTER";
-        }
-        return "LOCAL";
-    }
-
-    /**
-     * Sets the remoteTypeName attribute of the RemoteCacheAttributes object
-     * <p>
-     * @param s The new remoteTypeName value
-     */
-    public void setRemoteTypeName( String s )
-    {
-        if ( s.equals( "LOCAL" ) )
-        {
-            remoteType = LOCAL;
-        }
-        else if ( s.equals( "CLUSTER" ) )
-        {
-            remoteType = CLUSTER;
-        }
-    }
-
-    /**
-     * Gets the remoteType attribute of the RemoteCacheAttributes object
-     * <p>
-     * @return The remoteType value
-     */
-    public int getRemoteType()
-    {
-        return remoteType;
-    }
-
-    /**
-     * Sets the remoteType attribute of the RemoteCacheAttributes object
-     * <p>
-     * @param p The new remoteType value
-     */
-    public void setRemoteType( int p )
-    {
-        this.remoteType = p;
-    }
-
-    /**
-     * clones
-     * <p>
-     * @return AuxiliaryCacheAttributes clone
-     */
-    public AuxiliaryCacheAttributes copy()
-    {
-        try
-        {
-            return (AuxiliaryCacheAttributes) this.clone();
-        }
-        catch ( Exception e )
-        {
-            // swallow
-        }
-        return this;
-    }
-
-    /**
-     * Gets the remoteServiceName attribute of the RemoteCacheAttributes object
-     * <p>
-     * @return The remoteServiceName value
-     */
-    public String getRemoteServiceName()
-    {
-        return this.remoteServiceName;
-    }
-
-    /**
-     * Sets the remoteServiceName attribute of the RemoteCacheAttributes object
-     * <p>
-     * @param s The new remoteServiceName value
-     */
-    public void setRemoteServiceName( String s )
-    {
-        this.remoteServiceName = s;
-    }
-
-    /**
-     * Gets the remoteHost attribute of the RemoteCacheAttributes object
-     * <p>
-     * @return The remoteHost value
-     */
-    public String getRemoteHost()
-    {
-        return this.remoteHost;
-    }
-
-    /**
-     * Sets the remoteHost attribute of the RemoteCacheAttributes object
-     * <p>
-     * @param s The new remoteHost value
-     */
-    public void setRemoteHost( String s )
-    {
-        this.remoteHost = s;
-    }
-
-    /**
-     * Gets the remotePort attribute of the RemoteCacheAttributes object
-     * <p>
-     * @return The remotePort value
-     */
-    public int getRemotePort()
-    {
-        return this.remotePort;
-    }
-
-    /**
-     * Sets the remotePort attribute of the RemoteCacheAttributes object
-     * <p>
-     * @param p The new remotePort value
-     */
-    public void setRemotePort( int p )
-    {
-        this.remotePort = p;
-    }
-
-    /**
-     * Gets the clusterServers attribute of the RemoteCacheAttributes object
-     * <p>
-     * @return The clusterServers value
-     */
-    public String getClusterServers()
-    {
-        return this.clusterServers;
-    }
-
-    /**
-     * Sets the clusterServers attribute of the RemoteCacheAttributes object
-     * <p>
-     * @param s The new clusterServers value
-     */
-    public void setClusterServers( String s )
-    {
-        this.clusterServers = s;
-    }
-
-    /**
      * Gets the localPort attribute of the RemoteCacheAttributes object
      * <p>
      * @return The localPort value
@@ -268,86 +79,6 @@ public class RemoteCacheServerAttributes
     }
 
     /**
-     * Gets the removeUponRemotePut attribute of the RemoteCacheAttributes object
-     * <p>
-     * @return The removeUponRemotePut value
-     */
-    public boolean getRemoveUponRemotePut()
-    {
-        return this.removeUponRemotePut;
-    }
-
-    /**
-     * Sets the removeUponRemotePut attribute of the RemoteCacheAttributes object
-     * <p>
-     * @param r The new removeUponRemotePut value
-     */
-    public void setRemoveUponRemotePut( boolean r )
-    {
-        this.removeUponRemotePut = r;
-    }
-
-    /**
-     * Gets the getOnly attribute of the RemoteCacheAttributes object
-     * <p>
-     * @return The getOnly value
-     */
-    public boolean getGetOnly()
-    {
-        return this.getOnly;
-    }
-
-    /**
-     * Sets the getOnly attribute of the RemoteCacheAttributes object
-     * <p>
-     * @param r The new getOnly value
-     */
-    public void setGetOnly( boolean r )
-    {
-        this.getOnly = r;
-    }
-
-    /**
-     * Should cluster updates be propagated to the locals
-     * <p>
-     * @return The localClusterConsistency value
-     */
-    public boolean getLocalClusterConsistency()
-    {
-        return isLocalClusterConsistency();
-    }
-
-    /**
-     * Should cluster updates be propagated to the locals
-     * <p>
-     * @return The localClusterConsistency value
-     */
-    public boolean isLocalClusterConsistency()
-    {
-        return localClusterConsistency;
-    }
-    
-    /**
-     * Should cluster updates be propagated to the locals
-     * <p>
-     * @param r The new localClusterConsistency value
-     */
-    public void setLocalClusterConsistency( boolean r )
-    {
-        this.localClusterConsistency = r;
-    }
-
-    /**
-     * Should gets from non-cluster clients be allowed to get from other remote auxiliaries.
-     * <p>
-     * @return The localClusterConsistency value
-     */
-    public boolean getAllowClusterGet()
-    {
-        return isAllowClusterGet();
-    }
-
-    /**
      * Should gets from non-cluster clients be allowed to get from other remote auxiliaries.
      * <p>
      * @return The localClusterConsistency value
@@ -356,7 +87,7 @@ public class RemoteCacheServerAttributes
     {
         return allowClusterGet;
     }
-    
+
     /**
      * Should we try to get from other cluster servers if we don't find the items locally.
      * <p>
@@ -388,22 +119,6 @@ public class RemoteCacheServerAttributes
     }
 
     /**
-     * @param rmiSocketFactoryTimeoutMillis The rmiSocketFactoryTimeoutMillis to set.
-     */
-    public void setRmiSocketFactoryTimeoutMillis( int rmiSocketFactoryTimeoutMillis )
-    {
-        this.rmiSocketFactoryTimeoutMillis = rmiSocketFactoryTimeoutMillis;
-    }
-
-    /**
-     * @return Returns the rmiSocketFactoryTimeoutMillis.
-     */
-    public int getRmiSocketFactoryTimeoutMillis()
-    {
-        return rmiSocketFactoryTimeoutMillis;
-    }
-
-    /**
      * Should we try to keep the registry alive
      * <p>
      * @param useRegistryKeepAlive the useRegistryKeepAlive to set
@@ -465,15 +180,9 @@ public class RemoteCacheServerAttributes
     @Override
     public String toString()
     {
-        StringBuffer buf = new StringBuffer();
-        buf.append( "\n remoteHost = [" + this.getRemoteHost() + "]" );
-        buf.append( "\n remotePort = [" + this.getRemotePort() + "]" );
+        StringBuffer buf = new StringBuffer(super.toString());
         buf.append( "\n servicePort = [" + this.getServicePort() + "]" );
-        buf.append( "\n cacheName = [" + this.getCacheName() + "]" );
-        buf.append( "\n removeUponRemotePut = [" + this.getRemoveUponRemotePut() + "]" );
-        buf.append( "\n getOnly = [" + this.getGetOnly() + "]" );
-        buf.append( "\n allowClusterGet = [" + this.getAllowClusterGet() + "]" );
-        buf.append( "\n localClusterConsistency = [" + this.getLocalClusterConsistency() + "]" );
+        buf.append( "\n allowClusterGet = [" + this.isAllowClusterGet() + "]" );
         buf.append( "\n configFileName = [" + this.getConfigFileName() + "]" );
         buf.append( "\n rmiSocketFactoryTimeoutMillis = [" + this.getRmiSocketFactoryTimeoutMillis() + "]" );
         buf.append( "\n startRegistry = [" + this.isStartRegistry() + "]" );

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerFactory.java?rev=1408056&r1=1408055&r2=1408056&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerFactory.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerFactory.java Sun Nov 11 17:49:54 2012
@@ -109,16 +109,48 @@ public class RemoteCacheServerFactory
             {
                 return;
             }
-            if ( host == null )
-            {
-                host = "";
-            }
             if ( log.isInfoEnabled() )
             {
                 log.info( "ConfigFileName = [" + propFile + "]" );
             }
             Properties props = RemoteUtils.loadProps( propFile );
-            RemoteCacheServerAttributes rcsa = configureServerAttributes( propFile );
+            startup(host, port, props);
+        }
+    }
+
+    /**
+     * 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
+     * @param port
+     * @param props
+     * @throws IOException
+     */
+    public static void startup( String host, int port, Properties props )
+        throws IOException
+    {
+        if ( remoteCacheServer != null )
+        {
+            throw new IllegalArgumentException( "Server already started." );
+        }
+
+        synchronized ( RemoteCacheServer.class )
+        {
+            if ( remoteCacheServer != null )
+            {
+                return;
+            }
+            if ( host == null )
+            {
+                host = "";
+            }
+
+            RemoteCacheServerAttributes rcsa = configureRemoteCacheServerAttributes(props);
+            //rcsa.setConfigFileName( propFile );
+
             // These should come from the file!
             rcsa.setRemotePort( port );
             rcsa.setRemoteHost( host );
@@ -278,25 +310,6 @@ public class RemoteCacheServerFactory
     }
 
     /**
-     * Configures the RemoteCacheServerAttributes from the props file.
-     * <p>
-     * @param propFile
-     * @return RemoteCacheServerAttributes
-     * @throws IOException
-     */
-    protected static RemoteCacheServerAttributes configureServerAttributes( String propFile )
-        throws IOException
-    {
-        Properties prop = RemoteUtils.loadProps( propFile );
-        // Properties prop = PropertyLoader.loadProperties( propFile );
-
-        RemoteCacheServerAttributes rcsa = configureRemoteCacheServerAttributes( prop );
-        rcsa.setConfigFileName( propFile );
-
-        return rcsa;
-    }
-
-    /**
      * Configure.
      * <p>
      * jcs.remotecache.serverattributes.ATTRIBUTENAME=ATTRIBUTEVALUE

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/behavior/IRemoteCacheServerAttributes.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/behavior/IRemoteCacheServerAttributes.java?rev=1408056&r1=1408055&r2=1408056&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/behavior/IRemoteCacheServerAttributes.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/behavior/IRemoteCacheServerAttributes.java Sun Nov 11 17:49:54 2012
@@ -19,87 +19,21 @@ package org.apache.jcs.auxiliary.remote.
  * under the License.
  */
 
-import org.apache.jcs.auxiliary.AuxiliaryCacheAttributes;
+import org.apache.jcs.auxiliary.remote.behavior.ICommonRemoteCacheAttributes;
 
 /**
- * This defeines the minimal behavior for the objects that are used to configure
+ * This defines the minimal behavior for the objects that are used to configure
  * the remote cache server.
  */
 public interface IRemoteCacheServerAttributes
-    extends AuxiliaryCacheAttributes
+    extends ICommonRemoteCacheAttributes
 {
-    /** A remote cache is either a local cache or a cluster cache */
-    public static int LOCAL = 0;
-
-    /** A remote cache is either a local cache or a cluster cache */
-    public static int CLUSTER = 1;
-
-    /**
-     * Gets the remoteTypeName attribute of the IRemoteCacheAttributes object.
-     * <p>
-     * @return The remoteTypeName value
-     */
-    public String getRemoteTypeName();
-
-    /**
-     * Sets the remoteTypeName attribute of the IRemoteCacheAttributes object.
-     * <p>
-     * @param s
-     *            The new remoteTypeName value
-     */
-    public void setRemoteTypeName( String s );
-
-    /**
-     * Gets the remoteType attribute of the IRemoteCacheAttributes object.
-     * <p>
-     * @return The remoteType value
-     */
-    public int getRemoteType();
-
-    /**
-     * Sets the remoteType attribute of the IRemoteCacheAttributes object.
-     * <p>
-     * @param p
-     *            The new remoteType value
-     */
-    public void setRemoteType( int p );
-
-    /**
-     * Gets the remoteHost attribute of the IRemoteCacheAttributes object.
-     * <p>
-     * @return The remoteHost value
-     */
-    public String getRemoteHost();
-
-    /**
-     * Sets the remoteHost attribute of the IRemoteCacheAttributes object.
-     * <p>
-     * @param s
-     *            The new remoteHost value
-     */
-    public void setRemoteHost( String s );
-
-    /**
-     * Gets the remotePort attribute of the IRemoteCacheAttributes object.
-     * <p>
-     * @return The remotePort value
-     */
-    public int getRemotePort();
-
-    /**
-     * Sets the remotePort attribute of the IRemoteCacheAttributes object.
-     * <p>
-     * @param p
-     *            The new remotePort value
-     */
-    public void setRemotePort( int p );
-
     /**
      * Gets the localPort attribute of the IRemoteCacheAttributes object.
      * <p>
      * @return The localPort value
      */
-    public int getServicePort();
+    int getServicePort();
 
     /**
      * Sets the localPort attribute of the IRemoteCacheAttributes object.
@@ -107,69 +41,7 @@ public interface IRemoteCacheServerAttri
      * @param p
      *            The new localPort value
      */
-    public void setServicePort( int p );
-
-    /**
-     * Gets the clusterServers attribute of the IRemoteCacheAttributes object.
-     * <p>
-     * @return The clusterServers value
-     */
-    public String getClusterServers();
-
-    /**
-     * Sets the clusterServers attribute of the IRemoteCacheAttributes object.
-     * <p>
-     * @param s
-     *            The new clusterServers value
-     */
-    public void setClusterServers( String s );
-
-    /**
-     * Gets the removeUponRemotePut attribute of the IRemoteCacheAttributes.
-     * object.
-     * <p>
-     * @return The removeUponRemotePut value
-     */
-    public boolean getRemoveUponRemotePut();
-
-    /**
-     * Sets the removeUponRemotePut attribute of the IRemoteCacheAttributes.
-     * object
-     * <p>
-     * @param r
-     *            The new removeUponRemotePut value
-     */
-    public void setRemoveUponRemotePut( boolean r );
-
-    /**
-     * Gets the getOnly attribute of the IRemoteCacheAttributes object.
-     * A remote cache is either a local cache or a cluster cache
-     * @return The getOnly value
-     */
-    public boolean getGetOnly();
-
-    /**
-     * Sets the getOnly attribute of the IRemoteCacheAttributes object.
-     * <p>
-     * @param r
-     *            The new getOnly value
-     */
-    public void setGetOnly( boolean r );
-
-    /**
-     * Should cluster updates be propogated to the locals.
-     * <p>
-     * @return The localClusterConsistency value
-     */
-    public boolean getLocalClusterConsistency();
-
-    /**
-     * Should cluster updates be propogated to the locals.
-     * <p>
-     * @param r
-     *            The new localClusterConsistency value
-     */
-    public void setLocalClusterConsistency( boolean r );
+    void setServicePort( int p );
 
     /**
      * Should we try to get remotely when the request does not come in from a
@@ -181,22 +53,22 @@ public interface IRemoteCacheServerAttri
      * <p>
      * @return The localClusterConsistency value
      */
-    public boolean getAllowClusterGet();
+    boolean isAllowClusterGet();
 
     /**
-     * Should cluster updates be propogated to the locals.
+     * Should cluster updates be propagated to the locals.
      * <p>
      * @param r
      *            The new localClusterConsistency value
      */
-    public void setAllowClusterGet( boolean r );
+    void setAllowClusterGet( boolean r );
 
     /**
      * Gets the ConfigFileName attribute of the IRemoteCacheAttributes object.
      * <p>
      * @return The clusterServers value
      */
-    public String getConfigFileName();
+    String getConfigFileName();
 
     /**
      * Sets the ConfigFileName attribute of the IRemoteCacheAttributes object.
@@ -204,53 +76,43 @@ public interface IRemoteCacheServerAttri
      * @param s
      *            The new clusterServers value
      */
-    public void setConfigFileName( String s );
-    
-    /**
-     * @param rmiSocketFactoryTimeoutMillis The rmiSocketFactoryTimeoutMillis to set.
-     */
-    public void setRmiSocketFactoryTimeoutMillis( int rmiSocketFactoryTimeoutMillis );
-
-    /**
-     * @return Returns the rmiSocketFactoryTimeoutMillis.
-     */
-    public int getRmiSocketFactoryTimeoutMillis();
+    void setConfigFileName( String s );
 
     /**
      * Should we try to keep the registry alive
      * <p>
      * @param useRegistryKeepAlive the useRegistryKeepAlive to set
      */
-    public void setUseRegistryKeepAlive( boolean useRegistryKeepAlive );
+    void setUseRegistryKeepAlive( boolean useRegistryKeepAlive );
 
     /**
      * Should we start the registry
      * <p>
      * @param startRegistry the startRegistry to set
      */
-    public void setStartRegistry( boolean startRegistry );
+    void setStartRegistry( boolean startRegistry );
 
     /**
      * Should we start the registry
      * <p>
      * @return the startRegistry
      */
-    public boolean isStartRegistry();
+    boolean isStartRegistry();
 
     /**
      * Should we try to keep the registry alive
      * <p>
      * @return the useRegistryKeepAlive
      */
-    public boolean isUseRegistryKeepAlive();
+    boolean isUseRegistryKeepAlive();
 
     /**
      * @param registryKeepAliveDelayMillis the registryKeepAliveDelayMillis to set
      */
-    public void setRegistryKeepAliveDelayMillis( long registryKeepAliveDelayMillis );
+    void setRegistryKeepAliveDelayMillis( long registryKeepAliveDelayMillis );
 
     /**
      * @return the registryKeepAliveDelayMillis
      */
-    public long getRegistryKeepAliveDelayMillis();
+    long getRegistryKeepAliveDelayMillis();
 }

Added: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/behavior/RemoteType.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/behavior/RemoteType.java?rev=1408056&view=auto
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/behavior/RemoteType.java (added)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/behavior/RemoteType.java Sun Nov 11 17:49:54 2012
@@ -0,0 +1,32 @@
+package org.apache.jcs.auxiliary.remote.server.behavior;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Enum to describe the mode of the remote cache
+ */
+public enum RemoteType
+{
+    /** A remote cache is either a local cache or a cluster cache */
+    LOCAL,
+
+    /** A remote cache is either a local cache or a cluster cache */
+    CLUSTER
+}
\ No newline at end of file

Propchange: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/behavior/RemoteType.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message