From a pojo annotated with @Service and @Management I want to invoke a method on every instance in my cluster.
@Service(objectName=myClass.OBJECT_NAME)
@Management(MyInterface.class)
public class MyClass implements myInterface
{
@Override
public void callEverywhere () throws Exception {
final ArrayList results = partition.getHAPartition().callMethodOnCluster(OBJECT_NAME,"methodName", new Object[] {}, new Class[] {}, false);
}
public String myMethod() {
return "Hello";
}
}
results in the method not getting called. Under the hood it looks like Im getting a NoHandlerForRPC
instead of calling the method.
I know I can use an HAServiceMBeanSupport
but have reasons for wanting to use POJOs.
Can I do this with pojos in jboss 4.2.3?