avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: jakarta-avalon-apps/enterprise/corbaloc/src/java/org/apache/orb/corbaloc CorbalocURLConnection.java
Date Sat, 07 Sep 2002 19:08:37 GMT
mcconnell    2002/09/07 12:08:37

  Modified:    enterprise/corbaloc/src/java/org/apache/orb/corbaloc
                        CorbalocURLConnection.java
  Log:
  Minor updates to the corbaloc handler to manage non-existent exceptions more gracefully.
  
  Revision  Changes    Path
  1.2       +16 -17    jakarta-avalon-apps/enterprise/corbaloc/src/java/org/apache/orb/corbaloc/CorbalocURLConnection.java
  
  Index: CorbalocURLConnection.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-apps/enterprise/corbaloc/src/java/org/apache/orb/corbaloc/CorbalocURLConnection.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CorbalocURLConnection.java	7 Sep 2002 06:53:40 -0000	1.1
  +++ CorbalocURLConnection.java	7 Sep 2002 19:08:37 -0000	1.2
  @@ -119,10 +119,12 @@
        */
        private CorbalocCarrier getCORBAObject( String path, String remainder ) throws IOException
        {
  +        System.out.println("GET: " + path + ", " + remainder );
           try
           {
               org.omg.CORBA.Object object = m_orb.string_to_object( path );
  -            if( object._non_existent() )
  +            
  +            if( !objectExists( object ) )
               {
                   final int i = path.lastIndexOf("/");
                   if( i > -1 )
  @@ -152,6 +154,18 @@
           }
        }
   
  +     private boolean objectExists( org.omg.CORBA.Object object )
  +     {
  +        try
  +        {
  +            return !object._non_existent();
  +        }
  +        catch( org.omg.CORBA.OBJECT_NOT_EXIST e )
  +        {
  +            return false;
  +        }
  +     }
  +
       /**
        * Returns the object referenced by the URL.  If a connection has not been 
        * performed, a commection and retrival of the object reference will be 
  @@ -264,21 +278,6 @@
   
               return resolver.resolve( path );
               
  -            //
  -            // unpack the result and return it to the client
  -            //
  -
  -            //try
  -            //{
  -            //    return getResult( any );
  -            //}
  -            //catch( Throwable e )
  -            //{
  -            //    final String error = 
  -            //      "Failed to extact query result from url: " + m_url 
  -            //      + " due to: " + e.getMessage();
  -            //    throw new IOException( error );
  -            //}
           }
           catch( ServiceRedirection redirection )
           {
  @@ -323,7 +322,7 @@
       }
   
      /**
  -    * Unpack the value in the any as a Java object.
  +    * Unpack the value in the any as a Java object (not used).
       * @param any the Any 
       * @return Object the any contents as a Java Object
       */
  
  
  

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