KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > commons > modeler > demo > Connector


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

16
17
18 package org.apache.commons.modeler.demo;
19
20
21 /**
22  * <p>Sample managed object for the Modeler Demonstration Application,
23  * based on the Catalina architecture of Tomcat 4.</p>
24  *
25  * @author Craig R. McClanahan
26  * @version $Revision$ $Date: 2005-02-26 05:12:25 -0800 (Sat, 26 Feb 2005) $
27  */

28
29 public class Connector {
30
31
32     // ----------------------------------------------------------- Constructors
33

34
35     /**
36      * Construct a default instance of this class.
37      */

38     public Connector() {
39
40         super();
41
42     }
43
44
45     /**
46      * Construct a configured instance of this class.
47      *
48      * @param port Port number
49      * @param scheme Protocol (scheme)
50      * @param secure Secure flag
51      * @param service Associated service
52      * @param container Associated container
53      */

54     public Connector(int port, String JavaDoc scheme, boolean secure,
55                      Service service, Container container) {
56
57         super();
58         setPort(port);
59         setScheme(scheme);
60         setSecure(secure);
61         setService(service);
62         setContainer(container);
63
64     }
65
66
67     // ----------------------------------------------------- Instance Variables
68

69
70     // ------------------------------------------------------------- Properties
71

72
73     /**
74      * The Container for this Connector.
75      */

76     private Container container = null;
77
78     public Container getContainer() {
79         return (this.container);
80     }
81
82     public void setContainer(Container container) {
83         this.container = container;
84     }
85
86
87     /**
88      * The port number of this Connector.
89      */

90     private int port = 8080;
91
92     public int getPort() {
93         return (this.port);
94     }
95
96     public void setPort(int port) {
97         this.port = port;
98     }
99
100
101     /**
102      * The scheme of this Connector.
103      */

104     private String JavaDoc scheme = "http";
105
106     public String JavaDoc getScheme() {
107         return (this.scheme);
108     }
109
110     public void setScheme(String JavaDoc scheme) {
111         this.scheme = scheme;
112     }
113
114
115     /**
116      * The secure flag of this Connector.
117      */

118     private boolean secure = false;
119
120     public boolean getSecure() {
121         return (this.secure);
122     }
123
124     public void setSecure(boolean secure) {
125         this.secure = secure;
126     }
127
128
129     /**
130      * The associated Service of this Connector.
131      */

132     private Service service = null;
133
134     public Service getService() {
135         return (this.service);
136     }
137
138     public void setService(Service service) {
139         this.service = service;
140     }
141
142
143     /**
144      * Return a String representation of this object.
145      */

146     public String JavaDoc toString() {
147
148         StringBuffer JavaDoc sb = new StringBuffer JavaDoc("Connector[");
149         sb.append("port=");
150         sb.append(port);
151         sb.append(", scheme=");
152         sb.append(scheme);
153         sb.append(", secure=");
154         sb.append(secure);
155         sb.append("]");
156         return (sb.toString());
157
158     }
159
160
161 }
162
Popular Tags