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