avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From blorit...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/fortress/src/xdocs menu.xml
Date Fri, 24 Jan 2003 04:33:34 GMT
bloritsch    2003/01/23 20:33:34

  Modified:    fortress/examples/src/java/org/apache/excalibur/fortress/examples/extended
                        Main.java
               fortress/examples/src/java/org/apache/excalibur/fortress/examples/swing
                        Main.java SwingContainer.java
               fortress/examples/src/java/org/apache/excalibur/fortress/examples/viewer
                        ComponentViewer.java ComponentViewer.xconf
                        Main.java
               fortress/src/java/org/apache/excalibur/fortress/container
                        AbstractContainer.java
               fortress/src/java/org/apache/excalibur/fortress/util
                        ContextManager.java
               fortress/src/xdocs menu.xml
  Log:
  update docs and fix some hacks
  
  Revision  Changes    Path
  1.12      +3 -1      jakarta-avalon-excalibur/fortress/examples/src/java/org/apache/excalibur/fortress/examples/extended/Main.java
  
  Index: Main.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/fortress/examples/src/java/org/apache/excalibur/fortress/examples/extended/Main.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Main.java	10 Nov 2002 16:18:23 -0000	1.11
  +++ Main.java	24 Jan 2003 04:33:32 -0000	1.12
  @@ -87,6 +87,8 @@
           m_container = (ExtendedContainer)cm.getContainer();
   
           m_container.doLookups();
  +
  +        ContainerUtil.dispose( cm );
       }
   }
   
  
  
  
  1.16      +16 -1     jakarta-avalon-excalibur/fortress/examples/src/java/org/apache/excalibur/fortress/examples/swing/Main.java
  
  Index: Main.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/fortress/examples/src/java/org/apache/excalibur/fortress/examples/swing/Main.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- Main.java	10 Nov 2002 16:18:23 -0000	1.15
  +++ Main.java	24 Jan 2003 04:33:32 -0000	1.16
  @@ -71,6 +71,7 @@
       public static void main( String[] args )
           throws Exception
       {
  +        // Set up all the preferences for Fortress
           final FortressConfig config = new FortressConfig();
           config.setContainerClass( "org.apache.excalibur.fortress.examples.swing.SwingContainer"
);
           config.setContextDirectory( "./" );
  @@ -80,8 +81,22 @@
           config.setRoleManagerConfiguration( "resource://org/apache/excalibur/fortress/examples/swing/SwingContainer.roles"
);
           config.setInstrumentManagerConfiguration( "resource://org/apache/excalibur/fortress/examples/swing/SwingContainer.instruments"
);
   
  +        // Get the root container initialized
           ContainerManager cm = new DefaultContainerManager( config.getContext() );
           ContainerUtil.initialize( cm );
  +
  +        /* Special containers such as Swing applications run in a different
  +         * thread in the background.  This is only one method of handling
  +         * a Swing based container.  Another alternative is to have the root
  +         * JFrame/JWindow/JDialog at this level, and hand a reference of the
  +         * container or its ServiceManager to the Swing class.  That will allow
  +         * you to defer proper shutdown of Fortress resources when your
  +         * application is closed.
  +         */
  +        ((SwingContainer)cm.getContainer()).run();
  +
  +        // Properly clean up when we are done
  +        ContainerUtil.dispose( cm );
       }
   }
   
  
  
  
  1.9       +19 -2     jakarta-avalon-excalibur/fortress/examples/src/java/org/apache/excalibur/fortress/examples/swing/SwingContainer.java
  
  Index: SwingContainer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/fortress/examples/src/java/org/apache/excalibur/fortress/examples/swing/SwingContainer.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- SwingContainer.java	2 Oct 2002 01:52:20 -0000	1.8
  +++ SwingContainer.java	24 Jan 2003 04:33:32 -0000	1.9
  @@ -69,7 +69,7 @@
    * @version CVS $Revision$ $Date$
    */
   public final class SwingContainer extends DefaultContainer
  -    implements Startable, ActionListener
  +    implements Startable, ActionListener, Runnable
   {
       // Component references
       private Translator m_translator;
  @@ -134,6 +134,21 @@
           }
       }
   
  +    public void run()
  +    {
  +        while ( m_frame.isVisible() )
  +        {
  +            try
  +            {
  +                Thread.sleep(1000);
  +            }
  +            catch( InterruptedException ie )
  +            {
  +                m_frame.setVisible(false);
  +            }
  +        }
  +    }
  +
       /**
        * Stops component, make GUI invisible, ready for decomissioning.
        */
  @@ -173,6 +188,8 @@
       {
           if( m_translator != null )
               m_serviceManager.release( m_translator );
  +
  +        m_frame.dispose();
   
           super.dispose();
       }
  
  
  
  1.7       +17 -2     jakarta-avalon-excalibur/fortress/examples/src/java/org/apache/excalibur/fortress/examples/viewer/ComponentViewer.java
  
  Index: ComponentViewer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/fortress/examples/src/java/org/apache/excalibur/fortress/examples/viewer/ComponentViewer.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ComponentViewer.java	9 Nov 2002 08:13:51 -0000	1.6
  +++ ComponentViewer.java	24 Jan 2003 04:33:32 -0000	1.7
  @@ -40,7 +40,7 @@
    */
   public final class ComponentViewer
       extends DefaultContainer
  -    implements Startable, ActionListener
  +    implements Startable, ActionListener, Runnable
   {
       // GUI references
       private JFrame m_frame;
  @@ -166,6 +166,21 @@
           finally
           {
               if( component != null ) m_serviceManager.release( component );
  +        }
  +    }
  +
  +    public void run()
  +    {
  +        while (m_frame.isVisible())
  +        {
  +            try
  +            {
  +                Thread.sleep(1000);
  +            }
  +            catch (InterruptedException ie)
  +            {
  +                m_frame.setVisible(false);
  +            }
           }
       }
   }
  
  
  
  1.2       +10 -10    jakarta-avalon-excalibur/fortress/examples/src/java/org/apache/excalibur/fortress/examples/viewer/ComponentViewer.xconf
  
  Index: ComponentViewer.xconf
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/fortress/examples/src/java/org/apache/excalibur/fortress/examples/viewer/ComponentViewer.xconf,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ComponentViewer.xconf	22 Jul 2002 17:54:31 -0000	1.1
  +++ ComponentViewer.xconf	24 Jan 2003 04:33:33 -0000	1.2
  @@ -7,16 +7,16 @@
          given key in different languages.
      -->
     <translator id="translator" logger="translator" activation="request">
  -	<dictionary>
  -	  <translation key="hello-world">
  -	    <value language="Deutsch">Hallo Welt</value>
  -	    <value language="English">Hello World</value>
  -	    <value language="Franšais">Bonjour la monde</value>
  -	    <value language="Indonesia">Apa kabar Dunia</value>
  -	    <value language="Espan§l">Hola Mundo</value>
  -	    <value language="Italiano">Ciao Mondo</value>
  -	  </translation>
  -	</dictionary>
  +    <dictionary>
  +      <translation key="hello-world">
  +        <value language="Deutsch">Hallo Welt</value>
  +        <value language="English">Hello World</value>
  +        <value language="Franšais">Bonjour la monde</value>
  +        <value language="Indonesia">Apa kabar Dunia</value>
  +        <value language="Espan§l">Hola Mundo</value>
  +        <value language="Italiano">Ciao Mondo</value>
  +      </translation>
  +    </dictionary>
     </translator>
   
   </fortress-example>
  
  
  
  1.13      +3 -3      jakarta-avalon-excalibur/fortress/examples/src/java/org/apache/excalibur/fortress/examples/viewer/Main.java
  
  Index: Main.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/fortress/examples/src/java/org/apache/excalibur/fortress/examples/viewer/Main.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Main.java	23 Jan 2003 19:48:50 -0000	1.12
  +++ Main.java	24 Jan 2003 04:33:33 -0000	1.13
  @@ -86,7 +86,7 @@
               cm = new DefaultContainerManager( config.getContext() );
               ContainerUtil.initialize( cm );
   
  -            (ComponentViewer)cm.getContainer();
  +            ((ComponentViewer)cm.getContainer()).run();
           }
           catch( CascadingException e )
           {
  @@ -106,7 +106,7 @@
           }
           finally
           {
  -            //ContainerUtil.dispose( cm );
  +            ContainerUtil.dispose( cm );
           }
       }
   }
  
  
  
  1.27      +2 -1      jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/container/AbstractContainer.java
  
  Index: AbstractContainer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/container/AbstractContainer.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- AbstractContainer.java	23 Jan 2003 19:48:51 -0000	1.26
  +++ AbstractContainer.java	24 Jan 2003 04:33:33 -0000	1.27
  @@ -598,6 +598,7 @@
   
               if (getLogger().isDebugEnabled()) getLogger().debug("Shutting down: " + handler);
               ContainerUtil.dispose( handler );
  +            if (getLogger().isDebugEnabled()) getLogger().debug("Done.");
           }
       }
   
  
  
  
  1.61      +3 -11     jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/util/ContextManager.java
  
  Index: ContextManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/util/ContextManager.java,v
  retrieving revision 1.60
  retrieving revision 1.61
  diff -u -r1.60 -r1.61
  --- ContextManager.java	23 Jan 2003 21:45:16 -0000	1.60
  +++ ContextManager.java	24 Jan 2003 04:33:33 -0000	1.61
  @@ -323,16 +323,8 @@
               try
               {
                   if (getLogger().isDebugEnabled()) getLogger().debug("Shutting down: " +
o);
  -
  -                // HACK!!!  There is an infinite loop or lockup trying to
  -                // shut down the ThreadManager through the dispose method.
  -                // I have not been able to track it down yet, but as all
  -                // the threads are Daemon threads it is safe to ignore it
  -                // for now.
  -                if ( ! (o instanceof ThreadManager) )
  -                {
  -                    ContainerUtil.shutdown( o );
  -                }
  +                ContainerUtil.shutdown( o );
  +                if (getLogger().isDebugEnabled()) getLogger().debug("Done.");
               }
               catch( Exception e )
               {
  
  
  
  1.5       +6 -0      jakarta-avalon-excalibur/fortress/src/xdocs/menu.xml
  
  Index: menu.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/fortress/src/xdocs/menu.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- menu.xml	21 Jan 2003 21:12:00 -0000	1.4
  +++ menu.xml	24 Jan 2003 04:33:33 -0000	1.5
  @@ -9,6 +9,12 @@
               <item href="http://jakarta.apache.org/builds/jakarta-avalon-excalibur/release"
name="Download"/>
           </menu>
   
  +        <menu name="Environments">
  +            <item href="cli.html" name="Command Line Applications"/>
  +            <item href="swing.html" name="Swing Applications"/>
  +            <item href="servlet.html" name="Servlet Applications"/>
  +        </menu>
  +
           <menu name="Related">
               <item href="http://jakarta.apache.org/avalon/" name="Avalon Home"/>
               <item href="http://jakarta.apache.org/avalon/excalibur/" name="Excalibur
Home"/>
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message