Java 8 Hashtable - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 Hashtable class.

This code example shows how to use the following methods:
import com.omniti.jezebel.ResmonResult; 
 
 
public class JezebelResmon extends HttpServlet { 
    private static Resmon r = new Resmon(); 
    private static Hashtable<String,ResmonResult> mods = new Hashtable<String,ResmonResult>(); 
 
    public JezebelResmon() { } 
    public void doGet(HttpServletRequest request, 
                      HttpServletResponse response) { 
        r.write(response); 
    } 
 
    static public ResmonResult getModule(String modname) { 
        ResmonResult mod; 
        mod = mods.get(modname); 
        if(mod == null) { 
            mod = r.addResult("jezebel", modname); 
            mods.put(modname, mod); 
        } 
9
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:put
	 * of the managed resource. 
	 */ 
	@Override 
	public ObjectName getObjectName(Object managedBean, String beanKey) throws MalformedObjectNameException {
		String domain = ClassUtils.getPackageName(managedBean.getClass());
		Hashtable keys = new Hashtable();
		keys.put(TYPE_KEY, ClassUtils.getShortName(managedBean.getClass()));
		keys.put(HASH_CODE_KEY, ObjectUtils.getIdentityHexString(managedBean));
		return ObjectNameManager.getInstance(domain, keys);
	} 
 
} 
9
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:put, containsKey, get, putAll
    @TargetsContainer("iiop-client") 
    public static Archive<?> clientDeployment() { 
 
        String ejbJar = FileUtils.readFile(TransactionIIOPInvocationTestCase.class, "ejb-jar.xml");
 
        final Properties properties = new Properties();
        properties.putAll(System.getProperties());
        if(properties.containsKey("node1")) {
            properties.put("node1", NetworkUtils.formatPossibleIpv6Address((String) properties.get("node1")));
        } 
 
        final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "client.jar");
        jar.addClasses(ClientEjb.class, IIOPTransactionalHome.class,
                IIOPTransactionalRemote.class, TransactionIIOPInvocationTestCase.class 
                , IIOPTransactionalStatefulHome.class, IIOPTransactionalStatefulRemote.class) 
                .addAsManifestResource(TransactionIIOPInvocationTestCase.class.getPackage(), "jboss-ejb3.xml", "jboss-ejb3.xml")
                .addAsManifestResource(new StringAsset(PropertiesValueResolver.replaceProperties(ejbJar, properties)), "ejb-jar.xml");
        return jar;
    } 
 

9
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:put
     * @param hostName 
     * @return 
     * @throws UnknownHostException 
     */ 
    public static Properties createEjbClientConfiguration(String hostName) throws UnknownHostException {
        final Properties pr = new Properties();
        pr.put("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED", "false");
        pr.put("remote.connections", "default");
        pr.put("remote.connection.default.host", hostName);
        pr.put("remote.connection.default.port", "8080");
        pr.put("remote.connection.default.username", CONNECTION_USERNAME);
        pr.put("remote.connection.default.password", CONNECTION_PASSWORD);
        return pr;
    } 
 
} 
9
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
    private Vector names = new Vector();
     
    /** 
     * Pairs keyed by the description. 
     */ 
    private Hashtable keyedByString = new Hashtable();
     
    /** 
     * Pairs keyed by the integer value. 
     */ 
    private Hashtable keyedByInteger = new Hashtable();
     
    /** 
     * The default if no choice is initially specified.  Sub-classers 
     * shouldn't rely on this and should call setDefaultChoice in their 
     * static initializer. 
     */ 
    private int defaultChoice = 0;
     
    /** 
9
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:clear, containsKey, load
		return mappings.getProperty(key, defaultMappings.getProperty(key)) != null;
	} 
 
	private static void load(String path, String default_language) {
		InputStream langStream = null;
		Properties modMappings = new Properties();
 
		try { 
			// Load the default language mappings 
			langStream = Localization.class.getResourceAsStream(path + default_language + ".properties");
			modMappings.load(langStream);
			defaultMappings.putAll(modMappings);
			langStream.close();
 
			// Try to load the current language mappings. 
			// If the file doesn't exist use the default mappings. 
			langStream = Localization.class.getResourceAsStream(path + getCurrentLanguage() + ".properties");
			if (langStream != null) {
				modMappings.clear();
				modMappings.load(langStream);

8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:put
        pc.addPlugin( p );
        TestPlugin2 p2 = new TestPlugin2();
        pc.addPlugin( p2 );
 
 
        Properties config = new Properties();
        config.put("some.setting", "some value");
        config.put("plugins.disable", "play.plugins.TestPlugin");
 
        internalTest(config, pc, Arrays.asList(p2));
 
    } 
 
    @Test 
    public void verify_disableing_many_plugins() throws Exception { 
 
 
        PluginCollection pc = new PluginCollection();
        TestPlugin p = new TestPlugin();
        pc.addPlugin( p );
8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:put
	MyEjb ejb;
 
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		Context ctx = null;
		try { 
			Properties env = new Properties();
			String address = System.getProperty("node0", "localhost");
			// format possible IPv6 address 
			address = NetworkUtils.formatPossibleIpv6Address(address);
			env.put(Context.PROVIDER_URL, "http-remoting://" + address + ":8080");
			env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
			ctx = new InitialContext(env);
 
			// ensure it's actually connected to the server 
			MyObject obj = (MyObject) ctx.lookup("loc/stub");
 
			// call the EJB which also does remote lookup 
			Writer writer = resp.getWriter();
			writer.write(ejb.doIt());
			writer.write(obj.doIt("Hello"));
8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
 
    public ResmonResult(String m, String s) {
        module = m;
        service = s;
        last_update = System.currentTimeMillis() / 1000;
        metrics = new Hashtable<String,ResmonMetricData>();
    } 
 
    public ResmonResult addMetric(String name, ResmonMetricData d) {
        synchronized(metrics) {
            metrics.remove(name);
            metrics.put(name, d);
        } 
        last_update = System.currentTimeMillis() / 1000;
        return this;
    } 
    public ResmonResult set(String name, String t, String v) { return addMetric(name, new ResmonMetricData(t,v)); }
    public ResmonResult set(String name, Integer v) { return addMetric(name, new ResmonMetricData(v)); }
    public ResmonResult set(String name, Long v) { return addMetric(name, new ResmonMetricData(v)); }
    public ResmonResult set(String name, Double v) { return addMetric(name, new ResmonMetricData(v)); }
9
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:put
 
    /** 
     * Returns properties for RA admin-object element 
     */ 
    public static Properties raAdminProperties() {
        Properties params = new Properties();
        //attributes 
        params.put("use-java-context", "true");
        params.put("class-name", "Class3");
        params.put("jndi-name", "java:jboss/Name3");
        params.put("enabled", "true");
 
        return params;
    } 
 
    /** 
     * Sets parameters for DMR operation 
     * 
     * @param operation 
     * @param params 
9
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

Related Java 8 Hashtable Questions & Answers:

See Code Examples for Java 8 Hashtable Methods: