1 45 package org.exolab.jms.net.connector; 46 47 import org.exolab.jms.net.proxy.Proxy; 48 49 50 60 public class ContextInvocationHandler implements InvocationHandler { 61 62 65 private final InvocationHandler _handler; 66 67 70 private Connection _connection; 71 72 75 private final ConnectionFactory _resolver; 76 77 78 85 public ContextInvocationHandler(InvocationHandler handler, 86 ConnectionFactory resolver) { 87 _handler = handler; 88 _resolver = resolver; 89 } 90 91 96 public void setConnection(Connection connection) { 97 _connection = connection; 98 } 99 100 105 public void invoke(Invocation invocation) { 106 try { 107 ConnectionContext.push(_resolver, _connection); 108 _handler.invoke(invocation); 109 } finally { 110 ConnectionContext.pop(); 111 } 112 } 113 } 114 | Popular Tags |