portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sg...@apache.org
Subject cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/services/urlmanager JetspeedURLManagerService.java
Date Wed, 19 Feb 2003 12:42:57 GMT
sgala       2003/02/19 04:42:57

  Modified:    src/java/org/apache/jetspeed/services/urlmanager Tag:
                        jetspeed_13a3 JetspeedURLManagerService.java
  Log:
  Can potentially throw an exception on Servlet unload. Protected. More changes in initialization,
untested in HEAD, needed here.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.13.4.1  +27 -16    jakarta-jetspeed/src/java/org/apache/jetspeed/services/urlmanager/JetspeedURLManagerService.java
  
  Index: JetspeedURLManagerService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/urlmanager/JetspeedURLManagerService.java,v
  retrieving revision 1.13
  retrieving revision 1.13.4.1
  diff -u -r1.13 -r1.13.4.1
  --- JetspeedURLManagerService.java	1 May 2002 04:39:34 -0000	1.13
  +++ JetspeedURLManagerService.java	19 Feb 2003 12:42:57 -0000	1.13.4.1
  @@ -56,6 +56,7 @@
   
   import org.apache.turbine.util.Log;
   import org.apache.turbine.services.TurbineBaseService;
  +import org.apache.turbine.services.InitializationException;
   import org.apache.jetspeed.services.resources.JetspeedResources;
   //import org.apache.turbine.util.Configurations;
   //import org.apache.turbine.util.ExtendedProperties;
  @@ -100,17 +101,18 @@
       /**
        * Late init. Don't return control until early init says we're done.
        */
  -    public void init( )
  -    {
  -        while( !getInit() ) {
  -            try {
  -                Thread.sleep(500);
  -            } catch (InterruptedException ie ) {
  -                Log.info("URLManager service: Waiting for init()..." );
  -            }
  -        }
  +    //public void init( )
  +    //{
  +        //while( !getInit() ) {
  +        //    try {
  +        //        Thread.sleep(500);
  +        //        Log.info("URLManager service: Waiting for init()..." );
  +        //    } catch (InterruptedException ie ) {
  +        //        Log.info("URLManager service: Waiting for init()..." );
  +        //    }
  +        //}
   
  -    }
  +    //}
   
   
       
  @@ -120,10 +122,13 @@
        * @param config A ServletConfig.
        */
       public synchronized void init( ServletConfig config )
  +        throws InitializationException
       {
           //We have already been initialized...
           if( getInit() ) return;
   
  +        super.init(config);
  +
           try
           {
               Log.info ( "JetspeedURLManagerService early init()....starting!");
  @@ -183,14 +188,17 @@
               }
   
               load();
  -            Log.info ( "JetspeedURLManagerService early init()....finished!");
           }
           catch (Throwable t)
           {
               Log.error ( "Cannot initialize JetspeedURLManagerService!" );
               Log.error (t);
           }
  -        setInit(true);
  +        finally
  +        {
  +            Log.info ( "JetspeedURLManagerService early init()....finished!");
  +            setInit(true);
  +        }
   
       }
   
  @@ -426,11 +434,14 @@
                       entryNum++;
                   }
               }
  -        } catch ( IOException e ) {
  +        } catch ( Throwable t ) {
               Log.error( "Impossible to save URLManager state to "+path );
  -            Log.error( e );
  +            Log.error( t );
           } finally {
  -            pw.close();
  +            if( pw != null )
  +            {
  +                pw.close();
  +            }
           }
       }
   
  
  
  

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