|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.farrago.runtime.FarragoUdrRuntime
public abstract class FarragoUdrRuntime
FarragoUdrRuntime exposes a runtime support interface which can be used by
implementations of Farrago user-defined routines. For an example of how to
use this interface, see FarragoTestUDR.generateRandomNumber(long)
.
NOTE: By relying on this interface, your UDR becomes dependent on Farrago.
Constructor Summary | |
---|---|
FarragoUdrRuntime()
|
Method Summary | |
---|---|
static void |
checkCancel()
Tests to see whether the statement invoking this UDR has been cancelled; if so, an exception is thrown. |
static Object |
getContext()
Accesses the context object for the calling UDR. |
static Object |
getDataServerRuntimeSupport(Object param)
If this UDR invocation was generated by a FarragoMedDataServer , invokes that server's
FarragoMedDataServer.getRuntimeSupport(java.lang.Object)
method. |
static FarragoRepos |
getRepos()
Gets the FarragoRepos for this context. |
static FarragoSession |
getSession()
Gets the session which called the UDR. |
static Object |
handleRowError(String[] columnNames,
Object[] columnValues,
RuntimeException ex,
int columnIndex,
String tag,
boolean isWarning)
Forwards a row error to the runtime context. |
static Object |
handleRowError(String[] columnNames,
Object[] columnValues,
RuntimeException ex,
int columnIndex,
String tag,
boolean isWarning,
String errorCode,
String columnName)
Forwards error to runtime context, if error code is non-null, exceptions will be defered until all errors have been processed/logged for a row |
static void |
handleRowErrorCompletion(RuntimeException ex,
String tag)
|
static boolean |
inUdr()
|
static void |
setContext(Object context)
Stores the context object for the calling UDR. |
static void |
setExecutionHandle(FennelExecutionHandle execHandle)
Associates an execution handle with the context associated with the executing UDR. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FarragoUdrRuntime()
Method Detail |
---|
public static Object getContext()
public static void setContext(Object context)
ClosableAllocation
interface, its
closeAllocation method will be called automatically when statement
execution ends.
context
- new context object to setpublic static Object getDataServerRuntimeSupport(Object param)
FarragoMedDataServer
, invokes that server's
FarragoMedDataServer.getRuntimeSupport(java.lang.Object)
method. Otherwise, throws IllegalStateException
.
param
- server-specific runtime parameter
public static void checkCancel()
public static void setExecutionHandle(FennelExecutionHandle execHandle)
execHandle
- the execution handlepublic static FarragoSession getSession()
public static FarragoRepos getRepos()
public static Object handleRowError(String[] columnNames, Object[] columnValues, RuntimeException ex, int columnIndex, String tag, boolean isWarning)
columnNames
- array of column names from the input streamcolumnValues
- array of column values for the bad input row.
Primitive values such as long or int should be wrapped in Objects such as
Long or Int. Values should be printable via toString(). For example,
2006-10-08 would be preferrable to Date@1ee80a.ex
- the runtime exception to be handledcolumnIndex
- the 1-based index of the column with the error. Since
the value 0 is reserved for filter conditions, the value -1 may be used
when a column index is not applicable.tag
- a unique identifier for the source of the exception. It is
helpful for the tag to include information about the source. For example,
CleanseAddress[Id] may be more useful than [Id]. A timestamp suffix can
be informative and helps to satisfy the uniqueness requirement.isWarning
- whether the exception is to be treated as a warning
TupleIter.NoDataReason
to indicate that the error
could not be processed.public static Object handleRowError(String[] columnNames, Object[] columnValues, RuntimeException ex, int columnIndex, String tag, boolean isWarning, String errorCode, String columnName)
public static void handleRowErrorCompletion(RuntimeException ex, String tag)
public static boolean inUdr()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |