Author: fmeschbe
Date: Thu Feb 11 10:43:33 2010
New Revision: 908919

URL: http://svn.apache.org/viewvc?rev=908919&view=rev
Log:
SLING-1368 Add support to order authentication handlers and requirements by 
ServiceReference (service.rank, service.id) in addition to the path.

Modified:
    
sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/AbstractAuthenticationHandlerHolder.java
    
sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/AuthenticationHandlerHolder.java
    
sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/AuthenticationRequirementHolder.java
    
sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/AuthenticatorWebConsolePlugin.java
    
sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/PathBasedHolder.java
    
sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/SlingAuthenticator.java
    
sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/engine/EngineAuthenticationHandlerHolder.java

Modified: 
sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/AbstractAuthenticationHandlerHolder.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/AbstractAuthenticationHandlerHolder.java?rev=908919&r1=908918&r2=908919&view=diff
==============================================================================
--- 
sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/AbstractAuthenticationHandlerHolder.java
 (original)
+++ 
sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/AbstractAuthenticationHandlerHolder.java
 Thu Feb 11 10:43:33 2010
@@ -26,26 +26,34 @@
 import org.apache.sling.commons.auth.spi.AuthenticationFeedbackHandler;
 import org.apache.sling.commons.auth.spi.AuthenticationHandler;
 import org.apache.sling.commons.auth.spi.AuthenticationInfo;
+import org.osgi.framework.ServiceReference;
 
 /**
- * The <code>AuthenticationHandlerHolder</code> class represents an
- * authentication handler service in the internal data structure of the
+ * The <code>AbstractAuthenticationHandlerHolder</code> is a base class to
+ * represent authentication handlers (both legacy and new ones) for use in the
  * {...@link SlingAuthenticator}.
- *
  */
-public abstract class AbstractAuthenticationHandlerHolder extends 
PathBasedHolder implements AuthenticationHandler {
+public abstract class AbstractAuthenticationHandlerHolder extends
+        PathBasedHolder implements AuthenticationHandler {
 
-    protected AbstractAuthenticationHandlerHolder(final String fullPath) {
-        super(fullPath);
+    protected AbstractAuthenticationHandlerHolder(final String fullPath,
+            final ServiceReference serviceReference) {
+        super(fullPath, serviceReference);
     }
 
-    protected abstract AuthenticationFeedbackHandler getFeedbackHandler();
-
-    protected abstract AuthenticationInfo 
doExtractCredentials(HttpServletRequest request,
-            HttpServletResponse response);
-
-    public final AuthenticationInfo extractCredentials(HttpServletRequest 
request,
-            HttpServletResponse response) {
+    /**
+     * Sets the {...@link AuthenticationHandler#PATH_PROPERTY} request 
attribute to
+     * this {...@link PathBasedHolder#fullPath} and calls the
+     * {...@link #extractCredentials(HttpServletRequest, HttpServletResponse)} 
to
+     * have the credentials extracted from the request.
+     *
+     * @param request the current request
+     * @param response the current response
+     * @returns the result of calling
+     *          {...@link #doExtractCredentials(HttpServletRequest, 
HttpServletResponse)}
+     */
+    public final AuthenticationInfo extractCredentials(
+            HttpServletRequest request, HttpServletResponse response) {
 
         final Object oldPathAttr = setPath(request);
         try {
@@ -56,9 +64,18 @@
 
     }
 
-    protected abstract boolean doRequestCredentials(HttpServletRequest request,
-            HttpServletResponse response) throws IOException;
-
+    /**
+     * Sets the {...@link AuthenticationHandler#PATH_PROPERTY} request 
attribute to
+     * this {...@link PathBasedHolder#fullPath} and calls the
+     * {...@link #doRequestCredentials(HttpServletRequest, 
HttpServletResponse)} to
+     * have the credentials requested from the client.
+     *
+     * @param request the current request
+     * @param response the current response
+     * @returns the result of calling
+     *          {...@link #doRequestCredentials(HttpServletRequest, 
HttpServletResponse)}
+     * @throws IOException if an error occurrs interacting with the client
+     */
     public final boolean requestCredentials(HttpServletRequest request,
             HttpServletResponse response) throws IOException {
         final Object oldPathAttr = setPath(request);
@@ -69,19 +86,89 @@
         }
     }
 
-    protected abstract void doDropCredentials(HttpServletRequest request,
-            HttpServletResponse response) throws IOException;
-
+    /**
+     * Sets the {...@link AuthenticationHandler#PATH_PROPERTY} request 
attribute to
+     * this {...@link PathBasedHolder#fullPath} and calls the
+     * {...@link #doDropCredentials(HttpServletRequest, HttpServletResponse)} 
to
+     * have the credentials dropped by the held authentication handler.
+     *
+     * @param request the current request
+     * @param response the current response
+     * @throws IOException if an error occurrs interacting with the client
+     */
     public final void dropCredentials(HttpServletRequest request,
             HttpServletResponse response) throws IOException {
-        doDropCredentials(request, response);
+        final Object oldPathAttr = setPath(request);
+        try {
+            doDropCredentials(request, response);
+        } finally {
+            resetPath(request, oldPathAttr);
+        }
     }
 
+    // --------- API to be implemented
+
+    /**
+     * Returns a feedback handler provided by the authentication handler held 
by
+     * this instance or <code>null</code> if none is provided.
+     */
+    protected abstract AuthenticationFeedbackHandler getFeedbackHandler();
+
+    /**
+     * Calls the actual authentication handler to extract the credentials from
+     * the request.
+     *
+     * @param request The current request
+     * @param response The current response
+     * @return as returned from the called authentication handler
+     * @see #extractCredentials(HttpServletRequest, HttpServletResponse)
+     */
+    protected abstract AuthenticationInfo doExtractCredentials(
+            HttpServletRequest request, HttpServletResponse response);
+
+    /**
+     * Calls the actual authentication handler to request the credentials from
+     * the client.
+     *
+     * @param request The current request
+     * @param response The current response
+     * @return as returned from the called authentication handler
+     * @throws IOException if an error occurrs sending back any response to the
+     *             client.
+     * @see #requestCredentials(HttpServletRequest, HttpServletResponse)
+     */
+    protected abstract boolean doRequestCredentials(HttpServletRequest request,
+            HttpServletResponse response) throws IOException;
+
+    /**
+     * Calls the actual authentication handler to request the credentials from
+     * the client.
+     *
+     * @param request The current request
+     * @param response The current response
+     * @return as returned from the called authentication handler
+     * @throws IOException if an error occurrs sending back any response to the
+     *             client.
+     * @see #dropCredentials(HttpServletRequest, HttpServletResponse)
+     */
+    protected abstract void doDropCredentials(HttpServletRequest request,
+            HttpServletResponse response) throws IOException;
+
+    // ---------- internal
+
+    /**
+     * Sets the {...@link PathBasedHolder#fullPath} as the
+     * {...@link AuthenticationHandler#PATH_PROPERTY} request attribute.
+     */
     private Object setPath(final HttpServletRequest request) {
         return setRequestAttribute(request,
             AuthenticationHandler.PATH_PROPERTY, fullPath);
     }
 
+    /**
+     * Sets the given <code>odlValue</code> as the
+     * {...@link AuthenticationHandler#PATH_PROPERTY} request attribute.
+     */
     private void resetPath(final HttpServletRequest request, Object oldValue) {
         setRequestAttribute(request, AuthenticationHandler.PATH_PROPERTY,
             oldValue);

Modified: 
sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/AuthenticationHandlerHolder.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/AuthenticationHandlerHolder.java?rev=908919&r1=908918&r2=908919&view=diff
==============================================================================
--- 
sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/AuthenticationHandlerHolder.java
 (original)
+++ 
sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/AuthenticationHandlerHolder.java
 Thu Feb 11 10:43:33 2010
@@ -26,6 +26,7 @@
 import org.apache.sling.commons.auth.spi.AuthenticationFeedbackHandler;
 import org.apache.sling.commons.auth.spi.AuthenticationHandler;
 import org.apache.sling.commons.auth.spi.AuthenticationInfo;
+import org.osgi.framework.ServiceReference;
 
 /**
  * The <code>AuthenticationHandlerHolder</code> class represents an
@@ -40,8 +41,9 @@
     private final AuthenticationHandler handler;
 
     AuthenticationHandlerHolder(final String fullPath,
-            final AuthenticationHandler handler) {
-        super(fullPath);
+            final AuthenticationHandler handler,
+            final ServiceReference serviceReference) {
+        super(fullPath, serviceReference);
 
         // assign the fields
         this.handler = handler;

Modified: 
sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/AuthenticationRequirementHolder.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/AuthenticationRequirementHolder.java?rev=908919&r1=908918&r2=908919&view=diff
==============================================================================
--- 
sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/AuthenticationRequirementHolder.java
 (original)
+++ 
sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/AuthenticationRequirementHolder.java
 Thu Feb 11 10:43:33 2010
@@ -18,14 +18,14 @@
  */
 package org.apache.sling.commons.auth.impl;
 
+import org.osgi.framework.ServiceReference;
+
 class AuthenticationRequirementHolder extends PathBasedHolder {
 
     private final boolean requiresAuthentication;
 
-    private final String source;
-
     static AuthenticationRequirementHolder fromConfig(final String config,
-            final String source) {
+            final ServiceReference serviceReference) {
         if (config == null || config.length() == 0) {
             throw new IllegalArgumentException(
                 "Configuration must not be null or empty");
@@ -44,21 +44,18 @@
             path = config;
         }
 
-        return new AuthenticationRequirementHolder(path, required, source);
+        return new AuthenticationRequirementHolder(path, required,
+            serviceReference);
     }
 
     AuthenticationRequirementHolder(final String fullPath,
-            final boolean requiresAuthentication, final String source) {
-        super(fullPath);
+            final boolean requiresAuthentication,
+            final ServiceReference serviceReference) {
+        super(fullPath, serviceReference);
         this.requiresAuthentication = requiresAuthentication;
-        this.source = source;
     }
 
     boolean requiresAuthentication() {
         return requiresAuthentication;
     }
-
-    String getSource() {
-        return source;
-    }
 }

Modified: 
sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/AuthenticatorWebConsolePlugin.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/AuthenticatorWebConsolePlugin.java?rev=908919&r1=908918&r2=908919&view=diff
==============================================================================
--- 
sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/AuthenticatorWebConsolePlugin.java
 (original)
+++ 
sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/AuthenticatorWebConsolePlugin.java
 Thu Feb 11 10:43:33 2010
@@ -85,7 +85,7 @@
 
             pw.println("<tr class='content'>");
             pw.println("<td class='content'>" + handler.fullPath + "</td>");
-            pw.println("<td class='content' colspan='2'>" + handler + "</td>");
+            pw.println("<td class='content' colspan='2'>" + 
handler.getProvider() + "</td>");
             pw.println("</tr>");
 
         }
@@ -108,7 +108,7 @@
             pw.println("<td class='content'>" + req.fullPath + "</td>");
             pw.println("<td class='content'>"
                 + (req.requiresAuthentication() ? "Yes" : "No") + "</td>");
-            pw.println("<td class='content'>" + req.getSource() + "</td>");
+            pw.println("<td class='content'>" + req.getProvider() + "</td>");
             pw.println("</tr>");
 
         }

Modified: 
sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/PathBasedHolder.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/PathBasedHolder.java?rev=908919&r1=908918&r2=908919&view=diff
==============================================================================
--- 
sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/PathBasedHolder.java
 (original)
+++ 
sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/PathBasedHolder.java
 Thu Feb 11 10:43:33 2010
@@ -18,29 +18,75 @@
  */
 package org.apache.sling.commons.auth.impl;
 
+import org.apache.sling.commons.osgi.OsgiUtil;
+import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceReference;
+
 /**
- * The <code>AuthenticationHandlerHolder</code> class represents an
- * authentication handler service in the internal data structure of the
- * {...@link SlingAuthenticator}.
- *
+ * The <code>PathBasedHolder</code> provides the basic abstraction for managing
+ * authentication handler and authentication requirements in the
+ * {...@link SlingAuthenticator} with the following base functionality:
+ * <ul>
+ * <li>Provide location of control through its path fields</li>
+ * <li>Support orderability of instances by being <code>Comparable</code> and
+ * odering according to the {...@link #fullPath} and the
+ * <code>ServiceReference</code> of the provider service</li>
+ * <li>Support {...@link #equals(Object)} and {...@link #hashCode()} 
compatible with
+ * the <code>Comparable</code> implementation.</li>
+ * </ul>
  */
 public abstract class PathBasedHolder implements Comparable<PathBasedHolder> {
 
-    // full path of the service registration
+    /**
+     * The full registration path of this instance. This is the actual URL with
+     * which this instance has been created.
+     */
     protected final String fullPath;
 
-    // file path part of the service registration full path
-    final String path;
+    /**
+     * The Scheme part of the URL of the {...@link #fullPath}. If no scheme is
+     * contained, this field is set to an empty string.
+     */
+    final String protocol;
 
-    // host element of the service registration full path
+    /**
+     * The host part of the URL of the {...@link #fullPath}. If no host is
+     * contained, this field is set to an empty string.
+     */
     final String host;
 
-    // protocol element of the service registration full path
-    final String protocol;
+    /**
+     * The path part of the URL of the {...@link #fullPath}. If that URL 
contains
+     * neither a scheme nor a host, this field is actually set to the same as
+     * {...@link #fullPath}.
+     */
+    final String path;
 
-    protected PathBasedHolder(final String fullPath) {
+    /**
+     * The <code>ServiceReference</code> to the service, which causes this
+     * instance to be created. This may be <code>null</code> if the entry has
+     * been created by the {...@link SlingAuthenticator} itself.
+     */
+    private final ServiceReference serviceReference;
+
+    /**
+     * Sets up this instance with the given configuration URL provided by the
+     * given <code>serviceReference</code>.
+     * <p>
+     * The <code>serviceReference</code> may be <code>null</code> which means
+     * the configuration is created by the {...@link SlingAuthenticator} 
itself.
+     * Instances whose service reference is <code>null</code> are always 
ordered
+     * behind instances with non-<code>null</code> service references (provided
+     * their path is equal.
+     *
+     * @param url The configuration URL to setup this instance with
+     * @param serviceReference The reference to the service providing the
+     *            configuration for this instance.
+     */
+    protected PathBasedHolder(final String url,
+            final ServiceReference serviceReference) {
 
-        String path = fullPath;
+        String path = url;
         String host = "";
         String protocol = "";
 
@@ -69,21 +115,87 @@
         }
 
         // assign the fields
-        this.fullPath = fullPath;
+        this.fullPath = url;
         this.path = path;
         this.host = host;
         this.protocol = protocol;
+        this.serviceReference = serviceReference;
     }
 
-    public int compareTo(PathBasedHolder other) {
-        return other.path.compareTo(path);
+    /**
+     * Returns a descriptive string of the provider of this instance. The 
string
+     * is derived from the service reference with which this instance has been
+     * created. If the instance has been created without a service reference it
+     * is ordered the service description of the {...@link SlingAuthenticator} 
is
+     * returned.
+     */
+    final String getProvider() {
+        // assume the commons/auth SlingAuthenticator provides the entry
+        if (serviceReference == null) {
+            return SlingAuthenticator.DESCRIPTION;
+        }
+
+        final String descr = OsgiUtil.toString(
+            serviceReference.getProperty(Constants.SERVICE_DESCRIPTION), null);
+        if (descr != null) {
+            return descr;
+        }
+
+        return "Service "
+            + OsgiUtil.toString(
+                serviceReference.getProperty(Constants.SERVICE_ID), "unknown");
+    }
+
+    /**
+     * Compares this instance to the <code>other</code> PathBasedHolder
+     * instance. Comparison takes into account the {...@link #path} first. If 
they
+     * are not equal the result is returned: If the <code>other</code> path is
+     * lexicographically sorted behind this {...@link #path} a value larger 
than
+     * zero is returned; otherwise a value smaller than zero is returned.
+     * <p>
+     * If the paths are the same, a positive number is returned if the
+     * <code>other</code> service reference is ordered after this service
+     * reference. If the service reference is the same, zero is returned.
+     * <p>
+     * As a special case, zero is returned if <code>other</code> is the same
+     * object as this.
+     * <p>
+     * If this service reference is <code>null</code>, <code>-1</code> is 
always
+     * returned; if the <code>other</code> service reference is
+     * <code>null</code>, <code>+1</code> is returned.
+     */
+    public final int compareTo(PathBasedHolder other) {
+
+        // compare the path first, and return if not equal
+        final int pathResult = other.path.compareTo(path);
+        if (pathResult != 0) {
+            return pathResult;
+        }
+
+        // no compare the service references giving priority to
+        // to the higher priority service
+        if (serviceReference == null) {
+            return -1;
+        } else if (other.serviceReference == null) {
+            return 1;
+        }
+
+        return other.serviceReference.compareTo(serviceReference);
     }
 
+    /**
+     * Returns the hash code of the full path.
+     */
     @Override
     public int hashCode() {
         return fullPath.hashCode();
     }
 
+    /**
+     * Returns <code>true</code> if the other object is the same as this or if
+     * it is an instance of the same class with the same full path and the same
+     * provider (<code>ServiceReference</code>).
+     */
     @Override
     public boolean equals(Object obj) {
         if (obj == this) {
@@ -94,7 +206,8 @@
 
         if (obj.getClass() == getClass()) {
             PathBasedHolder other = (PathBasedHolder) obj;
-            return fullPath.equals(other.fullPath);
+            return fullPath.equals(other.fullPath)
+                && ((serviceReference == null && other.serviceReference == 
null) || (serviceReference != null && 
serviceReference.equals(other.serviceReference)));
         }
 
         return false;

Modified: 
sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/SlingAuthenticator.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/SlingAuthenticator.java?rev=908919&r1=908918&r2=908919&view=diff
==============================================================================
--- 
sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/SlingAuthenticator.java
 (original)
+++ 
sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/SlingAuthenticator.java
 Thu Feb 11 10:43:33 2010
@@ -98,7 +98,7 @@
     private final Logger log = 
LoggerFactory.getLogger(SlingAuthenticator.class);
 
     /** @scr.property name="service.description" */
-    private static final String DESCRIPTION = "Sling Request Authenticator";
+    static final String DESCRIPTION = "Apache Sling Request Authenticator";
 
     /**
      * @scr.property valueRef="DEFAULT_IMPERSONATION_COOKIE"
@@ -255,23 +255,23 @@
         boolean flag = OsgiUtil.toBoolean(
             properties.get(PAR_ANONYMOUS_ALLOWED), DEFAULT_ANONYMOUS_ALLOWED);
         authRequiredCache.addHolder(new AuthenticationRequirementHolder("/",
-            !flag, DESCRIPTION));
+            !flag, null));
 
         String[] authReqs = 
OsgiUtil.toStringArray(properties.get(PAR_AUTH_REQ));
         if (authReqs != null) {
             for (String authReq : authReqs) {
                 if (authReq != null && authReq.length() > 0) {
                     
authRequiredCache.addHolder(AuthenticationRequirementHolder.fromConfig(
-                        authReq, DESCRIPTION));
+                        authReq, null));
                 }
             }
         }
 
         // don't require authentication for login/logout servlets
         authRequiredCache.addHolder(new AuthenticationRequirementHolder(
-            LoginServlet.SERVLET_PATH, false, DESCRIPTION));
+            LoginServlet.SERVLET_PATH, false, null));
         authRequiredCache.addHolder(new AuthenticationRequirementHolder(
-            LogoutServlet.SERVLET_PATH, false, DESCRIPTION));
+            LogoutServlet.SERVLET_PATH, false, null));
 
         // add all registered services
         if (serviceListener != null) {
@@ -1156,13 +1156,12 @@
 
         private void addService(final ServiceReference ref) {
             final String[] authReqPaths = 
OsgiUtil.toStringArray(ref.getProperty(PAR_AUTH_REQ));
-            final String source = getSource(ref);
 
             ArrayList<AuthenticationRequirementHolder> authReqList = new 
ArrayList<AuthenticationRequirementHolder>();
             for (String authReq : authReqPaths) {
                 if (authReq != null && authReq.length() > 0) {
                     authReqList.add(AuthenticationRequirementHolder.fromConfig(
-                        authReq, source));
+                        authReq, ref));
                 }
             }
 
@@ -1186,18 +1185,6 @@
                 }
             }
         }
-
-        private String getSource(final ServiceReference ref) {
-            final String descr = OsgiUtil.toString(
-                ref.getProperty(Constants.SERVICE_DESCRIPTION), null);
-            if (descr != null) {
-                return descr;
-            }
-
-            return "Service "
-                + OsgiUtil.toString(ref.getProperty(Constants.SERVICE_ID),
-                    "unknown");
-        }
     }
 
     private static class AuthenticationHandlerTracker extends ServiceTracker {
@@ -1242,12 +1229,13 @@
         }
 
         protected AbstractAuthenticationHandlerHolder createHolder(
-                final String path, final Object handler) {
+                final String path, final Object handler,
+                final ServiceReference serviceReference) {
             return new AuthenticationHandlerHolder(path,
-                (AuthenticationHandler) handler);
+                (AuthenticationHandler) handler, serviceReference);
         }
 
-        private void bindAuthHandler(final Object handler, ServiceReference 
ref) {
+        private void bindAuthHandler(final Object handler, final 
ServiceReference ref) {
             final String paths[] = 
OsgiUtil.toStringArray(ref.getProperty(AuthenticationHandler.PATH_PROPERTY));
             if (paths != null && paths.length > 0) {
 
@@ -1255,7 +1243,7 @@
                 ArrayList<AbstractAuthenticationHandlerHolder> holderList = 
new ArrayList<AbstractAuthenticationHandlerHolder>();
                 for (String path : paths) {
                     if (path != null && path.length() > 0) {
-                        holderList.add(createHolder(path, handler));
+                        holderList.add(createHolder(path, handler, ref));
                     }
                 }
 
@@ -1301,10 +1289,10 @@
         @SuppressWarnings("deprecation")
         @Override
         protected AbstractAuthenticationHandlerHolder createHolder(String path,
-                Object handler) {
+                Object handler, final ServiceReference serviceReference) {
             return new EngineAuthenticationHandlerHolder(path,
-                (org.apache.sling.engine.auth.AuthenticationHandler) handler);
-
+                (org.apache.sling.engine.auth.AuthenticationHandler) handler,
+                serviceReference);
         }
     }
 

Modified: 
sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/engine/EngineAuthenticationHandlerHolder.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/engine/EngineAuthenticationHandlerHolder.java?rev=908919&r1=908918&r2=908919&view=diff
==============================================================================
--- 
sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/engine/EngineAuthenticationHandlerHolder.java
 (original)
+++ 
sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/engine/EngineAuthenticationHandlerHolder.java
 Thu Feb 11 10:43:33 2010
@@ -27,6 +27,7 @@
 import org.apache.sling.commons.auth.spi.AuthenticationFeedbackHandler;
 import org.apache.sling.commons.auth.spi.AuthenticationInfo;
 import org.apache.sling.engine.auth.AuthenticationHandler;
+import org.osgi.framework.ServiceReference;
 
 /**
  * The <code>EngineAuthenticationHandlerHolder</code> class represents an
@@ -42,8 +43,9 @@
     private final AuthenticationHandler handler;
 
     public EngineAuthenticationHandlerHolder(final String fullPath,
-            final AuthenticationHandler handler) {
-        super(fullPath);
+            final AuthenticationHandler handler,
+            final ServiceReference serviceReference) {
+        super(fullPath, serviceReference);
         this.handler = handler;
     }
 


Reply via email to