Package org.apache.cayenne.di.spi
Class DefaultScope
java.lang.Object
org.apache.cayenne.di.spi.DefaultScope
- All Implemented Interfaces:
Scope
An implementation of a DI scopes with support scope events.
- Since:
- 3.1
-
Field Summary
Modifier and TypeFieldDescriptionprotected Collection
<Class<? extends Annotation>> protected ConcurrentMap
<String, Collection<ScopeEventBinding>> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addScopeEventListener
(Object object) Registers annotated methods of an arbitrary object for this scope lifecycle events.void
postScopeEvent
(Class<? extends Annotation> type, Object... eventParameters) Posts a scope event to all registered listeners.void
removeScopeEventListener
(Object object) <T> Provider
<T> void
shutdown()
Shuts down this scope, postingBeforeScopeEnd
andAfterScopeEnd
events.
-
Field Details
-
eventTypes
-
listeners
-
-
Constructor Details
-
DefaultScope
-
-
Method Details
-
shutdown
public void shutdown()Shuts down this scope, postingBeforeScopeEnd
andAfterScopeEnd
events. -
addScopeEventListener
Registers annotated methods of an arbitrary object for this scope lifecycle events. -
removeScopeEventListener
-
postScopeEvent
Posts a scope event to all registered listeners. There's no predetermined order of event dispatching. An exception thrown by any of the listeners stops further event processing and is rethrown. -
scope
-