001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017:
018: package org.apache.commons.modeler.demo;
019:
020: /**
021: * <p>Sample managed object for the Modeler Demonstration Application,
022: * based on the Catalina architecture of Tomcat 4.</p>
023: *
024: * @author Craig R. McClanahan
025: * @version $Revision: 480402 $ $Date: 2006-11-29 04:43:23 +0000 (Wed, 29 Nov 2006) $
026: */
027:
028: public class Connector {
029:
030: // ----------------------------------------------------------- Constructors
031:
032: /**
033: * Construct a default instance of this class.
034: */
035: public Connector() {
036:
037: super ();
038:
039: }
040:
041: /**
042: * Construct a configured instance of this class.
043: *
044: * @param port Port number
045: * @param scheme Protocol (scheme)
046: * @param secure Secure flag
047: * @param service Associated service
048: * @param container Associated container
049: */
050: public Connector(int port, String scheme, boolean secure,
051: Service service, Container container) {
052:
053: super ();
054: setPort(port);
055: setScheme(scheme);
056: setSecure(secure);
057: setService(service);
058: setContainer(container);
059:
060: }
061:
062: // ----------------------------------------------------- Instance Variables
063:
064: // ------------------------------------------------------------- Properties
065:
066: /**
067: * The Container for this Connector.
068: */
069: private Container container = null;
070:
071: public Container getContainer() {
072: return (this .container);
073: }
074:
075: public void setContainer(Container container) {
076: this .container = container;
077: }
078:
079: /**
080: * The port number of this Connector.
081: */
082: private int port = 8080;
083:
084: public int getPort() {
085: return (this .port);
086: }
087:
088: public void setPort(int port) {
089: this .port = port;
090: }
091:
092: /**
093: * The scheme of this Connector.
094: */
095: private String scheme = "http";
096:
097: public String getScheme() {
098: return (this .scheme);
099: }
100:
101: public void setScheme(String scheme) {
102: this .scheme = scheme;
103: }
104:
105: /**
106: * The secure flag of this Connector.
107: */
108: private boolean secure = false;
109:
110: public boolean getSecure() {
111: return (this .secure);
112: }
113:
114: public void setSecure(boolean secure) {
115: this .secure = secure;
116: }
117:
118: /**
119: * The associated Service of this Connector.
120: */
121: private Service service = null;
122:
123: public Service getService() {
124: return (this .service);
125: }
126:
127: public void setService(Service service) {
128: this .service = service;
129: }
130:
131: /**
132: * Return a String representation of this object.
133: */
134: public String toString() {
135:
136: StringBuffer sb = new StringBuffer("Connector[");
137: sb.append("port=");
138: sb.append(port);
139: sb.append(", scheme=");
140: sb.append(scheme);
141: sb.append(", secure=");
142: sb.append(secure);
143: sb.append("]");
144: return (sb.toString());
145:
146: }
147:
148: }
|