avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/datasource/src/java/org/apache/avalon/excalibur/datasource/ids AbstractDataSourceIdGenerator.java
Date Thu, 07 Nov 2002 05:20:41 GMT
donaldp     2002/11/06 21:20:41

  Modified:    datasource/src/java/org/apache/avalon/excalibur/datasource/ids
                        AbstractDataSourceIdGenerator.java
  Log:
  Composaeable->Serviceable.
  
  Revision  Changes    Path
  1.4       +12 -16    jakarta-avalon-excalibur/datasource/src/java/org/apache/avalon/excalibur/datasource/ids/AbstractDataSourceIdGenerator.java
  
  Index: AbstractDataSourceIdGenerator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/datasource/src/java/org/apache/avalon/excalibur/datasource/ids/AbstractDataSourceIdGenerator.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AbstractDataSourceIdGenerator.java	2 Sep 2002 12:38:29 -0000	1.3
  +++ AbstractDataSourceIdGenerator.java	7 Nov 2002 05:20:41 -0000	1.4
  @@ -9,16 +9,16 @@
   
   import java.sql.Connection;
   import java.sql.SQLException;
  -import java.sql.Statement;
   import org.apache.avalon.excalibur.datasource.DataSourceComponent;
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.activity.Initializable;
  -import org.apache.avalon.framework.component.ComponentManager;
  -import org.apache.avalon.framework.component.ComponentSelector;
  -import org.apache.avalon.framework.component.Composable;
   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.service.ServiceException;
  +import org.apache.avalon.framework.service.ServiceManager;
  +import org.apache.avalon.framework.service.ServiceSelector;
  +import org.apache.avalon.framework.service.Serviceable;
   import org.apache.avalon.framework.thread.ThreadSafe;
   
   /**
  @@ -28,13 +28,10 @@
    */
   public abstract class AbstractDataSourceIdGenerator
       extends AbstractIdGenerator
  -    implements IdGenerator, Composable, Configurable, Initializable, Disposable, ThreadSafe
  +    implements IdGenerator, Serviceable, Configurable, Initializable, Disposable, ThreadSafe
   {
  -    /** ComponentLocator which created this component */
  -    protected ComponentManager m_manager;
  -
       private String m_dataSourceName;
  -    private ComponentSelector m_dbSelector;
  +    private ServiceSelector m_dbSelector;
       protected DataSourceComponent m_dataSource;
   
       /**
  @@ -74,11 +71,13 @@
        * Called by the Container to tell the component which ComponentLocator
        *  is controlling it.
        *
  -     * @param ComponentLocator which curently owns the component.
  +     * @param manager which curently owns the component.
  +     * @avalon.service interface="org.apache.avalon.excalibur.datasource.DataSourceComponentSelector"
        */
  -    public void compose( ComponentManager manager )
  +    public void service( final ServiceManager manager )
  +        throws ServiceException
       {
  -        m_manager = manager;
  +        m_dbSelector = (ServiceSelector)manager.lookup( DataSourceComponent.ROLE + "Selector"
);
       }
   
       /*---------------------------------------------------------------
  @@ -113,7 +112,6 @@
           throws Exception
       {
           // Get a reference to a data source
  -        m_dbSelector = (ComponentSelector)m_manager.lookup( DataSourceComponent.ROLE +
"Selector" );
           m_dataSource = (DataSourceComponent)m_dbSelector.select( m_dataSourceName );
       }
   
  @@ -134,8 +132,6 @@
   
                   m_dataSource = null;
               }
  -
  -            m_manager.release( m_dbSelector );
   
               m_dbSelector = null;
           }
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message