JSlim  


com.gtcgroup.jslim
Class ServiceLocator

java.lang.Object
  extended bycom.gtcgroup.jslim.ServiceLocatorSuper
      extended bycom.gtcgroup.jslim.ServiceLocator

public final class ServiceLocator
extends ServiceLocatorSuper

The "Core J2EE Patterns" ServiceLocator provides transparent location of business components and services in a uniform manner. This descriptor document driven implementation extends the standard pattern.

For details please review the example jslim.xml.

Copyright (c) 1999 - 2004 by Global Technology Consulting Group, Inc. at gtcGroup.com.
Use is authorized, provided the source is acknowledged by inclusion of this copyright notice.

Since:
v. 1.0
Author:
MDT (MarvinToll@gtcGroup.com)

Constructor Summary
private ServiceLocator()
          Constructor.
 
Method Summary
static java.util.ArrayList getArray(java.lang.String strElementKey)
          This method returns an ArrayList object.
static boolean getBoolean(java.lang.String strElementKey)
          This method returns a boolean.
static javax.sql.DataSource getDataSource(java.lang.String strServiceKey)
          This method returns a DataSource object.
static int getInt(java.lang.String strElementKey)
          This method returns a int.
static javax.ejb.EJBLocalHome getLocalHome(java.lang.String jndiHomeName)
          This method returns an EJBLocalHome object.
static javax.jms.Queue getQueue(java.lang.String strServiceKey)
          This method returns a JMS Queue object.
static javax.jms.QueueConnectionFactory getQueueConnectionFactory(java.lang.String strServiceKey)
          This method returns a JMS QueueConnectionFactory object.
static javax.ejb.EJBHome getRemoteHome(java.lang.String jndiHomeName, java.lang.Class homeClassName)
          This method returns a JSlimEJBHome object.
static java.lang.String getText(java.lang.String strElementKey)
          This method returns an String object.
static javax.jms.Topic getTopic(java.lang.String strServiceKey)
          This method returns a JMS Topic object.
static javax.jms.TopicConnectionFactory getTopicConnectionFactory(java.lang.String strServiceKey)
          This method returns a JMS TopicConnectionFactory object.
static void logDebug(java.lang.String strSourceClass, java.lang.String strSourceMethod, java.lang.String strMessage)
          Level - 300.
static void logEnter(java.lang.String strSourceClass, java.lang.String strSourceMethod)
          Level - 400.
static void logException(java.lang.String strSourceClass, java.lang.String strSourceMethod, java.lang.String strMessage, java.lang.Throwable throwable)
          Level - 500.
static void logExit(java.lang.String strSourceClass, java.lang.String strSourceMethod)
          Level - 400.
static void logFine(java.lang.String strSourceClass, java.lang.String strSourceMethod, java.lang.String strMessage)
          Level - 500.
static void logFiner(java.lang.String strSourceClass, java.lang.String strSourceMethod, java.lang.String strMessage)
          Level - 400.
static void logFinest(java.lang.String strSourceClass, java.lang.String strSourceMethod, java.lang.String strMessage)
          Level - 300.
static void logSQLException(java.lang.String strSourceClass, java.lang.String strSourceMethod, java.lang.String strMessage, java.sql.SQLException sE)
          Level - 500.
static void logWarning(java.lang.String strSourceClass, java.lang.String strSourceMethod, java.lang.String strMessage)
          Level - 500.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceLocator

private ServiceLocator()
Constructor.

Method Detail

getDataSource

public static final javax.sql.DataSource getDataSource(java.lang.String strServiceKey)
                                                throws JSlimException

This method returns a DataSource object. The processing sequence is as follows:

Parameters:
strServiceKey - Represents the service key read from a descriptor document.
Returns:
A JSlimDataSource object.
Throws:
JSlimException - if an exception encountered.

getTopicConnectionFactory

public static final javax.jms.TopicConnectionFactory getTopicConnectionFactory(java.lang.String strServiceKey)
                                                                        throws JSlimException

This method returns a JMS TopicConnectionFactory object. The processing sequence is as follows:

This method functions with or without a remote initial context service type specified in a descriptor document. If none specified, a local initial context is obtained for the current JVM.

Parameters:
strServiceKey - Represents the service key read from a descriptor document.
Returns:
A TopicConnectionFactory object.
Throws:
JSlimException - if an exception encountered.

getTopic

public static final javax.jms.Topic getTopic(java.lang.String strServiceKey)
                                      throws JSlimException

This method returns a JMS Topic object. The processing sequence is as follows:

This method functions with or without a remote initial context service type specified in a descriptor document. If none specified, a local initial context is obtained for the current JVM.

Parameters:
strServiceKey - Represents the service key read from a descriptor document.
Returns:
A JMS Topic object.
Throws:
JSlimException - if an exception encountered.

getQueueConnectionFactory

public static final javax.jms.QueueConnectionFactory getQueueConnectionFactory(java.lang.String strServiceKey)
                                                                        throws JSlimException

This method returns a JMS QueueConnectionFactory object. The processing sequence is as follows:

This method functions with or without a remote initial context service type specified in a descriptor document. If none specified, a local initial context is obtained for the current JVM.

Parameters:
strServiceKey - Represents the service key read from a descriptor document.
Returns:
A QueueConnectionFactory object.
Throws:
JSlimException - if an exception encountered.

getQueue

public static final javax.jms.Queue getQueue(java.lang.String strServiceKey)
                                      throws JSlimException

This method returns a JMS Queue object. The processing sequence is as follows:

This method functions with or without a remote initial context service type specified in a descriptor document. If none specified, a local initial context is obtained for the current JVM.

Parameters:
strServiceKey - Represents the service key read from a descriptor document.
Returns:
A JMS Queue object.
Throws:
JSlimException - if an exception encountered.

getLocalHome

public static final javax.ejb.EJBLocalHome getLocalHome(java.lang.String jndiHomeName)
                                                 throws JSlimException

This method returns an EJBLocalHome object. The processing sequence is as follows:

Parameters:
jndiHomeName - Represents the JNDI EJBHome name which is optionally a service key read from a descriptor document.
Returns:
An EJBLocalHome object.
Throws:
JSlimException - if an exception encountered.

getRemoteHome

public static final javax.ejb.EJBHome getRemoteHome(java.lang.String jndiHomeName,
                                                    java.lang.Class homeClassName)
                                             throws JSlimException

This method returns a JSlimEJBHome object. The processing sequence is as follows:

Parameters:
jndiHomeName - Represents the JNDI EJBHome name which is optionally a service key read from a descriptor document.
homeClassName - Represents the EJBHome name.
Returns:
A JSlimEJBHome object.
Throws:
JSlimException - if an exception encountered.

logException

public static final void logException(java.lang.String strSourceClass,
                                      java.lang.String strSourceMethod,
                                      java.lang.String strMessage,
                                      java.lang.Throwable throwable)
Level - 500.

Parameters:
strSourceClass - The class detecting the error.
strSourceMethod - The method detecting the error.
strMessage - The message.
throwable - The originating exception.

logSQLException

public static final void logSQLException(java.lang.String strSourceClass,
                                         java.lang.String strSourceMethod,
                                         java.lang.String strMessage,
                                         java.sql.SQLException sE)
Level - 500.

Parameters:
strSourceClass - The class detecting the error.
strSourceMethod - The method detecting the error.
strMessage - The message.
sE - The originating SQL exception.

logWarning

public static final void logWarning(java.lang.String strSourceClass,
                                    java.lang.String strSourceMethod,
                                    java.lang.String strMessage)
Level - 500.

Parameters:
strSourceClass - The class detecting the error.
strSourceMethod - The method detecting the error.
strMessage - The message.

logFine

public static final void logFine(java.lang.String strSourceClass,
                                 java.lang.String strSourceMethod,
                                 java.lang.String strMessage)
Level - 500.

Parameters:
strSourceClass - The class detecting the error.
strSourceMethod - The method detecting the error.
strMessage - The message.

logEnter

public static final void logEnter(java.lang.String strSourceClass,
                                  java.lang.String strSourceMethod)
Level - 400.

Parameters:
strSourceClass - The class detecting the error.
strSourceMethod - The method detecting the error.

logExit

public static final void logExit(java.lang.String strSourceClass,
                                 java.lang.String strSourceMethod)
Level - 400.

Parameters:
strSourceClass - The class detecting the error.
strSourceMethod - The method detecting the error.

logFiner

public static final void logFiner(java.lang.String strSourceClass,
                                  java.lang.String strSourceMethod,
                                  java.lang.String strMessage)
Level - 400.

Parameters:
strSourceClass - The class detecting the error.
strSourceMethod - The method detecting the error.
strMessage - The message.

logDebug

public static final void logDebug(java.lang.String strSourceClass,
                                  java.lang.String strSourceMethod,
                                  java.lang.String strMessage)
Level - 300.

Parameters:
strSourceClass - The class detecting the error.
strSourceMethod - The method detecting the error.
strMessage - The message.

logFinest

public static final void logFinest(java.lang.String strSourceClass,
                                   java.lang.String strSourceMethod,
                                   java.lang.String strMessage)
Level - 300.

Parameters:
strSourceClass - The class detecting the error.
strSourceMethod - The method detecting the error.
strMessage - The message.

getArray

public static final java.util.ArrayList getArray(java.lang.String strElementKey)
                                          throws JSlimException

This method returns an ArrayList object.

A _Property Service is optionally specified in a descriptor document. The following types are supported:

Parameters:
strElementKey - Represents an element key from a descriptor document.
Returns:
An ArrayList object.
Throws:
JSlimException - if an exception encountered.

getBoolean

public static final boolean getBoolean(java.lang.String strElementKey)
                                throws JSlimException

This method returns a boolean.

A _Property Service is optionally specified in a descriptor document. The following types are supported:

Parameters:
strElementKey - Represents an element key from a descriptor document.
Returns:
A boolean.
Throws:
JSlimException - if an exception encountered.

getInt

public static final int getInt(java.lang.String strElementKey)
                        throws JSlimException

This method returns a int.

A _Property Service is optionally specified in a descriptor document. The following types are supported:

Parameters:
strElementKey - Represents an element key from a descriptor document.
Returns:
A int.
Throws:
JSlimException - if an exception encountered.

getText

public static final java.lang.String getText(java.lang.String strElementKey)
                                      throws JSlimException

This method returns an String object.

A _Property Service is optionally specified in a descriptor document. The following types are supported:

Parameters:
strElementKey - Represents an element key from a descriptor document.
Returns:
An String object.
Throws:
JSlimException - if an exception encountered.

JSlim  


Copyright (c) 1999 - 2004 by Global Technology Consulting Group, Inc. at gtcGroup.com.
Use is authorized, provided the source is acknowledged by inclusion of this copyright notice.