Package org.springframework.jndi

Examples of org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet()


        as.setService(new QName("echo"));
        jbi.activateComponent(as);
       
        JndiObjectFactoryBean fb = new JndiObjectFactoryBean();
        fb.setJndiName(ClientFactory.DEFAULT_JNDI_NAME);
        fb.afterPropertiesSet();
        ClientFactory cf = (ClientFactory) fb.getObject();
        ServiceMixClient client = cf.createClient();
       
        Destination dest = client.createDestination("service::echo");
        InOut me = dest.createInOutExchange();
View Full Code Here


                JndiObjectFactoryBean factory = new JndiObjectFactoryBean();
                factory.setJndiName("jdbc/" + dsRefName);
                factory.setResourceRef(true);
               
                try {
                    factory.afterPropertiesSet();
                    source = (DataSource) factory.getObject();
                } catch (Exception t) {
                    LOG.error("Error looking up datasource [" + dsRefName + "] from JNDI.", t);
                    throw new IllegalArgumentException("Referenced JNDI name [" + dsRefName + "] did not map to a DataSource.");
                }
View Full Code Here

            // "java:comp/env/" will be prefixed if the JNDI name doesn't already have it
            factoryBean.setResourceRef(true);
           
            // This step actually does the JNDI lookup
            try {
                factoryBean.afterPropertiesSet();
            } catch(Exception e) {
                logger.error("datasource init from JNDI failed : " + e);
                logger.error("aborting application startup");
                throw new RuntimeException(e);
            } // end try..catch
View Full Code Here

    // "java:comp/env/" will be prefixed if the JNDI name doesn't already
    // have it
    factoryBean.setResourceRef(true);
    try {
      // this step actually does the JNDI lookup
      factoryBean.afterPropertiesSet();
    } catch (Exception e) {
      logger.warn("failed to locate mail session : " + e);
      return;
    }
    Session session = (Session) factoryBean.getObject();
View Full Code Here

        as.setService(new QName("echo"));
        jbi.activateComponent(as);
       
        JndiObjectFactoryBean fb = new JndiObjectFactoryBean();
        fb.setJndiName(ClientFactory.DEFAULT_JNDI_NAME);
        fb.afterPropertiesSet();
        ClientFactory cf = (ClientFactory) fb.getObject();
        ServiceMixClient client = cf.createClient();
       
        Destination dest = client.createDestination("service::echo");
        InOut me = dest.createInOutExchange();
View Full Code Here

        JndiObjectFactoryBean jndiBean = new JndiObjectFactoryBean();
        jndiBean.setLookupOnStartup(true);
        jndiBean.setResourceRef(true);
        jndiBean.setJndiName("jdbc/STATSDB");
        jndiBean.setExpectedType(javax.sql.DataSource.class);
        jndiBean.afterPropertiesSet();

        DataSource datasource = (DataSource)jndiBean.getObject();

        JdbcTemplate template = new JdbcTemplate();
        template.setDataSource(datasource);
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.