KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > nanocontainer > testmodel > WebServerImpl


1 /*****************************************************************************
2  * Copyright (C) NanoContainer Organization. All rights reserved. *
3  * ------------------------------------------------------------------------- *
4  * The software in this package is published under the terms of the BSD *
5  * style license a copy of which has been included with this distribution in *
6  * the LICENSE.txt file. *
7  * *
8  * Original code by Aslak Hellesoy and Paul Hammant *
9  *****************************************************************************/

10
11 package org.nanocontainer.testmodel;
12
13 import junit.framework.Assert;
14 import org.picocontainer.Startable;
15
16 public class WebServerImpl implements WebServer, Startable {
17
18     public WebServerImpl(WebServerConfig wsc) {
19         this(wsc, new StringBuffer JavaDoc("d"));
20     }
21
22     public WebServerImpl(WebServerConfig wsc, StringBuffer JavaDoc sb) {
23         Assert.assertTrue("No port number specified", wsc.getPort() > 0);
24         Assert.assertNotNull("No host name specified", wsc.getHost());
25         sb.append("-WebServerImpl:" + wsc.getHost() + ":" + wsc.getPort());
26     }
27
28     public void start() {
29     }
30
31     public void stop() {
32     }
33 }
34
Popular Tags