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 Engine implements Container {
029:
030: // ----------------------------------------------------------- Constructors
031:
032: /**
033: * Construct a default instance of this class.
034: */
035: public Engine() {
036:
037: super ();
038:
039: }
040:
041: /**
042: * Construct a configured instance of this class.
043: *
044: * @param name Name of this Engine
045: * @param defaultHost Default host name for this Engine
046: * @param service Associated service
047: */
048: public Engine(String name, String defaultHost, Service service) {
049:
050: super ();
051: setName(name);
052: setDefaultHost(defaultHost);
053: setService(service);
054:
055: }
056:
057: // ----------------------------------------------------- Instance Variables
058:
059: // ------------------------------------------------------------- Properties
060:
061: /**
062: * The default host name of this Engine.
063: */
064: private String defaultHost = null;
065:
066: public String getDefaultHost() {
067: return (this .defaultHost);
068: }
069:
070: public void setDefaultHost(String defaultHost) {
071: this .defaultHost = null;
072: }
073:
074: /**
075: * The name of this Engine.
076: */
077: private String name = null;
078:
079: public String getName() {
080: return (this .name);
081: }
082:
083: public void setName(String name) {
084: this .name = name;
085: }
086:
087: /**
088: * The parent Container of this Engine.
089: */
090: private Container parent = null;
091:
092: public Container getParent() {
093: return (this .parent);
094: }
095:
096: public void setParent(Container parent) {
097: this .parent = parent;
098: }
099:
100: /**
101: * The associated Service of this Engine.
102: */
103: private Service service = null;
104:
105: public Service getService() {
106: return (this .service);
107: }
108:
109: public void setService(Service service) {
110: this .service = service;
111: }
112:
113: /**
114: * Return a String representation of this object.
115: */
116: public String toString() {
117:
118: StringBuffer sb = new StringBuffer("Engine[");
119: sb.append("name=");
120: sb.append(name);
121: sb.append(", defaultHost=");
122: sb.append(defaultHost);
123: sb.append("]");
124: return (sb.toString());
125:
126: }
127:
128: }
|