MqContextC - create and manage a service … More...
Classes | |
interface | jvmqmsgque.MqServiceIF |
used for callback function pointer management → C-API: MqCallbackS More... | |
Functions | |
native void | jvmqmsgque.MqContextC.ServiceCreate (String token, MqServiceIF callback) |
Java: → C-API create a link between a service-token and a service-callback … | |
native void | jvmqmsgque.MqContextC.ServiceDelete (String token) |
Java: → C-API delete a service. … | |
native boolean | jvmqmsgque.MqContextC.ServiceIsTransaction () |
Java: → C-API check if the ongoing-service-call belongs to a transaction … | |
native void | jvmqmsgque.MqContextC.ServiceProxy (String token, int id) |
Java: → C-API create a service to link a master-context with a slave-context. … | |
native void | jvmqmsgque.MqContextC.ServiceProxyCtx (String token, MqContextC target) |
Java: → C-API same as MqServiceProxy but use an MqContextC as input. | |
native boolean | jvmqmsgque.MqContextC.ServiceProxyCtxExists (String token, MqContextC target) |
Java: → C-API check if service who belongs to token is a proxy-service | |
native void | jvmqmsgque.MqContextC.ServiceProxyRoundRobin (String token, String ident) |
Java: → C-API create a proxy-service using Round-Robin as load-balancer … | |
void | jvmqmsgque.MqContextC.ServiceProxy (String token) |
Java: → C-API create a service to link a master-context with a slave-context. … | |
native void | jvmqmsgque.MqContextC.ServiceStorage (String token) |
Java: → C-API setup a service listen on a MqContextC_ServiceApi_Identifer and save all read-data-package into the STORAGE … | |
native boolean | jvmqmsgque.MqContextC.ServiceTokenCheck (String token) |
Java: → C-API in an ongoing-service-call check if the current MqContextC_ServiceApi_Identifer is token … | |
native boolean | jvmqmsgque.MqContextC.ServiceTokenExists (String token) |
Java: → C-API check if the MqContextC_ServiceApi_Identifer token is defined as ctx service … | |
native String | jvmqmsgque.MqContextC.ServiceTokenGet () |
Java: → C-API in an ongoing-service-call get the current MqContextC_ServiceApi_Identifer … | |
JNIEXPORT void JNICALL | Java_jvmqmsgque_MqContextC_ServiceCreate (JNIEnv *env, jobject self, jstring token, jobject callback) |
Java: → C-API create a link between a service-token and a service-callback … | |
JNIEXPORT void JNICALL | Java_jvmqmsgque_MqContextC_ServiceDelete (JNIEnv *env, jobject self, jstring token) |
Java: → C-API delete a service. … | |
JNIEXPORT jboolean JNICALL | Java_jvmqmsgque_MqContextC_ServiceIsTransaction (JNIEnv *env, jobject self) |
Java: → C-API check if the ongoing-service-call belongs to a transaction … | |
JNIEXPORT void JNICALL | Java_jvmqmsgque_MqContextC_ServiceProxy (JNIEnv *env, jobject self, jstring token, jint id) |
Java: → C-API create a service to link a master-context with a slave-context. … | |
JNIEXPORT void JNICALL | Java_jvmqmsgque_MqContextC_ServiceProxyCtx (JNIEnv *env, jobject self, jstring token, jobject target) |
Java: → C-API same as MqServiceProxy but use an MqContextC as input. | |
JNIEXPORT jboolean JNICALL | Java_jvmqmsgque_MqContextC_ServiceProxyCtxExists (JNIEnv *env, jobject self, jstring token, jobject target) |
Java: → C-API check if service who belongs to token is a proxy-service | |
JNIEXPORT void JNICALL | Java_jvmqmsgque_MqContextC_ServiceProxyRoundRobin (JNIEnv *env, jobject self, jstring token, jstring ident) |
Java: → C-API create a proxy-service using Round-Robin as load-balancer … | |
JNIEXPORT void JNICALL | Java_jvmqmsgque_MqContextC_ServiceStorage (JNIEnv *env, jobject self, jstring token) |
Java: → C-API setup a service listen on a MqContextC_ServiceApi_Identifer and save all read-data-package into the STORAGE … | |
JNIEXPORT jboolean JNICALL | Java_jvmqmsgque_MqContextC_ServiceTokenCheck (JNIEnv *env, jobject self, jstring token) |
Java: → C-API in an ongoing-service-call check if the current MqContextC_ServiceApi_Identifer is token … | |
JNIEXPORT jboolean JNICALL | Java_jvmqmsgque_MqContextC_ServiceTokenExists (JNIEnv *env, jobject self, jstring token) |
Java: → C-API check if the MqContextC_ServiceApi_Identifer token is defined as ctx service … | |
JNIEXPORT jstring JNICALL | Java_jvmqmsgque_MqContextC_ServiceTokenGet (JNIEnv *env, jobject self) |
Java: → C-API in an ongoing-service-call get the current MqContextC_ServiceApi_Identifer … | |
MqContextC - create and manage a service …
To provide a service is the main purpose of a server and the main-purpose of a client/server connection is to call a service and to process the result.
A service can be defined on the server or on the client. On the server a service can be initial setup with MqServerSetupIF method and finally cleanup with MqServerCleanupIF.
A service is created with the MqServiceCreate and deleted with the MqServiceDelete.
A service can be created and deleted during the entire life-cycle of the server or the client. If the server/client-context is deleted all services of the are deleted also.
A MqServiceDelete is not required.
Creating or deleting a service is like granting or revoking the right to access a single feature.
eventloop
callback
Example from MyServer.java
→ define the service SRV1 on the server-link-setup
package example; import jvmkkernel.*; import jvmqmsgque.*; // package-item final class MyServer extends MqContextC implements MqServerSetupIF { // Factory Constructor public MyServer(MqContextC tmpl) { super(tmpl); } // service to serve all incoming requests for token "HLWO" class MyFirstCallback implements MqServiceIF { public void Callback(MqContextC ctx) { SendSTART(); SendSTR(ReadSTR() + " World"); SendRETURN(); } } // define a service as link between the token "HLWO" and the class "MyFirstService" public void ServerSetup() { ServiceCreate("HLWO", new MyFirstCallback()); } // ------------------------------------------------------------- // package-main public static void main(String[] argv) { // create the "MyServer" factory… and return the initial (top) object MqContextC srv = MqFactoryC.Add(MyServer.class).New(); try { srv.LinkCreate(argv); srv.ProcessEvent(MqWaitOnEventE.FOREVER); } catch (Throwable e) { srv.ErrorCatch(e); } srv.Exit(); } }
To provide a service is the main purpose of a server and the main-purpose of a client/server connection is to call a service and to process the result.
A service can be defined on the server or on the client. On the server a service can be initial setup with MqServerSetupIF method and finally cleanup with MqServerCleanupIF.
A service is created with the MqServiceCreate and deleted with the MqServiceDelete.
A service can be created and deleted during the entire life-cycle of the server or the client. If the server/client-context is deleted all services of the are deleted also.
A MqServiceDelete is not required.
Creating or deleting a service is like granting or revoking the right to access a single feature.
eventloop
callback
Example from MyServer.java
→ define the service SRV1 on the server-link-setup
package example; import jvmkkernel.*; import jvmqmsgque.*; // package-item final class MyServer extends MqContextC implements MqServerSetupIF { // Factory Constructor public MyServer(MqContextC tmpl) { super(tmpl); } // service to serve all incoming requests for token "HLWO" class MyFirstCallback implements MqServiceIF { public void Callback(MqContextC ctx) { SendSTART(); SendSTR(ReadSTR() + " World"); SendRETURN(); } } // define a service as link between the token "HLWO" and the class "MyFirstService" public void ServerSetup() { ServiceCreate("HLWO", new MyFirstCallback()); } // ------------------------------------------------------------- // package-main public static void main(String[] argv) { // create the "MyServer" factory… and return the initial (top) object MqContextC srv = MqFactoryC.Add(MyServer.class).New(); try { srv.LinkCreate(argv); srv.ProcessEvent(MqWaitOnEventE.FOREVER); } catch (Throwable e) { srv.ErrorCatch(e); } srv.Exit(); } }
JNIEXPORT void JNICALL Java_jvmqmsgque_MqContextC_ServiceCreate | ( | JNIEnv * | env, |
jobject | self, | ||
jstring | token, | ||
jobject | callback ) |
Java:
→ C-API ctx.ServiceCreate(String token, MqServiceIF callback)
create a link between a service-token and a service-callback …
Definition at line 2203 of file MqContextC_jv.c.
JNIEXPORT void JNICALL Java_jvmqmsgque_MqContextC_ServiceDelete | ( | JNIEnv * | env, |
jobject | self, | ||
jstring | token ) |
Java:
→ C-API ctx.ServiceDelete(String token)
delete a service. …
Definition at line 2219 of file MqContextC_jv.c.
JNIEXPORT jboolean JNICALL Java_jvmqmsgque_MqContextC_ServiceIsTransaction | ( | JNIEnv * | env, |
jobject | self ) |
Java:
→ C-API boolean ctx.ServiceIsTransaction()
check if the ongoing-service-call belongs to a transaction …
Definition at line 2233 of file MqContextC_jv.c.
JNIEXPORT void JNICALL Java_jvmqmsgque_MqContextC_ServiceProxy | ( | JNIEnv * | env, |
jobject | self, | ||
jstring | token, | ||
jint | id ) |
Java:
→ C-API ctx.ServiceProxy(String token, ?int id = MqSlaveE.OTHER.get()?)
create a service to link a master-context with a slave-context. …
Definition at line 2245 of file MqContextC_jv.c.
JNIEXPORT void JNICALL Java_jvmqmsgque_MqContextC_ServiceProxyCtx | ( | JNIEnv * | env, |
jobject | self, | ||
jstring | token, | ||
jobject | target ) |
Java:
→ C-API ctx.ServiceProxyCtx(String token, MqContextC target)
same as MqServiceProxy but use an MqContextC as input.
Definition at line 2259 of file MqContextC_jv.c.
JNIEXPORT jboolean JNICALL Java_jvmqmsgque_MqContextC_ServiceProxyCtxExists | ( | JNIEnv * | env, |
jobject | self, | ||
jstring | token, | ||
jobject | target ) |
Java:
→ C-API boolean ctx.ServiceProxyCtxExists(String token, MqContextC target)
check if service who belongs to token is a proxy-service
Definition at line 2275 of file MqContextC_jv.c.
JNIEXPORT void JNICALL Java_jvmqmsgque_MqContextC_ServiceProxyRoundRobin | ( | JNIEnv * | env, |
jobject | self, | ||
jstring | token, | ||
jstring | ident ) |
Java:
→ C-API ctx.ServiceProxyRoundRobin(String token, String ident)
create a proxy-service using Round-Robin as load-balancer …
Definition at line 2292 of file MqContextC_jv.c.
JNIEXPORT void JNICALL Java_jvmqmsgque_MqContextC_ServiceStorage | ( | JNIEnv * | env, |
jobject | self, | ||
jstring | token ) |
Java:
→ C-API ctx.ServiceStorage(String token)
setup a service listen on a MqContextC_ServiceApi_Identifer and save all read-data-package into the STORAGE …
Definition at line 2309 of file MqContextC_jv.c.
JNIEXPORT jboolean JNICALL Java_jvmqmsgque_MqContextC_ServiceTokenCheck | ( | JNIEnv * | env, |
jobject | self, | ||
jstring | token ) |
Java:
→ C-API boolean ctx.ServiceTokenCheck(String token)
in an ongoing-service-call check if the current MqContextC_ServiceApi_Identifer is token …
Definition at line 2323 of file MqContextC_jv.c.
JNIEXPORT jboolean JNICALL Java_jvmqmsgque_MqContextC_ServiceTokenExists | ( | JNIEnv * | env, |
jobject | self, | ||
jstring | token ) |
Java:
→ C-API boolean ctx.ServiceTokenExists(String token)
check if the MqContextC_ServiceApi_Identifer token is defined as ctx service …
Definition at line 2338 of file MqContextC_jv.c.
JNIEXPORT jstring JNICALL Java_jvmqmsgque_MqContextC_ServiceTokenGet | ( | JNIEnv * | env, |
jobject | self ) |
Java:
→ C-API String ctx.ServiceTokenGet()
in an ongoing-service-call get the current MqContextC_ServiceApi_Identifer …
Definition at line 2353 of file MqContextC_jv.c.
native void jvmqmsgque.MqContextC.ServiceCreate | ( | String | token, |
MqServiceIF | callback ) |
Java:
→ C-API ctx.ServiceCreate(String token, MqServiceIF callback)
create a link between a service-token and a service-callback …
native void jvmqmsgque.MqContextC.ServiceDelete | ( | String | token | ) |
Java:
→ C-API ctx.ServiceDelete(String token)
delete a service. …
native boolean jvmqmsgque.MqContextC.ServiceIsTransaction | ( | ) |
Java:
→ C-API boolean ctx.ServiceIsTransaction()
check if the ongoing-service-call belongs to a transaction …
void jvmqmsgque.MqContextC.ServiceProxy | ( | String | token | ) |
Java:
→ C-API ctx.ServiceProxy(String token, ?int id = MqSlaveE.OTHER.get()?)
create a service to link a master-context with a slave-context. …
Definition at line 1007 of file MqContextC.java.
native void jvmqmsgque.MqContextC.ServiceProxy | ( | String | token, |
int | id ) |
Java:
→ C-API ctx.ServiceProxy(String token, ?int id = MqSlaveE.OTHER.get()?)
create a service to link a master-context with a slave-context. …
native void jvmqmsgque.MqContextC.ServiceProxyCtx | ( | String | token, |
MqContextC | target ) |
Java:
→ C-API ctx.ServiceProxyCtx(String token, MqContextC target)
same as MqServiceProxy but use an MqContextC as input.
native boolean jvmqmsgque.MqContextC.ServiceProxyCtxExists | ( | String | token, |
MqContextC | target ) |
Java:
→ C-API boolean ctx.ServiceProxyCtxExists(String token, MqContextC target)
check if service who belongs to token is a proxy-service
native void jvmqmsgque.MqContextC.ServiceProxyRoundRobin | ( | String | token, |
String | ident ) |
Java:
→ C-API ctx.ServiceProxyRoundRobin(String token, String ident)
create a proxy-service using Round-Robin as load-balancer …
native void jvmqmsgque.MqContextC.ServiceStorage | ( | String | token | ) |
Java:
→ C-API ctx.ServiceStorage(String token)
setup a service listen on a MqContextC_ServiceApi_Identifer and save all read-data-package into the STORAGE …
native boolean jvmqmsgque.MqContextC.ServiceTokenCheck | ( | String | token | ) |
Java:
→ C-API boolean ctx.ServiceTokenCheck(String token)
in an ongoing-service-call check if the current MqContextC_ServiceApi_Identifer is token …
native boolean jvmqmsgque.MqContextC.ServiceTokenExists | ( | String | token | ) |
Java:
→ C-API boolean ctx.ServiceTokenExists(String token)
check if the MqContextC_ServiceApi_Identifer token is defined as ctx service …
native String jvmqmsgque.MqContextC.ServiceTokenGet | ( | ) |
Java:
→ C-API String ctx.ServiceTokenGet()
in an ongoing-service-call get the current MqContextC_ServiceApi_Identifer …