Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.runtime.test.runner
Class JndiHelper

java.lang.Object
  extended by org.nuxeo.runtime.test.runner.JndiHelper

public class JndiHelper
extends Object

helper for common jndi operations copied from jboss Util class


Constructor Summary
JndiHelper()
           
 
Method Summary
static void bind(Context ctx, Name name, Object value)
          Bind val to name in ctx, and make sure that all intermediate contexts exist
static void bind(Context ctx, String name, Object value)
          Bind val to name in ctx, and make sure that all intermediate contexts exist
static Context createSubcontext(Context ctx, Name name)
          Create a subcontext including any intermediate contexts.
static Context createSubcontext(Context ctx, String name)
          Create a subcontext including any intermediate contexts.
static void rebind(Context ctx, Name name, Object value)
          Rebind val to name in ctx, and make sure that all intermediate contexts exist
static void rebind(Context ctx, String name, Object value)
          Rebind val to name in ctx, and make sure that all intermediate contexts exist
static void unbind(Context ctx, Name name)
          Unbinds a name from ctx, and removes parents if they are empty
static void unbind(Context ctx, String name)
          Unbinds a name from ctx, and removes parents if they are empty
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JndiHelper

public JndiHelper()
Method Detail

createSubcontext

public static Context createSubcontext(Context ctx,
                                       String name)
                                throws NamingException
Create a subcontext including any intermediate contexts.

Parameters:
ctx - the parent JNDI Context under which value will be bound
name - the name relative to ctx of the subcontext.
Returns:
The new or existing JNDI subcontext
Throws:
NamingException - on any JNDI failure

createSubcontext

public static Context createSubcontext(Context ctx,
                                       Name name)
                                throws NamingException
Create a subcontext including any intermediate contexts.

Parameters:
ctx - the parent JNDI Context under which value will be bound
name - the name relative to ctx of the subcontext.
Returns:
The new or existing JNDI subcontext
Throws:
NamingException - on any JNDI failure

bind

public static void bind(Context ctx,
                        String name,
                        Object value)
                 throws NamingException
Bind val to name in ctx, and make sure that all intermediate contexts exist

Parameters:
ctx - the parent JNDI Context under which value will be bound
name - the name relative to ctx where value will be bound
value - the value to bind.
Throws:
NamingException - for any error

bind

public static void bind(Context ctx,
                        Name name,
                        Object value)
                 throws NamingException
Bind val to name in ctx, and make sure that all intermediate contexts exist

Parameters:
ctx - the parent JNDI Context under which value will be bound
name - the name relative to ctx where value will be bound
value - the value to bind.
Throws:
NamingException - for any error

rebind

public static void rebind(Context ctx,
                          String name,
                          Object value)
                   throws NamingException
Rebind val to name in ctx, and make sure that all intermediate contexts exist

Parameters:
ctx - the parent JNDI Context under which value will be bound
name - the name relative to ctx where value will be bound
value - the value to bind.
Throws:
NamingException - for any error

rebind

public static void rebind(Context ctx,
                          Name name,
                          Object value)
                   throws NamingException
Rebind val to name in ctx, and make sure that all intermediate contexts exist

Parameters:
ctx - the parent JNDI Context under which value will be bound
name - the name relative to ctx where value will be bound
value - the value to bind.
Throws:
NamingException - for any error

unbind

public static void unbind(Context ctx,
                          String name)
                   throws NamingException
Unbinds a name from ctx, and removes parents if they are empty

Parameters:
ctx - the parent JNDI Context under which the name will be unbound
name - The name to unbind
Throws:
NamingException - for any error

unbind

public static void unbind(Context ctx,
                          Name name)
                   throws NamingException
Unbinds a name from ctx, and removes parents if they are empty

Parameters:
ctx - the parent JNDI Context under which the name will be unbound
name - The name to unbind
Throws:
NamingException - for any error

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.