/* JFox, the OpenSource J2EE Application Server
 *
 * Copyright (C) 2002 huihoo.com
 * Distributable under GNU LGPL license
 * See the GNU Lesser General Public License for more details.
 */

package org.huihoo.jfox.mx;

import java.util.Properties;

import org.jfox.ejb.invoker.jrmp.JRMPContainerService;
import org.huihoo.jfox.system.State;

/**
 * 
 * @author <a href="mailto:young_yy@hotmail.com">Young Yang</a>
 */

public class JRMPContainerServiceMX implements ServiceMX {

  private JRMPContainerService invoker = null;

  public Properties getOperationDescriptions() {
    return null;
  }

  public void mx_start() {
    invoker = new JRMPContainerService();
    try {
      invoker.init();
      invoker.start();
    }
    catch(Exception e){
      e.printStackTrace();
    }
  }

  public void mx_stop(){
    try {
      invoker.stop();
      invoker.destroy();
    }
    catch(Exception e){
      e.printStackTrace();
    }
  }

  public void mx_ping(){
    try {
      invoker.ping();
    }
    catch(Exception e){
      e.printStackTrace();
    }
  }

  public Object getSource() {
    return invoker;
  }

  public String getMxDescription() {
    return null;
  }

  public State mx_getStat(){
    return invoker.getState();
  }

  public static void main(String[] args) {

  }
}