|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ops4j.peaberry.util.Decorators
public final class Decorators
Methods for creating various general purpose ImportDecorators.
| Method Summary | ||
|---|---|---|
static
|
chain(ImportDecorator... decorators)
An ImportDecorator that applies decorators in a chain, right-left. |
|
static
|
intercept(com.google.inject.matcher.Matcher<? super Class<?>> classMatcher,
com.google.inject.matcher.Matcher<? super Method> methodMatcher,
org.aopalliance.intercept.MethodInterceptor... interceptors)
An ImportDecorator that supports MethodInterceptors. |
|
static
|
sticky(Callable<Boolean> resetTask)
An ImportDecorator that caches the first valid service instance and
uses that until it becomes invalid. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <S> ImportDecorator<S> sticky(Callable<Boolean> resetTask)
ImportDecorator that caches the first valid service instance and
uses that until it becomes invalid. The decorator then calls the reset task
to see if it should reset the cache and get a new service instance.
If no reset task is provided, the service instance cache is never reset.
Note: sticky decorators only really make sense for single services.
resetTask - called when cached service becomes invalid, may be null
public static <S> ImportDecorator<S> chain(ImportDecorator... decorators)
ImportDecorator that applies decorators in a chain, right-left.
decorators - sequence of decorators
public static <S> ImportDecorator<S> intercept(com.google.inject.matcher.Matcher<? super Class<?>> classMatcher,
com.google.inject.matcher.Matcher<? super Method> methodMatcher,
org.aopalliance.intercept.MethodInterceptor... interceptors)
ImportDecorator that supports MethodInterceptors.
classMatcher - matches interfaces to be interceptedmethodMatcher - matches methods to be interceptedinterceptors - sequence of method interceptors
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||