/** * Set the JNDI environment to use for JNDI lookups. * Creates a JndiTemplate with the given environment settings. * @see #setJndiTemplate */ public void setJndiEnvironment(Properties jndiEnvironment) { this.jndiTemplate = new JndiTemplate(jndiEnvironment); }
/** * Set the JNDI template to use for JNDI lookups. * You can also specify JNDI environment settings via "jndiEnvironment". * @see #setJndiEnvironment */ public void setJndiTemplate(JndiTemplate jndiTemplate) { this.jndiTemplate = (jndiTemplate != null ? jndiTemplate : new JndiTemplate()); }
/** * Set the JNDI template to use for JNDI lookups. * <p>You can also specify JNDI environment settings via "jndiEnvironment". * @see #setJndiEnvironment */ public void setJndiTemplate(@Nullable JndiTemplate jndiTemplate) { this.jndiTemplate = (jndiTemplate != null ? jndiTemplate : new JndiTemplate()); }
/** * Set the JNDI environment to use for JNDI lookups. * Creates a JndiTemplate with the given environment settings. * @see #setJndiTemplate */ public void setJndiEnvironment(@Nullable Properties jndiEnvironment) { this.jndiTemplate = new JndiTemplate(jndiEnvironment); }
/** * Set the JNDI environment to use for JNDI lookups. * <p>Creates a JndiTemplate with the given environment settings. * @see #setJndiTemplate */ public void setJndiEnvironment(@Nullable Properties jndiEnvironment) { this.jndiTemplate = new JndiTemplate(jndiEnvironment); }
/** * Set the JNDI template to use for JNDI lookups. * You can also specify JNDI environment settings via "jndiEnvironment". * @see #setJndiEnvironment */ public void setJndiTemplate(JndiTemplate jndiTemplate) { this.jndiTemplate = (jndiTemplate != null ? jndiTemplate : new JndiTemplate()); }
/** * Set the JNDI environment to use for JNDI lookups. * Creates a JndiTemplate with the given environment settings. * @see #setJndiTemplate */ public void setJndiEnvironment(Properties jndiEnvironment) { this.jndiTemplate = new JndiTemplate(jndiEnvironment); }
/** * Set the JNDI environment to use for JNDI lookups. * <p>Creates a JndiTemplate with the given environment settings. * @see #setJndiTemplate */ public void setJndiEnvironment(@Nullable Properties jndiEnvironment) { this.jndiTemplate = new JndiTemplate(jndiEnvironment); }
/** * Set the JNDI template to use for JNDI lookups. * <p>You can also specify JNDI environment settings via "jndiEnvironment". * @see #setJndiEnvironment */ public void setJndiTemplate(@Nullable JndiTemplate jndiTemplate) { this.jndiTemplate = (jndiTemplate != null ? jndiTemplate : new JndiTemplate()); }
/** * Set the JNDI environment to use for JNDI lookups. * Creates a JndiTemplate with the given environment settings. * @see #setJndiTemplate */ public void setJndiEnvironment(@Nullable Properties jndiEnvironment) { this.jndiTemplate = new JndiTemplate(jndiEnvironment); }
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException { // Rely on default serialization; just initialize state after deserialization. ois.defaultReadObject(); // Create template for client-side JNDI lookup. this.jndiTemplate = new JndiTemplate(); // Perform a fresh lookup for JTA handles. initUserTransactionAndTransactionManager(); initTransactionSynchronizationRegistry(); }
@Override public void setAsText(@Nullable String text) throws IllegalArgumentException { if (text == null) { throw new IllegalArgumentException("JndiTemplate cannot be created from null string"); } if ("".equals(text)) { // empty environment setValue(new JndiTemplate()); } else { // we have a non-empty properties string this.propertiesEditor.setAsText(text); Properties props = (Properties) this.propertiesEditor.getValue(); setValue(new JndiTemplate(props)); } }
@Configuration public class MainConfig { ... @Bean DataSource dataSource() { DataSource dataSource = null; JndiTemplate jndi = new JndiTemplate(); try { dataSource = (DataSource) jndi.lookup("java:comp/env/jdbc/yourname"); } catch (NamingException e) { logger.error("NamingException for java:comp/env/jdbc/yourname", e); } return dataSource; } }
@Override public void setAsText(@Nullable String text) throws IllegalArgumentException { if (text == null) { throw new IllegalArgumentException("JndiTemplate cannot be created from null string"); } if ("".equals(text)) { // empty environment setValue(new JndiTemplate()); } else { // we have a non-empty properties string this.propertiesEditor.setAsText(text); Properties props = (Properties) this.propertiesEditor.getValue(); setValue(new JndiTemplate(props)); } }
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException { // Rely on default serialization; just initialize state after deserialization. ois.defaultReadObject(); // Create template for client-side JNDI lookup. this.jndiTemplate = new JndiTemplate(); // Perform a fresh lookup for JTA handles. initUserTransactionAndTransactionManager(); initTransactionSynchronizationRegistry(); }
public class JndiExporter implements InitializingBean { private final JndiTemplate template = new JndiTemplate(); private Map<String, Object> jndiMapping = null; @Override public void afterPropertiesSet() throws Exception { for(Entry<String, Object> addToJndi: jndiMapping.entrySet()){ template.bind(addToJndi.getKey(), addToJndi.getValue()); } } public void setJndiMapping(Map<String, Object> jndiMapping) { this.jndiMapping = jndiMapping; } }
/** * Set the JNDI environment to use for JNDI lookups. * Creates a JndiTemplate with the given environment settings. * @see #setJndiTemplate */ public void setJndiEnvironment(Properties jndiEnvironment) { this.jndiTemplate = new JndiTemplate(jndiEnvironment); }
/** * Set the JNDI environment to use for JNDI lookups. * Creates a JndiTemplate with the given environment settings. * @see #setJndiTemplate */ public void setJndiEnvironment(@Nullable Properties jndiEnvironment) { this.jndiTemplate = new JndiTemplate(jndiEnvironment); }
@Bean public JndiTemplate jndiTemplate() { JndiTemplate jndiTemplate = new JndiTemplate(); Properties environment = new Properties(); environment.setProperty(com....SOLACE_JMS_RESPECT_TIME_TO_LIVE, "false"); jndiTemplate.setEnvironment(environment); return jndiTemplate; }
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException { // Rely on default serialization; just initialize state after deserialization. ois.defaultReadObject(); // Create template for client-side JNDI lookup. this.jndiTemplate = new JndiTemplate(); // Perform a fresh lookup for JTA handles. initUserTransactionAndTransactionManager(); initTransactionSynchronizationRegistry(); }