Package org.osgi.service.event

Examples of org.osgi.service.event.Event


      {
        properties = new Hashtable();
      }
        properties.put("thread", Thread.currentThread().getId());
        properties.put("index", index);
      final Event event = new Event(topic, properties);
        if ( sync ) {
            getEventAdmin().sendEvent(event);
        } else {
            getEventAdmin().postEvent(event);
        }
View Full Code Here


     */
    private void execute() {
        this.waitForFinish();
        this.stop();
        logger.info("Finished eventing test {}", this.getClass().getSimpleName());
        Event currentEvent = null;
        Map<Long, Integer> orderVerifyMap = new HashMap<Long, Integer>();
        while((currentEvent =eventRecievedList.poll()) != null)
        {
          Integer index = (Integer)currentEvent.getProperty("index");
          Long threadId = (Long)currentEvent.getProperty("thread");
         
          if(index != null && threadId != null){
            Integer previousIndex = orderVerifyMap.get(threadId);
            if(previousIndex == null)
            {
View Full Code Here

                properties.put(EventConstants.SERVICE_OBJECTCLASS, objectClass);

                properties.put(EventConstants.SERVICE_PID, eventRef
                    .getProperty(EventConstants.SERVICE_PID));

                eventAdmin.postEvent(new Event(topic, properties));

                m_context.ungetService(ref);
            }
        }
    }
View Full Code Here

                properties.put(EventConstants.SERVICE_OBJECTCLASS, objectClass);

                properties.put(EventConstants.SERVICE_PID, eventRef
                    .getProperty(EventConstants.SERVICE_PID));
               
                eventAdmin.postEvent(new Event(topic, properties));

                m_context.ungetService(ref);
            }
        }
    }
View Full Code Here

    public void beforeExecute(CommandSession session, CharSequence command) {
        EventAdmin admin = (EventAdmin) tracker.getService();
        if (admin != null) {
            Properties props = new Properties();
            props.setProperty("command", command.toString());
            Event event = new Event("org/apache/felix/service/command/EXECUTING", props);
            admin.postEvent(event);
        }
    }
View Full Code Here

                properties.put(EventConstants.SERVICE_OBJECTCLASS, objectClass);

                properties.put(EventConstants.SERVICE_PID, eventRef.getProperty(
                    EventConstants.SERVICE_PID));
               
                eventAdmin.postEvent(new Event(topic, properties));

                m_context.ungetService(ref);
            }
        }
    }
View Full Code Here

                properties.put("upnp.serviceId", serviceId);
                properties.put("upnp.deviceId", deviceId);
                properties.put("upnp.events", immutableEvents);
               
                eventAdmin.postEvent(
                    new Event("org/osgi/service/upnp/UPnPEvent", properties));

                m_context.ungetService(ref);
            }
        }
    }
View Full Code Here

        listener.unregister();
    }


    protected void send(String topic, Dictionary<String, Object> properties, boolean sync) {
        final Event event = new Event(topic, properties);
        if ( sync ) {
            eventAdmin.sendEvent(event);
        } else {
            eventAdmin.postEvent(event);
        }
View Full Code Here

            }
            props.put(CommandExecutionProperties.ACTION_TYPE, command.getClass().getSimpleName());
            props.put(CommandExecutionProperties.ACTION_TARGET, command.getPath());
            props.put(CommandExecutionProperties.TIMESTAMP_START, start);
            props.put(CommandExecutionProperties.TIMESTAMP_END, end);
            Event event = new Event(CommandExecutionProperties.REPOSITORY_TOPIC, props);
            eventAdmin.postEvent(event);
        }

        return result;
    }
View Full Code Here

     * @see org.apache.sling.event.JobStatusProvider#removeJob(java.lang.String, java.lang.String)
     */
    @Override
    public boolean removeJob(final String topic, final String jobId) {
        if ( jobId != null && topic != null ) {
            final Event job = this.jobManager.findJob(topic,
                    Collections.singletonMap(JobUtil.PROPERTY_JOB_NAME, (Object)jobId));
            if ( job != null ) {
                return this.removeJob((String)job.getProperty(ResourceHelper.PROPERTY_JOB_ID));
            }
        }
        return true;
    }
View Full Code Here

TOP

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

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.