net.wgen.op
Class OpUtils

java.lang.Object
  extended bynet.wgen.op.OpUtils

public class OpUtils
extends java.lang.Object

Utils class that runs Ops and provides some tracing functionality.

Version:
$Id: OpUtils.html,v 1.2 2007/01/28 04:09:36 paulfeuer Exp $
Author:
Paul Feuer, Wireless Generation, Inc.

Constructor Summary
OpUtils()
           
 
Method Summary
static java.util.Map getLoggableFieldsAndValues(Op op)
          Used by the ParamTreePathCallbackTransformer to generate a map of input fields and values.
static void logOpTiming(long t1, long t2, Op op)
          Logs an OP-TIME message to the application log for the DataOp.
static boolean looksLikeLoggableInput(Op op, java.lang.reflect.Field field)
          Called by the OpToStringBuilder to determine whether or not a field should be included in an Op's string representation.
static void runOp(Op op, CallExecutor callExecutor)
          Execute an Op and time it.
static java.lang.String toString(Op op)
          Create a string representation of a DataOp.
protected static MappedConnectionFactory wrapSingleConnection(java.sql.Connection connection, TraceKey traceKey)
          Convenience function to wrap single connections in a MappedConnectionFactory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpUtils

public OpUtils()
Method Detail

runOp

public static void runOp(Op op,
                         CallExecutor callExecutor)
                  throws OpException
Execute an Op and time it.

Parameters:
op - the DataOp to execute
callExecutor -
Throws:
OpException

toString

public static java.lang.String toString(Op op)
Create a string representation of a DataOp.

Parameters:
op - the op to be toString'ed
Returns:
the string representation of a DataOp

logOpTiming

public static void logOpTiming(long t1,
                               long t2,
                               Op op)
Logs an OP-TIME message to the application log for the DataOp.

Parameters:
t1 - the start time
t2 - the end time
op - the op that was executed

getLoggableFieldsAndValues

public static java.util.Map getLoggableFieldsAndValues(Op op)
                                                throws java.lang.IllegalAccessException
Used by the ParamTreePathCallbackTransformer to generate a map of input fields and values.

Parameters:
op - the op to be examined
Returns:
a map of field name to value for what look like the Op's inputs
Throws:
java.lang.IllegalAccessException
See Also:
ParamTreePathCallbackTransformer.getOpParams(net.wgen.op.db.DatabaseCall)

looksLikeLoggableInput

public static boolean looksLikeLoggableInput(Op op,
                                             java.lang.reflect.Field field)
Called by the OpToStringBuilder to determine whether or not a field should be included in an Op's string representation. So, in other words, the field will be accepted for inclusion in the String if:

Parameters:
op -
field -
Returns:
whether or not this field appears to be loggable

wrapSingleConnection

protected static MappedConnectionFactory wrapSingleConnection(java.sql.Connection connection,
                                                              TraceKey traceKey)
Convenience function to wrap single connections in a MappedConnectionFactory.

Parameters:
connection -
traceKey -
Returns:
a connection factory for the single connection