leosimons    2002/09/08 03:46:41

  Modified:    assembly/src/java/org/apache/excalibur/merlin/service
                        DefaultServiceManagementContext.java
                        InvalidPathException.java
                        ServiceManagementContext.java
                        UnknownServiceException.java
               assembly/src/java/org/apache/excalibur/merlin/activation
                        DefaultServiceResolver.java
  Log:
  reverting move from URI to URL as there is no replacement of 
resolve()/relativize() in URL.
  
  Revision  Changes    Path
  1.4       +24 -24    
jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/service/DefaultServiceManagementContext.java
  
  Index: DefaultServiceManagementContext.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/service/DefaultServiceManagementContext.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DefaultServiceManagementContext.java      8 Sep 2002 10:32:45 -0000       
1.3
  +++ DefaultServiceManagementContext.java      8 Sep 2002 10:46:41 -0000       
1.4
  @@ -7,8 +7,8 @@
    */
   package org.apache.excalibur.merlin.service;
   
  -import java.net.URL;
  -import java.net.MalformedURLException;
  +import java.net.URI;
  +import java.net.URISyntaxException;
   import java.util.Map;
   import java.util.Hashtable;
   import java.util.Iterator;
  @@ -31,7 +31,7 @@
      /**
       * The context name.
       */
  -    private URL m_base;
  +    private URI m_base;
   
      /**
       * A parent context.
  @@ -55,13 +55,13 @@
   
      /**
       * Creation of a new service management context.
  -    *
  +    * 
       * @param parent a possibly null parent context
       * @param name the context name
       * @exception NullPointerException if the supplied name is null
       */
  -    public DefaultServiceManagementContext( final ServiceManagementContext 
parent, final String name )
  -      throws NullPointerException, MalformedURLException
  +    public DefaultServiceManagementContext( final ServiceManagementContext 
parent, final String name ) 
  +      throws NullPointerException, URISyntaxException
       {
           if( name == null )
           {
  @@ -74,11 +74,11 @@
           {
               if( name.endsWith("/") )
               {
  -                m_base = new URL( name );
  +                m_base = new URI( name );
               }
               else
               {
  -                m_base = new URL( name + "/" );
  +                m_base = new URI( name + "/" );
               }
           }
           else
  @@ -99,11 +99,11 @@
       //=============================================================
   
      /**
  -    * Returns the base context URL.
  +    * Returns the base context URI.
       *
  -    * @return the context url
  +    * @return the context uri
       */
  -    public URL getBase()
  +    public URI getBase()
       {
           return m_base;
       }
  @@ -114,10 +114,10 @@
       * @param name the relative name
       * @return the service context object
       * @exception NullPointerException if the supplied name is null
  -    * @exception MalformedURLException if the name is invalid
  +    * @exception URISyntaxException if the name is invalid
       * @exception IllegalArgumentException if the name is already in use
       */
  -    public ServiceManagementContext createChild( String name ) throws 
MalformedURLException, IllegalArgumentException
  +    public ServiceManagementContext createChild( String name ) throws 
URISyntaxException, IllegalArgumentException
       {
           if( name == null )
           {
  @@ -130,7 +130,7 @@
               throw new IllegalArgumentException( error );
           }
   
  -        ServiceManagementContext context =
  +        ServiceManagementContext context = 
             new DefaultServiceManagementContext( this, name );
   
           m_children.put( name, context );
  @@ -141,7 +141,7 @@
      /**
       * Bind a resource to the naming context.
       *
  -    * @exception IllegalArgumentException if the supplied resource
  +    * @exception IllegalArgumentException if the supplied resource 
       *  name already exists within the immediate context
       */
       public void bind( Resource resource )
  @@ -158,7 +158,7 @@
      /**
       * Unbind a resource from the naming context.
       *
  -    * @exception IllegalArgumentException if the supplied resource is
  +    * @exception IllegalArgumentException if the supplied resource is 
       *   unknown within the immediate scope of the context
       */
       public void unbind( Resource resource )
  @@ -179,16 +179,16 @@
       }
   
      /**
  -    * Select a set of service based on a supplied filter.  A filter is
  -    * supplied in the form of a URL.  Interpritation of URL path, query,
  +    * Select a set of service based on a supplied filter.  A filter is 
  +    * supplied in the form of a URI.  Interpritation of URI path, query,
       * and frasgment are protocol dependent.
       *
  -    * @param url the service url
  +    * @param uri the service uri
       * @exception Exception is an install error occurs
       */
  -    public Resource locate( URL url ) throws UnknownServiceException, 
InvalidPathException
  +    public Resource locate( URI uri ) throws UnknownServiceException, 
InvalidPathException
       {
  -        URL path = m_base.relativize( url );
  +        URI path = m_base.relativize( uri );
           System.out.println("## locating: '" + path + "'");
           if( path.getPath().indexOf("/") > -1 )
           {
  @@ -200,12 +200,12 @@
               ServiceManagementContext child = (ServiceManagementContext) 
m_children.get( name );
               if( child != null )
               {
  -                return child.locate( url );
  +                return child.locate( uri );
               }
               else
               {
                   final String error = "Invalid path element: " + name;
  -                throw new InvalidPathException( url, error );
  +                throw new InvalidPathException( uri, error );
               }
           }
           else
  @@ -220,7 +220,7 @@
                   return resource;
               }
               final String error = "Could not locate the requested service.";
  -            throw new UnknownServiceException( url, error );
  +            throw new UnknownServiceException( uri, error );
           }
       }
   }
  
  
  
  1.3       +9 -9      
jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/service/InvalidPathException.java
  
  Index: InvalidPathException.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/service/InvalidPathException.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- InvalidPathException.java 8 Sep 2002 10:32:45 -0000       1.2
  +++ InvalidPathException.java 8 Sep 2002 10:46:41 -0000       1.3
  @@ -8,10 +8,10 @@
   
   package org.apache.excalibur.merlin.service;
   
  -import java.net.URL;
  +import java.net.URI;
   
   /**
  - * Exception to indicate that service URL is invalid.
  + * Exception to indicate that service URI is invalid.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Stephen McConnell</a>
    * @version $Revision$ $Date$
  @@ -19,25 +19,25 @@
   public final class InvalidPathException
       extends Exception
   {
  -     private final URL m_path;
  +     private final URI m_path;
   
       /**
        * Construct a new <code>InvalidPathException</code> instance.
        *
  -     * @param path The supplied URL path.
  +     * @param path The supplied URI path.
        * @param message The detail message for this exception.
        */
  -    public InvalidPathException( final URL path, final String message )
  +    public InvalidPathException( final URI path, final String message )
       {
           super( message );
           m_path = path;
       }
   
      /**
  -    * Return the URL path from which the exception was raised.
  -    * @return the path URL
  +    * Return the URI path from which the exception was raised.
  +    * @return the path URI
       */
  -    public URL getPath()
  +    public URI getPath()
       {
           return m_path;
       }
  @@ -48,7 +48,7 @@
       */
       public String getMessage()
       {
  -        return super.getMessage() + " from url " + getPath();
  +        return super.getMessage() + " from uri " + getPath();
       }
   }
   
  
  
  
  1.3       +11 -11    
jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/service/ServiceManagementContext.java
  
  Index: ServiceManagementContext.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/service/ServiceManagementContext.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ServiceManagementContext.java     8 Sep 2002 10:32:45 -0000       1.2
  +++ ServiceManagementContext.java     8 Sep 2002 10:46:41 -0000       1.3
  @@ -7,8 +7,8 @@
    */
   package org.apache.excalibur.merlin.service;
   
  -import java.net.URL;
  -import java.net.MalformedURLException;
  +import java.net.URI;
  +import java.net.URISyntaxException;
   
   import org.apache.excalibur.merlin.model.Resource;
   
  @@ -21,21 +21,21 @@
   public interface ServiceManagementContext
   {
      /**
  -    * Returns the base context URL.
  +    * Returns the base context URI.
       *
  -    * @return the context url
  +    * @return the context uri
       */
  -    public URL getBase();
  +    public URI getBase();
   
      /**
       * Creation of a subsidiary service context.
       *
       * @param name the relative name
       * @return the service context object
  -    * @exception MalformedURLException if the name is invalid
  +    * @exception URISyntaxException if the name is invalid
       * @exception IllegalArgumentException if the name is already in use
       */
  -    public ServiceManagementContext createChild( String name ) throws 
MalformedURLException, IllegalArgumentException;
  +    public ServiceManagementContext createChild( String name ) throws 
URISyntaxException, IllegalArgumentException;
   
      /**
       * Bind a resource to the naming context.
  @@ -50,14 +50,14 @@
       public void unbind( Resource resource );
   
      /**
  -    * Select a set of service based on a supplied filter.  A filter is
  -    * supplied in the form of a URL.  Interpritation of URL path, query,
  +    * Select a set of service based on a supplied filter.  A filter is 
  +    * supplied in the form of a URI.  Interpritation of URI path, query,
       * and reference elements are protocol dependent.
       *
  -    * @param url the service url
  +    * @param uri the service uri
       * @exception Exception is an install error occurs
       */
  -    Resource locate( URL url ) throws UnknownServiceException, 
InvalidPathException;
  +    Resource locate( URI uri ) throws UnknownServiceException, 
InvalidPathException;
   
   
   }
  
  
  
  1.3       +8 -8      
jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/service/UnknownServiceException.java
  
  Index: UnknownServiceException.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/service/UnknownServiceException.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- UnknownServiceException.java      8 Sep 2002 10:32:45 -0000       1.2
  +++ UnknownServiceException.java      8 Sep 2002 10:46:41 -0000       1.3
  @@ -7,7 +7,7 @@
    */
   package org.apache.excalibur.merlin.service;
   
  -import java.net.URL;
  +import java.net.URI;
   
   /**
    * Exception to indicate that a requested service is unknown.
  @@ -18,25 +18,25 @@
   public final class UnknownServiceException
       extends Exception
   {
  -     private final URL m_path;
  +     private final URI m_path;
   
       /**
        * Construct a new <code>UnknownServiceException</code> instance.
        *
  -     * @param path The supplied URL path.
  +     * @param path The supplied URI path.
        * @param message The detail message for this exception.
        */
  -    public UnknownServiceException( final URL path, final String message )
  +    public UnknownServiceException( final URI path, final String message )
       {
           super( message );
           m_path = path;
       }
   
      /**
  -    * Return the URL path from which the exception was raised.
  -    * @return the path URL
  +    * Return the URI path from which the exception was raised.
  +    * @return the path URI
       */
  -    public URL getPath()
  +    public URI getPath()
       {
           return m_path;
       }
  @@ -47,7 +47,7 @@
       */
       public String getMessage()
       {
  -        return super.getMessage() + " from url " + getPath();
  +        return super.getMessage() + " from uri " + getPath();
       }
   
   }
  
  
  
  1.4       +3 -1      
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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DefaultServiceResolver.java       8 Sep 2002 10:32:45 -0000       1.3
  +++ DefaultServiceResolver.java       8 Sep 2002 10:46:41 -0000       1.4
  @@ -236,6 +236,7 @@
       public void stop()
       throws Exception
       {
  +        super.stop();
           try
           {
               m_poa.destroy( true, true );
  @@ -247,7 +248,6 @@
                   getLogger().warn( "ignoring POA related exception" );
               }
           }
  -        super.stop();
       }
   
       //=======================================================================
  @@ -276,6 +276,8 @@
               // the URL is refering to ourselves
               //
   
  +            //Any any = m_orb.create_any();
  +            //ServiceResolverHelper.insert( any, m_resolver );
               return m_resolver;
           }
   
  
  
  

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

Reply via email to