directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: rev 9608 - incubator/directory/eve/trunk/eve/frontend/processor/spi/src/java/org/apache/eve/processor
Date Fri, 19 Mar 2004 06:11:07 GMT
Author: akarasulu
Date: Thu Mar 18 22:11:06 2004
New Revision: 9608

Added:
   incubator/directory/eve/trunk/eve/frontend/processor/spi/src/java/org/apache/eve/processor/ManyReplyHandler.java
Modified:
   incubator/directory/eve/trunk/eve/frontend/processor/spi/src/java/org/apache/eve/processor/HandlerTypeEnum.java
   incubator/directory/eve/trunk/eve/frontend/processor/spi/src/java/org/apache/eve/processor/RequestProcessor.java
   incubator/directory/eve/trunk/eve/frontend/processor/spi/src/java/org/apache/eve/processor/RequestProcessorMonitor.java
   incubator/directory/eve/trunk/eve/frontend/processor/spi/src/java/org/apache/eve/processor/RequestProcessorMonitorAdapter.java
   incubator/directory/eve/trunk/eve/frontend/processor/spi/src/java/org/apache/eve/processor/SingleReplyHandler.java
Log:
should be set with the stubs

Modified: incubator/directory/eve/trunk/eve/frontend/processor/spi/src/java/org/apache/eve/processor/HandlerTypeEnum.java
==============================================================================
--- incubator/directory/eve/trunk/eve/frontend/processor/spi/src/java/org/apache/eve/processor/HandlerTypeEnum.java
(original)
+++ incubator/directory/eve/trunk/eve/frontend/processor/spi/src/java/org/apache/eve/processor/HandlerTypeEnum.java
Thu Mar 18 22:11:06 2004
@@ -34,8 +34,8 @@
     public static final int NOREPLY_VAL = 0 ;
     /** Value for singlereply enumeration type */
     public static final int SINGLEREPLY_VAL = 1 ;
-    /** Value for search enumeration type */
-    public static final int SEARCH_VAL = 2 ;
+    /** Value for many value enumeration type */
+    public static final int MANYREPLY_VAL = 2 ;
 
     /** Enum for noreply type */
 	public static final HandlerTypeEnum NOREPLY =
@@ -45,7 +45,7 @@
         new HandlerTypeEnum( "SINGLEREPLY", SINGLEREPLY_VAL ) ;
     /** Enum for search type */
 	public static final HandlerTypeEnum SEARCH =
-        new HandlerTypeEnum( "SEARCH", SEARCH_VAL ) ;
+        new HandlerTypeEnum( "MANYREPLY", MANYREPLY_VAL ) ;
 
 
     /**

Added: incubator/directory/eve/trunk/eve/frontend/processor/spi/src/java/org/apache/eve/processor/ManyReplyHandler.java
==============================================================================
--- (empty file)
+++ incubator/directory/eve/trunk/eve/frontend/processor/spi/src/java/org/apache/eve/processor/ManyReplyHandler.java
Thu Mar 18 22:11:06 2004
@@ -0,0 +1,42 @@
+/*
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+package org.apache.eve.processor ;
+
+
+import java.util.Iterator ;
+
+import org.apache.ldap.common.message.ManyReplyRequest ;
+
+
+/**
+ * A handler for requests that can generate zero, one or more responses.
+ *
+ * @author <a href="mailto:directory-dev@incubator.apache.org">
+ * Apache Directory Project</a>
+ * @version $Rev$
+ */
+public interface ManyReplyHandler extends RequestHandler
+{
+    /**
+     * A handler for a request that can create multiple responses of 
+     * heterogenous messages.
+     * 
+     * @param request the request that may generate many replies
+     * @return an enumeration over the responses
+     */
+    Iterator handle( ManyReplyRequest request ) ;
+}

Modified: incubator/directory/eve/trunk/eve/frontend/processor/spi/src/java/org/apache/eve/processor/RequestProcessor.java
==============================================================================
--- incubator/directory/eve/trunk/eve/frontend/processor/spi/src/java/org/apache/eve/processor/RequestProcessor.java
(original)
+++ incubator/directory/eve/trunk/eve/frontend/processor/spi/src/java/org/apache/eve/processor/RequestProcessor.java
Thu Mar 18 22:11:06 2004
@@ -27,5 +27,4 @@
  */
 public interface RequestProcessor
 {
-    void dummy() ;
 }

Modified: incubator/directory/eve/trunk/eve/frontend/processor/spi/src/java/org/apache/eve/processor/RequestProcessorMonitor.java
==============================================================================
--- incubator/directory/eve/trunk/eve/frontend/processor/spi/src/java/org/apache/eve/processor/RequestProcessorMonitor.java
(original)
+++ incubator/directory/eve/trunk/eve/frontend/processor/spi/src/java/org/apache/eve/processor/RequestProcessorMonitor.java
Thu Mar 18 22:11:06 2004
@@ -19,7 +19,9 @@
 
 import java.util.EventObject ;
 
-import org.apache.eve.event.Subscriber ; 
+import org.apache.eve.event.Subscriber ;
+import org.apache.eve.listener.ClientKey ;
+import org.apache.ldap.common.message.Request ;
 
 
 /**
@@ -40,4 +42,12 @@
      */
     void failedOnInform( Subscriber subscriber, EventObject event, 
                          Throwable t ) ;
+
+    /**
+     * 
+     * @param key
+     * @param request
+     * @param t
+     */
+    void failedOnSingleReply( ClientKey key, Request request, Throwable t ) ;
 }

Modified: incubator/directory/eve/trunk/eve/frontend/processor/spi/src/java/org/apache/eve/processor/RequestProcessorMonitorAdapter.java
==============================================================================
--- incubator/directory/eve/trunk/eve/frontend/processor/spi/src/java/org/apache/eve/processor/RequestProcessorMonitorAdapter.java
(original)
+++ incubator/directory/eve/trunk/eve/frontend/processor/spi/src/java/org/apache/eve/processor/RequestProcessorMonitorAdapter.java
Thu Mar 18 22:11:06 2004
@@ -19,7 +19,10 @@
 
 import java.util.EventObject ;
 
-import org.apache.eve.event.Subscriber ; 
+import org.apache.commons.lang.exception.ExceptionUtils;
+import org.apache.eve.event.Subscriber ;
+import org.apache.eve.listener.ClientKey ;
+import org.apache.ldap.common.message.Request ;
 
 
 /**
@@ -41,5 +44,28 @@
 								Throwable t )
     {
         throw new RuntimeException( t ) ;
+    }
+    
+    
+    /* (non-Javadoc)
+     * @see org.apache.eve.processor.RequestProcessorMonitor#failedOnSingleReply
+     * (org.apache.eve.listener.ClientKey, 
+     * org.apache.ldap.common.message.Request, java.lang.Throwable)
+     */
+    public void failedOnSingleReply( ClientKey key, Request request, 
+                                     Throwable t )
+    {
+        // @todo We should be able to email this or even post it to JIRA.
+        // if some of error reporting configuration parameters are set. Or
+        // perhaps this is something best left to a logger customization.
+        
+        StringBuffer buf = new StringBuffer() ;
+        buf.append( "Encountered an operational error while processing " ) ;
+        buf.append( request.getType().getName() ) ;
+        buf.append( " request. Please report the the following server stack" );
+        buf.append( " trace to the Apache Directory Project:\n" ) ;
+        buf.append( ExceptionUtils.getFullStackTrace( t ) ) ;
+        
+        throw new RuntimeException( buf.toString(), t ) ;
     }
 }

Modified: incubator/directory/eve/trunk/eve/frontend/processor/spi/src/java/org/apache/eve/processor/SingleReplyHandler.java
==============================================================================
--- incubator/directory/eve/trunk/eve/frontend/processor/spi/src/java/org/apache/eve/processor/SingleReplyHandler.java
(original)
+++ incubator/directory/eve/trunk/eve/frontend/processor/spi/src/java/org/apache/eve/processor/SingleReplyHandler.java
Thu Mar 18 22:11:06 2004
@@ -26,9 +26,9 @@
  * Request handler signature for those requests that generate a single response
  * for a request.
  *
- * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
- * @author $Author: akarasulu $
- * @version $Revision: 1.2 $
+ * @author <a href="mailto:directory-dev@incubator.apache.org">
+ * Apache Directory Project</a>
+ * @version $Rev$
  */
 public interface SingleReplyHandler
     extends RequestHandler

Mime
View raw message