Registers a session event listener.
968173
@SuppressWarnings("unchecked")
  public Listener<Void> onEvent(String event, Runnable callback) {
    return onEvent(event, v -> callback.run());
  }
1119719
public static void registerLifeCycleObserver(@NonNull Application application, @NonNull LifecycleListener listener) {
        application.registerActivityLifecycleCallbacks(new LifeCycleController(listener).createLifecycleCallback());
    }
826185
public <T> void register(Class<T> event, EventObserver<T> observer){
        if(event == null){
            throw new IllegalArgumentException("Null Event type passed to register");
        }
        if(observer == null){
            throw new IllegalArgumentException("Null observer passed to register");
        }
        nullSafeGet(event).add(observer);
    }
1298398
@Override
    public void register(Object listener)
    {
        if (!(listener instanceof EventListener))
        {
            throw new IllegalArgumentException("Listener must implement EventListener");
        }
        listeners.add(((EventListener) listener));
    }
1301941
private function registerObserver()
    {
        if ($this->observer) {
            return;
        }

        $this->observer = new \chilimatic\lib\session\observer\Session($this);
        $this->engine->attach($this->observer);
    }
817050
function(session) {
  EventEmitter.call(this);
  clone(session, this, FRONTEND_SESSION_FIELDS);
  // deep copy for settings
  this.settings = dclone(session.settings);
  this.__session__ = session;
}
1335308
private function registerListeners(): void
    {
        Event::listen(ReactionHasBeenAdded::class, IncrementAggregates::class);
        Event::listen(ReactionHasBeenRemoved::class, DecrementAggregates::class);
    }
574612
void triggerSessionRequested(Jingle initJin) {

        JingleSessionRequestListener[] jingleSessionRequestListeners;

        // Make a synchronized copy of the listenerJingles
        synchronized (this.jingleSessionRequestListeners) {
            jingleSessionRequestListeners = new JingleSessionRequestListener[this.jingleSessionRequestListeners.size()];
            this.jingleSessionRequestListeners.toArray(jingleSessionRequestListeners);
        }

        // ... and let them know of the event
        JingleSessionRequest request = new JingleSessionRequest(this, initJin);
        for (int i = 0; i < jingleSessionRequestListeners.length; i++) {
            jingleSessionRequestListeners[i].sessionRequested(request);
        }
    }
1089075
protected boolean register(IEventListener listener) {
        log.debug("register - listener: {}", listener);
        boolean registered = listeners.add(listener);
        if (registered) {
            listenerStats.increment();
            // prepare response for new client
            ownerMessage.addEvent(Type.CLIENT_INITIAL_DATA, null, null);
            if (!isPersistent()) {
                ownerMessage.addEvent(Type.CLIENT_CLEAR_DATA, null, null);
            }
            if (!attributes.isEmpty()) {
                ownerMessage.addEvent(new SharedObjectEvent(Type.CLIENT_UPDATE_DATA, null, getAttributes()));
            }
            // we call notifyModified here to send response if we're not in a beginUpdate block
            notifyModified();
        }
        return registered;
    }
913194
private void registerEventListeners(final Properties props, final URLClassLoader classLoader, final AbstractPlugin plugin)
            throws Exception {
        final String eventListenerClasses = props.getProperty(Plugin.PLUGIN_EVENT_LISTENER_CLASSES);
        final String[] eventListenerClassArray = eventListenerClasses.split(",");

        for (final String eventListenerClassName : eventListenerClassArray) {
            if (StringUtils.isBlank(eventListenerClassName)) {
                LOGGER.log(Level.INFO, "No event listener to load for plugin[name={0}]", plugin.getName());
                return;
            }

            LOGGER.log(Level.DEBUG, "Loading event listener[className={0}]", eventListenerClassName);

            final Class<?> eventListenerClass = classLoader.loadClass(eventListenerClassName);
            final AbstractEventListener<?> eventListener = (AbstractEventListener) eventListenerClass.newInstance();

            plugin.addEventListener(eventListener);

            LOGGER.log(Level.DEBUG, "Registered event listener[class={0}, eventType={1}] for plugin[name={2}]",
                    eventListener.getClass(), eventListener.getEventType(), plugin.getName());
        }
    }
907783
public void addEventListener(EventListener listener)
    throws IllegalArgumentException
    {
        
        if (listener instanceof HttpSessionAttributeListener)
            _sessionAttributeListeners.add(listener);
        if (listener instanceof HttpSessionListener)
            _sessionListeners.add(listener);
    }
1139803
protected function registerSessionBinder()
    {
        list($app, $me) = array($this->app, $this);

        $app->booted(function() use ($app, $me)
        {
            // If the current session has an "errors" variable bound to it, we will share
            // its value with all view instances so the views can easily access errors
            // without having to bind. An empty bag is set when there aren't errors.
            if ($me->sessionHasErrors($app))
            {
                $errors = $app['session.store']->get('errors');

                $app['view']->share('errors', $errors);
            }

            // Putting the errors in the view for every view allows the developer to just
            // assume that some errors are always available, which is convenient since
            // they don't have to continually run checks for the presence of errors.
            else
            {
                $app['view']->share('errors', new ViewErrorBag);
            }
        });
    }
857123
private void addHttpSessionIdListener(HttpSessionIdListener listener, boolean securityCheckNeeded) throws SecurityException {
        if (securityCheckNeeded) {
            SecurityManager sm = System.getSecurityManager();
            if (sm != null) {
                sm.checkPermission(perm);
            }
        }
        
        ((IHttpSessionContext31)this.getSessionContext()).addHttpSessionIdListener(listener, name);
    }
864685
private function registerEventListeners()
    {
        $listeners = $this->getListeners();
        foreach ($listeners as $listenerKey => $listenerValues) {
            foreach ($listenerValues as $listenerValue) {
                \Event::listen($listenerKey,
                    $listenerValue
                );
            }
        }
    }
312968
def add_listener(self, listener):
        
        self.logger.debug('installing listener %r', listener)
        if not isinstance(listener, SessionListener):
            raise SessionError("Listener must be a SessionListener type")
        with self._lock:
            self._listeners.add(listener)
1294099
private function register_event_listener() {

		$cron_array = _get_cron_array();
		if ( ! $cron_array ) {
			return;
		}

		$hooks = array_reduce(
			$cron_array,
			function ( $hooks, $crons ) {

				return array_merge( $hooks, array_keys( $crons ) );
			},
			[]
		);

		$profile_cb = function () {

			$this->cron_action_profile();
		};

		array_walk(
			$hooks,
			function ( $hook ) use ( $profile_cb ) {

				// Please note that "(int) ( PHP_INT_MAX + 1 )" is the lowest possible integer.
				add_action( $hook, $profile_cb, (int) ( PHP_INT_MAX + 1 ) );
				add_action( $hook, $profile_cb, PHP_INT_MAX );
			}
		);

		self::$ran = TRUE;
	}
1008389
public void addLifecycleListener(java.util.EventListener listener) {
        String listenerClassName = getClassName(listener);
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) {
                logger.entering(CLASS_NAME, "addLifecycleListener : listenerClass = " + listenerClassName);     
        }       

        if (listener != null) {
            if (listener instanceof javax.servlet.ServletContextListener) {
                addServletContextListener(listener);
            }
            if (listener instanceof javax.servlet.ServletContextAttributeListener) {
                // add to the context attr listener list
                servletContextLAttrListeners.add(listener);
            }

            if (listener instanceof javax.servlet.http.HttpSessionListener) {
                // add to the session listener list
                this.sessionCtx.addHttpSessionListener((javax.servlet.http.HttpSessionListener) listener, name);

                // 434577
                // add to a mirror list because we can't get access to the list
                // the
                // session context is holding on to later on.

                this.sessionListeners.add(listener);
                this.addedSessionListeners.add(listener);
            }
            
            // Servlet 3.1
            checkForSessionIdListenerAndAdd(listener);

            // \PK34418 begins
            if (listener instanceof javax.servlet.http.HttpSessionAttributeListener) {
                // add to the session attribute listener list
                if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) {
                    logger
                            .logp(Level.FINE, CLASS_NAME, "addLifecycleListener",
                                    "listener instanceof javax.servlet.http.HttpSessionAttributeListener");
                    logger.logp(Level.FINE, CLASS_NAME, "addLifecycleListener", "name : " + name);
                }
                this.sessionCtx.addHttpSessionAttributeListener((HttpSessionAttributeListener) listener, name);

                // 434577
                // add to a mirror list because we can't get access to the list
                // the
                // session context is holding on to later on.

                this.sessionAttrListeners.add(listener);
                this.addedSessionAttrListeners.add(listener);

            }// PK34418

            // 2.4 Listeners
            if (listener instanceof javax.servlet.ServletRequestListener) {
                servletRequestListeners.add(listener);
            }
            if (listener instanceof javax.servlet.ServletRequestAttributeListener) {
                servletRequestLAttrListeners.add(listener);
            }

            if (listener instanceof javax.servlet.http.HttpSessionActivationListener) {
                sessionActivationListeners.add(listener);
            }

            if (listener instanceof javax.servlet.http.HttpSessionBindingListener) {
                sessionBindingListeners.add(listener);
            }
        }
        logger.exiting(CLASS_NAME, "addLifecycleListener");
    }