A synchronous {@code ModuleEvent} listener. {@code SynchronousModuleListener}is a listener interface that may be implemented by a module developer. When a {@code ModuleEvent} is fired, it is synchronously delivered to a{@code SynchronousModuleListener}. The Runtime may deliver {@code ModuleEvent} objects to a {@code SynchronousModuleListener} out oforder and may concurrently call and/or reenter a {@code SynchronousModuleListener}.
For {@code ModuleEvent} type {@link ModuleEvent#STARTED STARTED}, the Runtime must not hold the referenced module's "state change" lock when the {@code ModuleEvent} is delivered to a {@code SynchronousModuleListener}. For the other {@code ModuleEvent} types, the Runtime must hold the referencedmodule's "state change" lock when the {@code ModuleEvent} isdelivered to a {@code SynchronousModuleListener}. A {@code SynchronousModuleListener} cannot directly call life cycle methods onthe referenced module when the Runtime is holding the referenced module's "state change" lock.
A {@code SynchronousModuleListener} object is registered with the Runtimeusing the {@link ModuleContext#addModuleListener(ModuleListener)} method.{@code SynchronousModuleListener} objects are called with a{@code ModuleEvent} object when a module has been installed, resolved,starting, started, stopping, stopped, updated, unresolved, or uninstalled.
Unlike normal {@code ModuleListener} objects,{@code SynchronousModuleListener}s are synchronously called during module lifecycle processing. The module lifecycle processing will not proceed until all {@code SynchronousModuleListener}s have completed. {@code SynchronousModuleListener} objects will be called prior to{@code ModuleListener} objects.
@author thomas.diesler@jboss.com
@since 27-Sep-2013
@see ModuleEvent
@ThreadSafe