Examples of Dictionary


Examples of java.util.Dictionary

    /* Stores the properties of the event in the dictionary, if the event is known */
    if (knownMessageType) {
      if(!Activator.handlerTracker.anyHandlersMatching(topic)) {
        return;
      }
      Dictionary props = new Hashtable();
      Bundle bundle = bundleEvent.getBundle();
      putProp(props, EventConstants.EVENT, bundleEvent);
      putProp(props, "bundle.id", new Long(bundle.getBundleId()));
      putProp(props, EventConstants.BUNDLE_SYMBOLICNAME, bundle.getSymbolicName());
      putProp(props, "bundle", bundle);
View Full Code Here

Examples of java.util.Dictionary

      return;
    }


    Bundle bundle = logEntry.getBundle();
    Dictionary props = new Hashtable();

    /* Stores the properties of the event in the dictionary */
    if (bundle != null) {
      putProp(props, "bundle.id", new Long(bundle.getBundleId()));
      putProp(props, EventConstants.BUNDLE_SYMBOLICNAME, bundle.getLocation());
View Full Code Here

Examples of java.util.Dictionary

    /* Stores the properties of the event in the dictionary, if the event is known */
    if (knownMessageType) {
      if(!Activator.handlerTracker.anyHandlersMatching(topic)) {
        return;
      }
      Dictionary props = new Hashtable();
      putProp(props, EventConstants.EVENT, serviceEvent);
      putProp(props, EventConstants.SERVICE, serviceEvent.getServiceReference());
      putProp(props, EventConstants.SERVICE_PID, serviceEvent.getServiceReference().getProperty(Constants.SERVICE_PID));
      putProp(props, EventConstants.SERVICE_ID, serviceEvent.getServiceReference().getProperty(Constants.SERVICE_ID));
      putProp(props, EventConstants.SERVICE_OBJECTCLASS, serviceEvent.getServiceReference().getProperty(Constants.OBJECTCLASS));
View Full Code Here

Examples of java.util.Dictionary

    if (knownMessageType) {
      if(!Activator.handlerTracker.anyHandlersMatching(topic)) {
        return;
      }
      Dictionary props = new Hashtable();
      Bundle bundle = frameworkEvent.getBundle();
      putProp(props, "event", frameworkEvent);
      /* If the event contains a bundle, further properties shall be set */
      if (frameworkEvent.getBundle() != null) {
        putProp(props, "bundle.id", new Long(bundle.getBundleId()));
View Full Code Here

Examples of java.util.Dictionary

      asynchMessages = 0;
      synchMessages = 0;
      System.out
        .println("!!! TO RUN THIS TEST CORRECTLY TWO EVENTADMINS NEEDS TO RUN IN THE FRAMEWORK!!!");
      /* create the hashtable to put properties in */
      Dictionary props = new Hashtable();
      /* determine what topicType to use */
      /* put service.pid property in hashtable */
      props.put(EventConstants.EVENT_TOPIC, topicsToConsume);

      /* register the service */
      serviceRegistration = bundleContext.registerService(
                                                          EventHandler.class.getName(), this, props);

View Full Code Here

Examples of java.util.Dictionary

      Thread thread = new Thread() {
          public void run() {
            int i = 0;
            while (running && i<500) {
              /* a Hash table to store message in */
              Dictionary message = new Hashtable();
              /* put some properties into the messages */
              message.put("Synchronus message", new Integer(i));
              /* print for the console */
              System.out.println(getName()
                                 + " sending a synchronus event with message:"
                                 + message.toString() + "and the topic:"
                                 + topicToSend);

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

View Full Code Here

Examples of java.util.Dictionary

      Thread thread = new Thread() {
          public void run() {
            int i = 0;
            while (running && i<500) {
              /* a Hash table to store message in */
              Dictionary message = new Hashtable();
              /* put some properties into the messages */
              message.put("Asynchronus message", new Integer(i));
              /* print for the console */
              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) {
View Full Code Here

Examples of java.util.Dictionary

    public void register(boolean value, int type) {

      shouldAssert = value;
      assertType = type;
      /* create the hashtable to put properties in */
      Dictionary props = new Hashtable();
      /* put service.pid property in hashtable */
      props.put(EventConstants.EVENT_TOPIC, topicsToConsume);
      /* register the service */
      serviceRegistration = bundleContext.registerService(EventHandler.class.getName(), this,
                                                          props);
      assertNotNull(displayName + " Can't get service", serviceRegistration);

View Full Code Here

Examples of java.util.Dictionary

     */
    public void register() {
      shouldAssert = false;
      assertType = 3;
      /* create the hashtable to put properties in */
      Dictionary props = new Hashtable();
      /* put service.pid property in hashtable */
      props.put(EventConstants.EVENT_TOPIC, topicsToConsume);
      /* register the service */
      serviceRegistration = bundleContext.registerService(EventHandler.class.getName(), this,
                                                          props);
    }
View Full Code Here

Examples of java.util.Dictionary

      Thread synchDeliver = new Thread() {
          public void run() {
            for (int i = 0; i < messageTosend; i++) {
              try{
                /* a Hash table to store message in */
                Dictionary message = new Hashtable();
                /* 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
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.