private Interceptor getInterceptor() { // lazy load the interceptor as it may not have been added when the instance was created in the wire attacher if (interceptor == null) { interceptor = wire.getInvocationChains().iterator().next().getHeadInterceptor(); } return interceptor; } }
/** * Constructor. * * @param manager the ZeroMQ Context manager * @param address the address to receive messages on * @param chains the invocation chains for dispatching invocations * @param socketType the socket type as defined by ZeroMQ * @param metadata metadata * @param executorService the executor for scheduling work * @param monitor the monitor */ public AbstractReceiver(ContextManager manager, SocketAddress address, List<InvocationChain> chains, int socketType, ZeroMQMetadata metadata, ExecutorService executorService, MessagingMonitor monitor) { this.manager = manager; this.address = address; this.executorService = executorService; this.interceptors = new Interceptor[chains.size()]; for (int i = 0, chainsSize = chains.size(); i < chainsSize; i++) { InvocationChain chain = chains.get(i); interceptors[i] = chain.getHeadInterceptor(); } this.socketType = socketType; this.metadata = metadata; this.monitor = monitor; }
public Object invoke(Packet packet, Method method, Object... args) throws InvocationTargetException { // the work context is populated by the current tubeline WorkContext workContext = (WorkContext) packet.invocationProperties.get(MetroConstants.WORK_CONTEXT); if (workContext == null) { // programming error throw new AssertionError("Work context not set"); } Message input = MessageCache.getAndResetMessage(); try { input.setWorkContext(workContext); input.setBody(args); Interceptor head = chains.get(method.getName()).getHeadInterceptor(); Message ret = head.invoke(input); if (!ret.isFault()) { return ret.getBody(); } else { Throwable th = (Throwable) ret.getBody(); throw new InvocationTargetException(th); } } finally { input.reset(); } }
public Object invoke(Packet packet, Method method, Object... args) throws InvocationTargetException { // the work context is populated by the current tubeline WorkContext workContext = (WorkContext) packet.invocationProperties.get(MetroConstants.WORK_CONTEXT); if (workContext == null) { // programming error throw new AssertionError("Work context not set"); } Message input = MessageCache.getAndResetMessage(); try { input.setWorkContext(workContext); input.setBody(args); Interceptor head = chains.get(method.getName()).getHeadInterceptor(); Message ret = head.invoke(input); if (!ret.isFault()) { return ret.getBody(); } else { Throwable th = (Throwable) ret.getBody(); throw new InvocationTargetException(th); } } finally { input.reset(); } }
throw new AssertionError("No invocation chain found for WSDL operation: " + operationName); Interceptor head = chains.get(operationName).getHeadInterceptor(); Message ret = head.invoke(input);
Interceptor interceptor = holder.getChain().getHeadInterceptor(); boolean oneWay = holder.getChain().getPhysicalOperation().isOneWay(); OperationPayloadTypes payloadTypes = holder.getPayloadTypes();
public Object invoke(Method method, Object[] args) throws Throwable { InvocationChain invocationChain = chains.get(method.getName()); if (invocationChain == null) { throw new ServiceRuntimeException("Unknown resource method: " + method.toString()); } WorkContext context = WorkContextCache.getThreadWorkContext(); // work context set previously in RsContainer Message message = MessageCache.getAndResetMessage(); try { message.setWorkContext(context); message.setBody(args); if (invocationChain != null) { Interceptor headInterceptor = invocationChain.getHeadInterceptor(); Message ret = headInterceptor.invoke(message); if (ret.isFault()) { return handleFault(ret); } else { return ret.getBody(); } } else { return null; } } catch (RuntimeException e) { throw new InvocationTargetException(e); } finally { message.reset(); } }
public Object invoke(Method method, Object[] args) throws Throwable { InvocationChain invocationChain = chains.get(method.getName()); if (invocationChain == null) { throw new ServiceRuntimeException("Unknown resource method: " + method.toString()); } WorkContext context = WorkContextCache.getThreadWorkContext(); // work context set previously in RsContainer Message message = MessageCache.getAndResetMessage(); try { message.setWorkContext(context); message.setBody(args); if (invocationChain != null) { Interceptor headInterceptor = invocationChain.getHeadInterceptor(); Message ret = headInterceptor.invoke(message); if (ret.isFault()) { return handleFault(ret); } else { return ret.getBody(); } } else { return null; } } catch (RuntimeException e) { throw new InvocationTargetException(e); } finally { message.reset(); } }
Interceptor headInterceptor = chain.getHeadInterceptor(); assert headInterceptor != null;
Interceptor headInterceptor = chain.getHeadInterceptor(); assert headInterceptor != null;
Interceptor headInterceptor = chain.getHeadInterceptor(); assert headInterceptor != null;
Interceptor headInterceptor = chain.getHeadInterceptor(); assert headInterceptor != null;