/*
(non-Javadoc)

@see com.ibm.wsspi.security.audit.AuditService#registerEvents()
434545
@Override
    public void unRegisterEvents(String handlerName) {

        if (handlerEventsMap.containsKey(handlerName)) {

            if (handlerEventsMap.size() == 1) {
                auditStopped(null);
            }

            handlerEventsMap.remove(handlerName);
        }

        if (tc.isDebugEnabled()) {
            Tr.debug(tc, "handlerEventsMap: " + handlerEventsMap.toString());
        }
    }
364912
private void addEvents() {
        if (clusterEvents != null && clusterEvents.size() > eventCounter) {
            ClusterEvent ev = clusterEvents.get(eventCounter);
            eventCounter++;
            JLabel eventMarker = new JLabel(ev.getType().substring(0, 1));

            eventMarker.setPreferredSize(new Dimension(20, y_offset_top));
            eventMarker.setSize(new Dimension(20, y_offset_top));
            eventMarker.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
            int x = (int) (ev.getTimestamp() / processFrequency / x_resolution);

            eventMarker.setLocation(x - 10, 0);
            eventMarker.setToolTipText(ev.getType() + " at " + ev.getTimestamp() + ": " + ev.getMessage());
            eventPanel.add(eventMarker);
            eventLabelList.add(eventMarker);
            eventPanel.repaint();
        }
    }
527134
public synchronized void registerSSLConfigChangeListener(SSLConfigChangeListener listener, SSLConfigChangeEvent event) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.entry(tc, "registerSSLConfigChangeListener", new Object[] { listener, event });

        List<SSLConfigChangeListener> listenerList = sslConfigListenerMap.get(event.getAlias());

        if (listenerList != null) {
            // used to hold sslconfig -> list of listener references
            listenerList.add(listener);
            sslConfigListenerMap.put(event.getAlias(), listenerList);
        } else {
            listenerList = new ArrayList<SSLConfigChangeListener>();
            listenerList.add(listener);
            sslConfigListenerMap.put(event.getAlias(), listenerList);
        }

        // used to hold listener -> listener event references
        sslConfigListenerEventMap.put(listener, event);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.exit(tc, "registerSSLConfigChangeListener");
    }
61320
public synchronized void register(@NonNull EventHandlerWrapper eventHandler) {
        String type = eventHandler.type;
        List<EventHandlerWrapper> handlers = subscribers.get(eventHandler.type);
        if (handlers == null) {
            handlers = new ArrayList<>();
            subscribers.put(type, handlers);
        }
        handlers.add(eventHandler);
    }
623941
public void setRegisters(Register[] registers) {
        writeCount = registers != null ? registers.length : 0;
        this.registers = registers != null ? Arrays.copyOf(registers, registers.length) : null;
    }
1322172
public function registerEvents()
    {
        if (!empty($this->clientEvents)) {
            $js = [];
            foreach ($this->clientEvents as $event => $handle) {
                $js[] = "jQuery('#{$this->options['id']}').on('{$event}',{$handle});";
            }
            $this->getView()->registerJs(implode(PHP_EOL, $js));
        }
    }
359542
public void setRegisters(InputRegister[] registers) {
        byteCount = registers.length * 2;
        setDataLength(byteCount + 1);

        this.registers = Arrays.copyOf(registers, registers.length);
    }
369679
protected function registerServerEvents(array $events): void
    {
        $eventInfo = [];

        // register event to swoole
        foreach ($events as $name => $cb) {
            // is a Closure callback, add by self::onSwoole()
            if (\is_object($cb) && \method_exists($cb, '__invoke')) {
                $eventInfo[] = [$name, \get_class($cb)];
                $this->server->on($name, $cb);
                continue;
            }

            if (\is_string($cb)) {
                if (\is_int($name)) {
                    $name = $cb;
                }

                $method = SwooleEvent::getHandler($cb);
                if ($method && \method_exists($this, $method)) {
                    $eventInfo[] = [$name, static::class . "->$method"];
                    $this->server->on($name, [$this, $method]);
                } elseif (\function_exists($cb)) {
                    $eventInfo[] = [$name, $cb];
                    $this->server->on($name, $cb);
                }
            }
        }

        Show::table($eventInfo, 'Registered events to the server', [
            'showBorder' => 0,
            'columns'    => ['event name', 'swoole event handler']
        ]);
    }
961789
public void setResourceLogEvents(java.util.Collection<LogEvent> resourceLogEvents) {
        if (resourceLogEvents == null) {
            this.resourceLogEvents = null;
            return;
        }

        this.resourceLogEvents = new java.util.ArrayList<LogEvent>(resourceLogEvents);
    }
870751
private void initEventTypes(IoEventType... eventTypes) {
        if ((eventTypes == null) || (eventTypes.length == 0)) {
            eventTypes = DEFAULT_EVENT_SET;
        }

        // Copy the list of handled events in the event set
        this.eventTypes = EnumSet.of(eventTypes[0], eventTypes);
        
        // Check that we don't have the SESSION_CREATED event in the set
        if (this.eventTypes.contains( IoEventType.SESSION_CREATED )) {
            this.eventTypes = null;
            throw new IllegalArgumentException(IoEventType.SESSION_CREATED
                + " is not allowed.");
        }
    }
786996
protected function registerListeners()
    {
        $this->process->getDispatcher()->addListener(LogEvent::EVENT_NAME, function (LogEvent $event) {
            $this->data = $event->toArray();
            $this->stream();
        });
    }
259006
private void registerEventsForResourceBuilder(ResourceBuilderModel resourceBuilder) {
        List<? extends EventModel<?>> events = resourceBuilder.announceEvents();
        if(events == null) return;
        events.stream()
                .filter(event -> event.getAllInformations() != null)
                .flatMap(event -> event.getAllInformations().stream())
                .map(this::getRegisteredListForEvent)
                .forEach(list -> list.add(resourceBuilder));
    }
196161
protected final <U extends GenericEvent> void bind(
      EventBus eventBus,
      List<HandlerRegistration> registrations,
      Class<U> type,
      GenericEventHandler handler) {
    registrations.add(eventBus.addHandler(GenericEventType.getTypeOf(type), handler));
  }
720051
private function registerEvents()
    {
        $this->eventEmitter->on('runner.end', [$this, 'setTime']);

        $this->eventEmitter->on('test.failed', function (Test $test, $e) {
            $this->errors[] = [$test, $e];
        });

        $this->eventEmitter->on('test.passed', function () {
            $this->passing++;
        });

        $this->eventEmitter->on('test.pending', function () {
            $this->pending++;
        });
    }
986797
@Override
    public AuditEventOutputStream write(AuditEvent event) {
        if (LifeCycleContext.getInstance().getStatus().equals(RunStatus.RUNNING)) {
            try {
                ValidationManager.validateEvent(event);
                if (configContext.getFilters().isEmpty() || filterAccepts(event)) {
                    outputStream.write(event);
                }
            } catch (ValidationException e) {

            }
        }
        return this;
    }
1139533
public void addEvents(List<FlowEvent> events) throws IOException {
    List<Put> puts = new ArrayList<Put>(events.size());
    for (FlowEvent e : events) {
      puts.add(createPutForEvent(e));
    }
    Table eventTable = null;
    try {
      eventTable = hbaseConnection
          .getTable(TableName.valueOf(Constants.FLOW_EVENT_TABLE));
      eventTable.put(puts);
    } finally {
      if (eventTable != null) {
        eventTable.close();
      }
    }
  }
567852
protected function registerClientEvents() {
		if (!empty($this->clientEvents)) {
			$id = $this->options['id'];
			$js = [];
			foreach ($this->clientEvents as $event => $handler) {
				$js[] = "jQuery('#$id').on('$event', $handler);";
			}
			$this->view->registerJs(implode("\n", $js));
		}
	}