Package org.osgi.service.event

Examples of org.osgi.service.event.Event


      putProp(props, "service.id", event.getReference().getProperty(Constants.SERVICE_ID));
      putProp(props, "service.objectClass", event.getReference().getProperty(Constants.OBJECTCLASS));
      putProp(props, "service.pid", event.getReference().getProperty(Constants.SERVICE_PID));

      try {
        Activator.eventAdmin.postEvent(new Event(topic, props));
      } catch (Exception e) {
        Activator.log.error("EXCEPTION in configurationEvent()", e);
      }
    } else {
      Activator.log.error("Recieved unknown configuration event (type="
View Full Code Here


      putProp(props, "bundle.id", new Long(bundle.getBundleId()));
      putProp(props, EventConstants.BUNDLE_SYMBOLICNAME, bundle.getSymbolicName());
      putProp(props, "bundle", bundle);
      /* Tries posting the event once the properties are set */
      try {
        Activator.eventAdmin.postEvent(new Event(topic, props));
      } catch (Exception e) {
        Activator.log.error("EXCEPTION in bundleChanged()", e);
      }
    } else {
      /* Logs an error if the event, which arrived, were of an unknown type */
 
View Full Code Here

      putProp(props, EventConstants.SERVICE_PID, logEntry.getServiceReference().getProperty(Constants.SERVICE_PID));
    }

    /* Tries posting the event once the properties are set */
    try {
      Activator.eventAdmin.postEvent(new Event(topic, props));
    } catch (Throwable t) {
      // We don't log more errors if postEvent has thrown more than
      // 5 times and we haven't gotten called back for those entries
      // within a certain time
      // See beginning of this method
View Full Code Here

      putProp(props, EventConstants.SERVICE_ID, serviceEvent.getServiceReference().getProperty(Constants.SERVICE_ID));
      putProp(props, EventConstants.SERVICE_OBJECTCLASS, serviceEvent.getServiceReference().getProperty(Constants.OBJECTCLASS));

      /* Tries posting the event once the properties are set */
      try {
        Activator.eventAdmin.postEvent(new Event(topic, props));
      } catch (Exception e) {
        Activator.log.error("EXCEPTION in serviceChanged() :", e);
      }
    } else {
      /* Logs an error if the event, which arrived, were of an unknown type */
 
View Full Code Here

        putProp(props, EventConstants.EXCEPTION, e);
      }

      /* Tries posting the event once the properties are set */
      try {
        Activator.eventAdmin.postEvent(new Event(topic, props));
      } catch (Exception e) {
        Activator.log.error("Exception in frameworkEvent() :", e);
      }
    } else {
      Activator.log.error("Recieved unknown framework event (type="
View Full Code Here

                                 + " sending a synchronus event with message:"
                                 + message.toString() + "and the topic:"
                                 + topicToSend);

              /* send the message */
              eventAdmin.sendEvent(new Event(topicToSend, message));

              synchronized (dummySemaphore) {
                if (shouldRegister) {
                  lastPublishedIDSynch = i;
                }
View Full Code Here

              System.out.println(getName()
                                 + " sending a asynchronus event with message:"
                                 + message.toString() + "and the topic:"
                                 + topicToSend);
              /* send the message */
              eventAdmin.postEvent(new Event(topicToSend, message));
              synchronized (dummySemaphore) {
                if (shouldRegister) {
                  lastPublishedIDAsynch = i;
                }
              }
View Full Code Here

                /* put some properties into the messages */
                message.put("Synchronus message",new Integer(i));
                /* send the message */
                System.out.println(getName() + " sending a synchronus event with message:" +
                                   message.toString() + "and the topic:" + topicsToSend[i]);
                eventAdmin.sendEvent(new Event(topicsToSend[i], message));
              }catch(Exception e){
                System.out.println("Error when publishing synhronous" + e);
              }
            }
          }
        };
      synchDeliver.start();
      /* wait until thread is dead */
      synchDeliver.join();

      Thread asynchDeliver = new Thread() {
          public void run() {
            for (int i = 0; i < messageTosend; i++) {
              try{
                /* create the hasht table */
                Dictionary message = new Hashtable();
                /* create the message */
                message.put("Asynchronus message",new Integer(i));
                /* Sends a synchronous event to the admin */
                System.out.println(getName() + " sending an Asynchronus event with message:" +
                                   message.toString() + "and the topic:" + topicsToSend[i]);
                eventAdmin.postEvent(new Event(topicsToSend[i], message));
              }catch(Exception e){
                System.out.println("Error when publishing asynhronous:" +e );
              }
            }
          }
View Full Code Here

  void copyToClipBoard() {
    StringBuffer sb = new StringBuffer();

    for(Iterator it = model.getEntries().iterator(); it.hasNext();) {
      Event entry = (Event)it.next();
      sb.append(entry.toString());
      sb.append("\n");
    }

    setClipboardContents(sb.toString());
  }
View Full Code Here

  }


  public Event getEntry(int row) {
    synchronized(lock) {
      Event e = (Event)filteredEntries.get(row);

      return e;
    }
  }
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.