OOP SimpleDaoHelper Version 1.2

com.bentofw.dao
Class JndiLocator

java.lang.Object
  extended by com.bentofw.dao.JndiLocator

public class JndiLocator
extends java.lang.Object

Service Locator. You can look up the JNDI DataSource and JNDI environment values, in addition to EJBHome.

Author:
Jun Inamori

Method Summary
 boolean getBooleanEnv(java.lang.String jndiName)
          Looks up the JNDI environment value and returns its boolean value for it.
 byte getByteEnv(java.lang.String jndiName)
          Looks up the JNDI environment value and returns its byte value for it.
 char getCharEnv(java.lang.String jndiName)
          Looks up the JNDI environment value and returns its char value for it.
 javax.sql.DataSource getDataSource(java.lang.String jndiName)
          Return the DataSource.
 double getDoubleEnv(java.lang.String jndiName)
          Looks up the JNDI environment value and returns its double value for it.
 javax.ejb.EJBHome getEjbHome(java.lang.String jndiName, java.lang.String className)
          Return the EJBHome.
 javax.ejb.EJBLocalHome getEjbLocalHome(java.lang.String jndiName)
          Return the EJBLocalHome.
 float getFloatEnv(java.lang.String jndiName)
          Looks up the JNDI environment value and returns its float value for it.
static JndiLocator getInstance()
          Return the instance of this class.
 int getIntEnv(java.lang.String jndiName)
          Looks up the JNDI environment value and returns its int value for it.
 long getLongEnv(java.lang.String jndiName)
          Looks up the JNDI environment value and returns its long value for it.
 javax.jms.Queue getQueue(java.lang.String jndiName)
          Return the Queue.
 javax.jms.QueueConnectionFactory getQueueConnectionFactory(java.lang.String jndiName)
          Return the QueueConnectionFactory.
 short getShortEnv(java.lang.String jndiName)
          Looks up the JNDI environment value and returns its short value for it.
 java.lang.String getStringEnv(java.lang.String jndiName)
          Looks up the JNDI environment value and returns its String value for it.
 javax.jms.Topic getTopic(java.lang.String jndiName)
          Return the Topic.
 javax.jms.TopicConnectionFactory getTopicConnectionFactory(java.lang.String jndiName)
          Return the TopicConnectionFactory.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static JndiLocator getInstance()
Return the instance of this class.

Returns:
The instance of this class.

getEjbHome

public javax.ejb.EJBHome getEjbHome(java.lang.String jndiName,
                                    java.lang.String className)
                             throws NestedException,
                                    SimpleException
Return the EJBHome.

Once the EJBHome is looked up, this method keeps the reference to it. So, the subsequent call of this method with the same JNDI name can soon return it, without looking up it on the InitialContext again.

Parameters:
jndiName - The JNDI name
className - The fully qualified class name for the intended EJBHome.
Returns:
EJBHome
Throws:
NestedException
SimpleException

getEjbLocalHome

public javax.ejb.EJBLocalHome getEjbLocalHome(java.lang.String jndiName)
                                       throws NestedException,
                                              SimpleException
Return the EJBLocalHome.

Once the EJBLocalHome is looked up, this method keeps the reference to it. So, the subsequent call of this method with the same JNDI name can soon return it, without looking up it on the InitialContext again.

Parameters:
jndiName - The JNDI name
Returns:
EJBLocalHome
Throws:
NestedException
SimpleException

getQueueConnectionFactory

public javax.jms.QueueConnectionFactory getQueueConnectionFactory(java.lang.String jndiName)
                                                           throws NestedException,
                                                                  SimpleException
Return the QueueConnectionFactory.

Once the QueueConnectionFactory is looked up, this method keeps the reference to it. So, the subsequent call of this method with the same JNDI name can soon return it, without looking up it on the InitialContext again.

Parameters:
jndiName - The JNDI name
Returns:
QueueConnectionFactory
Throws:
NestedException
SimpleException

getQueue

public javax.jms.Queue getQueue(java.lang.String jndiName)
                         throws NestedException,
                                SimpleException
Return the Queue.

Once the Queue is looked up, this method keeps the reference to it. So, the subsequent call of this method with the same JNDI name can soon return it, without looking up it on the InitialContext again.

Parameters:
jndiName - The JNDI name
Returns:
Queue
Throws:
NestedException
SimpleException

getTopicConnectionFactory

public javax.jms.TopicConnectionFactory getTopicConnectionFactory(java.lang.String jndiName)
                                                           throws NestedException,
                                                                  SimpleException
Return the TopicConnectionFactory.

Once the TopicConnectionFactory is looked up, this method keeps the reference to it. So, the subsequent call of this method with the same JNDI name can soon return it, without looking up it on the InitialContext again.

Parameters:
jndiName - The JNDI name
Returns:
TopicConnectionFactory
Throws:
NestedException
SimpleException

getTopic

public javax.jms.Topic getTopic(java.lang.String jndiName)
                         throws NestedException,
                                SimpleException
Return the Topic.

Once the Topic is looked up, this method keeps the reference to it. So, the subsequent call of this method with the same JNDI name can soon return it, without looking up it on the InitialContext again.

Parameters:
jndiName - The JNDI name
Returns:
Topic
Throws:
NestedException
SimpleException

getDataSource

public javax.sql.DataSource getDataSource(java.lang.String jndiName)
                                   throws NestedException,
                                          SimpleException
Return the DataSource.

Once the DataSource is looked up, this method keeps the reference to it. So, the subsequent call of this method with the same JNDI name can soon return it, without looking up it on the InitialContext again.

Parameters:
jndiName - The JNDI name
Returns:
DataSource
Throws:
NestedException
SimpleException

getBooleanEnv

public boolean getBooleanEnv(java.lang.String jndiName)
                      throws NestedException,
                             SimpleException
Looks up the JNDI environment value and returns its boolean value for it.

Once the JNDI environment value is looked up, this method keeps the reference to it. So, the subsequent call of this method with the same JNDI name can return without looking up it on the InitialContext again.

Parameters:
jndiName - The JNDI name
Returns:
boolean value for the intended JNDI environment value.
Throws:
NestedException
SimpleException

getByteEnv

public byte getByteEnv(java.lang.String jndiName)
                throws NestedException,
                       SimpleException
Looks up the JNDI environment value and returns its byte value for it.

Once the JNDI environment value is looked up, this method keeps the reference to it. So, the subsequent call of this method with the same JNDI name can return without looking up it on the InitialContext again.

Parameters:
jndiName - The JNDI name
Returns:
byte value for the intended JNDI environment value.
Throws:
NestedException
SimpleException

getCharEnv

public char getCharEnv(java.lang.String jndiName)
                throws NestedException,
                       SimpleException
Looks up the JNDI environment value and returns its char value for it.

Once the JNDI environment value is looked up, this method keeps the reference to it. So, the subsequent call of this method with the same JNDI name can return without looking up it on the InitialContext again.

Parameters:
jndiName - The JNDI name
Returns:
char value for the intended JNDI environment value.
Throws:
NestedException
SimpleException

getDoubleEnv

public double getDoubleEnv(java.lang.String jndiName)
                    throws NestedException,
                           SimpleException
Looks up the JNDI environment value and returns its double value for it.

Once the JNDI environment value is looked up, this method keeps the reference to it. So, the subsequent call of this method with the same JNDI name can return without looking up it on the InitialContext again.

Parameters:
jndiName - The JNDI name
Returns:
double value for the intended JNDI environment value.
Throws:
NestedException
SimpleException

getFloatEnv

public float getFloatEnv(java.lang.String jndiName)
                  throws NestedException,
                         SimpleException
Looks up the JNDI environment value and returns its float value for it.

Once the JNDI environment value is looked up, this method keeps the reference to it. So, the subsequent call of this method with the same JNDI name can return without looking up it on the InitialContext again.

Parameters:
jndiName - The JNDI name
Returns:
float value for the intended JNDI environment value.
Throws:
NestedException
SimpleException

getIntEnv

public int getIntEnv(java.lang.String jndiName)
              throws NestedException,
                     SimpleException
Looks up the JNDI environment value and returns its int value for it.

Once the JNDI environment value is looked up, this method keeps the reference to it. So, the subsequent call of this method with the same JNDI name can return without looking up it on the InitialContext again.

Parameters:
jndiName - The JNDI name
Returns:
int value for the intended JNDI environment value.
Throws:
NestedException
SimpleException

getLongEnv

public long getLongEnv(java.lang.String jndiName)
                throws NestedException,
                       SimpleException
Looks up the JNDI environment value and returns its long value for it.

Once the JNDI environment value is looked up, this method keeps the reference to it. So, the subsequent call of this method with the same JNDI name can return without looking up it on the InitialContext again.

Parameters:
jndiName - The JNDI name
Returns:
long value for the intended JNDI environment value.
Throws:
NestedException
SimpleException

getShortEnv

public short getShortEnv(java.lang.String jndiName)
                  throws NestedException,
                         SimpleException
Looks up the JNDI environment value and returns its short value for it.

Once the JNDI environment value is looked up, this method keeps the reference to it. So, the subsequent call of this method with the same JNDI name can return without looking up it on the InitialContext again.

Parameters:
jndiName - The JNDI name
Returns:
short value for the intended JNDI environment value.
Throws:
NestedException
SimpleException

getStringEnv

public java.lang.String getStringEnv(java.lang.String jndiName)
                              throws NestedException,
                                     SimpleException
Looks up the JNDI environment value and returns its String value for it.

Once the JNDI environment value is looked up, this method keeps the reference to it. So, the subsequent call of this method with the same JNDI name can return without looking up it on the InitialContext again.

Parameters:
jndiName - The JNDI name
Returns:
String value for the intended JNDI environment value.
Throws:
NestedException
SimpleException

OOP SimpleDaoHelper Version 1.2

ALL CONTENTS COPYRIGHT 2005, OOP-Research Corporation. All rights reserved.
Any questions and comments are welcome to OOP-Research Corporation.