cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: cocoon-2.1/src/blocks/ojb/java/org/apache/cocoon/ojb/broker/components PBFactory.java PBFactoryImpl.java
Date Fri, 25 Jun 2004 14:49:56 GMT
cziegeler    2004/06/25 07:49:56

  Modified:    src/blocks/ojb/java/org/apache/cocoon/ojb/odmg/components
                        OdmgImplementationImpl.java OdmgImplementation.java
               src/blocks/ojb/java/org/apache/cocoon/ojb/components
                        AbstractOjbImpl.java
                        ConnectionFactoryAvalonDataSource.java
               src/blocks/ojb/java/org/apache/cocoon/ojb/jdo/components
                        JdoPMF.java JdoPMFImpl.java
               src/blocks/ojb/java/org/apache/cocoon/ojb/broker/components
                        PBFactory.java PBFactoryImpl.java
  Log:
  Just a little cleanup
  
  Revision  Changes    Path
  1.4       +7 -23     cocoon-2.1/src/blocks/ojb/java/org/apache/cocoon/ojb/odmg/components/OdmgImplementationImpl.java
  
  Index: OdmgImplementationImpl.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/ojb/java/org/apache/cocoon/ojb/odmg/components/OdmgImplementationImpl.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- OdmgImplementationImpl.java	5 Mar 2004 13:02:02 -0000	1.3
  +++ OdmgImplementationImpl.java	25 Jun 2004 14:49:56 -0000	1.4
  @@ -19,11 +19,6 @@
   import java.util.Iterator;
   import java.util.Set;
   
  -import org.apache.avalon.framework.activity.Disposable;
  -import org.apache.avalon.framework.activity.Initializable;
  -import org.apache.avalon.framework.configuration.Configurable;
  -import org.apache.avalon.framework.configuration.Configuration;
  -import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.thread.ThreadSafe;
   import org.apache.cocoon.ojb.components.AbstractOjbImpl;
   import org.apache.ojb.odmg.OJB;
  @@ -40,7 +35,7 @@
    */
   public class OdmgImplementationImpl
       extends AbstractOjbImpl
  -    implements OdmgImplementation, Configurable, Initializable, Disposable, ThreadSafe
{
  +    implements OdmgImplementation, ThreadSafe {
   
       private final static String DEFAULT_CONNECTION ="default";
       private final static int DEFAULT_MODE = Database.OPEN_READ_WRITE;
  @@ -49,16 +44,6 @@
       private Hashtable databases = new Hashtable();
       
       /*  (non-Javadoc)
  -     * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration)
  -     */
  -    public void configure(Configuration myconf)
  -        throws ConfigurationException {
  -        if (this.getLogger().isDebugEnabled()) {
  -            this.getLogger().debug("OJB-ODMG: configuration");
  -        }
  -    }
  -
  -    /*  (non-Javadoc)
        * @see org.apache.avalon.framework.activity.Disposable#dispose()
        */
       public void dispose() {
  @@ -108,7 +93,7 @@
        */
       public Implementation getInstance() throws ODMGException {
           Database db = (Database)this.databases.get( DEFAULT_CONNECTION );
  -        if(null == db ) {
  +        if (null == db ) {
               db = this.odmg.newDatabase();
               db.open(DEFAULT_CONNECTION, DEFAULT_MODE);
               synchronized (this.databases) {
  @@ -123,7 +108,7 @@
        */
       public Implementation getInstance(String connection, int mode) throws ODMGException
{
           Database db = (Database)this.databases.get( connection + mode);
  -        if(null == db ) {
  +        if (null == db ) {
               db = this.odmg.newDatabase();
               db.open(connection, mode);
               synchronized (this.databases) {
  @@ -138,7 +123,7 @@
        */
       public Implementation getInstance(String connection) throws ODMGException {
           Database db = (Database)this.databases.get( connection + DEFAULT_MODE);
  -        if(null == db ) {
  +        if (null == db ) {
               db = this.odmg.newDatabase();
               db.open(connection, DEFAULT_MODE);
               synchronized (this.databases) {
  @@ -150,10 +135,9 @@
       /* (non-Javadoc)
        * @see org.apache.cocoon.ojb.odmg.components.OdmgImplementation#getInstance(int)
        */
  -    public Implementation getInstance( int mode ) throws ODMGException 
  -    {
  +    public Implementation getInstance( int mode ) throws ODMGException  {
           Database db = (Database)this.databases.get( DEFAULT_CONNECTION+ mode);
  -        if(null == db ) {
  +        if (null == db ) {
               db = this.odmg.newDatabase();
               db.open(DEFAULT_CONNECTION, mode);
               synchronized (this.databases) {
  
  
  
  1.3       +3 -3      cocoon-2.1/src/blocks/ojb/java/org/apache/cocoon/ojb/odmg/components/OdmgImplementation.java
  
  Index: OdmgImplementation.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/ojb/java/org/apache/cocoon/ojb/odmg/components/OdmgImplementation.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- OdmgImplementation.java	5 Mar 2004 13:02:02 -0000	1.2
  +++ OdmgImplementation.java	25 Jun 2004 14:49:56 -0000	1.3
  @@ -26,8 +26,8 @@
    * @author <a href="mailto:giacomo@apache.org">Giacomo Pati</a>
    * @version CVS $Id$
    */
  -public interface OdmgImplementation
  -    extends Component {
  +public interface OdmgImplementation extends Component {
  +
       /** The ROLE */
       String ROLE = OdmgImplementation.class.getName();
   
  
  
  
  1.3       +4 -3      cocoon-2.1/src/blocks/ojb/java/org/apache/cocoon/ojb/components/AbstractOjbImpl.java
  
  Index: AbstractOjbImpl.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/ojb/java/org/apache/cocoon/ojb/components/AbstractOjbImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractOjbImpl.java	5 Mar 2004 13:02:01 -0000	1.2
  +++ AbstractOjbImpl.java	25 Jun 2004 14:49:56 -0000	1.3
  @@ -34,6 +34,7 @@
   public class AbstractOjbImpl
       extends AbstractLogEnabled
       implements Initializable, Disposable, Serviceable {
  +    
       /** The <code>ServiceManager</code> instance */
       protected ServiceManager manager;
   
  @@ -41,7 +42,7 @@
        * @see org.apache.avalon.framework.activity.Initializable#initialize()
        */
       public void initialize()
  -        throws Exception {
  +    throws Exception {
           ConnectionFactoryAvalonDataSource.initialize(this.manager);
       }
   
  @@ -56,7 +57,7 @@
        * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
        */
       public void service(final ServiceManager manager)
  -        throws ServiceException {
  +    throws ServiceException {
           this.manager = manager;
       }
   }
  
  
  
  1.4       +4 -3      cocoon-2.1/src/blocks/ojb/java/org/apache/cocoon/ojb/components/ConnectionFactoryAvalonDataSource.java
  
  Index: ConnectionFactoryAvalonDataSource.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/ojb/java/org/apache/cocoon/ojb/components/ConnectionFactoryAvalonDataSource.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ConnectionFactoryAvalonDataSource.java	5 Mar 2004 13:02:02 -0000	1.3
  +++ ConnectionFactoryAvalonDataSource.java	25 Jun 2004 14:49:56 -0000	1.4
  @@ -38,6 +38,7 @@
    */
   public class ConnectionFactoryAvalonDataSource
       implements ConnectionFactory {
  +    
       /** The <code>ServiceManager</code> to be used */
       private static ServiceManager manager;
   
  @@ -54,7 +55,7 @@
        * @throws ServiceException In case we cannot obtain a DataSource
        */
       public static void initialize(final ServiceManager serviceManager)
  -        throws ServiceException {
  +    throws ServiceException {
           ConnectionFactoryAvalonDataSource.manager = serviceManager;
           ConnectionFactoryAvalonDataSource.dbselector =
               (ServiceSelector)ConnectionFactoryAvalonDataSource.manager.lookup(DataSourceComponent.ROLE
+
  @@ -72,7 +73,7 @@
        * @see org.apache.ojb.broker.accesslayer.ConnectionFactory#lookupConnection(org.apache.ojb.broker.metadata.JdbcConnectionDescriptor)
        */
       public Connection lookupConnection(final JdbcConnectionDescriptor conDesc)
  -        throws LookupException {
  +    throws LookupException {
           if (null == ConnectionFactoryAvalonDataSource.manager) {
               throw new LookupException("ServiceManager was not set!");
           }
  
  
  
  1.3       +6 -5      cocoon-2.1/src/blocks/ojb/java/org/apache/cocoon/ojb/jdo/components/JdoPMF.java
  
  Index: JdoPMF.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/ojb/java/org/apache/cocoon/ojb/jdo/components/JdoPMF.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JdoPMF.java	5 Mar 2004 13:02:02 -0000	1.2
  +++ JdoPMF.java	25 Jun 2004 14:49:56 -0000	1.3
  @@ -15,9 +15,10 @@
    */
   package org.apache.cocoon.ojb.jdo.components;
   
  -import org.apache.avalon.framework.component.Component;
   import javax.jdo.PersistenceManager;
   
  +import org.apache.avalon.framework.component.Component;
  +
   /**
    *  Interface of the JDO Persistent Manager Factory.
    * It is used to get the Persistence Manager to interact with JDO using OJB
  @@ -25,12 +26,12 @@
    * @author <a href="mailto:antonio@apache.org">Antonio Gallardo</a>
    * @version CVS $Id$
   */
  -public interface JdoPMF extends Component
  -{
  +public interface JdoPMF extends Component {
  +    
       String ROLE = JdoPMF.class.getName();
   	
       /**
       * get a Persitence Manager.
   	*/
  -    public PersistenceManager getPersistenceManager();
  +    PersistenceManager getPersistenceManager();
   }
  
  
  
  1.6       +17 -33    cocoon-2.1/src/blocks/ojb/java/org/apache/cocoon/ojb/jdo/components/JdoPMFImpl.java
  
  Index: JdoPMFImpl.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/ojb/java/org/apache/cocoon/ojb/jdo/components/JdoPMFImpl.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JdoPMFImpl.java	5 Mar 2004 13:02:02 -0000	1.5
  +++ JdoPMFImpl.java	25 Jun 2004 14:49:56 -0000	1.6
  @@ -18,11 +18,6 @@
   import javax.jdo.PersistenceManager;
   import javax.jdo.PersistenceManagerFactory;
   
  -import org.apache.avalon.framework.activity.Disposable;
  -import org.apache.avalon.framework.activity.Initializable;
  -import org.apache.avalon.framework.configuration.Configurable;
  -import org.apache.avalon.framework.configuration.Configuration;
  -import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.thread.ThreadSafe;
   import org.apache.cocoon.ojb.components.AbstractOjbImpl;
   import org.apache.ojb.jdori.sql.OjbStorePMF;
  @@ -33,52 +28,41 @@
    * @author <a href="mailto:antonio@apache.org">Antonio Gallardo</a>
    * @version CVS $Id$
   */
  -public class JdoPMFImpl extends AbstractOjbImpl implements JdoPMF, Configurable, Initializable,
  -Disposable, ThreadSafe
  -{
  -	protected PersistenceManagerFactory factory = null;
  +public class JdoPMFImpl 
  +    extends AbstractOjbImpl 
  +    implements JdoPMF, ThreadSafe {
  +    
  +	protected PersistenceManagerFactory factory;
   	
       /* (non-Javadoc)
  -     * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration)
  -     */
  -    public void configure(Configuration myconf) throws ConfigurationException
  -    {
  -		if (this.getLogger().isDebugEnabled())
  -			this.getLogger().debug("OJB-JDO: configuration");
  -    }
  -
  -    /* (non-Javadoc)
        * @see org.apache.avalon.framework.activity.Disposable#dispose()
        */
  -    public void dispose()
  -    {
  +    public void dispose() {
           super.dispose();
  -		if (this.getLogger().isDebugEnabled())
  +		if (this.getLogger().isDebugEnabled()) {
   			this.getLogger().debug("OJB-JDO: Disposed OK!");
  +        }
       }
   
   	/* (non-Javadoc)
   	 * @see org.apache.cocoon.ojb.jdori.components.JdoPMF#getPersistenceManager()
   	 */
  -	public PersistenceManager getPersistenceManager()
  -	{
  +	public PersistenceManager getPersistenceManager() {
   		return factory.getPersistenceManager();
   	}
  +    
   	/* (non-Javadoc)
   	 * @see org.apache.avalon.framework.activity.Initializable#initialize()
   	 */
  -	public void initialize() throws Exception
  -	{
  +	public void initialize() throws Exception {
           super.initialize();
  -		try
  -		{
  +		try	{
   			// Create the factory
   			factory = new OjbStorePMF();
  -			if (this.getLogger().isDebugEnabled())
  -						this.getLogger().debug("OJB-JDO: Started OK!");
  -		}
  -		catch (Throwable t)
  -		{
  +			if (this.getLogger().isDebugEnabled()) {
  +                this.getLogger().debug("OJB-JDO: Started OK!");
  +            }
  +		} catch (Throwable t){
   			if (this.getLogger().isFatalErrorEnabled()) {
   				this.getLogger().fatalError("OJB-JDO: Started failed: Cannot create a Persistence Manager
Factory.",t);
   			}
  
  
  
  1.3       +6 -6      cocoon-2.1/src/blocks/ojb/java/org/apache/cocoon/ojb/broker/components/PBFactory.java
  
  Index: PBFactory.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/ojb/java/org/apache/cocoon/ojb/broker/components/PBFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PBFactory.java	5 Mar 2004 13:02:01 -0000	1.2
  +++ PBFactory.java	25 Jun 2004 14:49:56 -0000	1.3
  @@ -28,8 +28,8 @@
    * @author <a href="mailto:antonio@apache.org">Antonio Gallardo</a>
    * @version CVS $Id$
   */
  -public interface PBFactory extends Component
  -{
  +public interface PBFactory extends Component {
  +    
       /**
        * The <code>ROLE</code>
        */
  @@ -40,7 +40,7 @@
        * @return a PersistenceBroker Object
        * @throws PBFactoryException - If the operation failed.
        */
  -    public PersistenceBroker defaultPersistenceBroker()
  +    PersistenceBroker defaultPersistenceBroker()
           throws PBFactoryException;
       
       /**
  @@ -53,7 +53,7 @@
        * @return a PersistenceBroker Object
        * @throws PBFactoryException - If the operation failed.
        */
  -    public PersistenceBroker createPersistenceBroker(String jcdAlias,
  +    PersistenceBroker createPersistenceBroker(String jcdAlias,
               String user, String password) throws PBFactoryException;
       
       /**
  @@ -62,6 +62,6 @@
        * @return a PersistenceBroker Object
        * @throws PBFactoryException - If the operation failed.
        */
  -    public PersistenceBroker createPersistenceBroker(PBKey key)
  +    PersistenceBroker createPersistenceBroker(PBKey key)
           throws PBFactoryException;
   }
  
  
  
  1.4       +6 -16     cocoon-2.1/src/blocks/ojb/java/org/apache/cocoon/ojb/broker/components/PBFactoryImpl.java
  
  Index: PBFactoryImpl.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/ojb/java/org/apache/cocoon/ojb/broker/components/PBFactoryImpl.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PBFactoryImpl.java	23 Mar 2004 19:21:33 -0000	1.3
  +++ PBFactoryImpl.java	25 Jun 2004 14:49:56 -0000	1.4
  @@ -15,11 +15,6 @@
    */
   package org.apache.cocoon.ojb.broker.components;
   
  -import org.apache.avalon.framework.activity.Disposable;
  -import org.apache.avalon.framework.activity.Initializable;
  -import org.apache.avalon.framework.configuration.Configurable;
  -import org.apache.avalon.framework.configuration.Configuration;
  -import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.thread.ThreadSafe;
   import org.apache.cocoon.ojb.components.AbstractOjbImpl;
   import org.apache.ojb.broker.PBFactoryException;
  @@ -33,23 +28,18 @@
    * @author <a href="mailto:antonio@apache.org">Antonio Gallardo</a>
    * @version CVS $Id$
   */
  -public class PBFactoryImpl extends AbstractOjbImpl implements PBFactory, Configurable,
Initializable, Disposable, ThreadSafe {
  +public class PBFactoryImpl 
  +extends AbstractOjbImpl 
  +implements PBFactory, ThreadSafe {
   	
       /* (non-Javadoc)
  -     * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration)
  -     */
  -    public void configure(Configuration myconf) throws ConfigurationException {
  -        if (this.getLogger().isDebugEnabled())
  -            this.getLogger().debug("OJB-JDO: configuration");
  -    }
  -
  -    /* (non-Javadoc)
        * @see org.apache.avalon.framework.activity.Disposable#dispose()
        */
       public void dispose() {
           super.dispose();
  -        if (this.getLogger().isDebugEnabled())
  +        if (this.getLogger().isDebugEnabled()) {
               this.getLogger().debug("OJB-PB: Disposed OK!");
  +        }
       }
   
       /* (non-Javadoc)
  
  
  

Mime
View raw message