KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > catalina > deploy > ContextTransaction


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17
18
19 package org.apache.catalina.deploy;
20
21 import java.io.Serializable JavaDoc;
22 import java.util.HashMap JavaDoc;
23 import java.util.Iterator JavaDoc;
24
25
26 /**
27  * Representation of an application resource reference, as represented in
28  * an <code>&lt;res-env-refy&gt;</code> element in the deployment descriptor.
29  *
30  * @author Craig R. McClanahan
31  * @version $Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $
32  */

33
34 public class ContextTransaction implements Serializable JavaDoc {
35
36
37     // ------------------------------------------------------------- Properties
38

39
40     /**
41      * Holder for our configured properties.
42      */

43     private HashMap JavaDoc properties = new HashMap JavaDoc();
44
45     /**
46      * Return a configured property.
47      */

48     public Object JavaDoc getProperty(String JavaDoc name) {
49         return properties.get(name);
50     }
51
52     /**
53      * Set a configured property.
54      */

55     public void setProperty(String JavaDoc name, Object JavaDoc value) {
56         properties.put(name, value);
57     }
58
59     /**
60      * remove a configured property.
61      */

62     public void removeProperty(String JavaDoc name) {
63         properties.remove(name);
64     }
65
66     /**
67      * List properties.
68      */

69     public Iterator JavaDoc listProperties() {
70         return properties.keySet().iterator();
71     }
72     
73     
74     // --------------------------------------------------------- Public Methods
75

76
77     /**
78      * Return a String representation of this object.
79      */

80     public String JavaDoc toString() {
81
82         StringBuffer JavaDoc sb = new StringBuffer JavaDoc("Transaction[");
83         sb.append("]");
84         return (sb.toString());
85
86     }
87
88
89     // -------------------------------------------------------- Package Methods
90

91
92     /**
93      * The NamingResources with which we are associated (if any).
94      */

95     protected NamingResources resources = null;
96
97     public NamingResources getNamingResources() {
98         return (this.resources);
99     }
100
101     void setNamingResources(NamingResources resources) {
102         this.resources = resources;
103     }
104
105
106 }
107
Popular Tags