endurox-java
Enduro/X Programming main page

Programming standard page

This section lists API practices used by Enduro/X Java package

ATMI API

ATMI API uses lower case function names (instead of Java camel case). This is for clener compatibility with C XATMI API. The same goes with the constants. ATMI constants goes in upper case as in the C side.

Class names are typed as with Java Standard.

Java Specific API

Java Specific APIs are using standard camel cases method names.

Java Specific API

All classes which are linked with C resources have the finalize() method overriden, but due mostly undefined logic of GC's finalize() invocation frequency, Enduro/X Java API implements cleanup() method, so that in code explicitly resources could be free'd up.

Error handling

In Enduro/X Java module error handling is done in a Java native way exceptions are thrown. Non checked exceptions are used and exceptions which might be throw by underlaying Enduro/X C API calls are denoted in documentation. There might be other exceptions thrown by the APIs, in case if there are some issues with JNI calls, like out of memory or missing classes. This normally shall not happen.

ATMI Exceptions may contain the input buffer assocated with the exception. If programmer have passed to method TypedBuffer and the exception does not contain the buffer, then assume that input buffer is still valid. If exception contains the buffer, then programmer shall continue to use that one from exception.