Java Code Examples for org.apache.hadoop.service.Service#getServiceState()
The following examples show how to use
org.apache.hadoop.service.Service#getServiceState() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AuxServices.java From hadoop with Apache License 2.0 | 6 votes |
@Override public void serviceStop() throws Exception { try { synchronized (serviceMap) { for (Service service : serviceMap.values()) { if (service.getServiceState() == Service.STATE.STARTED) { service.unregisterServiceListener(this); service.stop(); } } serviceMap.clear(); serviceMetaData.clear(); } } finally { super.serviceStop(); } }
Example 2
Source File: AuxServices.java From big-c with Apache License 2.0 | 6 votes |
@Override public void serviceStop() throws Exception { try { synchronized (serviceMap) { for (Service service : serviceMap.values()) { if (service.getServiceState() == Service.STATE.STARTED) { service.unregisterServiceListener(this); service.stop(); } } serviceMap.clear(); serviceMetaData.clear(); } } finally { super.serviceStop(); } }
Example 3
Source File: BreakableStateChangeListener.java From hadoop with Apache License 2.0 | 5 votes |
@Override public synchronized void stateChanged(Service service) { eventCount++; lastService = service; lastState = service.getServiceState(); stateEventList.add(lastState); if (lastState == failingState) { failureCount++; throw new BreakableService.BrokenLifecycleEvent(service, "Failure entering " + lastState + " for " + service.getName()); } }
Example 4
Source File: BreakableStateChangeListener.java From big-c with Apache License 2.0 | 5 votes |
@Override public synchronized void stateChanged(Service service) { eventCount++; lastService = service; lastState = service.getServiceState(); stateEventList.add(lastState); if (lastState == failingState) { failureCount++; throw new BreakableService.BrokenLifecycleEvent(service, "Failure entering " + lastState + " for " + service.getName()); } }
Example 5
Source File: BreakableService.java From hadoop with Apache License 2.0 | 4 votes |
public BrokenLifecycleEvent(Service service, String action) { super("Lifecycle Failure during " + action + " state is " + service.getServiceState()); state = service.getServiceState(); }
Example 6
Source File: TestServiceLifecycle.java From hadoop with Apache License 2.0 | 4 votes |
public synchronized void stateChanged(Service service) { notifyingState = service.getServiceState(); this.notifyAll(); }
Example 7
Source File: BreakableService.java From big-c with Apache License 2.0 | 4 votes |
public BrokenLifecycleEvent(Service service, String action) { super("Lifecycle Failure during " + action + " state is " + service.getServiceState()); state = service.getServiceState(); }
Example 8
Source File: TestServiceLifecycle.java From big-c with Apache License 2.0 | 4 votes |
public synchronized void stateChanged(Service service) { notifyingState = service.getServiceState(); this.notifyAll(); }