1 13 package info.magnolia.module.workflow.jcr; 14 15 import info.magnolia.module.workflow.WorkflowConstants; 16 import openwfe.org.ServiceException; 17 import openwfe.org.embed.impl.engine.FsPersistedEngine; 18 import openwfe.org.embed.impl.engine.PersistedEngine; 19 import openwfe.org.engine.Definitions; 20 import openwfe.org.engine.expool.ExpressionPool; 21 import openwfe.org.engine.participants.Participant; 22 import openwfe.org.engine.participants.ParticipantMap; 23 24 import org.slf4j.Logger; 25 import org.slf4j.LoggerFactory; 26 27 28 32 public class JCRPersistedEngine extends PersistedEngine { 33 34 private JCRExpressionStore eStore = null; 35 36 private final static Logger log = LoggerFactory.getLogger(FsPersistedEngine.class.getName()); 37 38 public JCRPersistedEngine() throws ServiceException { 39 this(WorkflowConstants.ENGINE_NAME, true); 40 41 } 42 43 public Participant getParticipant(String name) { 44 ParticipantMap pm = Definitions.getParticipantMap(getContext()); 45 if (pm == null) { 46 log.error("get participant failed, the map retrieved was null for:" + name); 47 return null; 48 } 49 return pm.get(name); 50 } 51 52 55 public JCRPersistedEngine(final String engineName, final boolean cached) throws ServiceException { 56 super(engineName, cached); 57 super.setDaemon(true); 58 59 final java.util.Map esParams = new java.util.HashMap (1); 61 62 this.eStore = new JCRExpressionStore(); 63 64 this.eStore.init(Definitions.S_EXPRESSION_STORE, getContext(), esParams); 65 66 getContext().add(this.eStore); 67 68 } 69 70 public JCRExpressionStore getExpStore() { 71 return this.eStore; 72 } 73 74 public ExpressionPool getExpressionPool() { 75 return super.getExpressionPool(); 76 } 77 78 } 79 | Popular Tags |