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 2015/10/11 22:40:49 UTC

svn commit: r1708024 - in /tomcat/trunk/java/org/apache/naming: ContextAccessController.java ContextBindings.java EjbRef.java

Author: markt
Date: Sun Oct 11 20:40:49 2015
New Revision: 1708024

URL: http://svn.apache.org/viewvc?rev=1708024&view=rev
Log:
Javadoc fixes

Modified:
    tomcat/trunk/java/org/apache/naming/ContextAccessController.java
    tomcat/trunk/java/org/apache/naming/ContextBindings.java
    tomcat/trunk/java/org/apache/naming/EjbRef.java

Modified: tomcat/trunk/java/org/apache/naming/ContextAccessController.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/ContextAccessController.java?rev=1708024&r1=1708023&r2=1708024&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/ContextAccessController.java (original)
+++ tomcat/trunk/java/org/apache/naming/ContextAccessController.java Sun Oct 11 20:40:49 2015
@@ -14,8 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-
 package org.apache.naming;
 
 import java.util.Hashtable;
@@ -27,27 +25,22 @@ import java.util.Hashtable;
  */
 public class ContextAccessController {
 
-
     // -------------------------------------------------------------- Variables
 
-
     /**
      * Catalina context names on which writing is not allowed.
      */
-    private static final Hashtable<Object,Object> readOnlyContexts =
-            new Hashtable<>();
+    private static final Hashtable<Object,Object> readOnlyContexts = new Hashtable<>();
 
 
     /**
      * Security tokens repository.
      */
-    private static final Hashtable<Object,Object> securityTokens =
-            new Hashtable<>();
+    private static final Hashtable<Object,Object> securityTokens = new Hashtable<>();
 
 
     // --------------------------------------------------------- Public Methods
 
-
     /**
      * Set a security token for a context. Can be set only once.
      *
@@ -81,12 +74,14 @@ public class ContextAccessController {
 
 
     /**
-     * Check a submitted security token. The submitted token must be equal to
-     * the token present in the repository. If no token is present for the
-     * context, then returns true.
+     * Check a submitted security token.
      *
      * @param name Name of the context
      * @param token Submitted security token
+     *
+     * @return <code>true</code> if the submitted token is equal to the token
+     *         in the repository or if no token is present in the repository.
+     *         Otherwise, <code>false</code>
      */
     public static boolean checkSecurityToken
         (Object name, Object token) {
@@ -118,14 +113,14 @@ public class ContextAccessController {
 
 
     /**
-     * Returns if a context is writable.
+     * Is the context is writable?
      *
      * @param name Name of the context
+     *
+     * @return <code>true</code> if it is writable, otherwise <code>false</code>
      */
     public static boolean isWritable(Object name) {
         return !(readOnlyContexts.containsKey(name));
     }
-
-
 }
 

Modified: tomcat/trunk/java/org/apache/naming/ContextBindings.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/ContextBindings.java?rev=1708024&r1=1708023&r2=1708024&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/ContextBindings.java (original)
+++ tomcat/trunk/java/org/apache/naming/ContextBindings.java Sun Oct 11 20:40:49 2015
@@ -37,55 +37,46 @@ import javax.naming.NamingException;
  */
 public class ContextBindings {
 
-
     // -------------------------------------------------------------- Variables
 
-
     /**
      * Bindings object - naming context. Keyed by object.
      */
-    private static final Hashtable<Object,Context> objectBindings =
-            new Hashtable<>();
+    private static final Hashtable<Object,Context> objectBindings = new Hashtable<>();
 
 
     /**
      * Bindings thread - naming context. Keyed by thread.
      */
-    private static final Hashtable<Thread,Context> threadBindings =
-            new Hashtable<>();
+    private static final Hashtable<Thread,Context> threadBindings = new Hashtable<>();
 
 
     /**
      * Bindings thread - object. Keyed by thread.
      */
-    private static final Hashtable<Thread,Object> threadObjectBindings =
-            new Hashtable<>();
+    private static final Hashtable<Thread,Object> threadObjectBindings = new Hashtable<>();
 
 
     /**
      * Bindings class loader - naming context. Keyed by class loader.
      */
-    private static final Hashtable<ClassLoader,Context> clBindings =
-            new Hashtable<>();
+    private static final Hashtable<ClassLoader,Context> clBindings = new Hashtable<>();
 
 
     /**
      * Bindings class loader - object. Keyed by class loader.
      */
-    private static final Hashtable<ClassLoader,Object> clObjectBindings =
-            new Hashtable<>();
+    private static final Hashtable<ClassLoader,Object> clObjectBindings = new Hashtable<>();
 
 
     /**
      * The string manager for this package.
      */
-    protected static final StringManager sm =
-        StringManager.getManager(Constants.Package);
+    protected static final StringManager sm = StringManager.getManager(Constants.Package);
 
 
     // --------------------------------------------------------- Public Methods
 
-
     /**
      * Binds an object and a naming context.
      *
@@ -139,6 +130,9 @@ public class ContextBindings {
      *
      * @param obj   Object bound to the required naming context
      * @param token Security token
+     *
+     * @throws NamingException If no naming context is bound to the provided
+     *         object
      */
     public static void bindThread(Object obj, Object token) throws NamingException {
         if (ContextAccessController.checkSecurityToken(obj, token)) {
@@ -169,6 +163,11 @@ public class ContextBindings {
 
     /**
      * Retrieves the naming context bound to the current thread.
+     *
+     * @return The naming context bound to the current thread.
+     *
+     * @throws NamingException If no naming context is bound to the current
+     *         thread
      */
     public static Context getThread() throws NamingException {
         Context context = threadBindings.get(Thread.currentThread());
@@ -196,6 +195,9 @@ public class ContextBindings {
 
     /**
      * Tests if current thread is bound to a naming context.
+     *
+     * @return <code>true</code> if the current thread is bound to a naming
+     *         context, otherwise <code>false</code>
      */
     public static boolean isThreadBound() {
         return (threadBindings.containsKey(Thread.currentThread()));
@@ -208,6 +210,9 @@ public class ContextBindings {
      * @param obj           Object bound to the required naming context
      * @param token         Security token
      * @param classLoader   The class loader to bind to the naming context
+     *
+     * @throws NamingException If no naming context is bound to the provided
+     *         object
      */
     public static void bindClassLoader(Object obj, Object token,
             ClassLoader classLoader) throws NamingException {
@@ -245,6 +250,11 @@ public class ContextBindings {
 
     /**
      * Retrieves the naming context bound to a class loader.
+     *
+     * @return the naming context bound to current class loader or one of its
+     *         parents
+     *
+     * @throws NamingException If no naming context was bound
      */
     public static Context getClassLoader() throws NamingException {
         ClassLoader cl = Thread.currentThread().getContextClassLoader();
@@ -278,6 +288,10 @@ public class ContextBindings {
 
     /**
      * Tests if the thread context class loader is bound to a context.
+     *
+     * @return <code>true</code> if the thread context class loader or one of
+     *         its parents is bound to a naming context, otherwise
+     *         <code>false</code>
      */
     public static boolean isClassLoaderBound() {
         ClassLoader cl = Thread.currentThread().getContextClassLoader();

Modified: tomcat/trunk/java/org/apache/naming/EjbRef.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/EjbRef.java?rev=1708024&r1=1708023&r2=1708024&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/EjbRef.java (original)
+++ tomcat/trunk/java/org/apache/naming/EjbRef.java Sun Oct 11 20:40:49 2015
@@ -78,9 +78,12 @@ public class EjbRef extends Reference {
      * EJB Reference.
      *
      * @param ejbType EJB type
-     * @param home Home interface classname
-     * @param remote Remote interface classname
-     * @param link EJB link
+     * @param home    Home interface classname
+     * @param remote  Remote interface classname
+     * @param link    EJB link
+     * @param factory The possibly null class name of the object's factory.
+     * @param factoryLocation   The possibly null location from which to load
+     *                          the factory (e.g. URL)
      */
     public EjbRef(String ejbType, String home, String remote, String link,
                   String factory, String factoryLocation) {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org