[maven-release-plugin] copy for tag commons-jcs-2.0-beta-1
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/jcs/tags/commons-jcs-2.0-beta-1@1660837 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/NOTICE.txt b/NOTICE.txt
index 54c104e..be30f70 100644
--- a/NOTICE.txt
+++ b/NOTICE.txt
@@ -1,10 +1,5 @@
Apache Commons JCS
-Copyright 2001-2014 The Apache Software Foundation.
-Portions Copyright (c) Xerox Corporation 1998-2001.
+Copyright 2001-2015 The Apache Software Foundation.
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
-See the LICENSE.txt file.
-
-This product includes software developed at Xerox Corporation.
-See the LICENSE.xerox file.
diff --git a/commons-jcs-core/LICENSE.txt b/commons-jcs-core/LICENSE.txt
index 5dcdee1..6b0b127 100644
--- a/commons-jcs-core/LICENSE.txt
+++ b/commons-jcs-core/LICENSE.txt
@@ -201,16 +201,3 @@
See the License for the specific language governing permissions and
limitations under the License.
-
--------------------------------------------------------------------------------
-
-Copyright (c) Xerox Corporation 1998-2001. All rights reserved.
-
-Use and copying of this software and preparation of derivative works based
-upon this software are permitted. Any distribution of this software or
-derivative works must comply with all applicable United States export control
-laws.
-
-This software is made available AS IS, and Xerox Corporation makes no warranty
-about the software, its performance or its conformity to any specification.
-
diff --git a/commons-jcs-core/NOTICE b/commons-jcs-core/NOTICE
index 2b6fa3d..13fc80c 100644
--- a/commons-jcs-core/NOTICE
+++ b/commons-jcs-core/NOTICE
@@ -1,10 +1,6 @@
Apache Commons JCS
-Copyright 2001-2014 The Apache Software Foundation.
-Portions Copyright (c) Xerox Corporation 1998-2001.
+Copyright 2001-2015 The Apache Software Foundation.
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
-See the LICENSE.txt file.
-This product includes software developed at Xerox Corporation.
-See the Xerox part in LICENSE.txt file.
diff --git a/commons-jcs-core/pom.xml b/commons-jcs-core/pom.xml
index 9793826..c282721 100644
--- a/commons-jcs-core/pom.xml
+++ b/commons-jcs-core/pom.xml
@@ -159,17 +159,10 @@
</configuration>
</plugin>
<plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>rmic-maven-plugin</artifactId>
- <version>1.2.1</version>
- </plugin>
- <plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
<configuration>
<excludes combine.children="append">
- <exclude>src/aspect/org/apache/commons/Trace.aj</exclude>
- <exclude>**/LICENSE.xerox</exclude>
<exclude>**/zipcodes.txt</exclude>
</excludes>
</configuration>
@@ -177,26 +170,6 @@
</plugins>
</pluginManagement>
<plugins>
- <!-- We need to generate some stub/skel classes with RMIC -->
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>rmic-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>rmic</id>
- <goals>
- <goal>rmic</goal>
- </goals>
- <configuration>
- <includes>
- <include>**/RemoteCacheListener.class</include>
- <include>**/RemoteCacheServer.class</include>
- </includes>
- <outputDirectory>${project.build.outputDirectory}</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
diff --git a/commons-jcs-core/src/aspect/org/apache/commons/GetTiming.aj b/commons-jcs-core/src/aspect/org/apache/commons/GetTiming.aj
deleted file mode 100644
index e4fa32f..0000000
--- a/commons-jcs-core/src/aspect/org/apache/commons/GetTiming.aj
+++ /dev/null
@@ -1,71 +0,0 @@
-import org.aspectj.lang.*;
-
-/*
- * 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.
- */
-
-aspect GetTiming {
-
-// static final void println(String s){ System.out.println(s); }
-
-// pointcut allExecs(): !within(GetTiming) && cflow(this(com.realm.arch.proxy.PageProxyServlet)) && execution(* *(..));
-
- pointcut allExecs():
-
-// !within(GetTiming)
- !withincode(void org.apache.commons.jcs.utils.log.Logger.*(..))
- && !withincode(void org.apache.commons.jcs.utils.log.Logger.*(..))
- && (cflow(this(org.apache.commons.jcs.engine.control.Cache))
-// || cflow(this(org.apache.commons.jcs.engine.group.GroupCache))
- )
-// && !withincode(* *.getValueObj(..))
-//
-// && execution(* *(..));
-
- && execution(* *(..));
-
-
- Object around(): allExecs() {
- long start = System.currentTimeMillis();
- String s = thisJoinPointStaticPart.getSignature().getName()
- + " in class: "
- + thisJoinPointStaticPart.getSignature().getDeclaringType().getName();
- //+ printParameters(thisJoinPoint);
- Object result = proceed();
- long delta = System.currentTimeMillis() - start;
- if (delta >= 0) {
- System.out.println(delta+ " ms: "+s);
- }
- return result;
- }
-
-/*
- static private void printParameters(JoinPoint jp) {
- System.out.println("Arguments: " );
- Object[] args = jp.getArgs();
- String[] names = ((CodeSignature)jp.getSignature()).getParameterNames();
- Class[] types = ((CodeSignature)jp.getSignature()).getParameterTypes();
- for (int i = 0; i < args.length; i++) {
- System.out.println(" " + i + ". " + names[i] +
- " : " + types[i].getName() +
- " = " + args[i]);
- }
- }
-*/
-
-}
diff --git a/commons-jcs-core/src/aspect/org/apache/commons/JCSTrace.aj b/commons-jcs-core/src/aspect/org/apache/commons/JCSTrace.aj
deleted file mode 100644
index 5fa550a..0000000
--- a/commons-jcs-core/src/aspect/org/apache/commons/JCSTrace.aj
+++ /dev/null
@@ -1,56 +0,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.
- */
-
-aspect JCSTrace {
- /**
- * Application classes.
- */
- // turned it off
- pointcut myClass(): !within(org.apache.stratum.*) ;
- /**
- * The constructors in those classes.
- */
- pointcut myConstructor(): myClass() && execution(new(..));
- /**
- * The methods of those classes.
- */
- pointcut myMethod(): myClass() && execution(* *(..));
-
- /**
- * Prints trace messages before and after executing constructors.
- */
- before (): myConstructor() {
- Trace.traceEntry("" + thisJoinPointStaticPart.getSignature());
- }
- after(): myConstructor() {
- Trace.traceExit("" + thisJoinPointStaticPart.getSignature());
- }
-
- /**
- * Prints trace messages before and after executing methods.
- */
- before (): myMethod() {
- Trace.traceEntry("" + thisJoinPoint.getSignature());
- }
- after(): myMethod() {
- Trace.traceExit("" + thisJoinPoint.getSignature());
- }
-
-}
-
diff --git a/commons-jcs-core/src/aspect/org/apache/commons/ShowSlow.aj b/commons-jcs-core/src/aspect/org/apache/commons/ShowSlow.aj
deleted file mode 100644
index 164301f..0000000
--- a/commons-jcs-core/src/aspect/org/apache/commons/ShowSlow.aj
+++ /dev/null
@@ -1,71 +0,0 @@
-import org.aspectj.lang.*;
-
-/*
- * 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.
- */
-
-aspect ShowSlow {
-
-// static final void println(String s){ System.out.println(s); }
-
-// pointcut allExecs(): !within(GetTiming) && cflow(this(com.realm.arch.proxy.PageProxyServlet)) && execution(* *(..));
-
- pointcut allExecs():
-
-// !within(GetTiming)
- !withincode(void org.apache.commons.jcs.utils.log.Logger.*(..))
- && !withincode(void org.apache.commons.jcs.utils.log.Logger.*(..))
-// && (cflow(this(org.apache.commons.jcs.engine.control.Cache))
-// || cflow(this(org.apache.commons.jcs.engine.group.GroupCache))
-// )
-// && !withincode(* *.getValueObj(..))
-//
-// && execution(* *(..));
-
- && execution(* *(..));
-
-
- Object around(): allExecs() {
- long start = System.currentTimeMillis();
- String s = thisJoinPointStaticPart.getSignature().getName()
- + " in class: "
- + thisJoinPointStaticPart.getSignature().getDeclaringType().getName();
- //+ printParameters(thisJoinPoint);
- Object result = proceed();
- long delta = System.currentTimeMillis() - start;
- if (delta > 10) {
- System.out.println(delta+ " ms: "+s);
- }
- return result;
- }
-
-/*
- static private void printParameters(JoinPoint jp) {
- System.out.println("Arguments: " );
- Object[] args = jp.getArgs();
- String[] names = ((CodeSignature)jp.getSignature()).getParameterNames();
- Class[] types = ((CodeSignature)jp.getSignature()).getParameterTypes();
- for (int i = 0; i < args.length; i++) {
- System.out.println(" " + i + ". " + names[i] +
- " : " + types[i].getName() +
- " = " + args[i]);
- }
- }
-*/
-
-}
diff --git a/commons-jcs-core/src/aspect/org/apache/commons/Trace.aj b/commons-jcs-core/src/aspect/org/apache/commons/Trace.aj
deleted file mode 100644
index c7b53b5..0000000
--- a/commons-jcs-core/src/aspect/org/apache/commons/Trace.aj
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
-
-Copyright (c) Xerox Corporation 1998-2001. All rights reserved.
-
-Use and copying of this software and preparation of derivative works based
-upon this software are permitted. Any distribution of this software or
-derivative works must comply with all applicable United States export control
-laws.
-
-This software is made available AS IS, and Xerox Corporation makes no warranty
-about the software, its performance or its conformity to any specification.
-
-|<--- this code is formatted to fit into 80 columns --->|
-|<--- this code is formatted to fit into 80 columns --->|
-|<--- this code is formatted to fit into 80 columns --->|
-
-*/
-
-
-import java.io.PrintStream;
-
-/**
- *
- * This class provides some basic functionality for printing trace messages
- * into a stream.
- *
- */
-public class Trace {
- /**
- * There are 3 trace levels (values of TRACELEVEL):
- * 0 - No messages are printed
- * 1 - Trace messages are printed, but there is no indentation
- * according to the call stack
- * 2 - Trace messages are printed, and they are indented
- * according to the call stack
- */
- public static int TRACELEVEL = 0;
- protected static PrintStream stream = null;
- protected static int callDepth = 0;
-
- /**
- * Initialization.
- */
- public static void initStream(PrintStream s) {
- stream = s;
- }
-
- /**
- * Prints an "entering" message. It is intended to be called in the
- * beginning of the blocks to be traced.
- */
- public static void traceEntry(String str) {
- if (TRACELEVEL == 0) return;
- if (TRACELEVEL == 2) callDepth++;
- printEntering(str);
- }
-
- /**
- * Prints an "exiting" message. It is intended to be called in the
- * end of the blocks to be traced.
- */
- public static void traceExit(String str) {
- if (TRACELEVEL == 0) return;
- printExiting(str);
- if (TRACELEVEL == 2) callDepth--;
- }
-
- private static void printEntering(String str) {
- printIndent();
- stream.println("--> " + str);
- }
-
- private static void printExiting(String str) {
- printIndent();
- stream.println("<-- " + str);
- }
-
- private static void printIndent() {
- for (int i = 0; i < callDepth; i++)
- stream.print(" ");
- }
-}
diff --git a/commons-jcs-core/src/aspect/org/apache/commons/jcs/TraceJCS.aj b/commons-jcs-core/src/aspect/org/apache/commons/jcs/TraceJCS.aj
deleted file mode 100644
index fed3ff5..0000000
--- a/commons-jcs-core/src/aspect/org/apache/commons/jcs/TraceJCS.aj
+++ /dev/null
@@ -1,176 +0,0 @@
-package org.apache.commons.jcs;
-
-/*
- * 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.log4j.Category;
-
-/**
- * This class provides support for printing trace messages into a
- * log4j category.
- *
- * The messages are appended with the string representation of the objects
- * whose constructors and methods are being traced.
- *
- * @author <a href="mailto:jvanzyl@zenplex.com">Jason van Zyl</a>
- * @author <a href="mailto:james@jamestaylor.org">James Taylor</a>
- * @version $Id$
- */
-public aspect TraceJCS
-{
- /*
- * Functional part
- */
-
- /**
- * There are 3 trace levels (values of TRACELEVEL):
- *
- * 0 - No messages are printed
- * 1 - Trace messages are printed, but there is no indentation
- * according to the call stack
- * 2 - Trace messages are printed, and they are indented
- * according to the call stack
- */
- public static int TRACELEVEL = 2;
-
- /**
- * Tracks the call depth for indented traces made according
- * to the structure of the stack.
- */
- protected static int callDepth = 0;
-
- /**
- * Log4j category used for tracing.
- */
- private static Category log = Category.getInstance( TraceJCS.class );
-
- /**
- * Tracing method used in before advice.
- */
- protected static void traceEntry(String str, Object o)
- {
- if (TRACELEVEL == 0)
- {
- return;
- }
-
- if (TRACELEVEL == 2)
- {
- callDepth++;
- }
- printEntering(str + ": " + o.toString());
- }
-
- /**
- * Tracing method used in after advice.
- */
- protected static void traceExit(String str, Object o)
- {
- if (TRACELEVEL == 0)
- {
- return;
- }
-
- printExiting(str + ": " + o.toString());
-
- if (TRACELEVEL == 2)
- {
- callDepth--;
- }
- }
-
- private static void printEntering(String str)
- {
- log.debug(indent() + "--> " + str);
- }
-
- private static void printExiting(String str)
- {
- log.debug(indent() + "<-- " + str);
- }
-
- private static String indent()
- {
- StringBuffer sb = new StringBuffer();
-
- for (int i = 0; i < callDepth; i++)
- {
- sb.append(" ");
- }
-
- return sb.toString();
- }
-
- /*
- * Crosscut part
- */
-
- /**
- * JCS Application classes
- */
- pointcut myClass(Object obj): this(obj) &&
- (within(org.apache.stratum.jcs..*));
-
- /**
- * The constructors in those classes.
- */
- pointcut myConstructor(Object obj): myClass(obj) && execution(new(..));
-
- /**
- * The methods of those classes.
- */
- pointcut myMethod(Object obj): myClass(obj) &&
- execution(* *(..)) && !execution(String toString());
-
- /**
- * Before advice that will execute before a constructor
- * is invoked.
- */
- before(Object obj): myConstructor(obj)
- {
- traceEntry("" + thisJoinPointStaticPart.getSignature(), obj);
- }
-
- /**
- * After advice that will execute after a constructor
- * a constructor has been invoked.
- */
- after(Object obj): myConstructor(obj)
- {
- traceExit("" + thisJoinPointStaticPart.getSignature(), obj);
- }
-
- /**
- * Before advice that will execute before a method
- * is invoked.
- */
- before(Object obj): myMethod(obj)
- {
- traceEntry("" + thisJoinPointStaticPart.getSignature(), obj);
- }
-
- /**
- * After advice that will execute after a method
- * has been invoked.
- */
- after(Object obj): myMethod(obj)
- {
- traceExit("" + thisJoinPointStaticPart.getSignature(), obj);
- }
-}
diff --git a/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheListener.java b/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheListener.java
index 0be5635..ff79d7a 100644
--- a/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheListener.java
+++ b/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheListener.java
@@ -65,17 +65,10 @@
super( irca, cacheMgr );
// Export this remote object to make it available to receive incoming
- // calls, using an anonymous port unless the local port is specified.
+ // calls.
try
{
- if ( irca.getLocalPort() > 0 )
- {
- UnicastRemoteObject.exportObject( this, irca.getLocalPort() );
- }
- else
- {
- UnicastRemoteObject.exportObject( this );
- }
+ UnicastRemoteObject.exportObject( this, irca.getLocalPort() );
}
catch ( RemoteException ex )
{
diff --git a/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServer.java b/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServer.java
index cea01dc..7fbbcbc 100644
--- a/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServer.java
+++ b/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServer.java
@@ -19,29 +19,8 @@
* under the License.
*/
-import org.apache.commons.jcs.access.exception.CacheException;
-import org.apache.commons.jcs.auxiliary.remote.behavior.IRemoteCacheListener;
-import org.apache.commons.jcs.auxiliary.remote.behavior.IRemoteCacheObserver;
-import org.apache.commons.jcs.auxiliary.remote.server.behavior.IRemoteCacheServerAttributes;
-import org.apache.commons.jcs.auxiliary.remote.server.behavior.RemoteType;
-import org.apache.commons.jcs.engine.CacheEventQueueFactory;
-import org.apache.commons.jcs.engine.CacheListeners;
-import org.apache.commons.jcs.engine.behavior.ICacheElement;
-import org.apache.commons.jcs.engine.behavior.ICacheEventQueue;
-import org.apache.commons.jcs.engine.behavior.ICacheListener;
-import org.apache.commons.jcs.engine.behavior.ICacheServiceAdmin;
-import org.apache.commons.jcs.engine.behavior.ICacheServiceNonLocal;
-import org.apache.commons.jcs.engine.control.CompositeCache;
-import org.apache.commons.jcs.engine.control.CompositeCacheManager;
-import org.apache.commons.jcs.engine.logging.CacheEvent;
-import org.apache.commons.jcs.engine.logging.behavior.ICacheEvent;
-import org.apache.commons.jcs.engine.logging.behavior.ICacheEventLogger;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
import java.io.IOException;
import java.io.Serializable;
-import java.rmi.Remote;
import java.rmi.RemoteException;
import java.rmi.registry.Registry;
import java.rmi.server.RMISocketFactory;
@@ -53,6 +32,24 @@
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
+import org.apache.commons.jcs.access.exception.CacheException;
+import org.apache.commons.jcs.auxiliary.remote.behavior.IRemoteCacheListener;
+import org.apache.commons.jcs.auxiliary.remote.server.behavior.IRemoteCacheServer;
+import org.apache.commons.jcs.auxiliary.remote.server.behavior.IRemoteCacheServerAttributes;
+import org.apache.commons.jcs.auxiliary.remote.server.behavior.RemoteType;
+import org.apache.commons.jcs.engine.CacheEventQueueFactory;
+import org.apache.commons.jcs.engine.CacheListeners;
+import org.apache.commons.jcs.engine.behavior.ICacheElement;
+import org.apache.commons.jcs.engine.behavior.ICacheEventQueue;
+import org.apache.commons.jcs.engine.behavior.ICacheListener;
+import org.apache.commons.jcs.engine.control.CompositeCache;
+import org.apache.commons.jcs.engine.control.CompositeCacheManager;
+import org.apache.commons.jcs.engine.logging.CacheEvent;
+import org.apache.commons.jcs.engine.logging.behavior.ICacheEvent;
+import org.apache.commons.jcs.engine.logging.behavior.ICacheEventLogger;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
/**
* This class provides remote cache services. The remote cache server propagates events from local
* caches to other local caches. It can also store cached data, making it available to new clients.
@@ -70,7 +67,7 @@
*/
public class RemoteCacheServer<K, V>
extends UnicastRemoteObject
- implements ICacheServiceNonLocal<K, V>, IRemoteCacheObserver, ICacheServiceAdmin, Remote, Unreferenced
+ implements IRemoteCacheServer<K, V>, Unreferenced
{
/** For serialization. Don't change. */
private static final long serialVersionUID = -8072345435941473116L;
diff --git a/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServerFactory.java b/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServerFactory.java
index 4b6de9e..7c1cbb3 100644
--- a/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServerFactory.java
+++ b/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServerFactory.java
@@ -389,7 +389,7 @@
log.info( "Unbinding host=" + host + ", port=" + port + ", serviceName=" + getServiceName() );
try
{
- Naming.unbind( "//" + host + ":" + port + "/" + getServiceName() );
+ Naming.unbind( RemoteUtils.getNamingURL(host, port, getServiceName()) );
}
catch ( MalformedURLException ex )
{
@@ -448,7 +448,7 @@
if ( args.length > 0 && args[0].toLowerCase().indexOf( "-shutdown" ) != -1 )
{
String remoteServiceName = prop.getProperty( REMOTE_CACHE_SERVICE_NAME, REMOTE_CACHE_SERVICE_VAL ).trim();
- String registry = "//:" + port + "/" + remoteServiceName;
+ String registry = RemoteUtils.getNamingURL("", port, remoteServiceName);
if ( log.isDebugEnabled() )
{
@@ -481,7 +481,7 @@
try
{
String sz = prop.getProperty( REMOTE_CACHE_SERVICE_NAME, REMOTE_CACHE_SERVICE_VAL ).trim();
- String registry = "//:" + port + "/" + sz;
+ String registry = RemoteUtils.getNamingURL("", port, sz);
log.debug( "looking up server " + registry );
Object obj = Naming.lookup( registry );
log.debug( "server found" );
diff --git a/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/remote/server/behavior/IRemoteCacheServer.java b/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/remote/server/behavior/IRemoteCacheServer.java
new file mode 100644
index 0000000..f0aa692
--- /dev/null
+++ b/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/remote/server/behavior/IRemoteCacheServer.java
@@ -0,0 +1,38 @@
+package org.apache.commons.jcs.auxiliary.remote.server.behavior;
+
+import java.rmi.Remote;
+
+import org.apache.commons.jcs.auxiliary.remote.behavior.IRemoteCacheObserver;
+import org.apache.commons.jcs.engine.behavior.ICacheServiceAdmin;
+import org.apache.commons.jcs.engine.behavior.ICacheServiceNonLocal;
+
+/*
+ * 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.
+ */
+
+/**
+ * Interface for managing Remote objects
+ *
+ * @author Thomas Vandahl
+ *
+ */
+public interface IRemoteCacheServer<K, V>
+ extends ICacheServiceNonLocal<K, V>, IRemoteCacheObserver, ICacheServiceAdmin, Remote
+{
+ // empty
+}
diff --git a/commons-jcs-core/src/main/java/org/apache/commons/jcs/engine/behavior/ICacheServiceNonLocal.java b/commons-jcs-core/src/main/java/org/apache/commons/jcs/engine/behavior/ICacheServiceNonLocal.java
index 26acd89..a150b3b 100644
--- a/commons-jcs-core/src/main/java/org/apache/commons/jcs/engine/behavior/ICacheServiceNonLocal.java
+++ b/commons-jcs-core/src/main/java/org/apache/commons/jcs/engine/behavior/ICacheServiceNonLocal.java
@@ -68,7 +68,7 @@
/**
* Returns a cache bean from the specified cache; or null if the key does not exist.
* <p>
- * Adding the requestor id, allows the cache to determine the source of the get.
+ * Adding the requester id, allows the cache to determine the source of the get.
* <p>
* @param cacheName
* @param key
diff --git a/commons-jcs-core/src/main/java/org/apache/commons/jcs/utils/config/PropertySetter.java b/commons-jcs-core/src/main/java/org/apache/commons/jcs/utils/config/PropertySetter.java
index c9fdc2b..f33800d 100644
--- a/commons-jcs-core/src/main/java/org/apache/commons/jcs/utils/config/PropertySetter.java
+++ b/commons-jcs-core/src/main/java/org/apache/commons/jcs/utils/config/PropertySetter.java
@@ -263,6 +263,12 @@
return Boolean.FALSE;
}
}
+ else if( type.isEnum() )
+ {
+ @SuppressWarnings("unchecked") // type check in if()
+ Enum<?> en = Enum.valueOf(type.asSubclass(Enum.class), v );
+ return en;
+ }
else if ( File.class.isAssignableFrom( type ) )
{
return new File( v );
diff --git a/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheClientTester.java b/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheClientTester.java
index 7f718f0..cdb2686 100644
--- a/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheClientTester.java
+++ b/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheClientTester.java
@@ -144,7 +144,7 @@
{
service = REMOTE_CACHE_SERVICE_VAL;
}
- String registry = "//" + host + ":" + port + "/" + service;
+ String registry = RemoteUtils.getNamingURL(host, port, service);
p( "looking up server " + registry );
diff --git a/commons-jcs-core/src/test/java/org/apache/commons/jcs/utils/access/JCSWorkerUnitTest.java b/commons-jcs-core/src/test/java/org/apache/commons/jcs/utils/access/JCSWorkerUnitTest.java
index 02b862b..c4ff5e0 100644
--- a/commons-jcs-core/src/test/java/org/apache/commons/jcs/utils/access/JCSWorkerUnitTest.java
+++ b/commons-jcs-core/src/test/java/org/apache/commons/jcs/utils/access/JCSWorkerUnitTest.java
@@ -32,7 +32,7 @@
{
/**
- * Test basic worker funtionality. This is a serial not a concurrent test.
+ * Test basic worker functionality. This is a serial not a concurrent test.
* <p>
* Just verify that the worker will go to the cache before asking the helper.
*
diff --git a/commons-jcs-core/src/test/java/org/apache/commons/jcs/utils/config/PropertySetterUnitTest.java b/commons-jcs-core/src/test/java/org/apache/commons/jcs/utils/config/PropertySetterUnitTest.java
new file mode 100644
index 0000000..bb363f7
--- /dev/null
+++ b/commons-jcs-core/src/test/java/org/apache/commons/jcs/utils/config/PropertySetterUnitTest.java
@@ -0,0 +1,61 @@
+package org.apache.commons.jcs.utils.config;
+
+/*
+ * 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 static org.junit.Assert.*;
+
+import java.io.File;
+
+import org.junit.Test;
+
+/**
+ * Test property settings
+ *
+ * @author Thomas Vandahl
+ *
+ */
+public class PropertySetterUnitTest
+{
+ enum EnumTest { ONE, TWO, THREE };
+
+ @Test
+ public void testConvertArg()
+ {
+ PropertySetter ps = new PropertySetter(this);
+ Object s = ps.convertArg("test", String.class);
+ assertEquals("Should be a string", "test", s);
+
+ Object i = ps.convertArg("1", Integer.TYPE);
+ assertEquals("Should be an integer", Integer.valueOf(1), i);
+
+ Object l = ps.convertArg("1", Long.TYPE);
+ assertEquals("Should be a long", Long.valueOf(1), l);
+
+ Object b = ps.convertArg("true", Boolean.TYPE);
+ assertEquals("Should be a boolean", Boolean.TRUE, b);
+
+ Object e = ps.convertArg("TWO", EnumTest.class);
+ assertEquals("Should be an enum", EnumTest.TWO, e);
+
+ Object f = ps.convertArg("test.conf", File.class);
+ assertTrue("Should be a file", f instanceof File);
+ }
+
+}
diff --git a/commons-jcs-core/src/test/java/org/apache/commons/jcs/utils/struct/JCSvsCommonsLRUMapPerformanceTest.java b/commons-jcs-core/src/test/java/org/apache/commons/jcs/utils/struct/JCSvsCommonsLRUMapPerformanceTest.java
index 1b56bbb..7db83fc 100644
--- a/commons-jcs-core/src/test/java/org/apache/commons/jcs/utils/struct/JCSvsCommonsLRUMapPerformanceTest.java
+++ b/commons-jcs-core/src/test/java/org/apache/commons/jcs/utils/struct/JCSvsCommonsLRUMapPerformanceTest.java
@@ -144,7 +144,6 @@
// /////////////////////////////////////////////////////////////
cache2Name = "Commons ";
// or LRUMapJCS
- @SuppressWarnings("unchecked")
Map<String, String> cache2 = new org.apache.commons.collections4.map.LRUMap<String, String>( tries );
// cache2Name = "Hashtable";
// Hashtable cache2 = new Hashtable();
diff --git a/commons-jcs-core/src/test/java/org/apache/commons/jcs/utils/struct/LRUMapPerformanceTest.java b/commons-jcs-core/src/test/java/org/apache/commons/jcs/utils/struct/LRUMapPerformanceTest.java
index 67b0eac..47cd760 100644
--- a/commons-jcs-core/src/test/java/org/apache/commons/jcs/utils/struct/LRUMapPerformanceTest.java
+++ b/commons-jcs-core/src/test/java/org/apache/commons/jcs/utils/struct/LRUMapPerformanceTest.java
@@ -136,7 +136,6 @@
///////////////////////////////////////////////////////////////
cache2Name = "LRUMapJCS (commons)";
//or LRUMapJCS
- @SuppressWarnings("unchecked")
Map<String, String> cache2 = new org.apache.commons.collections4.map.LRUMap<String, String>( tries );
//cache2Name = "Hashtable";
//Hashtable cache2 = new Hashtable();
diff --git a/commons-jcs-dist/NOTICE.txt b/commons-jcs-dist/NOTICE.txt
index 54c104e..13fc80c 100644
--- a/commons-jcs-dist/NOTICE.txt
+++ b/commons-jcs-dist/NOTICE.txt
@@ -1,10 +1,6 @@
Apache Commons JCS
-Copyright 2001-2014 The Apache Software Foundation.
-Portions Copyright (c) Xerox Corporation 1998-2001.
+Copyright 2001-2015 The Apache Software Foundation.
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
-See the LICENSE.txt file.
-This product includes software developed at Xerox Corporation.
-See the LICENSE.xerox file.
diff --git a/commons-jcs-jcache-extras/NOTICE.txt b/commons-jcs-jcache-extras/NOTICE.txt
index d00fed7..13fc80c 100644
--- a/commons-jcs-jcache-extras/NOTICE.txt
+++ b/commons-jcs-jcache-extras/NOTICE.txt
@@ -1,7 +1,6 @@
Apache Commons JCS
-Copyright 2001-2014 The Apache Software Foundation.
+Copyright 2001-2015 The Apache Software Foundation.
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
-See the LICENSE.txt file.
diff --git a/commons-jcs-jcache-extras/src/main/java/org/apache/commons/jcs/jcache/extras/web/JCacheFilter.java b/commons-jcs-jcache-extras/src/main/java/org/apache/commons/jcs/jcache/extras/web/JCacheFilter.java
index d878af1..cdfc644 100644
--- a/commons-jcs-jcache-extras/src/main/java/org/apache/commons/jcs/jcache/extras/web/JCacheFilter.java
+++ b/commons-jcs-jcache-extras/src/main/java/org/apache/commons/jcs/jcache/extras/web/JCacheFilter.java
@@ -185,15 +185,15 @@
{
if (Integer.class.isInstance(value))
{
- httpServletResponse.addIntHeader(entry.getKey(), Integer.class.cast(entry.getValue()));
+ httpServletResponse.addIntHeader(entry.getKey(), Integer.class.cast(value));
}
else if (String.class.isInstance(value))
{
- httpServletResponse.addHeader(entry.getKey(), String.class.cast(entry.getValue()));
+ httpServletResponse.addHeader(entry.getKey(), String.class.cast(value));
}
else if (Long.class.isInstance(value))
{
- httpServletResponse.addDateHeader(entry.getKey(), Long.class.cast(entry.getValue()));
+ httpServletResponse.addDateHeader(entry.getKey(), Long.class.cast(value));
}
}
}
diff --git a/commons-jcs-jcache-openjpa/NOTICE.txt b/commons-jcs-jcache-openjpa/NOTICE.txt
index d00fed7..13fc80c 100644
--- a/commons-jcs-jcache-openjpa/NOTICE.txt
+++ b/commons-jcs-jcache-openjpa/NOTICE.txt
@@ -1,7 +1,6 @@
Apache Commons JCS
-Copyright 2001-2014 The Apache Software Foundation.
+Copyright 2001-2015 The Apache Software Foundation.
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
-See the LICENSE.txt file.
diff --git a/commons-jcs-jcache/NOTICE.txt b/commons-jcs-jcache/NOTICE.txt
index d00fed7..13fc80c 100644
--- a/commons-jcs-jcache/NOTICE.txt
+++ b/commons-jcs-jcache/NOTICE.txt
@@ -1,7 +1,6 @@
Apache Commons JCS
-Copyright 2001-2014 The Apache Software Foundation.
+Copyright 2001-2015 The Apache Software Foundation.
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
-See the LICENSE.txt file.
diff --git a/commons-jcs-jcache/pom.xml b/commons-jcs-jcache/pom.xml
index 6ad0bac..cec1ea5 100644
--- a/commons-jcs-jcache/pom.xml
+++ b/commons-jcs-jcache/pom.xml
@@ -68,5 +68,45 @@
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.5</version>
+ <executions>
+ <execution>
+ <id>default-jar</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>cdi-jar</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ <configuration>
+ <includes>
+ <include>org/apache/commons/jcs/jcache/cdi/*</include>
+ </includes>
+ <classifier>cdi</classifier>
+ </configuration>
+ </execution>
+ <execution>
+ <id>no-cdi-jar</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ <configuration>
+ <excludes>
+ <exclude>org/apache/commons/jcs/jcache/cdi/</exclude>
+ </excludes>
+ <classifier>nocdi</classifier>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
-
diff --git a/pom.xml b/pom.xml
index 610bede..d38855d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -207,7 +207,6 @@
<configuration>
<excludes combine.children="append">
<exclude>.java-version</exclude>
- <exclude>**/LICENSE.xerox</exclude>
<exclude>**/zipcodes.txt</exclude>
<exclude>**/download_jcs.cgi</exclude>
<exclude>**/.gitignore</exclude>
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 0b2be5c..4f23987 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -20,6 +20,9 @@
</properties>
<body>
<release version="2.0" date="unreleased" description="JDK 1.6 based major release">
+ <action issue="JCS-139" dev="tv" type="fix" due-to="Youngho Cho">
+ PropertySetter doesn't set Enum properly. Added a test.
+ </action>
<action issue="JCS-136" dev="tv" type="fix" due-to="Youngho Cho">
OutOfMemoryError when using compressing serializer
</action>