/* (non-Javadoc)
@see nz.co.senanque.workflow.WorkflowDAO#removeDeferredEvent(nz.co.senanque.workflow.instances.ProcessInstance, nz.co.senanque.process.instances.TaskBase)
425887
@Transactional
	public DeferredEvent removeDeferredEvent(ProcessInstance processInstance,
			TaskBase task) {
		List<DeferredEvent> deferredEvents = processInstance.getDeferredEvents();
		for (DeferredEvent deferredEvent: deferredEvents) {
			if (deferredEvent.getEventType() != EventType.DONE && deferredEvent.getTaskId().longValue() == task.getTaskId() && task.getProcessDefinitionName().equals(deferredEvent.getProcessDefinitionName())) {
				log.debug("killed deferred event processId {} taskId {} status {} {}", deferredEvent.getProcessInstance().getId(), deferredEvent.getId(), deferredEvent.getEventType() ,deferredEvent.getComment() );
				deferredEvent.setEventType(EventType.DONE);
				return deferredEvent;
			}
		}
		log.debug("failed to find deferred event processId {} {} taskId {}", processInstance.getId(), task.getProcessDefinitionName(), task.getTaskId());
		return null;
	}
1251628
@Override
  public void recordProcessInstanceEnd(String processInstanceId, String deleteReason, String activityId) {

    if (isHistoryLevelAtLeast(HistoryLevel.ACTIVITY)) {
      HistoricProcessInstanceEntity historicProcessInstance = getHistoricProcessInstanceEntityManager().findById(processInstanceId);

      if (historicProcessInstance != null) {
        historicProcessInstance.markEnded(deleteReason);
        historicProcessInstance.setEndActivityId(activityId);
        
        // Fire event
        ActivitiEventDispatcher activitiEventDispatcher = getEventDispatcher();
        if (activitiEventDispatcher != null && activitiEventDispatcher.isEnabled()) {
          activitiEventDispatcher.dispatchEvent(
              ActivitiEventBuilder.createEntityEvent(ActivitiEventType.HISTORIC_PROCESS_INSTANCE_ENDED, historicProcessInstance));
        }
        
      }
    }
  }
59033
def remove(self, event=None):
        
        observers = self._pool.get(event)
        if observers:
            self._pool[event] = []
280750
protected function removeLastEventIfOutsideWindowAndNonRecurring()
    {
        $events = $this->cal['VEVENT'];

        if (!empty($events)) {
            $lastIndex = sizeof($events) - 1;
            $lastEvent = $events[$lastIndex];

            if (!isset($lastEvent['RRULE']) || $lastEvent['RRULE'] === '' && $this->doesEventStartOutsideWindow($lastEvent)) {
                $this->eventCount--;

                unset($events[$lastIndex]);
            }

            $this->cal['VEVENT'] = $events;
        }
    }
705094
public synchronized void removeEventListener(EventListener listener)
    {
        if (_sessionManager != null)
            _sessionManager.removeEventListener(listener);

        _sessionListeners= LazyList.remove(_sessionListeners, listener);
        _requestListeners= LazyList.remove(_requestListeners, listener);
        _requestAttributeListeners= LazyList.remove(_requestAttributeListeners, listener);
        _contextAttributeListeners= LazyList.remove(_contextAttributeListeners, listener);
        super.removeEventListener(listener);
    }
446093
@Override
  public void remove( int offset, int length ) throws BadLocationException
  {
    super.remove( offset, length );
    processChangedLines( offset, 0 );
  }
418298
void removeEvent(EventId eventId) throws Exception {
		this.eventsBufferCache.remove(eventId);
		this.eventsBuffer.remove(eventId);
	}
630578
public void sessionDestroyed(final HttpSessionEvent event) {
		final HttpSession session = event.getSession();
		final String id = session.getId();
		SESSIONS.remove(id);
		counter--;
	}
421380
public void updateTimersAndEvents(ProcessDefinitionEntity processDefinition, 
      ProcessDefinitionEntity previousProcessDefinition, ParsedDeployment parsedDeployment) {
    
    Process process = parsedDeployment.getProcessModelForProcessDefinition(processDefinition);
    BpmnModel bpmnModel = parsedDeployment.getBpmnModelForProcessDefinition(processDefinition);

    eventSubscriptionManager.removeObsoleteMessageEventSubscriptions(previousProcessDefinition);
    eventSubscriptionManager.addMessageEventSubscriptions(processDefinition, process, bpmnModel);

    eventSubscriptionManager.removeObsoleteSignalEventSubScription(previousProcessDefinition);
    eventSubscriptionManager.addSignalEventSubscriptions(Context.getCommandContext(), processDefinition, process, bpmnModel);

    timerManager.removeObsoleteTimers(processDefinition);
    timerManager.scheduleTimers(processDefinition, process);
  }
952890
private void onConversationUndeleted(ConversationUndeleteEvent event) {
        handler.post(() -> listener.onConversationUndeleted(event));
        log("Event published " + event.toString());
    }
1222867
protected void fireLayerRemoveAllEvent(List<? extends L> removedObjects) {
		fireLayerHierarchyChangedEvent(
				new MapLayerHierarchyEvent(
						this,
						removedObjects,
						Type.REMOVE_ALL_CHILDREN,
						-1,
						isTemporaryLayer()));
	}
603221
ManagerEvent removeMember(BridgeLeaveEvent event)
    {
        List<BridgeEnterEvent> remaining = null;

        synchronized (members)
        {
            if (members.remove(event.getChannel()) != null
                    && members.size() == 2)
            {
                remaining = new ArrayList<>(members.values());
            }
        }

        // If we didn't remove anything, or we aren't at exactly 2 members,
        // there's nothing else for us to do
        if (remaining == null)
        {
            return null;
        }

        return buildBridgeEvent(
                BridgeEvent.BRIDGE_STATE_UNLINK,
                remaining);
    }
314051
@Override
    public void removeAllAppenders() {
        if (aai != null) {
            Vector appenders = new Vector();
            Enumeration iter = aai.getAllAppenders();
            if (iter == null) {
                return;
            }
            while (iter.hasMoreElements()) {
                appenders.add(iter.nextElement());
            }
            aai.removeAllAppenders();
            iter = appenders.elements();
            while (iter.hasMoreElements()) {
                fireRemoveAppenderEvent((Appender) iter.nextElement());
            }
        }
    }
348226
public void removedService(ServiceReference<FilterFactory> reference, FilterFactoryReference service) {
        bundleContext.ungetService(reference);
        if (service != null) {
            service.dispose();
            LOGGER.debug("removed filterFactory for application {}", applicationName);
        }
    }
413814
public function cleanupDeferredEventHandlers()
    {
        foreach ($this as $key => $property) {
            if ($property instanceof DeferredEvent) {
                $property->cleanup();
                $this->{$key} = null;
            }
        }
    }
1102548
@Override
  public void recordTaskProcessDefinitionChange(String taskId, String processDefinitionId) {
    if (isHistoryLevelAtLeast(HistoryLevel.ACTIVITY)) {
      HistoricTaskInstanceEntity historicTaskInstance = getHistoricTaskInstanceEntityManager().findById(taskId);
      if (historicTaskInstance != null) {
        historicTaskInstance.setProcessDefinitionId(processDefinitionId);
      }
    }
  }
1286019
synchronized void removeEvents(Table table) {
        final String tName = table.getName();

        try {
            final SQLiteDatabase db = dbHelper.getWritableDatabase();
            db.delete(tName, null, null);
        } catch (final SQLiteException e) {
            getConfigLogger().verbose("Error removing all events from table " + tName + " Recreating DB");
            deleteDB();
        } finally {
            dbHelper.close();
        }
    }