Returns a list of events associated with a component.

@param component Component of interest.
@param forceCreate If true and no current list exists, one will be created.
@return The list of associated events (may be null).
176239
private static List<ActionListener> getActionListeners(BaseComponent component, boolean forceCreate) {
        @SuppressWarnings("unchecked")
        List<ActionListener> ActionListeners = (List<ActionListener>) component.getAttribute(EVENT_LISTENER_ATTR);
        
        if (ActionListeners == null && forceCreate) {
            ActionListeners = new ArrayList<>();
            component.setAttribute(EVENT_LISTENER_ATTR, ActionListeners);
        }
        
        return ActionListeners;
    }
1138722
public void frameworkEvent(FrameworkEvent frameworkEvent) {
        final String topic = getTopic(frameworkEvent);

        // Bail quickly if the event is one that should be ignored
        if (topic == null) {
            return;
        }

        // Event properties
        Map<String, Object> eventProperties = new HashMap<String, Object>();

        // "event" --> the original event object
        eventProperties.put(EventConstants.EVENT, frameworkEvent);

        // Non-null result from getBundle
        // "bundle.id" --> source bundle id as Long
        // "bundle.symbolicName" --> source bundle's symbolic name
        // "bundle" --> the source bundle object
        Bundle bundle = frameworkEvent.getBundle();
        if (bundle != null) {
            eventProperties.put(EventConstants.BUNDLE_ID, Long.valueOf(bundle.getBundleId()));
            String symbolicName = bundle.getSymbolicName();
            if (symbolicName != null) {
                eventProperties.put(EventConstants.BUNDLE_SYMBOLICNAME, symbolicName);
            }
            eventProperties.put(EventConstants.BUNDLE, bundle);
        }

        // Non-null result from getThrowable
        // "exception.class" --> fully-qualified class name of attached exception
        // "exception.message" --> the message from the attached exception
        // "exception" --> the Throwable associated with the event
        Throwable throwable = frameworkEvent.getThrowable();
        if (throwable != null) {
            eventProperties.put(EventConstants.EXCEPTION_CLASS, throwable.getClass().getName());
            String message = throwable.getMessage();
            if (message != null) {
                eventProperties.put(EventConstants.EXCEPTION_MESSAGE, message);
            }
            eventProperties.put(EventConstants.EXCEPTION, throwable);
        }

        // Construct and fire the event
        Event event = new Event(topic, eventProperties);
        eventAdmin.postEvent(event);
    }
1243627
protected Collection<? extends CasEvent> getCasTicketGrantingTicketCreatedEventsFor(final String principal) {
        val type = CasTicketGrantingTicketCreatedEvent.class.getName();
        LOGGER.debug("Retrieving events of type [{}] for [{}]", type, principal);

        val date = ZonedDateTime.now(ZoneOffset.UTC)
            .minusDays(casProperties.getAuthn().getAdaptive().getRisk().getDaysInRecentHistory());
        return casEventRepository.getEventsOfTypeForPrincipal(type, principal, date);
    }
399578
public java.util.List<EventTopic> getEventTopics() {
        if (eventTopics == null) {
            eventTopics = new com.amazonaws.internal.SdkInternalList<EventTopic>();
        }
        return eventTopics;
    }
880137
private List<Event> filterEvents(List<Event> events) {
        List<Event> filteredEvents = new ArrayList<Event>();
        for (Event event : events) {
            if (!filter(event)) {
                filteredEvents.add(event);
            }
        }
        return filteredEvents;
    }
943184
public List<T> getEvents() {
        List<T> returnEvents = new ArrayList<T>();

        if (bufferedEvents.isEmpty()) {
            return returnEvents;
        }

        int returnSize = isBufferFull() ? bufferSize : bufferedEvents.size();

        for (int i = 0 ; i < returnSize ; i++) {
            returnEvents.add(bufferedEvents.remove(0));
        }

        return returnEvents;
    }
24444
@Beta
    public EventGridEvent[] deserializeEventGridEvents(final String requestContent, final SerializerAdapter<ObjectMapper> serializerAdapter) throws IOException {
        EventGridEvent[] eventGridEvents = serializerAdapter.<EventGridEvent[]>deserialize(requestContent, EventGridEvent[].class);
        for (EventGridEvent receivedEvent : eventGridEvents) {
            if (receivedEvent.data() == null) {
                continue;
            } else {
                final String eventType = receivedEvent.eventType();
                final Type eventDataType;
                if (SystemEventTypeMappings.containsMappingFor(eventType)) {
                    eventDataType = SystemEventTypeMappings.getMapping(eventType);
                } else if (containsCustomEventMappingFor(eventType)) {
                    eventDataType = getCustomEventMapping(eventType);
                } else {
                    eventDataType = null;
                }
                if (eventDataType != null) {
                    final String eventDataAsString = serializerAdapter.serializeRaw(receivedEvent.data());
                    final Object eventData = serializerAdapter.<Object>deserialize(eventDataAsString, eventDataType);
                    setEventData(receivedEvent, eventData);
                }
            }
        }
        return eventGridEvents;
    }
348034
public static ActionListener getListener(BaseComponent component, String eventName) {
        return (ActionListener) component.getAttribute(ActionListener.getAttrName(eventName));
    }
960015
public static ftw_events[] get_filtered(nitro_service service, String filter) throws Exception
	{
		ftw_events obj = new ftw_events();
		options option = new options();
		option.set_filter(filter);
		ftw_events[] response = (ftw_events[]) obj.getfiltered(service, option);
		return response;
	}
1238805
@Override
    public void componentMetaDataCreated(MetaDataEvent<ComponentMetaData> event) {
        JaccService js = jaccService.getService();
        if (js != null) {
            MetaData metaData = event.getMetaData();
            if (metaData instanceof BeanMetaData) {
                BeanMetaData bmd = (BeanMetaData) metaData;
                js.propagateEJBRoles(bmd.j2eeName.getApplication(), bmd.j2eeName.getModule(), bmd.enterpriseBeanName, bmd.ivRoleLinkMap,
                                     JaccUtil.convertMethodInfoList(JaccUtil.mergeMethodInfos(bmd)));
            }
        }
    }
417676
public java.util.List<VolumeStatusEvent> getEvents() {
        if (events == null) {
            events = new com.amazonaws.internal.SdkInternalList<VolumeStatusEvent>();
        }
        return events;
    }
744172
@Override
	public List<Component> findComponentChildren( String applicationName, String componentName ) {

		if( componentName == null )
			this.logger.fine( "Request: list root components in " + applicationName + "." );
		else
			this.logger.fine( "Request: find components that can be deployed under a " + componentName + " component in " + applicationName + "." );

		List<Component> result = new ArrayList<> ();
		Application app = this.manager.applicationMngr().findApplicationByName( applicationName );
		if( app != null ) {
			Component comp;
			if( componentName == null )
				result.addAll( app.getTemplate().getGraphs().getRootComponents());
			else if(( comp = ComponentHelpers.findComponent( app, componentName )) != null )
				result.addAll( ComponentHelpers.findAllChildren( comp ));
			else
				this.logger.fine( "No component called " + componentName + " was found in " + applicationName + "." );
		}

		return result;
	}
472785
protected void addComponent(Object o)
    {
        if (!LazyList.contains(_components,o))
        {
            _components = LazyList.add(_components,o);
            if(log.isDebugEnabled())log.debug("add component: "+o);
            ComponentEvent event = new ComponentEvent(this,o);
            for(int i=0;i<LazyList.size(_eventListeners);i++)
            {
                EventListener listener=(EventListener)LazyList.get(_eventListeners,i);
                if (listener instanceof ComponentListener)
                    ((ComponentListener)listener).addComponent(event);
            }
        }
    }
111281
public Iterable<DFactory> queryByCreatedDate(java.util.Date createdDate) {
    return queryByField(null, DFactoryMapper.Field.CREATEDDATE.getFieldName(), createdDate);
  }
489169
public List<EventDefinition> getEvents(final EventType _eventType)
    {
        if (!this.eventChecked) {
            this.eventChecked = true;
            try {
                EventDefinition.addEvents(this);
            } catch (final EFapsException e) {
                AbstractAdminObject.LOG.error("Could not read events for Name:; {}', UUID: {}",  this.name, this.uuid);
            }
        }
        return this.events.get(_eventType);
    }
1195097
@Transactional
	public List<DeferredEvent> getDeferredEvents() {
		if (log.isDebugEnabled()) {
			Query query = m_entityManager.createNamedQuery("DeferredEventsDebug");
			@SuppressWarnings("unchecked")
			List<DeferredEvent> result = query.getResultList();
			log.debug("#found {} deferred events",result.size());
			for (DeferredEvent deferredEvent:result) {
				log.debug("#deferred event: {} fire: {} now: {} created: {}",deferredEvent.getEventType(), deferredEvent.getFire(),new Date().getTime(),deferredEvent.getCreated());
			}
		}
		long now = new Date().getTime();
		Query query = m_entityManager.createNamedQuery("DeferredEvents").setParameter("rightNow", now);
		@SuppressWarnings("unchecked")
		List<DeferredEvent> result = query.getResultList();
		log.debug("found {} deferred events",result.size());
		return result;
	}
464644
public synchronized void addComponent(ComponentEvent event)
    {
        try
        {
            if(log.isDebugEnabled())log.debug("Component added "+event);
            Object o=event.getComponent();
            
            ModelMBean mbean=ModelMBeanImpl.mbeanFor(o);
            if (mbean==null)
                log.warn("No MBean for "+o);
            else
            {
                ObjectName oName=null;
                if (mbean instanceof ModelMBeanImpl)
                {
                    ((ModelMBeanImpl)mbean).setBaseObjectName(getObjectName().toString());
                    oName=
                        getMBeanServer().registerMBean(mbean,null).getObjectName();
                }
                else
                {
                    oName=uniqueObjectName(getMBeanServer(),
                                           o,
                                           getObjectName().toString());
                    oName=getMBeanServer().registerMBean(mbean,oName)
                        .getObjectName();
                }
                Holder holder = new Holder(oName,mbean);
                _mbeanMap.put(o,holder);
            }
        }
        catch(Exception e)
        {
            log.warn(LogSupport.EXCEPTION,e);
        }
    }