1 13 14 package org.ejbca.core.ejb; 15 16 import javax.ejb.SessionBean ; 17 import javax.ejb.SessionContext ; 18 import javax.naming.InitialContext ; 19 20 import org.apache.log4j.Logger; 21 22 23 24 29 public class BaseSessionBean implements SessionBean { 30 31 32 public transient Logger log; 33 private SessionContext ctx; 34 35 36 transient InitialContext cacheCtx = null; 37 38 41 public BaseSessionBean() { 42 log = Logger.getLogger(this.getClass()); 43 } 44 45 50 public void debug(String msg) { 51 log.debug(msg); 52 } 53 54 60 public void debug(String msg, Throwable t) { 61 log.debug(msg, t); 62 } 63 64 69 public void info(String msg) { 70 log.info(msg); 71 } 72 73 79 public void info(String msg, Throwable t) { 80 log.info(msg, t); 81 } 82 83 88 public void warn(String msg) { 89 log.warn(msg); 90 } 91 92 98 public void warn(String msg, Throwable t) { 99 log.warn(msg, t); 100 } 101 102 107 public void error(String msg) { 108 log.error(msg); 109 } 110 111 117 public void error(String msg, Throwable t) { 118 log.error(msg, t); 119 } 120 121 127 public void ejbActivate() throws javax.ejb.EJBException , java.rmi.RemoteException { 128 log = Logger.getLogger(this.getClass()); 129 } 130 131 137 public void ejbRemove() throws javax.ejb.EJBException , java.rmi.RemoteException { 138 } 139 140 146 public void ejbPassivate() throws javax.ejb.EJBException , java.rmi.RemoteException { 147 } 148 149 157 public void setSessionContext(final javax.ejb.SessionContext ctx) 158 throws javax.ejb.EJBException , java.rmi.RemoteException { 159 this.ctx = ctx; 160 } 161 162 167 public SessionContext getSessionContext() { 168 return ctx; 169 } 170 171 175 protected ServiceLocator getLocator() { 176 return ServiceLocator.getInstance(); 177 } 178 179 } 180 | Popular Tags |