skip to main content
Embedding OpenAccess SDK Server in Java applications : Java API : oasload.OaServerControl
 

oasload.OaServerControl

This function should be called from a thread in the application to start the specified OpenAccess SDK service that has already been configured and to stop a service. The required parameters are passed in as strings in an array of strings. When called to start a service, this method will not return control back to the calling thread until the service is stopped from a different thread. Once the service is started it behaves just as if it was started as a standalone server.
int OaServerControl(int argc, String argv[], int command)
Table 295. Parameters for OaServerControl
Parameter
Type
Description
IN
argc
int
Number or arguments passed into the argv string array.
argv[]
char*
Array of strings that represent the arguments for the server_start command.
argv[0] - a string indicating the name of the application
argv[1] - -datamodel - indicates that the next argument specifies the path of the configuration file.
argv[2] -<datamodel>
where <datamodel> is replaced with the file name, including path, of the OpenAccess SDK Server configuration file oadm.ini.
argv[3] - -servicename - indicates that the next argument specifies the OpenAccess SDK service name.
argv[4] -<servicename>
where <servicename> is replaced with the OpenAccess SDK service name that is configured in the configuration file specified by the -datamodel argument. For example, OpenAccessSDK810_C.
Command
int
Command:
*OASERVER_START (2) - start the service using the arguments passed in the argv string array.
*OASERVER_STOP (3) - stop the service.
*OASERVER_START_WITH_JOBJECT (4) - start the service in Extended Mode . This command is valid only for Java Service.
RETURN
int
*0 - For OASERVER_START, service has been started. For OASERVER_STOP, stop command has been placed in the service's queue.
*All other return values for OASERVER_START and OASERVER_START_WITH_JOBJECT - see the following table.
Table 296. Error Codes
Error Code
Reason
0
Success
10
oasoa.dll is started without the required command arguments
11
The -servicename or -n option is missing servicename argument
12
The -connectmodel or -m option is missing an argument.
13
The -sessionid option is missing an argument.
14
The -connectinfo option is missing an argument.
15
The -datamodel or -d option is missing an argument.
16
The -msgfile or -g option is missing an argument.
17
The required servicename is missing.
18
Invalid value for connection model passed
21
Cannot open the message file
22
Cannot open the configuration file
23
Configuration file has incorrect version
24
Servicename name not found in configuration file
25
ServiceMessageFile attrbute not set in configuration file
30
Failed to Build MGSS mechanism map from DM and create MGSS factory
31
Failed to initialize the EventQueue Cache
32
Failed to create the Core Service component
33
Failed to create the Scheduler component
34
Failed to create the Event Processor component
35
Failed to initialize the Service component
91
Internal error, memory allocation failed.
95
Internal error, fatal server error detected.
For both Windows and Linux/UNIX, when OaServerControl returns with exit code 35, a related error message is written to a Service debug log file in the logging subdirectory.
For all other exit codes:
On Windows, a related error message is sent to the Windows Application log. Use the Event Viewer to read the Windows Application log.
On Linux/UNIX, a related error message is sent to syslog marked at as level 'err'(LOG_ERR) and facility 'user'(LOGUSER). Verify the contents of /etc/syslog.conf where messages marked as level 'err' and facility 'user' are written.
Some typical locations are shown in the following table.
Table 297. Syslog Location
Operating System
Location of the syslog
Solaris
/var/adm/messages
Linux
/var/log/messages
HP/UX
/var/adm/syslog/syslog.log
AIX
as set in /etc/syslog.conf