JSlim  


com.gtcgroup.jslim
Class ServiceLocatorX

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

public final class ServiceLocatorX
extends ServiceLocatorSuper

This JSlim class provides extended ServiceLocator services.

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 ServiceLocatorX()
          Constructor.
 
Method Summary
static void closeConnection(java.sql.Connection connection)
          This convenience method closes a Connection object.
static void closeContext(JSlimInitialContext jSlimInitialContext)
          This method returns a JSlimInitialContext object to the pool.
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 java.sql.Connection getConnection(java.lang.String strServiceKey)
          This method returns an Connection object.
static java.lang.String getConnectionAuditName(java.lang.String strServiceKey)
          This convenience method returns an arbitrary descriptor driven String for audit trail logging (not used in obtaining a connection).
static int getIncrement(java.lang.String strServiceKey, java.lang.String strIncrementName)
          This method returns an int primary key value.
static int getInt(java.lang.String strElementKey)
          This method returns a int.
static JSlimInitialContext getRemoteContext(java.lang.String strServiceKey)
          This method returns a JSlimInitialContext object.
static javax.ejb.EJBHome getRemoteHome(java.lang.Class homeClassName)
          This method returns an EJBHome object using a remote InitialContext.
static java.lang.String getText(java.lang.String strElementKey)
          This method returns an String 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.
static java.lang.String sendMessage(java.lang.String strServiceKey, java.io.Serializable message)
          This method sends text and object Messages to a JMS Queue using a pooled JSlimProducer object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceLocatorX

private ServiceLocatorX()
Constructor.

Method Detail

getRemoteContext

public static final JSlimInitialContext getRemoteContext(java.lang.String strServiceKey)
                                                  throws JSlimException

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

Note: The JSlimInitialContext should be closed [ServiceLocatorX.closeContext()] after use.

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

closeContext

public static final void closeContext(JSlimInitialContext jSlimInitialContext)
                               throws JSlimException

This method returns a JSlimInitialContext object to the pool.

Parameters:
jSlimInitialContext - Class extending InitialContext in order to override methods throwing a NamingException.
Throws:
JSlimException - if an exception encountered.

getConnection

public static final java.sql.Connection getConnection(java.lang.String strServiceKey)
                                               throws JSlimException

This method returns an Connection object. A _ConnectionX Service is the preferred approach to obtaining a Connection by one of three alternatives. The processing sequence is as follows:

Note: Connections should be closed [ServiceLocatorX.closeConnection()] after use.

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

closeConnection

public static final void closeConnection(java.sql.Connection connection)
                                  throws JSlimException

This convenience method closes a Connection object.

Parameters:
connection - A connection (session) with a specific database. SQL statements are executed and results are returned within the context of a connection.
Throws:
JSlimException - if an exception encountered.

getConnectionAuditName

public static final java.lang.String getConnectionAuditName(java.lang.String strServiceKey)
                                                     throws JSlimException

This convenience method returns an arbitrary descriptor driven String for audit trail logging (not used in obtaining a connection).

Parameters:
strServiceKey - Represents the service key read from a descriptor document.
Returns:
An arbitrary descriptor driven String for audit trail logging
Throws:
JSlimException - if an exception encountered.

getIncrement

public static final int getIncrement(java.lang.String strServiceKey,
                                     java.lang.String strIncrementName)
                              throws JSlimException

This method returns an int primary key value. An _IncrementX Service provides a generic (vendor independent) solution for incrementing primary key table columns. The processing sequence is as follows:

For details please review the example jslim.xml.

Parameters:
strServiceKey - Represents the service key read from a descriptor document.
strIncrementName - Typically a table name for which an incremented primary key value is requested.
Returns:
An int primary key value.
Throws:
JSlimException - if an exception encountered.

sendMessage

public static final java.lang.String sendMessage(java.lang.String strServiceKey,
                                                 java.io.Serializable message)
                                          throws JSlimException

This method sends text and object Messages to a JMS Queue using a pooled JSlimProducer object. The processing sequence is as follows:

Parameters:
strServiceKey - Represents the service key read from a descriptor document.
message - The message to be sent.
Returns:
The String message ID.
Throws:
JSlimException - if an exception encountered.

getRemoteHome

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

This method returns an EJBHome object using a remote InitialContext. The processing sequence is as follows:

Parameters:
homeClassName - Represents the EJBHome name.
Returns:
An EJBHome object.
Throws:
JSlimException

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.