001: /*
002: * Copyright 1999,2004 The Apache Software Foundation.
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016:
017: package org.apache.catalina.deploy;
018:
019: import java.io.Serializable;
020:
021: /**
022: * Representation of a resource reference for a web application, as
023: * represented in a <code><resource-ref></code> element in the
024: * deployment descriptor.
025: *
026: * @author Craig R. McClanahan
027: * @version $Revision: 1.4 $ $Date: 2004/05/13 20:40:49 $
028: */
029:
030: public class ContextResource implements Serializable {
031:
032: // ------------------------------------------------------------- Properties
033:
034: /**
035: * The authorization requirement for this resource
036: * (<code>Application</code> or <code>Container</code>).
037: */
038: private String auth = null;
039:
040: public String getAuth() {
041: return (this .auth);
042: }
043:
044: public void setAuth(String auth) {
045: this .auth = auth;
046: }
047:
048: /**
049: * The description of this resource.
050: */
051: private String description = null;
052:
053: public String getDescription() {
054: return (this .description);
055: }
056:
057: public void setDescription(String description) {
058: this .description = description;
059: }
060:
061: /**
062: * The name of this resource.
063: */
064: private String name = null;
065:
066: public String getName() {
067: return (this .name);
068: }
069:
070: public void setName(String name) {
071: this .name = name;
072: }
073:
074: /**
075: * The sharing scope of this resource factory (<code>Shareable</code>
076: * or <code>Unshareable</code>).
077: */
078: private String scope = "Shareable";
079:
080: public String getScope() {
081: return (this .scope);
082: }
083:
084: public void setScope(String scope) {
085: this .scope = scope;
086: }
087:
088: /**
089: * The type of this resource.
090: */
091: private String type = null;
092:
093: public String getType() {
094: return (this .type);
095: }
096:
097: public void setType(String type) {
098: this .type = type;
099: }
100:
101: // --------------------------------------------------------- Public Methods
102:
103: /**
104: * Return a String representation of this object.
105: */
106: public String toString() {
107:
108: StringBuffer sb = new StringBuffer("ContextResource[");
109: sb.append("name=");
110: sb.append(name);
111: if (description != null) {
112: sb.append(", description=");
113: sb.append(description);
114: }
115: if (type != null) {
116: sb.append(", type=");
117: sb.append(type);
118: }
119: if (auth != null) {
120: sb.append(", auth=");
121: sb.append(auth);
122: }
123: if (scope != null) {
124: sb.append(", scope=");
125: sb.append(scope);
126: }
127: sb.append("]");
128: return (sb.toString());
129:
130: }
131:
132: // -------------------------------------------------------- Package Methods
133:
134: /**
135: * The NamingResources with which we are associated (if any).
136: */
137: protected NamingResources resources = null;
138:
139: public NamingResources getNamingResources() {
140: return (this .resources);
141: }
142:
143: void setNamingResources(NamingResources resources) {
144: this.resources = resources;
145: }
146:
147: }
|