code: @Override
  	public int deferredEvents() {
  		int ret = 0;
  		if (!m_shuttingDown && !m_freeze) {
  			List<DeferredEvent> deferredEvents;
  			try {
  				deferredEvents = getWorkflowDAO().getDeferredEvents();
  			} catch (RuntimeException e) {
  				return 0;
  			}
  			for (DeferredEvent deferredEvent: deferredEvents) {
  				final DeferredEvent finalDeferredEvent = deferredEvent;
  				ProcessInstance processInstance = finalDeferredEvent.getProcessInstance();
  				getBundleSelector().selectBundle(processInstance);
  				List<Lock> locks = ContextUtils.getLocks(processInstance,getLockFactory(),"nz.co.senanque.workflow.Executor.deferredEvents()");
  				LockTemplate lockTemplate = new LockTemplate(locks, new LockAction() {
  	
  					public void doAction() {
  						getWorkflowManager().executeDeferredEvent(finalDeferredEvent.getId());
  					}});
  				if (lockTemplate.doAction()) {
  					ret++;
  				}
  			}
  		}
  		return ret;
  	}
docs: /* (non-Javadoc)
  @see nz.co.senanque.workflow.Executor#deferredEvents()