KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > spi > webxml > WebXmlRegistry


1 package org.enhydra.spi.webxml;
2
3 import org.objectweb.carol.util.configuration.*;
4 import org.objectweb.carol.jndi.ns.NameService;
5 import org.objectweb.carol.jndi.ns.NameServiceException;
6
7 /*
8  * Class <code>WebXmlRegistry</code> is a fake registry service.
9  */

10 public class WebXmlRegistry implements NameService {
11
12     /**
13      * port number (0 for default)
14      */

15     public int port = 0;
16     
17     public String JavaDoc host = "nohost";
18
19     /**
20      * Starts a new NameService or does nothing if the name service is already
21      * started.
22      * @throws NameServiceException If a problem occures.
23      */

24     public void start() throws NameServiceException {
25     if (TraceCarol.isDebugJndiCarol()) {
26             TraceCarol.debugJndiCarol("WebXmlRegistry.start() on port:" + port);
27         }
28     // do nothing
29
}
30
31     /**
32      * Stops a NameService or does nothing if the name service is already stopped.
33      * @throws NameServiceException If a problem occures.
34      */

35     public void stop() throws NameServiceException {
36     if (TraceCarol.isDebugJndiCarol()) {
37             TraceCarol.debugJndiCarol("WebXmlRegistry.stop()");
38         }
39     // do nothing
40
}
41
42     /**
43      * Checks if a name service is started.
44      * @return Always returns true.
45      */

46     public boolean isStarted() {
47     return true;
48     }
49
50     /**
51      * Set the port for the name service.
52      * @param p Port number.
53      */

54     public void setPort (int p) {
55     }
56
57     /* (non-Javadoc)
58      * @see org.objectweb.carol.jndi.ns.NameService#getPort()
59      */

60     public int getPort() {
61             return 0;
62     }
63     
64     public void setConfigProperties(java.util.Properties JavaDoc props){
65         
66     }
67     
68     public void setHost(String JavaDoc s){
69         host = s;
70     };
71
72     public String JavaDoc getHost(){
73         return host;
74     };
75
76
77 }
78
Popular Tags