You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by mc...@apache.org on 2004/04/03 09:52:51 UTC

cvs commit: avalon/merlin/platform/xdocs/merlin/embedded main.xml servlet.xml

mcconnell    2004/04/02 23:52:51

  Modified:    merlin/platform/xdocs/extensions/facilities finder.xml
                        http.xml index.xml navigation.xml
               merlin/platform/xdocs/merlin/embedded main.xml servlet.xml
  Log:
  Reshuffling and improving docs.
  
  Revision  Changes    Path
  1.2       +3 -3      avalon/merlin/platform/xdocs/extensions/facilities/finder.xml
  
  Index: finder.xml
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/platform/xdocs/extensions/facilities/finder.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- finder.xml	3 Apr 2004 05:34:14 -0000	1.1
  +++ finder.xml	3 Apr 2004 07:52:51 -0000	1.2
  @@ -20,12 +20,12 @@
   <document>
   
     <properties>
  -    <title>Finder Facility</title>
  +    <title>Avalon Finder Facility</title>
       <author email="dev@avalon.apache.org">Avalon Development Team</author>
     </properties>
   
     <body>
  -    <section name="Finder Facility">
  +    <section name="Avalon Finder Facility">
       </section>
     </body>
   
  
  
  
  1.2       +3 -3      avalon/merlin/platform/xdocs/extensions/facilities/http.xml
  
  Index: http.xml
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/platform/xdocs/extensions/facilities/http.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- http.xml	3 Apr 2004 05:34:14 -0000	1.1
  +++ http.xml	3 Apr 2004 07:52:51 -0000	1.2
  @@ -20,12 +20,12 @@
   <document>
   
     <properties>
  -    <title>JMX Extension</title>
  +    <title>Avalon HTTP Facility</title>
       <author email="dev@avalon.apache.org">Avalon Development Team</author>
     </properties>
   
     <body>
  -    <section name="HTTP Facility">
  +    <section name="Avalon HTTP Facility">
       </section>
     </body>
   
  
  
  
  1.2       +12 -5     avalon/merlin/platform/xdocs/extensions/facilities/index.xml
  
  Index: index.xml
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/platform/xdocs/extensions/facilities/index.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- index.xml	3 Apr 2004 05:34:14 -0000	1.1
  +++ index.xml	3 Apr 2004 07:52:51 -0000	1.2
  @@ -30,17 +30,24 @@
           <table>
             <tr><th>Topic</th><th>Summary</th></tr>
             <tr>
  -            <td><a href="finder.html">Finder</a></td>
  +            <td><a href="finder.html">Avalon Finder</a></td>
               <td>
                 A facility that provides support for dynamic component
  -              aquisition.
  +              aquisition.  The facility exposes methods that allow
  +              non-privaliged components to delegate activation request
  +              to the finder.  The finder will return a service reference
  +              to the client application.
               </td>
             </tr>
             <tr>
  -            <td><a href="http.html">HTTP</a></td>
  +            <td><a href="http.html">Avalon HTTP</a></td>
               <td>
                 A facility that handles redirection of HTTP requests to
  -              components.
  +              components.  This facility scans the containment model for 
  +              for components implement HTTP request handlers and provides
  +              support for the redirection of incomming HTTP requests to 
  +              classic compoennts - providing a integration layer
  +              between web-centric protocols and components.
               </td>
             </tr>
           </table>
  
  
  
  1.2       +2 -2      avalon/merlin/platform/xdocs/extensions/facilities/navigation.xml
  
  Index: navigation.xml
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/platform/xdocs/extensions/facilities/navigation.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- navigation.xml	3 Apr 2004 05:34:14 -0000	1.1
  +++ navigation.xml	3 Apr 2004 07:52:51 -0000	1.2
  @@ -39,8 +39,8 @@
         <item name="Extensions" href="/extensions/index.html">
           <item name="Platform" href="/extensions/platform/index.html"/>
           <item name="Facilities" href="/extensions/facilities/index.html">
  -          <item name="Facilities" href="/extensions/facilities/finder.html"/>
  -          <item name="HTTP" href="/extensions/facilities/http.html"/>
  +          <item name="Avalon Finder" href="/extensions/facilities/finder.html"/>
  +          <item name="Avalon HTTP" href="/extensions/facilities/http.html"/>
           </item>
         </item>
       </menu>
  
  
  
  1.2       +94 -0     avalon/merlin/platform/xdocs/merlin/embedded/main.xml
  
  Index: main.xml
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/platform/xdocs/merlin/embedded/main.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- main.xml	3 Apr 2004 04:34:08 -0000	1.1
  +++ main.xml	3 Apr 2004 07:52:51 -0000	1.2
  @@ -29,6 +29,100 @@
       <section name="Generic Embedding">
   
         <subsection name="Overview">
  +
  +        <p>
  +        The folowing information is a step by step decomposition of 
  +        a example of Merlin embedded in a main method.  The details
  +        presented here are the same as that used in all embedded Merlin
  +        scenarios.  Typically a embedded application will deviate from 
  +        this model to take into account the embedded context by resolving
  +        factory parameters relative to the execution environment.
  +        </p>
  +
  +      </subsection>
  +
  +      <subsection name="Sample Main">
  +<source>
  +/* 
  + * Copyright 2004 Apache Software Foundation
  + * Licensed  under the  Apache License,  Version 2.0  (the "License");
  + * you may not use  this file  except in  compliance with the License.
  + * You may obtain a copy of the License at 
  + * 
  + *   http://www.apache.org/licenses/LICENSE-2.0
  + * 
  + * Unless required by applicable law or agreed to in writing, software
  + * distributed  under the  License is distributed on an "AS IS" BASIS,
  + * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
  + * implied.
  + * 
  + * See the License for the specific language governing permissions and
  + * limitations under the License.
  + */
  +
  +package tutorial;
  +
  +import java.io.File;
  +import java.util.Map;
  +
  +import org.apache.avalon.repository.Artifact;
  +import org.apache.avalon.repository.provider.Builder;
  +import org.apache.avalon.repository.provider.Factory;
  +import org.apache.avalon.repository.provider.InitialContextFactory;
  +import org.apache.avalon.repository.provider.InitialContext;
  +import org.apache.avalon.repository.main.DefaultInitialContextFactory;
  +import org.apache.avalon.repository.Artifact;
  +
  +/**
  + * An example of the embedding of a merlin kernel inside a main 
  + * method.  The objective of the example is to demonstrate a 
  + * simple embedded scenario.
  + */
  +public class Main 
  +{
  +    public static void main( String[] args ) throws Exception
  +    {
  +        //
  +        // Create the initial context factory.  This establishes
  +        // the application group from which properties will
  +        // be resolved. It also provides operations supporting 
  +        // customization of the application environment.
  +        //
  +
  +        InitialContextFactory initial = 
  +          new DefaultInitialContextFactory( "merlin" );
  +        File home = initial.getHomeDirectory();
  +        initial.setCacheDirectory( new File( home, "system" ) );
  +        InitialContext context = initial.createInitialContext();
  +
  +        //
  +        // Using the initial context we can now load any repository 
  +        // application using an artifact specification. Meta 
  +        // information associated with the artifact is used to 
  +        // construct the classloader that the application needs in 
  +        // order to execute.
  +        //
  +
  +        String spec = "artifact:merlin/merlin-impl#3.3-SNAPSHOT";
  +        Artifact artifact = Artifact.createArtifact( spec );
  +        Builder builder = context.newBuilder( artifact );
  +
  +        //
  +        // With the classloader established we can go ahead and 
  +        // and get the application factory.  The factory has already
  +        // been parameterized with defaults derived from properties
  +        // based on the application group. We can provide 
  +        // overriding values by setting the factory criteria to
  +        // application specific values following which we instantiate 
  +        // the application.
  +        // 
  +
  +        Factory factory = builder.getFactory();
  +        Map criteria = factory.createDefaultCriteria();
  +        factory.create( criteria );
  +    }
  +}
  +</source>
         </subsection>
   
       </section>
  
  
  
  1.4       +7 -1      avalon/merlin/platform/xdocs/merlin/embedded/servlet.xml
  
  Index: servlet.xml
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/platform/xdocs/merlin/embedded/servlet.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- servlet.xml	3 Apr 2004 05:45:25 -0000	1.3
  +++ servlet.xml	3 Apr 2004 07:52:51 -0000	1.4
  @@ -43,6 +43,12 @@
         </subsection>
         <subsection name="Example web.xml">
           <p>
  +          <i>WARNING: there is an inconsitency here between properties 
  +          included in the web.xml and the servlet code.  Currently web.xml 
  +          properties are not used by the servlet - instread the servlet 
  +          uses merlin.properties in the standard locations.</i>
  +        </p>
  +        <p>
             <i>web.xml</i>
           </p>
   <source><![CDATA[
  
  
  

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