avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From leosim...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/activation DefaultServiceResolver.java
Date Sun, 08 Sep 2002 11:59:18 GMT
leosimons    2002/09/08 04:59:17

  Modified:    assembly/src/java/org/apache/excalibur/merlin/activation
                        DefaultServiceResolver.java
  Log:
  revert to 1.2
  
  Revision  Changes    Path
  1.5       +37 -37    jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/activation/DefaultServiceResolver.java
  
  Index: DefaultServiceResolver.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/activation/DefaultServiceResolver.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DefaultServiceResolver.java	8 Sep 2002 10:46:41 -0000	1.4
  +++ DefaultServiceResolver.java	8 Sep 2002 11:59:17 -0000	1.5
  @@ -3,7 +3,9 @@
   
   import java.io.Serializable;
   import java.net.URL;
  +import java.net.URI;
   import java.net.MalformedURLException;
  +import java.net.URISyntaxException;
   
   import org.apache.avalon.framework.context.Context;
   import org.apache.avalon.framework.context.ContextException;
  @@ -44,7 +46,7 @@
   
   /**
    * Implementation of a container that provides support for remotely
  - * accessible services.  Services managed by this container my be
  + * accessible services.  Services managed by this container my be 
    * accessed using a corbaloc URL.  The implemetation handles the management
    * of incomming requests by redirecting requests to servant implementation
    * exposing remotely accessible services.
  @@ -71,7 +73,7 @@
       private Context m_context;
   
      /**
  -    * The server ORB used to locate the corbaloc service, POA service, and
  +    * The server ORB used to locate the corbaloc service, POA service, and 
       * handle POA activation.
       */
       private ORB m_orb;
  @@ -87,7 +89,7 @@
       private POA m_poa;
   
      /**
  -    * Internal reference to the object reference to this server.
  +    * Internal reference to the object reference to this server. 
       */
       private ServiceResolver m_resolver;
   
  @@ -105,7 +107,7 @@
       * The container's resource registry.
       */
       private ServiceManagementContext m_registry;
  -
  +    
       //=================================================================
       // Contextualizable
       //=================================================================
  @@ -113,7 +115,7 @@
      /**
       * Method invoked by the ORB initializer to declare the runtime context.
       * @param context runtime application context
  -    * @exception ContextException if the supplied context does not meet
  +    * @exception ContextException if the supplied context does not meet 
       *   contextulization criteria
       */
       public void contextualize( Context context ) throws ContextException
  @@ -127,7 +129,7 @@
       //=======================================================================
       // Configurable
       //=======================================================================
  -
  +    
      /**
       * Method invoked by the ORB initializer to declare the static configuration.
       * @param config application static configuration
  @@ -143,7 +145,7 @@
       //=======================================================================
       // Serviceable
       //=======================================================================
  -
  +    
      /**
       * Method invoked by the container to provide dependent services.
       * @param manager the service manager
  @@ -159,18 +161,18 @@
       //=======================================================================
   
      /**
  -    * Initialization of the server.  The initialization validates that a
  -    * logging channel is available, that configuration exists, and that
  -    * context is not null.  Folowing validation, the implementation
  +    * Initialization of the server.  The initialization validates that a 
  +    * logging channel is available, that configuration exists, and that 
  +    * context is not null.  Folowing validation, the implementation 
       * creates an ORB based on a child configuration named 'orb' supplied
  -    * during Initializer establishment.  Once the ORB is obtained, the
  +    * during Initializer establishment.  Once the ORB is obtained, the 
       * implementation handles the establishment of the POA and servant.
       *
       * @exception Exception if initialization fails
       */
       public void initialize()
       throws Exception
  -    {
  +    {       
           super.initialize();
   
           //
  @@ -192,8 +194,8 @@
                 new Policy[]
                 {
                    m_root.create_id_assignment_policy( IdAssignmentPolicyValue.USER_ID ),
  -                 m_root.create_lifespan_policy( LifespanPolicyValue.PERSISTENT )
  -              }
  +                 m_root.create_lifespan_policy( LifespanPolicyValue.PERSISTENT ) 
  +              } 
               );
   
               Servant servant = new ServiceResolverPOATie( this );
  @@ -217,7 +219,7 @@
       //=======================================================================
       // Startable
       //=======================================================================
  -
  +    
       /**
        * Start the container.
        * @exception Exception if a startup error occurs
  @@ -236,18 +238,18 @@
       public void stop()
       throws Exception
       {
  -        super.stop();
           try
           {
               m_poa.destroy( true, true );
           }
           catch( Throwable e )
           {
  -            if( getLogger().isWarnEnabled() )
  +            if( getLogger().isWarnEnabled() ) 
               {
                   getLogger().warn( "ignoring POA related exception" );
               }
           }
  +        super.stop();
       }
   
       //=======================================================================
  @@ -256,7 +258,7 @@
   
       /**
        * Process a corbaloc request.
  -     *
  +     * 
        * @param path a path relative to this container
        * @return an object reference
        * @exception  InvalidQuery if the supplied path is invalid
  @@ -272,34 +274,32 @@
   
           if( path.equals("") )
           {
  -            //
  -            // the URL is refering to ourselves
  +            // 
  +            // the URI is refering to ourselves
               //
   
  -            //Any any = m_orb.create_any();
  -            //ServiceResolverHelper.insert( any, m_resolver );
               return m_resolver;
           }
   
           //
  -        // convert the relative corbaloc path to an absolute path relative to the
  -        // the registries base path (i.e. transform from the corbaloc namespace to
  +        // convert the relative corbaloc path to an absolute path relative to the 
  +        // the registries base path (i.e. transform from the corbaloc namespace to 
           // the container namespace)
           //
   
  -        URL base = m_registry.getBase();
  -        URL url = base.resolve( path );
  +        URI base = m_registry.getBase();
  +        URI uri = base.resolve( path );
   
           getLogger().info("path: '" + path + "'");
  -        getLogger().info("resolved: " + url );
  +        getLogger().info("resolved: " + uri );
   
           try
           {
  -            Resource resource = m_registry.locate( url );
  +            Resource resource = m_registry.locate( uri );
               getLogger().info("## located a resource: " + resource );
   
               //
  -            // we have located a resource matching the resolved url
  +            // we have located a resource matching the resolved uri
               // so we need to verify if the object type backing the resource
               // can be passed back to the client inside an any
               //
  @@ -313,7 +313,7 @@
                   // this resource does not implement an adaptrive interface
                   //
   
  -                final String error =
  +                final String error = 
                     "Service is not IIOP addressable.";
                   throw new InvalidReference( m_url, error );
               }
  @@ -321,7 +321,7 @@
               {
                   //
                   // get the object - if it is a corba object reference
  -                // then return it otherwise
  +                // then return it otherwise 
                   //
   
                   try
  @@ -362,7 +362,7 @@
       //=======================================================================
       // Disposable
       //=======================================================================
  -
  +    
      /**
       * Disposal of the server.  This method is triggered by a shutdown hook
       * becuase initializers are not cleared by an ORB on shutdown.
  @@ -375,20 +375,20 @@
       //=======================================================================
       // implementation
       //=======================================================================
  -
  +    
      /**
       * Pack a value in an.
  -    * @param any the Any
  +    * @param any the Any 
       * @return Object the any contents as a Java Object
       */
       private Any putResult( Any any, Object object )
       {
           if( any == null )
  -        {
  +        { 
               throw new NullPointerException("any");
           }
           if( object == null )
  -        {
  +        { 
               throw new NullPointerException("object");
           }
   
  @@ -404,7 +404,7 @@
           }
           else
           {
  -           throw new IllegalStateException(
  +           throw new IllegalStateException( 
                 "Object type: " + any.type().kind().value() + " unsupported.");
           }
       }
  
  
  

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