theLink 10.0
Loading...
Searching...
No Matches
MqMsgque.java
Go to the documentation of this file.
1
9/* LABEL-NO */
10package jvmqmsgque;
11
12import jvmkkernel.*;
13import java.util.concurrent.ExecutorService;
14import java.util.concurrent.Executors;
15import java.util.concurrent.Future;
16import java.util.concurrent.TimeUnit;
17
18// MARK_D ################################################################
19// -----------------------------------------------------------------------
20// documentation order
21
30
43
68
77
86
94
103
111
112// --------------------------------------------------------------------------------
113
117final public class MqMsgque {
118
119 private MqMsgque() {};
120
123
124 private static boolean first = false;
146 static private void SetupTmpl() {
147 if (first) return;
148 first = true;
149 //MkObjectC.M1();
150 System.loadLibrary("jvmqmsgque");
151
152 if (MqFactoryC.DefaultIdent().equals("libmqmsgque")) {
153 MqFactoryC.Add(MqContextC.class, "jvmsgque").Default().Initial();
154 }
155
156
157 var cmd = System.getProperty("sun.java.command").split(" ")[0];
158
159//MkObjectC.printObj(System.getProperty("sun.java.command"));
160//MkObjectC.printObj(cmd.substring(cmd.length()-4));
161
162 if (cmd.substring(cmd.length()-4).equals(".jar")) {
163 InitSetArg0("java","-jar",cmd);
164 } else {
165 InitSetArg0("java",cmd);
166 }
167 }
168
170
171 // PUBLIC
172
173 // BEGIN-MqMsgque - created by 'jv_MqS.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
174
178
179 // doc-key: MqMsgque,MqMsgque-Enum,sco
180
182 public native static MqIdentE IdentE_FromInt (int value);
183
185 public native static MqSlaveE SlaveE_FromInt (int value);
186
188 public native static MqStartE StartE_FromInt (int value);
189
191 public native static MqStatusIsEF StatusIsEF_FromInt (int value);
192
194 public native static MqWaitOnEventE WaitOnEventE_FromInt (int value);
195
196 // doc-key: MqMsgque,MqMsgque-Enum,sm_
197
199 public native static int IdentE_ToInt (MqIdentE value);
200
202 public native static String IdentE_ToString (MqIdentE value);
203
205 public native static int SlaveE_ToInt (MqSlaveE value);
206
208 public native static String SlaveE_ToString (MqSlaveE value);
209
211 public native static int StartE_ToInt (MqStartE value);
212
214 public native static String StartE_ToString (MqStartE value);
215
217 public native static int StatusIsEF_ToInt (MqStatusIsEF value);
218
220 public native static String StatusIsEF_ToString (MqStatusIsEF value);
221
223 public native static int WaitOnEventE_ToInt (MqWaitOnEventE value);
224
226 public native static String WaitOnEventE_ToString (MqWaitOnEventE value);
227
229 // MqMsgque_Enum_JV_API
230
234
235 // doc-key: MqMsgque,MqMsgque-Help,sm_
236
238 public native static String Help (String tool);
239
241 public native static String HelpMsgque ();
242
244 // MqMsgque_Help_JV_API
245
249
250 // doc-key: MqMsgque,MqMsgque-Init,sm_
251
253 public native static MkBufferListC InitGetArg0 ();
254
256 public native static MkBufferListC InitResetArg0 ();
257
259 public native static void InitSetArg0 (MkBufferListC bfl);
260
262 public static void InitSetArg0 (String... bfl) {
263 InitSetArg0 (new MkBufferListC(bfl));
264 }
265
267 public static void InitSetArg0 () {
268 InitSetArg0 ((MkBufferListC) null);
269 }
270
272 // MqMsgque_Init_JV_API
273
277
278 // doc-key: MqMsgque,MqMsgque-Setup,sm_
279
281 public native static void Cleanup ();
282
284 public static void Setup () {
285 SetupTmpl();
286 }
287
289 // MqMsgque_Setup_JV_API
290
291 // END-MqMsgque - created by 'jv_MqS.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
292
293 // [OVERLOAD THREAD]
294
295 private static native void MqSysServerThreadMain(long mainS);
296 private static ExecutorService threadPool = null;
297
298 private static Future<Object> MqSysServerThreadPipeCB(long mainS) {
299 if (threadPool == null) threadPool = Executors.newCachedThreadPool();
300 var ret = threadPool.submit(
301 () -> {
302 try {
303 MqSysServerThreadMain(mainS);
304 } catch (Throwable e) {
306 }
307 }
308 ,null);
309 return ret;
310 }
311
312 private static void MqSysServerThreadWorkCB(long mainS) {
313 if (threadPool == null) threadPool = Executors.newCachedThreadPool();
314 threadPool.execute(
315 new Runnable() {
316 public void run() {
317 try {
318 MqSysServerThreadMain(mainS);
319 } catch (Throwable e) {
321 }
322 }
323 }
324 );
325 }
326
327 private void WaitForThreadPipe (Future<Object> fut) {
328 try {
329 fut.get(200,TimeUnit.MILLISECONDS);
330 } catch (Exception e) {
331 // ignore
332 }
333 }
334 // [OVERLOAD THREAD]
335}
336
MqContextC - the class known as ctx or context is the application-handle of the application-server an...
MqFactoryC - the class known as fct or factory is used to provide an interface to create one or more ...
MqMsgque PACKAGE - the package is the toplevel structure of the jvmqmsgque …
Java: enum MqStatusIsEF → C-API
Java: enum MqIdentE → C-API
Definition MqIdentE.java:16
Java: enum MqSlaveE → C-API
Definition MqSlaveE.java:16
Java: enum MqStartE → C-API
Definition MqStartE.java:16
Java: enum MqWaitOnEventE → C-API
native void Println(String msg, String callfunc, int callline)
native MkErrorC Catch(Throwable exception, String callfunc)
static native MkErrorC DEFAULT()
native MqFactoryC Initial()
Java: MqFactoryC fct.Initial() → C-API set the initial-attribut to fct …
static native String DefaultIdent()
Java: [static] String MqFactoryC.DefaultIdent() → C-API return the factory-identifier of the def...
native MqFactoryC Default()
Java: MqFactoryC fct.Default() → C-API set the default-attribute to the factory …
static native MqFactoryC Add(Class<?> constructor, String ident)
Java: [constructor,static] MqFactoryC MqFactoryC.Add(Class<?> constructor, ?String ident = null?...
static native int StatusIsEF_ToInt(MqStatusIsEF value)
Java: [static] int StatusIsEF_ToInt(MqStatusIsEF value) → C-API return the MqStatusIsEF as integ...
static native String WaitOnEventE_ToString(MqWaitOnEventE value)
Java: [static] String WaitOnEventE_ToString(MqWaitOnEventE value) → C-API return the MqWaitOnEve...
static native int IdentE_ToInt(MqIdentE value)
Java: [static] int IdentE_ToInt(MqIdentE value) → C-API return the MqIdentE as integer …
static native MqSlaveE SlaveE_FromInt(int value)
Java: [static] MqSlaveE SlaveE_FromInt(int value) → C-API return the MqSlaveE from integer …
static native String StartE_ToString(MqStartE value)
Java: [static] String StartE_ToString(MqStartE value) → C-API return the MqStartE as string …
static native MqIdentE IdentE_FromInt(int value)
Java: [static] MqIdentE IdentE_FromInt(int value) → C-API return the MqIdentE from integer …
static native String IdentE_ToString(MqIdentE value)
Java: [static] String IdentE_ToString(MqIdentE value) → C-API return the MqIdentE as string …
static native int StartE_ToInt(MqStartE value)
Java: [static] int StartE_ToInt(MqStartE value) → C-API return the MqStartE as integer …
static native String SlaveE_ToString(MqSlaveE value)
Java: [static] String SlaveE_ToString(MqSlaveE value) → C-API return the MqSlaveE as string …
static native String StatusIsEF_ToString(MqStatusIsEF value)
Java: [static] String StatusIsEF_ToString(MqStatusIsEF value) → C-API return the MqStatusIsEF as...
static native int SlaveE_ToInt(MqSlaveE value)
Java: [static] int SlaveE_ToInt(MqSlaveE value) → C-API return the MqSlaveE as integer …
static native MqStartE StartE_FromInt(int value)
Java: [static] MqStartE StartE_FromInt(int value) → C-API return the MqStartE from integer …
static native MqWaitOnEventE WaitOnEventE_FromInt(int value)
Java: [static] MqWaitOnEventE WaitOnEventE_FromInt(int value) → C-API return the MqWaitOnEventE ...
static native MqStatusIsEF StatusIsEF_FromInt(int value)
Java: [static] MqStatusIsEF StatusIsEF_FromInt(int value) → C-API return the MqStatusIsEF from i...
static native int WaitOnEventE_ToInt(MqWaitOnEventE value)
Java: [static] int WaitOnEventE_ToInt(MqWaitOnEventE value) → C-API return the MqWaitOnEventE as...
static native String HelpMsgque()
Java: [static] String HelpMsgque() → C-API return a page with the usage of all jvmqmsgque specif...
static native String Help(String tool)
Java: [static] String Help(String tool) → C-API write jvmqmsgque specific user-help to stderr
static native MkBufferListC InitResetArg0()
Java: [static] MkBufferListC InitResetArg0() → C-API Reset the process-startup-prefix argument t...
static void InitSetArg0(String... bfl)
Java: [static] InitSetArg0(?MkBufferListC bfl = null?) → C-API set the process startup-prefix ar...
static native MkBufferListC InitGetArg0()
Java: [static] MkBufferListC InitGetArg0() → C-API get the process startup-prefix argument
static native void InitSetArg0(MkBufferListC bfl)
Java: [static] InitSetArg0(?MkBufferListC bfl = null?) → C-API set the process startup-prefix ar...
static void InitSetArg0()
Java: [static] InitSetArg0(?MkBufferListC bfl = null?) → C-API set the process startup-prefix ar...
static native void Cleanup()
Java: [static] Cleanup() → C-API cleanup jvmqmsgque internal memory …
static void Setup()
Java: [static] Setup() → C-API setup jvmqmsgque internal memory …