1 17 18 package org.apache.geronimo.connector; 19 20 import javax.resource.spi.endpoint.MessageEndpointFactory ; 21 22 import org.apache.geronimo.gbean.GBeanInfo; 23 import org.apache.geronimo.gbean.GBeanInfoBuilder; 24 import org.apache.geronimo.gbean.DynamicGBean; 25 import org.apache.geronimo.gbean.DynamicGBeanDelegate; 26 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory; 27 import org.apache.geronimo.transaction.manager.ResourceManager; 28 29 33 public class ActivationSpecWrapperGBean extends ActivationSpecWrapper implements DynamicGBean { 34 35 private final DynamicGBeanDelegate delegate; 36 37 public ActivationSpecWrapperGBean() { 38 delegate = null; 39 } 40 41 public ActivationSpecWrapperGBean(final String activationSpecClass, final String containerId, final ResourceAdapterWrapper resourceAdapterWrapper, final ClassLoader cl) throws IllegalAccessException , InstantiationException , ClassNotFoundException { 42 super(activationSpecClass, containerId, resourceAdapterWrapper, cl); 43 delegate = new DynamicGBeanDelegate(); 44 delegate.addAll(activationSpec); 45 } 46 47 49 56 public Object getAttribute(final String name) throws Exception { 57 return delegate.getAttribute(name); 58 } 59 60 67 public void setAttribute(final String name, final Object value) throws Exception { 68 delegate.setAttribute(name, value); 69 } 70 71 80 public Object invoke(final String name, final Object [] arguments, final String [] types) throws Exception { 81 return null; 83 } 84 85 public static final GBeanInfo GBEAN_INFO; 86 87 static { 88 GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(ActivationSpecWrapperGBean.class, NameFactory.JCA_ACTIVATION_SPEC); 89 infoBuilder.addAttribute("activationSpecClass", String .class, true); 90 infoBuilder.addAttribute("containerId", String .class, true); 91 infoBuilder.addAttribute("classLoader", ClassLoader .class, false); 92 93 infoBuilder.addReference("ResourceAdapterWrapper", ResourceAdapterWrapper.class, NameFactory.RESOURCE_ADAPTER); 94 95 infoBuilder.addOperation("activate", new Class []{MessageEndpointFactory .class}); 96 infoBuilder.addOperation("deactivate", new Class []{MessageEndpointFactory .class}); 97 98 infoBuilder.addInterface(ResourceManager.class); 99 100 infoBuilder.setConstructor(new String []{ 101 "activationSpecClass", 102 "containerId", 103 "ResourceAdapterWrapper", 104 "classLoader"}); 105 106 GBEAN_INFO = infoBuilder.getBeanInfo(); 107 } 108 109 public static GBeanInfo getGBeanInfo() { 110 return GBEAN_INFO; 111 } 112 113 } 114 | Popular Tags |