directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: rev 22556 - in incubator/directory/eve/branches/consolidation2/frontend: api/src/java/org/apache/eve/seda buffer/pojo-impl/src/java/org/apache/eve/buffer decoder/pojo-impl/src/java/org/apache/eve/decoder/impl encoder/pojo-impl/src/java/org/apache/eve/encoder/impl event/pojo-impl/src/java/org/apache/eve/event frontend/pojo-impl/src/java/org/apache/eve impl/src/java/org/apache/eve impl/src/java/org/apache/eve/buffer impl/src/java/org/apache/eve/decoder impl/src/java/org/apache/eve/encoder impl/src/java/org/apache/eve/event impl/src/java/org/apache/eve/input impl/src/java/org/apache/eve/listener impl/src/java/org/apache/eve/output impl/src/java/org/apache/eve/processor impl/src/java/org/apache/eve/seda input/pojo-impl/src/java/org/apache/eve/input listener/pojo-impl/src/java/org/apache/eve/listener output/pojo-impl/src/java/org/apache/eve/output/impl processor/pojo-impl/src/java/org/apache/eve/processor/impl
Date Sun, 04 Jul 2004 10:27:17 GMT
Author: akarasulu
Date: Sun Jul  4 03:27:16 2004
New Revision: 22556

Added:
   incubator/directory/eve/branches/consolidation2/frontend/impl/src/java/org/apache/eve/DefaultFrontend.java
      - copied unchanged from rev 22554, incubator/directory/eve/branches/consolidation2/frontend/frontend/pojo-impl/src/java/org/apache/eve/DefaultFrontend.java
   incubator/directory/eve/branches/consolidation2/frontend/impl/src/java/org/apache/eve/buffer/DefaultBufferPool.java
      - copied unchanged from rev 22554, incubator/directory/eve/branches/consolidation2/frontend/buffer/pojo-impl/src/java/org/apache/eve/buffer/DefaultBufferPool.java
   incubator/directory/eve/branches/consolidation2/frontend/impl/src/java/org/apache/eve/decoder/DecodeStageHandler.java
      - copied unchanged from rev 22554, incubator/directory/eve/branches/consolidation2/frontend/decoder/pojo-impl/src/java/org/apache/eve/decoder/impl/DecodeStageHandler.java
   incubator/directory/eve/branches/consolidation2/frontend/impl/src/java/org/apache/eve/decoder/DefaultDecoderManager.java
      - copied unchanged from rev 22554, incubator/directory/eve/branches/consolidation2/frontend/decoder/pojo-impl/src/java/org/apache/eve/decoder/impl/DefaultDecoderManager.java
   incubator/directory/eve/branches/consolidation2/frontend/impl/src/java/org/apache/eve/encoder/
   incubator/directory/eve/branches/consolidation2/frontend/impl/src/java/org/apache/eve/encoder/DefaultEncoderManager.java
      - copied unchanged from rev 22554, incubator/directory/eve/branches/consolidation2/frontend/encoder/pojo-impl/src/java/org/apache/eve/encoder/impl/DefaultEncoderManager.java
   incubator/directory/eve/branches/consolidation2/frontend/impl/src/java/org/apache/eve/event/DefaultEventRouter.java
      - copied unchanged from rev 22554, incubator/directory/eve/branches/consolidation2/frontend/event/pojo-impl/src/java/org/apache/eve/event/DefaultEventRouter.java
   incubator/directory/eve/branches/consolidation2/frontend/impl/src/java/org/apache/eve/input/DefaultInputManager.java
      - copied unchanged from rev 22554, incubator/directory/eve/branches/consolidation2/frontend/input/pojo-impl/src/java/org/apache/eve/input/DefaultInputManager.java
   incubator/directory/eve/branches/consolidation2/frontend/impl/src/java/org/apache/eve/listener/DefaultListenerManager.java
      - copied unchanged from rev 22554, incubator/directory/eve/branches/consolidation2/frontend/listener/pojo-impl/src/java/org/apache/eve/listener/DefaultListenerManager.java
   incubator/directory/eve/branches/consolidation2/frontend/impl/src/java/org/apache/eve/output/DefaultOutputManager.java
      - copied unchanged from rev 22554, incubator/directory/eve/branches/consolidation2/frontend/output/pojo-impl/src/java/org/apache/eve/output/impl/DefaultOutputManager.java
   incubator/directory/eve/branches/consolidation2/frontend/impl/src/java/org/apache/eve/processor/AbandonHandler.java
      - copied unchanged from rev 22554, incubator/directory/eve/branches/consolidation2/frontend/processor/pojo-impl/src/java/org/apache/eve/processor/impl/AbandonHandler.java
   incubator/directory/eve/branches/consolidation2/frontend/impl/src/java/org/apache/eve/processor/AddHandler.java
      - copied unchanged from rev 22554, incubator/directory/eve/branches/consolidation2/frontend/processor/pojo-impl/src/java/org/apache/eve/processor/impl/AddHandler.java
   incubator/directory/eve/branches/consolidation2/frontend/impl/src/java/org/apache/eve/processor/BindHandler.java
      - copied unchanged from rev 22554, incubator/directory/eve/branches/consolidation2/frontend/processor/pojo-impl/src/java/org/apache/eve/processor/impl/BindHandler.java
   incubator/directory/eve/branches/consolidation2/frontend/impl/src/java/org/apache/eve/processor/CompareHandler.java
      - copied unchanged from rev 22554, incubator/directory/eve/branches/consolidation2/frontend/processor/pojo-impl/src/java/org/apache/eve/processor/impl/CompareHandler.java
   incubator/directory/eve/branches/consolidation2/frontend/impl/src/java/org/apache/eve/processor/DefaultHandlerRegistry.java
      - copied unchanged from rev 22554, incubator/directory/eve/branches/consolidation2/frontend/processor/pojo-impl/src/java/org/apache/eve/processor/impl/DefaultHandlerRegistry.java
   incubator/directory/eve/branches/consolidation2/frontend/impl/src/java/org/apache/eve/processor/DefaultRequestProcessor.java
      - copied unchanged from rev 22554, incubator/directory/eve/branches/consolidation2/frontend/processor/pojo-impl/src/java/org/apache/eve/processor/impl/DefaultRequestProcessor.java
   incubator/directory/eve/branches/consolidation2/frontend/impl/src/java/org/apache/eve/processor/DeleteHandler.java
      - copied unchanged from rev 22554, incubator/directory/eve/branches/consolidation2/frontend/processor/pojo-impl/src/java/org/apache/eve/processor/impl/DeleteHandler.java
   incubator/directory/eve/branches/consolidation2/frontend/impl/src/java/org/apache/eve/processor/ExtendedHandler.java
      - copied unchanged from rev 22554, incubator/directory/eve/branches/consolidation2/frontend/processor/pojo-impl/src/java/org/apache/eve/processor/impl/ExtendedHandler.java
   incubator/directory/eve/branches/consolidation2/frontend/impl/src/java/org/apache/eve/processor/ModifyDnHandler.java
      - copied unchanged from rev 22554, incubator/directory/eve/branches/consolidation2/frontend/processor/pojo-impl/src/java/org/apache/eve/processor/impl/ModifyDnHandler.java
   incubator/directory/eve/branches/consolidation2/frontend/impl/src/java/org/apache/eve/processor/ModifyHandler.java
      - copied unchanged from rev 22554, incubator/directory/eve/branches/consolidation2/frontend/processor/pojo-impl/src/java/org/apache/eve/processor/impl/ModifyHandler.java
   incubator/directory/eve/branches/consolidation2/frontend/impl/src/java/org/apache/eve/processor/SearchHandler.java
      - copied unchanged from rev 22554, incubator/directory/eve/branches/consolidation2/frontend/processor/pojo-impl/src/java/org/apache/eve/processor/impl/SearchHandler.java
   incubator/directory/eve/branches/consolidation2/frontend/impl/src/java/org/apache/eve/processor/UnbindHandler.java
      - copied unchanged from rev 22554, incubator/directory/eve/branches/consolidation2/frontend/processor/pojo-impl/src/java/org/apache/eve/processor/impl/UnbindHandler.java
Removed:
   incubator/directory/eve/branches/consolidation2/frontend/buffer/pojo-impl/src/java/org/apache/eve/buffer/DefaultBufferPool.java
   incubator/directory/eve/branches/consolidation2/frontend/decoder/pojo-impl/src/java/org/apache/eve/decoder/impl/DecodeStageHandler.java
   incubator/directory/eve/branches/consolidation2/frontend/decoder/pojo-impl/src/java/org/apache/eve/decoder/impl/DefaultDecoderManager.java
   incubator/directory/eve/branches/consolidation2/frontend/encoder/pojo-impl/src/java/org/apache/eve/encoder/impl/DefaultEncoderManager.java
   incubator/directory/eve/branches/consolidation2/frontend/event/pojo-impl/src/java/org/apache/eve/event/DefaultEventRouter.java
   incubator/directory/eve/branches/consolidation2/frontend/frontend/pojo-impl/src/java/org/apache/eve/DefaultFrontend.java
   incubator/directory/eve/branches/consolidation2/frontend/input/pojo-impl/src/java/org/apache/eve/input/DefaultInputManager.java
   incubator/directory/eve/branches/consolidation2/frontend/listener/pojo-impl/src/java/org/apache/eve/listener/DefaultListenerManager.java
   incubator/directory/eve/branches/consolidation2/frontend/output/pojo-impl/src/java/org/apache/eve/output/impl/DefaultOutputManager.java
   incubator/directory/eve/branches/consolidation2/frontend/processor/pojo-impl/src/java/org/apache/eve/processor/impl/AbandonHandler.java
   incubator/directory/eve/branches/consolidation2/frontend/processor/pojo-impl/src/java/org/apache/eve/processor/impl/AddHandler.java
   incubator/directory/eve/branches/consolidation2/frontend/processor/pojo-impl/src/java/org/apache/eve/processor/impl/BindHandler.java
   incubator/directory/eve/branches/consolidation2/frontend/processor/pojo-impl/src/java/org/apache/eve/processor/impl/CompareHandler.java
   incubator/directory/eve/branches/consolidation2/frontend/processor/pojo-impl/src/java/org/apache/eve/processor/impl/DefaultHandlerRegistry.java
   incubator/directory/eve/branches/consolidation2/frontend/processor/pojo-impl/src/java/org/apache/eve/processor/impl/DefaultRequestProcessor.java
   incubator/directory/eve/branches/consolidation2/frontend/processor/pojo-impl/src/java/org/apache/eve/processor/impl/DeleteHandler.java
   incubator/directory/eve/branches/consolidation2/frontend/processor/pojo-impl/src/java/org/apache/eve/processor/impl/ExtendedHandler.java
   incubator/directory/eve/branches/consolidation2/frontend/processor/pojo-impl/src/java/org/apache/eve/processor/impl/ModifyDnHandler.java
   incubator/directory/eve/branches/consolidation2/frontend/processor/pojo-impl/src/java/org/apache/eve/processor/impl/ModifyHandler.java
   incubator/directory/eve/branches/consolidation2/frontend/processor/pojo-impl/src/java/org/apache/eve/processor/impl/SearchHandler.java
   incubator/directory/eve/branches/consolidation2/frontend/processor/pojo-impl/src/java/org/apache/eve/processor/impl/UnbindHandler.java
Modified:
   incubator/directory/eve/branches/consolidation2/frontend/api/src/java/org/apache/eve/seda/StageMonitor.java
   incubator/directory/eve/branches/consolidation2/frontend/impl/src/java/org/apache/eve/seda/DefaultStage.java
   incubator/directory/eve/branches/consolidation2/frontend/impl/src/java/org/apache/eve/seda/LoggingStageMonitor.java
   incubator/directory/eve/branches/consolidation2/frontend/impl/src/java/org/apache/eve/seda/StageMonitorAdapter.java
Log:
Commit changes ...

 o moved all pojo-impl project classes over to the impl project
 o added project.xml will all deps
 o brought over some fixes made to stage implementation and interfaces
   from the old consolidation branch
 


Modified: incubator/directory/eve/branches/consolidation2/frontend/api/src/java/org/apache/eve/seda/StageMonitor.java
==============================================================================
--- incubator/directory/eve/branches/consolidation2/frontend/api/src/java/org/apache/eve/seda/StageMonitor.java
(original)
+++ incubator/directory/eve/branches/consolidation2/frontend/api/src/java/org/apache/eve/seda/StageMonitor.java
Sun Jul  4 03:27:16 2004
@@ -156,4 +156,13 @@
      * @param fault the faulting exception
      */
     void handlerFailed( Stage stage, EventObject event, Throwable fault ) ;
+
+    /**
+     * Monitors enqueue predicate additions.
+     *
+     * @param stage the default stage the predicate is added to
+     * @param predicate the enqueue predicate added to the stage
+     */
+    void predicateAdded( Stage stage,
+                         EnqueuePredicate predicate ) ;
 }

Modified: incubator/directory/eve/branches/consolidation2/frontend/impl/src/java/org/apache/eve/seda/DefaultStage.java
==============================================================================
--- incubator/directory/eve/branches/consolidation2/frontend/impl/src/java/org/apache/eve/seda/DefaultStage.java
(original)
+++ incubator/directory/eve/branches/consolidation2/frontend/impl/src/java/org/apache/eve/seda/DefaultStage.java
Sun Jul  4 03:27:16 2004
@@ -76,12 +76,14 @@
 
 
     /**
-     * @see org.apache.eve.seda.Stage#
+     * @see org.apache.eve.seda.Stage#addPredicate(
+     *          org.apache.eve.seda.EnqueuePredicate)
      * addPredicate(org.apache.eve.seda.EnqueuePredicate)
      */
     public void addPredicate( EnqueuePredicate predicate )
     {
         config.getPredicates().add( predicate ) ;
+        monitor.predicateAdded( this, predicate ) ;
     }
     
     
@@ -95,13 +97,23 @@
 
 
     /**
+     * Enqueue's an event onto the event queue of this stage if the stage
+     * predicates permit the operation and the stage has started.  The event
+     * enqueue is rejected if the stage has not started.
+     *
      * @see org.apache.eve.seda.Stage#enqueue(java.util.EventObject)
      */
     public void enqueue( final EventObject event )
     {
         boolean isAccepted = true ;
-        
-        for ( int ii = 0; ii < config.getPredicates().size() && isAccepted ; 
+
+        if ( ! hasStarted.booleanValue() )
+        {
+            monitor.enqueueRejected( this, event ) ;
+            return ;
+        }
+
+        for ( int ii = 0; ii < config.getPredicates().size() && isAccepted ;
             ii++ ) 
         {
             EnqueuePredicate test = 
@@ -144,24 +156,29 @@
         public final void run()
         {
             monitor.startedDriver( DefaultStage.this ) ;
-    
-            while( hasStarted.booleanValue() ) 
+
+            /*
+             * keep processing until the hasStarted variable is toggled off
+             * and there are no queue events left.  Before without the queue
+             * term events would be left unprocessed on the queue on stop calls
+             */
+            while( hasStarted.booleanValue() || !queue.isEmpty() )
             {
-                synchronized ( queue ) 
+                synchronized ( queue )
                 {
                     monitor.lockedQueue( DefaultStage.this ) ;
-                    
-                    if( queue.isEmpty() ) 
+
+                    if( queue.isEmpty() )
                     {
-                        try 
+                        try
                         {
                             monitor.waiting( DefaultStage.this ) ;
                             queue.wait() ;
                             monitor.notified( DefaultStage.this ) ;
-                        } 
-                        catch( InterruptedException e ) 
+                        }
+                        catch( InterruptedException e )
                         {
-                            try { stop() ; } catch ( Exception e2 ) 
+                            try { stop() ; } catch ( Exception e2 )
                             {/*NOT THROWN*/}
                             monitor.driverFailed( DefaultStage.this, e ) ;
                         }
@@ -268,8 +285,19 @@
         
         monitor.stopped( this ) ;
     }
-    
-    
+
+
+    /**
+     * Tests to see if this stage has started.
+     *
+     * @return true if this stage has started, false otherwise
+     */
+    public boolean hasStarted()
+    {
+        return hasStarted.booleanValue() ;
+    }
+
+
     /**
      * Gets this Stage's monitor.
      * 

Modified: incubator/directory/eve/branches/consolidation2/frontend/impl/src/java/org/apache/eve/seda/LoggingStageMonitor.java
==============================================================================
--- incubator/directory/eve/branches/consolidation2/frontend/impl/src/java/org/apache/eve/seda/LoggingStageMonitor.java
(original)
+++ incubator/directory/eve/branches/consolidation2/frontend/impl/src/java/org/apache/eve/seda/LoggingStageMonitor.java
Sun Jul  4 03:27:16 2004
@@ -123,8 +123,8 @@
     {
         if ( log.isDebugEnabled() )
         {
-            log.debug( stage.getConfig().getName() + " had event " + event 
-                    + " enqueued!" ) ;
+            log.debug( stage.getConfig().getName() + " had event "
+                    + getDesc( event ) + " enqueued!" ) ;
         }
     }
 
@@ -137,8 +137,8 @@
     {
         if ( log.isWarnEnabled() )
         {
-            log.warn( stage.getConfig().getName() + " had event " + event 
-                    + " enqueue REJECTED!" ) ;
+            log.warn( stage.getConfig().getName() + " had event "
+                    + getDesc( event ) + " enqueue REJECTED!" ) ;
         }
     }
 
@@ -152,7 +152,7 @@
         if ( log.isDebugEnabled() )
         {
             log.debug( stage.getConfig().getName() 
-                    + "'s queue locked for processing " + event ) ; 
+                    + "'s queue locked for processing " + getDesc( event ) ) ;
         }
     }
 
@@ -179,7 +179,7 @@
         if ( log.isDebugEnabled() )
         {
             log.debug( stage.getConfig().getName() 
-                    + "'s stage driver thread notified out of waiting" ) ; 
+                    + "'s driver thread notified out of waiting" ) ; 
         }
     }
 
@@ -233,8 +233,8 @@
     {
         if ( log.isDebugEnabled() )
         {
-            log.debug( stage.getConfig().getName() + " had event " + event 
-                    + " dequeued!" ) ;
+            log.debug( stage.getConfig().getName() + " had event "
+                    + getDesc( event ) + " dequeued!" ) ;
         }
     }
 
@@ -247,7 +247,8 @@
     {
         if ( log.isDebugEnabled() )
         {
-            log.debug( stage.getConfig().getName() + " handled " + event ) ; 
+            log.debug( stage.getConfig().getName() + " handled "
+                    + getDesc( event ) ) ;
         }
     }
 
@@ -277,5 +278,33 @@
             log.error( stage.getConfig().getName() 
                     + "'s handler failed", fault ) ; 
         }
+    }
+
+
+    /**
+     * Monitors enqueue predicate additions.
+     *
+     * @param stage the default stage the predicate is added to
+     * @param predicate    the enqueue predicate added to the stage
+     */
+    public void predicateAdded( Stage stage, EnqueuePredicate predicate )
+    {
+        if ( log.isDebugEnabled() )
+        {
+            log.debug( "predicate added to stage "
+                    + stage.getConfig().getName() ) ;
+        }
+    }
+
+
+    /**
+     * Gets a short string description for an event.
+     *
+     * @param event the event to create a description string for
+     * @return the description string for the event
+     */
+    private String getDesc( EventObject event )
+    {
+        return ClassUtils.getShortClassName( event.getClass() ) ;
     }
 }

Modified: incubator/directory/eve/branches/consolidation2/frontend/impl/src/java/org/apache/eve/seda/StageMonitorAdapter.java
==============================================================================
--- incubator/directory/eve/branches/consolidation2/frontend/impl/src/java/org/apache/eve/seda/StageMonitorAdapter.java
(original)
+++ incubator/directory/eve/branches/consolidation2/frontend/impl/src/java/org/apache/eve/seda/StageMonitorAdapter.java
Sun Jul  4 03:27:16 2004
@@ -172,4 +172,15 @@
     {
         System.err.println( ExceptionUtils.getFullStackTrace( fault ) ) ;
     }
+
+
+    /**
+     * Monitors enqueue predicate additions.
+     *
+     * @param stage the default stage the predicate is added to
+     * @param predicate    the enqueue predicate added to the stage
+     */
+    public void predicateAdded( Stage stage, EnqueuePredicate predicate )
+    {
+    }
 }

Mime
View raw message