public class LegacyJavaAppserverClient extends LegacyJavaAppserver
| Modifier and Type | Class and Description |
|---|---|
private static interface |
LegacyJavaAppserverClient.JavaClientAppServerWork
Interface for the work task to be processed by the legacy appserver worker, as prepared by the java
client.
|
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
connectionID
The appserver connection ID for this client.
|
protected static CentralLogger |
LOG
Anonymous log instance.
|
protected AppServerConnectionPool |
pool
The pool of workers.
|
protected long |
sessionID
The session ID associated with this client.
|
INPUT, INPUT_OUTPUT, OUTPUT, TYPE_BLOB, TYPE_CHARACTER, TYPE_CLOB, TYPE_DATASET, TYPE_DATASET_HANDLE, TYPE_DATE, TYPE_DATETIME, TYPE_DATETIMETZ, TYPE_DECIMAL, TYPE_HANDLE, TYPE_INT64, TYPE_INTEGER, TYPE_LOGICAL, TYPE_LONGCHAR, TYPE_MEMPTR, TYPE_RAW, TYPE_RECID, TYPE_ROWID, TYPE_TABLE, TYPE_TABLE_HANDLE, TYPE_UNKNOWN| Constructor and Description |
|---|
LegacyJavaAppserverClient(AppServerConnectionPool pool)
Initialize this client with the given worker pool.
|
LegacyJavaAppserverClient(AppServerConnectionPool pool,
boolean normalizedExtent)
Initialize this client with the given worker pool.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancelAllRequests()
Cancel all the requests active on this client.
|
boolean |
connect()
Execute the connection to the worker.
|
static LegacyJavaAppserverClient |
connectRemote(BootstrapConfig cfg,
java.lang.String appserver)
Establish a remote client connection, and connect it to the target appserver.
|
static LegacyJavaAppserverClient |
connectRemote(BootstrapConfig cfg,
java.lang.String appserver,
boolean sessionFree)
Establish a remote client connection, and connect it to the target appserver.
|
void |
deleteProcedure(handle h)
Delete the specified procedure handle.
|
void |
disconnect()
Disconnect this client.
|
protected boolean |
execute(LegacyAppServerWork work)
Send the given task to be executed by one of the workers in the
pool. |
private java.lang.String |
getTarget()
Get the target for the current web request.
|
void |
invokeWithArgs(java.lang.String procedure,
LegacyJavaAppserverParameter[] paramArray)
Perform a pseudo-dynamic call where the target procedure doesn't receive the parameter as arguments at
the Java method definition, but instead they are managed via
LegacyOpenClientCaller APIs. |
boolean |
isInitialized()
Check if the
pool is initialized. |
java.lang.Object |
runFunction(handle proxy,
java.lang.String function,
LegacyJavaAppserverParameter... paramArray)
Run the specified internal function in the given proxy external program.
|
handle |
runPersistentProcedure(java.lang.String procedureName,
LegacyJavaAppserverParameter... paramArray)
Run an external program persistent.
|
java.lang.String |
runProcedure(handle proxy,
java.lang.String procedure,
LegacyJavaAppserverParameter... paramArray)
Run the specified internal procedure in the given proxy external program.
|
java.lang.String |
runProcedure(java.lang.String procedure,
LegacyJavaAppserverParameter... paramArray)
Run the specified external program in non-persistent mode.
|
handle |
runSingleRunProcedure(java.lang.String procedure,
LegacyJavaAppserverParameter... paramArray)
Run the specified external program in SINGLE-RUN mode.
|
handle |
runSingletonProcedure(java.lang.String procedure,
LegacyJavaAppserverParameter... paramArray)
Run the specified external program in SINGLETON mode.
|
static void |
setMergeTables(boolean state)
Set the
DataSetSDOHelper.setMergeTables(boolean) flag. |
(package private) void |
setParameterOrig(LegacyJavaAppserverParameter param,
java.lang.Object orig)
Set the
orig value, useful when mocking the
LegacyJavaAppserverClient. |
static void |
setUnknownValuesForFields(boolean state)
Set the
DataSetSDOHelper.setUnknownValuesForFields(boolean) flag. |
addDataObject, addDataObject, addRelation, addTableMetaData, addTableMetaData, beginLogging, createDataGraph, createDataGraph, createDataObject, createDataObject, createGraphMetaData, createMemptr, createObjectMetaData, createObjectMetaData, endLogging, getArgumentModes, getArguments, getBeforeObjects, getBytes, getChangedDataObjects, getChanges, getChangeSummary, getChildRows, getConnection, getDataGraphName, getDataObjects, getDataObjects, getDataObjects, getFieldCount, getFieldName, getFields, getFieldType, getGraphName, getGregorianCalendar, getGregorianCalendar, getJavaParameter, getJavaParameter, getMetaData, getNamespacePrefix, getNamespaceURI, getNumTables, getNumTables, getOutputParameter, getOutputParameter, getRelation, getRelation, getRelations, getRelations, getTableFieldCount, getTableFieldNames, getTableFields, getTableFieldType, getTableFieldType, getTableIndex, getTableIndex, getTableIndex, getTableMetaData, getTableMetaData, getTableMetaData, getTableName, getTableNames, getXmlNodeName, isCreated, isDeleted, isMemptr, isTableField, postProcessArguments, selectRows, setDefaultTrackChanges, setFieldMetaData, setGregorianCalendar, setNamespacePrefix, setNamespaceURI, setNormalizedExtent, setXmlNodeName, useSchemaMarshalNoneclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitblob, character, clob, dataset, datasetHandle, date, datetime, datetimetz, decimal, handle, input, inputOutput, int64, integer, logical, longchar, memptr, output, raw, recid, rowid, table, tableHandle, unknownprotected static final CentralLogger LOG
protected final AppServerConnectionPool pool
protected final long sessionID
protected java.lang.String connectionID
public LegacyJavaAppserverClient(AppServerConnectionPool pool)
pool - The pool of workers where tasks will be forwarded, to be executed on the remote appserver.public LegacyJavaAppserverClient(AppServerConnectionPool pool, boolean normalizedExtent)
pool - The pool of workers where tasks will be forwarded, to be executed on the remote appserver.normalizedExtent - The extent field mode.public static LegacyJavaAppserverClient connectRemote(BootstrapConfig cfg, java.lang.String appserver)
cfg - The configuration to connect to the remote FWD server.appserver - The appserver name for the target connection.public static LegacyJavaAppserverClient connectRemote(BootstrapConfig cfg, java.lang.String appserver, boolean sessionFree)
cfg - The configuration to connect to the remote FWD server.appserver - The appserver name for the target connection.sessionFree - Flag indicating if session-free mode is used.public static void setUnknownValuesForFields(boolean state)
DataSetSDOHelper.setUnknownValuesForFields(boolean) flag. This will allow the getter to return
null if the field is not currently set in a table row (or even if it was set to null),
instead of returning 0 or false for Java native types (like int and boolean).state - true to return null if the field is not set.public static void setMergeTables(boolean state)
DataSetSDOHelper.setMergeTables(boolean) flag. This will allow the response to be merged based
on the signature instead of being replaced in the dataset.state - true to merge the response.public void cancelAllRequests()
public boolean isInitialized()
pool is initialized.public boolean connect()
true if it connected.public void invokeWithArgs(java.lang.String procedure,
LegacyJavaAppserverParameter[] paramArray)
LegacyOpenClientCaller APIs.
This allows the target program to act as a controller, where it can prepare the arguments, perform security checks, etc, before dispatching the call to the real target, which can be resolved from the arguments or in some other way.
procedure - The target external program. Must have no parameters defined.paramArray - The parameter array.public void deleteProcedure(handle h) throws ConditionException, RuntimeAppserverError
h - The procedure handle.ConditionException - In case the remote call has thrown an condition (STOP, QUIT, ERROR).RuntimeAppserverError - In case the remote call has thrown an unexpected error.public java.lang.Object runFunction(handle proxy, java.lang.String function, LegacyJavaAppserverParameter... paramArray)
proxy - A proxy external program obtained via runPersistentProcedure(java.lang.String, com.goldencode.p2j.util.LegacyJavaAppserverParameter...).function - The internal function name.paramArray - The parameters.ConditionException - In case the remote call has thrown an condition (STOP, QUIT, ERROR).RuntimeAppserverError - In case the remote call has thrown an unexpected error.public java.lang.String runProcedure(java.lang.String procedure,
LegacyJavaAppserverParameter... paramArray)
throws ConditionException,
RuntimeAppserverError
procedure - The external program name.paramArray - The parameters.ConditionException - In case the remote call has thrown an condition (STOP, QUIT, ERROR).RuntimeAppserverError - In case the remote call has thrown an unexpected error.public handle runSingleRunProcedure(java.lang.String procedure, LegacyJavaAppserverParameter... paramArray) throws ConditionException, RuntimeAppserverError
procedure - The external program name.paramArray - The parameters.ConditionException - In case the remote call has thrown an condition (STOP, QUIT, ERROR).RuntimeAppserverError - In case the remote call has thrown an unexpected error.public handle runSingletonProcedure(java.lang.String procedure, LegacyJavaAppserverParameter... paramArray) throws ConditionException, RuntimeAppserverError
procedure - The external program name.paramArray - The parameters.ConditionException - In case the remote call has thrown an condition (STOP, QUIT, ERROR).RuntimeAppserverError - In case the remote call has thrown an unexpected error.public java.lang.String runProcedure(handle proxy, java.lang.String procedure, LegacyJavaAppserverParameter... paramArray) throws ConditionException, RuntimeAppserverError
proxy - A proxy external program obtained via runPersistentProcedure(java.lang.String, com.goldencode.p2j.util.LegacyJavaAppserverParameter...).procedure - The internal procedure name.paramArray - The parameters.ConditionException - In case the remote call has thrown an condition (STOP, QUIT, ERROR).RuntimeAppserverError - In case the remote call has thrown an unexpected error.public handle runPersistentProcedure(java.lang.String procedureName, LegacyJavaAppserverParameter... paramArray) throws ConditionException, RuntimeAppserverError
procedureName - The procedure name.paramArray - The parameters.ConditionException - In case the remote call has thrown an condition (STOP, QUIT, ERROR).RuntimeAppserverError - In case the remote call has thrown an unexpected error.public void disconnect()
protected boolean execute(LegacyAppServerWork work)
pool.work - The work to be executed.java.lang.RuntimeException - If the request was not posted to any worker or the time allowed to execute has elapsed.void setParameterOrig(LegacyJavaAppserverParameter param, java.lang.Object orig)
orig value, useful when mocking the
LegacyJavaAppserverClient.param - The parameter instance.orig - The value assumed to be returned by the remote side.private java.lang.String getTarget()