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/cluster AbstractDataSourceCluster.java
Date Thu, 07 Nov 2002 05:25:56 GMT
donaldp     2002/11/06 21:25:55

  Modified:    datasource/src/java/org/apache/avalon/excalibur/datasource/cluster
                        AbstractDataSourceCluster.java
  Log:
  Convert to Serviceable
  
  Revision  Changes    Path
  1.4       +12 -16    jakarta-avalon-excalibur/datasource/src/java/org/apache/avalon/excalibur/datasource/cluster/AbstractDataSourceCluster.java
  
  Index: AbstractDataSourceCluster.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/datasource/src/java/org/apache/avalon/excalibur/datasource/cluster/AbstractDataSourceCluster.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AbstractDataSourceCluster.java	5 Nov 2002 04:34:02 -0000	1.3
  +++ AbstractDataSourceCluster.java	7 Nov 2002 05:25:55 -0000	1.4
  @@ -13,9 +13,10 @@
   import org.apache.avalon.excalibur.datasource.NoValidConnectionException;
   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.service.ServiceManager;
  +import org.apache.avalon.framework.service.Serviceable;
  +import org.apache.avalon.framework.service.ServiceSelector;
  +import org.apache.avalon.framework.service.ServiceException;
   import org.apache.avalon.framework.configuration.Configurable;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
  @@ -29,15 +30,11 @@
    */
   public abstract class AbstractDataSourceCluster
       extends AbstractLogEnabled
  -    implements Composable, Configurable, Initializable, Disposable, ThreadSafe
  +    implements Serviceable, Configurable, Initializable, Disposable, ThreadSafe
   {
  -
  -    /** ComponentLocator which created this component */
  -    protected ComponentManager m_manager;
  -
       protected int m_size;
       private String[] m_dataSourceNames;
  -    private ComponentSelector m_dbSelector;
  +    private ServiceSelector m_dbSelector;
       private DataSourceComponent[] m_dataSources;
   
       /*---------------------------------------------------------------
  @@ -89,10 +86,13 @@
        *  is controlling it.
        *
        * @param manager which curently owns the component.
  +     * @avalon.service interface="org.apache.avalon.excalibur.datasource.DataSourceComponentClusterSelector"
        */
  -    public void compose( ComponentManager manager )
  +    public void service( final ServiceManager manager )
  +        throws ServiceException
       {
  -        m_manager = manager;
  +        m_dbSelector =
  +            (ServiceSelector)manager.lookup( DataSourceComponent.ROLE + "ClusterSelector"
);
       }
   
       /*---------------------------------------------------------------
  @@ -155,8 +155,6 @@
       public void initialize() throws Exception
       {
           // Get references to a data sources
  -        m_dbSelector =
  -            (ComponentSelector)m_manager.lookup( DataSourceComponent.ROLE + "ClusterSelector"
);
           m_dataSources = new DataSourceComponent[ m_size ];
           for( int i = 0; i < m_dataSourceNames.length; i++ )
           {
  @@ -187,8 +185,6 @@
   
                   m_dataSources = 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