User: starksm 
  Date: 01/04/08 23:46:50

  Modified:    src/main/org/jnp/interfaces NamingContext.java
  Log:
  Add support for the lookupLink(Name) and lookupLink(String) methods
  so that LinkRefs can be obtained to show what they some consistency
  with the jboss module jnp binaries and this module.
  
  Revision  Changes    Path
  1.5       +26 -4     jnp/src/main/org/jnp/interfaces/NamingContext.java
  
  Index: NamingContext.java
  ===================================================================
  RCS file: /cvsroot/jboss/jnp/src/main/org/jnp/interfaces/NamingContext.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- NamingContext.java        2000/12/12 10:57:09     1.4
  +++ NamingContext.java        2001/04/09 06:46:50     1.5
  @@ -31,8 +31,8 @@
    *   <description> 
    *      
    *   @see <related>
  - *   @author $Author: oberg $
  - *   @version $Revision: 1.4 $
  + *   @author $Author: starksm $
  + *   @version $Revision: 1.5 $
    */
   public class NamingContext
      implements Context, java.io.Serializable
  @@ -655,14 +655,36 @@
      public Object lookupLink(String name)
         throws NamingException 
      {
  -      throw new OperationNotSupportedException();
  +      return lookupLink(getNameParser(name).parse(name));
      }
   
  +   /** Lookup the object referred to by name but don't dereferrence the final
  +    component. This really just involves returning the raw value returned by
  +    the Naming.lookup() method.
  +   @return the raw object bound under name.
  +   */
      public Object lookupLink(Name name)
         throws NamingException 
      {
  -      throw new OperationNotSupportedException();
  -   }
  +       if( name.isEmpty() )
  +           return lookup(name);
  +
  +       Object link = null;
  +       try
  +       {
  +           Name n = getAbsoluteName(name);
  +           link = naming.lookup(n);
  +       }
  +       catch(IOException e)
  +       {
  +            naming = null;
  +            removeServer(env);
  +            NamingException ex = new CommunicationException();
  +            ex.setRootCause(e);
  +            throw ex;
  +       }
  +       return link;
  +  }
   
      // Y overrides ---------------------------------------------------
   
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to