congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
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

  • Finding current android device location
  • getExternalFilesDir (Context)
  • findViewById (Activity)
  • getResourceAsStream (ClassLoader)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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