avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground EmbeddedDemo.java EmbeddedDemo.xinfo BasicComponent.xprofile DemoManager.java DemoManager.xinfo Demonstratable.java Exploitable.java ExploitationManager.java ExploitationManager.xinfo SimpleComponent.java
Date Fri, 02 Aug 2002 06:29:20 GMT
mcconnell    2002/08/01 23:29:20

  Modified:    assembly/demo/src/java/org/apache/excalibur/playground
                        BasicComponent.xprofile DemoManager.java
                        DemoManager.xinfo Demonstratable.java
                        Exploitable.java ExploitationManager.java
                        ExploitationManager.xinfo SimpleComponent.java
  Added:       assembly/demo/src/java/org/apache/excalibur/playground
                        EmbeddedDemo.java EmbeddedDemo.xinfo
  Log:
  Initial demonstration of an embedded kernel.
  
  Revision  Changes    Path
  1.5       +1 -1      jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/BasicComponent.xprofile
  
  Index: BasicComponent.xprofile
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/BasicComponent.xprofile,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- BasicComponent.xprofile	19 Jul 2002 14:08:06 -0000	1.4
  +++ BasicComponent.xprofile	2 Aug 2002 06:29:20 -0000	1.5
  @@ -11,7 +11,7 @@
    
      <component name="basic">
        <context class="org.apache.excalibur.playground.BasicContext">
  -       <import key="home" name="avalon:work"/>
  +       <import key="home" name="avalon:home"/>
          <entry key="location">Paris</entry>
          <entry key="test" class="java.io.File">../assembly</entry>
        </context>
  
  
  
  1.2       +10 -9     jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/DemoManager.java
  
  Index: DemoManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/DemoManager.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DemoManager.java	30 Jul 2002 13:52:56 -0000	1.1
  +++ DemoManager.java	2 Aug 2002 06:29:20 -0000	1.2
  @@ -22,26 +22,27 @@
   
       public void initialize()
       {
  -        getLogger().debug("initialize");
  +        getLogger().info("initialize");
       }
   
       //=======================================================================
  -    // Disposable
  +    // Extension
       //=======================================================================
   
  -    public void dispose()
  +    public void extend( int stage, Object target, Context context ) throws Exception
       {
  -        getLogger().debug( "dispose" );
  +        super.extend( stage, target, context );
  +        if( target instanceof Demonstratable )
  +          ((Demonstratable)target).demo( stageToString( stage ).toLowerCase() );
       }
   
       //=======================================================================
  -    // Extension
  +    // Disposable
       //=======================================================================
   
  -    public void extend( int stage, Object target, Context context ) throws Exception
  +    public void dispose()
       {
  -        super.extend( stage, target, context );
  -        if( target instanceof Demonstratable )
  -          ((Demonstratable)target).demo( stage );
  +        getLogger().info( "dispose" );
       }
  +
    }
  
  
  
  1.2       +1 -1      jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/DemoManager.xinfo
  
  Index: DemoManager.xinfo
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/DemoManager.xinfo,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DemoManager.xinfo	30 Jul 2002 13:52:56 -0000	1.1
  +++ DemoManager.xinfo	2 Aug 2002 06:29:20 -0000	1.2
  @@ -7,7 +7,7 @@
   <component-info>
   
     <component>
  -    <name>demo</name>
  +    <name>demo-ext</name>
     </component>
   
     <!--
  
  
  
  1.2       +1 -1      jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/Demonstratable.java
  
  Index: Demonstratable.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/Demonstratable.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Demonstratable.java	30 Jul 2002 13:52:56 -0000	1.1
  +++ Demonstratable.java	2 Aug 2002 06:29:20 -0000	1.2
  @@ -7,5 +7,5 @@
    */
   public interface Demonstratable 
   {
  -    void demo( int stage );
  +    void demo( String stage );
   }
  
  
  
  1.2       +2 -1      jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/Exploitable.java
  
  Index: Exploitable.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/Exploitable.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Exploitable.java	29 Jul 2002 06:14:28 -0000	1.1
  +++ Exploitable.java	2 Aug 2002 06:29:20 -0000	1.2
  @@ -7,5 +7,6 @@
    */
   public interface Exploitable 
   {
  -    public void exploit();
  +    public void incarnate();
  +    public void etherialize();
   }
  
  
  
  1.4       +7 -3      jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/ExploitationManager.java
  
  Index: ExploitationManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/ExploitationManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ExploitationManager.java	30 Jul 2002 13:49:07 -0000	1.3
  +++ ExploitationManager.java	2 Aug 2002 06:29:20 -0000	1.4
  @@ -22,7 +22,7 @@
   
       public void initialize()
       {
  -        getLogger().debug("initialize");
  +        getLogger().info("initialize");
       }
   
       //=======================================================================
  @@ -31,7 +31,7 @@
   
       public void dispose()
       {
  -        getLogger().debug( "dispose" );
  +        getLogger().info( "dispose" );
       }
   
       //=======================================================================
  @@ -55,7 +55,11 @@
               super.extend( stage, object, context );
               if( stage == CREATE )
               {
  -                ((Exploitable)object).exploit();
  +                ((Exploitable)object).incarnate();
  +            }
  +            else if( stage == DESTROY )
  +            {
  +                ((Exploitable)object).etherialize();
               }
           }
           else
  
  
  
  1.3       +1 -1      jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/ExploitationManager.xinfo
  
  Index: ExploitationManager.xinfo
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/ExploitationManager.xinfo,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ExploitationManager.xinfo	30 Jul 2002 13:49:07 -0000	1.2
  +++ ExploitationManager.xinfo	2 Aug 2002 06:29:20 -0000	1.3
  @@ -7,7 +7,7 @@
   <component-info>
   
     <component>
  -    <name>exploitation</name>
  +    <name>exploit-ext</name>
     </component>
   
     <!--
  
  
  
  1.10      +10 -4     jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/SimpleComponent.java
  
  Index: SimpleComponent.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/SimpleComponent.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- SimpleComponent.java	30 Jul 2002 13:49:07 -0000	1.9
  +++ SimpleComponent.java	2 Aug 2002 06:29:20 -0000	1.10
  @@ -52,18 +52,24 @@
       // Exploitable
       //=======================================================================
   
  -    public void exploit()
  +    public void incarnate() 
       {
  -        getLogger().info( "I've been exploited!" );
  +        getLogger().info( "incarnation phase in exploitable" );
       }
   
  +    public void etherialize()
  +    {
  +        getLogger().info( "etherialize phase in exploitable" );
  +    }
  +
  +
       //=======================================================================
       // Demonstratable
       //=======================================================================
   
  -    public void demo( int stage )
  +    public void demo( String stage )
       {
  -        getLogger().info( "doing demo for stage: " + stage );
  +        getLogger().info( stage + " stage in demonstratable");
       }
   
       //=======================================================================
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/EmbeddedDemo.java
  
  Index: EmbeddedDemo.java
  ===================================================================
  
  
  package org.apache.excalibur.playground;
  
  import java.io.File;
  
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.context.Context;
  import org.apache.avalon.framework.context.DefaultContext;
  import org.apache.avalon.framework.context.Contextualizable;
  import org.apache.avalon.framework.context.ContextException;
  import org.apache.avalon.framework.configuration.DefaultConfiguration;
  import org.apache.avalon.framework.logger.Logger;
  import org.apache.avalon.framework.activity.Initializable;
  import org.apache.avalon.framework.activity.Startable;
  import org.apache.avalon.framework.activity.Disposable;
  
  import org.apache.excalibur.merlin.kernel.Kernel;
  import org.apache.excalibur.merlin.kernel.DefaultKernel;
  import org.apache.excalibur.merlin.model.ContainerDescriptor;
  import org.apache.excalibur.merlin.model.ClasspathDescriptor;
  import org.apache.excalibur.merlin.assembly.ContainerManager;
  
  /**
   * This is a minimal demonstration component that implements the 
   * <code>BasicService</code> interface and has no dependencies.
   *
   * @author <a href="mailto:mcconnell@osm.net">Stephen McConnell</a>
   */
  public class EmbeddedDemo extends AbstractLogEnabled 
  implements Contextualizable, Initializable, Startable, Disposable
  {
      private DefaultKernel m_kernel;
  
      private File m_home;
      private Context m_context;
  
      public void contextualize( Context context ) throws ContextException
      {
          m_home = (File) context.get("avalon:home");
          m_context = context;
      }
  
      //=======================================================================
      // Initializable
      //=======================================================================
  
      public void initialize() throws Exception
      {
          getLogger().info("initialize");
          m_kernel = new DefaultKernel();
          m_kernel.enableLogging( getLogger().getChildLogger( "my-kernel" ) );
          m_kernel.contextualize( m_context );
          m_kernel.configure( new DefaultConfiguration( "kernel", null ) );
          m_kernel.initialize();
      }
  
      //=======================================================================
      // Startable
      //=======================================================================
  
      public void start() throws Exception
      {
          getLogger().info("starting");
          m_kernel.startup();
      }
  
      public void stop()
      {
          getLogger().info("stopping");
          m_kernel.shutdown();
      }
  
      public void dispose()
      {
          getLogger().debug( "dispose" );
      }
  
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/EmbeddedDemo.xinfo
  
  Index: EmbeddedDemo.xinfo
  ===================================================================
  <?xml version="1.0"?>
  <!DOCTYPE component-info
        PUBLIC "-//AVALON/Component Info DTD Version 1.0//EN"
               "http://jakarta.apache.org/avalon/componentinfo_1_0.dtd" >
  
  <component-info>
  
    <component>
      <name>embedded</name>
    </component>
  
    <context>
      <entry key="avalon:home" type="java.io.File"/>
    </context>
  
  
  </component-info>
  
  
  
  

--
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