Silk DI 0.6


se.jbee.inject.service
Interface ServiceInvocation<T>

Type Parameters:
T - Type of the state transfered between before(Value, Type) and after(Value, Value, Object).

public interface ServiceInvocation<T>

Frames the invocation of ServiceMethods with further functionality that can be executed before(Value, Type) or after(Value, Value, Object) the invoked ServiceMethod. Thereby a state can be passed between these tow methods. The result of first will be passed to the second as an argument. This allows them stay stateless. A ServiceInvocation intentionally doesn't give any control or access over/to the invoked ServiceMethod in order to be able to grant the same actual function invocation even with faulty ServiceInvocations in place. That includes catching all exceptions thrown in before(Value, Type) or after(Value, Value, Object).

Author:
Jan Bernitt (jan@jbee.se)

Nested Class Summary
static class ServiceInvocation.ServiceInvocationExtension
          Used to hook up a ServiceInvocation to ServiceMethods.
 
Method Summary
<P,R> void
after(Value<P> parameter, Value<R> result, T before)
           
<P,R> void
afterException(Value<P> parameter, Type<R> result, Exception e, T before)
           
<P,R> T
before(Value<P> parameter, Type<R> result)
           
 

Method Detail

before

<P,R> T before(Value<P> parameter,
               Type<R> result)

after

<P,R> void after(Value<P> parameter,
                 Value<R> result,
                 T before)

afterException

<P,R> void afterException(Value<P> parameter,
                          Type<R> result,
                          Exception e,
                          T before)

Silk DI 0.6