1 23 package com.sun.ejb.containers; 24 25 import java.lang.reflect.Method ; 26 import com.sun.ejb.MessageBeanListener; 27 import com.sun.enterprise.resource.ResourceHandle; 28 29 34 public class MessageBeanListenerImpl implements MessageBeanListener { 35 36 private MessageBeanContainer container_; 37 private ResourceHandle resourceHandle_; 38 39 MessageBeanListenerImpl(MessageBeanContainer container, 40 ResourceHandle handle) { 41 container_ = container; 42 43 resourceHandle_ = handle; 45 } 46 47 public void setResourceHandle(ResourceHandle handle) { 48 resourceHandle_ = handle; 49 } 50 51 public ResourceHandle getResourceHandle() { 52 return resourceHandle_; 53 } 54 55 public void beforeMessageDelivery(Method method, boolean txImported) { 56 container_.onEnteringContainer(); container_.beforeMessageDelivery(method, txImported, resourceHandle_); 58 } 59 60 public Object deliverMessage(Object [] params) throws Throwable { 61 return container_.deliverMessage(params); 62 } 63 64 public void afterMessageDelivery() { 65 try { 66 container_.afterMessageDelivery(resourceHandle_); 67 } finally { 68 container_.onLeavingContainer(); } 70 } 71 72 } 73 | Popular Tags |