Skip to Content.
Sympa Menu

notify-dpml - r942 - trunk/main/transit/core/src/main/net/dpml/transit

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: r942 - trunk/main/transit/core/src/main/net/dpml/transit
  • Date: Sun, 22 Jan 2006 03:38:34 +0100

Author: mcconnell
Date: 2006-01-22 03:37:47 +0100 (Sun, 22 Jan 2006)
New Revision: 942

Modified:
trunk/main/transit/core/src/main/net/dpml/transit/DefaultModel.java
Log:
Update the event dispatch thread to take a formal disposal request.

Modified: trunk/main/transit/core/src/main/net/dpml/transit/DefaultModel.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/DefaultModel.java
2006-01-21 22:56:15 UTC (rev 941)
+++ trunk/main/transit/core/src/main/net/dpml/transit/DefaultModel.java
2006-01-22 02:37:47 UTC (rev 942)
@@ -159,6 +159,10 @@
EventListener listener = listeners[i];
removeListener( listener );
}
+ if( null != m_EVENT_DISPATCH_THREAD )
+ {
+ m_EVENT_DISPATCH_THREAD.dispose();
+ }
}

/**
@@ -214,13 +218,20 @@
*/
private static class EventDispatchThread extends Thread
{
+ private boolean m_continue = true;
+
private Logger m_logger;
-
+
EventDispatchThread( Logger logger )
{
m_logger = logger;
}
-
+
+ void dispose()
+ {
+ m_continue = false;
+ }
+
private Logger getLogger()
{
return m_logger;
@@ -228,7 +239,7 @@

public void run()
{
- while( true )
+ while( m_continue )
{
// Wait on EVENT_QUEUE till an event is present
EventObject event = null;
@@ -236,7 +247,7 @@
{
try
{
- while( EVENT_QUEUE.isEmpty() )
+ while( m_continue && EVENT_QUEUE.isEmpty() )
{
EVENT_QUEUE.wait();
}
@@ -287,7 +298,7 @@
}
}

- private static Thread m_EVENT_DISPATCH_THREAD = null;
+ private static EventDispatchThread m_EVENT_DISPATCH_THREAD = null;

/**
* This method starts the event dispatch thread the first time it




  • r942 - trunk/main/transit/core/src/main/net/dpml/transit, mcconnell at BerliOS, 01/21/2006

Archive powered by MHonArc 2.6.24.

Top of Page