Package org.springframework.jndi

Examples of org.springframework.jndi.JndiLocatorDelegate


   * (for compatibility with Google App Engine's API white list).
   */
  private class LocatorDelegate {

    public <T> T lookup(String jndiName, Class<T> requiredType) throws Exception {
      JndiLocatorDelegate locator = new JndiLocatorDelegate();
      if (jndiEnvironment instanceof JndiTemplate) {
        locator.setJndiTemplate((JndiTemplate) jndiEnvironment);
      }
      else if (jndiEnvironment instanceof Properties) {
        locator.setJndiEnvironment((Properties) jndiEnvironment);
      }
      else if (jndiEnvironment != null) {
        throw new IllegalStateException("Illegal 'jndiEnvironment' type: " + jndiEnvironment.getClass());
      }
      locator.setResourceRef(resourceRef);
      return locator.lookup(jndiName, requiredType);
    }
View Full Code Here


   * (for compatibility with Google App Engine's API white list).
   */
  private class LocatorDelegate {

    public <T> T lookup(String jndiName, Class<T> requiredType) throws Exception {
      JndiLocatorDelegate locator = new JndiLocatorDelegate();
      if (jndiEnvironment instanceof JndiTemplate) {
        locator.setJndiTemplate((JndiTemplate) jndiEnvironment);
      }
      else if (jndiEnvironment instanceof Properties) {
        locator.setJndiEnvironment((Properties) jndiEnvironment);
      }
      else if (jndiEnvironment != null) {
        throw new IllegalStateException("Illegal 'jndiEnvironment' type: " + jndiEnvironment.getClass());
      }
      locator.setResourceRef(resourceRef);
      return locator.lookup(jndiName, requiredType);
    }
View Full Code Here

  private JmsProperties properties;

  @Bean
  public ConnectionFactory connectionFactory() throws NamingException {
    if (StringUtils.hasLength(this.properties.getJndiName())) {
      return new JndiLocatorDelegate().lookup(this.properties.getJndiName(),
          ConnectionFactory.class);
    }
    return findJndiConnectionFactory();
  }
View Full Code Here

  }

  private ConnectionFactory findJndiConnectionFactory() {
    for (String name : JNDI_LOCATIONS) {
      try {
        return new JndiLocatorDelegate().lookup(name, ConnectionFactory.class);
      }
      catch (NamingException ex) {
        // Swallow and continue
      }
    }
View Full Code Here

   * (for compatibility with Google App Engine's API white list).
   */
  private class LocatorDelegate {

    public <T> T lookup(String jndiName, Class<T> requiredType) throws Exception {
      JndiLocatorDelegate locator = new JndiLocatorDelegate();
      if (jndiEnvironment instanceof JndiTemplate) {
        locator.setJndiTemplate((JndiTemplate) jndiEnvironment);
      }
      else if (jndiEnvironment instanceof Properties) {
        locator.setJndiEnvironment((Properties) jndiEnvironment);
      }
      else if (jndiEnvironment != null) {
        throw new IllegalStateException("Illegal 'jndiEnvironment' type: " + jndiEnvironment.getClass());
      }
      locator.setResourceRef(resourceRef);
      return locator.lookup(jndiName, requiredType);
    }
View Full Code Here

TOP

Related Classes of org.springframework.jndi.JndiLocatorDelegate

Copyright © 2018 www.massapicom. 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.