MqContextC - create and manage a service … More...
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.cs
→ define the service HLWO on the server-link-setup
using System; using csmqmsgque; namespace example { // package-item sealed class MyServer : MqContextC, MqServerSetupIF { // factory constructor public MyServer(MqContextC tmpl=null) : base(tmpl) { } // service to serve all incoming requests for token "HLWO" public void MyFirstService () { SendSTART(); SendSTR("Hello World"); SendRETURN(); } // define a service as link between the token "HLWO" and the callback "MyFirstService" void MqServerSetupIF.ServerSetup() { ServiceCreate("HLWO", MyFirstService); } // package-main static void Main(string[] argv) { // create the "MyServer" factory… and the object var srv = MqFactoryCT<MyServer>.Add().New(); try { srv.LinkCreate(argv); srv.ProcessEvent(MqWaitOnEventE.FOREVER); } catch (Exception ex) { srv.ErrorCatch (ex); } srv.Exit(); } } }
|
inline |
C#:
→ C-API ctx.ServiceCreate(string token, MqServiceICB|MqServiceCCB|MqServiceIF callback)
create a link between a service-token and a service-callback …
Definition at line 1601 of file MqContextC.cs.
|
inline |
C#:
→ C-API ctx.ServiceCreate(string token, MqServiceICB|MqServiceCCB|MqServiceIF callback)
create a link between a service-token and a service-callback …
Definition at line 1610 of file MqContextC.cs.
|
inline |
C#:
→ C-API ctx.ServiceCreate(string token, MqServiceICB|MqServiceCCB|MqServiceIF callback)
create a link between a service-token and a service-callback …
Definition at line 1619 of file MqContextC.cs.
|
inline |
C#:
→ C-API ctx.ServiceDelete(string token)
delete a service. …
Definition at line 1628 of file MqContextC.cs.
|
inline |
C#:
→ C-API bool ctx.ServiceIsTransaction()
check if the ongoing-service-call belongs to a transaction …
Definition at line 1636 of file MqContextC.cs.
|
inline |
C#:
→ C-API ctx.ServiceProxy(string token, int id = (int)MqSlaveE.OTHER)
create a service to link a master-context with a slave-context. …
Definition at line 1642 of file MqContextC.cs.
|
inline |
C#:
→ C-API ctx.ServiceProxyCtx(string token, MqContextC target)
same as MqServiceProxy but use an MqContextC as input.
Definition at line 1650 of file MqContextC.cs.
|
inline |
C#:
→ C-API bool ctx.ServiceProxyCtxExists(string token, MqContextC target)
check if service who belongs to token is a proxy-service
Definition at line 1659 of file MqContextC.cs.
|
inline |
C#:
→ C-API ctx.ServiceProxyRoundRobin(string token, string ident)
create a proxy-service using Round-Robin as load-balancer …
Definition at line 1668 of file MqContextC.cs.
|
inline |
C#:
→ 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 1678 of file MqContextC.cs.
|
inline |
C#:
→ C-API bool ctx.ServiceTokenCheck(string token)
in an ongoing-service-call check if the current MqContextC_ServiceApi_Identifer is token …
Definition at line 1686 of file MqContextC.cs.
|
inline |
C#:
→ C-API bool ctx.ServiceTokenExists(string token)
check if the MqContextC_ServiceApi_Identifer token is defined as ctx service …
Definition at line 1694 of file MqContextC.cs.
|
inline |
C#:
→ C-API string ctx.ServiceTokenGet()
in an ongoing-service-call get the current MqContextC_ServiceApi_Identifer …
Definition at line 1702 of file MqContextC.cs.