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.security.JaccHelper; 16 import org.jboss.ejb3.entity.ManagedEntityManagerFactory; 17 import org.jboss.system.ServiceMBeanSupport; 18 19 25 public class MessageDrivenManager extends ServiceMBeanSupport implements MessageDrivenManagerMBean, Container 26 { 27 protected MDB container; 28 protected String jaccContextId; 29 30 public MessageDrivenManager(ClassLoader cl, String beanClassName, String ejbName, AspectManager manager, String jaccContextId) 31 { 32 container = new MDB(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 MessageDrivenManager(MDB mdb, String jaccContextId) 52 { 53 container = mdb; 54 this.jaccContextId = jaccContextId; 55 } 56 57 public ManagedEntityManagerFactory getManagedEntityManagerFactory() 58 { 59 return container.getManagedEntityManagerFactory(); 60 } 61 62 public void setManagedEntityManagerFactory(ManagedEntityManagerFactory factory) 63 { 64 container.setManagedEntityManagerFactory(factory); 65 } 66 67 public MDB getMDB() 68 { 69 return container; 70 } 71 72 public void createService() throws Exception 73 { 74 container.create(); 75 JaccHelper.configureContainer(jaccContextId, container); 76 } 77 78 public void startService() throws Exception 79 { 80 container.start(); 81 } 82 83 public void stopService() throws Exception 84 { 85 container.stop(); 86 } 87 88 public void destroyService() throws Exception 89 { 90 container.destroy(); 91 } 92 93 public Class getBeanClass() 94 { 95 return container.getBeanClass(); 96 } 97 98 public String getEjbName() 99 { 100 return container.getEjbName(); 101 } 102 103 public ObjectName getObjectName() 104 { 105 return container.getObjectName(); 106 } 107 108 public TimerService getTimerService() 109 { 110 return container.getTimerService(); 111 } 112 113 public Pool getPool() 114 { 115 return container.getPool(); 116 } 117 118 public void invokePostConstruct(Object bean) 119 { 120 container.invokePostConstruct(bean); 121 } 122 123 public void invokePreDestroy(Object bean) 124 { 125 container.invokePreDestroy(bean); 126 } 127 128 public void invokePostActivate(Object bean) 129 { 130 container.invokePostActivate(bean); 131 } 132 133 public void invokePrePassivate(Object bean) 134 { 135 container.invokePrePassivate(bean); 136 } 137 138 public void invokeInit(Object bean) 139 { 140 container.invokeInit(bean); 141 } 142 143 public void invokeInit(Object bean, Class [] initParameterTypes, Object [] initParameterValues) 144 { 145 container.invokeInit(bean, initParameterTypes, initParameterValues); 146 } 147 148 public Object construct() 149 { 150 return container.construct(); 151 } 152 153 } 154 | Popular Tags |