View Javadoc

1   /**
2    * $Id: BaseConsumerManagerImpl.java 82 2006-12-15 21:46:07Z maldito_orco $
3    * $Revision: 82 $
4    * $Date: 2006-12-15 18:46:07 -0300 (Fri, 15 Dec 2006) $
5    *
6    * =========================================================================
7    *
8    * Copyright 2005 Tubo
9    *
10   *  Licensed under the Apache License, Version 2.0 (the "License");
11   *  you may not use this file except in compliance with the License.
12   *  You may obtain a copy of the License at
13   *
14   *     http://www.apache.org/licenses/LICENSE-2.0
15   *
16   *  Unless required by applicable law or agreed to in writing, software
17   *  distributed under the License is distributed on an "AS IS" BASIS,
18   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19   *  See the License for the specific language governing permissions and
20   *  limitations under the License.
21   */
22  package org.tubo.resource.consumer;
23  
24  //log
25  import org.apache.commons.logging.Log;
26  import org.apache.commons.logging.LogFactory;
27  //tubo
28  import org.tubo.resource.baseimpl.BaseManagerImpl;
29  import org.tubo.resource.Resource;
30  import org.tubo.exception.TuboException;
31  
32  /**
33   * <p></p>
34   * <p/>
35   * Created: Sep 3, 2006, 11:38:12 AM <br>
36   * Last Modification Date: $Date: 2006-12-15 18:46:07 -0300 (Fri, 15 Dec 2006) $
37   * </p>
38   *
39   * @author maldito_orco (maldito_orco@users.sourceforge.net)
40   * @version $Revision: 82 $
41   */
42  public class BaseConsumerManagerImpl extends BaseManagerImpl implements ConsumerManager {
43      public static final String RCS_ID = "$Id: BaseConsumerManagerImpl.java 82 2006-12-15 21:46:07Z maldito_orco $";
44      private static Log log = LogFactory.getLog(BaseConsumerManagerImpl.class);
45  
46      ConsumerLoader loader = null;
47  
48      public ConsumerLoader getLoader() { return loader; }
49      public void setLoader(ConsumerLoader loader) {
50          this.loader = loader;
51      }
52  
53  
54      /**
55       * this method is a wrapper than get method, but especialized to Consumer interface.
56       *
57       * @return a Consumer instance
58       * @throws TuboException
59       */
60      public Consumer getConsumer() throws TuboException {
61          Resource resource = get();
62          Consumer consumer = (Consumer)resource;
63          return consumer;
64      }
65  
66      /**
67       * This method load consumers delegating this work to loader instance.
68       */
69      public void load() throws TuboException {
70          loader.load(this);
71      }
72  }