unico       2003/11/21 03:39:18

  Modified:    
src/blocks/repository/java/org/apache/cocoon/components/source/impl
                        SimpleJdbcSourceDescriptor.java
  Log:
  remove redundant disposable stage
  
  Revision  Changes    Path
  1.4       +4 -9      
cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/components/source/impl/SimpleJdbcSourceDescriptor.java
  
  Index: SimpleJdbcSourceDescriptor.java
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/components/source/impl/SimpleJdbcSourceDescriptor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SimpleJdbcSourceDescriptor.java   31 Oct 2003 12:49:06 -0000      1.3
  +++ SimpleJdbcSourceDescriptor.java   21 Nov 2003 11:39:18 -0000      1.4
  @@ -58,7 +58,6 @@
   import java.util.List;
   
   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.configuration.Configurable;
   import org.apache.avalon.framework.configuration.Configuration;
  @@ -107,7 +106,7 @@
    */
   public class SimpleJdbcSourceDescriptor
       extends AbstractConfigurableSourceDescriptor
  -    implements SourceDescriptor, Serviceable, Configurable, Initializable, 
Disposable, ThreadSafe {
  +    implements SourceDescriptor, Serviceable, Configurable, Initializable, 
ThreadSafe {
       
       
       private static final String STMT_SELECT_SINGLE =
  @@ -139,9 +138,8 @@
       public void service(ServiceManager manager) throws ServiceException {
           m_manager = manager;
           m_resolver = (SourceResolver) manager.lookup(SourceResolver.ROLE);
  -        Cache cache = (Cache) manager.lookup(Cache.ROLE + "/EventAware");
  -        if (cache instanceof EventAware) {
  -            m_cache = (EventAware) cache;
  +        if (manager.hasService(Cache.ROLE + "/EventAware")) {
  +            m_cache = (EventAware) manager.lookup(Cache.ROLE + 
"/EventAware");
           } else {
               getLogger().warn("EventAware cache was not found: sources won't 
be cacheable.");
           }
  @@ -153,7 +151,7 @@
        * <ul>
        *  <li>element <code>property</code> (multiple,required) 
        *      - define a property that this store should handle.</li>
  -     *  <li>element <code>datasource</code> (single,required) 
  +     *  <li>element <code>datasource</code> (single,optional,[cocoondb]) 
        *      - the name of the excalibur datasource to use.</li>
        * </ul>
        */
  @@ -174,9 +172,6 @@
           ServiceSelector datasources = (ServiceSelector) m_manager.lookup(
               DataSourceComponent.ROLE + "Selector");
           m_datasource = (DataSourceComponent) 
datasources.select(m_datasourceName);
  -    }
  -    
  -    public void dispose() {
       }
       
       // ---------------------------------------------------- SourceInspection
  
  
  

Reply via email to