Examples of Config


Examples of net.greghaines.jesque.Config

        new KeysDAORedisImpl(null, null);
    }

    @Test(expected = IllegalArgumentException.class)
    public void testConstructor_NullPool() {
        final Config config = new ConfigBuilder().build();
        new KeysDAORedisImpl(config, null);
    }
View Full Code Here

Examples of net.jini.jeri.kerberos.KerberosUtil.Config

    outer:
      for (ConfigIter citer = new ConfigIter(
         clientPrincipals, serverPrincipal, canDeleg);
     citer.hasNext(); )
      {
    Config config = citer.next();
    for (Iterator jter = constraints.requirements().iterator();
         jter.hasNext(); )
    {
        InvocationConstraint c =
      (InvocationConstraint) jter.next();
        if (!KerberosUtil.isSatisfiable(config, c))
      continue outer;
    }
    configArr.add(config);
      }

      if (configArr.size() == 0) {
    errorCode = UNSATISFIABLE_CONSTRAINT_REQUIRED;
    detailedExceptionMsg = "Constraints unsatisfiable by this " +
        "endpoint with the current subject have been required: " +
        constraints + ", while the KerberosPrincipal set of " +
        "the subject is: " + subjectClientPrincipals;
    return;
      }

      configs = (Config[]) configArr.toArray(
    new Config[configArr.size()]);

      // reorder configs by the num of preferences a config can satisfy
      for (int i = 0; i < configs.length; i++) {
    for (Iterator iter = constraints.preferences().iterator();
         iter.hasNext(); )
          {
        InvocationConstraint c =
      (InvocationConstraint) iter.next();
        if (KerberosUtil.isSatisfiable(configs[i], c))
      configs[i].prefCount++;
    }
      }
      Arrays.sort(configs, new Comparator() {
        public int compare(Object o1, Object o2) {
      Config config1 = (Config) o1;
      Config config2 = (Config) o2;
      // sort to descending order by prefCount
      return config2.prefCount - config1.prefCount;
        }
    });
View Full Code Here

Examples of net.jodah.lyra.config.Config

  /**
   * Asserts that invocation failures are rethrown when a retry policy is not set.
   */
  public void shouldThrowOnInvocationFailureWithNoRetryPolicy() throws Throwable {
    config = new Config().withRetryPolicy(RetryPolicies.retryNever());
    connectionFactory = mock(ConnectionFactory.class);
    connection = mock(Connection.class);
    when(connectionFactory.newConnection(any(ExecutorService.class), any(Address[].class))).thenAnswer(
        failNTimes(3, new ConnectException("fail"), connection, connectionHandler));

View Full Code Here

Examples of net.opentsdb.utils.Config

      System.exit(3);
    }
    final boolean ignorecase = argp.has("--ignore-case") || argp.has("-i");
   
    // get a config object
    Config config = CliOptions.getConfig(argp);
    final byte[] table = config.getString("tsd.storage.hbase.uid_table")
      .getBytes();
   
    final TSDB tsdb = new TSDB(config);
    tsdb.getClient().ensureTableExists(
        config.getString("tsd.storage.hbase.uid_table")).joinUninterruptibly();
    argp = null;
    int rc;
    try {
      rc = runCommand(tsdb, table, idwidth, ignorecase, args);
    } finally {
View Full Code Here

Examples of net.sdiz.bitcoin.jdo.Config

  @Override
  public void doGet(HttpServletRequest req, HttpServletResponse resp)
      throws IOException {
    ScanHash sh = new ScanHash();

    Config config = null;
    int accepted = 0, rejected = 0;
    try {
      config = Config.getConfig();
      long targetTotalTime = config.getTargetTotalTime();

      log.info("Start " + config.getUsername() + " [" + config.getAuth()
          + "]");
      long startTime = System.currentTimeMillis();
      do {
        long startRoundTime = System.currentTimeMillis();
        Work work = fetchWork(config);
        boolean found = sh.scan(work, 1, config.getScanCount());
        if (found) {
          log.warning("found: " + work.data);
          if (submitWork(config, work)) {
            log.warning("Yay! Accepted!");
            accepted++;
          } else {
            log.warning("Doh! Rejected!");
            rejected++;
          }
        } else {
          adjustHashPerRound(config, startRoundTime);
        }
      } while (timePassed(startTime) < targetTotalTime);
      log.info("Times Up!");
    } catch (DeadlineExceededException dee) {
      log.info("DealineExcessedException!");
    } catch (Exception ex) {
      log.severe("Exception Caught! " + ex);
      ex.printStackTrace(System.err);
    } finally {
      log.info("Fin. H=" + sh.getCount() + ", A=" + accepted + ", R="
          + rejected);
    }

    config.save();

    resp.getWriter().println(
        "Fin. H=" + sh.getCount() + ", A=" + accepted + ", R="
            + rejected);
  }
View Full Code Here

Examples of net.sf.agentopia.util.Config

        catch (IOException exc) {
            exc.printStackTrace();
        }

        // Set window size and position.
        Config conf = Config.getConfig();
        int windowWid = conf.getInt("GUI.WindowWid", 800);
        int windowHei = conf.getInt("GUI.WindowHei", 600);
        frame.setSize(windowWid, windowHei);
        int windowX = conf.getInt("GUI.WindowX", -1);
        int windowY = conf.getInt("GUI.WindowY", -1);
        if (-1 == windowX || -1 == windowY) {
            GUI.centerWindow(frame);
        }
        else {
            frame.setLocation(windowX, windowY);
View Full Code Here

Examples of net.sf.launch4j.config.Config

    _libsCheck.addActionListener(new LibsActionListener());
  }

  private class HeaderTypeChangeListener implements ChangeListener {
    public void stateChanged(ChangeEvent e) {
      Config c = ConfigPersister.getInstance().getConfig();
      c.setHeaderType(_guiHeaderRadio.isSelected() ? Config.GUI_HEADER
                            : Config.CONSOLE_HEADER);
      if (!_headerObjectsCheck.isSelected()) {
        Binding b = _bindings.getBinding("headerObjects");
        b.put(c);
      }
View Full Code Here

Examples of net.sourceforge.peers.Config

                        notifyListener(sipResponse);
                    } else { // received != via ip address
                        try {
                            InetAddress receivedInetAddress =
                                InetAddress.getByName(received);
                            Config config = userAgent.getConfig();
                            config.setPublicInetAddress(receivedInetAddress);
                            userAgent.getUac().register();
                        } catch (UnknownHostException e) {
                            notifyListener(sipResponse);
                            logger.error(e.getMessage(), e);
                        } catch (SipUriSyntaxException e) {
View Full Code Here

Examples of net.spy.memcached.vbucket.config.Config

        throw new IllegalArgumentException("The base URI must be absolute");
      }
    }
    this.configurationProvider = new ConfigurationProviderHTTP(baseList, usr, pwd);
    Bucket bucket = this.configurationProvider.getBucketConfiguration(bucketName);
    Config config = bucket.getConfig();
    ConnectionFactoryBuilder cfb = new ConnectionFactoryBuilder();
    if (config.getConfigType() == ConfigType.MEMBASE) {
      cfb.setFailureMode(FailureMode.Retry)
        .setProtocol(ConnectionFactoryBuilder.Protocol.BINARY)
        .setHashAlg(HashAlgorithm.KETAMA_HASH)
        .setLocatorType(ConnectionFactoryBuilder.Locator.VBUCKET)
        .setVBucketConfig(bucket.getConfig());
    } else if (config.getConfigType() == ConfigType.MEMCACHE) {
      cfb.setFailureMode(FailureMode.Retry)
        .setProtocol(ConnectionFactoryBuilder.Protocol.BINARY)
        .setHashAlg(HashAlgorithm.KETAMA_HASH)
        .setLocatorType(ConnectionFactoryBuilder.Locator.CONSISTENT);
    } else {
View Full Code Here

Examples of nsit.Config

    }
  }

  public GrouperQueryEngine(String group, boolean isGroup){
    try{
      Config conf = Config.getInstance();
      initialize(conf.getOption("ldap_host"),
              conf.getOption("grouper_url"),
              conf.getOption("grouper_user"),
              conf.getOption("grouper_password"),
              null);
    }
    catch(Exception e){
      throw new RuntimeException(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.