Update DependencyCycleTestCase to check if cycle information is accurate. Also, update RemovalDuringcycleDetectionTest due to changes in cycle detection bytecodes.
…ynchronized block between the moment dependents are notified of dependency availability and the moment a service status is set from NEW to DOWN. If a second thread attempts to install a dependent at the moment this unsynchronized block is executing, the dependent will fail to receive an immediateDependencyAvailable notification. As a result, this dependent will never be able to start. Create race condition InstallDependentDuringDependencyInstallationTestCase to check the bug is fixed.
…ich enter or leave rest states
…ithout an immediateDependencyUnavailable counterpart. Such a scenario could happen during a service installation, if the ServiceRegistrationImpl object gets an addDependent call before the instance installation is committed, but after the instance was set. This behavior could also lead to a missing immediateDependencyUnavailable call if a dependent is added to a service whose ongoing installation will be rolled back.
…sn't entered REMOVING substate. Add two racecondition tests to simulate a scenario whereas the removal request can be successfully cleared, and another scenario where it is too late to revert removal..
…ed in final service name
…oolean dependencyFailed field. Also, remove useless notifyTransitiveDependencyUnavailable, and tidy up the code.
…reated from inside setMode. Instead, it is created only when the transition method is invoked and asyncTasks == 0. The new version of setMode no longer performs any action related to demandParents/undemandParents tasks leaving this responsibility to transition, which will check for current status conditions and decide whether a new DemandParentsTask/UndemandParentsTask should be created. As a support, the new parentsDemanded field has been added, to indicate to transition whether parents have been demanded. This change in behavior garantees that no out-of-order demand notifications will take place, as no demanded-related task will be created unless asyncTasks == 0. Also, update OptionalDependencyListenersTestCase, whose tests no longer require a Thread.sleep between mode changes, a statement that was added before to avoid the out-of-order demand issue in the tests.
…DEMAND to ACTIVE, and from PASSIVE to ACTIVE.