Search in sources :

Example 71 with Event

use of org.osgi.service.event.Event in project sling by apache.

the class MongoDBContext method notifyUpdated.

public void notifyUpdated(final String[] info) {
    final Dictionary<String, Object> props = new Hashtable<String, Object>();
    props.put(SlingConstants.PROPERTY_PATH, this.rootWithSlash + info[0] + '/' + info[1]);
    props.put("event.distribute", "");
    final Event event = new Event(SlingConstants.TOPIC_RESOURCE_CHANGED, props);
    this.eventAdmin.postEvent(event);
}
Also used : Hashtable(java.util.Hashtable) Event(org.osgi.service.event.Event)

Example 72 with Event

use of org.osgi.service.event.Event in project sling by apache.

the class MongoDBContext method notifyAddeed.

public void notifyAddeed(final String[] info) {
    final Dictionary<String, Object> props = new Hashtable<String, Object>();
    props.put(SlingConstants.PROPERTY_PATH, this.rootWithSlash + info[0] + '/' + info[1]);
    props.put("event.distribute", "");
    final Event event = new Event(SlingConstants.TOPIC_RESOURCE_ADDED, props);
    this.eventAdmin.postEvent(event);
}
Also used : Hashtable(java.util.Hashtable) Event(org.osgi.service.event.Event)

Example 73 with Event

use of org.osgi.service.event.Event in project sling by apache.

the class ListTreeCommand method log.

private void log(String text, long start, long end) {
    Map<String, Object> props = new HashMap<>();
    props.put(CommandExecutionProperties.RESULT_TEXT, text);
    props.put(CommandExecutionProperties.RESULT_STATUS, Boolean.TRUE);
    props.put(CommandExecutionProperties.ACTION_TYPE, getClass().getSimpleName());
    props.put(CommandExecutionProperties.ACTION_TARGET, getPath());
    props.put(CommandExecutionProperties.TIMESTAMP_START, start);
    props.put(CommandExecutionProperties.TIMESTAMP_END, end);
    Event event = new Event(CommandExecutionProperties.REPOSITORY_TOPIC, props);
    eventAdmin.postEvent(event);
}
Also used : HashMap(java.util.HashMap) Event(org.osgi.service.event.Event)

Example 74 with Event

use of org.osgi.service.event.Event in project jersey by jersey.

the class WebAppContextListener method contextInitialized.

@Override
public void contextInitialized(final ServletContextEvent sce) {
    if (getEa() != null) {
        final String contextPath = sce.getServletContext().getContextPath();
        getEa().sendEvent(new Event("jersey/test/DEPLOYED", new HashMap<String, String>() {

            {
                put("context-path", contextPath);
            }
        }));
    }
}
Also used : HashMap(java.util.HashMap) ServletContextEvent(javax.servlet.ServletContextEvent) Event(org.osgi.service.event.Event)

Example 75 with Event

use of org.osgi.service.event.Event in project eclipse.themes.darker by jinmingjian.

the class DarkerThemer method onExecute.

@Execute
public void onExecute() {
    eventBroker.subscribe(IThemeEngine.Events.THEME_CHANGED, new EventHandler() {

        public void handleEvent(Event event) {
            ITheme currentTheme = (ITheme) event.getProperty(IThemeEngine.Events.THEME);
            // THEME_DARKER_PREF_THEMEENABLED, false))
            if (currentTheme.getId().equals(THEME_DARKER_ID)) {
                setupPreferences();
                isLastThemeDarker = true;
                DarkerWeavingHook.enableWeaving();
                hookDarkerCore();
            } else if (isLastThemeDarker) {
                DarkerWeavingHook.disableWeaving();
                setToDefaultPreferences();
            }
        }
    });
}
Also used : ITheme(org.eclipse.e4.ui.css.swt.theme.ITheme) EventHandler(org.osgi.service.event.EventHandler) Event(org.osgi.service.event.Event) Execute(org.eclipse.e4.core.di.annotations.Execute)

Aggregations

Event (org.osgi.service.event.Event)142 Test (org.junit.Test)79 HashMap (java.util.HashMap)48 Hashtable (java.util.Hashtable)44 MetacardImpl (ddf.catalog.data.impl.MetacardImpl)23 ContentTypePredicate (ddf.catalog.pubsub.predicate.ContentTypePredicate)20 EventAdmin (org.osgi.service.event.EventAdmin)19 GeospatialPredicate (ddf.catalog.pubsub.predicate.GeospatialPredicate)18 Predicate (ddf.catalog.pubsub.predicate.Predicate)16 ArrayList (java.util.ArrayList)16 ActivityEvent (org.codice.ddf.activities.ActivityEvent)13 EventHandler (org.osgi.service.event.EventHandler)13 SubscriptionFilterVisitor (ddf.catalog.pubsub.internal.SubscriptionFilterVisitor)11 Date (java.util.Date)11 Job (org.apache.sling.event.jobs.Job)9 Map (java.util.Map)8 List (java.util.List)7 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)7 JobManager (org.apache.sling.event.jobs.JobManager)7 JobConsumer (org.apache.sling.event.jobs.consumer.JobConsumer)7