001 package biz.hammurapi.jms.adapter; 002 003 004 005 /** 006 * Local calls are routed to instances of this interface. 007 * @author Pavel 008 */ 009 public interface LocalDelegate { 010 011 /** 012 * Local state to be sent to JMS as part of method invocation. 013 * @return 014 */ 015 Object getState(); 016 017 /** 018 * @param state Local state. 019 */ 020 void setState(Object state); 021 022 /** 023 * All proxy calls are routed to this method. For local calls the last parameter is null. 024 * LocalDelegate doesn't have to chain-invoke jmsMethod for remote calls. E.g. it may cache return 025 * values from previous calls. 026 * @param proxy Proxy instance 027 * @param method Method 028 * @param args Method arguments 029 * @param jmsMethod Remote method. Null for local method calls. If jmsMethod is asynchronous, local delgate 030 * can execute is synchronously or asynchronously at its discretion. 031 * @return Method return value. 032 * @throws Throwable 033 */ 034 public Object invoke( 035 Object proxy, 036 java.lang.reflect.Method method, 037 Object[] args, 038 Method jmsMethod) throws Throwable; 039 040 }