Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/utils/props/PropertyLoader.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/utils/props/PropertyLoader.java?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/utils/props/PropertyLoader.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/utils/props/PropertyLoader.java Thu May 10 09:03:42 2007
@@ -1,169 +1,177 @@
-package org.apache.jcs.utils.props;
-
-/*
- * Copyright 2001-2004 The Apache Software Foundation. Licensed 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.InputStream;
-import java.util.Properties;
-
-/**
- * I modified this class to work with .ccf files in particular. I also removed
- * the resource bundle functionality.
- * <p>
- * A simple class for loading java.util.Properties backed by .ccf files deployed
- * as classpath resources. See individual methods for details.
- * <p>
- * The original source is from:
- * <p>
- * @author (C) <a
- * href="http://www.javaworld.com/columns/jw-qna-index.shtml">Vlad
- * Roubtsov </a>, 2003
- */
-public abstract class PropertyLoader
-{
- private static final boolean THROW_ON_LOAD_FAILURE = true;
-
- private static final String SUFFIX = ".ccf";
-
- private static final String SUFFIX_PROPERTIES = ".properties";
-
- /**
- * Looks up a resource named 'name' in the classpath. The resource must map
- * to a file with .ccf extention. The name is assumed to be absolute and can
- * use either "/" or "." for package segment separation with an optional
- * leading "/" and optional ".ccf" suffix.
- * <p>
- * The suffix ".ccf" will be appended if it is not set. This can also handle
- * .properties files
- * <p>
- * Thus, the following names refer to the same resource:
- *
- * <pre>
- *
- * some.pkg.Resource
- * some.pkg.Resource.ccf
- * some/pkg/Resource
- * some/pkg/Resource.ccf
- * /some/pkg/Resource
- * /some/pkg/Resource.ccf
- * </pre>
- *
- * @param name
- * classpath resource name [may not be null]
- * @param loader
- * classloader through which to load the resource [null is
- * equivalent to the application loader]
- * @return resource converted to java.util.properties [may be null if the
- * resource was not found and THROW_ON_LOAD_FAILURE is false]
- * @throws IllegalArgumentException
- * if the resource was not found and THROW_ON_LOAD_FAILURE is
- * true
- */
- public static Properties loadProperties( String name, ClassLoader loader )
- {
- boolean isCCFSuffix = true;
-
- if ( name == null )
- throw new IllegalArgumentException( "null input: name" );
-
- if ( name.startsWith( "/" ) )
- {
- name = name.substring( 1 );
- }
-
- if ( name.endsWith( SUFFIX ) )
- {
- name = name.substring( 0, name.length() - SUFFIX.length() );
- }
-
- if ( name.endsWith( SUFFIX_PROPERTIES ) )
- {
- name = name.substring( 0, name.length() - SUFFIX_PROPERTIES.length() );
- isCCFSuffix = false;
- }
-
- Properties result = null;
-
- InputStream in = null;
- try
- {
- if ( loader == null )
- {
- loader = ClassLoader.getSystemClassLoader();
- }
-
- name = name.replace( '.', '/' );
-
- if ( !name.endsWith( SUFFIX ) && isCCFSuffix )
- {
- name = name.concat( SUFFIX );
- }
- else if ( !name.endsWith( SUFFIX_PROPERTIES ) && !isCCFSuffix )
- {
- name = name.concat( SUFFIX_PROPERTIES );
- }
-
- // returns null on lookup failures:
- in = loader.getResourceAsStream( name );
- if ( in != null )
- {
- result = new Properties();
- result.load( in ); // can throw IOException
- }
- }
- catch ( Exception e )
- {
- result = null;
- }
- finally
- {
- if ( in != null )
- try
- {
- in.close();
- }
- catch ( Throwable ignore )
- {
- // swallow
- }
- }
-
- if ( THROW_ON_LOAD_FAILURE && ( result == null ) )
- {
- throw new IllegalArgumentException( "could not load [" + name + "]" + " as " + "a classloader resource" );
- }
-
- return result;
- }
-
- /**
- * A convenience overload of {@link #loadProperties(String, ClassLoader)}
- * that uses the current thread's context classloader. A better strategy
- * would be to use techniques shown in
- * http://www.javaworld.com/javaworld/javaqa/2003-06/01-qa-0606-load.html
- * <p>
- * @param name
- * @return Properties
- */
- public static Properties loadProperties( final String name )
- {
- return loadProperties( name, Thread.currentThread().getContextClassLoader() );
- }
-
- /**
- * Can't use this one.
- */
- private PropertyLoader()
- {
- super();
- } // this class is not extentible
-
-}
+package org.apache.jcs.utils.props;
+
+/*
+ * 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.InputStream;
+import java.util.Properties;
+
+/**
+ * I modified this class to work with .ccf files in particular. I also removed
+ * the resource bundle functionality.
+ * <p>
+ * A simple class for loading java.util.Properties backed by .ccf files deployed
+ * as classpath resources. See individual methods for details.
+ * <p>
+ * The original source is from:
+ * <p>
+ * @author (C) <a
+ * href="http://www.javaworld.com/columns/jw-qna-index.shtml">Vlad
+ * Roubtsov </a>, 2003
+ */
+public abstract class PropertyLoader
+{
+ private static final boolean THROW_ON_LOAD_FAILURE = true;
+
+ private static final String SUFFIX = ".ccf";
+
+ private static final String SUFFIX_PROPERTIES = ".properties";
+
+ /**
+ * Looks up a resource named 'name' in the classpath. The resource must map
+ * to a file with .ccf extention. The name is assumed to be absolute and can
+ * use either "/" or "." for package segment separation with an optional
+ * leading "/" and optional ".ccf" suffix.
+ * <p>
+ * The suffix ".ccf" will be appended if it is not set. This can also handle
+ * .properties files
+ * <p>
+ * Thus, the following names refer to the same resource:
+ *
+ * <pre>
+ *
+ * some.pkg.Resource
+ * some.pkg.Resource.ccf
+ * some/pkg/Resource
+ * some/pkg/Resource.ccf
+ * /some/pkg/Resource
+ * /some/pkg/Resource.ccf
+ * </pre>
+ *
+ * @param name
+ * classpath resource name [may not be null]
+ * @param loader
+ * classloader through which to load the resource [null is
+ * equivalent to the application loader]
+ * @return resource converted to java.util.properties [may be null if the
+ * resource was not found and THROW_ON_LOAD_FAILURE is false]
+ * @throws IllegalArgumentException
+ * if the resource was not found and THROW_ON_LOAD_FAILURE is
+ * true
+ */
+ public static Properties loadProperties( String name, ClassLoader loader )
+ {
+ boolean isCCFSuffix = true;
+
+ if ( name == null )
+ throw new IllegalArgumentException( "null input: name" );
+
+ if ( name.startsWith( "/" ) )
+ {
+ name = name.substring( 1 );
+ }
+
+ if ( name.endsWith( SUFFIX ) )
+ {
+ name = name.substring( 0, name.length() - SUFFIX.length() );
+ }
+
+ if ( name.endsWith( SUFFIX_PROPERTIES ) )
+ {
+ name = name.substring( 0, name.length() - SUFFIX_PROPERTIES.length() );
+ isCCFSuffix = false;
+ }
+
+ Properties result = null;
+
+ InputStream in = null;
+ try
+ {
+ if ( loader == null )
+ {
+ loader = ClassLoader.getSystemClassLoader();
+ }
+
+ name = name.replace( '.', '/' );
+
+ if ( !name.endsWith( SUFFIX ) && isCCFSuffix )
+ {
+ name = name.concat( SUFFIX );
+ }
+ else if ( !name.endsWith( SUFFIX_PROPERTIES ) && !isCCFSuffix )
+ {
+ name = name.concat( SUFFIX_PROPERTIES );
+ }
+
+ // returns null on lookup failures:
+ in = loader.getResourceAsStream( name );
+ if ( in != null )
+ {
+ result = new Properties();
+ result.load( in ); // can throw IOException
+ }
+ }
+ catch ( Exception e )
+ {
+ result = null;
+ }
+ finally
+ {
+ if ( in != null )
+ try
+ {
+ in.close();
+ }
+ catch ( Throwable ignore )
+ {
+ // swallow
+ }
+ }
+
+ if ( THROW_ON_LOAD_FAILURE && ( result == null ) )
+ {
+ throw new IllegalArgumentException( "could not load [" + name + "]" + " as " + "a classloader resource" );
+ }
+
+ return result;
+ }
+
+ /**
+ * A convenience overload of {@link #loadProperties(String, ClassLoader)}
+ * that uses the current thread's context classloader. A better strategy
+ * would be to use techniques shown in
+ * http://www.javaworld.com/javaworld/javaqa/2003-06/01-qa-0606-load.html
+ * <p>
+ * @param name
+ * @return Properties
+ */
+ public static Properties loadProperties( final String name )
+ {
+ return loadProperties( name, Thread.currentThread().getContextClassLoader() );
+ }
+
+ /**
+ * Can't use this one.
+ */
+ private PropertyLoader()
+ {
+ super();
+ } // this class is not extentible
+
+}
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/utils/serialization/SerializationConversionUtil.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/utils/serialization/SerializationConversionUtil.java?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/utils/serialization/SerializationConversionUtil.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/utils/serialization/SerializationConversionUtil.java Thu May 10 09:03:42 2007
@@ -1,127 +1,146 @@
-package org.apache.jcs.utils.serialization;
-
-import java.io.IOException;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.jcs.engine.CacheElement;
-import org.apache.jcs.engine.CacheElementSerialized;
-import org.apache.jcs.engine.behavior.ICacheElement;
-import org.apache.jcs.engine.behavior.ICacheElementSerialized;
-import org.apache.jcs.engine.behavior.IElementSerializer;
-
-/**
- * This uses a supplied Serialer to convert to and from cache elements.
- * <p>
- * @author Aaron Smuts
- */
-public class SerializationConversionUtil
-{
- private final static Log log = LogFactory.getLog( SerializationConversionUtil.class );
-
- /**
- * This returns a wrapper that has a serialized version of the value instead
- * of the value.
- * <p>
- * @param element
- * @param elementSerializer
- * the serializer to be used.
- * @return null for null;
- * @throws IOException
- */
- public static ICacheElementSerialized getSerializedCacheElement( ICacheElement element,
- IElementSerializer elementSerializer )
- throws IOException
- {
- if ( element == null )
- {
- return null;
- }
-
- byte[] serialzedValue = null;
-
- // if it has already been serialized, don't do it again.
- if ( element instanceof ICacheElementSerialized )
- {
- serialzedValue = ( (ICacheElementSerialized) element ).getSerializedValue();
- }
- else
- {
- if ( elementSerializer != null )
- {
- try
- {
- serialzedValue = elementSerializer.serialize( element.getVal() );
- }
- catch ( IOException e )
- {
- log.error( "Problem serializing object.", e );
- throw e;
- }
- }
- else
- {
- // we could just use the default.
- log.warn( "ElementSerializer is null. Could not serialize object." );
- throw new IOException( "Could not serialize object. The ElementSerializer is null." );
- }
- }
- ICacheElementSerialized serialized = new CacheElementSerialized( element.getCacheName(), element.getKey(),
- serialzedValue, element.getElementAttributes() );
-
- return serialized;
- }
-
- /**
- * This returns a wrapper that has a de-serialized version of the value
- * instead of the serialized value.
- * <p>
- * @param serialized
- * @param elementSerializer
- * the serializer to be used.
- * @return null for null;
- * @throws IOException
- * @throws ClassNotFoundException
- */
- public static ICacheElement getDeSerializedCacheElement( ICacheElementSerialized serialized,
- IElementSerializer elementSerializer )
- throws IOException, ClassNotFoundException
- {
- if ( serialized == null )
- {
- return null;
- }
-
- Object deSerialzedValue = null;
-
- if ( elementSerializer != null )
- {
- try
- {
- try
- {
- deSerialzedValue = elementSerializer.deSerialize( serialized.getSerializedValue() );
- }
- catch ( ClassNotFoundException e )
- {
- log.error( "Problem de-serializing object.", e );
- throw e;
- }
- }
- catch ( IOException e )
- {
- log.error( "Problem de-serializing object.", e );
- throw e;
- }
- }
- else
- {
- // we could just use the default.
- log.warn( "ElementSerializer is null. Could not serialize object." );
- }
- ICacheElement deSerialized = new CacheElement( serialized.getCacheName(), serialized.getKey(), deSerialzedValue );
- deSerialized.setElementAttributes( serialized.getElementAttributes() );
-
- return deSerialized;
- }
-}
+package org.apache.jcs.utils.serialization;
+
+/*
+ * 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;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jcs.engine.CacheElement;
+import org.apache.jcs.engine.CacheElementSerialized;
+import org.apache.jcs.engine.behavior.ICacheElement;
+import org.apache.jcs.engine.behavior.ICacheElementSerialized;
+import org.apache.jcs.engine.behavior.IElementSerializer;
+
+/**
+ * This uses a supplied Serialer to convert to and from cache elements.
+ * <p>
+ * @author Aaron Smuts
+ */
+public class SerializationConversionUtil
+{
+ private final static Log log = LogFactory.getLog( SerializationConversionUtil.class );
+
+ /**
+ * This returns a wrapper that has a serialized version of the value instead
+ * of the value.
+ * <p>
+ * @param element
+ * @param elementSerializer
+ * the serializer to be used.
+ * @return null for null;
+ * @throws IOException
+ */
+ public static ICacheElementSerialized getSerializedCacheElement( ICacheElement element,
+ IElementSerializer elementSerializer )
+ throws IOException
+ {
+ if ( element == null )
+ {
+ return null;
+ }
+
+ byte[] serialzedValue = null;
+
+ // if it has already been serialized, don't do it again.
+ if ( element instanceof ICacheElementSerialized )
+ {
+ serialzedValue = ( (ICacheElementSerialized) element ).getSerializedValue();
+ }
+ else
+ {
+ if ( elementSerializer != null )
+ {
+ try
+ {
+ serialzedValue = elementSerializer.serialize( element.getVal() );
+ }
+ catch ( IOException e )
+ {
+ log.error( "Problem serializing object.", e );
+ throw e;
+ }
+ }
+ else
+ {
+ // we could just use the default.
+ log.warn( "ElementSerializer is null. Could not serialize object." );
+ throw new IOException( "Could not serialize object. The ElementSerializer is null." );
+ }
+ }
+ ICacheElementSerialized serialized = new CacheElementSerialized( element.getCacheName(), element.getKey(),
+ serialzedValue, element.getElementAttributes() );
+
+ return serialized;
+ }
+
+ /**
+ * This returns a wrapper that has a de-serialized version of the value
+ * instead of the serialized value.
+ * <p>
+ * @param serialized
+ * @param elementSerializer
+ * the serializer to be used.
+ * @return null for null;
+ * @throws IOException
+ * @throws ClassNotFoundException
+ */
+ public static ICacheElement getDeSerializedCacheElement( ICacheElementSerialized serialized,
+ IElementSerializer elementSerializer )
+ throws IOException, ClassNotFoundException
+ {
+ if ( serialized == null )
+ {
+ return null;
+ }
+
+ Object deSerialzedValue = null;
+
+ if ( elementSerializer != null )
+ {
+ try
+ {
+ try
+ {
+ deSerialzedValue = elementSerializer.deSerialize( serialized.getSerializedValue() );
+ }
+ catch ( ClassNotFoundException e )
+ {
+ log.error( "Problem de-serializing object.", e );
+ throw e;
+ }
+ }
+ catch ( IOException e )
+ {
+ log.error( "Problem de-serializing object.", e );
+ throw e;
+ }
+ }
+ else
+ {
+ // we could just use the default.
+ log.warn( "ElementSerializer is null. Could not serialize object." );
+ }
+ ICacheElement deSerialized = new CacheElement( serialized.getCacheName(), serialized.getKey(), deSerialzedValue );
+ deSerialized.setElementAttributes( serialized.getElementAttributes() );
+
+ return deSerialized;
+ }
+}
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/utils/serialization/StandardSerializer.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/utils/serialization/StandardSerializer.java?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/utils/serialization/StandardSerializer.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/utils/serialization/StandardSerializer.java Thu May 10 09:03:42 2007
@@ -1,70 +1,89 @@
-package org.apache.jcs.utils.serialization;
-
-import java.io.BufferedInputStream;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-
-import org.apache.jcs.engine.behavior.IElementSerializer;
-
-/**
- * Performs default serialization and de-serialization.
- * <p>
- * @author Aaron Smuts
- */
-public class StandardSerializer
- implements IElementSerializer
-{
- /**
- * Serializes an object using default serilaization.
- */
- public byte[] serialize( Serializable obj )
- throws IOException
- {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- ObjectOutputStream oos = new ObjectOutputStream( baos );
- try
- {
- oos.writeObject( obj );
- }
- finally
- {
- oos.close();
- }
- return baos.toByteArray();
- }
-
- /**
- * Uses default de-serialization to turn a byte array into an object. All
- * exceptions are converted into IOExceptions.
- */
- public Object deSerialize( byte[] data )
- throws IOException, ClassNotFoundException
- {
- ByteArrayInputStream bais = new ByteArrayInputStream( data );
- BufferedInputStream bis = new BufferedInputStream( bais );
- ObjectInputStream ois = new ObjectInputStream( bis );
- try
- {
- try
- {
- return ois.readObject();
- }
- catch ( IOException e )
- {
- throw e;
- }
- catch ( ClassNotFoundException e )
- {
- throw e;
- }
- }
- finally
- {
- ois.close();
- }
- }
-}
+package org.apache.jcs.utils.serialization;
+
+/*
+ * 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.BufferedInputStream;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+
+import org.apache.jcs.engine.behavior.IElementSerializer;
+
+/**
+ * Performs default serialization and de-serialization.
+ * <p>
+ * @author Aaron Smuts
+ */
+public class StandardSerializer
+ implements IElementSerializer
+{
+ /**
+ * Serializes an object using default serilaization.
+ */
+ public byte[] serialize( Serializable obj )
+ throws IOException
+ {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectOutputStream oos = new ObjectOutputStream( baos );
+ try
+ {
+ oos.writeObject( obj );
+ }
+ finally
+ {
+ oos.close();
+ }
+ return baos.toByteArray();
+ }
+
+ /**
+ * Uses default de-serialization to turn a byte array into an object. All
+ * exceptions are converted into IOExceptions.
+ */
+ public Object deSerialize( byte[] data )
+ throws IOException, ClassNotFoundException
+ {
+ ByteArrayInputStream bais = new ByteArrayInputStream( data );
+ BufferedInputStream bis = new BufferedInputStream( bais );
+ ObjectInputStream ois = new ObjectInputStream( bis );
+ try
+ {
+ try
+ {
+ return ois.readObject();
+ }
+ catch ( IOException e )
+ {
+ throw e;
+ }
+ catch ( ClassNotFoundException e )
+ {
+ throw e;
+ }
+ }
+ finally
+ {
+ ois.close();
+ }
+ }
+}
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/utils/servlet/BasicHttpAuthenticator.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/utils/servlet/BasicHttpAuthenticator.java?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/utils/servlet/BasicHttpAuthenticator.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/utils/servlet/BasicHttpAuthenticator.java Thu May 10 09:03:42 2007
@@ -1,14 +1,22 @@
package org.apache.jcs.utils.servlet;
/*
- * Copyright 2001-2004 The Apache Software Foundation. Licensed 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.
+ * 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;
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/utils/servlet/JCSServletContextListener.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/utils/servlet/JCSServletContextListener.java?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/utils/servlet/JCSServletContextListener.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/utils/servlet/JCSServletContextListener.java Thu May 10 09:03:42 2007
@@ -1,71 +1,79 @@
-package org.apache.jcs.utils.servlet;
-
-/*
- * Copyright 2001-2004 The Apache Software Foundation. Licensed 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 javax.servlet.ServletContextEvent;
-import javax.servlet.ServletContextListener;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.jcs.engine.control.CompositeCacheManager;
-
-/**
- * If you add this to the context listeners section of your web.xml file, this will shutdown JCS
- * gracefully.
- * <p>
- * Add the following to the top of your web.xml file.
- *
- * <pre>
- * <listener>
- * <listener-class>
- * org.apache.jcs.utils.servlet.JCSServletContextListener
- * </listener-class>
- * </listener>
- * </pre>
- *
- * @author Aaron Smuts
- */
-public class JCSServletContextListener
- implements ServletContextListener
-{
- private static final Log log = LogFactory.getLog( JCSServletContextListener.class );
-
- /**
- * This does nothing. We don't want to initialize the cache here.
- * <p>
- * (non-Javadoc)
- * @see javax.servlet.ServletContextListener#contextInitialized(javax.servlet.ServletContextEvent)
- */
- public void contextInitialized( ServletContextEvent arg0 )
- {
- if ( log.isInfoEnabled() )
- {
- log.info( "contextInitialized" );
- }
- }
-
- /**
- * This gets the singleton instance of the CompositeCacheManager and calls shutdown.
- * <p>
- * (non-Javadoc)
- * @see javax.servlet.ServletContextListener#contextDestroyed(javax.servlet.ServletContextEvent)
- */
- public void contextDestroyed( ServletContextEvent arg0 )
- {
- if ( log.isInfoEnabled() )
- {
- log.info( "contextDestroyed, shutting down JCS." );
- }
- CompositeCacheManager.getInstance().shutDown();
- }
-
-}
+package org.apache.jcs.utils.servlet;
+
+/*
+ * 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 javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jcs.engine.control.CompositeCacheManager;
+
+/**
+ * If you add this to the context listeners section of your web.xml file, this will shutdown JCS
+ * gracefully.
+ * <p>
+ * Add the following to the top of your web.xml file.
+ *
+ * <pre>
+ * <listener>
+ * <listener-class>
+ * org.apache.jcs.utils.servlet.JCSServletContextListener
+ * </listener-class>
+ * </listener>
+ * </pre>
+ *
+ * @author Aaron Smuts
+ */
+public class JCSServletContextListener
+ implements ServletContextListener
+{
+ private static final Log log = LogFactory.getLog( JCSServletContextListener.class );
+
+ /**
+ * This does nothing. We don't want to initialize the cache here.
+ * <p>
+ * (non-Javadoc)
+ * @see javax.servlet.ServletContextListener#contextInitialized(javax.servlet.ServletContextEvent)
+ */
+ public void contextInitialized( ServletContextEvent arg0 )
+ {
+ if ( log.isInfoEnabled() )
+ {
+ log.info( "contextInitialized" );
+ }
+ }
+
+ /**
+ * This gets the singleton instance of the CompositeCacheManager and calls shutdown.
+ * <p>
+ * (non-Javadoc)
+ * @see javax.servlet.ServletContextListener#contextDestroyed(javax.servlet.ServletContextEvent)
+ */
+ public void contextDestroyed( ServletContextEvent arg0 )
+ {
+ if ( log.isInfoEnabled() )
+ {
+ log.info( "contextDestroyed, shutting down JCS." );
+ }
+ CompositeCacheManager.getInstance().shutDown();
+ }
+
+}
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/BoundedQueue.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/BoundedQueue.java?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/BoundedQueue.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/BoundedQueue.java Thu May 10 09:03:42 2007
@@ -1,83 +1,91 @@
-package org.apache.jcs.utils.struct;
-
-/*
- * Copyright 2001-2004 The Apache Software Foundation. Licensed 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.
- */
-
-/**
- * This is a bounded queue. It only allows maxSize items.
- * <p>
- * @author Aaron Smuts
- */
-public class BoundedQueue
-{
- private int maxSize;
-
- private DoubleLinkedList list = new DoubleLinkedList();
-
- /**
- * Initialize the bounded queue.
- * <p>
- * @param maxSize
- */
- public BoundedQueue( int maxSize )
- {
- this.maxSize = maxSize;
- }
-
- /**
- * Adds an item to the end of the queue, which is the front of the list.
- * <p>
- * @param object
- */
- public void add( Object object )
- {
- if ( list.size() >= maxSize )
- {
- list.removeLast();
- }
- list.addFirst( new DoubleLinkedListNode( object ) );
- }
-
- /**
- * Takes the last of the underlying double linked list.
- * <p>
- * @return null if it is epmpty.
- */
- public Object take()
- {
- DoubleLinkedListNode node = list.removeLast();
- if ( node != null )
- {
- return node.getPayload();
- }
- return null;
- }
-
- /**
- * Return the number of items in the queue.
- * <p>
- * @return size
- */
- public int size()
- {
- return list.size();
- }
-
- /**
- * Return true if the size is <= 0;
- * <p>
- * @return true is size <= 0;
- */
- public boolean isEmpty()
- {
- return list.size() <= 0;
- }
-}
+package org.apache.jcs.utils.struct;
+
+/*
+ * 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.
+ */
+
+/**
+ * This is a bounded queue. It only allows maxSize items.
+ * <p>
+ * @author Aaron Smuts
+ */
+public class BoundedQueue
+{
+ private int maxSize;
+
+ private DoubleLinkedList list = new DoubleLinkedList();
+
+ /**
+ * Initialize the bounded queue.
+ * <p>
+ * @param maxSize
+ */
+ public BoundedQueue( int maxSize )
+ {
+ this.maxSize = maxSize;
+ }
+
+ /**
+ * Adds an item to the end of the queue, which is the front of the list.
+ * <p>
+ * @param object
+ */
+ public void add( Object object )
+ {
+ if ( list.size() >= maxSize )
+ {
+ list.removeLast();
+ }
+ list.addFirst( new DoubleLinkedListNode( object ) );
+ }
+
+ /**
+ * Takes the last of the underlying double linked list.
+ * <p>
+ * @return null if it is epmpty.
+ */
+ public Object take()
+ {
+ DoubleLinkedListNode node = list.removeLast();
+ if ( node != null )
+ {
+ return node.getPayload();
+ }
+ return null;
+ }
+
+ /**
+ * Return the number of items in the queue.
+ * <p>
+ * @return size
+ */
+ public int size()
+ {
+ return list.size();
+ }
+
+ /**
+ * Return true if the size is <= 0;
+ * <p>
+ * @return true is size <= 0;
+ */
+ public boolean isEmpty()
+ {
+ return list.size() <= 0;
+ }
+}
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/DoubleLinkedList.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/DoubleLinkedList.java?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/DoubleLinkedList.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/DoubleLinkedList.java Thu May 10 09:03:42 2007
@@ -1,5 +1,24 @@
package org.apache.jcs.utils.struct;
+/*
+ * 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.logging.Log;
import org.apache.commons.logging.LogFactory;
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/DoubleLinkedListNode.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/DoubleLinkedListNode.java?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/DoubleLinkedListNode.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/DoubleLinkedListNode.java Thu May 10 09:03:42 2007
@@ -1,14 +1,22 @@
package org.apache.jcs.utils.struct;
/*
- * Copyright 2001-2004 The Apache Software Foundation. Licensed 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.
+ * 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;
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/LRUElementDescriptor.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/LRUElementDescriptor.java?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/LRUElementDescriptor.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/LRUElementDescriptor.java Thu May 10 09:03:42 2007
@@ -1,5 +1,24 @@
package org.apache.jcs.utils.struct;
+/*
+ * 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.
+ */
+
/**
* This is a node in the double linked list. It is stored as the value in the
* underlying map used by the LRUMap class.
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/LRUMap.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/LRUMap.java?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/LRUMap.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/LRUMap.java Thu May 10 09:03:42 2007
@@ -1,5 +1,24 @@
package org.apache.jcs.utils.struct;
+/*
+ * 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.ArrayList;
import java.util.Collection;
@@ -642,4 +661,4 @@
// TODO fix this, it needs to return the keys inside the wrappers.
return map.keySet();
}
-}
\ No newline at end of file
+}
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/LRUMapEntry.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/LRUMapEntry.java?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/LRUMapEntry.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/LRUMapEntry.java Thu May 10 09:03:42 2007
@@ -1,59 +1,78 @@
-package org.apache.jcs.utils.struct;
-
-import java.io.Serializable;
-import java.util.Map.Entry;
-
-/**
- * Entry for the LRUMap.
- * <p>
- * @author Aaron Smuts
- */
-public class LRUMapEntry
- implements Entry, Serializable
-{
- private static final long serialVersionUID = -8176116317739129331L;
-
- private Object key;
-
- private Object value;
-
- /**
- * S
- * @param key
- * @param value
- */
- public LRUMapEntry( Object key, Object value )
- {
- this.key = key;
- this.value = value;
- }
-
- /*
- * (non-Javadoc)
- * @see java.util.Map$Entry#getKey()
- */
- public Object getKey()
- {
- return this.key;
- }
-
- /*
- * (non-Javadoc)
- * @see java.util.Map$Entry#getValue()
- */
- public Object getValue()
- {
- return this.value;
- }
-
- /*
- * (non-Javadoc)
- * @see java.util.Map$Entry#setValue(java.lang.Object)
- */
- public Object setValue( Object valueArg )
- {
- Object old = this.value;
- this.value = valueArg;
- return old;
- }
-}
+package org.apache.jcs.utils.struct;
+
+/*
+ * 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.Map.Entry;
+
+/**
+ * Entry for the LRUMap.
+ * <p>
+ * @author Aaron Smuts
+ */
+public class LRUMapEntry
+ implements Entry, Serializable
+{
+ private static final long serialVersionUID = -8176116317739129331L;
+
+ private Object key;
+
+ private Object value;
+
+ /**
+ * S
+ * @param key
+ * @param value
+ */
+ public LRUMapEntry( Object key, Object value )
+ {
+ this.key = key;
+ this.value = value;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see java.util.Map$Entry#getKey()
+ */
+ public Object getKey()
+ {
+ return this.key;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see java.util.Map$Entry#getValue()
+ */
+ public Object getValue()
+ {
+ return this.value;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see java.util.Map$Entry#setValue(java.lang.Object)
+ */
+ public Object setValue( Object valueArg )
+ {
+ Object old = this.value;
+ this.value = valueArg;
+ return old;
+ }
+}
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/SingleLinkedList.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/SingleLinkedList.java?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/SingleLinkedList.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/SingleLinkedList.java Thu May 10 09:03:42 2007
@@ -1,113 +1,132 @@
-package org.apache.jcs.utils.struct;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * This is an basic thread safe single linked list. It provides very limited functionality. It is
- * small and fast.
- * <p>
- * @author Aaron Smuts
- */
-public class SingleLinkedList
-{
- private static final Log log = LogFactory.getLog( SingleLinkedList.class );
-
- private Object lock = new Object();
-
- // the head of the queue
- private Node head = new Node();
-
- // the end of the queue
- private Node tail = head;
-
- private int size = 0;
-
- /**
- * Takes the first item off the list.
- * <p>
- * @return null if the list is empty.
- */
- public Object takeFirst()
- {
- synchronized ( lock )
- {
- // wait until there is something to read
- if ( head == tail )
- {
- return null;
- }
-
- Node node = head.next;
-
- Object value = node.payload;
-
- if ( log.isDebugEnabled() )
- {
- log.debug( "head.payload = " + head.payload );
- log.debug( "node.payload = " + node.payload );
- }
-
- // Node becomes the new head (head is always empty)
-
- node.payload = null;
- head = node;
-
- size--;
- return value;
- }
- }
-
- /**
- * Adds an item to the end of the list.
- * <p>
- * @param payload
- */
- public void addLast( Object payload )
- {
- Node newNode = new Node();
-
- newNode.payload = payload;
-
- synchronized ( lock )
- {
- size++;
- tail.next = newNode;
- tail = newNode;
- }
- }
-
- /**
- * Removes everything.
- */
- public void clear()
- {
- synchronized ( lock )
- {
- head = tail;
- size = 0;
- }
- }
-
- /**
- * The list is composed of nodes.
- * <p>
- * @author Aaron Smuts
- */
- private static class Node
- {
- Node next = null;
-
- Object payload;
- }
-
- /**
- * Returns the number of elements in the list.
- * <p>
- * @return number of items in the list.
- */
- public int size()
- {
- return size;
- }
-}
+package org.apache.jcs.utils.struct;
+
+/*
+ * 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.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * This is an basic thread safe single linked list. It provides very limited functionality. It is
+ * small and fast.
+ * <p>
+ * @author Aaron Smuts
+ */
+public class SingleLinkedList
+{
+ private static final Log log = LogFactory.getLog( SingleLinkedList.class );
+
+ private Object lock = new Object();
+
+ // the head of the queue
+ private Node head = new Node();
+
+ // the end of the queue
+ private Node tail = head;
+
+ private int size = 0;
+
+ /**
+ * Takes the first item off the list.
+ * <p>
+ * @return null if the list is empty.
+ */
+ public Object takeFirst()
+ {
+ synchronized ( lock )
+ {
+ // wait until there is something to read
+ if ( head == tail )
+ {
+ return null;
+ }
+
+ Node node = head.next;
+
+ Object value = node.payload;
+
+ if ( log.isDebugEnabled() )
+ {
+ log.debug( "head.payload = " + head.payload );
+ log.debug( "node.payload = " + node.payload );
+ }
+
+ // Node becomes the new head (head is always empty)
+
+ node.payload = null;
+ head = node;
+
+ size--;
+ return value;
+ }
+ }
+
+ /**
+ * Adds an item to the end of the list.
+ * <p>
+ * @param payload
+ */
+ public void addLast( Object payload )
+ {
+ Node newNode = new Node();
+
+ newNode.payload = payload;
+
+ synchronized ( lock )
+ {
+ size++;
+ tail.next = newNode;
+ tail = newNode;
+ }
+ }
+
+ /**
+ * Removes everything.
+ */
+ public void clear()
+ {
+ synchronized ( lock )
+ {
+ head = tail;
+ size = 0;
+ }
+ }
+
+ /**
+ * The list is composed of nodes.
+ * <p>
+ * @author Aaron Smuts
+ */
+ private static class Node
+ {
+ Node next = null;
+
+ Object payload;
+ }
+
+ /**
+ * Returns the number of elements in the list.
+ * <p>
+ * @return number of items in the list.
+ */
+ public int size()
+ {
+ return size;
+ }
+}
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/SortedPreferentialArray.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/SortedPreferentialArray.java?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/SortedPreferentialArray.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/SortedPreferentialArray.java Thu May 10 09:03:42 2007
@@ -1,12 +1,22 @@
package org.apache.jcs.utils.struct;
/*
- * Copyright 2001-2004 The Apache Software Foundation. Licensed 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.
+ * 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.logging.Log;
@@ -583,7 +593,7 @@
/**
* Debugging method to return a human readable display of array data.
* <p>
- * @return String representation of the contents.
+ * @return String representation of the contents.
*/
protected synchronized String dumpArray()
{
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/utils/threadpool/PoolConfiguration.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/utils/threadpool/PoolConfiguration.java?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/utils/threadpool/PoolConfiguration.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/utils/threadpool/PoolConfiguration.java Thu May 10 09:03:42 2007
@@ -1,18 +1,27 @@
package org.apache.jcs.utils.threadpool;
-import org.apache.jcs.utils.threadpool.behavior.IPoolConfiguration;
-
/*
- * Copyright 2001-2004 The Apache Software Foundation. Licensed 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.
+ * 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.utils.threadpool.behavior.IPoolConfiguration;
+
+
/**
* This object holds configuration data for a thread pool.
* <p>
@@ -250,4 +259,4 @@
return new PoolConfiguration( isUseBoundary(), boundarySize, maximumPoolSize, minimumPoolSize, keepAliveTime,
getWhenBlockedPolicy(), startUpSize );
}
-}
\ No newline at end of file
+}
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/utils/threadpool/ThreadPool.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/utils/threadpool/ThreadPool.java?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/utils/threadpool/ThreadPool.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/utils/threadpool/ThreadPool.java Thu May 10 09:03:42 2007
@@ -1,5 +1,24 @@
package org.apache.jcs.utils.threadpool;
+/*
+ * 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 EDU.oswego.cs.dl.util.concurrent.Channel;
import EDU.oswego.cs.dl.util.concurrent.PooledExecutor;
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/utils/threadpool/ThreadPoolManager.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/utils/threadpool/ThreadPoolManager.java?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/utils/threadpool/ThreadPoolManager.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/utils/threadpool/ThreadPoolManager.java Thu May 10 09:03:42 2007
@@ -1,14 +1,22 @@
package org.apache.jcs.utils.threadpool;
/*
- * Copyright 2001-2004 The Apache Software Foundation. Licensed 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.
+ * 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.ArrayList;
@@ -47,23 +55,23 @@
* <p>
* If a value is not set for a particular pool, the hard coded defaults will be
* used.
- *
+ *
* <pre>
* int boundarySize_DEFAULT = 2000;
- *
+ *
* int maximumPoolSize_DEFAULT = 150;
- *
+ *
* int minimumPoolSize_DEFAULT = 4;
- *
+ *
* int keepAliveTime_DEFAULT = 1000 * 60 * 5;
- *
+ *
* boolean abortWhenBlocked = false;
- *
+ *
* String whenBlockedPolicy_DEFAULT = IPoolConfiguration.POLICY_RUN;
- *
+ *
* int startUpSize_DEFAULT = 4;
* </pre>
- *
+ *
* You can configure default settings by specifying a default pool in the
* properties, ie "cache.ccf"
* <p>
@@ -441,7 +449,7 @@
return config;
}
-
+
/**
* Allows us to set the daemon status on the threads.
* <p>
@@ -452,7 +460,7 @@
{
/*
* (non-Javadoc)
- *
+ *
* @see EDU.oswego.cs.dl.util.concurrent.ThreadFactory#newThread(java.lang.Runnable)
*/
public Thread newThread( Runnable runner )
@@ -461,5 +469,5 @@
t.setDaemon( true );
return t;
}
- }
+ }
}
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/utils/threadpool/behavior/IPoolConfiguration.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/utils/threadpool/behavior/IPoolConfiguration.java?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/utils/threadpool/behavior/IPoolConfiguration.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/utils/threadpool/behavior/IPoolConfiguration.java Thu May 10 09:03:42 2007
@@ -1,5 +1,24 @@
package org.apache.jcs.utils.threadpool.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.
+ */
+
/**
* This provides values to use for the when-blocked-policy.
* <p>
@@ -102,4 +121,4 @@
* @return Returns the startUpSize.
*/
public abstract int getStartUpSize();
-}
\ No newline at end of file
+}
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/utils/timing/ElapsedTimer.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/utils/timing/ElapsedTimer.java?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/utils/timing/ElapsedTimer.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/utils/timing/ElapsedTimer.java Thu May 10 09:03:42 2007
@@ -1,47 +1,57 @@
-package org.apache.jcs.utils.timing;
-
-/*
- * Copyright 2001-2004 The Apache Software Foundation. Licensed 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.
- */
-
-/**
- * This is a simple timer utility.
- */
-public class ElapsedTimer
-{
- private static final String SUFFIX = "ms.";
-
- /**
- * Sets the start time when created.
- */
- private long timeStamp = System.currentTimeMillis();
-
- /**
- * Gets the time elapsed between the start time and now. The start time is reset to now.
- * Subsequent calls will get the time between then and now.
- * <p>
- * @return
- */
- public long getElapsedTime()
- {
- long now = System.currentTimeMillis();
- long elapsed = now - timeStamp;
- timeStamp = now;
- return elapsed;
- }
-
- /**
- * Retuns the elapsed time with the display suffix.
- * <p>
- * @return formatted elapsed Time
- */
- public String getElapsedTimeString()
- {
- return String.valueOf( getElapsedTime() ) + SUFFIX;
- }
-}
+package org.apache.jcs.utils.timing;
+
+/*
+ * 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.
+ */
+
+/**
+ * This is a simple timer utility.
+ */
+public class ElapsedTimer
+{
+ private static final String SUFFIX = "ms.";
+
+ /**
+ * Sets the start time when created.
+ */
+ private long timeStamp = System.currentTimeMillis();
+
+ /**
+ * Gets the time elapsed between the start time and now. The start time is reset to now.
+ * Subsequent calls will get the time between then and now.
+ * <p>
+ * @return
+ */
+ public long getElapsedTime()
+ {
+ long now = System.currentTimeMillis();
+ long elapsed = now - timeStamp;
+ timeStamp = now;
+ return elapsed;
+ }
+
+ /**
+ * Retuns the elapsed time with the display suffix.
+ * <p>
+ * @return formatted elapsed Time
+ */
+ public String getElapsedTimeString()
+ {
+ return String.valueOf( getElapsedTime() ) + SUFFIX;
+ }
+}
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/utils/timing/SleepUtil.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/utils/timing/SleepUtil.java?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/utils/timing/SleepUtil.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/utils/timing/SleepUtil.java Thu May 10 09:03:42 2007
@@ -1,31 +1,50 @@
-package org.apache.jcs.utils.timing;
-
-/**
- * Utility methods to help deal with thread issues.
- */
-public class SleepUtil
-{
- /**
- * Sleep for a specified duration in milliseconds. This method is a
- * platform-specific workaround for Windows due to its inability to resolve
- * durations of time less than approximately 10 - 16 ms.
- * <p>
- * @param milliseconds the number of milliseconds to sleep
- */
- public static void sleepAtLeast( long milliseconds )
- {
- long endTime = System.currentTimeMillis() + milliseconds;
-
- while ( System.currentTimeMillis() <= endTime )
- {
- try
- {
- Thread.sleep( milliseconds );
- }
- catch ( InterruptedException e )
- {
- // TODO - Do something here?
- }
- }
- }
-}
+package org.apache.jcs.utils.timing;
+
+/*
+ * 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.
+ */
+
+/**
+ * Utility methods to help deal with thread issues.
+ */
+public class SleepUtil
+{
+ /**
+ * Sleep for a specified duration in milliseconds. This method is a
+ * platform-specific workaround for Windows due to its inability to resolve
+ * durations of time less than approximately 10 - 16 ms.
+ * <p>
+ * @param milliseconds the number of milliseconds to sleep
+ */
+ public static void sleepAtLeast( long milliseconds )
+ {
+ long endTime = System.currentTimeMillis() + milliseconds;
+
+ while ( System.currentTimeMillis() <= endTime )
+ {
+ try
+ {
+ Thread.sleep( milliseconds );
+ }
+ catch ( InterruptedException e )
+ {
+ // TODO - Do something here?
+ }
+ }
+ }
+}
Modified: jakarta/jcs/trunk/src/scripts/cpappend.bat
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/scripts/cpappend.bat?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
--- jakarta/jcs/trunk/src/scripts/cpappend.bat (original)
+++ jakarta/jcs/trunk/src/scripts/cpappend.bat Thu May 10 09:03:42 2007
@@ -1,2 +1,18 @@
+rem Licensed to the Apache Software Foundation (ASF) under one
+rem or more contributor license agreements. See the NOTICE file
+rem distributed with this work for additional information
+rem regarding copyright ownership. The ASF licenses this file
+rem to you under the Apache License, Version 2.0 (the
+rem "License"); you may not use this file except in compliance
+rem with the License. You may obtain a copy of the License at
+rem
+rem http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing,
+rem software distributed under the License is distributed on an
+rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+rem KIND, either express or implied. See the License for the
+rem specific language governing permissions and limitations
+rem under the License.
echo %_LIBJARS%
set _LIBJARS=%_LIBJARS%;%1
Modified: jakarta/jcs/trunk/src/scripts/directory.bat
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/scripts/directory.bat?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
--- jakarta/jcs/trunk/src/scripts/directory.bat (original)
+++ jakarta/jcs/trunk/src/scripts/directory.bat Thu May 10 09:03:42 2007
@@ -1 +1,17 @@
+rem Licensed to the Apache Software Foundation (ASF) under one
+rem or more contributor license agreements. See the NOTICE file
+rem distributed with this work for additional information
+rem regarding copyright ownership. The ASF licenses this file
+rem to you under the Apache License, Version 2.0 (the
+rem "License"); you may not use this file except in compliance
+rem with the License. You may obtain a copy of the License at
+rem
+rem http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing,
+rem software distributed under the License is distributed on an
+rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+rem KIND, either express or implied. See the License for the
+rem specific language governing permissions and limitations
+rem under the License.
set CURDIR=%2
Modified: jakarta/jcs/trunk/src/scripts/jgtest.bat
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/scripts/jgtest.bat?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
Binary files - no diff available.
Modified: jakarta/jcs/trunk/src/scripts/jgtest_send.bat
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/scripts/jgtest_send.bat?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
Binary files - no diff available.
Modified: jakarta/jcs/trunk/src/scripts/jgtest_send.sh
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/scripts/jgtest_send.sh?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
Binary files - no diff available.
Modified: jakarta/jcs/trunk/src/scripts/prep.bat
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/scripts/prep.bat?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
--- jakarta/jcs/trunk/src/scripts/prep.bat (original)
+++ jakarta/jcs/trunk/src/scripts/prep.bat Thu May 10 09:03:42 2007
@@ -1,3 +1,19 @@
+rem Licensed to the Apache Software Foundation (ASF) under one
+rem or more contributor license agreements. See the NOTICE file
+rem distributed with this work for additional information
+rem regarding copyright ownership. The ASF licenses this file
+rem to you under the Apache License, Version 2.0 (the
+rem "License"); you may not use this file except in compliance
+rem with the License. You may obtain a copy of the License at
+rem
+rem http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing,
+rem software distributed under the License is distributed on an
+rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+rem KIND, either express or implied. See the License for the
+rem specific language governing permissions and limitations
+rem under the License.
@rem echo off
:setcurdir
@@ -29,4 +45,4 @@
:addLibJars
set CLASSPATH=%CLASSPATH%;%_LIBJARS%
-
+
Modified: jakarta/jcs/trunk/src/scripts/remoteCacheStats.bat
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/scripts/remoteCacheStats.bat?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
--- jakarta/jcs/trunk/src/scripts/remoteCacheStats.bat (original)
+++ jakarta/jcs/trunk/src/scripts/remoteCacheStats.bat Thu May 10 09:03:42 2007
@@ -1,11 +1,27 @@
+rem Licensed to the Apache Software Foundation (ASF) under one
+rem or more contributor license agreements. See the NOTICE file
+rem distributed with this work for additional information
+rem regarding copyright ownership. The ASF licenses this file
+rem to you under the Apache License, Version 2.0 (the
+rem "License"); you may not use this file except in compliance
+rem with the License. You may obtain a copy of the License at
+rem
+rem http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing,
+rem software distributed under the License is distributed on an
+rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+rem KIND, either express or implied. See the License for the
+rem specific language governing permissions and limitations
+rem under the License.
@echo on
call prep.bat
-
+
:run
rem set DBUGPARM=-classic -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,address=5000,suspend=n
%JAVA_HOME%\bin\java %DBUGPARM% -ms10m -mx20m -classpath %CLASSPATH% "-Djava.security.policy=%CURDIR%\src\conf\cache.policy" org.apache.jcs.auxiliary.remote.server.RemoteCacheServerFactory -stats /remote.cache%1.ccf
-
+
Modified: jakarta/jcs/trunk/src/scripts/remoteCacheStats.sh
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/scripts/remoteCacheStats.sh?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
--- jakarta/jcs/trunk/src/scripts/remoteCacheStats.sh (original)
+++ jakarta/jcs/trunk/src/scripts/remoteCacheStats.sh Thu May 10 09:03:42 2007
@@ -1,28 +1,44 @@
-#! /bin/sh
-
-export CLASSPATH=.
-export CLASSPATH=${CLASSPATH}:`dirname $0`/../conf:/usr/java/jcs/conf:/usr/java/jcs/conf/
-
-THISDIR=`dirname $0`
-
-for i in `find ${THISDIR}/../lib -name "*.jar" `
-do
- export CLASSPATH=${CLASSPATH}:$i
-done
-echo "Classpath = ${CLASSPATH}"
-
-
-POLICY="-Djava.security.policy=`dirname $0`/../conf/cache.policy"
-
-HEAP="-Xms10m -Xmx20m"
-
-DEBUG="-verbose:gc -XX:+PrintTenuringDistribution"
-
-ARGS="$HEAP $DEBUG $POLICY"
-
-echo $ARGS
-
-java $ARGS org.apache.jcs.auxiliary.remote.server.RemoteCacheServerFactory -stats "$1"
-
-
-
+# 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.
+# ! /bin/sh
+
+export CLASSPATH=.
+export CLASSPATH=${CLASSPATH}:`dirname $0`/../conf:/usr/java/jcs/conf:/usr/java/jcs/conf/
+
+THISDIR=`dirname $0`
+
+for i in `find ${THISDIR}/../lib -name "*.jar" `
+do
+ export CLASSPATH=${CLASSPATH}:$i
+done
+echo "Classpath = ${CLASSPATH}"
+
+
+POLICY="-Djava.security.policy=`dirname $0`/../conf/cache.policy"
+
+HEAP="-Xms10m -Xmx20m"
+
+DEBUG="-verbose:gc -XX:+PrintTenuringDistribution"
+
+ARGS="$HEAP $DEBUG $POLICY"
+
+echo $ARGS
+
+java $ARGS org.apache.jcs.auxiliary.remote.server.RemoteCacheServerFactory -stats "$1"
+
+
+
Modified: jakarta/jcs/trunk/src/scripts/setCURDIR.bat
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/scripts/setCURDIR.bat?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
--- jakarta/jcs/trunk/src/scripts/setCURDIR.bat (original)
+++ jakarta/jcs/trunk/src/scripts/setCURDIR.bat Thu May 10 09:03:42 2007
@@ -1,11 +1,27 @@
+rem Licensed to the Apache Software Foundation (ASF) under one
+rem or more contributor license agreements. See the NOTICE file
+rem distributed with this work for additional information
+rem regarding copyright ownership. The ASF licenses this file
+rem to you under the Apache License, Version 2.0 (the
+rem "License"); you may not use this file except in compliance
+rem with the License. You may obtain a copy of the License at
+rem
+rem http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing,
+rem software distributed under the License is distributed on an
+rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+rem KIND, either express or implied. See the License for the
+rem specific language governing permissions and limitations
+rem under the License.
rem cd ..
rem dir | find "Directory" > }{.bat
rem echo set CURDIR=%%2> directory.bat
rem for %%a in (call del) do %%a }{.bat
-rem cd bin
+rem cd bin
cd ..\..
set CURDIR=%CD%
echo %CURDIR%
cd src
-cd scripts
\ No newline at end of file
+cd scripts
Modified: jakarta/jcs/trunk/src/scripts/startJetty.bat
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/scripts/startJetty.bat?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
--- jakarta/jcs/trunk/src/scripts/startJetty.bat (original)
+++ jakarta/jcs/trunk/src/scripts/startJetty.bat Thu May 10 09:03:42 2007
@@ -1,7 +1,23 @@
+rem Licensed to the Apache Software Foundation (ASF) under one
+rem or more contributor license agreements. See the NOTICE file
+rem distributed with this work for additional information
+rem regarding copyright ownership. The ASF licenses this file
+rem to you under the Apache License, Version 2.0 (the
+rem "License"); you may not use this file except in compliance
+rem with the License. You may obtain a copy of the License at
+rem
+rem http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing,
+rem software distributed under the License is distributed on an
+rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+rem KIND, either express or implied. See the License for the
+rem specific language governing permissions and limitations
+rem under the License.
@echo off
call prep.bat
-
+
:run
rem set DBUGPARM=-classic -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,address=5000,suspend=n
%JAVA_HOME%\bin\java %DBUGPARM% -ms10m -mx200m -classpath %CLASSPATH% "-Djava.security.policy=%CURDIR%/conf/cache.policy" com.mortbay.Jetty.Server %CURDIR%/conf/myjetty%1.xml
Modified: jakarta/jcs/trunk/src/scripts/startRemoteCache.bat
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/scripts/startRemoteCache.bat?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
--- jakarta/jcs/trunk/src/scripts/startRemoteCache.bat (original)
+++ jakarta/jcs/trunk/src/scripts/startRemoteCache.bat Thu May 10 09:03:42 2007
@@ -1,7 +1,23 @@
+rem Licensed to the Apache Software Foundation (ASF) under one
+rem or more contributor license agreements. See the NOTICE file
+rem distributed with this work for additional information
+rem regarding copyright ownership. The ASF licenses this file
+rem to you under the Apache License, Version 2.0 (the
+rem "License"); you may not use this file except in compliance
+rem with the License. You may obtain a copy of the License at
+rem
+rem http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing,
+rem software distributed under the License is distributed on an
+rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+rem KIND, either express or implied. See the License for the
+rem specific language governing permissions and limitations
+rem under the License.
@rem echo off
call prep.bat
-
+
:run
rem set DBUGPARM=-classic -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,address=5000,suspend=n
%JAVA_HOME%\bin\java %DBUGPARM% -verbosegc -XX:+PrintTenuringDistribution -ms10m -mx200m -classpath %CLASSPATH% "-Djava.security.policy=%CURDIR%\src\conf\cache.policy" org.apache.jcs.auxiliary.remote.server.RemoteCacheServerFactory /remote.cache%1.ccf
Modified: jakarta/jcs/trunk/src/scripts/startRemoteCache.sh
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/scripts/startRemoteCache.sh?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
Binary files - no diff available.
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.