Package org.osgi.service.event

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


                    Event event = new Event(topic, props);
                    props.put("type", topic.substring(topic.lastIndexOf("/") + 1).toLowerCase());
                    props.put("timestamp", System.currentTimeMillis());
                    props.put("username", username);
                    props.put("subject", subject);
                    eventAdmin.postEvent(event);
                } finally {
                    bundleContext.ungetService(ref);
                }
            }
        }
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

        @SuppressWarnings("unchecked")
        final Dictionary<Object, Object> properties = (Dictionary<Object, Object>) context.getConfiguration().get(JOB_CONFIG);
        final EventAdmin ea = this.eventAdmin;
        if ( ea != null ) {
            try {
                ea.postEvent(new Event(topic, properties));
            } catch (IllegalArgumentException iae) {
                this.logger.error("Scheduled event has illegal topic: " + topic, iae);
            }
        } else {
            this.logger.warn("Unable to send timed event as no event admin service is available.");
View Full Code Here

                    try {
                        session = this.createSession();
                        final Node eventNode = (Node)session.getItem(info.nodePath);
                        final EventAdmin localEA = this.eventAdmin;
                        if ( localEA != null ) {
                            localEA.postEvent(this.readEvent(eventNode));
                        } else {
                            this.logger.error("Unable to post event as no event admin is available.");
                        }
                    } catch (Exception ex) {
                        this.logger.error("Exception during reading the event from the repository.", ex);
View Full Code Here

        props.put(MAPPING_CLASS, mapper.getMappedClasses());
        props.put(MAPPING_NODE_TYPE, mapper.getMappedNodeTypes());

        // create and fire the event
        Event event = OsgiUtil.createEvent(sourceBundle, null, eventName, props);
        ea.postEvent(event);
    }

    // ---------- SCR Integration ---------------------------------------------

    /** Activates this component, called by SCR before registering as a service */
 
View Full Code Here

        // timestamp the event
        table.put(EventConstants.TIMESTAMP,
            new Long(System.currentTimeMillis()));

        // create the event
        ea.postEvent(new Event(eventName, table));
    }

    // ---------- Implementation helpers --------------------------------------

    /** If uri is a virtual URI returns the real URI, otherwise returns null */
 
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

            RemoteServiceAdminEvent rsaEvent =
                new RemoteServiceAdminEvent(RemoteServiceAdminEvent.EXPORT_REGISTRATION, source, registration
                    .getExportReference(), registration.getException());
            EventAdmin eventAdmin = getEventAdmin();
            if (eventAdmin != null) {
                eventAdmin.postEvent(wrap(rsaEvent));
            }
            for (Object listener : listeners.getServices()) {
                RemoteServiceAdminListener rsaListener = (RemoteServiceAdminListener)listener;
                rsaListener.remoteAdminEvent(rsaEvent);
            }
View Full Code Here

        RemoteServiceAdminEvent rsaEvent =
            new RemoteServiceAdminEvent(RemoteServiceAdminEvent.IMPORT_REGISTRATION, source, registration
                .getImportReference(), registration.getException());
        EventAdmin eventAdmin = getEventAdmin();
        if (eventAdmin != null) {
            eventAdmin.postEvent(wrap(rsaEvent));
        }
        for (Object listener : listeners.getServices()) {
            RemoteServiceAdminListener rsaListener = (RemoteServiceAdminListener)listener;
            rsaListener.remoteAdminEvent(rsaEvent);
        }
View Full Code Here

     * {@inheritDoc}
     */
    public void postEvent(Event event) {
        EventAdmin eventAdmin = getEventAdmin();
        if (eventAdmin != null) {
            eventAdmin.postEvent(event);
        }
    }

    /**
     * {@inheritDoc}
 
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.