01: package org.enhydra.spi.webxml;
02:
03: import org.objectweb.carol.util.configuration.*;
04: import org.objectweb.carol.jndi.ns.NameService;
05: import org.objectweb.carol.jndi.ns.NameServiceException;
06:
07: /*
08: * Class <code>WebXmlRegistry</code> is a fake registry service.
09: */
10: public class WebXmlRegistry implements NameService {
11:
12: /**
13: * port number (0 for default)
14: */
15: public int port = 0;
16:
17: public String 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:"
27: + port);
28: }
29: // do nothing
30: }
31:
32: /**
33: * Stops a NameService or does nothing if the name service is already stopped.
34: * @throws NameServiceException If a problem occures.
35: */
36: public void stop() throws NameServiceException {
37: if (TraceCarol.isDebugJndiCarol()) {
38: TraceCarol.debugJndiCarol("WebXmlRegistry.stop()");
39: }
40: // do nothing
41: }
42:
43: /**
44: * Checks if a name service is started.
45: * @return Always returns true.
46: */
47: public boolean isStarted() {
48: return true;
49: }
50:
51: /**
52: * Set the port for the name service.
53: * @param p Port number.
54: */
55: public void setPort(int p) {
56: }
57:
58: /* (non-Javadoc)
59: * @see org.objectweb.carol.jndi.ns.NameService#getPort()
60: */
61: public int getPort() {
62: return 0;
63: }
64:
65: public void setConfigProperties(java.util.Properties props) {
66:
67: }
68:
69: public void setHost(String s) {
70: host = s;
71: };
72:
73: public String getHost() {
74: return host;
75: };
76:
77: }
|