Examples of ConfigReader


Examples of org.apache.qpid.disttest.controller.config.ConfigReader

        }
    }

    private Config buildTestConfigFrom(String testConfigFile)
    {
        ConfigReader configReader = new ConfigReader();
        Config testConfig;
        try
        {
            testConfig = configReader.getConfigFromFile(testConfigFile);
        }
        catch (IOException e)
        {
            throw new DistributedTestException("Exception while loading test config from '" + testConfigFile + "'", e);
        }
View Full Code Here

Examples of org.apache.qpid.disttest.controller.config.ConfigReader

        }
    }

    private Config buildTestConfigFrom(String testConfigFile)
    {
        ConfigReader configReader = new ConfigReader();
        Config testConfig;
        InputStream configStream = null;
        try
        {
            configStream = getClass().getResourceAsStream(testConfigFile);
            if (configStream != null)
            {
                testConfig = configReader.readConfig(new InputStreamReader(configStream), testConfigFile.endsWith(".js"));
            }
            else
            {
                ConfigFileHelper configFileHelper = new ConfigFileHelper();
                List<String> files = configFileHelper.getTestConfigFiles(testConfigFile);
                List<TestConfig> tests = new ArrayList<TestConfig>();
                for (String file : files)
                {
                    Config config = configReader.getConfigFromFile(file);
                    tests.addAll(config.getTestConfigs());
                }
                testConfig = new Config(tests);
            }
        }
View Full Code Here

Examples of org.dcm4che3.conf.api.generic.ReflectiveConfig.ConfigReader

        ConfigField fieldAnno = field.getAnnotation(ConfigField.class);

        Map<String,Object> cnode = new HashMap<String,Object>();

        // read collection
        ConfigReader collectionReader = reader.getChildReader(getCollectionName(fieldAnno));
        Map<String, ConfigReader> map = collectionReader.readCollection(fieldAnno.mapKey());

        ConfigTypeAdapter<V, Object> valueAdapter = (ConfigTypeAdapter<V, Object>) getValueAdapter(field, config);

        // for each element, read it using the value adapter
        for (Entry<String, ConfigReader> e : map.entrySet()) {
View Full Code Here

Examples of org.dcm4che3.conf.api.generic.ReflectiveConfig.ConfigReader

            confObj = confClass.newInstance();
        } catch (Exception e) {
            throw new ConfigurationException(e);
        }

        ConfigReader prefsReader = new PrefsConfigReader(deviceNode.node(nodename));
       
        try {
       
            reflectiveConfig.readConfig(confObj, prefsReader);
            device.addDeviceExtension(confObj);
View Full Code Here

Examples of org.dcm4che3.conf.api.generic.ReflectiveConfig.ConfigReader

        // TODO: creation can be done already by the reflective adapter
        try {

            T confObj = confClass.newInstance();

            ConfigReader ldapReader = new LdapConfigIO(attrs, getCnStr() + deviceDN, config);

            reflectiveConfig.readConfig(confObj, ldapReader);

            device.addDeviceExtension(confObj);
View Full Code Here

Examples of org.getspout.spout.config.ConfigReader

        sender.sendMessage("Only players can add waypoints.");
        return true;
      }
      if (args.length > 1) {
        String name = args[1];
        (new ConfigReader()).addWaypoint(name, ((Player) sender).getLocation());
        sender.sendMessage("Waypoint [" + name + "] created successfully");
        return true;
      } else {
        sender.sendMessage("You must give a name to the waypoint.");
        return true;
      }
    }
    if (c.equals("list")) {
      String message = "Players online with " + ChatColor.BLUE + "Spoutcraft" + ChatColor.RESET + ":\n";
      for (Player plr : Bukkit.getOnlinePlayers()) {
        SpoutPlayer splr = SpoutManager.getPlayer(plr);
        if (splr.isSpoutCraftEnabled()) {
          message += ChatColor.GREEN + splr.getName() + ChatColor.RESET + ", ";
        }
      }
      message = message.substring(0, message.length() - 2);
      sender.sendMessage(message);
      return true;
    }
    if (c.equals("reload")) {
      (new ConfigReader()).read();
      sender.sendMessage("Configuration for SpoutPlugin has been reloaded.");
      return true;
    }
    if (c.equals("verify") && args.length > 1) {
      sender.sendMessage("[SpoutPlugin] Temporarily setting the MOTD to: " + args[1]);
View Full Code Here

Examples of org.getspout.spout.config.ConfigReader

    super.onDisable();
  }

  @Override
  public void onEnable() {
    (new ConfigReader()).read();

    // The infamous SpoutPlugin build check
    if (ConfigReader.isBuildCheck()) {
      InputStream is = getResource("plugin.yml");
      final YamlConfiguration config = YamlConfiguration.loadConfiguration(is);
View Full Code Here

Examples of org.nasutekds.guitools.controlpanel.util.ConfigReader

      if (lastRemoteHostName != null)
      {
        desc.setHostname(lastRemoteHostName);
      }
    }
    ConfigReader reader;

    ServerDescriptor.ServerStatus status = null;
    for (Task task : getTasks())
    {
      if ((task.getType() == Task.Type.START_SERVER) &&
          (task.getState() == Task.State.RUNNING) &&
          isRunningOnServer(desc, task))
      {
        status = ServerDescriptor.ServerStatus.STARTING;
      }
      else if ((task.getType() == Task.Type.STOP_SERVER) &&
          (task.getState() == Task.State.RUNNING) &&
          isRunningOnServer(desc, task))
      {
        status = ServerDescriptor.ServerStatus.STOPPING;
      }
    }
    if (status != null)
    {
      desc.setStatus(status);
      if (status == ServerDescriptor.ServerStatus.STOPPING)
      {
        if (ctx != null)
        {
          try
          {
            ctx.close();
          }
          catch (Throwable t)
          {
          }
          this.ctx = null;
        }
        if (userDataCtx != null)
        {
          if (connectionPool.isConnectionRegistered(userDataCtx))
          {
            try
            {
              connectionPool.unregisterConnection(userDataCtx);
            }
            catch (Throwable t)
            {
            }
          }
          try
          {
            userDataCtx.close();
          }
          catch (Throwable t)
          {
          }
          userDataCtx = null;
        }
      }
      if (isLocal)
      {
        reader = createNewConfigFromFileReader();
        ((ConfigFromFile)reader).readConfiguration();
      }
      else
      {
        reader = null;
      }
      desc.setAuthenticated(false);
    }
    else if (!isLocal ||
        Utilities.isServerRunning(new File(desc.getInstancePath())))
    {
      desc.setStatus(ServerDescriptor.ServerStatus.STARTED);

      if ((ctx == null) && (lastWorkingBindDN != null))
      {
        // Try with previous credentials.
        try
        {
          if (isLocal)
          {
            ctx = Utilities.getAdminDirContext(this, lastWorkingBindDN,
              lastWorkingBindPwd);
          }
          else if (lastRemoteAdministrationURL != null)
          {
            ctx = Utils.createLdapsContext(lastRemoteAdministrationURL,
                lastWorkingBindDN,
                lastWorkingBindPwd,
                getConnectTimeout(), null,
                getTrustManager());
          }
        }
        catch (ConfigReadException cre)
        {
//        Ignore: we will ask the user for credentials.
        }
        catch (NamingException ne)
        {
          // Ignore: we will ask the user for credentials.
        }
        if (ctx != null)
        {
          this.ctx = ctx;
        }
      }

      if (isLocal && (ctx == null))
      {
        reader = createNewConfigFromFileReader();
        ((ConfigFromFile)reader).readConfiguration();
      }
      else
      {
        if (!isLocal && (ctx == null))
        {
          desc.setStatus(ServerDescriptor.ServerStatus.NOT_CONNECTED_TO_REMOTE);
          reader = null;
        }
        else
        {
          reader = createNewConfigFromDirContextReader();
          ((ConfigFromDirContext)reader).readConfiguration(ctx);

          boolean connectionWorks = checkConnections(ctx, userDataCtx);
          if (!connectionWorks)
          {
            if (isLocal)
            {
              // Try with off-line info
              reader = createNewConfigFromFileReader();
              ((ConfigFromFile)reader).readConfiguration();
            }
            else
            {
              desc.setStatus(
                  ServerDescriptor.ServerStatus.NOT_CONNECTED_TO_REMOTE);
              reader = null;
            }
            try
            {
              ctx.close();
            }
            catch (Throwable t)
            {
            }
            this.ctx = null;
            if (connectionPool.isConnectionRegistered(userDataCtx))
            {
              try
              {
                connectionPool.unregisterConnection(userDataCtx);
              }
              catch (Throwable t)
              {
              }
            }
            try
            {
              userDataCtx.close();
            }
            catch (Throwable t)
            {
            }
            userDataCtx = null;
          }
        }
      }
      if (reader != null)
      {
        desc.setAuthenticated(reader instanceof ConfigFromDirContext);
        desc.setJavaVersion(reader.getJavaVersion());
        desc.setOpenConnections(reader.getOpenConnections());
        desc.setTaskEntries(reader.getTaskEntries());
        if (reader instanceof ConfigFromDirContext)
        {
          ConfigFromDirContext rCtx = (ConfigFromDirContext)reader;
          desc.setRootMonitor(rCtx.getRootMonitor());
          desc.setEntryCachesMonitor(rCtx.getEntryCaches());
View Full Code Here

Examples of org.openmeetings.app.ldap.config.ConfigReader

    File configFile = new File(configPath);
   
    if(!configFile.isFile())
      return null;
   
    ConfigReader reader = new ConfigReader();
    reader.readConfig(configPath);
   
    return reader.getConfigMap();
   
  }
View Full Code Here

Examples of org.openmeetings.app.ldap.config.ConfigReader

    File configFile = new File(configPath);

    if (!configFile.isFile())
      return null;

    ConfigReader reader = new ConfigReader();
    reader.readConfig(configPath);

    return reader.getConfigMap();

  }
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.