Class SimpleJndiNameResolver

java.lang.Object
org.mule.jms.commons.api.connection.factory.jndi.SimpleJndiNameResolver
All Implemented Interfaces:
JndiNameResolver, org.mule.runtime.api.lifecycle.Disposable, org.mule.runtime.api.lifecycle.Initialisable, org.mule.runtime.api.lifecycle.Lifecycle, org.mule.runtime.api.lifecycle.Startable, org.mule.runtime.api.lifecycle.Stoppable

public class SimpleJndiNameResolver extends Object
Defines a simple JndiNameResolver that maintains a Context instance opened all the time and always relies on the context to do the look ups.
Since:
1.0
  • Field Details

    • LOGGER

      protected final org.slf4j.Logger LOGGER
  • Constructor Details

    • SimpleJndiNameResolver

      public SimpleJndiNameResolver()
  • Method Details

    • lookup

      public Object lookup(String name) throws NamingException
      Description copied from interface: JndiNameResolver
      Looks up an object by name.
      Parameters:
      name - the name of the object to search for
      Returns:
      the object if is found
      Throws:
      NamingException - is there is an error during the lookup.
    • initialise

      public void initialise() throws org.mule.runtime.api.lifecycle.InitialisationException
      Specified by:
      initialise in interface org.mule.runtime.api.lifecycle.Initialisable
      Throws:
      org.mule.runtime.api.lifecycle.InitialisationException
    • dispose

      public void dispose()
      Specified by:
      dispose in interface org.mule.runtime.api.lifecycle.Disposable
    • createInitialContext

      protected Context createInitialContext() throws NamingException
      Creates a JNDI context using the current contextFactory
      Returns:
      a new Context instance. Callers must provide concurrent access control on the returned value.
      Throws:
      NamingException - if there is a problem during the context creation.
    • getContextProperties

      protected Hashtable getContextProperties()
    • getJndiProviderUrl

      public String getJndiProviderUrl()
    • setJndiProviderUrl

      public void setJndiProviderUrl(String jndiProviderUrl)
    • getJndiInitialFactory

      public String getJndiInitialFactory()
    • setJndiInitialFactory

      public void setJndiInitialFactory(String jndiInitialFactory)
    • getJndiProviderProperties

      public Map<String,Object> getJndiProviderProperties()
    • setJndiProviderProperties

      public void setJndiProviderProperties(Map<String,Object> jndiProviderProperties)
    • getContextFactory

      public InitialContextFactory getContextFactory()
    • setContextFactory

      public void setContextFactory(InitialContextFactory contextFactory)
    • start

      public void start() throws org.mule.runtime.api.exception.MuleException
      Specified by:
      start in interface org.mule.runtime.api.lifecycle.Startable
      Throws:
      org.mule.runtime.api.exception.MuleException
    • stop

      public void stop() throws org.mule.runtime.api.exception.MuleException
      Specified by:
      stop in interface org.mule.runtime.api.lifecycle.Stoppable
      Throws:
      org.mule.runtime.api.exception.MuleException