make a class implements org.jboss.system.ServiceMBean?
could somebody give me an example?
thank.
I found a bit of code like this:
public void startService() throws Exception{
try{
Class myClass = Class.forName(myclassName);
Object myObj = myClass.newInstance();
InitialContext ctx = new InitialContext(System.getProperties());
NonSerializableFactory.rebind(ctx,"MyService",myObj );
System.out.println("My Service Started...");
}catch(Exception e){
e.printStackTrace();
}
}
I got something confused about this:
org.jboss.naming.NonSerializableFactory.rebind(ctx,"MyService",myObj );
I could find the class org.jboss.naming.NonSerializableFactory.
and i was confused why not code like this:
ctx.rebind("MyService",myObj );
Sorry, it is " I could not find the org.jboss.naming.NonSerializableFactory."