View Javadoc

1   /**
2    * $Id: BaseResourceImpl.java 17 2006-10-19 15:11:35Z maldito_orco $
3    * $Revision: 17 $
4    * $Date: 2006-10-19 12:11:35 -0300 (Thu, 19 Oct 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.baseimpl;
23  
24  //log
25  import org.apache.commons.logging.Log;
26  import org.apache.commons.logging.LogFactory;
27  //tubo
28  import org.tubo.resource.Resource;
29  import org.tubo.resource.ResourceManager;
30  import org.tubo.exception.TuboException;
31  //util
32  import java.util.Properties;
33  
34  /**
35   * Created: Sep 3, 2006, 10:38:11 AM
36   * Last Modification Date: $Date: 2006-10-19 12:11:35 -0300 (Thu, 19 Oct 2006) $
37   *
38   * @author maldito_orco (maldito_orco@users.sourceforge.net)
39   * @version $Revision: 17 $
40   */
41  public class BaseResourceImpl implements Resource {
42      public static final String RCS_ID = "$Id: BaseResourceImpl.java 17 2006-10-19 15:11:35Z maldito_orco $";
43      private static Log log = LogFactory.getLog(BaseResourceImpl.class);
44  
45      /** Resource ID */
46      private String id = null;
47  
48      /** ResourceManager reference */
49      private ResourceManager resourceManager = null;
50  
51      /** Configuration properties */
52      private Properties properties = new Properties();
53  
54  
55      public String getId() {
56          return id;
57      }
58  
59      public void setId(String id) {
60          this.id = id;
61      }
62  
63      /**
64       * Get for the ResourceManager linked to this Resource
65       * @return the ResourceManager for this Resource
66       */
67      public ResourceManager getResourceManager() {
68          return resourceManager;
69      }
70  
71      /**
72       * Set for the ResourceManager for this Resource
73       * @param resourceManager the ResourceManager for this Resource
74       * @throws org.tubo.exception.TuboException
75       */
76      public void setResourceManager(ResourceManager resourceManager) throws TuboException {
77          this.resourceManager = resourceManager;
78      }
79  
80      public Properties getProperties() { return properties; }
81      public void setProperties(Properties properties) {
82          this.properties = properties;
83      }
84  
85      public String getProperty(String name) {
86          return properties.getProperty(name);
87      }
88  
89      public void setProperty(String name, String value) {
90          properties.setProperty(name,value);
91      }    
92  }