This method of the Service Class determines the service state.
public synchronized int getCurrentState();
Returns the system's current state.