01: /* JFox, the OpenSource J2EE Application Server
02: *
03: * Copyright (C) 2002 huihoo.com
04: * Distributable under GNU LGPL license
05: * See the GNU Lesser General Public License for more details.
06: */
07:
08: package org.huihoo.jfox.jndi;
09:
10: import org.huihoo.jfox.service.ServiceWrapper;
11: import org.huihoo.jfox.service.ServiceWrapperMBean;
12:
13: /**
14: *
15: * @author <a href="mailto:young_yy@hotmail.com">Young Yang</a>
16: */
17:
18: public class JNDIService {
19: private int port = 1099;
20: private ServiceWrapperMBean swm = null;
21:
22: public JNDIService() throws Exception {
23: swm = new ServiceWrapper(NamingServiceSupport.class.getName(),
24: port);
25: start();
26: }
27:
28: public JNDIService(int port) throws Exception {
29: this .port = port;
30: swm = new ServiceWrapper(NamingServiceSupport.class.getName(),
31: port);
32: start();
33: }
34:
35: private void start() throws Exception {
36: swm.init();
37: swm.start();
38: }
39:
40: public static void main(String[] args) throws Exception {
41: new JNDIService();
42: }
43: }
|