1 4 package com.nightlabs.ipanema.server; 5 6 import java.rmi.RemoteException ; 7 import java.util.List ; 8 9 import javax.ejb.CreateException ; 10 import javax.ejb.EJBException ; 11 import javax.ejb.SessionBean ; 12 import javax.ejb.SessionContext ; 13 14 import com.nightlabs.ModuleException; 15 import com.nightlabs.ipanema.base.BaseSessionBeanImpl; 16 import com.nightlabs.ipanema.module.ModuleType; 17 import com.nightlabs.ipanema.servermanager.IpanemaServerManager; 18 import com.nightlabs.ipanema.servermanager.config.IpanemaServerConfigModule; 19 20 27 public abstract class ServerManagerBean 28 extends BaseSessionBeanImpl 29 implements SessionBean 30 { 31 32 35 public void setSessionContext(SessionContext sessionContext) 36 throws EJBException , RemoteException 37 { 38 super.setSessionContext(sessionContext); 39 } 40 44 public void ejbCreate() 45 throws CreateException 46 { 47 } 56 57 64 public boolean isNewServerNeedingSetup() 65 throws ModuleException 66 { 67 IpanemaServerManager ism = getIpanemaServerManager(); 68 try { 69 return ism.isNewServerNeedingSetup(); 70 } finally { 71 ism.close(); 72 } 73 } 74 75 80 public void ejbRemove() throws EJBException , RemoteException { } 81 82 88 public IpanemaServerConfigModule getIpanemaServerConfigModule() 89 throws ModuleException 90 { 91 IpanemaServerManager ism = getIpanemaServerManager(); 92 try { 93 return (IpanemaServerConfigModule) ism.getIpanemaServerConfigModule(); 94 } finally { 95 ism.close(); 96 } 97 } 98 99 105 public void setIpanemaServerConfigModule(IpanemaServerConfigModule cfMod) 106 throws ModuleException 107 { 108 IpanemaServerManager ism = getIpanemaServerManager(); 109 try { 110 ism.setIpanemaServerConfigModule(cfMod); 111 } finally { 112 ism.close(); 113 } 114 } 115 116 120 public List getModules(ModuleType moduleType) 121 throws ModuleException 122 { 123 IpanemaServerManager ism = getIpanemaServerManager(); 124 try { 125 return ism.getModules(moduleType); 126 } finally { 127 ism.close(); 128 } 129 } 130 131 135 public void flushModuleCache() 136 throws ModuleException 137 { 138 IpanemaServerManager ism = getIpanemaServerManager(); 139 try { 140 ism.flushModuleCache(); 141 } finally { 142 ism.close(); 143 } 144 } 145 146 174 203 } | Popular Tags |