directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r231157 - /directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/interceptor/InterceptorChain.java
Date Wed, 10 Aug 2005 03:14:37 GMT
Author: trustin
Date: Tue Aug  9 20:14:33 2005
New Revision: 231157

URL: http://svn.apache.org/viewcvs?rev=231157&view=rev
Log:
* Added add...() methods so that users can add interceptors at runtime.

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/interceptor/InterceptorChain.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/interceptor/InterceptorChain.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/interceptor/InterceptorChain.java?rev=231157&r1=231156&r2=231157&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/interceptor/InterceptorChain.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/interceptor/InterceptorChain.java
Tue Aug  9 20:14:33 2005
@@ -289,7 +289,7 @@
     /**
      * Returns the list of all registered interceptors.
      */
-    public List getAll()
+    public synchronized List getAll()
     {
         List result = new ArrayList();
         Entry e = head;
@@ -301,6 +301,36 @@
         while ( e != tail );
         
         return result;
+    }
+    
+    public synchronized void addFirst( InterceptorConfiguration cfg ) throws NamingException
+    {
+        register0( cfg, head );
+    }
+    
+    public synchronized void addLast( InterceptorConfiguration cfg ) throws NamingException
+    {
+        register0( cfg, tail );
+    }
+    
+    public synchronized void addBefore( String nextInterceptorName, InterceptorConfiguration
cfg ) throws NamingException
+    {
+        Entry e = (Entry) name2entry.get( nextInterceptorName );
+        if( e == null )
+        {
+            throw new ConfigurationException( "Interceptor not found: " + nextInterceptorName
);
+        }
+        register0( cfg, e );
+    }
+    
+    public synchronized void addAfter( String prevInterceptorName, InterceptorConfiguration
cfg ) throws NamingException
+    {
+        Entry e = (Entry) name2entry.get( prevInterceptorName );
+        if( e == null )
+        {
+            throw new ConfigurationException( "Interceptor not found: " + prevInterceptorName
);
+        }
+        register0( cfg, e.nextEntry );
     }
 
 



Mime
View raw message