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: 155428 $ $Date: 2005-02-26 08:12:25 -0500 (Sat, 26 Feb 2005) $
27   */
28  
29  public class Engine implements Container {
30  
31  
32      // ----------------------------------------------------------- Constructors
33  
34  
35      /***
36       * Construct a default instance of this class.
37       */
38      public Engine() {
39  
40          super();
41  
42      }
43  
44  
45      /***
46       * Construct a configured instance of this class.
47       *
48       * @param name Name of this Engine
49       * @param defaultHost Default host name for this Engine
50       * @param service Associated service
51       */
52      public Engine(String name, String defaultHost, Service service) {
53  
54          super();
55          setName(name);
56          setDefaultHost(defaultHost);
57          setService(service);
58  
59      }
60  
61  
62      // ----------------------------------------------------- Instance Variables
63  
64  
65      // ------------------------------------------------------------- Properties
66  
67  
68      /***
69       * The default host name of this Engine.
70       */
71      private String defaultHost = null;
72  
73      public String getDefaultHost() {
74          return (this.defaultHost);
75      }
76  
77      public void setDefaultHost(String defaultHost) {
78          this.defaultHost = null;
79      }
80  
81  
82      /***
83       * The name of this Engine.
84       */
85      private String name = null;
86  
87      public String getName() {
88          return (this.name);
89      }
90  
91      public void setName(String name) {
92          this.name = name;
93      }
94  
95  
96      /***
97       * The parent Container of this Engine.
98       */
99      private Container parent = null;
100 
101     public Container getParent() {
102         return (this.parent);
103     }
104 
105     public void setParent(Container parent) {
106         this.parent = parent;
107     }
108 
109 
110     /***
111      * The associated Service of this Engine.
112      */
113     private Service service = null;
114 
115     public Service getService() {
116         return (this.service);
117     }
118 
119     public void setService(Service service) {
120         this.service = service;
121     }
122 
123 
124     /***
125      * Return a String representation of this object.
126      */
127     public String toString() {
128 
129         StringBuffer sb = new StringBuffer("Engine[");
130         sb.append("name=");
131         sb.append(name);
132         sb.append(", defaultHost=");
133         sb.append(defaultHost);
134         sb.append("]");
135         return (sb.toString());
136 
137     }
138 
139 
140 }