You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by jv...@apache.org on 2001/06/14 16:38:40 UTC

cvs commit: jakarta-turbine/src/java/org/apache/turbine/services/castor TurbineCastorService.java

jvanzyl     01/06/14 07:38:40

  Modified:    src/java/org/apache/turbine/services/castor
                        TurbineCastorService.java
  Log:
  - updating service as per notes.
  
  Revision  Changes    Path
  1.8       +11 -20    jakarta-turbine/src/java/org/apache/turbine/services/castor/TurbineCastorService.java
  
  Index: TurbineCastorService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/castor/TurbineCastorService.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TurbineCastorService.java	2001/04/08 16:41:07	1.7
  +++ TurbineCastorService.java	2001/06/14 14:38:40	1.8
  @@ -54,7 +54,6 @@
    * <http://www.apache.org/>.
    */
   
  -// Java Stuff
   import java.io.File;
   import java.io.FileNotFoundException;
   import java.io.FileReader;
  @@ -63,9 +62,6 @@
   import java.io.PrintWriter;
   import java.sql.Timestamp;
   import java.util.Enumeration;
  -import java.util.Properties;
  -
  -// Castor Stuff
   import org.exolab.castor.jdo.Database;
   import org.exolab.castor.jdo.DatabaseNotFoundException;
   import org.exolab.castor.jdo.JDO;
  @@ -75,13 +71,8 @@
   import org.exolab.castor.jdo.TransactionNotInProgressException;
   import org.exolab.castor.mapping.MappingException;
   import org.exolab.castor.util.Logger;
  -
  -// Turbine Stuff
  -import org.apache.turbine.services.TurbineBaseService;
  +import org.apache.turbine.services.BaseService;
   import org.apache.turbine.services.InitializationException;
  -import org.apache.turbine.util.Log;
  -
  -// SAX Stuff
   import org.xml.sax.EntityResolver;
   import org.xml.sax.InputSource;
   
  @@ -124,10 +115,10 @@
    *
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
    * @author <a href="mailto:celkins@scardini.com">Christopher Elkins</a>
  - * @version $Id: TurbineCastorService.java,v 1.7 2001/04/08 16:41:07 ilkka Exp $
  + * @version $Id: TurbineCastorService.java,v 1.8 2001/06/14 14:38:40 jvanzyl Exp $
    */
   public class TurbineCastorService
  -    extends TurbineBaseService
  +    extends BaseService
       implements CastorService
   {
       /**
  @@ -158,7 +149,8 @@
           }
           catch (Exception e)
           {
  -            throw new InitializationException("TurbineCastorService failed to initalize", e);
  +            throw new InitializationException(
  +                "TurbineCastorService failed to initalize", e);
           }
       }
   
  @@ -176,30 +168,29 @@
                  MappingException,
                  Exception
       {
  -        Properties props = getProperties();
  -
  -        String logprefix = props.getProperty (LOGPREFIX_PROPERTY);
  +        String logprefix = getConfiguration().getString (LOGPREFIX_PROPERTY);
           if (logprefix == null)
           {
               logprefix = DEFAULT_LOGPREFIX;
           }
  -        String logfile = props.getProperty (LOGFILE_PROPERTY);
  +        
  +        String logfile = getConfiguration().getString (LOGFILE_PROPERTY);
           if (logfile == null)
           {
  -            Log.warn ("CastorService no LogFile property specified");
  +            getCategory().warn ("CastorService no LogFile property specified");
           }
           else
           {
               logger = new Logger (new FileWriter (logfile)).setPrefix(logprefix);
           }
   
  -        databasename = props.getProperty (DATABASENAME_PROPERTY);
  +        databasename = getConfiguration().getString (DATABASENAME_PROPERTY);
           if (databasename == null)
           {
               throw new Exception ("TurbineCastor: missing databasename propertiy");
           }
   
  -        databasefile = props.getProperty (DATABASEFILE_PROPERTY);
  +        databasefile = getConfiguration().getString (DATABASEFILE_PROPERTY);
           if (databasefile == null)
           {
               throw new Exception ("TurbineCastor: missing databasefile propertiy");
  
  
  

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