public class CloseableScope extends Object implements com.google.inject.Scope, HasScopeAnnotation
Constructor and Description |
---|
CloseableScope(Class<? extends Annotation> scopeAnnotation) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes all of the objects within this scope using the given injector and
scope annotation and clears the scope
|
void |
close(com.google.inject.Injector injector)
Closes all of the objects within the given injector of the specified
scope and clears the scope
|
Class<? extends Annotation> |
getScopeAnnotation()
Returns the scope annotation associated with this object
|
<T> com.google.inject.Provider<T> |
scope(com.google.inject.Key<T> key,
com.google.inject.Provider<T> creator) |
public CloseableScope(Class<? extends Annotation> scopeAnnotation)
public <T> com.google.inject.Provider<T> scope(com.google.inject.Key<T> key, com.google.inject.Provider<T> creator)
scope
in interface com.google.inject.Scope
public void close() throws CloseFailedException
CloseFailedException
public void close(com.google.inject.Injector injector) throws CloseFailedException
CloseFailedException
public Class<? extends Annotation> getScopeAnnotation()
HasScopeAnnotation
getScopeAnnotation
in interface HasScopeAnnotation
Apache Camel