public Message invoke(Message msg) { return next.invoke(msg); }
private Message dispatch(Object[] payload, Message message) { message.setBody(payload); return interceptor.invoke(message); }
public Message invoke(Message msg) { Object body = msg.getBody(); if (body == null || !body.getClass().isArray()) { return next.invoke(msg); } Object[] payload = (Object[]) body; if (payload.length != 1) { throw new ServiceRuntimeException("Unexpected payload size: " + payload.length); } msg.setBody(payload[0]); return next.invoke(msg); }
public Message invoke(Message msg) { transformInput(msg); Message ret = next.invoke(msg); return transformOutput(ret); }
public Message invoke(Message msg) { transformInput(msg); Message ret = next.invoke(msg); return transformOutput(ret); }
public Message invoke(Message msg) { msg.setBody(new Object[]{msg.getBody()}); return next.invoke(msg); }
public void run() { Message request = MessageCache.getAndResetMessage(); try { request.setBody(frames[0]); int methodIndex = ByteBuffer.wrap(frames[1]).getInt(); WorkContext context = setWorkContext(frames[2]); request.setWorkContext(context); Interceptor interceptor = interceptors[methodIndex]; interceptor.invoke(request); } finally { request.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(); } }
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 void run() { Message request = MessageCache.getAndResetMessage(); try { request.setBody(frames[0]); int methodIndex = ByteBuffer.wrap(frames[1]).getInt(); WorkContext context = setWorkContext(frames[2]); request.setWorkContext(context); Interceptor interceptor = interceptors[methodIndex]; // invoke the service Message response = interceptor.invoke(request); Object responseBody = response.getBody(); if (!(responseBody instanceof byte[])) { throw new ServiceRuntimeException("Return value not serialized"); } // queue the response try { queue.put(new Response(clientId, (byte[]) responseBody)); } catch (InterruptedException e) { Thread.interrupted(); } } finally { request.reset(); // context.reset(); } } });
Message ret = head.invoke(input);
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(); } }
org.fabric3.spi.container.invocation.Message outMessage = interceptor.invoke(inMessage);
public void run() { WorkContext workContext = WorkContextCache.getAndResetThreadWorkContext(); workContext.addCallbackReferences(stack); workContext.addHeaders(headers); workContext.setSubject(subject); Message message = MessageCache.getAndResetMessage(); message.setBody(payload); message.setWorkContext(workContext); Message response = next.invoke(message); if (response.isFault()) { // log the exception monitor.onError((Throwable) response.getBody()); } message.reset(); workContext.reset(); }
response = headInterceptor.invoke(message); } catch (ServiceRuntimeException e) {
response = headInterceptor.invoke(message); } catch (ServiceRuntimeException e) {
response = headInterceptor.invoke(message); } catch (ServiceUnavailableException e) {
public boolean onUpload(String fileName, String contentType, InputStream uploadData) throws Exception { Object[] args = new Object[]{fileName, uploadData}; WorkContext workContext = WorkContextCache.getAndResetThreadWorkContext(); Message input = MessageCache.getAndResetMessage(); try { // set the header value for the request context workContext.setHeader(FtpConstants.HEADER_CONTENT_TYPE, contentType); input.setWorkContext(workContext); input.setBody(args); Message response = getInterceptor().invoke(input); if (response.isFault()) { monitor.fileProcessingError(servicePath, (Throwable) response.getBody()); input.reset(); return false; } return true; } finally { input.reset(); workContext.reset(); } }
response = headInterceptor.invoke(message); } catch (ServiceUnavailableException e) {