KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > spi > conf > ConfFileRegistry


1 package org.enhydra.spi.conf;
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>ConfFileRegistry</code> is a fake registry service
9  */

10 public class ConfFileRegistry 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      * start Method, Start a new NameService or do nothing if the name service is all ready start
21      * @throws NameServiceException if a problem occures.
22      */

23     public void start() throws NameServiceException {
24     if (TraceCarol.isDebugJndiCarol()) {
25             TraceCarol.debugJndiCarol("ConfFileRegistry.start() on port:" + port);
26         }
27     // do nothing
28
}
29
30     /**
31      * stop Method, Stop a NameService or do nothing if the name service is all ready stop
32      * @throws NameServiceException if a problem occure
33      */

34     public void stop() throws NameServiceException {
35     if (TraceCarol.isDebugJndiCarol()) {
36             TraceCarol.debugJndiCarol("ConfFileRegistry.stop()");
37         }
38     // do nothing
39
}
40
41     /**
42      * isStarted Method, check if a name service is started
43      * @return alway return true
44      */

45     public boolean isStarted() {
46     return true;
47     }
48
49     /**
50      * set port method, set the port for the name service
51      * @param p port number
52      */

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

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