1 7 package org.jboss.ejb3.mdb; 8 9 import javax.ejb.TimerService ; 10 import javax.management.ObjectName ; 11 import org.jboss.aop.AspectManager; 12 import org.jboss.ejb3.Container; 13 import org.jboss.ejb3.Pool; 14 import org.jboss.ejb3.EjbLinkResolver; 15 import org.jboss.ejb3.entity.ManagedEntityManagerFactory; 16 import org.jboss.ejb3.security.JaccHelper; 17 import org.jboss.system.ServiceMBeanSupport; 18 19 25 public class ConsumerManager extends ServiceMBeanSupport implements ConsumerManagerMBean, Container 26 { 27 protected ConsumerContainer container; 28 protected String jaccContextId; 29 30 public ConsumerManager(ClassLoader cl, String beanClassName, String ejbName, AspectManager manager, String jaccContextId) 31 { 32 container = new ConsumerContainer(ejbName, manager, cl, beanClassName); 33 this.jaccContextId = jaccContextId; 34 } 35 36 public Container getInstance() 37 { 38 return container; 39 } 40 41 public EjbLinkResolver getEjbLinkResolver() 42 { 43 return container.getEjbLinkResolver(); 44 } 45 46 public void setEjbLinkResolver(EjbLinkResolver ejbLinkResolver) 47 { 48 container.setEjbLinkResolver(ejbLinkResolver); 49 } 50 51 public ManagedEntityManagerFactory getManagedEntityManagerFactory() 52 { 53 return container.getManagedEntityManagerFactory(); 54 } 55 56 public void setManagedEntityManagerFactory(ManagedEntityManagerFactory factory) 57 { 58 container.setManagedEntityManagerFactory(factory); 59 } 60 61 public void createService() throws Exception 62 { 63 container.create(); 64 JaccHelper.configureContainer(jaccContextId, container); 65 } 66 67 public void startService() throws Exception 68 { 69 container.start(); 70 } 71 72 public void stopService() throws Exception 73 { 74 container.stop(); 75 } 76 77 public void destroyService() throws Exception 78 { 79 container.destroy(); 80 } 81 82 public Class getBeanClass() 83 { 84 return container.getBeanClass(); 85 } 86 87 public String getEjbName() 88 { 89 return container.getEjbName(); 90 } 91 92 public ObjectName getObjectName() 93 { 94 return container.getObjectName(); 95 } 96 97 public TimerService getTimerService() 98 { 99 return container.getTimerService(); 100 } 101 102 public Pool getPool() 103 { 104 return container.getPool(); 105 } 106 107 public void invokePostConstruct(Object bean) 108 { 109 container.invokePostConstruct(bean); 110 } 111 112 public void invokePreDestroy(Object bean) 113 { 114 container.invokePreDestroy(bean); 115 } 116 117 public void invokePostActivate(Object bean) 118 { 119 container.invokePostActivate(bean); 120 } 121 122 public void invokePrePassivate(Object bean) 123 { 124 container.invokePrePassivate(bean); 125 } 126 127 public void invokeInit(Object bean) 128 { 129 container.invokeInit(bean); 130 } 131 132 public void invokeInit(Object bean, Class [] initParameterTypes, Object [] initParameterValues) 133 { 134 container.invokeInit(bean, initParameterTypes, initParameterValues); 135 } 136 137 public Object construct() 138 { 139 return container.construct(); 140 } 141 142 } 143 | Popular Tags |