svn commit: r726773 - in /jakarta/jcs/trunk: src/conf/ src/java/org/apache/jcs/auxiliary/remote/ src/java/org/apache/jcs/auxiliary/remote/http/behavior/ src/java/org/apache/jcs/auxiliary/remote/http/client/ src/java/org/apache/jcs/auxiliary/remote/http...
[email protected] Mon, 15 Dec 2008 19:16:05 -0000
| Newsgroups | gmane.comp.jakarta.turbine.jcs.devel |
|---|---|
| Message-ID | <[email protected]> |
Author: asmuts
Date: Mon Dec 15 11:16:04 2008
New Revision: 726773
URL: http://svn.apache.org/viewvc?rev=726773&view=rev
Log:
The basic http remote cache functionality is complete. I'm going to change the manager so that there is a separate instance per url and name. But the basics are here.
Added:
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/behavior/
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/behavior/IRemoteHttpCacheClient.java
jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheManagerUnitTest.java
jakarta/jcs/trunk/xdocs/RemoteHttpCacheProperties.xml
Modified:
jakarta/jcs/trunk/src/conf/cacheRHTTP.ccf
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbsractRemoteCacheListener.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbstractRemoteAuxiliaryCache.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbstractRemoteCacheNoWaitFacade.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/behavior/IRemoteHttpCacheConstants.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/AbstractHttpClient.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCache.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheAttributes.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheClient.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheDispatcher.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheFactory.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheManager.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheMonitor.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpClientListener.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/AbstractRemoteCacheService.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteCacheServiceAdaptor.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheServerAttributes.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheService.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheServlet.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheSeviceFactory.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerInfo.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/util/RemoteCacheRequestFactory.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/util/RemoteCacheRequestUtil.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/value/RemoteCacheRequest.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/value/RemoteCacheResponse.java
jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/MockRemoteCacheDispatcher.java
jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheClientUnitTest.java
jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheManualTester.java
jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteCacheServiceAdaptorUnitTest.java
jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheServiceUnitTest.java
jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheSeviceFactoryUnitTest.java
jakarta/jcs/trunk/xdocs/changes.xml
jakarta/jcs/trunk/xdocs/navigation.xml
Modified: jakarta/jcs/trunk/src/conf/cacheRHTTP.ccf
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/conf/cacheRHTTP.ccf?rev=726773&r1=726772&r2=726773&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/conf/cacheRHTTP.ccf (original)
+++ jakarta/jcs/trunk/src/conf/cacheRHTTP.ccf Mon Dec 15 11:16:04 2008
@@ -37,3 +37,4 @@
jcs.auxiliary.RC=org.apache.jcs.auxiliary.remote.http.client.RemoteHttpCacheFactory
jcs.auxiliary.RC.attributes=org.apache.jcs.auxiliary.remote.http.client.RemoteHttpCacheAttributes
jcs.auxiliary.RC.attributes.url=http://localhost:8000/jcs-app/RemoteCache
+jcs.auxiliary.RC.attributes.maxConnectionsPerHost=500
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbsractRemoteCacheListener.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbsractRemoteCacheListener.java?rev=726773&r1=726772&r2=726773&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbsractRemoteCacheListener.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbsractRemoteCacheListener.java Mon Dec 15 11:16:04 2008
@@ -1,5 +1,24 @@
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 java.io.IOException;
import java.io.Serializable;
import java.net.UnknownHostException;
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbstractRemoteAuxiliaryCache.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbstractRemoteAuxiliaryCache.java?rev=726773&r1=726772&r2=726773&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbstractRemoteAuxiliaryCache.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbstractRemoteAuxiliaryCache.java Mon Dec 15 11:16:04 2008
@@ -1,5 +1,24 @@
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 java.io.IOException;
import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbstractRemoteCacheNoWaitFacade.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbstractRemoteCacheNoWaitFacade.java?rev=726773&r1=726772&r2=726773&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbstractRemoteCacheNoWaitFacade.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbstractRemoteCacheNoWaitFacade.java Mon Dec 15 11:16:04 2008
@@ -1,5 +1,24 @@
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 java.io.IOException;
import java.io.Serializable;
import java.util.ArrayList;
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/behavior/IRemoteHttpCacheConstants.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/behavior/IRemoteHttpCacheConstants.java?rev=726773&r1=726772&r2=726773&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/behavior/IRemoteHttpCacheConstants.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/behavior/IRemoteHttpCacheConstants.java Mon Dec 15 11:16:04 2008
@@ -1,5 +1,24 @@
package org.apache.jcs.auxiliary.remote.http.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.
+ */
+
/** Constants used throughout the HTTP remote cache. */
public interface IRemoteHttpCacheConstants
{
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/AbstractHttpClient.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/AbstractHttpClient.java?rev=726773&r1=726772&r2=726773&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/AbstractHttpClient.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/AbstractHttpClient.java Mon Dec 15 11:16:04 2008
@@ -1,5 +1,24 @@
package org.apache.jcs.auxiliary.remote.http.client;
+/*
+ * 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.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpVersion;
import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
@@ -10,12 +29,7 @@
/**
* This class simply configures the http multithreaded connection manager.
* <p>
- * This class does common functions required by basic WSRequestDispatchers such as loading the
- * properties files.
- * <p>
- * This is abstract because it can't do anything. It used to require the reload properties method to
- * be implemented. I was able to get a default implementation of that method here as well. Child
- * classes can overwrite whatever they want.
+ * This is abstract because it can't do anything. Child classes can overwrite whatever they want.
*/
public abstract class AbstractHttpClient
{
@@ -81,8 +95,9 @@
}
}
- getConnectionManager().getParams()
- .setConnectionTimeout( getRemoteHttpCacheAttributes().getConnectionTimeoutMillis() );
+ getConnectionManager().getParams().setConnectionTimeout(
+ getRemoteHttpCacheAttributes()
+ .getConnectionTimeoutMillis() );
// By default we instruct HttpClient to ignore cookies.
String cookiePolicy = CookiePolicy.IGNORE_COOKIES;
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCache.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCache.java?rev=726773&r1=726772&r2=726773&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCache.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCache.java Mon Dec 15 11:16:04 2008
@@ -1,5 +1,24 @@
package org.apache.jcs.auxiliary.remote.http.client;
+/*
+ * 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 java.io.IOException;
import org.apache.commons.logging.Log;
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheAttributes.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheAttributes.java?rev=726773&r1=726772&r2=726773&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheAttributes.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheAttributes.java Mon Dec 15 11:16:04 2008
@@ -1,5 +1,24 @@
package org.apache.jcs.auxiliary.remote.http.client;
+/*
+ * 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.remote.RemoteCacheAttributes;
/** Http client specific settings. */
@@ -10,7 +29,7 @@
private static final long serialVersionUID = -5944327125140505212L;
/** http verison to use. */
- private static final String DEFAULT_HTTP_VERSION = "1.0";
+ private static final String DEFAULT_HTTP_VERSION = "1.1";
/** The max connections allowed per host */
private int maxConnectionsPerHost = 100;
@@ -35,6 +54,12 @@
/** The complete URL to the service. */
private String url;
+
+ /** The default classname for the client. */
+ public static final String DEFAULT_REMOTE_HTTP_CLIENT_CLASS_NAME = RemoteHttpCacheClient.class.getName();
+
+ /** This allows users to inject their own client implementation. */
+ private String remoteHttpClientClassName = DEFAULT_REMOTE_HTTP_CLIENT_CLASS_NAME;
/**
* @param maxConnectionsPerHost the maxConnectionsPerHost to set
@@ -165,6 +190,22 @@
}
/**
+ * @param remoteHttpClientClassName the remoteHttpClientClassName to set
+ */
+ public void setRemoteHttpClientClassName( String remoteHttpClientClassName )
+ {
+ this.remoteHttpClientClassName = remoteHttpClientClassName;
+ }
+
+ /**
+ * @return the remoteHttpClientClassName
+ */
+ public String getRemoteHttpClientClassName()
+ {
+ return remoteHttpClientClassName;
+ }
+
+ /**
* @return String details
*/
public String toString()
@@ -179,6 +220,7 @@
buf.append( "\n includeKeysAndPatternsAsParameter = [" + isIncludeKeysAndPatternsAsParameter() + "]" );
buf.append( "\n includeRequestTypeasAsParameter = [" + isIncludeRequestTypeasAsParameter() + "]" );
buf.append( "\n url = [" + getUrl() + "]" );
+ buf.append( "\n remoteHttpClientClassName = [" + getRemoteHttpClientClassName() + "]" );
buf.append( super.toString() );
return buf.toString();
}
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheClient.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheClient.java?rev=726773&r1=726772&r2=726773&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheClient.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheClient.java Mon Dec 15 11:16:04 2008
@@ -1,5 +1,24 @@
package org.apache.jcs.auxiliary.remote.http.client;
+/*
+ * 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 java.io.IOException;
import java.io.Serializable;
import java.util.Collections;
@@ -9,7 +28,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheDispatcher;
-import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheService;
+import org.apache.jcs.auxiliary.remote.http.client.behavior.IRemoteHttpCacheClient;
import org.apache.jcs.auxiliary.remote.http.server.RemoteCacheServiceAdaptor;
import org.apache.jcs.auxiliary.remote.util.RemoteCacheRequestFactory;
import org.apache.jcs.auxiliary.remote.value.RemoteCacheRequest;
@@ -18,7 +37,7 @@
/** This is the service used by the remote http auxiliary cache. */
public class RemoteHttpCacheClient
- implements IRemoteCacheService
+ implements IRemoteHttpCacheClient
{
/** The Logger. */
private final static Log log = LogFactory.getLog( RemoteCacheServiceAdaptor.class );
@@ -26,6 +45,18 @@
/** The internal client. */
private IRemoteCacheDispatcher remoteDispatcher;
+ /** The remote attributes */
+ private RemoteHttpCacheAttributes remoteHttpCacheAttributes;
+
+ /** Set to true when initialize is called */
+ private boolean initialized = false;
+
+ /** For factory construction. */
+ public RemoteHttpCacheClient()
+ {
+ // does nothing
+ }
+
/**
* Constructs a client.
* <p>
@@ -33,6 +64,7 @@
*/
public RemoteHttpCacheClient( RemoteHttpCacheAttributes attributes )
{
+ setRemoteHttpCacheAttributes( attributes );
initialize( attributes );
}
@@ -42,7 +74,7 @@
* <p>
* @param attributes
*/
- protected void initialize( RemoteHttpCacheAttributes attributes )
+ public void initialize( RemoteHttpCacheAttributes attributes )
{
setRemoteDispatcher( new RemoteHttpCacheDispatcher( attributes ) );
@@ -50,6 +82,7 @@
{
log.info( "Created remote Dispatcher." + getRemoteDispatcher() );
}
+ setInitialized( true );
}
/**
@@ -78,6 +111,12 @@
public ICacheElement get( String cacheName, Serializable key, long requesterId )
throws IOException
{
+ if ( !isInitialized() )
+ {
+ String message = "The Remote Http Client is not initialized. Cannot process request.";
+ log.warn( message );
+ throw new IOException( message );
+ }
RemoteCacheRequest remoteHttpCacheRequest = RemoteCacheRequestFactory.createGetRequest( cacheName, key,
requesterId );
@@ -87,7 +126,7 @@
{
log.debug( "Get [" + key + "] = " + remoteHttpCacheResponse );
}
-
+
ICacheElement retval = null;
if ( remoteHttpCacheResponse != null && remoteHttpCacheResponse.getPayload() != null )
{
@@ -124,12 +163,24 @@
public Map getMatching( String cacheName, String pattern, long requesterId )
throws IOException
{
+ if ( !isInitialized() )
+ {
+ String message = "The Remote Http Client is not initialized. Cannot process request.";
+ log.warn( message );
+ throw new IOException( message );
+ }
+
RemoteCacheRequest remoteHttpCacheRequest = RemoteCacheRequestFactory.createGetMatchingRequest( cacheName,
pattern,
requesterId );
RemoteCacheResponse remoteHttpCacheResponse = getRemoteDispatcher().dispatchRequest( remoteHttpCacheRequest );
+ if ( log.isDebugEnabled() )
+ {
+ log.debug( "GetMatching [" + pattern + "] = " + remoteHttpCacheResponse );
+ }
+
return remoteHttpCacheResponse.getPayload();
}
@@ -161,12 +212,24 @@
public Map getMultiple( String cacheName, Set keys, long requesterId )
throws IOException
{
+ if ( !isInitialized() )
+ {
+ String message = "The Remote Http Client is not initialized. Cannot process request.";
+ log.warn( message );
+ throw new IOException( message );
+ }
+
RemoteCacheRequest remoteHttpCacheRequest = RemoteCacheRequestFactory.createGetMultipleRequest( cacheName,
keys,
requesterId );
RemoteCacheResponse remoteHttpCacheResponse = getRemoteDispatcher().dispatchRequest( remoteHttpCacheRequest );
+ if ( log.isDebugEnabled() )
+ {
+ log.debug( "GetMultiple [" + keys + "] = " + remoteHttpCacheResponse );
+ }
+
return remoteHttpCacheResponse.getPayload();
}
@@ -194,6 +257,13 @@
public void remove( String cacheName, Serializable key, long requesterId )
throws IOException
{
+ if ( !isInitialized() )
+ {
+ String message = "The Remote Http Client is not initialized. Cannot process request.";
+ log.warn( message );
+ throw new IOException( message );
+ }
+
RemoteCacheRequest remoteHttpCacheRequest = RemoteCacheRequestFactory.createRemoveRequest( cacheName, key,
requesterId );
@@ -222,6 +292,13 @@
public void removeAll( String cacheName, long requesterId )
throws IOException
{
+ if ( !isInitialized() )
+ {
+ String message = "The Remote Http Client is not initialized. Cannot process request.";
+ log.warn( message );
+ throw new IOException( message );
+ }
+
RemoteCacheRequest remoteHttpCacheRequest = RemoteCacheRequestFactory.createRemoveAllRequest( cacheName,
requesterId );
@@ -250,6 +327,13 @@
public void update( ICacheElement cacheElement, long requesterId )
throws IOException
{
+ if ( !isInitialized() )
+ {
+ String message = "The Remote Http Client is not initialized. Cannot process request.";
+ log.warn( message );
+ throw new IOException( message );
+ }
+
RemoteCacheRequest remoteHttpCacheRequest = RemoteCacheRequestFactory.createUpdateRequest( cacheElement,
requesterId );
@@ -265,6 +349,13 @@
public void dispose( String cacheName )
throws IOException
{
+ if ( !isInitialized() )
+ {
+ String message = "The Remote Http Client is not initialized. Cannot process request.";
+ log.warn( message );
+ throw new IOException( message );
+ }
+
RemoteCacheRequest remoteHttpCacheRequest = RemoteCacheRequestFactory.createDisposeRequest( cacheName, 0 );
getRemoteDispatcher().dispatchRequest( remoteHttpCacheRequest );
@@ -290,12 +381,23 @@
public Set getGroupKeys( String cacheName, String groupName )
throws IOException
{
+ if ( !isInitialized() )
+ {
+ String message = "The Remote Http Client is not initialized. Cannot process request.";
+ log.warn( message );
+ throw new IOException( message );
+ }
+
RemoteCacheRequest remoteHttpCacheRequest = RemoteCacheRequestFactory.createGetGroupKeysRequest( cacheName,
groupName, 0 );
- getRemoteDispatcher().dispatchRequest( remoteHttpCacheRequest );
+ RemoteCacheResponse remoteHttpCacheResponse = getRemoteDispatcher().dispatchRequest( remoteHttpCacheRequest );
+
+ if ( remoteHttpCacheResponse != null && remoteHttpCacheResponse.getPayload() != null )
+ {
+ return (Set)remoteHttpCacheResponse.getPayload().get( groupName );
+ }
- // FIX ME
return Collections.EMPTY_SET;
}
@@ -303,11 +405,18 @@
* Make and alive request.
* <p>
* @return true if we make a successful alive request.
- * @throws IOException
+ * @throws IOException
*/
- protected boolean isAlive()
+ public boolean isAlive()
throws IOException
{
+ if ( !isInitialized() )
+ {
+ String message = "The Remote Http Client is not initialized. Cannot process request.";
+ log.warn( message );
+ throw new IOException( message );
+ }
+
RemoteCacheRequest remoteHttpCacheRequest = RemoteCacheRequestFactory.createAliveCheckRequest( 0 );
RemoteCacheResponse remoteHttpCacheResponse = getRemoteDispatcher().dispatchRequest( remoteHttpCacheRequest );
@@ -334,4 +443,36 @@
{
return remoteDispatcher;
}
+
+ /**
+ * @param remoteHttpCacheAttributes the remoteHttpCacheAttributes to set
+ */
+ public void setRemoteHttpCacheAttributes( RemoteHttpCacheAttributes remoteHttpCacheAttributes )
+ {
+ this.remoteHttpCacheAttributes = remoteHttpCacheAttributes;
+ }
+
+ /**
+ * @return the remoteHttpCacheAttributes
+ */
+ public RemoteHttpCacheAttributes getRemoteHttpCacheAttributes()
+ {
+ return remoteHttpCacheAttributes;
+ }
+
+ /**
+ * @param initialized the initialized to set
+ */
+ protected void setInitialized( boolean initialized )
+ {
+ this.initialized = initialized;
+ }
+
+ /**
+ * @return the initialized
+ */
+ protected boolean isInitialized()
+ {
+ return initialized;
+ }
}
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheDispatcher.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheDispatcher.java?rev=726773&r1=726772&r2=726773&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheDispatcher.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheDispatcher.java Mon Dec 15 11:16:04 2008
@@ -1,5 +1,24 @@
package org.apache.jcs.auxiliary.remote.http.client;
+/*
+ * 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 java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheFactory.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheFactory.java?rev=726773&r1=726772&r2=726773&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheFactory.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheFactory.java Mon Dec 15 11:16:04 2008
@@ -74,7 +74,8 @@
ArrayList noWaits = new ArrayList();
RemoteHttpCacheManager rcm = RemoteHttpCacheManager.getInstance( cacheMgr, cacheEventLogger, elementSerializer );
- rca.setRemoteType( RemoteCacheAttributes.CLUSTER );
+ // TODO, use the configured value.
+ rca.setRemoteType( RemoteCacheAttributes.LOCAL );
ICache ic = rcm.getCache( rca );
if ( ic != null )
{
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheManager.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheManager.java?rev=726773&r1=726772&r2=726773&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheManager.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheManager.java Mon Dec 15 11:16:04 2008
@@ -30,13 +30,14 @@
import org.apache.jcs.auxiliary.remote.RemoteCacheNoWait;
import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheAttributes;
import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheClient;
-import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheService;
+import org.apache.jcs.auxiliary.remote.http.client.behavior.IRemoteHttpCacheClient;
import org.apache.jcs.engine.behavior.ICache;
import org.apache.jcs.engine.behavior.ICompositeCacheManager;
import org.apache.jcs.engine.behavior.IElementSerializer;
import org.apache.jcs.engine.behavior.IShutdownObserver;
import org.apache.jcs.engine.control.CompositeCacheManager;
import org.apache.jcs.engine.logging.behavior.ICacheEventLogger;
+import org.apache.jcs.utils.config.OptionConverter;
/**
* This is a very crude copy of the RMI remote manager. It needs a lot of work!
@@ -181,7 +182,7 @@
{
RemoteHttpClientListener listener = new RemoteHttpClientListener( cattr, cacheMgr );
- RemoteHttpCacheClient remoteService = createRemoteHttpCacheClientForAttributes( cattr );
+ IRemoteHttpCacheClient remoteService = createRemoteHttpCacheClientForAttributes( cattr );
IRemoteCacheClient remoteCacheClient = new RemoteHttpCache( cattr, remoteService, listener );
remoteCacheClient.setCacheEventLogger( cacheEventLogger );
@@ -204,12 +205,23 @@
* RemoteHttpCacheClient through this method.
* <p>
* @param cattr
- * @return RemoteHttpCacheClient
+ * @return IRemoteHttpCacheClient
*/
- protected RemoteHttpCacheClient createRemoteHttpCacheClientForAttributes( RemoteHttpCacheAttributes cattr )
+ protected IRemoteHttpCacheClient createRemoteHttpCacheClientForAttributes( RemoteHttpCacheAttributes cattr )
{
- RemoteHttpCacheClient remoteService = new RemoteHttpCacheClient( cattr );
- return remoteService;
+ IRemoteHttpCacheClient client = (IRemoteHttpCacheClient) OptionConverter.instantiateByClassName( cattr
+ .getRemoteHttpClientClassName(), IRemoteHttpCacheClient.class, null );
+
+ if ( client == null )
+ {
+ if ( log.isInfoEnabled() )
+ {
+ log.info( "Creating the default client." );
+ }
+ client = new RemoteHttpCacheClient( );
+ }
+ client.initialize( cattr );
+ return client;
}
/**
@@ -233,25 +245,6 @@
}
/**
- * Fixes up all the caches managed by this cache manager.
- * <p>
- * @param remoteService
- */
- public void fixCaches( IRemoteCacheService remoteService )
- {
- synchronized ( caches )
- {
- // this.remoteService = remoteService;
- // // this.remoteWatch.setCacheWatch( remoteWatch );
- // for ( Iterator en = caches.values().iterator(); en.hasNext(); )
- // {
- // RemoteCacheNoWait cache = (RemoteCacheNoWait) en.next();
- // cache.fixCache( this.remoteService );
- // }
- }
- }
-
- /**
* Gets the cacheType attribute of the RemoteCacheManager object
* @return The cacheType value
*/
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheMonitor.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheMonitor.java?rev=726773&r1=726772&r2=726773&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheMonitor.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheMonitor.java Mon Dec 15 11:16:04 2008
@@ -25,17 +25,13 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.jcs.auxiliary.remote.http.client.behavior.IRemoteHttpCacheClient;
import org.apache.jcs.engine.CacheConstants;
/**
- * Used to monitor and repair any failed connection for the remote cache service. By default the
- * monitor operates in a failure driven mode. That is, it goes into a wait state until there is an
- * error. TODO consider moving this into an active monitoring mode. Upon the notification of a
- * connection error, the monitor changes to operate in a time driven mode. That is, it attempts to
- * recover the connections on a periodic basis. When all failed connections are restored, it changes
- * back to the failure driven mode.
- * <p>
- * This simply pings the service until it works.
+ * Upon the notification of a connection error, the monitor changes to operate in a time driven
+ * mode. That is, it attempts to recover the connections on a periodic basis. When all failed
+ * connections are restored, it changes back to the failure driven mode.
*/
public class RemoteHttpCacheMonitor
implements Runnable
@@ -124,7 +120,7 @@
// Run forever.
// Avoid the use of any synchronization in the process of monitoring for
- // performance reason.
+ // performance reasons.
// If exception is thrown owing to synchronization,
// just skip the monitoring until the next round.
/** Main processing method for the RemoteCacheMonitor object */
@@ -209,7 +205,7 @@
{
RemoteHttpCacheAttributes attributes = remoteCache.getRemoteHttpCacheAttributes();
- RemoteHttpCacheClient remoteService = RemoteHttpCacheManager.getInstance()
+ IRemoteHttpCacheClient remoteService = RemoteHttpCacheManager.getInstance()
.createRemoteHttpCacheClientForAttributes( attributes );
if ( log.isInfoEnabled() )
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpClientListener.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpClientListener.java?rev=726773&r1=726772&r2=726773&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpClientListener.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpClientListener.java Mon Dec 15 11:16:04 2008
@@ -1,5 +1,24 @@
package org.apache.jcs.auxiliary.remote.http.client;
+/*
+ * 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.remote.AbsractRemoteCacheListener;
import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheAttributes;
import org.apache.jcs.engine.behavior.ICompositeCacheManager;
Added: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/behavior/IRemoteHttpCacheClient.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/behavior/IRemoteHttpCacheClient.java?rev=726773&view=auto
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/behavior/IRemoteHttpCacheClient.java (added)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/behavior/IRemoteHttpCacheClient.java Mon Dec 15 11:16:04 2008
@@ -0,0 +1,50 @@
+package org.apache.jcs.auxiliary.remote.http.client.behavior;
+
+import java.io.IOException;
+
+import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheService;
+import org.apache.jcs.auxiliary.remote.http.client.RemoteHttpCacheAttributes;
+
+/*
+ * 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.
+ */
+
+/**
+ * It's not entirely clear that this interface is needed. I simply wanted the initialization method.
+ * This could be added to the ICacheSerice method.
+ */
+public interface IRemoteHttpCacheClient
+ extends IRemoteCacheService
+{
+ /**
+ * The provides an extension point. If you want to extend this and use a special dispatcher,
+ * here is the place to do it.
+ * <p>
+ * @param attributes
+ */
+ void initialize( RemoteHttpCacheAttributes attributes );
+
+ /**
+ * Make and alive request.
+ * <p>
+ * @return true if we make a successful alive request.
+ * @throws IOException
+ */
+ boolean isAlive()
+ throws IOException;
+}
\ No newline at end of file
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/AbstractRemoteCacheService.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/AbstractRemoteCacheService.java?rev=726773&r1=726772&r2=726773&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/AbstractRemoteCacheService.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/AbstractRemoteCacheService.java Mon Dec 15 11:16:04 2008
@@ -1,5 +1,24 @@
package org.apache.jcs.auxiliary.remote.http.server;
+/*
+ * 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 java.io.IOException;
import java.io.Serializable;
import java.util.Map;
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteCacheServiceAdaptor.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteCacheServiceAdaptor.java?rev=726773&r1=726772&r2=726773&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteCacheServiceAdaptor.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteCacheServiceAdaptor.java Mon Dec 15 11:16:04 2008
@@ -1,6 +1,27 @@
package org.apache.jcs.auxiliary.remote.http.server;
+/*
+ * 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 java.util.Collections;
import java.util.Map;
+import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -102,6 +123,19 @@
case RemoteCacheRequest.REQUEST_TYPE_ALIVE_CHECK:
response.setSuccess( true );
break;
+ case RemoteCacheRequest.REQUEST_TYPE_DISPOSE:
+ response.setSuccess( true );
+ // DO NOTHING
+ break;
+ case RemoteCacheRequest.REQUEST_TYPE_GET_GROUP_KEYS:
+ Set groupKeys = getRemoteCacheService().getGroupKeys( request.getCacheName(),
+ request.getKey() + "" );
+ if ( groupKeys == null )
+ {
+ groupKeys = Collections.EMPTY_SET;
+ }
+ response.getPayload().put( request.getKey(), groupKeys );
+ break;
default:
String message = "Unknown event type. Cannot process " + request;
log.warn( message );
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheServerAttributes.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheServerAttributes.java?rev=726773&r1=726772&r2=726773&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheServerAttributes.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheServerAttributes.java Mon Dec 15 11:16:04 2008
@@ -1,5 +1,24 @@
package org.apache.jcs.auxiliary.remote.http.server;
+/*
+ * 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;
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheService.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheService.java?rev=726773&r1=726772&r2=726773&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheService.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheService.java Mon Dec 15 11:16:04 2008
@@ -1,5 +1,24 @@
package org.apache.jcs.auxiliary.remote.http.server;
+/*
+ * 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 java.io.IOException;
import java.io.Serializable;
import java.util.Map;
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheServlet.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheServlet.java?rev=726773&r1=726772&r2=726773&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheServlet.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheServlet.java Mon Dec 15 11:16:04 2008
@@ -59,6 +59,12 @@
/** This needs to be standard, since the other side is standard */
private StandardSerializer serializer = new StandardSerializer();
+ /** Number of service calls. */
+ private int serviceCalls = 0;
+
+ /** The interval at which we will log the count. */
+ private int logInterval = 100;
+
/**
* Initializes the cache.
* <p>
@@ -88,9 +94,10 @@
public void service( HttpServletRequest request, HttpServletResponse response )
throws ServletException, IOException
{
+ incrementServiceCallCount();
if ( log.isDebugEnabled() )
{
- log.debug( "Servicing a request." );
+ log.debug( "Servicing a request. " + request );
}
RemoteCacheRequest remoteRequest = readRequest( request );
@@ -114,7 +121,7 @@
InputStream inputStream = request.getInputStream();
if ( log.isDebugEnabled() )
{
- log.debug( "after getting input stream and before reading it" );
+ log.debug( "After getting input stream and before reading it" );
}
remoteRequest = readRequestFromStream( inputStream );
@@ -177,6 +184,22 @@
}
/**
+ * Log some details.
+ */
+ private void incrementServiceCallCount()
+ {
+ // not thread safe, but it doesn't have to be accurate
+ serviceCalls++;
+ if ( log.isInfoEnabled() )
+ {
+ if ( serviceCalls % logInterval == 0 )
+ {
+ log.info( "serviceCalls = " + serviceCalls );
+ }
+ }
+ }
+
+ /**
* Make sure we have a cache manager. This should have happened in the init method.
*/
protected synchronized void ensureCacheManager()
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheSeviceFactory.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheSeviceFactory.java?rev=726773&r1=726772&r2=726773&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheSeviceFactory.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheSeviceFactory.java Mon Dec 15 11:16:04 2008
@@ -1,5 +1,24 @@
package org.apache.jcs.auxiliary.remote.http.server;
+/*
+ * 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 java.util.Properties;
import org.apache.commons.logging.Log;
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerInfo.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerInfo.java?rev=726773&r1=726772&r2=726773&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerInfo.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerInfo.java Mon Dec 15 11:16:04 2008
@@ -21,9 +21,7 @@
import java.rmi.dgc.VMID;
-/**
- * A shared static variable holder for the server.
- */
+/** A shared static variable holder for the server. */
public class RemoteCacheServerInfo
{
/** shouldn't be instantiated */
@@ -42,5 +40,4 @@
/** By default it is the VMID. */
public static long listenerId = vmid.hashCode();
-
}
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/util/RemoteCacheRequestFactory.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/util/RemoteCacheRequestFactory.java?rev=726773&r1=726772&r2=726773&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/util/RemoteCacheRequestFactory.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/util/RemoteCacheRequestFactory.java Mon Dec 15 11:16:04 2008
@@ -171,7 +171,7 @@
RemoteCacheRequest request = new RemoteCacheRequest();
request.setCacheName( cacheName );
request.setRequesterId( requesterId );
- request.setRequestType( RemoteCacheRequest.REQUEST_TYPE_DIPOSE );
+ request.setRequestType( RemoteCacheRequest.REQUEST_TYPE_DISPOSE );
if ( log.isDebugEnabled() )
{
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/util/RemoteCacheRequestUtil.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/util/RemoteCacheRequestUtil.java?rev=726773&r1=726772&r2=726773&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/util/RemoteCacheRequestUtil.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/util/RemoteCacheRequestUtil.java Mon Dec 15 11:16:04 2008
@@ -29,7 +29,7 @@
return "Update";
case RemoteCacheRequest.REQUEST_TYPE_GET_GROUP_KEYS:
return "GetGroupKeys";
- case RemoteCacheRequest.REQUEST_TYPE_DIPOSE:
+ case RemoteCacheRequest.REQUEST_TYPE_DISPOSE:
return "Dispose";
default:
return "Unknown";
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/value/RemoteCacheRequest.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/value/RemoteCacheRequest.java?rev=726773&r1=726772&r2=726773&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/value/RemoteCacheRequest.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/value/RemoteCacheRequest.java Mon Dec 15 11:16:04 2008
@@ -42,7 +42,7 @@
public static final byte REQUEST_TYPE_GET_GROUP_KEYS = 7;
/** Remove All request type. */
- public static final byte REQUEST_TYPE_DIPOSE = 8;
+ public static final byte REQUEST_TYPE_DISPOSE = 8;
/** The request type specifies the type of request: get, put, remove, . . */
private byte requestType = -1;
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/value/RemoteCacheResponse.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/value/RemoteCacheResponse.java?rev=726773&r1=726772&r2=726773&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/value/RemoteCacheResponse.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/value/RemoteCacheResponse.java Mon Dec 15 11:16:04 2008
@@ -19,7 +19,7 @@
/** Simple error messaging */
private String errorMessage;
-
+
/**
* The payload. Typically a key / ICacheElement map. A normal get will return a map with one
* record.
Modified: jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/MockRemoteCacheDispatcher.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/MockRemoteCacheDispatcher.java?rev=726773&r1=726772&r2=726773&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/MockRemoteCacheDispatcher.java (original)
+++ jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/MockRemoteCacheDispatcher.java Mon Dec 15 11:16:04 2008
@@ -1,5 +1,24 @@
package org.apache.jcs.auxiliary.remote.http.client;
+/*
+ * 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 java.io.IOException;
import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheDispatcher;
Modified: jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheClientUnitTest.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheClientUnitTest.java?rev=726773&r1=726772&r2=726773&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheClientUnitTest.java (original)
+++ jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheClientUnitTest.java Mon Dec 15 11:16:04 2008
@@ -1,5 +1,24 @@
package org.apache.jcs.auxiliary.remote.http.client;
+/*
+ * 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 java.io.IOException;
import java.util.Collections;
import java.util.Map;
@@ -243,7 +262,7 @@
client.dispose( cacheName );
// VERIFY
- assertEquals( "Wrong type.", RemoteCacheRequest.REQUEST_TYPE_DIPOSE, mockDispatcher.lastRemoteCacheRequest
+ assertEquals( "Wrong type.", RemoteCacheRequest.REQUEST_TYPE_DISPOSE, mockDispatcher.lastRemoteCacheRequest
.getRequestType() );
}
}
Added: jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheManagerUnitTest.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheManagerUnitTest.java?rev=726773&view=auto
==============================================================================
--- jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheManagerUnitTest.java (added)
+++ jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheManagerUnitTest.java Mon Dec 15 11:16:04 2008
@@ -0,0 +1,98 @@
+package org.apache.jcs.auxiliary.remote.http.client;
+
+/*
+ * 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 junit.framework.TestCase;
+
+import org.apache.jcs.auxiliary.AuxiliaryCache;
+import org.apache.jcs.auxiliary.remote.http.client.behavior.IRemoteHttpCacheClient;
+import org.apache.jcs.engine.behavior.ICompositeCacheManager;
+import org.apache.jcs.engine.behavior.IElementSerializer;
+import org.apache.jcs.engine.logging.behavior.ICacheEventLogger;
+
+/** Unit tests for the manager. */
+public class RemoteHttpCacheManagerUnitTest
+ extends TestCase
+{
+ /** Verify that we get the default. */
+ public void testCreateRemoteHttpCacheClient_Bad()
+ {
+ // SETUP
+ ICompositeCacheManager cacheMgr = null;
+ ICacheEventLogger cacheEventLogger = null;
+ IElementSerializer elementSerializer = null;
+
+ String remoteHttpClientClassName = "junk";
+ RemoteHttpCacheAttributes cattr = new RemoteHttpCacheAttributes();
+ cattr.setRemoteHttpClientClassName( remoteHttpClientClassName );
+
+ RemoteHttpCacheManager manager = RemoteHttpCacheManager.getInstance( cacheMgr, cacheEventLogger,
+ elementSerializer );
+
+ // DO WORK
+ IRemoteHttpCacheClient result = manager.createRemoteHttpCacheClientForAttributes( cattr );
+
+ // VEIFY
+ assertNotNull( "Should have a cache.", result );
+ assertTrue( "Wrong default.", result instanceof RemoteHttpCacheClient );
+ assertTrue( "Should be initialized", ((RemoteHttpCacheClient)result).isInitialized() );
+ }
+
+ /** Verify that we get the default. */
+ public void testCreateRemoteHttpCacheClient_deafult()
+ {
+ // SETUP
+ ICompositeCacheManager cacheMgr = null;
+ ICacheEventLogger cacheEventLogger = null;
+ IElementSerializer elementSerializer = null;
+
+ RemoteHttpCacheAttributes cattr = new RemoteHttpCacheAttributes();
+
+ RemoteHttpCacheManager manager = RemoteHttpCacheManager.getInstance( cacheMgr, cacheEventLogger,
+ elementSerializer );
+
+ // DO WORK
+ IRemoteHttpCacheClient result = manager.createRemoteHttpCacheClientForAttributes( cattr );
+
+ // VEIFY
+ assertNotNull( "Should have a cache.", result );
+ assertTrue( "Wrong default.", result instanceof RemoteHttpCacheClient );
+ }
+
+ /** Verify that we get a cache no wait. */
+ public void testGetCache_normal()
+ {
+ // SETUP
+ ICompositeCacheManager cacheMgr = null;
+ ICacheEventLogger cacheEventLogger = null;
+ IElementSerializer elementSerializer = null;
+
+ RemoteHttpCacheAttributes cattr = new RemoteHttpCacheAttributes();
+
+ RemoteHttpCacheManager manager = RemoteHttpCacheManager.getInstance( cacheMgr, cacheEventLogger,
+ elementSerializer );
+
+ // DO WORK
+ AuxiliaryCache result = manager.getCache( cattr );
+
+ // VEIFY
+ assertNotNull( "Should have a cache.", result );
+ }
+}
Modified: jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheManualTester.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheManualTester.java?rev=726773&r1=726772&r2=726773&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheManualTester.java (original)
+++ jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheManualTester.java Mon Dec 15 11:16:04 2008
@@ -1,5 +1,24 @@
package org.apache.jcs.auxiliary.remote.http.client;
+/*
+ * 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 junit.framework.TestCase;
import org.apache.jcs.JCS;
Modified: jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteCacheServiceAdaptorUnitTest.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteCacheServiceAdaptorUnitTest.java?rev=726773&r1=726772&r2=726773&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteCacheServiceAdaptorUnitTest.java (original)
+++ jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteCacheServiceAdaptorUnitTest.java Mon Dec 15 11:16:04 2008
@@ -1,5 +1,24 @@
package org.apache.jcs.auxiliary.remote.http.server;
+/*
+ * 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 java.io.Serializable;
import java.util.Collections;
import java.util.Set;
Modified: jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheServiceUnitTest.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheServiceUnitTest.java?rev=726773&r1=726772&r2=726773&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheServiceUnitTest.java (original)
+++ jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheServiceUnitTest.java Mon Dec 15 11:16:04 2008
@@ -1,5 +1,24 @@
package org.apache.jcs.auxiliary.remote.http.server;
+/*
+ * 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 java.io.Serializable;
import java.util.HashSet;
Modified: jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheSeviceFactoryUnitTest.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheSeviceFactoryUnitTest.java?rev=726773&r1=726772&r2=726773&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheSeviceFactoryUnitTest.java (original)
+++ jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheSeviceFactoryUnitTest.java Mon Dec 15 11:16:04 2008
@@ -1,5 +1,24 @@
package org.apache.jcs.auxiliary.remote.http.server;
+/*
+ * 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 java.util.Properties;
import junit.framework.TestCase;
Added: jakarta/jcs/trunk/xdocs/RemoteHttpCacheProperties.xml
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/xdocs/RemoteHttpCacheProperties.xml?rev=726773&view=auto
==============================================================================
--- jakarta/jcs/trunk/xdocs/RemoteHttpCacheProperties.xml (added)
+++ jakarta/jcs/trunk/xdocs/RemoteHttpCacheProperties.xml Mon Dec 15 11:16:04 2008
@@ -0,0 +1,116 @@
+<?xml version="1.0"?>
+ <!--
+ 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.
+ -->
+<document>
+ <properties>
+ <title>Remote Http Cache Configuration</title>
+ <author email="[email protected]">Aaron Smuts</author>
+ </properties>
+ <body>
+ <section name="Remote Auxiliary Http Cache Configuration">
+ <p> The following properties apply to the Remote Http Cache plugin.</p>
+ <subsection name="Remote Http Client Configuration Properties">
+ <table>
+ <tr>
+ <th>Property</th>
+ <th>Description</th>
+ <th>Required</th>
+ <th>Default Value</th>
+ </tr>
+ <tr>
+ <td>url</td>
+ <td> This is the full url for the http service.</td>
+ <td>Y</td>
+ <td>n/a</td>
+ </tr>
+ <tr>
+ <td>maxConnectionsPerHost</td>
+ <td> Maximum simultaneous connections per host.</td>
+ <td>N</td>
+ <td>100</td>
+ </tr>
+ <tr>
+ <td>socketTimeoutMillis</td>
+ <td> Read timeout.</td>
+ <td>N</td>
+ <td>3000</td>
+ </tr>
+ <tr>
+ <td>connectionTimeoutMillis</td>
+ <td> Connection timeout.</td>
+ <td>N</td>
+ <td>5000</td>
+ </tr>
+ <tr>
+ <td>httpVersion</td>
+ <td> The http version to use.</td>
+ <td>N</td>
+ <td>1.1</td>
+ </tr>
+ <tr>
+ <td>includeCacheNameAsParameter</td>
+ <td> Should the cache name be appended to the url.</td>
+ <td>N</td>
+ <td>true</td>
+ </tr>
+ <tr>
+ <td>includeKeysAndPatternsAsParameter
+ </td>
+ <td> Should the key be appended to the url.</td>
+ <td>N</td>
+ <td>true</td>
+ </tr>
+ <tr>
+ <td>includeRequestTypeasAsParameter
+ </td>
+ <td> Should the request type be appended to the url.</td>
+ <td>N</td>
+ <td>true</td>
+ </tr>
+ <tr>
+ <td>remoteHttpClientClassName
+ </td>
+ <td> This allows you to specify your own client implementation.</td>
+ <td>N</td>
+ <td>RemoteHttpCacheClient.class.getName()</td>
+ </tr>
+ <tr>
+ <td>ZombieQueueMaxSize</td>
+ <td> The number of elements the zombie queue will hold. This queue
+ is used to store events if we lose our connection with the
+ server.</td>
+ <td>N</td>
+ <td>1000</td>
+ </tr>
+ </table>
+ </subsection>
+ <subsection name="Example Configuration">
+ <source>
+ <![CDATA[
+# This remote client does not receive
+jcs.auxiliary.RC=org.apache.jcs.auxiliary.remote.http.client.RemoteCacheFactory
+jcs.auxiliary.RC.attributes=org.apache.jcs.auxiliary.remote.RemoteCacheAttributes
+jcs.auxiliary.RC.attributes.FailoverServers=localhost:1101,localhost:1102
+jcs.auxiliary.RC.attributes.LocalPort=1201
+jcs.auxiliary.RC.attributes.RemoveUponRemotePut=false
+jcs.auxiliary.RC.attributes.RmiSocketFactoryTimeoutMillis=5000
+jcs.auxiliary.RC.attributes.GetOnly=false
+jcs.auxiliary.RC.attributes.Receive=false
+ ]]>
+ </source>
+ </subsection>
+ </section>
+ </body>
+</document>
\ No newline at end of file
Modified: jakarta/jcs/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/xdocs/changes.xml?rev=726773&r1=726772&r2=726773&view=diff
==============================================================================
--- jakarta/jcs/trunk/xdocs/changes.xml (original)
+++ jakarta/jcs/trunk/xdocs/changes.xml Mon Dec 15 11:16:04 2008
@@ -21,7 +21,9 @@
<body>
<release version="1.4-dev" date="in SVN">
</release>
- <release version="1.3.2.7" date="2008-12-05" description="tempbuild">
+ <release version="1.3.2.7" date="2008-12-15" description="tempbuild">
+ <action dev="asmuts" type="update">Added a simple http remote
+ cache client and server.</action>
<action dev="asmuts" type="fix">Fixed bug in the MySQLDiskCache
optimizer. It can now use a shared pool.</action>
</release>
Modified: jakarta/jcs/trunk/xdocs/navigation.xml
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/xdocs/navigation.xml?rev=726773&r1=726772&r2=726773&view=diff
==============================================================================
--- jakarta/jcs/trunk/xdocs/navigation.xml (original)
+++ jakarta/jcs/trunk/xdocs/navigation.xml Mon Dec 15 11:16:04 2008
@@ -76,6 +76,8 @@
<item name="Remote Cache" href="/RemoteAuxCache.html" />
<item name="Remote Cache Properties"
href="/RemoteCacheProperties.html" />
+ <item name="Remote Http Cache Properties"
+ href="/RemoteHttpCacheProperties.html" />
<item name="Lateral TCP Cache"
href="/LateralTCPAuxCache.html" />
<item name="Lateral TCP Properties"