public static void ensureCurrentState ( Service . STATE state , Service . STATE expectedState ) { if ( state != expectedState ) { throw new IllegalStateException ( "For this operation, the " + "current service state must be " + expectedState + " instead of " + state ) ; } }
Verify that a service is in a given state .