Ejemplo n.º 1
0
 public void attach(PhysicalSourceDefinition source, WebTargetDefinition target, Wire wire)
     throws WiringException {
   WebCallbackInterceptor interceptor = new WebCallbackInterceptor(broadcasterManager);
   for (InvocationChain chain : wire.getInvocationChains()) {
     chain.addInterceptor(interceptor);
   }
 }
Ejemplo n.º 2
0
 public Object intercept(Object object, Method method, Object[] args, MethodProxy proxy)
     throws Throwable {
   WorkContext context = WorkContextTunnel.getThreadWorkContext();
   authenticate(context);
   Message message = new MessageImpl(args, false, context);
   InvocationChain invocationChain = invocationChains.get(method.getName());
   if (invocationChain != null) {
     Interceptor headInterceptor = invocationChain.getHeadInterceptor();
     Message ret = headInterceptor.invoke(message);
     if (ret.isFault()) {
       throw (Throwable) ret.getBody();
     } else {
       return ret.getBody();
     }
   } else {
     return null;
   }
 }