JSlim  


com.gtcgroup.jslim
Class _IncrementX

java.lang.Object
  extended bycom.gtcgroup.jslim._ServiceTypesSuper
      extended bycom.gtcgroup.jslim._IncrementX

final class _IncrementX
extends _ServiceTypesSuper

This utility class provides a generic (vendor independent) solution for incrementing primary key table columns. The processing sequence is as follows:

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)

Field Summary
private static int intPrimaryKey
          Object/Interface used in the synchronized method.
private static java.sql.PreparedStatement pstmt
          Object/Interface used in the synchronized method.
private static java.sql.ResultSet resultSet
          Object/Interface used in the synchronized method.
 
Constructor Summary
private _IncrementX()
          Constructor.
 
Method Summary
(package private) static boolean closeConnection(java.sql.Connection connection)
          A convenience method for closing a Connection.
(package private) static int getIncrement(java.lang.String strServiceKey, java.lang.String strIncrementKey)
          Returns an incremented integer normally used as a primary key.
private static int getMock(ServiceKeyVO serviceKeyVO, java.lang.String strIncrementKey)
           
private static int getPrimaryKey(java.lang.String strIncrementKey, ServiceKeyVO serviceKeyVO, java.sql.Connection connection)
           
(package private) static java.lang.Object getServiceCached(int intServiceType, java.lang.String strServiceKey, boolean blnDescriptorDocRequired)
          Inherited method returning a mapped service object.
(package private) static java.lang.Object getServicePooled(int intServiceType, java.lang.String strServiceKey, ServiceElementVO serviceElementVOoriginating)
          "Template Method" returning a pooled service object.
(package private) static void reThrowInstantiationProblem(ServicesSuperVO serviceSuperVO, java.lang.String strSourceClass, java.lang.String strSourceMethod, java.lang.Throwable throwable)
          Level - 640.
(package private) static void rethrowNamingException(JSlimInitialContext jSlimInitialContext, ServiceKeyVO serviceKeyVO, java.lang.String strSourceClass, java.lang.String strSourceMethod, javax.naming.NamingException namingException)
          Level - 640.
(package private) static void throwOnlyNullsException(ServiceElementVO serviceElementVO1, ServiceElementVO serviceElementVO2, java.lang.String strSourceClass, java.lang.String strSourceMethod)
          Level - 640.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pstmt

private static java.sql.PreparedStatement pstmt
Object/Interface used in the synchronized method.


resultSet

private static java.sql.ResultSet resultSet
Object/Interface used in the synchronized method.


intPrimaryKey

private static int intPrimaryKey
Object/Interface used in the synchronized method.

Constructor Detail

_IncrementX

private _IncrementX()
Constructor.

Method Detail

getIncrement

static final int getIncrement(java.lang.String strServiceKey,
                              java.lang.String strIncrementKey)
                       throws JSlimException
Returns an incremented integer normally used as a primary key.

For details please review the example jslim.xml.

Parameters:
strServiceKey - Represents the service key read from a descriptor document.
strIncrementKey - The name of the integer to be incremented. (Row name in table.)
Returns:
An incremented integer.
Throws:
JSlimException

getPrimaryKey

private static final int getPrimaryKey(java.lang.String strIncrementKey,
                                       ServiceKeyVO serviceKeyVO,
                                       java.sql.Connection connection)
                                throws JSlimException
Throws:
JSlimException

getMock

private static int getMock(ServiceKeyVO serviceKeyVO,
                           java.lang.String strIncrementKey)
                    throws JSlimException
Throws:
JSlimException

getServicePooled

static java.lang.Object getServicePooled(int intServiceType,
                                         java.lang.String strServiceKey,
                                         ServiceElementVO serviceElementVOoriginating)
                                  throws JSlimException
"Template Method" returning a pooled service object.

Parameters:
intServiceType - Represents the service type read from a descriptor document.
strServiceKey - Represents the service key read from a descriptor document.
serviceElementVOoriginating - Immutable class containing text and descriptor document traceability.
Returns:
A new service object.
Throws:
JSlimException - if an exception encountered.

getServiceCached

static final java.lang.Object getServiceCached(int intServiceType,
                                               java.lang.String strServiceKey,
                                               boolean blnDescriptorDocRequired)
                                        throws JSlimException
Inherited method returning a mapped service object.

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

rethrowNamingException

static final void rethrowNamingException(JSlimInitialContext jSlimInitialContext,
                                         ServiceKeyVO serviceKeyVO,
                                         java.lang.String strSourceClass,
                                         java.lang.String strSourceMethod,
                                         javax.naming.NamingException namingException)
                                  throws JSlimException
Level - 640.

Parameters:
jSlimInitialContext - Class extending InitialContext in order to override methods throwing a NamingException.
serviceKeyVO - A portion of a descriptor document representing one service.
strSourceClass - The class detecting the error.
strSourceMethod - The method detecting the error.
namingException - The originating exception.
Throws:
JSlimException - if an exception encountered.

throwOnlyNullsException

static final void throwOnlyNullsException(ServiceElementVO serviceElementVO1,
                                          ServiceElementVO serviceElementVO2,
                                          java.lang.String strSourceClass,
                                          java.lang.String strSourceMethod)
                                   throws JSlimException
Level - 640.

Parameters:
serviceElementVO1 - Immutable class containing text and descriptor document traceability.
serviceElementVO2 - Immutable class containing text and descriptor document traceability.
strSourceClass - The class detecting the error.
strSourceMethod - The method detecting the error.
Throws:
JSlimException - if an exception encountered.

reThrowInstantiationProblem

static final void reThrowInstantiationProblem(ServicesSuperVO serviceSuperVO,
                                              java.lang.String strSourceClass,
                                              java.lang.String strSourceMethod,
                                              java.lang.Throwable throwable)
                                       throws JSlimException
Level - 640.

Parameters:
serviceSuperVO - Abstract super-class providing variables for VOs.
strSourceClass - The class detecting the error.
strSourceMethod - The method detecting the error.
throwable - The originating exception.
Throws:
JSlimException - if an exception encountered.

closeConnection

static final boolean closeConnection(java.sql.Connection connection)
A convenience method for closing a Connection.

Parameters:
connection -
Returns:
Whether or not the Connection closed successfully.

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.