Hashtable put - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hashtable put method.

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
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","false");
        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
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
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
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
This code example shows how to use the following methods:put
This code example shows how to use the following methods:put, put
 
        SSLContext sslContext = SSLContext.getInstance("TLS"); 
        sslContext.init(keyManagerFactory.getKeyManagers(), trustManagerFactory.getTrustManagers(), null); 
        SSLContext.setDefault(sslContext); 
 
        final Properties env = new Properties(); 
        env.put("java.naming.factory.initial", "org.jboss.naming.remote.client.InitialContextFactory"); 
        env.put("java.naming.provider.url", "remote://" + mgmtClient.getMgmtAddress() + ":" + REMOTING_PORT_TEST); 
        env.put("jboss.naming.client.ejb.context", "true"); 
        env.put("jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false"); 
        env.put(Context.SECURITY_PRINCIPAL, "admin"); 
        env.put(Context.SECURITY_CREDENTIALS, "testing"); 
 
        // SSL related config parameters 
        env.put("jboss.naming.client.remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED", "true"); 
        env.put("jboss.naming.client.connect.options.org.xnio.Options.SSL_STARTTLS", "true"); 
        return env; 
    } 
 
    /** 
     * Returns {@link File} instance representing keystore of client with given name. 
8
CodeRank
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.connection.default.connect.options.org.xnio.Options.SASL_DISALLOWED_MECHANISMS", "JBOSS_LOCAL_USER");
        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
This code example shows how to use the following methods:put
        return bean.getObject();
    } 
 
    private Properties hibernateProps()
    { 
        Properties jpaProperties = new Properties();
        jpaProperties.put("hibernate.dialect", "org.hibernate.dialect.HSQLDialect");
        jpaProperties.put("hibernate.hbm2ddl.auto", "create-drop");
        jpaProperties.put("hibernate.show_sql", false);
        jpaProperties.put("hibernate.format_sql", true);
        return jpaProperties;
    } 
 
    @Value("${db.driverClass}") private String driverClass;
    @Value("${db.jdbcUrl}") private String jdbcUrl;
    @Value("${db.user}") private String user;
    @Value("${db.password}") private String password;
 
    @Bean 
    public DataSource dataSource()
8
CodeRank
This code example shows how to use the following methods:put
public class ClientEngineMBean extends HazelcastMBean<ClientEngine> { 
 
    public ClientEngineMBean(HazelcastInstance hazelcastInstance, ClientEngine clientEngine, ManagementService service) {
        super(clientEngine, service);
 
        Hashtable<String, String> properties = new Hashtable<String, String>(3);
        properties.put("type", quote("HazelcastInstance.ClientEngine"));
        properties.put("name", quote(hazelcastInstance.getName()));
        properties.put("instance", quote(hazelcastInstance.getName()));
 
        setObjectName(properties);
    } 
 
    @ManagedAnnotation("clientEndpointCount") 
    @ManagedDescription("The number of client endpoints") 
    public int getClientEndpointCount() { 
        return managedObject.getClientEndpointCount(); 
    } 
} 
8
CodeRank

Related Hashtable put Questions & Answers:

put Method Overview
Maps the specified key to the specified value in this hashtable.
See Code Examples for other Java 8 Hashtable Methods: