/* 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.jfox.mx.test;

import java.util.Properties;

import org.jfox.mx.Mxable;
import org.jfox.mx.MxServer;
import org.jfox.mx.ObjectName;
import org.jfox.mx.MxRegistration;

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

public class MxTest implements Mxable, MxRegistration {
  Test test = new Test();

  public Object getSource() {
    return test;
  }

  public Properties getOperationDescriptions() {
    return new Properties();
  }

  public String mx_getWord () {
    return test.getWord();
  }

  public String getMxDescription() {
    return "";
  }

  public void preRegister(MxServer server, ObjectName name) throws Exception {
    System.out.println("preRegister");
  }

  public void postRegister(Boolean registrationDone) {
    System.out.println("postRegister");
  }

  public void preDeregister() throws Exception {
    System.out.println("preDeregister");
  }

  public void postDeregister() {
    System.out.println("postDeregister");
  }

  public static void main(String[] args) throws Exception {
    MxServer mx = MxServer.getInstance();
    MxTest mxtest = (MxTest)mx.createMX("org.jfox.mx.test.MxTest",new ObjectName(":class=MxTest"));
    System.out.println(mxtest.mx_getWord());
  }
}