Package java.util

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


     */
    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

      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

    public void runTest() throws Throwable {
      asynchMessages=0;
      synchMessages=0;
      /* 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(getName()
View Full Code Here

  // public methods

  public static Dictionary getDefaultConfig() {

    final Dictionary config = new Hashtable();

    config.put(TelnetConfig.PORT_KEY, new Integer(port));
    config.put(TelnetConfig.HOST_KEY, host);
    config.put(TelnetConfig.UM_KEY, new Boolean(um));
    config.put(TelnetConfig.REQUIRED_GROUP_KEY, requiredGroup);
    config.put(TelnetConfig.FORBIDDEN_GROUP_KEY, forbiddenGroup);

    return config;
  }
View Full Code Here

        m_bc = bc;
        m_log = new LogRef(m_bc);

        m_factory = new SslServiceFactory(m_bc, m_log);

        Dictionary parameters = new Hashtable();
        parameters.put("service.pid", SslServiceFactory.PID);
        m_reg = bc.registerService(ManagedServiceFactory.class.getName(),
                                           m_factory,
                                           parameters);

        ServiceReference adminRef = null;
View Full Code Here

                    log.info("User " + telnetLogin.getUser() + " logged in");
                    Authorization authorization
                        = telnetLogin.getAuthorization();
                    s = consoleService.runSession("telnet session", reader,
                                                  printWriter);
                    Dictionary props = s.getProperties();

                    if (authorization != null) {
                        props.put(Session.PROPERTY_AUTHORIZATION,
                                  authorization);
                    }

                    printWriter.println("'quit' to end session");
View Full Code Here

                    String inputPath = telnetConfig.getInputPath();
                    String authMethod = telnetConfig.getAuthorizationMethod();

                    ((ContextualAuthorization) telnetLogin.getAuthorization())
                            .setIPAMContext(inputPath, authMethod);
                    Dictionary context = ((ContextualAuthorization) telnetLogin
                            .getAuthorization()).getContext();
                    log.info("User " + telnetLogin.getAuthorization().getName()
                            + " logged in, authentication context is "
                            + context + ".");
                } else if (telnetLogin.getAuthorization() == null) {
View Full Code Here

            }
            for (int i = 0; i < cs.length; ++i) {
                if (i > 0) {
                    out.println();
                }
                Dictionary d = cs[i].getProperties();
                if (d == null) {
                    out.println("No properties set in " + cs[i].getPid());
                } else {
                    out.println("Properties for " + cs[i].getPid());
                    printDictionary(out, d);
View Full Code Here

            out.println("No configuration open currently");
        } else {
            if (isEditing(session)) {
                printDictionary(out, getEditingDict(session));
            } else {
                Dictionary d = cfg.getProperties();
                if (d == null) {
                    out.println("No properties set in current configuration");
                } else {
                    printDictionary(out, d);
                }
View Full Code Here

TOP

Related Classes of java.util.Dictionary

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.