org.itracker.services.util
Class NamingUtilites

java.lang.Object
  extended by org.itracker.services.util.NamingUtilites

public class NamingUtilites
extends Object

Utilities class for naming

Author:
ranks@rosa.com

Constructor Summary
NamingUtilites()
           
 
Method Summary
static Context getDefaultInitialContext()
          get a default initial context
static Context getDefaultInitialContext(Hashtable<?,?> environment)
          get a default initial context
static String getStringValue(Context ctx, String lookupName, String defaultValue)
          Read a String value of any type of object
static Object lookup(Context ctx, String lookupName)
          savely get object from naming context
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamingUtilites

public NamingUtilites()
Method Detail

getStringValue

public static final String getStringValue(Context ctx,
                                          String lookupName,
                                          String defaultValue)
Read a String value of any type of object

Parameters:
ctx - - Context for lookup
lookupName - - lookup name
defaultValue - - default value

lookup

public static final Object lookup(Context ctx,
                                  String lookupName)
savely get object from naming context

Parameters:
ctx -
lookupName -
Returns:
Object - value
Throws:
IllegalArgumentException - - if any argument is null, or the lookup name was empty

getDefaultInitialContext

public static final Context getDefaultInitialContext(Hashtable<?,?> environment)
                                              throws NamingException
get a default initial context

Returns:
initial context.
Throws:
NamingException
IllegalStateException - - if initial context was null

getDefaultInitialContext

public static final Context getDefaultInitialContext()
                                              throws NamingException
get a default initial context

Returns:
initial context.
Throws:
NamingException
IllegalStateException - - if initial context was null


Copyright © 2002-2012 itracker. All Rights Reserved.