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