Spring Framework SimpleNamingContextBuilder - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework SimpleNamingContextBuilder class.

This code example shows how to use the following methods:activate, bind
     *             if any. 
     */ 
    public static void create() throws Exception {
        try { 
            if (isJNDIExist("java:comp/env/jdbc/" + JNDI_NAME)) return;
            final SimpleNamingContextBuilder builder = new SimpleNamingContextBuilder();
 
            BasicDataSource ds = new BasicDataSource();
            ds.setDriverClassName("org.postgresql.Driver");
            ds.setUsername(USERNAME);
            ds.setPassword(PASSWORD);
            ds.setRemoveAbandoned(true);
            ds.setRemoveAbandonedTimeout(30);
            ds.setLogAbandoned(true);
            ds.setUrl("jdbc:postgresql://localhost:5432/test_seqware_meta_db");
 
            Map<String, String> settings = new HashMap<>();
            try { 
                settings = ConfigTools.getSettings();
            } catch (Exception e) {

5
CodeRank
This code example shows how to use the following methods:bind
    public void setup() throws Exception {
 
        targetRegistry = new JndiLookupTargetRegistry();
 
        builder = SimpleNamingContextBuilder.emptyActivatedContextBuilder();
        builder.bind(CONTEXT, new Date());
    } 
 
    @After 
    public void clean() throws Exception {
        builder.clear();
    } 
 
    @Test
    public void notFound() { 
        assertNull(targetRegistry.getTarget("not-existing"));
    } 
 
    @Test
    public void found() { 
4
CodeRank
This code example shows how to use the following methods:bind
			ds.setUsername(username); 
			ds.setPassword(password); 
			ds.setMaxActive(8); 
			ds.setMaxIdle(4); 
			ds.setDriverClassName(className); 
			builder.bind("java:comp/env/jdbc/" + beanName, ds); 
		} catch (Throwable t) { 
			throw new RuntimeException("Error on creation datasource '" + beanName + "'", t); 
		} 
	} 
	 
	/** 
	 * Restituisce l'insieme dei file di configurazione dei bean definiti nel sistema. 
	 * Il metodo và esteso nel caso si inseriscano file di configurazioni esterni al Core ed ai Plugin. 
	 * @return L'insieme dei file di configurazione definiti nel sistema. 
	 */ 
	protected String[] getSpringConfigFilePaths() { 
    	String[] filePaths = new String[6]; 
		filePaths[0] = "classpath:spring/propertyPlaceholder.xml"; 
		filePaths[1] = "classpath:spring/baseSystemConfig.xml"; 
4
CodeRank
See Code Examples for Spring Framework SimpleNamingContextBuilder Methods: