Package org.osgi.service.event

Examples of org.osgi.service.event.EventHandler


                        parallelCount.decrementAndGet();
                        return JobResult.OK;
                    }
                });
        final ServiceRegistration ehReg = this.registerEventHandler(NotificationConstants.TOPIC_JOB_FINISHED,
                new EventHandler() {

                    @Override
                    public void handleEvent(final Event event) {
                        count.incrementAndGet();
                    }
View Full Code Here


    /**
     * Send the event.
     */
    public void sendEvent(final Event event)
    {
        final EventHandler handlerService = this.obtain();
        if (handlerService == null)
        {
            return;
        }

        try
        {
            handlerService.handleEvent(event);
        }
        catch (final Throwable e)
        {
            // The spec says that we must catch exceptions and log them:
            LogWrapper.getLogger().log(
View Full Code Here

        final AtomicReference<Event> completionEventRef = new AtomicReference<Event>();
        final AtomicReference<Event> installEventRef = new AtomicReference<Event>();
        final CountDownLatch cdl = new CountDownLatch(1);

        EventHandler eventHandler = new EventHandler()
        {
            @Override
            public void handleEvent(Event event)
            {
                if (Constants.EVENTTOPIC_COMPLETE.equals(event.getTopic()))
View Full Code Here

        final AtomicReference<Event> completionEventRef = new AtomicReference<Event>();
        final AtomicReference<Event> installEventRef = new AtomicReference<Event>();
        final CountDownLatch cdl = new CountDownLatch(2);
       
        EventHandler eventHandler = new EventHandler()
        {
            @Override
            public void handleEvent(Event event)
            {
                if (Constants.EVENTTOPIC_COMPLETE.equals(event.getTopic()))
View Full Code Here

        final AtomicReference<Event> completionEventRef = new AtomicReference<Event>();
        final AtomicReference<Event> uninstallEventRef = new AtomicReference<Event>();
        final CountDownLatch cdl = new CountDownLatch(2);
       
        EventHandler eventHandler = new EventHandler()
        {
            @Override
            public void handleEvent(Event event)
            {
                if (Constants.EVENTTOPIC_COMPLETE.equals(event.getTopic()))
View Full Code Here

        final AtomicReference<Event> completionEventRef = new AtomicReference<Event>();
        final AtomicReference<Event> uninstallEventRef = new AtomicReference<Event>();
        final CountDownLatch cdl = new CountDownLatch(2);

        EventHandler eventHandler = new EventHandler()
        {
            @Override
            public void handleEvent(Event event)
            {
                if (Constants.EVENTTOPIC_COMPLETE.equals(event.getTopic()))
View Full Code Here

  private boolean              isLastThemeDarker = false;

  @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);
            // if (!prefDarker.getBoolean(
            // THEME_DARKER_PREF_THEMEENABLED, false))
View Full Code Here

            LOGGER.exiting(CLASS_NAME, "addingService", null);

            return null;
        }

        EventHandler service = (EventHandler) context.getService(reference);
        SecurityManager sm = System.getSecurityManager();
        if (sm != null)
        {
            for (String topic : topics)
            {
                if (!service.getClass().getProtectionDomain().implies(new TopicPermission(topic, TopicPermission.SUBSCRIBE)))
                {
                    LOGGER.finest("Service does not have permission to subscribe for topic " + topic + ", ignoring");
                    LOGGER.exiting(CLASS_NAME, "addingService", null);

                    return null;
View Full Code Here

        Dictionary<String, Object> properties = new Hashtable<String, Object>();
        properties.put(EventConstants.EVENT_TOPIC, "a/b/c/d");

        final CountDownLatch latch = new CountDownLatch(1);
        final AtomicInteger count = new AtomicInteger();
        ServiceRegistration sr = bundleContext.registerService(EventHandler.class.getName(), new EventHandler()
        {
            public void handleEvent(Event event)
            {
                try
                {
View Full Code Here

        Dictionary<String, Object> properties = new Hashtable<String, Object>();
        properties.put(EventConstants.EVENT_TOPIC, "a/b/c/*");

        final CountDownLatch latch = new CountDownLatch(1);
        final AtomicInteger count = new AtomicInteger();
        ServiceRegistration sr = bundleContext.registerService(EventHandler.class.getName(), new EventHandler()
        {
            public void handleEvent(Event event)
            {
                try
                {
View Full Code Here

TOP

Related Classes of org.osgi.service.event.EventHandler

Copyright © 2018 www.massapicom. 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.