endurox-java
|
Public Member Functions | |
long | getCtx () |
void | setCtx (long ctx) |
Server | getSvr () |
native TypedBuffer | tpalloc (String btype, String bsubtype, long size) |
AtmiCtx () | |
AtmiCtx (long ctx) | |
native void | tpterm () |
void | cleanup () |
native void | tpreturn (int rval, long rcode, TypedBuffer data, long flags) |
native void | tpforward (String svcname, TypedBuffer data, long flags) |
synchronized int | tprun (Server svr, String[] arg) |
synchronized int | tprun (Server svr) |
void | tpadvertise (String svcname, String funcname, Service svc) |
native void | tplogdelbufreqfile (TypedBuffer data) |
native int | tplogqinfo (int lev, long flags) |
native void | tplogex (int lev, String msg, Throwable e) |
native void | tplogsetreqfile (TypedBuffer data, String filename, String filesvc) |
native String | tploggetbufreqfile (TypedBuffer data) |
native String | tploggetreqfile () |
native void | tplogsetreqfile_direct (String filename) |
native void | tplogclosereqfile () |
native void | tplogconfig (int logger, int lev, String debug_string, String module, String new_file) |
native void | userlogex (String msg, Throwable e) |
void | tplog (int lev, boolean directCall, String format, Object... arguments) |
void | tplogAlways (String format, Object... arguments) |
void | tplogError (String format, Object... arguments) |
void | tplogWarn (String format, Object... arguments) |
void | tplogInfo (String format, Object... arguments) |
void | tplogDebug (String format, Object... arguments) |
native void | tplogDump (int lev, String msg, byte[] data) |
native void | tplogDumpDiff (int lev, String msg, byte[] data1, byte[] data2) |
native void | tpinit (TpInit tpinfo) |
void | userlog (String format, Object... arguments) |
native TypedBuffer | tpcall (String svc, TypedBuffer idata, long flags) |
native int | tpacall (String svc, TypedBuffer idata, long flags) |
native TpgetrplyResult | tpgetrply (int cd, TypedBuffer odata, long flags) |
native int | tpconnect (String svc, TypedBuffer idata, long flags) |
native long | tpsend (int cd, TypedBuffer idata, long flags) |
native TprecvResult | tprecv (int cd, TypedBuffer idata, long flags) |
native void | tpdiscon (int cd) |
native void | tpcancel (int cd) |
native BExprTree | Bboolco (String expr) |
native void | Bboolpr (BExprTree cexpr, OutputStream ostream) |
void | Bboolsetcbf (String funcname, Bboolcbf callback) |
native String | Btype (int bfldid) |
native String | Bfname (int bfldid) |
native int | Bfldid (String fldnm) |
native int | tptoutget () |
native long | tpurcode () |
native void | tptoutset (int tout) |
TypedString | newString (String s) |
TypedJson | newJson (String j) |
TypedCarray | newCarray (byte[] b) |
native long[] | getBuffers () |
UnsolCallback | tpsetunsol (UnsolCallback cb) |
native void | tpnotify (ClientId clientid, TypedBuffer idata, long flags) |
native void | tpbroadcast (String lmid, String usrname, String cltname, TypedBuffer idata, long flags) |
native int | tpchkunsol () |
native void | tpenqueue (String qspace, String qname, TPQCTL ctl, TypedBuffer idata, long flags) |
native void | tpenqueueex (short nodeid, short srvid, String qname, TPQCTL ctl, TypedBuffer idata, long flags) |
native TypedBuffer | tpdequeue (String qspace, String qname, TPQCTL ctl, TypedBuffer odata, long flags) |
native TypedBuffer | tpdequeueex (short nodeid, short srvid, String qname, TPQCTL ctl, TypedBuffer odata, long flags) |
native long | tpsrvgetctxdata () |
native void | tpsrvsetctxdata (long dataptr, long flags) |
native void | tpsrvfreectxdata (long dataptr) |
native void | tpcontinue () |
native void | tpopen () |
native void | tpclose () |
native void | tpbegin (long timeout, long flags) |
native void | tpcommit (long flags) |
native void | tpabort (long flags) |
native TPTRANID | tpsuspend (long flags) |
native void | tpresume (TPTRANID tid, long flags) |
Connection | tpgetconn () throws SQLException |
native int | tpgetlev () |
native void | installTermSigHandler (java.lang.Runnable run) |
Static Public Member Functions | |
static AtmiCtx | createAtmiCtx (long ctx) |
Public Attributes | |
XAConnection | xaConn = null |
XAResource | xaRes = null |
Protected Member Functions | |
void | finalize () throws Throwable |
org.endurox.AtmiCtx.AtmiCtx | ( | ) |
Allocate new ATMI Context
AtmiTPESYSTEMException | Failed to allocate new context object in C space. |
org.endurox.AtmiCtx.AtmiCtx | ( | long | ctx | ) |
Create new ATMI Context, from existing C/external context. This does not perform C context deallocation
ctx | ptr to C context |
native int org.endurox.AtmiCtx.Bfldid | ( | String | fldnm | ) |
Method is used to dynamically resolve field id from given field name See Bfldid(3) manpage for more information.
fldnm | Field name |
UbfBEINVALException | null value passed in fldnm |
native String org.endurox.AtmiCtx.Bfname | ( | int | bfldid | ) |
Get field name by give compiled field id. If field tables are bad or field is not found, then output id is formatted as: "((BFLDID32)%d)" where "%d" is filled with bfldid
See Bfname(3) manpage for more information.
bfldid | compiled filed |
native String org.endurox.AtmiCtx.Btype | ( | int | bfldid | ) |
Return field type in string format. The possible values are following: 'short', 'long', 'char', 'float', 'double', 'string', 'carray' See Btype(3) manpage for more information.
bfldid | compiled field id. |
UbfBTYPERRException | Invalid field - bad type extracted from oldest bits. |
void org.endurox.AtmiCtx.cleanup | ( | ) |
Clean up the object (basically this is destructor) as we cannot relay on finalize() auto call of from the Garbage Collector. Thus we object goes out of the scope, this method needs to be called. This automatically invokes tpterm() too.
|
static |
Create ATMI Context by static call.
ctx | C pointer |
|
protected |
Terminate the ATMI Context
Throwable |
native long [] org.endurox.AtmiCtx.getBuffers | ( | ) |
List XATMI buffers (C side pointers). Note these pointer might not be valid after the call due to possible work of GC and/or other threads (if used). The method shall not be normally used. It is provided soley for Enduro/X internal purposes.
long org.endurox.AtmiCtx.getCtx | ( | ) |
Get The C Context
Server org.endurox.AtmiCtx.getSvr | ( | ) |
Get server object (if any)
native void org.endurox.AtmiCtx.installTermSigHandler | ( | java.lang.Runnable | run | ) |
This set a callback method indicating that shutdown is initiated from the OS. This captures the SIGTERM, SIGINT, SIGHUP signals. I.e. hides from the Java. On first method call, new signals are masked, and new thread is started which monitors the arrival of these signals. Once the signal is detected, the \r run object is executed.
run | object to be executed (if set) in case if termination signal is received. In case of NULL, the signal thread is not terminated, but it will do nothing in case of receiving the shutdown signals. |
TypedCarray org.endurox.AtmiCtx.newCarray | ( | byte[] | b | ) |
TypedJson org.endurox.AtmiCtx.newJson | ( | String | j | ) |
Allocate JSON object
j | string value to set |
TypedString org.endurox.AtmiCtx.newString | ( | String | s | ) |
Allocate string object with value
s | string value to set |
void org.endurox.AtmiCtx.setCtx | ( | long | ctx | ) |
Set the C context
ctx |
native int org.endurox.AtmiCtx.tpacall | ( | String | svc, |
TypedBuffer | idata, | ||
long | flags | ||
) |
Asynchronous service call See tpacall(3) manpage for more information.
svc | service name to call |
idata | input typed buffer to send to service |
flags | call flags: TPNOTRAN, TPSIGRSTRT, TPNOBLOCK, TPNOREPLY |
AtmiTPEINVALException | Invalid parameter is given to function. Either service name is NULL or flags does not allow to change the value. |
AtmiTPENOENTException | No service (svc parameter) advertised in system. |
AtmiTPETIMEException | Service did not reply in given time (NDRX_TOUT). |
AtmiTPESVCFAILException | Service returned TPFAIL. This is application level failure. |
AtmiTPESVCERRException | System level service failure. Server died during the message presence in service queue. |
AtmiTPESYSTEMException | System failure occurred during serving. See logs i.e. user log, or debugs for more info. |
AtmiTPEOSException | System failure occurred during serving. See logs i.e. user log, or debugs for more info. |
AtmiTPEBLOCKException | Service queue was full and TPNOBLOCK flag was specified. |
AtmiTPNOTIMEException | Do not expire call by server process, If message age is older than NDRX_TOUT timeout (or timeout overridden by tptoutset(3)). |
void org.endurox.AtmiCtx.tpadvertise | ( | String | svcname, |
String | funcname, | ||
Service | svc | ||
) |
native TypedBuffer org.endurox.AtmiCtx.tpalloc | ( | String | btype, |
String | bsubtype, | ||
long | size | ||
) |
Allocate buffer
btype | buffer type name |
bsubtype | buffer sub type or empty string (if no subtype) |
size | buffer size in bytes |
AtmiTPEINVALException | invalid arguments passed to btype
bsubtype
|
AtmiTPEOTYPEException | invalid types specified (or sub-type) |
AtmiTPESYSTEMException | system exception occurred |
AtmiTPEOSException | Operating System error occurred |
native TypedBuffer org.endurox.AtmiCtx.tpcall | ( | String | svc, |
TypedBuffer | idata, | ||
long | flags | ||
) |
Call the service See tpcall(3) manpage for more information.
svc | XATMI service name to call |
idata | Input buffer |
flags | ATMI flags; TPNOTRAN, TPSIGRSTRT, TPNOTIME, TPNOCHANGE, TPTRANSUSPEND, TPNOBLOCK |
AtmiTPEINVALException | Invalid parameter is given to function. Either service name is NULL or flags does not allow to change the value. |
AtmiTPENOENTException | No service (svc parameter) advertised in system. |
AtmiTPETIMEException | Service did not reply in given time (NDRX_TOUT). |
AtmiTPESVCFAILException | Service returned TPFAIL. This is application level failure. |
AtmiTPESVCERRException | System level service failure. Server died during the message presence in service queue. |
AtmiTPESYSTEMException | System failure occurred during serving. See logs i.e. user log, or debugs for more info. |
AtmiTPEOSException | System failure occurred during serving. See logs i.e. user log, or debugs for more info. |
AtmiTPEBLOCKException | Service request queue was full and TPNOBLOCK flag was specified. |
AtmiTPNOABORTException | Do not abort global transaction (if one in progress), even if service failed. |
native void org.endurox.AtmiCtx.tpcancel | ( | int | cd | ) |
Cancel a tpacall(). This basically marks the in the call descriptor registry that response is no more waited from the caller.
cd | call descriptor from the tpacall() |
AtmiTPEBADDESCException | Invalid call descriptor (out of range). |
AtmiTPEINVALException | Enduro/X is not configured. |
AtmiTPESYSTEMException | System failure occurred during serving. See logs i.e. user log, or debugs for more info. |
AtmiTPEOSException | System failure occurred during serving. See logs i.e. user log, or debugs for more info. |
native void org.endurox.AtmiCtx.tpforward | ( | String | svcname, |
TypedBuffer | data, | ||
long | flags | ||
) |
Forward the call to other service for processing
svc | target service name |
data | data buffer to send |
flags | call flags (reserved ) |
native TpgetrplyResult org.endurox.AtmiCtx.tpgetrply | ( | int | cd, |
TypedBuffer | odata, | ||
long | flags | ||
) |
Get reply from Asynchronous call tpacall(). See tpgetrply(3) manpage for more information.
[in] | cd | call descriptor returned by tpacall(). In case if TPGETANY flag is set, the field value is ignored |
[in] | odata | input data buffer used for receiving the reply data copied/reallocated to TpgetrplyResult |
flags | TPGETANY, TPNOBLOCK, TPSIGRSTRT, TPNOTIME, TPNOCHANGE, TPNOABORT |
AtmiTPEBLOCKException | TPENOBLOCK was specified in flags and no message is in queue. |
AtmiTPEINVALException | Invalid parameter is given to function. Particularly pointer parameters are NULL. |
AtmiTPETIMEException | Service did not reply in given time (NDRX_TOUT time). |
AtmiTPESVCFAILException | Service returned TPFAIL. This is application level failure. |
AtmiTPESVCERRException | System level service failure. Server died during the message presence in service queue. |
AtmiTPESYSTEMException | System failure occurred during serving. See logs i.e. user log, or debugs for more info. |
AtmiTPEOSException | System failure occurred during serving. See logs i.e. user log, or debugs for more info. |
AtmiTPEBADDESCException | Invalid call descriptor - out of range or not issued/canceled value. This exception is thrown only in case if TPGETANY flag is not passed to the call. |
native void org.endurox.AtmiCtx.tpinit | ( | TpInit | tpinfo | ) |
Initialize current ATMI Context as a ATMI client
tpinfo | might be NULL. Currently not used by Enduro/X |
AtmiTPEINVALException | environment not configured |
AtmiTPESYSTEMException | System failure occurred during serving. See logs i.e. user log, or debugs for more info. |
AtmiTPEOSException | System failure occurred during serving. See logs i.e. user log, or debugs for more info. |
native void org.endurox.AtmiCtx.tpreturn | ( | int | rval, |
long | rcode, | ||
TypedBuffer | data, | ||
long | flags | ||
) |
Perform tp return
rval | return value (TPSUCCESS/TPFAIL) |
rcode | user return code |
data | data buffer to return, can be NULL to? |
flags |
synchronized int org.endurox.AtmiCtx.tprun | ( | Server | svr | ) |
Run server using Enduro/X environment variables
svr | server class instance |
AtmiTPEINVALException | invalid command line arguments or invalid ATMI context. |
synchronized int org.endurox.AtmiCtx.tprun | ( | Server | svr, |
String[] | arg | ||
) |
Run server instance. Only one thread is allowed to step into this
svr | server class |
arg | Command line argumenst passed to the Enduro/X core. This is optional and can be NULL. In that case NDRX_SV* environment variables are used. |
AtmiTPEINVALException | invalid command line arguments or invalid ATMI context. |
native void org.endurox.AtmiCtx.tpterm | ( | ) |
Terminate XATMI Session. This does not remove the context. To remove context (including XATMI terminate), use cleanup() method.
AtmiTPEPROTOException | Called from XATMI server (main thread) |
AtmiTPESYSTEMException | Failed to close conversations |
AtmiTPEOSException | System failure occurred during serving. See logs i.e. user log, or debugs for more info. That could insufficient memory or other error |
native int org.endurox.AtmiCtx.tptoutget | ( | ) |
Return current XATMI timeout for IPC communications. By default method uses NDRX_TOUT env variable for readings if value is not override by
native void org.endurox.AtmiCtx.tptoutset | ( | int | tout | ) |
Set XATMI sub-system timeout value
tout | number of seconds for XATMI calls like tpcall or tpgetrply before returning timeout exception See tptoutset(3) manpage for more information. |
AtmiTPEINVALException | tout parameter is less or equal to 0. |
native long org.endurox.AtmiCtx.tpurcode | ( | ) |
Returns last user return code from tpcall/tpgetrply result. See tpurcode(3) manpage for more information.
void org.endurox.AtmiCtx.userlog | ( | String | format, |
Object... | arguments | ||
) |
Write user log (for more critical events)
format | java format string |
arguments | arguments for format string |
XAConnection org.endurox.AtmiCtx.xaConn = null |
XA Connection handler, i.e. if the context have invoked tpopen().
XAResource org.endurox.AtmiCtx.xaRes = null |
Currently active connection
public Connection dbConn = null; Currently active resource