1 13 package org.ejbca.core.model.services.workers; 14 15 import javax.ejb.CreateException ; 16 17 import org.apache.log4j.Logger; 18 import org.ejbca.core.ejb.ca.crl.ICreateCRLSessionLocal; 19 import org.ejbca.core.ejb.ca.crl.ICreateCRLSessionLocalHome; 20 import org.ejbca.core.model.services.BaseWorker; 21 import org.ejbca.core.model.services.ServiceExecutionFailedException; 22 23 31 public class CRLUpdateWorker extends BaseWorker { 32 33 private static Logger log = Logger.getLogger(CRLUpdateWorker.class); 34 35 private ICreateCRLSessionLocal createcrlsession = null; 36 37 42 public void work() throws ServiceExecutionFailedException { 43 long polltime = getNextInterval(); 44 ICreateCRLSessionLocal session = getCreateCRLSession(); 45 if (session != null) { 46 session.createCRLs(getAdmin(), polltime*1000); 47 } 48 } 49 50 51 public ICreateCRLSessionLocal getCreateCRLSession(){ 52 if(createcrlsession == null){ 53 try { 54 ICreateCRLSessionLocalHome home = (ICreateCRLSessionLocalHome) getLocator().getLocalHome(ICreateCRLSessionLocalHome.COMP_NAME); 55 this.createcrlsession = home.create(); 56 } catch (CreateException e) { 57 log.error(e); 58 } 59 } 60 61 return createcrlsession; 62 } 63 } 64 | Popular Tags |