Package com.sun.sgs.impl.service.watchdog

Examples of com.sun.sgs.impl.service.watchdog.WatchdogServiceImpl


    @Test(expected = IllegalStateException.class)
    public void testAddRecoveryListenerServiceShuttingDown()
  throws Exception
    {
  DataService dataService = createDataService(serviceProps);
  WatchdogServiceImpl watchdog = new WatchdogServiceImpl(
      serviceProps, systemRegistry, txnProxy, dummyShutdownCtrl);
  watchdog.shutdown();
  watchdog.addRecoveryListener(new DummyRecoveryListener());
  dataService.shutdown();
    }
View Full Code Here


  final String appName = "TestReportFailure";

  // Create a dummy shutdown controller to log calls to the shutdown
  // method. NOTE: The controller does not actually shutdown the node
  DataService dataService = createDataService(serviceProps);
  WatchdogServiceImpl watchdogService =
      new WatchdogServiceImpl(serviceProps, systemRegistry,
            txnProxy, dummyShutdownCtrl);

  // Report a failure, which should shutdown the node
  watchdogService.reportFailure(dataService.getLocalNodeId(),
              appName);

  // Node should not be alive since we reported a failure
  try {
      assertFalse(watchdogService.isLocalNodeAliveNonTransactional());
  } catch (Exception e) {
      fail("Not expecting an Exception: " + e.getLocalizedMessage());
  }
           
  // The shutdown controller should be incremented as a result of the
  // failure being reported
  assertEquals(1, dummyShutdownCtrl.getShutdownCount());
  watchdogService.shutdown();
  dataService.shutdown();
    }
View Full Code Here

  throws Exception
    {
  Properties props = SgsTestNode.getDefaultProperties(
      "TestWatchdogServiceImpl", serverNode, null);
  DataService data = createDataService(props);
  WatchdogServiceImpl watchdog =
      new WatchdogServiceImpl(props, systemRegistry, txnProxy,
            dummyShutdownCtrl);
  watchdog.addRecoveryListener(listener);
  watchdog.ready();
  System.err.println("Created node (" + data.getLocalNodeId() + ")");
  return new WatchdogAndData(watchdog, data);
    }
View Full Code Here

TOP

Related Classes of com.sun.sgs.impl.service.watchdog.WatchdogServiceImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.