Example usage for java.util Hashtable Hashtable

List of usage examples for java.util Hashtable Hashtable

Introduction

In this page you can find the example usage for java.util Hashtable Hashtable.

Prototype

public Hashtable() 

Source Link

Document

Constructs a new, empty hashtable with a default initial capacity (11) and load factor (0.75).

Usage

From source file:com.santander.serenity.security.credentials.bkstoken.internal.BKSAuthenticatorServiceComponent.java

protected void activate(ComponentContext cxt) {
    try {//  w  w w  . j  av a  2s . c  o m
        BKSAuthenticator authenticator = new BKSAuthenticator();
        BKSAuthenticatorServiceComponent.setBundleContext(cxt.getBundleContext());
        Hashtable<String, String> props = new Hashtable<String, String>();
        props.put(CarbonConstants.AUTHENTICATOR_TYPE, authenticator.getAuthenticatorName());
        cxt.getBundleContext().registerService(CarbonServerAuthenticator.class.getName(), authenticator, props);
    } catch (Exception e) {
        log.error(e.getMessage(), e);
        // throwing so that server will not start
        throw new RuntimeException("Failed to start the BKS Authenticator Bundle" + e.getMessage(), e);
    }
    log.debug("BKS Authenticator is activated");
}

From source file:org.ow2.chameleon.fuchsia.importer.jsonrpc.it.JSONRPCImporterTest.java

@Before
public void setUpFinal() {
    // instantiate the importer
    Dictionary<String, String> conf = new Hashtable<String, String>();
    conf.put(INSTANCE_NAME_PROPERTY, IMPORTER_NAME);
    conf.put(TARGET_FILTER_PROPERTY, "(" + CONFIGS + "=jsonrpc)");
    ComponentInstance importer = ipojoHelper
            .createComponentInstance("org.ow2.chameleon.fuchsia.importer.jsonrpc.JSONRPCImporter", conf, 20000);
    if (importer == null) {
        fail("Fail to create the JSONRPC Importer.");
    }/* w w w. j  av  a2 s  . co  m*/

    // create HttpServer
    try {
        httpServer = HttpServer.create(new InetSocketAddress(HTTP_PORT), 0);
    } catch (IOException e) {
        fail("Creation of httpServer fail", e);
    }
    httpServer.setExecutor(Executors.newCachedThreadPool());
    httpServer.start();
}

From source file:com.dattack.naming.AbstractContext.java

protected AbstractContext(final Map<?, ?> env) throws NamingException {

    this.env = new Hashtable<Object, Object>();
    if (env != null) {
        this.env.putAll(env);
    }//w  w w.  j  a v a2s  .  c o m
    this.closing = false;
    nameParser = new DefaultNameParser(this);
    nameInNamespace = nameParser.parse("");
}

From source file:com.alfaariss.oa.engine.session.memory.MemorySessionFactory.java

/**
 * Create a new <code>MemoryFactory</code>.
 *///from   www .j a v a2 s .  c o  m
public MemorySessionFactory() {
    super();
    _logger = LogFactory.getLog(MemorySessionFactory.class);
    _eventLogger = LogFactory.getLog(Engine.EVENT_LOGGER);
    _htSession = new Hashtable<String, MemorySession>();
}

From source file:net.ivoi.core.mvc.model.cache.EhCacheProvider.java

/**
 *//* w w w .j  ava2  s .  c  o  m*/
public void start() throws CacheException {
    if (manager != null) {
        log.warn("Attempt to restart an already started EhCacheProvider. Use sessionFactory.close() "
                + " between repeated calls to buildSessionFactory. Using previously created EhCacheProvider."
                + " If this behaviour is required, consider using net.sf.ehcache.hibernate.SingletonEhCacheProvider.");
        return;
    }
    manager = new net.sf.ehcache.CacheManager();
    cacheManager = new Hashtable<String, EhCache>();
}

From source file:com.alfaariss.oa.engine.attribute.gather.processor.jdbc.JDBCGatherer.java

/**
 * Creates the object.//from   w  w  w  .  j a v a  2  s  . c  o m
 */
public JDBCGatherer() {
    _sID = null;
    _sFriendlyName = null;
    _bEnabled = false;
    _htMapper = new Hashtable<String, String>();
    _listGather = new Vector<String>();
}

From source file:RecordMIDlet.java

public Preferences(String recordStoreName) throws RecordStoreException {
    mRecordStoreName = recordStoreName;
    mHashtable = new Hashtable();
    load();
}

From source file:unalcol.termites.boxplots.BestAgentsPercentageInfoCollected.java

/**
 * Creates a new demo.// w w w  . java  2s .c  o  m
 *
 * @param title the frame title.
 * @param pf
 */
public BestAgentsPercentageInfoCollected(final String title, ArrayList<Double> pf) {

    super(title);
    String sDirectorio = experimentsDir;

    Hashtable<String, List> info = new Hashtable();

    //String[] aMode = {"levywalk", "lwphevap", "hybrid", "hybrid3", "hybrid4"};
    /*for (String mode : aMode) {
     info.put(mode, new ArrayList());
     }*/
    createSampleDataset(pf, info);
    AddDataFailingExperiments(sDirectorio, pf, info);
    final BoxAndWhiskerCategoryDataset dataset = addDataSet(info);

    final CategoryAxis xAxis = new CategoryAxis("");
    //final NumberAxis yAxis = new NumberAxis("Information Collected");
    final NumberAxis yAxis = new NumberAxis("");

    yAxis.setAutoRangeIncludesZero(false);
    final BoxAndWhiskerRenderer renderer = new BoxAndWhiskerRenderer();
    renderer.setFillBox(false);
    renderer.setToolTipGenerator(new BoxAndWhiskerToolTipGenerator());
    final CategoryPlot plot = new CategoryPlot(dataset, xAxis, yAxis, renderer);

    Font font = new Font("Dialog", Font.PLAIN, 13);
    xAxis.setTickLabelFont(font);
    yAxis.setTickLabelFont(font);
    yAxis.setLabelFont(font);

    final JFreeChart chart = new JFreeChart("Information Collected " + getTitle(pf),
            new Font("SansSerif", Font.BOLD, 18), plot, true);
    final ChartPanel chartPanel = new ChartPanel(chart);
    chartPanel.setPreferredSize(new java.awt.Dimension(650, 370));
    setContentPane(chartPanel);

    TextTitle legendText = null;
    if (pf.size() == 1) {
        legendText = new TextTitle("Population Size");
    } else {
        legendText = new TextTitle("Population Size - Probability of Failure");
    }

    legendText.setFont(font);
    legendText.setPosition(RectangleEdge.BOTTOM);
    chart.addSubtitle(legendText);
    chart.getLegend().setItemFont(font);

    FileOutputStream output;
    try {
        output = new FileOutputStream("BestAgentsPercentageInfoCollected" + pf + mazeMode + ".jpg");
        ChartUtilities.writeChartAsJPEG(output, 1.0f, chart, 350, 350, null);
    } catch (FileNotFoundException ex) {
        Logger.getLogger(BestAgentsPercentageInfoCollected.class.getName()).log(Level.SEVERE, null, ex);
    } catch (IOException ex) {
        Logger.getLogger(BestAgentsPercentageInfoCollected.class.getName()).log(Level.SEVERE, null, ex);
    }
}

From source file:kjscompiler.Program.java

private static void run() throws ParseException, IOException, NullPointerException {
    Settings settings = new Settings(settingsPath);

    System.out.println("Searching for " + settings.getPattern() + " in " + settings.getBaseDir());

    JSONArray Base = settings.getBaseDir();
    List<String> files = new ArrayList<String>();
    for (int i = 0; i < Base.size(); i++) {
        files.addAll(FileScanner.run((String) Base.get(i), settings.getPattern(), settings.getProjectPath()));
    }//from w  w w .java  2  s.  co  m
    System.out.println("Found " + files.size() + " files");

    List<FileInfo> fiPrimaries = new ArrayList<FileInfo>();
    List<String> pExternals = new ArrayList<String>();

    Hashtable<String, Integer> fiHtPrimaries = new Hashtable<String, Integer>();

    for (String fullpath : files) {
        FileInfo fi = new FileInfo(fullpath);

        if (!fi.getIsIgnore()) {

            if (fi.getIsExternal()) {
                pExternals.add(fi.getFilename());
            } else {
                fiPrimaries.add(fi);
            }
        }
    }

    System.out.println("Primaries: " + fiPrimaries.size() + " files");
    System.out.println("Externals: " + pExternals.size() + " files");

    OrderDeps od = new OrderDeps(fiPrimaries);
    List<FileInfo> ordered = od.getOrderedFiles();
    List<String> oErrors = od.getErrors();

    for (int i = 0, length = oErrors.size(); i < length; i++) {
        String err = oErrors.get(i);
        System.out.println("Order Error #" + (i + 1) + ": " + err);
    }

    System.out.println("Primaries ordered");

    List<String> pPrimaries = new ArrayList<String>();

    for (int i = 0, length = ordered.size(); i < length; i++) {
        pPrimaries.add(ordered.get(i).getFilename());
    }

    String compilationLevel = settings.getLevel();

    GoogleClosureCompiler compiler = new GoogleClosureCompiler(pPrimaries, settings.getOutput(),
            compilationLevel, pExternals);
    compiler.setWrapper(settings.getWrapper());
    compiler.setWarningLevel(WarningLevel.VERBOSE);
    compiler.run();
    System.out.println("Compiled file: " + settings.getOutput());

    JSError[] errors = compiler.getErrors();
    for (int i = 0, length = errors.length; i < length; i++) {
        JSError err = errors[i];
        System.out.println("Error #" + (i + 1) + ": " + err.description + " in " + err.sourceName + " ("
                + err.lineNumber + ")");
    }
    if (errors.length == 0) {
        JSError[] warnings = compiler.getWarnings();
        for (int i = 0, length = warnings.length; i < length; i++) {
            JSError warn = errors[i];
            System.out.println("Warning #" + (i + 1) + ": " + warn.description + " in " + warn.sourceName + " ("
                    + warn.lineNumber + ")");
        }
    }

    System.out.println("\n\n Thank you for using kJScompiler!\n Who said JavaScript can't be compiled?\n");

    System.exit(0);
}

From source file:libra.common.kmermatch.KmerMatchFileMapping.java

public KmerMatchFileMapping() {
    this.idTable = new Hashtable<String, Integer>();
    this.objList = new ArrayList<String>();
}