Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 67391 invoked from network); 9 Aug 2006 05:00:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 9 Aug 2006 05:00:34 -0000 Received: (qmail 67033 invoked by uid 500); 9 Aug 2006 05:00:34 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 66887 invoked by uid 500); 9 Aug 2006 05:00:33 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 66876 invoked by uid 99); 9 Aug 2006 05:00:33 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Aug 2006 22:00:33 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Aug 2006 22:00:32 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 4F6E61A981C; Tue, 8 Aug 2006 22:00:12 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r429962 - in /geronimo/xbean/site: colossus-bootstrap.html home.html Date: Wed, 09 Aug 2006 05:00:11 -0000 To: scm@geronimo.apache.org From: chirino@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060809050012.4F6E61A981C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: chirino Date: Tue Aug 8 22:00:11 2006 New Revision: 429962 URL: http://svn.apache.org/viewvc?rev=429962&view=rev Log: Latest export from confluence Added: geronimo/xbean/site/colossus-bootstrap.html Modified: geronimo/xbean/site/home.html Added: geronimo/xbean/site/colossus-bootstrap.html URL: http://svn.apache.org/viewvc/geronimo/xbean/site/colossus-bootstrap.html?rev=429962&view=auto ============================================================================== --- geronimo/xbean/site/colossus-bootstrap.html (added) +++ geronimo/xbean/site/colossus-bootstrap.html Tue Aug 8 22:00:11 2006 @@ -0,0 +1,245 @@ + + + + + + + + +Colossus Bootstrap + + + + + +
+ + + + + + +
+
XBean
+
+ +
+ +
+ + + + + + +
+ + + + + +
+ + +
+ + +

Bootstrap

+ +

Goal

+ +

The goal of the bootstrap module is to create the initial environment for a server. Normally this sort of bootstrap is handled by java directly via command line arguments to the java executable or via manifest entries in an executable jar. Unfortunately, the bootstrap built into Java is so limited and hard to work with that it is often augmented with shell scripts to generate the command line arguments. The xbean-bootstrap module will support the following features:

+ +
    +
  • Creation of a bootstrap class loader which is a child of the system class loader. This leaves the system class loader clean of the bootstrap classes, which makes class loader isolation much easier.
  • +
+ + +
    +
  • Support for ant style pattern matching for the specification of the bootstrap class path. Normally one writes a shell script to find all jars and zips in the lib directory, or one has to list the exact name of each jar.
  • +
+ + +
    +
  • Pluggable bootstrap loaders. The bootstrap code determines what should be loaded (normally this is a file but is it really just a string so anything goes), and finds loader that can handle the resource (this will normally be the spring loader).
  • +
+ + +
    +
  • Bootstrap jar should be reusable. In most cases, the default values should be good enough for a server. In cases where defaults need to be changed, the manifest can be modified to change them.
  • +
+ + +
    +
  • Bootstrap should be completely self contained meaning no dependencies.
  • +
+ + +
    +
  • Bootstrap should do as little as possible. Create the class loader, create the loader, start the loading, and get out of the way.
  • +
+ + +

Properties

+ +

The bootstrap code will need a bunch of properties to start up, and there are many way to get properties into the server. This is a little something I learned from OpenEJB is we load properties in layers from multiple sources and then present the final startup code with a single properties object.

+ +

Another trick from OpenEJB is the system properties on the command line come from the left side of the java class name and to make life easy you also scan the command line args for aditional -Dname=value properties. Then you just add those properties to the system making the admin's life easier.

+ +
    +
  1. System properties
  2. +
  3. bin/bootstrap.properties
  4. +
  5. META-INF/bootstrap.properties
  6. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Property Default Description
xbean.base.dir if can locate startup jar or startup classes dir (the one containing a the bootstrap class)
+ if startup jar is named "bin" use parent else use startup jar
+ else throw error
The base directory of the server. This is simply set into the environment.
xbean.bootstrap.ClassPath lib/*.jar lib*.zip The paths used for the bootstrap class loader.
xbean.bootstrap.ClassLoaderFactory UrlClassLoaderFactory The factory used to create the bootstrap class loader.
xbean.bootstrap.Loader Use xbean-finder to search class path for file named META-INF/org/xbean/bootstrap/loader.properties The class used to load the bootstrap resource
+ +

Startup Procedure

+ +
    +
  1. Process properties +
      +
    1. determine base dir and set into system property xbean.base.dir
    2. +
    3. determine class path
    4. +
    5. determine class loader factory
    6. +
    7. determine the bootstrap loader
    8. +
    +
  2. +
  3. Resolve class path
  4. +
  5. Create class loader
  6. +
  7. Create the bootstrap loader
  8. +
  9. Call loader passing in the class loader, properties, and cli args (without any consumed during bootstrap)
  10. +
+
+ +
+
+
+ + + + + + \ No newline at end of file Modified: geronimo/xbean/site/home.html URL: http://svn.apache.org/viewvc/geronimo/xbean/site/home.html?rev=429962&r1=429961&r2=429962&view=diff ============================================================================== --- geronimo/xbean/site/home.html (original) +++ geronimo/xbean/site/home.html Tue Aug 8 22:00:11 2006 @@ -214,7 +214,10 @@ Hide Children