congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
JndiLocatorDelegate.setResourceRef
Code IndexAdd Tabnine to your IDE (free)

How to use
setResourceRef
method
in
org.springframework.jndi.JndiLocatorDelegate

Best Java code snippets using org.springframework.jndi.JndiLocatorDelegate.setResourceRef (Showing top 19 results out of 315)

origin: spring-projects/spring-framework

/**
 * Set whether the lookup occurs in a Java EE container, i.e. if the prefix
 * "java:comp/env/" needs to be added if the JNDI name doesn't already
 * contain it. PersistenceAnnotationBeanPostProcessor's default is "true".
 * @see org.springframework.jndi.JndiLocatorSupport#setResourceRef
 */
public void setResourceRef(boolean resourceRef) {
  this.jndiLocator.setResourceRef(resourceRef);
}
origin: spring-projects/spring-framework

/**
 * Set whether the lookup occurs in a Java EE container, i.e. if the prefix
 * "java:comp/env/" needs to be added if the JNDI name doesn't already
 * contain it. PersistenceAnnotationBeanPostProcessor's default is "true".
 * @see org.springframework.jndi.JndiLocatorSupport#setResourceRef
 */
public void setResourceRef(boolean resourceRef) {
  this.jndiLocator.setResourceRef(resourceRef);
}
origin: spring-projects/spring-framework

/**
 * Set whether the lookup occurs in a Java EE container, i.e. if the prefix
 * "java:comp/env/" needs to be added if the JNDI name doesn't already
 * contain it. PersistenceAnnotationBeanPostProcessor's default is "true".
 * @see org.springframework.jndi.JndiLocatorSupport#setResourceRef
 */
public void setResourceRef(boolean resourceRef) {
  this.jndiLocator.setResourceRef(resourceRef);
}
origin: org.springframework/spring-context

/**
 * Set whether the lookup occurs in a Java EE container, i.e. if the prefix
 * "java:comp/env/" needs to be added if the JNDI name doesn't already
 * contain it. PersistenceAnnotationBeanPostProcessor's default is "true".
 * @see org.springframework.jndi.JndiLocatorSupport#setResourceRef
 */
public void setResourceRef(boolean resourceRef) {
  this.jndiLocator.setResourceRef(resourceRef);
}
origin: org.springframework/spring-context

/**
 * Set whether the lookup occurs in a Java EE container, i.e. if the prefix
 * "java:comp/env/" needs to be added if the JNDI name doesn't already
 * contain it. PersistenceAnnotationBeanPostProcessor's default is "true".
 * @see org.springframework.jndi.JndiLocatorSupport#setResourceRef
 */
public void setResourceRef(boolean resourceRef) {
  this.jndiLocator.setResourceRef(resourceRef);
}
origin: org.springframework/spring-context

/**
 * Set whether the lookup occurs in a Java EE container, i.e. if the prefix
 * "java:comp/env/" needs to be added if the JNDI name doesn't already
 * contain it. PersistenceAnnotationBeanPostProcessor's default is "true".
 * @see org.springframework.jndi.JndiLocatorSupport#setResourceRef
 */
public void setResourceRef(boolean resourceRef) {
  this.jndiLocator.setResourceRef(resourceRef);
}
origin: spring-projects/spring-framework

/**
 * Configure a {@code JndiLocatorDelegate} with its "resourceRef" property set to
 * {@code true}, meaning that all names will be prefixed with "java:comp/env/".
 * @see #setResourceRef
 */
public static JndiLocatorDelegate createDefaultResourceRefLocator() {
  JndiLocatorDelegate jndiLocator = new JndiLocatorDelegate();
  jndiLocator.setResourceRef(true);
  return jndiLocator;
}
origin: org.springframework/spring-context

/**
 * Configure a {@code JndiLocatorDelegate} with its "resourceRef" property set to
 * {@code true}, meaning that all names will be prefixed with "java:comp/env/".
 * @see #setResourceRef
 */
public static JndiLocatorDelegate createDefaultResourceRefLocator() {
  JndiLocatorDelegate jndiLocator = new JndiLocatorDelegate();
  jndiLocator.setResourceRef(true);
  return jndiLocator;
}
origin: spring-projects/spring-framework

  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);
  }
}
origin: org.springframework/spring-orm

  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);
  }
}
origin: spring-projects/spring-framework

@Test
public void propertyWithDefaultClauseInResourceRefMode() {
  JndiLocatorDelegate jndiLocator = new JndiLocatorDelegate() {
    @Override
    public Object lookup(String jndiName) throws NamingException {
      throw new IllegalStateException("Should not get called");
    }
  };
  jndiLocator.setResourceRef(true);
  JndiPropertySource ps = new JndiPropertySource("jndiProperties", jndiLocator);
  assertThat(ps.getProperty("propertyKey:defaultValue"), nullValue());
}
origin: spring-projects/spring-framework

@Test
public void propertyWithColonInNonResourceRefMode() {
  JndiLocatorDelegate jndiLocator = new JndiLocatorDelegate() {
    @Override
    public Object lookup(String jndiName) throws NamingException {
      assertEquals("my:key", jndiName);
      return "my:value";
    }
  };
  jndiLocator.setResourceRef(false);
  JndiPropertySource ps = new JndiPropertySource("jndiProperties", jndiLocator);
  assertThat(ps.getProperty("my:key"), equalTo("my:value"));
}
origin: spring-projects/spring-framework

@Test
public void nameBoundWithoutPrefix() {
  final SimpleNamingContext context = new SimpleNamingContext();
  context.bind("p1", "v1");
  JndiTemplate jndiTemplate = new JndiTemplate() {
    @Override
    protected Context createInitialContext() throws NamingException {
      return context;
    }
  };
  JndiLocatorDelegate jndiLocator = new JndiLocatorDelegate();
  jndiLocator.setResourceRef(true);
  jndiLocator.setJndiTemplate(jndiTemplate);
  JndiPropertySource ps = new JndiPropertySource("jndiProperties", jndiLocator);
  assertThat(ps.getProperty("p1"), equalTo("v1"));
}
origin: spring-projects/spring-framework

@Test
public void nameBoundWithPrefix() {
  final SimpleNamingContext context = new SimpleNamingContext();
  context.bind("java:comp/env/p1", "v1");
  JndiTemplate jndiTemplate = new JndiTemplate() {
    @Override
    protected Context createInitialContext() throws NamingException {
      return context;
    }
  };
  JndiLocatorDelegate jndiLocator = new JndiLocatorDelegate();
  jndiLocator.setResourceRef(true);
  jndiLocator.setJndiTemplate(jndiTemplate);
  JndiPropertySource ps = new JndiPropertySource("jndiProperties", jndiLocator);
  assertThat(ps.getProperty("p1"), equalTo("v1"));
}
origin: apache/servicemix-bundles

/**
 * Set whether the lookup occurs in a Java EE container, i.e. if the prefix
 * "java:comp/env/" needs to be added if the JNDI name doesn't already
 * contain it. PersistenceAnnotationBeanPostProcessor's default is "true".
 * @see org.springframework.jndi.JndiLocatorSupport#setResourceRef
 */
public void setResourceRef(boolean resourceRef) {
  this.jndiLocator.setResourceRef(resourceRef);
}
origin: apache/servicemix-bundles

/**
 * Set whether the lookup occurs in a Java EE container, i.e. if the prefix
 * "java:comp/env/" needs to be added if the JNDI name doesn't already
 * contain it. PersistenceAnnotationBeanPostProcessor's default is "true".
 * @see org.springframework.jndi.JndiLocatorSupport#setResourceRef
 */
public void setResourceRef(boolean resourceRef) {
  this.jndiLocator.setResourceRef(resourceRef);
}
origin: apache/servicemix-bundles

/**
 * Set whether the lookup occurs in a Java EE container, i.e. if the prefix
 * "java:comp/env/" needs to be added if the JNDI name doesn't already
 * contain it. PersistenceAnnotationBeanPostProcessor's default is "true".
 * @see org.springframework.jndi.JndiLocatorSupport#setResourceRef
 */
public void setResourceRef(boolean resourceRef) {
  this.jndiLocator.setResourceRef(resourceRef);
}
origin: apache/servicemix-bundles

/**
 * Configure a {@code JndiLocatorDelegate} with its "resourceRef" property set to
 * {@code true}, meaning that all names will be prefixed with "java:comp/env/".
 * @see #setResourceRef
 */
public static JndiLocatorDelegate createDefaultResourceRefLocator() {
  JndiLocatorDelegate jndiLocator = new JndiLocatorDelegate();
  jndiLocator.setResourceRef(true);
  return jndiLocator;
}
origin: apache/servicemix-bundles

  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);
  }
}
org.springframework.jndiJndiLocatorDelegatesetResourceRef

Popular methods of JndiLocatorDelegate

  • <init>
  • lookup
  • setJndiTemplate
  • isDefaultJndiEnvironmentAvailable
    Check whether a default JNDI environment, as in a Java EE environment, is available on this JVM.
  • setJndiEnvironment
  • createDefaultResourceRefLocator
    Configure a JndiLocatorDelegate with its "resourceRef" property set to true, meaning that all names
  • isResourceRef

Popular in Java

  • Finding current android device location
  • runOnUiThread (Activity)
  • getExternalFilesDir (Context)
  • setScale (BigDecimal)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now