portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wea...@apache.org
Subject cvs commit: jakarta-jetspeed-2/cps/src/java/org/apache/jetspeed/cps/jndi TyrexJNDIService.java
Date Mon, 16 Feb 2004 19:18:39 GMT
weaver      2004/02/16 11:18:39

  Modified:    cps/src/java/org/apache/jetspeed/cps/jndi
                        TyrexJNDIService.java
  Log:
  fixed issue with not correctly binding names
  
  Revision  Changes    Path
  1.3       +17 -16    jakarta-jetspeed-2/cps/src/java/org/apache/jetspeed/cps/jndi/TyrexJNDIService.java
  
  Index: TyrexJNDIService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/cps/src/java/org/apache/jetspeed/cps/jndi/TyrexJNDIService.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TyrexJNDIService.java	16 Feb 2004 13:31:47 -0000	1.2
  +++ TyrexJNDIService.java	16 Feb 2004 19:18:39 -0000	1.3
  @@ -6,18 +6,13 @@
    */
   package org.apache.jetspeed.cps.jndi;
   
  -
  -
   import javax.naming.Context;
   import javax.naming.NamingException;
   
  -
   import org.apache.fulcrum.InitializationException;
   import org.apache.jetspeed.cps.BaseCommonService;
   import org.apache.jetspeed.cps.components.jndi.*;
   
  -
  -
   /**
    * <p>
    * TyrexJNDIService
  @@ -29,21 +24,27 @@
    */
   public class TyrexJNDIService extends BaseCommonService implements JNDIService
   {
  -	protected JNDIComponent jndiComponent;
  +    protected JNDIComponent jndiComponent;
   
       /**
        * @see org.apache.fulcrum.Service#init()
        */
       public void init() throws InitializationException
       {
  -		try
  +        if (!isInitialized())
           {
  -            jndiComponent = new TyrexJNDIComponent();     
  +
  +            try
  +            {
  +                jndiComponent = new TyrexJNDIComponent();
  +                jndiComponent.bindToCurrentThread();
  +                setInit(true);
  +            }
  +            catch (NamingException e)
  +            {
  +                throw new InitializationException("jndi naming exception " + e.toString(),
e);
  +            }
           }
  -        catch (NamingException e)
  -        {
  -            throw new InitializationException("jndi naming exception "+e.toString(), e);
  -        }   
       }
   
       /**
  @@ -51,15 +52,15 @@
        */
       public Context getRootContext()
       {
  -		return jndiComponent.getRootContext();
  +        return jndiComponent.getRootContext();
       }
   
       /**
        * @see org.apache.jetspeed.cps.jndi.JNDIService#bindToCurrentThread()
        */
       public void bindToCurrentThread() throws NamingException
  -    {		 
  -		jndiComponent.bindToCurrentThread();
  +    {
  +        jndiComponent.bindToCurrentThread();
       }
   
       /** 
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message