CUBRID Engine
latest
|
#include "config.h"
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <netdb.h>
#include <signal.h>
#include "environment_variable.h"
#include "system_parameter.h"
#include "error_code.h"
#include "error_manager.h"
#include "message_catalog.h"
#include "utility.h"
#include "databases_file.h"
#include "object_representation.h"
#include "jsp_comm.h"
#include "jsp_file.h"
#include "jsp_sr.h"
#include <string>
#include <algorithm>
#include <array>
Go to the source code of this file.
Macros | |
#define | JAVASP_PING_LEN PATH_MAX |
#define | JAVASP_PRINT_ERR_MSG(...) |
#define | NULL_DEVICE "/dev/null" |
Functions | |
static int | javasp_start_server (const JAVASP_SERVER_INFO jsp_info, const std::string &db_name, const std::string &path) |
static int | javasp_stop_server (const JAVASP_SERVER_INFO jsp_info, const std::string &db_name) |
static int | javasp_status_server (const JAVASP_SERVER_INFO jsp_info) |
static void | javasp_dump_status (FILE *fp, JAVASP_STATUS_INFO status_info) |
static int | javasp_ping_server (const int server_port, char *buf) |
static bool | javasp_is_running (const int server_port, const std::string &db_name) |
static bool | javasp_is_terminated_process (int pid) |
static void | javasp_terminate_process (int pid) |
static int | javasp_get_server_info (const std::string &db_name, JAVASP_SERVER_INFO &info) |
static int | javasp_check_argument (int argc, char *argv[], std::string &command, std::string &db_name) |
static int | javasp_check_database (const std::string &db_name, std::string &db_path) |
int | main (int argc, char *argv[]) |
#define JAVASP_PING_LEN PATH_MAX |
Definition at line 69 of file javasp.cpp.
Referenced by javasp_is_running(), and main().
#define JAVASP_PRINT_ERR_MSG | ( | ... | ) |
Definition at line 71 of file javasp.cpp.
Referenced by javasp_check_argument(), and main().
#define NULL_DEVICE "/dev/null" |
Definition at line 79 of file javasp.cpp.
Referenced by main().
|
static |
Definition at line 600 of file javasp.cpp.
References ER_GENERIC_ERROR, JAVASP_PRINT_ERR_MSG, and NO_ERROR.
Referenced by main().
|
static |
Definition at line 580 of file javasp.cpp.
References cfg_find_db(), cfg_free_directory(), ER_GENERIC_ERROR, NO_ERROR, NULL, and database_info::pathname.
Referenced by main().
|
static |
Definition at line 481 of file javasp.cpp.
References javasp_status_info::db_name, i, javasp_status_info::pid, javasp_status_info::port, and javasp_status_info::vm_args.
Referenced by javasp_status_server().
|
static |
Definition at line 566 of file javasp.cpp.
References ER_GENERIC_ERROR, javasp_open_info_dir(), javasp_read_info(), and NO_ERROR.
Referenced by main().
Definition at line 499 of file javasp.cpp.
References JAVASP_PING_LEN, javasp_ping_server(), and NO_ERROR.
Referenced by javasp_start_server().
|
static |
Definition at line 521 of file javasp.cpp.
Referenced by javasp_stop_server().
|
static |
Definition at line 435 of file javasp.cpp.
References ARG_FILE_LINE, er_errid(), ER_ERROR_SEVERITY, er_set(), ER_SP_NETWORK_ERROR, INVALID_SOCKET, jsp_connect_server(), jsp_disconnect_server(), jsp_readn(), jsp_writen(), ntohl(), NULL, OR_ALIGNED_BUF, OR_ALIGNED_BUF_START, OR_INT_SIZE, or_pack_int(), SP_CODE_UTIL_PING, and SP_CODE_UTIL_TERMINATE_THREAD.
Referenced by javasp_is_running(), and main().
|
static |
Definition at line 271 of file javasp.cpp.
References ARG_FILE_LINE, er_clear(), ER_ERROR_SEVERITY, ER_GENERIC_ERROR, er_set(), ER_SP_CANNOT_START_JVM, javasp_get_info_file(), javasp_is_running(), javasp_open_info_dir(), javasp_write_info(), jsp_server_port(), jsp_start_server(), NO_ERROR, javasp_server_info::port, prm_get_integer_value(), and PRM_ID_JAVA_STORED_PROCEDURE_PORT.
Referenced by main().
|
static |
Definition at line 359 of file javasp.cpp.
References ARG_FILE_LINE, javasp_status_info::db_name, er_errid(), ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), ER_SP_NETWORK_ERROR, free_and_init, i, INVALID_SOCKET, javasp_dump_status(), jsp_connect_server(), jsp_disconnect_server(), jsp_readn(), jsp_writen(), NO_ERROR, ntohl(), NULL, OR_ALIGNED_BUF, OR_ALIGNED_BUF_START, OR_INT_SIZE, or_pack_int(), or_unpack_int(), or_unpack_string_nocopy(), javasp_server_info::pid, javasp_status_info::pid, javasp_server_info::port, javasp_status_info::port, SP_CODE_UTIL_STATUS, SP_CODE_UTIL_TERMINATE_THREAD, and javasp_status_info::vm_args.
Referenced by main().
|
static |
Definition at line 326 of file javasp.cpp.
References ARG_FILE_LINE, er_errid(), ER_ERROR_SEVERITY, er_set(), ER_SP_NETWORK_ERROR, INVALID_SOCKET, javasp_is_terminated_process(), javasp_reset_info(), javasp_terminate_process(), jsp_connect_server(), jsp_disconnect_server(), jsp_writen(), NO_ERROR, NULL, javasp_server_info::pid, and javasp_server_info::port.
Referenced by main().
|
static |
Definition at line 549 of file javasp.cpp.
References FALSE.
Referenced by javasp_stop_server().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 102 of file javasp.cpp.
References ARG_FILE_LINE, assert, db_name, ER_ALL_FINAL, ER_ERROR_SEVERITY, er_final(), ER_GENERIC_ERROR, er_has_error(), er_init(), er_msg(), ER_NEVER_EXIT, er_set(), ER_SP_CANNOT_START_JVM, javasp_check_argument(), javasp_check_database(), javasp_get_info_file(), javasp_get_server_info(), JAVASP_PING_LEN, javasp_ping_server(), JAVASP_PRINT_ERR_MSG, javasp_start_server(), javasp_status_server(), javasp_stop_server(), NO_ERROR, NULL, NULL_DEVICE, os_set_signal_handler(), javasp_server_info::port, prm_get_bool_value(), prm_get_name(), PRM_ID_JAVA_STORED_PROCEDURE, SLEEP_MILISEC, SYSPRM_IGNORE_INTL_PARAMS, and sysprm_load_and_init().