package org.huihoo.jfox.mx;
import java.util.Properties;
import org.huihoo.jfox.jndi.NamingServiceImpl;
import org.huihoo.jfox.system.ServiceWrapper;
import org.huihoo.jfox.system.State;
public class NamingServiceMX implements ServiceMX {
private int port = 1099;
private ServiceWrapper sw = null;
public NamingServiceMX() {
}
public void mx_setPort(int port){
this.port = port;
}
public int mx_getPort(){
return port;
}
public void mx_start() {
sw = new ServiceWrapper(NamingServiceImpl.class.getName(),port);
try {
sw.init();
sw.start();
}
catch(Exception e){
e.printStackTrace();
}
}
public void mx_stop(){
try {
sw.stop();
sw.destroy();
}
catch(Exception e){
e.printStackTrace();
}
}
public State mx_getStat(){
return sw.getState();
}
public Properties getOperationDescriptions() {
return null;
}
public Object getSource() {
return sw;
}
public String getMxDescription() {
return "JNDI Implementaion";
}
public static void main(String[] args) {
}
}