You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2011/10/22 23:04:00 UTC
svn commit: r1187782 [4/5] - in /tomcat/trunk/java/org/apache/naming: ./
factory/ factory/webservices/ java/ resources/ resources/jndi/
Modified: tomcat/trunk/java/org/apache/naming/resources/ProxyDirContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/resources/ProxyDirContext.java?rev=1187782&r1=1187781&r2=1187782&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/resources/ProxyDirContext.java (original)
+++ tomcat/trunk/java/org/apache/naming/resources/ProxyDirContext.java Sat Oct 22 21:03:58 2011
@@ -5,15 +5,15 @@
* 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.
- */
+ */
package org.apache.naming.resources;
@@ -80,7 +80,7 @@ public class ProxyDirContext implements
BaseDirContext baseDirContext = (BaseDirContext) dirContext;
if (baseDirContext.isCached()) {
try {
- cache = (ResourceCache)
+ cache = (ResourceCache)
Class.forName(cacheClassName).newInstance();
} catch (Exception e) {
throw new IllegalArgumentException(sm.getString(
@@ -162,7 +162,7 @@ public class ProxyDirContext implements
/**
* Cache class.
*/
- protected String cacheClassName =
+ protected String cacheClassName =
"org.apache.naming.resources.ResourceCache";
@@ -248,11 +248,11 @@ public class ProxyDirContext implements
/**
- * Retrieves the named object. If name is empty, returns a new instance
- * of this context (which represents the same naming context as this
- * context, but its environment may be modified independently and it may
+ * Retrieves the named object. If name is empty, returns a new instance
+ * of this context (which represents the same naming context as this
+ * context, but its environment may be modified independently and it may
* be accessed concurrently).
- *
+ *
* @param name the name of the object to look up
* @return the object bound to name
* @exception NamingException if a naming exception is encountered
@@ -282,7 +282,7 @@ public class ProxyDirContext implements
/**
* Retrieves the named object.
- *
+ *
* @param name the name of the object to look up
* @return the object bound to name
* @exception NamingException if a naming exception is encountered
@@ -316,10 +316,10 @@ public class ProxyDirContext implements
/**
- * Binds a name to an object. All intermediate contexts and the target
- * context (that named by all but terminal atomic component of the name)
+ * Binds a name to an object. All intermediate contexts and the target
+ * context (that named by all but terminal atomic component of the name)
* must already exist.
- *
+ *
* @param name the name to bind; may not be empty
* @param obj the object to bind; possibly null
* @exception javax.naming.NameAlreadyBoundException if name is already
@@ -338,7 +338,7 @@ public class ProxyDirContext implements
/**
* Binds a name to an object.
- *
+ *
* @param name the name to bind; may not be empty
* @param obj the object to bind; possibly null
* @exception javax.naming.NameAlreadyBoundException if name is already
@@ -356,14 +356,14 @@ public class ProxyDirContext implements
/**
- * Binds a name to an object, overwriting any existing binding. All
- * intermediate contexts and the target context (that named by all but
+ * Binds a name to an object, overwriting any existing binding. All
+ * intermediate contexts and the target context (that named by all but
* terminal atomic component of the name) must already exist.
* <p>
- * If the object is a DirContext, any existing attributes associated with
- * the name are replaced with those of the object. Otherwise, any
+ * If the object is a DirContext, any existing attributes associated with
+ * the name are replaced with those of the object. Otherwise, any
* existing attributes associated with the name remain unchanged.
- *
+ *
* @param name the name to bind; may not be empty
* @param obj the object to bind; possibly null
* @exception javax.naming.directory.InvalidAttributesException if object
@@ -380,7 +380,7 @@ public class ProxyDirContext implements
/**
* Binds a name to an object, overwriting any existing binding.
- *
+ *
* @param name the name to bind; may not be empty
* @param obj the object to bind; possibly null
* @exception javax.naming.directory.InvalidAttributesException if object
@@ -396,16 +396,16 @@ public class ProxyDirContext implements
/**
- * Unbinds the named object. Removes the terminal atomic name in name
- * from the target context--that named by all but the terminal atomic
+ * Unbinds the named object. Removes the terminal atomic name in name
+ * from the target context--that named by all but the terminal atomic
* part of name.
* <p>
- * This method is idempotent. It succeeds even if the terminal atomic
- * name is not bound in the target context, but throws
- * NameNotFoundException if any of the intermediate contexts do not exist.
- *
+ * This method is idempotent. It succeeds even if the terminal atomic
+ * name is not bound in the target context, but throws
+ * NameNotFoundException if any of the intermediate contexts do not exist.
+ *
* @param name the name to bind; may not be empty
- * @exception NameNotFoundException if an intermediate context does not
+ * @exception NameNotFoundException if an intermediate context does not
* exist
* @exception NamingException if a naming exception is encountered
*/
@@ -419,9 +419,9 @@ public class ProxyDirContext implements
/**
* Unbinds the named object.
- *
+ *
* @param name the name to bind; may not be empty
- * @exception NameNotFoundException if an intermediate context does not
+ * @exception NameNotFoundException if an intermediate context does not
* exist
* @exception NamingException if a naming exception is encountered
*/
@@ -434,11 +434,11 @@ public class ProxyDirContext implements
/**
- * Binds a new name to the object bound to an old name, and unbinds the
- * old name. Both names are relative to this context. Any attributes
- * associated with the old name become associated with the new name.
+ * Binds a new name to the object bound to an old name, and unbinds the
+ * old name. Both names are relative to this context. Any attributes
+ * associated with the old name become associated with the new name.
* Intermediate contexts of the old name are not changed.
- *
+ *
* @param oldName the name of the existing binding; may not be empty
* @param newName the name of the new binding; may not be empty
* @exception javax.naming.NameAlreadyBoundException if name is already
@@ -454,9 +454,9 @@ public class ProxyDirContext implements
/**
- * Binds a new name to the object bound to an old name, and unbinds the
+ * Binds a new name to the object bound to an old name, and unbinds the
* old name.
- *
+ *
* @param oldName the name of the existing binding; may not be empty
* @param newName the name of the new binding; may not be empty
* @exception javax.naming.NameAlreadyBoundException if name is already
@@ -472,15 +472,15 @@ public class ProxyDirContext implements
/**
- * Enumerates the names bound in the named context, along with the class
- * names of objects bound to them. The contents of any subcontexts are
+ * Enumerates the names bound in the named context, along with the class
+ * names of objects bound to them. The contents of any subcontexts are
* not included.
* <p>
- * If a binding is added to or removed from this context, its effect on
+ * If a binding is added to or removed from this context, its effect on
* an enumeration previously returned is undefined.
- *
+ *
* @param name the name of the context to list
- * @return an enumeration of the names and class names of the bindings in
+ * @return an enumeration of the names and class names of the bindings in
* this context. Each element of the enumeration is of type NameClassPair.
* @exception NamingException if a naming exception is encountered
*/
@@ -492,11 +492,11 @@ public class ProxyDirContext implements
/**
- * Enumerates the names bound in the named context, along with the class
+ * Enumerates the names bound in the named context, along with the class
* names of objects bound to them.
- *
+ *
* @param name the name of the context to list
- * @return an enumeration of the names and class names of the bindings in
+ * @return an enumeration of the names and class names of the bindings in
* this context. Each element of the enumeration is of type NameClassPair.
* @exception NamingException if a naming exception is encountered
*/
@@ -508,15 +508,15 @@ public class ProxyDirContext implements
/**
- * Enumerates the names bound in the named context, along with the
- * objects bound to them. The contents of any subcontexts are not
+ * Enumerates the names bound in the named context, along with the
+ * objects bound to them. The contents of any subcontexts are not
* included.
* <p>
- * If a binding is added to or removed from this context, its effect on
+ * If a binding is added to or removed from this context, its effect on
* an enumeration previously returned is undefined.
- *
+ *
* @param name the name of the context to list
- * @return an enumeration of the bindings in this context.
+ * @return an enumeration of the bindings in this context.
* Each element of the enumeration is of type Binding.
* @exception NamingException if a naming exception is encountered
*/
@@ -528,11 +528,11 @@ public class ProxyDirContext implements
/**
- * Enumerates the names bound in the named context, along with the
+ * Enumerates the names bound in the named context, along with the
* objects bound to them.
- *
+ *
* @param name the name of the context to list
- * @return an enumeration of the bindings in this context.
+ * @return an enumeration of the bindings in this context.
* Each element of the enumeration is of type Binding.
* @exception NamingException if a naming exception is encountered
*/
@@ -544,26 +544,26 @@ public class ProxyDirContext implements
/**
- * Destroys the named context and removes it from the namespace. Any
- * attributes associated with the name are also removed. Intermediate
+ * Destroys the named context and removes it from the namespace. Any
+ * attributes associated with the name are also removed. Intermediate
* contexts are not destroyed.
* <p>
- * This method is idempotent. It succeeds even if the terminal atomic
- * name is not bound in the target context, but throws
- * NameNotFoundException if any of the intermediate contexts do not exist.
- *
- * In a federated naming system, a context from one naming system may be
- * bound to a name in another. One can subsequently look up and perform
- * operations on the foreign context using a composite name. However, an
- * attempt destroy the context using this composite name will fail with
- * NotContextException, because the foreign context is not a "subcontext"
- * of the context in which it is bound. Instead, use unbind() to remove
- * the binding of the foreign context. Destroying the foreign context
- * requires that the destroySubcontext() be performed on a context from
+ * This method is idempotent. It succeeds even if the terminal atomic
+ * name is not bound in the target context, but throws
+ * NameNotFoundException if any of the intermediate contexts do not exist.
+ *
+ * In a federated naming system, a context from one naming system may be
+ * bound to a name in another. One can subsequently look up and perform
+ * operations on the foreign context using a composite name. However, an
+ * attempt destroy the context using this composite name will fail with
+ * NotContextException, because the foreign context is not a "subcontext"
+ * of the context in which it is bound. Instead, use unbind() to remove
+ * the binding of the foreign context. Destroying the foreign context
+ * requires that the destroySubcontext() be performed on a context from
* the foreign context's "native" naming system.
- *
+ *
* @param name the name of the context to be destroyed; may not be empty
- * @exception NameNotFoundException if an intermediate context does not
+ * @exception NameNotFoundException if an intermediate context does not
* exist
* @exception javax.naming.NotContextException if the name is bound but does
* not name a context, or does not name a context of the appropriate type
@@ -578,9 +578,9 @@ public class ProxyDirContext implements
/**
* Destroys the named context and removes it from the namespace.
- *
+ *
* @param name the name of the context to be destroyed; may not be empty
- * @exception NameNotFoundException if an intermediate context does not
+ * @exception NameNotFoundException if an intermediate context does not
* exist
* @exception javax.naming.NotContextException if the name is bound but does
* not name a context, or does not name a context of the appropriate type
@@ -594,11 +594,11 @@ public class ProxyDirContext implements
/**
- * Creates and binds a new context. Creates a new context with the given
- * name and binds it in the target context (that named by all but
- * terminal atomic component of the name). All intermediate contexts and
+ * Creates and binds a new context. Creates a new context with the given
+ * name and binds it in the target context (that named by all but
+ * terminal atomic component of the name). All intermediate contexts and
* the target context must already exist.
- *
+ *
* @param name the name of the context to create; may not be empty
* @return the newly created context
* @exception javax.naming.NameAlreadyBoundException if name is already
@@ -618,7 +618,7 @@ public class ProxyDirContext implements
/**
* Creates and binds a new context.
- *
+ *
* @param name the name of the context to create; may not be empty
* @return the newly created context
* @exception javax.naming.NameAlreadyBoundException if name is already
@@ -637,12 +637,12 @@ public class ProxyDirContext implements
/**
- * Retrieves the named object, following links except for the terminal
- * atomic component of the name. If the object bound to name is not a
+ * Retrieves the named object, following links except for the terminal
+ * atomic component of the name. If the object bound to name is not a
* link, returns the object itself.
- *
+ *
* @param name the name of the object to look up
- * @return the object bound to name, not following the terminal link
+ * @return the object bound to name, not following the terminal link
* (if any).
* @exception NamingException if a naming exception is encountered
*/
@@ -654,11 +654,11 @@ public class ProxyDirContext implements
/**
- * Retrieves the named object, following links except for the terminal
+ * Retrieves the named object, following links except for the terminal
* atomic component of the name.
- *
+ *
* @param name the name of the object to look up
- * @return the object bound to name, not following the terminal link
+ * @return the object bound to name, not following the terminal link
* (if any).
* @exception NamingException if a naming exception is encountered
*/
@@ -670,16 +670,16 @@ public class ProxyDirContext implements
/**
- * Retrieves the parser associated with the named context. In a
- * federation of namespaces, different naming systems will parse names
- * differently. This method allows an application to get a parser for
- * parsing names into their atomic components using the naming convention
- * of a particular naming system. Within any single naming system,
- * NameParser objects returned by this method must be equal (using the
+ * Retrieves the parser associated with the named context. In a
+ * federation of namespaces, different naming systems will parse names
+ * differently. This method allows an application to get a parser for
+ * parsing names into their atomic components using the naming convention
+ * of a particular naming system. Within any single naming system,
+ * NameParser objects returned by this method must be equal (using the
* equals() test).
- *
+ *
* @param name the name of the context from which to get the parser
- * @return a name parser that can parse compound names into their atomic
+ * @return a name parser that can parse compound names into their atomic
* components
* @exception NamingException if a naming exception is encountered
*/
@@ -692,9 +692,9 @@ public class ProxyDirContext implements
/**
* Retrieves the parser associated with the named context.
- *
+ *
* @param name the name of the context from which to get the parser
- * @return a name parser that can parse compound names into their atomic
+ * @return a name parser that can parse compound names into their atomic
* components
* @exception NamingException if a naming exception is encountered
*/
@@ -708,13 +708,13 @@ public class ProxyDirContext implements
/**
* Composes the name of this context with a name relative to this context.
* <p>
- * Given a name (name) relative to this context, and the name (prefix)
- * of this context relative to one of its ancestors, this method returns
- * the composition of the two names using the syntax appropriate for the
- * naming system(s) involved. That is, if name names an object relative
- * to this context, the result is the name of the same object, but
+ * Given a name (name) relative to this context, and the name (prefix)
+ * of this context relative to one of its ancestors, this method returns
+ * the composition of the two names using the syntax appropriate for the
+ * naming system(s) involved. That is, if name names an object relative
+ * to this context, the result is the name of the same object, but
* relative to the ancestor context. None of the names may be null.
- *
+ *
* @param name a name relative to this context
* @param prefix the name of this context relative to one of its ancestors
* @return the composition of prefix and name
@@ -730,7 +730,7 @@ public class ProxyDirContext implements
/**
* Composes the name of this context with a name relative to this context.
- *
+ *
* @param name a name relative to this context
* @param prefix the name of this context relative to one of its ancestors
* @return the composition of prefix and name
@@ -744,10 +744,10 @@ public class ProxyDirContext implements
/**
- * Adds a new environment property to the environment of this context. If
+ * Adds a new environment property to the environment of this context. If
* the property already exists, its value is overwritten.
- *
- * @param propName the name of the environment property to add; may not
+ *
+ * @param propName the name of the environment property to add; may not
* be null
* @param propVal the value of the property to add; may not be null
* @exception NamingException if a naming exception is encountered
@@ -760,9 +760,9 @@ public class ProxyDirContext implements
/**
- * Removes an environment property from the environment of this context.
- *
- * @param propName the name of the environment property to remove;
+ * Removes an environment property from the environment of this context.
+ *
+ * @param propName the name of the environment property to remove;
* may not be null
* @exception NamingException if a naming exception is encountered
*/
@@ -774,12 +774,12 @@ public class ProxyDirContext implements
/**
- * Retrieves the environment in effect for this context. See class
- * description for more details on environment properties.
- * The caller should not make any changes to the object returned: their
- * effect on the context is undefined. The environment of this context
+ * Retrieves the environment in effect for this context. See class
+ * description for more details on environment properties.
+ * The caller should not make any changes to the object returned: their
+ * effect on the context is undefined. The environment of this context
* may be changed using addToEnvironment() and removeFromEnvironment().
- *
+ *
* @return the environment of this context; never null
* @exception NamingException if a naming exception is encountered
*/
@@ -791,13 +791,13 @@ public class ProxyDirContext implements
/**
- * Closes this context. This method releases this context's resources
- * immediately, instead of waiting for them to be released automatically
+ * Closes this context. This method releases this context's resources
+ * immediately, instead of waiting for them to be released automatically
* by the garbage collector.
- * This method is idempotent: invoking it on a context that has already
- * been closed has no effect. Invoking any other method on a closed
+ * This method is idempotent: invoking it on a context that has already
+ * been closed has no effect. Invoking any other method on a closed
* context is not allowed, and results in undefined behaviour.
- *
+ *
* @exception NamingException if a naming exception is encountered
*/
@Override
@@ -810,15 +810,15 @@ public class ProxyDirContext implements
/**
* Retrieves the full name of this context within its own namespace.
* <p>
- * Many naming services have a notion of a "full name" for objects in
- * their respective namespaces. For example, an LDAP entry has a
- * distinguished name, and a DNS record has a fully qualified name. This
- * method allows the client application to retrieve this name. The string
- * returned by this method is not a JNDI composite name and should not be
- * passed directly to context methods. In naming systems for which the
- * notion of full name does not make sense,
+ * Many naming services have a notion of a "full name" for objects in
+ * their respective namespaces. For example, an LDAP entry has a
+ * distinguished name, and a DNS record has a fully qualified name. This
+ * method allows the client application to retrieve this name. The string
+ * returned by this method is not a JNDI composite name and should not be
+ * passed directly to context methods. In naming systems for which the
+ * notion of full name does not make sense,
* OperationNotSupportedException is thrown.
- *
+ *
* @return this context's name in its own namespace; never null
* @exception javax.naming.OperationNotSupportedException if the naming
* system does not have the notion of a full name
@@ -835,9 +835,9 @@ public class ProxyDirContext implements
/**
- * Retrieves all of the attributes associated with a named object.
- *
- * @return the set of attributes associated with name.
+ * Retrieves all of the attributes associated with a named object.
+ *
+ * @return the set of attributes associated with name.
* Returns an empty attribute set if name has no attributes; never null.
* @param name the name of the object from which to retrieve attributes
* @exception NamingException if a naming exception is encountered
@@ -862,7 +862,7 @@ public class ProxyDirContext implements
/**
* Retrieves all of the attributes associated with a named object.
- *
+ *
* @return the set of attributes associated with name
* @param name the name of the object from which to retrieve attributes
* @exception NamingException if a naming exception is encountered
@@ -886,21 +886,21 @@ public class ProxyDirContext implements
/**
- * Retrieves selected attributes associated with a named object.
- * See the class description regarding attribute models, attribute type
+ * Retrieves selected attributes associated with a named object.
+ * See the class description regarding attribute models, attribute type
* names, and operational attributes.
- *
+ *
* @return the requested attributes; never null
* @param name the name of the object from which to retrieve attributes
- * @param attrIds the identifiers of the attributes to retrieve. null
- * indicates that all attributes should be retrieved; an empty array
+ * @param attrIds the identifiers of the attributes to retrieve. null
+ * indicates that all attributes should be retrieved; an empty array
* indicates that none should be retrieved
* @exception NamingException if a naming exception is encountered
*/
@Override
public Attributes getAttributes(Name name, String[] attrIds)
throws NamingException {
- Attributes attributes =
+ Attributes attributes =
dirContext.getAttributes(parseName(name), attrIds);
if (!(attributes instanceof ResourceAttributes)) {
attributes = new ResourceAttributes(attributes);
@@ -911,18 +911,18 @@ public class ProxyDirContext implements
/**
* Retrieves selected attributes associated with a named object.
- *
+ *
* @return the requested attributes; never null
* @param name the name of the object from which to retrieve attributes
- * @param attrIds the identifiers of the attributes to retrieve. null
- * indicates that all attributes should be retrieved; an empty array
+ * @param attrIds the identifiers of the attributes to retrieve. null
+ * indicates that all attributes should be retrieved; an empty array
* indicates that none should be retrieved
* @exception NamingException if a naming exception is encountered
*/
@Override
public Attributes getAttributes(String name, String[] attrIds)
throws NamingException {
- Attributes attributes =
+ Attributes attributes =
dirContext.getAttributes(parseName(name), attrIds);
if (!(attributes instanceof ResourceAttributes)) {
attributes = new ResourceAttributes(attributes);
@@ -932,14 +932,14 @@ public class ProxyDirContext implements
/**
- * Modifies the attributes associated with a named object. The order of
- * the modifications is not specified. Where possible, the modifications
+ * Modifies the attributes associated with a named object. The order of
+ * the modifications is not specified. Where possible, the modifications
* are performed atomically.
- *
+ *
* @param name the name of the object whose attributes will be updated
- * @param mod_op the modification operation, one of: ADD_ATTRIBUTE,
+ * @param mod_op the modification operation, one of: ADD_ATTRIBUTE,
* REPLACE_ATTRIBUTE, REMOVE_ATTRIBUTE
- * @param attrs the attributes to be used for the modification; may not
+ * @param attrs the attributes to be used for the modification; may not
* be null
* @exception javax.naming.directory.AttributeModificationException if the
* modification cannot be completed successfully
@@ -955,11 +955,11 @@ public class ProxyDirContext implements
/**
* Modifies the attributes associated with a named object.
- *
+ *
* @param name the name of the object whose attributes will be updated
- * @param mod_op the modification operation, one of: ADD_ATTRIBUTE,
+ * @param mod_op the modification operation, one of: ADD_ATTRIBUTE,
* REPLACE_ATTRIBUTE, REMOVE_ATTRIBUTE
- * @param attrs the attributes to be used for the modification; may not
+ * @param attrs the attributes to be used for the modification; may not
* be null
* @exception javax.naming.directory.AttributeModificationException if the
* modification cannot be completed successfully
@@ -974,14 +974,14 @@ public class ProxyDirContext implements
/**
- * Modifies the attributes associated with a named object using an an
- * ordered list of modifications. The modifications are performed in the
- * order specified. Each modification specifies a modification operation
- * code and an attribute on which to operate. Where possible, the
+ * Modifies the attributes associated with a named object using an an
+ * ordered list of modifications. The modifications are performed in the
+ * order specified. Each modification specifies a modification operation
+ * code and an attribute on which to operate. Where possible, the
* modifications are performed atomically.
- *
+ *
* @param name the name of the object whose attributes will be updated
- * @param mods an ordered sequence of modifications to be performed; may
+ * @param mods an ordered sequence of modifications to be performed; may
* not be null
* @exception javax.naming.directory.AttributeModificationException if the
* modification cannot be completed successfully
@@ -996,11 +996,11 @@ public class ProxyDirContext implements
/**
- * Modifies the attributes associated with a named object using an an
+ * Modifies the attributes associated with a named object using an an
* ordered list of modifications.
- *
+ *
* @param name the name of the object whose attributes will be updated
- * @param mods an ordered sequence of modifications to be performed; may
+ * @param mods an ordered sequence of modifications to be performed; may
* not be null
* @exception javax.naming.directory.AttributeModificationException if the
* modification cannot be completed successfully
@@ -1015,12 +1015,12 @@ public class ProxyDirContext implements
/**
- * Binds a name to an object, along with associated attributes. If attrs
- * is null, the resulting binding will have the attributes associated
- * with obj if obj is a DirContext, and no attributes otherwise. If attrs
- * is non-null, the resulting binding will have attrs as its attributes;
+ * Binds a name to an object, along with associated attributes. If attrs
+ * is null, the resulting binding will have the attributes associated
+ * with obj if obj is a DirContext, and no attributes otherwise. If attrs
+ * is non-null, the resulting binding will have attrs as its attributes;
* any attributes associated with obj are ignored.
- *
+ *
* @param name the name to bind; may not be empty
* @param obj the object to bind; possibly null
* @param attrs the attributes to associate with the binding
@@ -1040,7 +1040,7 @@ public class ProxyDirContext implements
/**
* Binds a name to an object, along with associated attributes.
- *
+ *
* @param name the name to bind; may not be empty
* @param obj the object to bind; possibly null
* @param attrs the attributes to associate with the binding
@@ -1059,16 +1059,16 @@ public class ProxyDirContext implements
/**
- * Binds a name to an object, along with associated attributes,
- * overwriting any existing binding. If attrs is null and obj is a
- * DirContext, the attributes from obj are used. If attrs is null and obj
+ * Binds a name to an object, along with associated attributes,
+ * overwriting any existing binding. If attrs is null and obj is a
+ * DirContext, the attributes from obj are used. If attrs is null and obj
* is not a DirContext, any existing attributes associated with the object
- * already bound in the directory remain unchanged. If attrs is non-null,
- * any existing attributes associated with the object already bound in
- * the directory are removed and attrs is associated with the named
- * object. If obj is a DirContext and attrs is non-null, the attributes
+ * already bound in the directory remain unchanged. If attrs is non-null,
+ * any existing attributes associated with the object already bound in
+ * the directory are removed and attrs is associated with the named
+ * object. If obj is a DirContext and attrs is non-null, the attributes
* of obj are ignored.
- *
+ *
* @param name the name to bind; may not be empty
* @param obj the object to bind; possibly null
* @param attrs the attributes to associate with the binding
@@ -1085,9 +1085,9 @@ public class ProxyDirContext implements
/**
- * Binds a name to an object, along with associated attributes,
+ * Binds a name to an object, along with associated attributes,
* overwriting any existing binding.
- *
+ *
* @param name the name to bind; may not be empty
* @param obj the object to bind; possibly null
* @param attrs the attributes to associate with the binding
@@ -1104,14 +1104,14 @@ public class ProxyDirContext implements
/**
- * Creates and binds a new context, along with associated attributes.
- * This method creates a new subcontext with the given name, binds it in
- * the target context (that named by all but terminal atomic component of
- * the name), and associates the supplied attributes with the newly
- * created object. All intermediate and target contexts must already
- * exist. If attrs is null, this method is equivalent to
+ * Creates and binds a new context, along with associated attributes.
+ * This method creates a new subcontext with the given name, binds it in
+ * the target context (that named by all but terminal atomic component of
+ * the name), and associates the supplied attributes with the newly
+ * created object. All intermediate and target contexts must already
+ * exist. If attrs is null, this method is equivalent to
* Context.createSubcontext().
- *
+ *
* @param name the name of the context to create; may not be empty
* @param attrs the attributes to associate with the newly created context
* @return the newly created context
@@ -1124,7 +1124,7 @@ public class ProxyDirContext implements
@Override
public DirContext createSubcontext(Name name, Attributes attrs)
throws NamingException {
- DirContext context =
+ DirContext context =
dirContext.createSubcontext(parseName(name), attrs);
cacheUnload(name.toString());
return context;
@@ -1133,7 +1133,7 @@ public class ProxyDirContext implements
/**
* Creates and binds a new context, along with associated attributes.
- *
+ *
* @param name the name of the context to create; may not be empty
* @param attrs the attributes to associate with the newly created context
* @return the newly created context
@@ -1146,7 +1146,7 @@ public class ProxyDirContext implements
@Override
public DirContext createSubcontext(String name, Attributes attrs)
throws NamingException {
- DirContext context =
+ DirContext context =
dirContext.createSubcontext(parseName(name), attrs);
cacheUnload(name);
return context;
@@ -1154,13 +1154,13 @@ public class ProxyDirContext implements
/**
- * Retrieves the schema associated with the named object. The schema
- * describes rules regarding the structure of the namespace and the
- * attributes stored within it. The schema specifies what types of
- * objects can be added to the directory and where they can be added;
- * what mandatory and optional attributes an object can have. The range
+ * Retrieves the schema associated with the named object. The schema
+ * describes rules regarding the structure of the namespace and the
+ * attributes stored within it. The schema specifies what types of
+ * objects can be added to the directory and where they can be added;
+ * what mandatory and optional attributes an object can have. The range
* of support for schemas is directory-specific.
- *
+ *
* @param name the name of the object whose schema is to be retrieved
* @return the schema associated with the context; never null
* @exception javax.naming.OperationNotSupportedException if schema not
@@ -1176,7 +1176,7 @@ public class ProxyDirContext implements
/**
* Retrieves the schema associated with the named object.
- *
+ *
* @param name the name of the object whose schema is to be retrieved
* @return the schema associated with the context; never null
* @exception javax.naming.OperationNotSupportedException if schema not
@@ -1191,12 +1191,12 @@ public class ProxyDirContext implements
/**
- * Retrieves a context containing the schema objects of the named
+ * Retrieves a context containing the schema objects of the named
* object's class definitions.
- *
- * @param name the name of the object whose object class definition is to
+ *
+ * @param name the name of the object whose object class definition is to
* be retrieved
- * @return the DirContext containing the named object's class
+ * @return the DirContext containing the named object's class
* definitions; never null
* @exception javax.naming.OperationNotSupportedException if schema not
* supported
@@ -1210,12 +1210,12 @@ public class ProxyDirContext implements
/**
- * Retrieves a context containing the schema objects of the named
+ * Retrieves a context containing the schema objects of the named
* object's class definitions.
- *
- * @param name the name of the object whose object class definition is to
+ *
+ * @param name the name of the object whose object class definition is to
* be retrieved
- * @return the DirContext containing the named object's class
+ * @return the DirContext containing the named object's class
* definitions; never null
* @exception javax.naming.OperationNotSupportedException if schema not
* supported
@@ -1229,19 +1229,19 @@ public class ProxyDirContext implements
/**
- * Searches in a single context for objects that contain a specified set
- * of attributes, and retrieves selected attributes. The search is
+ * Searches in a single context for objects that contain a specified set
+ * of attributes, and retrieves selected attributes. The search is
* performed using the default SearchControls settings.
- *
+ *
* @param name the name of the context to search
- * @param matchingAttributes the attributes to search for. If empty or
+ * @param matchingAttributes the attributes to search for. If empty or
* null, all objects in the target context are returned.
- * @param attributesToReturn the attributes to return. null indicates
- * that all attributes are to be returned; an empty array indicates that
+ * @param attributesToReturn the attributes to return. null indicates
+ * that all attributes are to be returned; an empty array indicates that
* none are to be returned.
- * @return a non-null enumeration of SearchResult objects. Each
- * SearchResult contains the attributes identified by attributesToReturn
- * and the name of the corresponding object, named relative to the
+ * @return a non-null enumeration of SearchResult objects. Each
+ * SearchResult contains the attributes identified by attributesToReturn
+ * and the name of the corresponding object, named relative to the
* context named by name.
* @exception NamingException if a naming exception is encountered
*/
@@ -1249,24 +1249,24 @@ public class ProxyDirContext implements
public NamingEnumeration<SearchResult> search(Name name,
Attributes matchingAttributes, String[] attributesToReturn)
throws NamingException {
- return dirContext.search(parseName(name), matchingAttributes,
+ return dirContext.search(parseName(name), matchingAttributes,
attributesToReturn);
}
/**
- * Searches in a single context for objects that contain a specified set
+ * Searches in a single context for objects that contain a specified set
* of attributes, and retrieves selected attributes.
- *
+ *
* @param name the name of the context to search
- * @param matchingAttributes the attributes to search for. If empty or
+ * @param matchingAttributes the attributes to search for. If empty or
* null, all objects in the target context are returned.
- * @param attributesToReturn the attributes to return. null indicates
- * that all attributes are to be returned; an empty array indicates that
+ * @param attributesToReturn the attributes to return. null indicates
+ * that all attributes are to be returned; an empty array indicates that
* none are to be returned.
- * @return a non-null enumeration of SearchResult objects. Each
- * SearchResult contains the attributes identified by attributesToReturn
- * and the name of the corresponding object, named relative to the
+ * @return a non-null enumeration of SearchResult objects. Each
+ * SearchResult contains the attributes identified by attributesToReturn
+ * and the name of the corresponding object, named relative to the
* context named by name.
* @exception NamingException if a naming exception is encountered
*/
@@ -1274,23 +1274,23 @@ public class ProxyDirContext implements
public NamingEnumeration<SearchResult> search(String name,
Attributes matchingAttributes, String[] attributesToReturn)
throws NamingException {
- return dirContext.search(parseName(name), matchingAttributes,
+ return dirContext.search(parseName(name), matchingAttributes,
attributesToReturn);
}
/**
- * Searches in a single context for objects that contain a specified set
- * of attributes. This method returns all the attributes of such objects.
- * It is equivalent to supplying null as the atributesToReturn parameter
+ * Searches in a single context for objects that contain a specified set
+ * of attributes. This method returns all the attributes of such objects.
+ * It is equivalent to supplying null as the atributesToReturn parameter
* to the method search(Name, Attributes, String[]).
- *
+ *
* @param name the name of the context to search
- * @param matchingAttributes the attributes to search for. If empty or
+ * @param matchingAttributes the attributes to search for. If empty or
* null, all objects in the target context are returned.
- * @return a non-null enumeration of SearchResult objects. Each
- * SearchResult contains the attributes identified by attributesToReturn
- * and the name of the corresponding object, named relative to the
+ * @return a non-null enumeration of SearchResult objects. Each
+ * SearchResult contains the attributes identified by attributesToReturn
+ * and the name of the corresponding object, named relative to the
* context named by name.
* @exception NamingException if a naming exception is encountered
*/
@@ -1302,15 +1302,15 @@ public class ProxyDirContext implements
/**
- * Searches in a single context for objects that contain a specified set
+ * Searches in a single context for objects that contain a specified set
* of attributes.
- *
+ *
* @param name the name of the context to search
- * @param matchingAttributes the attributes to search for. If empty or
+ * @param matchingAttributes the attributes to search for. If empty or
* null, all objects in the target context are returned.
- * @return a non-null enumeration of SearchResult objects. Each
- * SearchResult contains the attributes identified by attributesToReturn
- * and the name of the corresponding object, named relative to the
+ * @return a non-null enumeration of SearchResult objects. Each
+ * SearchResult contains the attributes identified by attributesToReturn
+ * and the name of the corresponding object, named relative to the
* context named by name.
* @exception NamingException if a naming exception is encountered
*/
@@ -1322,17 +1322,17 @@ public class ProxyDirContext implements
/**
- * Searches in the named context or object for entries that satisfy the
- * given search filter. Performs the search as specified by the search
+ * Searches in the named context or object for entries that satisfy the
+ * given search filter. Performs the search as specified by the search
* controls.
- *
+ *
* @param name the name of the context or object to search
- * @param filter the filter expression to use for the search; may not be
+ * @param filter the filter expression to use for the search; may not be
* null
- * @param cons the search controls that control the search. If null,
- * the default search controls are used (equivalent to
+ * @param cons the search controls that control the search. If null,
+ * the default search controls are used (equivalent to
* (new SearchControls())).
- * @return an enumeration of SearchResults of the objects that satisfy
+ * @return an enumeration of SearchResults of the objects that satisfy
* the filter; never null
* @exception javax.naming.directory.InvalidSearchFilterException if the
* search filter specified is not supported or understood by the underlying
@@ -1342,7 +1342,7 @@ public class ProxyDirContext implements
* @exception NamingException if a naming exception is encountered
*/
@Override
- public NamingEnumeration<SearchResult> search(Name name, String filter,
+ public NamingEnumeration<SearchResult> search(Name name, String filter,
SearchControls cons)
throws NamingException {
return dirContext.search(parseName(name), filter, cons);
@@ -1350,17 +1350,17 @@ public class ProxyDirContext implements
/**
- * Searches in the named context or object for entries that satisfy the
- * given search filter. Performs the search as specified by the search
+ * Searches in the named context or object for entries that satisfy the
+ * given search filter. Performs the search as specified by the search
* controls.
- *
+ *
* @param name the name of the context or object to search
- * @param filter the filter expression to use for the search; may not be
+ * @param filter the filter expression to use for the search; may not be
* null
- * @param cons the search controls that control the search. If null,
- * the default search controls are used (equivalent to
+ * @param cons the search controls that control the search. If null,
+ * the default search controls are used (equivalent to
* (new SearchControls())).
- * @return an enumeration of SearchResults of the objects that satisfy
+ * @return an enumeration of SearchResults of the objects that satisfy
* the filter; never null
* @exception javax.naming.directory.InvalidSearchFilterException if the
* search filter specified is not supported or understood by the underlying
@@ -1370,7 +1370,7 @@ public class ProxyDirContext implements
* @exception NamingException if a naming exception is encountered
*/
@Override
- public NamingEnumeration<SearchResult> search(String name, String filter,
+ public NamingEnumeration<SearchResult> search(String name, String filter,
SearchControls cons)
throws NamingException {
return dirContext.search(parseName(name), filter, cons);
@@ -1378,22 +1378,22 @@ public class ProxyDirContext implements
/**
- * Searches in the named context or object for entries that satisfy the
- * given search filter. Performs the search as specified by the search
+ * Searches in the named context or object for entries that satisfy the
+ * given search filter. Performs the search as specified by the search
* controls.
- *
+ *
* @param name the name of the context or object to search
- * @param filterExpr the filter expression to use for the search.
- * The expression may contain variables of the form "{i}" where i is a
+ * @param filterExpr the filter expression to use for the search.
+ * The expression may contain variables of the form "{i}" where i is a
* nonnegative integer. May not be null.
- * @param filterArgs the array of arguments to substitute for the
- * variables in filterExpr. The value of filterArgs[i] will replace each
+ * @param filterArgs the array of arguments to substitute for the
+ * variables in filterExpr. The value of filterArgs[i] will replace each
* occurrence of "{i}". If null, equivalent to an empty array.
- * @param cons the search controls that control the search. If null, the
+ * @param cons the search controls that control the search. If null, the
* default search controls are used (equivalent to (new SearchControls())).
- * @return an enumeration of SearchResults of the objects that satisy the
+ * @return an enumeration of SearchResults of the objects that satisy the
* filter; never null
- * @exception ArrayIndexOutOfBoundsException if filterExpr contains {i}
+ * @exception ArrayIndexOutOfBoundsException if filterExpr contains {i}
* expressions where i is outside the bounds of the array filterArgs
* @exception javax.naming.directory.InvalidSearchControlsException if cons
* contains invalid settings
@@ -1405,28 +1405,28 @@ public class ProxyDirContext implements
public NamingEnumeration<SearchResult> search(Name name, String filterExpr,
Object[] filterArgs, SearchControls cons)
throws NamingException {
- return dirContext.search(parseName(name), filterExpr, filterArgs,
+ return dirContext.search(parseName(name), filterExpr, filterArgs,
cons);
}
/**
- * Searches in the named context or object for entries that satisfy the
- * given search filter. Performs the search as specified by the search
+ * Searches in the named context or object for entries that satisfy the
+ * given search filter. Performs the search as specified by the search
* controls.
- *
+ *
* @param name the name of the context or object to search
- * @param filterExpr the filter expression to use for the search.
- * The expression may contain variables of the form "{i}" where i is a
+ * @param filterExpr the filter expression to use for the search.
+ * The expression may contain variables of the form "{i}" where i is a
* nonnegative integer. May not be null.
- * @param filterArgs the array of arguments to substitute for the
- * variables in filterExpr. The value of filterArgs[i] will replace each
+ * @param filterArgs the array of arguments to substitute for the
+ * variables in filterExpr. The value of filterArgs[i] will replace each
* occurrence of "{i}". If null, equivalent to an empty array.
- * @param cons the search controls that control the search. If null, the
+ * @param cons the search controls that control the search. If null, the
* default search controls are used (equivalent to (new SearchControls())).
- * @return an enumeration of SearchResults of the objects that satisy the
+ * @return an enumeration of SearchResults of the objects that satisy the
* filter; never null
- * @exception ArrayIndexOutOfBoundsException if filterExpr contains {i}
+ * @exception ArrayIndexOutOfBoundsException if filterExpr contains {i}
* expressions where i is outside the bounds of the array filterArgs
* @exception javax.naming.directory.InvalidSearchControlsException if cons
* contains invalid settings
@@ -1438,7 +1438,7 @@ public class ProxyDirContext implements
public NamingEnumeration<SearchResult> search(String name,
String filterExpr, Object[] filterArgs, SearchControls cons)
throws NamingException {
- return dirContext.search(parseName(name), filterExpr, filterArgs,
+ return dirContext.search(parseName(name), filterExpr, filterArgs,
cons);
}
@@ -1448,7 +1448,7 @@ public class ProxyDirContext implements
/**
* Retrieves the named object as a cache entry, without any exception.
- *
+ *
* @param name the name of the object to look up
* @return the cache entry bound to name
*/
@@ -1487,7 +1487,7 @@ public class ProxyDirContext implements
/**
* Parses a name.
- *
+ *
* @return the parsed name
* @throws NamingException if the name cannot be parsed
*/
@@ -1498,7 +1498,7 @@ public class ProxyDirContext implements
/**
* Parses a name.
- *
+ *
* @return the parsed name
* @throws NamingException if the name cannot be parsed
*/
@@ -1536,7 +1536,7 @@ public class ProxyDirContext implements
cacheUnload(cacheEntry.name);
return (null);
} else {
- cacheEntry.timestamp =
+ cacheEntry.timestamp =
System.currentTimeMillis() + cacheTTL;
}
}
@@ -1552,7 +1552,7 @@ public class ProxyDirContext implements
protected boolean validate(CacheEntry entry) {
if (((!entry.exists)
|| (entry.context != null)
- || ((entry.resource != null)
+ || ((entry.resource != null)
&& (entry.resource.getContent() != null)))
&& (System.currentTimeMillis() < entry.timestamp)) {
return true;
@@ -1565,7 +1565,7 @@ public class ProxyDirContext implements
* Revalidate entry.
*/
protected boolean revalidate(CacheEntry entry) {
- // Get the attributes at the given path, and check the last
+ // Get the attributes at the given path, and check the last
// modification date
if (!entry.exists)
return false;
@@ -1585,7 +1585,7 @@ public class ProxyDirContext implements
}
long lastModified2 = attributes.getLastModified();
long contentLength2 = attributes.getContentLength();
- return (lastModified == lastModified2)
+ return (lastModified == lastModified2)
&& (contentLength == contentLength2);
} catch (NamingException e) {
return false;
@@ -1608,7 +1608,7 @@ public class ProxyDirContext implements
try {
Attributes attributes = dirContext.getAttributes(entry.name);
if (!(attributes instanceof ResourceAttributes)) {
- entry.attributes =
+ entry.attributes =
new ResourceAttributes(attributes);
} else {
entry.attributes = (ResourceAttributes) attributes;
@@ -1638,13 +1638,13 @@ public class ProxyDirContext implements
}
// Load object content
- if ((exists) && (entry.resource != null)
- && (entry.resource.getContent() == null)
+ if ((exists) && (entry.resource != null)
+ && (entry.resource.getContent() == null)
&& (entry.attributes.getContentLength() >= 0)
- && (entry.attributes.getContentLength() <
+ && (entry.attributes.getContentLength() <
(cacheObjectMaxSize * 1024))) {
int length = (int) entry.attributes.getContentLength();
- // The entry size is 1 + the resource size in KB, if it will be
+ // The entry size is 1 + the resource size in KB, if it will be
// cached
entry.size += (entry.attributes.getContentLength() / 1024);
InputStream is = null;
Modified: tomcat/trunk/java/org/apache/naming/resources/RecyclableNamingEnumeration.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/resources/RecyclableNamingEnumeration.java?rev=1187782&r1=1187781&r2=1187782&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/resources/RecyclableNamingEnumeration.java (original)
+++ tomcat/trunk/java/org/apache/naming/resources/RecyclableNamingEnumeration.java Sat Oct 22 21:03:58 2011
@@ -5,15 +5,15 @@
* 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.
- */
+ */
package org.apache.naming.resources;
@@ -31,7 +31,7 @@ import javax.naming.NamingException;
* @version $Id$
*/
-public class RecyclableNamingEnumeration<E>
+public class RecyclableNamingEnumeration<E>
implements NamingEnumeration<E> {
Modified: tomcat/trunk/java/org/apache/naming/resources/Resource.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/resources/Resource.java?rev=1187782&r1=1187781&r2=1187782&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/resources/Resource.java (original)
+++ tomcat/trunk/java/org/apache/naming/resources/Resource.java Sat Oct 22 21:03:58 2011
@@ -5,15 +5,15 @@
* 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.
- */
+ */
package org.apache.naming.resources;
@@ -23,52 +23,52 @@ import java.io.InputStream;
/**
* Encapsulates the contents of a resource.
- *
+ *
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
* @version $Revision$
*/
public class Resource {
-
-
+
+
// ----------------------------------------------------------- Constructors
-
-
+
+
public Resource() {
// NO-OP
}
-
-
+
+
public Resource(InputStream inputStream) {
setContent(inputStream);
}
-
-
+
+
public Resource(byte[] binaryContent) {
setContent(binaryContent);
}
-
-
+
+
// ----------------------------------------------------- Instance Variables
-
-
+
+
/**
* Binary content.
*/
protected byte[] binaryContent = null;
-
-
+
+
/**
* Input stream.
*/
protected InputStream inputStream = null;
-
-
+
+
// ------------------------------------------------------------- Properties
-
-
+
+
/**
* Content accessor.
- *
+ *
* @return InputStream
* @throws IOException
*/
@@ -78,36 +78,36 @@ public class Resource {
}
return inputStream;
}
-
-
+
+
/**
* Content accessor.
- *
+ *
* @return binary content
*/
public byte[] getContent() {
return binaryContent;
}
-
-
+
+
/**
* Content mutator.
- *
+ *
* @param inputStream New input stream
*/
public void setContent(InputStream inputStream) {
this.inputStream = inputStream;
}
-
-
+
+
/**
* Content mutator.
- *
+ *
* @param binaryContent New bin content
*/
public void setContent(byte[] binaryContent) {
this.binaryContent = binaryContent;
}
-
-
+
+
}
Modified: tomcat/trunk/java/org/apache/naming/resources/ResourceAttributes.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/resources/ResourceAttributes.java?rev=1187782&r1=1187781&r2=1187782&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/resources/ResourceAttributes.java (original)
+++ tomcat/trunk/java/org/apache/naming/resources/ResourceAttributes.java Sat Oct 22 21:03:58 2011
@@ -5,15 +5,15 @@
* 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.
- */
+ */
package org.apache.naming.resources;
@@ -32,104 +32,104 @@ import javax.naming.directory.BasicAttri
/**
* Attributes implementation.
- *
+ *
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
* @version $Revision$
*/
public class ResourceAttributes implements Attributes {
-
-
+
+
// -------------------------------------------------------------- Constants
-
+
private static final long serialVersionUID = 1L;
-
+
// Default attribute names
-
+
/**
* Creation date.
*/
public static final String CREATION_DATE = "creationdate";
-
-
+
+
/**
* Creation date.
*/
public static final String ALTERNATE_CREATION_DATE = "creation-date";
-
-
+
+
/**
* Last modification date.
*/
public static final String LAST_MODIFIED = "getlastmodified";
-
-
+
+
/**
* Last modification date.
*/
public static final String ALTERNATE_LAST_MODIFIED = "last-modified";
-
-
+
+
/**
* Name.
*/
public static final String NAME = "displayname";
-
-
+
+
/**
* Type.
*/
public static final String TYPE = "resourcetype";
-
-
+
+
/**
* Type.
*/
public static final String ALTERNATE_TYPE = "content-type";
-
-
+
+
/**
* MIME type of the content.
*/
public static final String CONTENT_TYPE = "getcontenttype";
-
-
+
+
/**
* Content length.
*/
public static final String CONTENT_LENGTH = "getcontentlength";
-
-
+
+
/**
* Content length.
*/
public static final String ALTERNATE_CONTENT_LENGTH = "content-length";
-
-
+
+
/**
* ETag.
*/
public static final String ETAG = "getetag";
-
-
+
+
/**
* ETag.
*/
public static final String ALTERNATE_ETAG = "etag";
-
-
+
+
/**
* Collection type.
*/
public static final String COLLECTION_TYPE = "<collection/>";
-
-
+
+
/**
* HTTP date format.
*/
protected static final SimpleDateFormat format =
new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US);
-
-
+
+
/**
* Date formats using for Date parsing.
*/
@@ -138,8 +138,8 @@ public class ResourceAttributes implemen
new SimpleDateFormat("EEEEEE, dd-MMM-yy HH:mm:ss zzz", Locale.US),
new SimpleDateFormat("EEE MMMM d HH:mm:ss yyyy", Locale.US)
};
-
-
+
+
protected static final TimeZone gmtZone = TimeZone.getTimeZone("GMT");
@@ -158,24 +158,24 @@ public class ResourceAttributes implemen
// ----------------------------------------------------------- Constructors
-
-
+
+
/**
* Default constructor.
*/
public ResourceAttributes() {
// NO-OP
}
-
-
+
+
/**
* Merges with another attribute set.
*/
public ResourceAttributes(Attributes attributes) {
this.attributes = attributes;
}
-
-
+
+
// ----------------------------------------------------- Instance Variables
@@ -214,18 +214,18 @@ public class ResourceAttributes implemen
*/
protected Date lastModifiedDate = null;
-
+
/**
* Last modified date in HTTP format.
*/
protected String lastModifiedHttp = null;
-
+
/**
* MIME type.
*/
protected String mimeType = null;
-
+
/**
* Name.
@@ -264,8 +264,8 @@ public class ResourceAttributes implemen
return (collection);
}
}
-
-
+
+
/**
* Set collection flag.
*
@@ -280,11 +280,11 @@ public class ResourceAttributes implemen
attributes.put(TYPE, value);
}
}
-
-
+
+
/**
* Get content length.
- *
+ *
* @return content length value
*/
public long getContentLength() {
@@ -311,11 +311,11 @@ public class ResourceAttributes implemen
}
return contentLength;
}
-
-
+
+
/**
* Set content length.
- *
+ *
* @param contentLength New content length value
*/
public void setContentLength(long contentLength) {
@@ -323,11 +323,11 @@ public class ResourceAttributes implemen
if (attributes != null)
attributes.put(CONTENT_LENGTH, Long.valueOf(contentLength));
}
-
-
+
+
/**
* Get creation time.
- *
+ *
* @return creation time value
*/
public long getCreation() {
@@ -349,7 +349,7 @@ public class ResourceAttributes implemen
String creationDateValue = value.toString();
Date result = null;
// Parsing the HTTP Date
- for (int i = 0; (result == null) &&
+ for (int i = 0; (result == null) &&
(i < formats.length); i++) {
try {
result = formats[i].parse(creationDateValue);
@@ -369,11 +369,11 @@ public class ResourceAttributes implemen
}
return creation;
}
-
-
+
+
/**
* Set creation.
- *
+ *
* @param creation New creation value
*/
public void setCreation(long creation) {
@@ -382,11 +382,11 @@ public class ResourceAttributes implemen
if (attributes != null)
attributes.put(CREATION_DATE, new Date(creation));
}
-
-
+
+
/**
* Get creation date.
- *
+ *
* @return Creation date value
*/
public Date getCreationDate() {
@@ -411,7 +411,7 @@ public class ResourceAttributes implemen
String creationDateValue = value.toString();
Date result = null;
// Parsing the HTTP Date
- for (int i = 0; (result == null) &&
+ for (int i = 0; (result == null) &&
(i < formats.length); i++) {
try {
result = formats[i].parse(creationDateValue);
@@ -431,11 +431,11 @@ public class ResourceAttributes implemen
}
return creationDate;
}
-
-
+
+
/**
* Creation date mutator.
- *
+ *
* @param creationDate New creation date
*/
public void setCreationDate(Date creationDate) {
@@ -444,11 +444,11 @@ public class ResourceAttributes implemen
if (attributes != null)
attributes.put(CREATION_DATE, creationDate);
}
-
-
+
+
/**
* Get last modified time.
- *
+ *
* @return lastModified time value
*/
public long getLastModified() {
@@ -470,10 +470,10 @@ public class ResourceAttributes implemen
String lastModifiedDateValue = value.toString();
Date result = null;
// Parsing the HTTP Date
- for (int i = 0; (result == null) &&
+ for (int i = 0; (result == null) &&
(i < formats.length); i++) {
try {
- result =
+ result =
formats[i].parse(lastModifiedDateValue);
} catch (ParseException e) {
// Ignore
@@ -491,11 +491,11 @@ public class ResourceAttributes implemen
}
return lastModified;
}
-
-
+
+
/**
* Set last modified.
- *
+ *
* @param lastModified New last modified value
*/
public void setLastModified(long lastModified) {
@@ -504,11 +504,11 @@ public class ResourceAttributes implemen
if (attributes != null)
attributes.put(LAST_MODIFIED, new Date(lastModified));
}
-
-
+
+
/**
* Get lastModified date.
- *
+ *
* @return LastModified date value
*/
public Date getLastModifiedDate() {
@@ -533,10 +533,10 @@ public class ResourceAttributes implemen
String lastModifiedDateValue = value.toString();
Date result = null;
// Parsing the HTTP Date
- for (int i = 0; (result == null) &&
+ for (int i = 0; (result == null) &&
(i < formats.length); i++) {
try {
- result =
+ result =
formats[i].parse(lastModifiedDateValue);
} catch (ParseException e) {
// Ignore
@@ -554,11 +554,11 @@ public class ResourceAttributes implemen
}
return lastModifiedDate;
}
-
-
+
+
/**
* Last modified date mutator.
- *
+ *
* @param lastModifiedDate New last modified date
*/
public void setLastModifiedDate(Date lastModifiedDate) {
@@ -567,8 +567,8 @@ public class ResourceAttributes implemen
if (attributes != null)
attributes.put(LAST_MODIFIED, lastModifiedDate);
}
-
-
+
+
/**
* @return Returns the lastModifiedHttp.
*/
@@ -587,24 +587,24 @@ public class ResourceAttributes implemen
}
return lastModifiedHttp;
}
-
-
+
+
/**
* @param lastModifiedHttp The lastModifiedHttp to set.
*/
public void setLastModifiedHttp(String lastModifiedHttp) {
this.lastModifiedHttp = lastModifiedHttp;
}
-
-
+
+
/**
* @return Returns the mimeType.
*/
public String getMimeType() {
return mimeType;
}
-
-
+
+
/**
* @param mimeType The mimeType to set.
*/
@@ -612,10 +612,10 @@ public class ResourceAttributes implemen
this.mimeType = mimeType;
}
-
+
/**
* Get name.
- *
+ *
* @return Name value
*/
public String getName() {
@@ -637,7 +637,7 @@ public class ResourceAttributes implemen
/**
* Set name.
- *
+ *
* @param name New name value
*/
public void setName(String name) {
@@ -645,11 +645,11 @@ public class ResourceAttributes implemen
if (attributes != null)
attributes.put(NAME, name);
}
-
-
+
+
/**
* Get resource type.
- *
+ *
* @return String resource type
*/
public String getResourceType() {
@@ -670,11 +670,11 @@ public class ResourceAttributes implemen
}
return result;
}
-
-
+
+
/**
* Type mutator.
- *
+ *
* @param resourceType New resource type
*/
public void setResourceType(String resourceType) {
@@ -686,8 +686,8 @@ public class ResourceAttributes implemen
/**
* Get ETag.
- *
- * @return strong ETag if available, else weak ETag.
+ *
+ * @return strong ETag if available, else weak ETag.
*/
public String getETag() {
String result = null;
@@ -717,7 +717,7 @@ public class ResourceAttributes implemen
}
result = weakETag;
}
- }
+ }
return result;
}
@@ -731,19 +731,19 @@ public class ResourceAttributes implemen
attributes.put(ETAG, eTag);
}
-
+
/**
- * Return the canonical path of the resource, to possibly be used for
+ * Return the canonical path of the resource, to possibly be used for
* direct file serving. Implementations which support this should override
* it to return the file path.
- *
+ *
* @return The canonical path of the resource
*/
public String getCanonicalPath() {
return null;
}
-
-
+
+
// ----------------------------------------------------- Attributes Methods
@@ -803,8 +803,8 @@ public class ResourceAttributes implemen
}
return null;
}
-
-
+
+
/**
* Put attribute.
*/
@@ -820,8 +820,8 @@ public class ResourceAttributes implemen
return attributes.put(attribute);
}
}
-
-
+
+
/**
* Put attribute.
*/
@@ -833,8 +833,8 @@ public class ResourceAttributes implemen
return attributes.put(attrID, val);
}
}
-
-
+
+
/**
* Remove attribute.
*/
@@ -846,8 +846,8 @@ public class ResourceAttributes implemen
return attributes.remove(attrID);
}
}
-
-
+
+
/**
* Get all attributes.
*/
@@ -894,8 +894,8 @@ public class ResourceAttributes implemen
return attributes.getAll();
}
}
-
-
+
+
/**
* Get all attribute IDs.
*/
@@ -936,8 +936,8 @@ public class ResourceAttributes implemen
return attributes.getIDs();
}
}
-
-
+
+
/**
* Retrieves the number of attributes in the attribute set.
*/
@@ -956,8 +956,8 @@ public class ResourceAttributes implemen
return attributes.size();
}
}
-
-
+
+
/**
* Clone the attributes object (WARNING: fake cloning).
*/
@@ -965,8 +965,8 @@ public class ResourceAttributes implemen
public Object clone() {
return this;
}
-
-
+
+
/**
* Case sensitivity.
*/
@@ -974,6 +974,6 @@ public class ResourceAttributes implemen
public boolean isCaseIgnored() {
return false;
}
-
-
+
+
}
Modified: tomcat/trunk/java/org/apache/naming/resources/ResourceCache.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/resources/ResourceCache.java?rev=1187782&r1=1187781&r2=1187782&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/resources/ResourceCache.java (original)
+++ tomcat/trunk/java/org/apache/naming/resources/ResourceCache.java Sat Oct 22 21:03:58 2011
@@ -5,15 +5,15 @@
* 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.
- */
+ */
package org.apache.naming.resources;
@@ -23,21 +23,21 @@ import java.util.Random;
/**
* Implements a special purpose cache.
- *
+ *
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
* @version $Revision$
*/
public class ResourceCache {
-
-
+
+
// ----------------------------------------------------------- Constructors
-
-
+
+
public ResourceCache() {
// NO-OP
}
-
-
+
+
// ----------------------------------------------------- Instance Variables
@@ -109,7 +109,7 @@ public class ResourceCache {
/**
* Return the access count.
- * Note: Update is not synced, so the number may not be completely
+ * Note: Update is not synced, so the number may not be completely
* accurate.
*/
public long getAccessCount() {
@@ -159,7 +159,7 @@ public class ResourceCache {
/**
* Return the number of cache hits.
- * Note: Update is not synced, so the number may not be completely
+ * Note: Update is not synced, so the number may not be completely
* accurate.
*/
public long getHitsCount() {
@@ -248,7 +248,7 @@ public class ResourceCache {
}
}
}
- long entryAccessRatio =
+ long entryAccessRatio =
((cache[entryPos].accessCount * 100) / accessCount);
if (entryAccessRatio < desiredEntryAccessRatio) {
toRemove[entriesFound] = entryPos;
@@ -413,7 +413,7 @@ public class ResourceCache {
if ((pos != -1) && (name.equals(oldCache[pos].name))) {
CacheEntry[] newCache = new CacheEntry[cache.length - 1];
System.arraycopy(oldCache, 0, newCache, 0, pos);
- System.arraycopy(oldCache, pos + 1, newCache, pos,
+ System.arraycopy(oldCache, pos + 1, newCache, pos,
oldCache.length - pos - 1);
cache = newCache;
return oldCache[pos];
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org