Package org.osgi.service.event

Examples of org.osgi.service.event.EventAdmin.postEvent()


        }
        Dictionary<String, Object> props = createDefaultProperties(bundle, contextPath);
        if (cause != null) {
            props.put(EventConstants.EXCEPTION, cause);
        }
        eventAdmin.postEvent(new Event(WebContainerConstants.TOPIC_FAILED, props));
    }
   
    /**
     * Dispatch a FAILED event indicating a contextPath collision
     *
 
View Full Code Here


            return;
        }
        Dictionary<String, Object> props = createDefaultProperties(bundle, contextPath);
        props.put(WebContainerConstants.COLLISION, contextPath);
        props.put(WebContainerConstants.COLLISION_BUNDLES, bundleId);
        eventAdmin.postEvent(new Event(WebContainerConstants.TOPIC_FAILED, props));
    }
   
    /**
     * Dispatch an event to the appropriate listeners.
     *
 
View Full Code Here

        EventAdmin eventAdmin = getEventAdmin();
        if (eventAdmin == null) {
            return;
        }
        Dictionary<String, Object> props = createDefaultProperties(bundle, contextPath);
        eventAdmin.postEvent(new Event(topic, props));
    }

    private Dictionary<String, Object> createDefaultProperties(Bundle bundle, String contextPath) {
        Dictionary<String, Object> props = new Hashtable<String, Object>();
       
View Full Code Here

                    topic = EventConstants.TOPIC_WAITING;
                    break;
                default:
                    throw new IllegalStateException("Unknown blueprint event type: " + event.getType());
            }
            eventAdmin.postEvent(new Event(topic, props));
        }

        /**
         * Perform cleanup at Blueprint extender shutdown.
         */
 
View Full Code Here

           
            if (params.get(CIShellEventConstants.EVENT_ID) == null)
                params.put(CIShellEventConstants.EVENT_ID, idGen.newID());
           
            EventAdmin eventAdmin = (EventAdmin) eventReg.getService();
            eventAdmin.postEvent(new Event(CIShellEventConstants.BASE_TOPIC, params));
        }
    }
       
    private static final Algorithm NULL_ALG = new Algorithm() {
        public Data[] execute() {
View Full Code Here

    }

    public void postEvent(Event event) {
        EventAdmin eventAdmin = (EventAdmin) eventAdminTracker.getService();
        if (eventAdmin != null) {
            eventAdmin.postEvent(event);
        } else {
            warning("EventAdmin is unavailable", null);
        }
    }
}
View Full Code Here

                        LOGGER.warn("unknown-event-property", key);
                    }
                }
            }
            // post the event (asynchronous)
            sa.postEvent(new Event(DefaultMetrics.TOPIC, dict));
        }
    }

    /**
     * Release any resources used by this handler.
View Full Code Here

                topic = EventConstants.TOPIC_FEATURES_UNINSTALLED;
                break;
            default:
                throw new IllegalStateException("Unknown features event type: " + event.getType());
        }
        eventAdmin.postEvent(new Event(topic, props));
    }

    public void repositoryEvent(RepositoryEvent event) {
        EventAdmin eventAdmin = tracker.getService();
        if (eventAdmin == null) {
View Full Code Here

                topic = EventConstants.TOPIC_REPOSITORY_REMOVED;
                break;
            default:
                throw new IllegalStateException("Unknown repository event type: " + event.getType());
        }
        eventAdmin.postEvent(new Event(topic, props));
    }
}
View Full Code Here

    private void dispatch(String topic, Dictionary<String, Object> props) {
        EventAdmin eventAdmin = getEventAdmin();
        if (eventAdmin == null) {
            return;
        }
        eventAdmin.postEvent(new Event(topic, props));
    }

    private Dictionary<String, Object> createDefaultProperties(Bundle bundle, String contextPath) {
        Dictionary<String, Object> props = new Hashtable<String, Object>();
       
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.