Пример #1
0
 private int expectedResults() throws Exception {
   Object o = (new InitialContext()).lookup("MyMessageChecker");
   MessageCheckerHome home =
       (MessageCheckerHome) PortableRemoteObject.narrow(o, MessageCheckerHome.class);
   MessageChecker checker = home.create();
   return checker.expectedResults();
 }
Пример #2
0
 private void notifyAndWait() throws Exception {
   Object o = (new InitialContext()).lookup("MyMessageChecker");
   MessageCheckerHome home =
       (MessageCheckerHome) PortableRemoteObject.narrow(o, MessageCheckerHome.class);
   MessageChecker checker = home.create();
   checker.notifyAndWait();
 }
Пример #3
0
 private boolean checkResults(int num) throws Exception {
   Object o = (new InitialContext()).lookup("MyMessageChecker");
   MessageCheckerHome home =
       (MessageCheckerHome) PortableRemoteObject.narrow(o, MessageCheckerHome.class);
   MessageChecker checker = home.create();
   int result = checker.getMessageCount();
   return result == num;
 }