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

How to use
org.springframework.jndi.JndiLocatorDelegate
constructor

Best Java code snippets using org.springframework.jndi.JndiLocatorDelegate.<init> (Showing top 11 results out of 315)

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

  @Override
  public MBeanServer getMBeanServer() {
    try {
      return new JndiLocatorDelegate().lookup("java:comp/env/jmx/runtime", MBeanServer.class);
    }
    catch (NamingException ex) {
      throw new MBeanServerNotFoundException("Failed to retrieve WebLogic MBeanServer from JNDI", ex);
    }
  }
},
origin: org.springframework/spring-context

  @Override
  public MBeanServer getMBeanServer() {
    try {
      return new JndiLocatorDelegate().lookup("java:comp/env/jmx/runtime", MBeanServer.class);
    }
    catch (NamingException ex) {
      throw new MBeanServerNotFoundException("Failed to retrieve WebLogic MBeanServer from JNDI", ex);
    }
  }
},
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 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: 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: 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

  @Override
  public MBeanServer getMBeanServer() {
    try {
      return new JndiLocatorDelegate().lookup("java:comp/env/jmx/runtime", MBeanServer.class);
    }
    catch (NamingException ex) {
      throw new MBeanServerNotFoundException("Failed to retrieve WebLogic MBeanServer from JNDI", ex);
    }
  }
},
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.jndiJndiLocatorDelegate<init>

Popular methods of JndiLocatorDelegate

  • lookup
  • setJndiTemplate
  • setResourceRef
  • 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

  • Reactive rest calls using spring rest template
  • findViewById (Activity)
  • onRequestPermissionsResult (Fragment)
  • getResourceAsStream (ClassLoader)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Runner (org.openjdk.jmh.runner)
  • Top 17 PhpStorm Plugins
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