mcconnell    02/05/11 20:29:21

  Modified:    enterprise/orb build.properties build.xml
               enterprise/orb/lib openorb-1.3.0.jar openorb_tools-1.3.0.jar
               enterprise/orb/src/java/org/apache/orb
                        DefaultORBContext.java ORB.java ORB.xinfo
                        ORBContext.java
  Log:
  ganeral updates
  
  Revision  Changes    Path
  1.5       +6 -0      jakarta-avalon-apps/enterprise/orb/build.properties
  
  Index: build.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-apps/enterprise/orb/build.properties,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- build.properties  9 Mar 2002 04:50:20 -0000       1.4
  +++ build.properties  12 May 2002 03:29:20 -0000      1.5
  @@ -3,6 +3,12 @@
   # The build.properties file is read in by Ant.  It contains information 
   # related to resource dependencies and paths to related project resource
   #
  +
  +project.title=Apache ORB
  +MAJOR=2
  +MINOR=0
  +MICRO=1
  +
   # demo configuration
   #
   hello.verbose=false
  
  
  
  1.10      +27 -34    jakarta-avalon-apps/enterprise/orb/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-apps/enterprise/orb/build.xml,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- build.xml 14 Mar 2002 10:10:30 -0000      1.9
  +++ build.xml 12 May 2002 03:29:20 -0000      1.10
  @@ -1,9 +1,4 @@
   
  -<!-- 
  -PSS Service.
  -Copyright 2001-2002 OSM SARL, All Rights Reserved.
  --->
  -
   <project name="orb" default="help" basedir=".">
   
     <property file="local.properties"/>
  @@ -15,7 +10,7 @@
         Description
         -----------
   
  -      CORBA ORB package.
  +      ${project.title}
   
         Main Targets:
         -------------
  @@ -37,9 +32,6 @@
       </echo>
     </target>
   
  -  <property name="MAJOR" value="1"/>
  -  <property name="MINOR" value="0"/>
  -  <property name="MICRO" value="1"/>
     <property name="VERSION" value="${MAJOR}.${MINOR}.${MICRO}"/>
   
     <property name="compiler.jar" value="psdl-${VERSION}.jar"/>
  @@ -139,7 +131,8 @@
             <include name="org/apache/orb/**/orb.properties"/>
           </fileset>
         </copy>
  -      <jar jarfile="${dist}/${orb.manager.jar}" basedir="${build}/orb/lib" 
manifest="${etc}/factory.mf" />
  +      <jar jarfile="${dist}/${orb.manager.jar}" basedir="${build}/orb/lib" 
  +        manifest="${etc}/factory.mf" />
     </target>
   
     <target name="examples" depends="hello.build"/>
  @@ -202,28 +195,6 @@
        </java>
     </target>
   
  -  <target name="loader.context">
  -    <available property="merlin.available" 
file="${ant.home}/lib/merlin.jar"/>
  -  </target>
  -
  -  <target name="loader.defintion" depends="loader.context" 
if="merlin.available">
  -    <taskdef resource="merlin.properties"/>
  -  </target>
  - 
  -  <target name="loader.validation" depends="loader.defintion" 
unless="merlin.available">
  -    <echo>
  -
  -     Merlin is not installed in your Ant library.
  -     In order to use the "load" task the following jar files 
  -     must be added to your ${ant.home}/lib directory:
  -
  -       - merlin.jar
  -       - avalon-framework.jar
  -       - logkit.jar
  -       - xerces.jar (pre JRE 1.4 only)
  -    </echo>
  -  </target>
  -
     <target name="load-hello" depends="loader.validation,examples" 
if="merlin.available">
   
       <!-- 
  @@ -276,11 +247,11 @@
          </fileset>
       </copy>
       <javadoc destdir="${javadoc.root.path}/${ant.project.name}" 
  -     doctitle="&lt;h1&gt;Object Request Broker (ORB)&lt;/h1&gt;" 
  +     doctitle="&lt;h1&gt;${project.title} ${VERSION}&lt;/h1&gt;" 
         noindex="false" author="false" 
         use="true"
         overview="${overview.html}"
  -     windowtitle="Apache ORB 2.4" 
  +     windowtitle="${project.title}" 
         bottom="&lt;a href='[EMAIL PROTECTED]/LICENSE.HTML'/&gt;License, 
Disclaimer and due credits.&lt;/a&gt;"
         additionalparam="-breakiterator -J-Xmx128m"
         packagenames="org.*" 
  @@ -311,6 +282,28 @@
            <arg line="-I ${idl.includes}"/>
            <arg line="${idl.target}" />
         </java>
  +  </target>
  +
  +  <target name="loader.context">
  +    <available property="merlin.available" 
file="${ant.home}/lib/merlin.jar"/>
  +  </target>
  +
  +  <target name="loader.defintion" depends="loader.context" 
if="merlin.available">
  +    <taskdef resource="merlin.properties"/>
  +  </target>
  + 
  +  <target name="loader.validation" depends="loader.defintion" 
unless="merlin.available">
  +    <echo>
  +
  +     Merlin is not installed in your Ant library.
  +     In order to use the "load" task the following jar files 
  +     must be added to your ${ant.home}/lib directory:
  +
  +       - merlin.jar
  +       - avalon-framework.jar
  +       - logkit.jar
  +       - xerces.jar (pre JRE 1.4 only)
  +    </echo>
     </target>
   
   </project>
  
  
  
  1.2       +2527 -2418jakarta-avalon-apps/enterprise/orb/lib/openorb-1.3.0.jar
  
        <<Binary file>>
  
  
  1.2       +499 -495  
jakarta-avalon-apps/enterprise/orb/lib/openorb_tools-1.3.0.jar
  
        <<Binary file>>
  
  
  1.2       +11 -2     
jakarta-avalon-apps/enterprise/orb/src/java/org/apache/orb/DefaultORBContext.java
  
  Index: DefaultORBContext.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-apps/enterprise/orb/src/java/org/apache/orb/DefaultORBContext.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultORBContext.java    28 Feb 2002 16:29:37 -0000      1.1
  +++ DefaultORBContext.java    12 May 2002 03:29:21 -0000      1.2
  @@ -16,8 +16,6 @@
   import org.apache.avalon.framework.context.DefaultContext;
   import org.apache.avalon.framework.CascadingRuntimeException;
   
  -import org.omg.CORBA_2_3.ORB;
  -
   /**
    * The <code>DefaultORBContext</code> class is Context class that 
    * holds an ORB instance.
  @@ -39,8 +37,19 @@
       */
       public DefaultORBContext( ORB orb )
       {
  +        this( orb, null );
  +    }
  +
  +   /**
  +    * Creation of a new DefaultORBContext.
  +    * @param orb the ORB
  +    */
  +    public DefaultORBContext( ORB orb, Context parent )
  +    {
  +        super( parent );
           put( ORBContext.ORB_KEY, orb );
       }
  +
   
       //=================================================================
       // ORBContext
  
  
  
  1.4       +117 -4    
jakarta-avalon-apps/enterprise/orb/src/java/org/apache/orb/ORB.java
  
  Index: ORB.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-apps/enterprise/orb/src/java/org/apache/orb/ORB.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ORB.java  13 Mar 2002 02:12:26 -0000      1.3
  +++ ORB.java  12 May 2002 03:29:21 -0000      1.4
  @@ -17,6 +17,8 @@
   import org.apache.avalon.framework.context.Context;
   import org.apache.avalon.framework.context.Contextualizable;
   import org.apache.avalon.framework.context.ContextException;
  +import org.apache.avalon.framework.service.ServiceManager;
  +import org.apache.avalon.framework.service.ServiceException;
   import org.apache.avalon.framework.component.Component;
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.activity.Initializable;
  @@ -29,6 +31,8 @@
   import org.apache.avalon.phoenix.BlockContext;
   
   import org.omg.CORBA.ORBPackage.InvalidName;
  +import org.omg.PortableServer.POA;
  +import org.omg.PortableServer.POAHelper;
   
   /**
    * The <code>ORB</code> class.
  @@ -76,7 +80,8 @@
    */
   
   public class ORB extends org.openorb.CORBA.ORB
  -implements Component, Configurable, Contextualizable, Initializable, 
Startable, Disposable
  +implements Component, Configurable, Contextualizable, Initializable, 
Startable, Disposable,
  +ORBContext, POAContext, ServiceManager
   {
   
       //=================================================================
  @@ -114,7 +119,7 @@
   
       private Thread m_thread;
   
  -    private ORB orb; // self
  +    private ORB m_orb; // self
   
       private boolean m_stopped = false;
       private boolean m_disposed = false;
  @@ -128,7 +133,7 @@
       */
       public ORB()
       {
  -        orb = this;
  +        m_orb = this;
       }
   
       //=================================================================
  @@ -176,6 +181,7 @@
       public void initialize()
       throws Exception
       {
  +        if( getLogger().isDebugEnabled() ) getLogger().debug( 
"initialization (ORB)" );
   
           //
           // create an ORBInitContext that will be used as the properties 
argument
  @@ -220,7 +226,17 @@
               {
                   try
                   {
  -                    orb.run();
  +                    getPOA().the_POAManager().activate();
  +                }
  +                catch( Throwable e )
  +                {
  +                    final String warning = "Error encountered while 
attempting to start the POA.";
  +                    if( getLogger().isWarnEnabled() ) getLogger().warn( 
warning, e );
  +                }
  +
  +                try
  +                {
  +                    m_orb.run();
                   }
                   catch (Exception e)
                   {
  @@ -231,6 +247,7 @@
               }
             }
           );
  +        m_thread.setName( "orb-" + System.identityHashCode( m_orb ) );
           m_thread.start();
          final String debug = "started";
           if( getLogger().isDebugEnabled() ) getLogger().debug( debug );
  @@ -242,6 +259,14 @@
       public void stop()
       {
           if( getLogger().isDebugEnabled() ) getLogger().debug( "stop" );
  +        try
  +        {
  +            getPOA().destroy( true, true );
  +        }
  +        catch( Throwable e )
  +        {
  +            if( getLogger().isWarnEnabled() ) getLogger().warn( "ignoring 
POA related exception" );
  +        }
          try
          {
               shutdown( true );
  @@ -271,4 +296,92 @@
           m_context = null;
       }
   
  +    //=================================================================
  +    // ServiceManager
  +    //=================================================================
  +
  +   /**
  +    * Return TRUE is the named service is available.
  +    * @param the service key
  +    * @return boolean TRUE if the service is available
  +    */
  +    public boolean hasService( String key )
  +    {
  +        try
  +        {
  +            release( lookup( key ) );
  +            return true;
  +        }
  +        catch( Throwable e )
  +        {
  +            return false;
  +        }
  +    }
  +
  +   /**
  +    * Returns a service based on a supplied key.  The implementation is 
  +    * functionally equivalent to the ORB 
<code>resolve_initial_references</code>
  +    * operation.
  +    * @param key the service key
  +    * @return Object the service
  +    * @exception ServiceException if the service cannot be located
  +    */
  +    public Object lookup( String key ) throws ServiceException
  +    {
  +        try
  +        {
  +            return resolve_initial_references( key );
  +        }
  +        catch( Throwable e )
  +        {
  +            throw new ServiceException( "Could not locate service with key: 
" + key );
  +        }
  +    }
  +
  +   /**
  +    * Release a service.
  +    * (empty implementation)
  +    */
  +    public void release( Object service )
  +    {
  +    }
  +
  +    //=================================================================
  +    // POAContext
  +    //=================================================================
  +
  +    public POA getPOA()
  +    {
  +        try
  +        {
  +            return (POA) getORB().resolve_initial_references("RootPOA");
  +        }
  +        catch( Throwable e )
  +        {
  +            final String error = "Unable to resolve root POA.";
  +            throw new CascadingRuntimeException( error, e );
  +        }
  +    }
  +
  +    //=================================================================
  +    // ORBContext
  +    //=================================================================
  +
  +   /**
  +    * Returns the ORB.
  +    * @return ORB the object request broker
  +    */
  +    public ORB getORB( )
  +    {
  +        return this;
  +    }
  +
  +    public Object get( Object key ) throws ContextException
  +    {
  +        if( key.equals( ORBContext.ORB_KEY ) )
  +        {
  +            return this;
  +        }
  +        throw new ContextException( "Key not recognized: " + key );
  +    }
   }
  
  
  
  1.2       +1 -0      
jakarta-avalon-apps/enterprise/orb/src/java/org/apache/orb/ORB.xinfo
  
  Index: ORB.xinfo
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-apps/enterprise/orb/src/java/org/apache/orb/ORB.xinfo,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ORB.xinfo 12 Mar 2002 22:23:29 -0000      1.1
  +++ ORB.xinfo 12 May 2002 03:29:21 -0000      1.2
  @@ -21,6 +21,7 @@
   
     <services>
         <service name="org.apache.orb.ORB" version="2.4" />
  +      <service name="org.apache.orb.POAContext" version="1.0" />
     </services>
   
     <implementation policy="SINGLETON"/>
  
  
  
  1.2       +1 -3      
jakarta-avalon-apps/enterprise/orb/src/java/org/apache/orb/ORBContext.java
  
  Index: ORBContext.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-apps/enterprise/orb/src/java/org/apache/orb/ORBContext.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ORBContext.java   28 Feb 2002 16:29:37 -0000      1.1
  +++ ORBContext.java   12 May 2002 03:29:21 -0000      1.2
  @@ -11,8 +11,6 @@
   import org.apache.avalon.framework.context.Context;
   import org.apache.avalon.framework.context.ContextException;
   
  -import org.omg.CORBA_2_3.ORB;
  -
   /**
    * The <code>ORBContext</code> interface defines a <code>Context</code> type 
that 
    * holds an ORB instance.
  @@ -23,7 +21,7 @@
   public interface ORBContext extends Context, Component
   {
   
  -    public static final String ORB_KEY = "ORB";
  +    public static final String ORB_KEY = "orb";
   
      /**
       * Returns the ORB.
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to