You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2003/12/14 00:30:57 UTC
svn commit: rev 1409 - in incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve: . event listener security seda thread
Author: akarasulu
Date: Sat Dec 13 15:30:57 2003
New Revision: 1409
Added:
incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/thread/
incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/thread/ThreadPool.java
- copied unchanged from rev 1408, incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/seda/ThreadPool.java
Removed:
incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/seda/StageThreadPool.java
incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/seda/ThreadPool.java
Modified:
incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/ResourceException.java
incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/ClientEvent.java
incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/ConnectEvent.java
incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/ConnectSubscriber.java
incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/DisconnectEvent.java
incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/DisconnectSubscriber.java
incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/InputEvent.java
incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/SessionCreationEvent.java
incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/SessionCreationSubscriber.java
incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/SessionDestructionEvent.java
incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/SessionDestructionListener.java
incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/Subscriber.java
incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/listener/ClientKey.java
incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/listener/KeyExpiryException.java
incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/security/LdapPrincipal.java
incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/seda/DefaultStage.java
incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/seda/EnqueuePredicate.java
incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/seda/Stage.java
incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/seda/StageConfig.java
incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/seda/StageHandler.java
incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/seda/StageMonitor.java
incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/seda/StageMonitorAdapter.java
Log:
moves and cleanup of tabs
Modified: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/ResourceException.java
==============================================================================
--- incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/ResourceException.java (original)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/ResourceException.java Sat Dec 13 15:30:57 2003
@@ -1,4 +1,3 @@
-package org.apache.eve;
/*
============================================================================
@@ -24,7 +23,7 @@
and wherever such third-party acknowledgments normally appear.
4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve"
- and "Apache Software Foundation" must not be used to endorse or promote
+ and "Apache Software Foundation" must not be used to endorse or promote
products derived from this software without prior written
permission. For written permission, please contact apache@apache.org.
@@ -48,6 +47,7 @@
Apache Software Foundation, please see <http://www.apache.org/>.
*/
+package org.apache.eve ;
/**
Modified: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/ClientEvent.java
==============================================================================
--- incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/ClientEvent.java (original)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/ClientEvent.java Sat Dec 13 15:30:57 2003
@@ -23,7 +23,7 @@
and wherever such third-party acknowledgments normally appear.
4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve"
- and "Apache Software Foundation" must not be used to endorse or promote
+ and "Apache Software Foundation" must not be used to endorse or promote
products derived from this software without prior written
permission. For written permission, please contact apache@apache.org.
Modified: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/ConnectEvent.java
==============================================================================
--- incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/ConnectEvent.java (original)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/ConnectEvent.java Sat Dec 13 15:30:57 2003
@@ -23,7 +23,7 @@
and wherever such third-party acknowledgments normally appear.
4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve"
- and "Apache Software Foundation" must not be used to endorse or promote
+ and "Apache Software Foundation" must not be used to endorse or promote
products derived from this software without prior written
permission. For written permission, please contact apache@apache.org.
Modified: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/ConnectSubscriber.java
==============================================================================
--- incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/ConnectSubscriber.java (original)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/ConnectSubscriber.java Sat Dec 13 15:30:57 2003
@@ -23,7 +23,7 @@
and wherever such third-party acknowledgments normally appear.
4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve"
- and "Apache Software Foundation" must not be used to endorse or promote
+ and "Apache Software Foundation" must not be used to endorse or promote
products derived from this software without prior written
permission. For written permission, please contact apache@apache.org.
Modified: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/DisconnectEvent.java
==============================================================================
--- incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/DisconnectEvent.java (original)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/DisconnectEvent.java Sat Dec 13 15:30:57 2003
@@ -23,7 +23,7 @@
and wherever such third-party acknowledgments normally appear.
4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve"
- and "Apache Software Foundation" must not be used to endorse or promote
+ and "Apache Software Foundation" must not be used to endorse or promote
products derived from this software without prior written
permission. For written permission, please contact apache@apache.org.
Modified: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/DisconnectSubscriber.java
==============================================================================
--- incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/DisconnectSubscriber.java (original)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/DisconnectSubscriber.java Sat Dec 13 15:30:57 2003
@@ -1,7 +1,7 @@
/*
============================================================================
- The Apache Software License, Version 1.1
+ The Apache Software License, Version 1.1
============================================================================
Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
@@ -10,26 +10,26 @@
tion, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
+ this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
3. The end-user documentation included with the redistribution, if any, must
- include the following acknowledgment: "This product includes software
- developed by the Apache Software Foundation (http://www.apache.org/)."
- Alternately, this acknowledgment may appear in the software itself, if
- and wherever such third-party acknowledgments normally appear.
+ include the following acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve"
- and "Apache Software Foundation" must not be used to endorse or promote
- products derived from this software without prior written
- permission. For written permission, please contact apache@apache.org.
+ and "Apache Software Foundation" must not be used to endorse or promote
+ products derived from this software without prior written
+ permission. For written permission, please contact apache@apache.org.
5. Products derived from this software may not be called "Apache", nor may
- "Apache" appear in their name, without prior written permission of the
- Apache Software Foundation.
+ "Apache" appear in their name, without prior written permission of the
+ Apache Software Foundation.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
Modified: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/InputEvent.java
==============================================================================
--- incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/InputEvent.java (original)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/InputEvent.java Sat Dec 13 15:30:57 2003
@@ -1,7 +1,7 @@
/*
============================================================================
- The Apache Software License, Version 1.1
+ The Apache Software License, Version 1.1
============================================================================
Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
@@ -10,26 +10,26 @@
tion, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
+ this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
3. The end-user documentation included with the redistribution, if any, must
- include the following acknowledgment: "This product includes software
- developed by the Apache Software Foundation (http://www.apache.org/)."
- Alternately, this acknowledgment may appear in the software itself, if
- and wherever such third-party acknowledgments normally appear.
+ include the following acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve"
- and "Apache Software Foundation" must not be used to endorse or promote
- products derived from this software without prior written
- permission. For written permission, please contact apache@apache.org.
+ and "Apache Software Foundation" must not be used to endorse or promote
+ products derived from this software without prior written
+ permission. For written permission, please contact apache@apache.org.
5. Products derived from this software may not be called "Apache", nor may
- "Apache" appear in their name, without prior written permission of the
- Apache Software Foundation.
+ "Apache" appear in their name, without prior written permission of the
+ Apache Software Foundation.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
Modified: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/SessionCreationEvent.java
==============================================================================
--- incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/SessionCreationEvent.java (original)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/SessionCreationEvent.java Sat Dec 13 15:30:57 2003
@@ -23,7 +23,7 @@
and wherever such third-party acknowledgments normally appear.
4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve"
- and "Apache Software Foundation" must not be used to endorse or promote
+ and "Apache Software Foundation" must not be used to endorse or promote
products derived from this software without prior written
permission. For written permission, please contact apache@apache.org.
Modified: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/SessionCreationSubscriber.java
==============================================================================
--- incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/SessionCreationSubscriber.java (original)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/SessionCreationSubscriber.java Sat Dec 13 15:30:57 2003
@@ -1,7 +1,7 @@
/*
============================================================================
- The Apache Software License, Version 1.1
+ The Apache Software License, Version 1.1
============================================================================
Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
@@ -10,26 +10,26 @@
tion, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
+ this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
3. The end-user documentation included with the redistribution, if any, must
- include the following acknowledgment: "This product includes software
- developed by the Apache Software Foundation (http://www.apache.org/)."
- Alternately, this acknowledgment may appear in the software itself, if
- and wherever such third-party acknowledgments normally appear.
+ include the following acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve"
- and "Apache Software Foundation" must not be used to endorse or promote
- products derived from this software without prior written
- permission. For written permission, please contact apache@apache.org.
+ and "Apache Software Foundation" must not be used to endorse or promote
+ products derived from this software without prior written
+ permission. For written permission, please contact apache@apache.org.
5. Products derived from this software may not be called "Apache", nor may
- "Apache" appear in their name, without prior written permission of the
- Apache Software Foundation.
+ "Apache" appear in their name, without prior written permission of the
+ Apache Software Foundation.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
Modified: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/SessionDestructionEvent.java
==============================================================================
--- incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/SessionDestructionEvent.java (original)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/SessionDestructionEvent.java Sat Dec 13 15:30:57 2003
@@ -23,7 +23,7 @@
and wherever such third-party acknowledgments normally appear.
4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve"
- and "Apache Software Foundation" must not be used to endorse or promote
+ and "Apache Software Foundation" must not be used to endorse or promote
products derived from this software without prior written
permission. For written permission, please contact apache@apache.org.
Modified: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/SessionDestructionListener.java
==============================================================================
--- incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/SessionDestructionListener.java (original)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/SessionDestructionListener.java Sat Dec 13 15:30:57 2003
@@ -23,7 +23,7 @@
and wherever such third-party acknowledgments normally appear.
4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve"
- and "Apache Software Foundation" must not be used to endorse or promote
+ and "Apache Software Foundation" must not be used to endorse or promote
products derived from this software without prior written
permission. For written permission, please contact apache@apache.org.
Modified: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/Subscriber.java
==============================================================================
--- incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/Subscriber.java (original)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/Subscriber.java Sat Dec 13 15:30:57 2003
@@ -23,7 +23,7 @@
and wherever such third-party acknowledgments normally appear.
4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve"
- and "Apache Software Foundation" must not be used to endorse or promote
+ and "Apache Software Foundation" must not be used to endorse or promote
products derived from this software without prior written
permission. For written permission, please contact apache@apache.org.
Modified: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/listener/ClientKey.java
==============================================================================
--- incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/listener/ClientKey.java (original)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/listener/ClientKey.java Sat Dec 13 15:30:57 2003
@@ -23,7 +23,7 @@
and wherever such third-party acknowledgments normally appear.
4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve"
- and "Apache Software Foundation" must not be used to endorse or promote
+ and "Apache Software Foundation" must not be used to endorse or promote
products derived from this software without prior written
permission. For written permission, please contact apache@apache.org.
@@ -87,7 +87,7 @@
/** Socket connection to client */
private final Socket m_socket ;
- /** Whether or not this key has expired: the client has disconnected. */
+ /** Whether or not this key has expired: the client has disconnected. */
private boolean m_hasExpired = false ;
@@ -169,7 +169,7 @@
public String getClientAddress() throws KeyExpiryException
{
checkExpiry() ;
- return m_socket.getInetAddress().getHostAddress() ;
+ return m_socket.getInetAddress().getHostAddress() ;
}
Modified: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/listener/KeyExpiryException.java
==============================================================================
--- incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/listener/KeyExpiryException.java (original)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/listener/KeyExpiryException.java Sat Dec 13 15:30:57 2003
@@ -23,7 +23,7 @@
and wherever such third-party acknowledgments normally appear.
4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve"
- and "Apache Software Foundation" must not be used to endorse or promote
+ and "Apache Software Foundation" must not be used to endorse or promote
products derived from this software without prior written
permission. For written permission, please contact apache@apache.org.
@@ -87,7 +87,7 @@
public KeyExpiryException( ClientKey a_key, String a_message )
{
super( a_message );
- m_key = a_key ;
+ m_key = a_key ;
}
Modified: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/security/LdapPrincipal.java
==============================================================================
--- incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/security/LdapPrincipal.java (original)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/security/LdapPrincipal.java Sat Dec 13 15:30:57 2003
@@ -23,7 +23,7 @@
and wherever such third-party acknowledgments normally appear.
4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve"
- and "Apache Software Foundation" must not be used to endorse or promote
+ and "Apache Software Foundation" must not be used to endorse or promote
products derived from this software without prior written
permission. For written permission, please contact apache@apache.org.
Modified: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/seda/DefaultStage.java
==============================================================================
--- incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/seda/DefaultStage.java (original)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/seda/DefaultStage.java Sat Dec 13 15:30:57 2003
@@ -23,7 +23,7 @@
and wherever such third-party acknowledgments normally appear.
4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve"
- and "Apache Software Foundation" must not be used to endorse or promote
+ and "Apache Software Foundation" must not be used to endorse or promote
products derived from this software without prior written
permission. For written permission, please contact apache@apache.org.
@@ -66,254 +66,254 @@
public class DefaultStage implements Stage
{
/** driver max wait/timeout in millis */
- private static final long DRIVER_WAIT = 200 ;
- /** the configuration bean */
- protected final StageConfig m_config ;
- /** this Stage's event queue */
- private final LinkedList m_queue = new LinkedList() ;
- /** this Stage's active handler threads */
- private final Set m_activeWorkers = new HashSet() ;
-
- /** this Stage's StageDriver's driving thread */
- private Thread m_thread = null ;
- /** the start stop control variable */
- private Boolean m_hasStarted = new Boolean( false ) ;
- /** this Stage's monitor */
- private StageMonitor m_monitor = new StageMonitorAdapter() ;
-
-
- // ------------------------------------------------------------------------
- // C O N S T R U C T O R S
- // ------------------------------------------------------------------------
-
-
- /**
- * Creates a DefaultStage using a configuration bean.
- *
- * @param a_config the configuration bean
- */
- public DefaultStage( StageConfig a_config )
- {
- m_config = a_config ;
- m_hasStarted = new Boolean( false ) ;
- }
-
-
- // ------------------------------------------------------------------------
- // Stage Methods
- // ------------------------------------------------------------------------
-
-
- /**
- * @see org.apache.eve.seda.Stage#
- * addPredicate(org.apache.eve.seda.EnqueuePredicate)
- */
- public void addPredicate( EnqueuePredicate a_predicate )
- {
- m_config.getPredicates().add( a_predicate ) ;
- }
-
-
- /**
- * @see org.apache.eve.seda.Stage#getConfig()
- */
- public StageConfig getConfig()
- {
- return m_config ;
- }
-
-
- /**
- * @see org.apache.eve.seda.Stage#enqueue(java.util.EventObject)
- */
- public void enqueue( final EventObject an_event )
- {
- boolean l_isAccepted = true ;
-
- for ( int ii = 0; ii < m_config.getPredicates().size() && l_isAccepted;
- ii++ )
- {
- EnqueuePredicate l_test =
- ( EnqueuePredicate ) m_config.getPredicates().get( ii ) ;
- l_isAccepted &= l_test.accept( an_event ) ;
- }
-
- if( l_isAccepted )
- {
- synchronized ( m_queue )
- {
- m_monitor.lockedQueue( this, an_event ) ;
- m_queue.addFirst( an_event ) ;
- m_queue.notifyAll() ;
- }
-
- m_monitor.enqueueOccurred( this, an_event ) ;
- }
- else
- {
- m_monitor.enqueueRejected( this, an_event ) ;
- }
- }
-
-
- /**
- * Gets this Stage's monitor.
- *
- * @return returns the monitor
- */
- public StageMonitor getMonitor()
- {
- return m_monitor ;
- }
-
-
- /**
- * Sets this Stage's monitor.
- *
- * @param a_monitor the monitor to set
- */
- public void setMonitor( StageMonitor a_monitor )
- {
- m_monitor = a_monitor ;
- }
-
-
- // ------------------------------------------------------------------------
- // Runnable Implementations
- // ------------------------------------------------------------------------
-
-
- /**
- * The runnable driving the main thread of this Stage.
- *
- * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
- * @author $Author$
- * @version $Revision$
- */
- class StageDriver implements Runnable
- {
- public final void run()
- {
- m_monitor.startedDriver( DefaultStage.this ) ;
-
- while( m_hasStarted.booleanValue() )
- {
- synchronized ( m_queue )
- {
- if( m_queue.isEmpty() )
- {
- try
- {
- m_queue.wait( DRIVER_WAIT ) ;
- }
- catch( InterruptedException e )
- {
- try { stop() ; } catch ( Exception e2 )
- {/*NOT THROWN*/}
- m_monitor.driverFailed( DefaultStage.this, e ) ;
- }
- }
- else
- {
- EventObject l_event =
- ( EventObject ) m_queue.removeLast() ;
- m_monitor.eventDequeued( DefaultStage.this, l_event ) ;
- Runnable l_runnable = new ExecutableHandler( l_event ) ;
- m_config.getThreadPool().execute( l_runnable ) ;
- }
- }
- }
- }
- }
-
-
- /**
- * The runnable driving the work of this Stage's handler.
- *
- * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
- * @author $Author$
- * @version $Revision$
- */
- class ExecutableHandler implements Runnable
- {
- final EventObject m_event ;
-
- public ExecutableHandler( EventObject an_event )
- {
- m_event = an_event ;
- }
-
- public void run()
- {
- synchronized( m_activeWorkers )
- {
- m_activeWorkers.add( Thread.currentThread() ) ;
- }
-
- try
- {
- m_config.getHandler().handleEvent( m_event ) ;
- }
- catch( Throwable t )
- {
- m_monitor.handlerFailed( DefaultStage.this, m_event, t ) ;
- }
-
- synchronized( m_activeWorkers )
- {
- m_activeWorkers.remove( Thread.currentThread() ) ;
- }
-
- m_monitor.eventHandled( DefaultStage.this, m_event ) ;
- }
- }
-
-
- // ------------------------------------------------------------------------
- // start stop controls
- // ------------------------------------------------------------------------
-
-
- /**
- * Starts up this Stage's driver.
- */
- public void start()
- {
- synchronized( m_hasStarted )
- {
- if ( m_hasStarted.booleanValue() )
- {
- throw new IllegalStateException( "Already started!" ) ;
- }
+ private static final long DRIVER_WAIT = 200 ;
+ /** the configuration bean */
+ protected final StageConfig m_config ;
+ /** this Stage's event queue */
+ private final LinkedList m_queue = new LinkedList() ;
+ /** this Stage's active handler threads */
+ private final Set m_activeWorkers = new HashSet() ;
+
+ /** this Stage's StageDriver's driving thread */
+ private Thread m_thread = null ;
+ /** the start stop control variable */
+ private Boolean m_hasStarted = new Boolean( false ) ;
+ /** this Stage's monitor */
+ private StageMonitor m_monitor = new StageMonitorAdapter() ;
+
+
+ // ------------------------------------------------------------------------
+ // C O N S T R U C T O R S
+ // ------------------------------------------------------------------------
+
+
+ /**
+ * Creates a DefaultStage using a configuration bean.
+ *
+ * @param a_config the configuration bean
+ */
+ public DefaultStage( StageConfig a_config )
+ {
+ m_config = a_config ;
+ m_hasStarted = new Boolean( false ) ;
+ }
+
+
+ // ------------------------------------------------------------------------
+ // Stage Methods
+ // ------------------------------------------------------------------------
+
+
+ /**
+ * @see org.apache.eve.seda.Stage#
+ * addPredicate(org.apache.eve.seda.EnqueuePredicate)
+ */
+ public void addPredicate( EnqueuePredicate a_predicate )
+ {
+ m_config.getPredicates().add( a_predicate ) ;
+ }
+
+
+ /**
+ * @see org.apache.eve.seda.Stage#getConfig()
+ */
+ public StageConfig getConfig()
+ {
+ return m_config ;
+ }
+
+
+ /**
+ * @see org.apache.eve.seda.Stage#enqueue(java.util.EventObject)
+ */
+ public void enqueue( final EventObject an_event )
+ {
+ boolean l_isAccepted = true ;
+
+ for ( int ii = 0; ii < m_config.getPredicates().size() && l_isAccepted;
+ ii++ )
+ {
+ EnqueuePredicate l_test =
+ ( EnqueuePredicate ) m_config.getPredicates().get( ii ) ;
+ l_isAccepted &= l_test.accept( an_event ) ;
+ }
+
+ if( l_isAccepted )
+ {
+ synchronized ( m_queue )
+ {
+ m_monitor.lockedQueue( this, an_event ) ;
+ m_queue.addFirst( an_event ) ;
+ m_queue.notifyAll() ;
+ }
+
+ m_monitor.enqueueOccurred( this, an_event ) ;
+ }
+ else
+ {
+ m_monitor.enqueueRejected( this, an_event ) ;
+ }
+ }
+
+
+ /**
+ * Gets this Stage's monitor.
+ *
+ * @return returns the monitor
+ */
+ public StageMonitor getMonitor()
+ {
+ return m_monitor ;
+ }
+
+
+ /**
+ * Sets this Stage's monitor.
+ *
+ * @param a_monitor the monitor to set
+ */
+ public void setMonitor( StageMonitor a_monitor )
+ {
+ m_monitor = a_monitor ;
+ }
+
+
+ // ------------------------------------------------------------------------
+ // Runnable Implementations
+ // ------------------------------------------------------------------------
+
+
+ /**
+ * The runnable driving the main thread of this Stage.
+ *
+ * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
+ * @author $Author$
+ * @version $Revision$
+ */
+ class StageDriver implements Runnable
+ {
+ public final void run()
+ {
+ m_monitor.startedDriver( DefaultStage.this ) ;
+
+ while( m_hasStarted.booleanValue() )
+ {
+ synchronized ( m_queue )
+ {
+ if( m_queue.isEmpty() )
+ {
+ try
+ {
+ m_queue.wait( DRIVER_WAIT ) ;
+ }
+ catch( InterruptedException e )
+ {
+ try { stop() ; } catch ( Exception e2 )
+ {/*NOT THROWN*/}
+ m_monitor.driverFailed( DefaultStage.this, e ) ;
+ }
+ }
+ else
+ {
+ EventObject l_event =
+ ( EventObject ) m_queue.removeLast() ;
+ m_monitor.eventDequeued( DefaultStage.this, l_event ) ;
+ Runnable l_runnable = new ExecutableHandler( l_event ) ;
+ m_config.getThreadPool().execute( l_runnable ) ;
+ }
+ }
+ }
+ }
+ }
+
+
+ /**
+ * The runnable driving the work of this Stage's handler.
+ *
+ * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
+ * @author $Author$
+ * @version $Revision$
+ */
+ class ExecutableHandler implements Runnable
+ {
+ final EventObject m_event ;
+
+ public ExecutableHandler( EventObject an_event )
+ {
+ m_event = an_event ;
+ }
+
+ public void run()
+ {
+ synchronized( m_activeWorkers )
+ {
+ m_activeWorkers.add( Thread.currentThread() ) ;
+ }
+
+ try
+ {
+ m_config.getHandler().handleEvent( m_event ) ;
+ }
+ catch( Throwable t )
+ {
+ m_monitor.handlerFailed( DefaultStage.this, m_event, t ) ;
+ }
+
+ synchronized( m_activeWorkers )
+ {
+ m_activeWorkers.remove( Thread.currentThread() ) ;
+ }
+
+ m_monitor.eventHandled( DefaultStage.this, m_event ) ;
+ }
+ }
+
+
+ // ------------------------------------------------------------------------
+ // start stop controls
+ // ------------------------------------------------------------------------
+
+
+ /**
+ * Starts up this Stage's driver.
+ */
+ public void start()
+ {
+ synchronized( m_hasStarted )
+ {
+ if ( m_hasStarted.booleanValue() )
+ {
+ throw new IllegalStateException( "Already started!" ) ;
+ }
- m_hasStarted = new Boolean( true ) ;
- m_thread = new Thread( new StageDriver() ) ;
- m_thread.start() ;
- }
-
- m_monitor.started( this ) ;
- }
-
-
- /**
- * Blocks calling thread until this Stage gracefully stops its driver and
- * all its worker threads.
- */
- public void stop() throws InterruptedException
- {
- synchronized( m_hasStarted )
- {
- m_hasStarted = new Boolean( false ) ;
-
- synchronized( m_activeWorkers )
- {
- while ( m_thread.isAlive() || ! m_activeWorkers.isEmpty() )
- {
- Thread.sleep( 100 ) ;
- }
- }
- }
-
- m_monitor.stopped( this ) ;
- }
+ m_hasStarted = new Boolean( true ) ;
+ m_thread = new Thread( new StageDriver() ) ;
+ m_thread.start() ;
+ }
+
+ m_monitor.started( this ) ;
+ }
+
+
+ /**
+ * Blocks calling thread until this Stage gracefully stops its driver and
+ * all its worker threads.
+ */
+ public void stop() throws InterruptedException
+ {
+ synchronized( m_hasStarted )
+ {
+ m_hasStarted = new Boolean( false ) ;
+
+ synchronized( m_activeWorkers )
+ {
+ while ( m_thread.isAlive() || ! m_activeWorkers.isEmpty() )
+ {
+ Thread.sleep( 100 ) ;
+ }
+ }
+ }
+
+ m_monitor.stopped( this ) ;
+ }
}
Modified: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/seda/EnqueuePredicate.java
==============================================================================
--- incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/seda/EnqueuePredicate.java (original)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/seda/EnqueuePredicate.java Sat Dec 13 15:30:57 2003
@@ -1,7 +1,7 @@
/*
============================================================================
- The Apache Software License, Version 1.1
+ The Apache Software License, Version 1.1
============================================================================
Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
@@ -10,26 +10,26 @@
tion, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
+ this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
3. The end-user documentation included with the redistribution, if any, must
- include the following acknowledgment: "This product includes software
- developed by the Apache Software Foundation (http://www.apache.org/)."
- Alternately, this acknowledgment may appear in the software itself, if
- and wherever such third-party acknowledgments normally appear.
+ include the following acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve"
- and "Apache Software Foundation" must not be used to endorse or promote
- products derived from this software without prior written
- permission. For written permission, please contact apache@apache.org.
+ and "Apache Software Foundation" must not be used to endorse or promote
+ products derived from this software without prior written
+ permission. For written permission, please contact apache@apache.org.
5. Products derived from this software may not be called "Apache", nor may
- "Apache" appear in their name, without prior written permission of the
- Apache Software Foundation.
+ "Apache" appear in their name, without prior written permission of the
+ Apache Software Foundation.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
Modified: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/seda/Stage.java
==============================================================================
--- incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/seda/Stage.java (original)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/seda/Stage.java Sat Dec 13 15:30:57 2003
@@ -23,7 +23,7 @@
and wherever such third-party acknowledgments normally appear.
4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve"
- and "Apache Software Foundation" must not be used to endorse or promote
+ and "Apache Software Foundation" must not be used to endorse or promote
products derived from this software without prior written
permission. For written permission, please contact apache@apache.org.
Modified: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/seda/StageConfig.java
==============================================================================
--- incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/seda/StageConfig.java (original)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/seda/StageConfig.java Sat Dec 13 15:30:57 2003
@@ -23,7 +23,7 @@
and wherever such third-party acknowledgments normally appear.
4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve"
- and "Apache Software Foundation" must not be used to endorse or promote
+ and "Apache Software Foundation" must not be used to endorse or promote
products derived from this software without prior written
permission. For written permission, please contact apache@apache.org.
@@ -89,5 +89,5 @@
*
* @return the thread pool used by the Stage
*/
- StageThreadPool getThreadPool() ;
+ ThreadPool getThreadPool() ;
}
Modified: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/seda/StageHandler.java
==============================================================================
--- incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/seda/StageHandler.java (original)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/seda/StageHandler.java Sat Dec 13 15:30:57 2003
@@ -1,7 +1,7 @@
/*
============================================================================
- The Apache Software License, Version 1.1
+ The Apache Software License, Version 1.1
============================================================================
Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
@@ -10,26 +10,26 @@
tion, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
+ this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
3. The end-user documentation included with the redistribution, if any, must
- include the following acknowledgment: "This product includes software
- developed by the Apache Software Foundation (http://www.apache.org/)."
- Alternately, this acknowledgment may appear in the software itself, if
- and wherever such third-party acknowledgments normally appear.
+ include the following acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve"
- and "Apache Software Foundation" must not be used to endorse or promote
- products derived from this software without prior written
- permission. For written permission, please contact apache@apache.org.
+ and "Apache Software Foundation" must not be used to endorse or promote
+ products derived from this software without prior written
+ permission. For written permission, please contact apache@apache.org.
5. Products derived from this software may not be called "Apache", nor may
- "Apache" appear in their name, without prior written permission of the
- Apache Software Foundation.
+ "Apache" appear in their name, without prior written permission of the
+ Apache Software Foundation.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
Modified: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/seda/StageMonitor.java
==============================================================================
--- incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/seda/StageMonitor.java (original)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/seda/StageMonitor.java Sat Dec 13 15:30:57 2003
@@ -23,7 +23,7 @@
and wherever such third-party acknowledgments normally appear.
4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve"
- and "Apache Software Foundation" must not be used to endorse or promote
+ and "Apache Software Foundation" must not be used to endorse or promote
products derived from this software without prior written
permission. For written permission, please contact apache@apache.org.
@@ -69,11 +69,11 @@
*/
void started( Stage a_stage ) ;
- /**
- * Monitors Stage has stops.
- *
- * @param a_stage the stopped Stage
- */
+ /**
+ * Monitors Stage has stops.
+ *
+ * @param a_stage the stopped Stage
+ */
void stopped( Stage a_stage ) ;
/**
@@ -81,7 +81,7 @@
*
* @param a_stage the Stage whose driver started
*/
- void startedDriver( Stage a_stage ) ;
+ void startedDriver( Stage a_stage ) ;
/**
* Monitor for successful enqueue operations on the stage.
@@ -91,12 +91,12 @@
*/
void enqueueOccurred( Stage a_stage, EventObject an_event ) ;
- /**
- * Monitor for failed enqueue operations on the stage.
- *
- * @param a_stage the stage where enqueue failed
- * @param an_event the event enqueue failed on
- */
+ /**
+ * Monitor for failed enqueue operations on the stage.
+ *
+ * @param a_stage the stage where enqueue failed
+ * @param an_event the event enqueue failed on
+ */
void enqueueRejected( Stage a_stage, EventObject an_event ) ;
/**
@@ -113,35 +113,35 @@
* @param a_stage the Stage dequeued
* @param an_event the event that was dequeued
*/
- void eventDequeued( Stage a_stage, EventObject an_event ) ;
-
- /**
- * Monitor for successfully completing the handling of an event.
- *
- * @param a_stage the Stage processing the event
- * @param an_event the event that was handled
- */
- void eventHandled( Stage a_stage, EventObject an_event ) ;
-
- // ------------------------------------------------------------------------
- // failure monitors
- // ------------------------------------------------------------------------
-
- /**
- * Monitors driver thread interruption failures.
- *
- * @param a_stage the stage that caused the failure
- * @param a_fault the faulting exception
- */
+ void eventDequeued( Stage a_stage, EventObject an_event ) ;
+
+ /**
+ * Monitor for successfully completing the handling of an event.
+ *
+ * @param a_stage the Stage processing the event
+ * @param an_event the event that was handled
+ */
+ void eventHandled( Stage a_stage, EventObject an_event ) ;
+
+ // ------------------------------------------------------------------------
+ // failure monitors
+ // ------------------------------------------------------------------------
+
+ /**
+ * Monitors driver thread interruption failures.
+ *
+ * @param a_stage the stage that caused the failure
+ * @param a_fault the faulting exception
+ */
void driverFailed( Stage a_stage, InterruptedException a_fault ) ;
- /**
- * Monitors handler failures.
- *
- * @param a_stage the stage that caused the failure
- * @param an_event the event the handler failed on
- * @param a_fault the faulting exception
- */
+ /**
+ * Monitors handler failures.
+ *
+ * @param a_stage the stage that caused the failure
+ * @param an_event the event the handler failed on
+ * @param a_fault the faulting exception
+ */
void handlerFailed( Stage a_stage, EventObject an_event,
- Throwable a_fault ) ;
+ Throwable a_fault ) ;
}
Modified: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/seda/StageMonitorAdapter.java
==============================================================================
--- incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/seda/StageMonitorAdapter.java (original)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/seda/StageMonitorAdapter.java Sat Dec 13 15:30:57 2003
@@ -23,7 +23,7 @@
and wherever such third-party acknowledgments normally appear.
4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve"
- and "Apache Software Foundation" must not be used to endorse or promote
+ and "Apache Software Foundation" must not be used to endorse or promote
products derived from this software without prior written
permission. For written permission, please contact apache@apache.org.
@@ -144,7 +144,7 @@
* org.apache.eve.seda.Stage, java.util.EventObject, java.lang.Throwable)
*/
public void handlerFailed( Stage a_stage, EventObject an_event,
- Throwable a_fault)
+ Throwable a_fault)
{
}
}