JBoss Native SVN: r1440 - in sandbox/httpd/src/native: mod_manager and 1 other directories.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-03-16 17:00:11 -0400 (Sun, 16 Mar 2008)
New Revision: 1440
Modified:
sandbox/httpd/src/native/common/node.c
sandbox/httpd/src/native/common/node.h
sandbox/httpd/src/native/mod_manager/mod_manager.c
sandbox/httpd/src/native/mod_proxy_cluster/mod_proxy_cluster.c
Log:
Add logic to create the node.
Modified: sandbox/httpd/src/native/common/node.c
===================================================================
--- sandbox/httpd/src/native/common/node.c 2008-03-16 19:21:42 UTC (rev 1439)
+++ sandbox/httpd/src/native/common/node.c 2008-03-16 21:00:11 UTC (rev 1440)
@@ -64,9 +64,9 @@
}
storename = apr_pstrcat(p, string, NODEEXE, NULL);
if (type)
- rv = ptr->storage->ap_slotmem_create(&ptr->slotmem, storename, sizeof(nodeinfo_t) + SIZEOFSCORE, *num, p);
+ rv = ptr->storage->ap_slotmem_create(&ptr->slotmem, storename, sizeof(nodeinfo_t), *num, p);
else {
- apr_size_t size = sizeof(nodeinfo_t) + SIZEOFSCORE;
+ apr_size_t size = sizeof(nodeinfo_t);
rv = ptr->storage->ap_slotmem_attach(&ptr->slotmem, storename, &size, num, p);
}
if (rv != APR_SUCCESS) {
@@ -87,11 +87,9 @@
{
nodeinfo_t *in = (nodeinfo_t *)*data;
nodeinfo_t *ou = (nodeinfo_t *)mem;
- if (strcmp(in->mess.hostname, ou->mess.hostname) == 0) {
- char *ptr = (char *) ou + sizeof(nodeinfo_t);
+ if (strcmp(in->mess.JVMRoute, ou->mess.JVMRoute) == 0) {
memcpy(ou, in, sizeof(nodeinfo_t));
ou->mess.id = id;
- ou->status = ptr;
ou->updatetime = apr_time_sec(apr_time_now());
*data = ou;
return APR_SUCCESS;
@@ -118,6 +116,10 @@
memcpy(ou, node, sizeof(nodeinfo_t));
ou->mess.id = ident;
ou->updatetime = apr_time_sec(apr_time_now());
+
+ /* set of offset to the proxy_worker_stat */
+ ou->status = sizeof(nodemess_t) + sizeof(unsigned long) + sizeof(ou->balancer) + sizeof(int);
+
return APR_SUCCESS;
}
@@ -130,7 +132,7 @@
static apr_status_t loc_read_node(void* mem, void **data, int id, apr_pool_t *pool) {
nodeinfo_t *in = (nodeinfo_t *)*data;
nodeinfo_t *ou = (nodeinfo_t *)mem;
- if (strcmp(in->mess.hostname, ou->mess.hostname) == 0) {
+ if (strcmp(in->mess.JVMRoute, ou->mess.JVMRoute) == 0) {
*data = ou;
return APR_SUCCESS;
}
Modified: sandbox/httpd/src/native/common/node.h
===================================================================
--- sandbox/httpd/src/native/common/node.h 2008-03-16 19:21:42 UTC (rev 1439)
+++ sandbox/httpd/src/native/common/node.h 2008-03-16 21:00:11 UTC (rev 1440)
@@ -48,36 +48,38 @@
unsigned short __pad;
};
-/* status of the node received from jboss nodes. */
+/* configuration of the node received from jboss cluster. */
struct nodemess {
- /* part receive from the node */
- char hostname[40]; /* 000: something like ajp://localhost:8009 */
- char strtime[8]; /* 040: date when send by the node */
- struct contact contact; /* 048: IP/port (node view) */
- char route[8]; /* 068: JVM route */
+ char JVMRoute[20];
+ char Domain[20];
+ char Host[64];
+ char Port[7];
+ char Type[6];
/* XXX: add the load balancing information */
- char schni[44]; /* 076: hugly filler */
+ char schni[44]; /* hugly filler */
+ char strtime[8]; /* date when send by the node */
+
/* part updated in httpd */
- int id; /* 120: id in table and worker it */
- /* 124: end */
+ int id; /* id in table and worker it */
};
typedef struct nodemess nodemess_t;
+#define SIZEOFSCORE 200 /* size of the proxy_worker_stat structure */
+
/* status of the node as read/store in httpd. */
struct nodeinfo {
- /* received from jboss/tomcat */
+ /* config from jboss/tomcat */
nodemess_t mess;
/* filled by httpd */
- unsigned long updatetime; /* 124: time of last received message */
- char balancer[40]; /* 128: name of the balancer */
- void *status; /* 168: to the proxy_worker_stat structure */
- /* 172: end */
+ unsigned long updatetime; /* time of last received message */
+ char balancer[40]; /* name of the balancer */
+ int status; /* offset to the proxy_worker_stat structure */
+ char stat[SIZEOFSCORE]; /* to store the status */
};
typedef struct nodeinfo nodeinfo_t;
-#define SIZEOFSCORE 100 /* size of the proxy_worker_stat structure */
/**
* Insert(alloc) and update a node record in the shared table
Modified: sandbox/httpd/src/native/mod_manager/mod_manager.c
===================================================================
--- sandbox/httpd/src/native/mod_manager/mod_manager.c 2008-03-16 19:21:42 UTC (rev 1439)
+++ sandbox/httpd/src/native/mod_manager/mod_manager.c 2008-03-16 21:00:11 UTC (rev 1440)
@@ -13,6 +13,7 @@
*/
#include "apr_strings.h"
+#include "apr_lib.h"
#define CORE_PRIVATE
@@ -49,20 +50,13 @@
int maxcontext;
/* max munber of node supported */
int maxnode;
- /* enablePort */
- int enable;
+ /* Balancer name */
+ char *balancername;
/* store the balancer names */
struct baldata *baldata;
} mod_manager_config;
-/* message from the node */
-typedef struct node_mess
-{
- int type;
- nodeinfo_t node;
-} node_mess;
-
/*
* routines for the node_storage_method
*/
@@ -142,6 +136,145 @@
*/
return OK;
}
+static char **process_buff(request_rec *r, char *buff)
+{
+ int i = 0;
+ char *s = buff;
+ char **ptr = NULL;
+ for (; *s != '\0'; s++) {
+ if (*s == '&') {
+ i++;
+ }
+ }
+ ptr = apr_palloc(r->pool, sizeof(char *) * ((2 *i) +1));
+ if (ptr == NULL)
+ return NULL;
+
+ s = buff;
+ ptr[0] = s;
+ ptr[2*i] = NULL;
+ i = 1;
+ for (; *s != '\0'; s++) {
+ if (*s == '&' || *s == '=') {
+ *s = '\0';
+ ptr[i] = s + 1;
+ i++;
+ }
+ }
+ return ptr;
+}
+
+/*
+ * Process a CONFIG message
+ * JvmRoute?: <JvmRoute>
+ * Domain: <Domain>
+ * <Host: <Node IP>
+ * Port: <Connector Port>
+ * Type: <Type of the connector>
+ * (<node conf>
+ * Virtual hosts in JBossAS
+ * Alias: <vhost list>
+ * Context corresponding to the applications.
+ * Context: <context list>
+ */
+static int process_config(request_rec *r, char *buff)
+{
+ /* Process the node description */
+ nodeinfo_t nodeinfo;
+ char *JVMRoute;
+ char *Domain;
+ char *Host;
+ char *Port;
+ char *Type;
+ /* XXX node conf */
+ char **ptr = process_buff(r, buff);
+ if (ptr == NULL)
+ return 500;
+ int i = 0;
+ while (ptr[i]) {
+ if (strcasecmp(ptr[i], "JVMRoute") == 0) {
+ if (strlen(ptr[i+1])>=sizeof(nodeinfo.mess.JVMRoute))
+ return 500;
+ strcpy(nodeinfo.mess.JVMRoute, ptr[i+1]);
+ }
+ if (strcasecmp(ptr[i], "Domain") == 0) {
+ if (strlen(ptr[i+1])>=sizeof(nodeinfo.mess.Domain))
+ return 500;
+ strcpy(nodeinfo.mess.Domain, ptr[i+1]);
+ }
+ if (strcasecmp(ptr[i], "Host") == 0) {
+ if (strlen(ptr[i+1])>=sizeof(nodeinfo.mess.Host))
+ return 500;
+ strcpy(nodeinfo.mess.Host, ptr[i+1]);
+ }
+ if (strcasecmp(ptr[i], "Port") == 0) {
+ if (strlen(ptr[i+1])>=sizeof(nodeinfo.mess.Port))
+ return 500;
+ strcpy(nodeinfo.mess.Port, ptr[i+1]);
+ }
+ if (strcasecmp(ptr[i], "Type") == 0) {
+ if (strlen(ptr[i+1])>=sizeof(nodeinfo.mess.Type))
+ return 500;
+ strcpy(nodeinfo.mess.Type, ptr[i+1]);
+ }
+ ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL, "manager_handler %s %s", ptr[i], ptr[i+1]);
+ i++;
+ i++;
+ }
+ /* Read the balancer name */
+ mod_manager_config *mconf = ap_get_module_config(r->server->module_config, &manager_module);
+ strcpy(nodeinfo.balancer,mconf->balancername);
+
+ /* Insert or update node description */
+ if (insert_update_node(nodestatsmem, &nodeinfo) != APR_SUCCESS)
+ return 500;
+ return OK;
+}
+/* Process an enable application message */
+static int process_enable(request_rec *r, char *buff)
+{
+ return OK;
+}
+static int process_disable(request_rec *r, char *buff)
+{
+ return OK;
+}
+static int process_stop(request_rec *r, char *buff)
+{
+ return OK;
+}
+static int process_remove(request_rec *r, char *buff)
+{
+ return OK;
+}
+static int process_status(request_rec *r, char *buff)
+{
+ return OK;
+}
+
+/*
+ * Decodes a '%' escaped string, and returns the number of characters
+ * (From mod_proxy_ftp.c).
+ */
+static int decodeenc(char *x)
+{
+ int i, j, ch;
+
+ if (x[0] == '\0')
+ return 0; /* special case for no characters */
+ for (i = 0, j = 0; x[i] != '\0'; i++, j++) {
+ /* decode it if not already done */
+ ch = x[i];
+ if (ch == '%' && apr_isxdigit(x[i + 1]) && apr_isxdigit(x[i + 2])) {
+ ch = ap_proxy_hex2c(&x[i + 1]);
+ i += 2;
+ }
+ x[j] = ch;
+ }
+ x[j] = '\0';
+ return j;
+}
+
/* Process the requests from the ModClusterService */
static int manager_handler(request_rec *r)
{
@@ -155,6 +288,27 @@
apr_brigade_flatten(input_brigade, buff, &bufsiz);
buff[bufsiz] = '\0';
ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL, "%s %s manager_handler buff %s", r->method, r->uri, buff);
+ decodeenc(buff);
+ if (strcasecmp(r->method, "CONFIG") == 0)
+ return(process_config(r, buff));
+ /* Application handling */
+ else if (strcasecmp(r->method, "ENABLE-APP") == 0)
+ return(process_enable(r, buff));
+ else if (strcasecmp(r->method, "DISABLE-APP") == 0)
+ return(process_disable(r, buff));
+ else if (strcasecmp(r->method, "STOP-APP") == 0)
+ return(process_stop(r, buff));
+ else if (strcasecmp(r->method, "REMOVE-APP") == 0)
+ return(process_remove(r, buff));
+ /* Status handling */
+ else if (strcasecmp(r->method, "STATUS") == 0)
+ return(process_status(r, buff));
+ else {
+ /* The command is not supported */
+ r->status_line = apr_psprintf(r->pool, "%3.3u VERSION %d.%d.%d", 500, 0, 0, 0);
+ return 500;
+ }
+
return (OK);
}
@@ -179,6 +333,12 @@
mconf->basefilename = apr_pstrdup(cmd->pool, word);
return NULL;
}
+AP_DECLARE_NONSTD(const char *) cmd_manager_balancername(cmd_parms *cmd, void *mconfig, const char *word)
+{
+ mod_manager_config *mconf = ap_get_module_config(cmd->server->module_config, &manager_module);
+ mconf->balancername = apr_pstrdup(cmd->pool, word);
+ return NULL;
+}
static const command_rec manager_cmds[] =
{
AP_INIT_TAKE1(
@@ -202,6 +362,13 @@
OR_ALL,
"MemManagerFile - base name of the files used to create/attach to shared memory"
),
+ AP_INIT_TAKE1(
+ "ManagerBalancerName",
+ cmd_manager_balancername,
+ NULL,
+ OR_ALL,
+ "ManagerBalancerName - name of the balancer corresponding to the manager"
+ ),
{NULL}
};
@@ -230,7 +397,7 @@
mconf->basefilename = NULL;
mconf->maxcontext = DEFMAXCONTEXT;
mconf->maxnode = DEFMAXNODE;
- mconf->enable = 0;
+ mconf->balancername = NULL;
mconf->baldata = NULL;
return mconf;
}
@@ -255,7 +422,7 @@
mconf->basefilename = NULL;
mconf->maxcontext = DEFMAXCONTEXT;
mconf->maxnode = DEFMAXNODE;
- mconf->enable = 0;
+ mconf->balancername = NULL;
mconf->baldata = NULL;
if (mconf2->basefilename)
@@ -273,10 +440,10 @@
else if (mconf1->maxnode != DEFMAXNODE)
mconf->maxnode = mconf1->maxnode;
- if (mconf2->enable)
- mconf->enable = mconf2->enable;
- else if (mconf1->enable)
- mconf->enable = mconf1->enable;
+ if (mconf2->balancername)
+ mconf->balancername = mconf2->balancername;
+ else if (mconf1->balancername)
+ mconf->balancername = mconf1->balancername;
/* XXX: Shouldn't be the baldata chains duplicated */
if (mconf2->baldata)
Modified: sandbox/httpd/src/native/mod_proxy_cluster/mod_proxy_cluster.c
===================================================================
--- sandbox/httpd/src/native/mod_proxy_cluster/mod_proxy_cluster.c 2008-03-16 19:21:42 UTC (rev 1439)
+++ sandbox/httpd/src/native/mod_proxy_cluster/mod_proxy_cluster.c 2008-03-16 21:00:11 UTC (rev 1440)
@@ -51,29 +51,39 @@
request_rec *r, proxy_worker **worker,
nodeinfo_t *node)
{
- char *name;
- char *p;
- proxy_worker_stat *proxy_worker_stat;
+ char url[6+64+7+4]; /* Type :// Host : Port */
/* build the name (scheme and port) when needed */
- p = strchr(node->mess.hostname, ':');
- if (p == NULL || p[1] != '/' || p[2] != '/' || p[3] == '\0') {
- name = apr_pstrcat(conf->pool, "http://", node->mess.hostname, NULL);
- } else {
- name = apr_pstrdup(conf->pool, node->mess.hostname);
- }
+ strcpy(url, node->mess.Type);
+ strcat(url, "://");
+ strcat(url, node->mess.Host);
+ strcat(url, ":");
+ strcat(url, node->mess.Port);
- *worker = ap_proxy_get_worker(conf->pool, conf, name);
+ *worker = ap_proxy_get_worker(conf->pool, conf, url);
if (*worker == NULL) {
+ char *ptr;
+ proxy_worker *proxy_worker;
+
/* creates it */
- struct proxy_worker *proxy_worker;
- ap_proxy_add_worker(worker, conf->pool, conf, name);
+ const char *err = ap_proxy_add_worker(worker, conf->pool, conf, url);
+ if (err) {
+ ap_log_error(APLOG_MARK, APLOG_NOTICE|APLOG_NOERRNO, 0, r->server,
+ "Created: worker for %s failed: %s", url, err);
+ return;
+ }
proxy_worker = (struct proxy_worker *) *worker;
- proxy_worker->s = node->status;
+ /* Get the shared memory for this worker */
+ ptr = (char *) node;
+ ptr = ptr + node->status;
+ proxy_worker->s = (proxy_worker_stat *) ptr;
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
+ "Created: worker for %s", url);
+ proxy_worker->s->status = PROXY_WORKER_INITIALIZED;
+
ap_proxy_add_worker_to_balancer(conf->pool, balancer, *worker);
- proxy_worker->s->status = PROXY_WORKER_INITIALIZED;
- strncpy(proxy_worker->s->route, node->mess.route, PROXY_WORKER_MAX_ROUTE_SIZ);
+ strncpy(proxy_worker->s->route, node->mess.JVMRoute, PROXY_WORKER_MAX_ROUTE_SIZ);
proxy_worker->s->route[PROXY_WORKER_MAX_ROUTE_SIZ] = '\0';
/* XXX: We need that information from TC */
proxy_worker->s->redirect[0] = '\0';
16 years, 9 months
JBoss Native SVN: r1439 - trunk/build/unix.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2008-03-16 15:21:42 -0400 (Sun, 16 Mar 2008)
New Revision: 1439
Modified:
trunk/build/unix/buildbin.jboss-native.windows.sh
Log:
Use latest released AS
Modified: trunk/build/unix/buildbin.jboss-native.windows.sh
===================================================================
--- trunk/build/unix/buildbin.jboss-native.windows.sh 2008-03-16 19:19:58 UTC (rev 1438)
+++ trunk/build/unix/buildbin.jboss-native.windows.sh 2008-03-16 19:21:42 UTC (rev 1439)
@@ -79,7 +79,7 @@
)
(cd service/examples
- awk -f rewritesvc.awk service.bat ${output_loc}/bin/service.bat "5.0.0 Beta 3" 5 0 "Windows ${BUILD_CPU}"
+ awk -f rewritesvc.awk service.bat ${output_loc}/bin/service.bat "5.0.0 Beta 4" 5 0 "Windows ${BUILD_CPU}"
cp README-service.txt ${output_loc}/bin
)
16 years, 9 months
JBoss Native SVN: r1438 - in trunk/utils/windows/native/service: jbosssch and 1 other directories.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2008-03-16 15:19:58 -0400 (Sun, 16 Mar 2008)
New Revision: 1438
Modified:
trunk/utils/windows/native/service/examples/service.bat
trunk/utils/windows/native/service/jbosssch/sch.rc
trunk/utils/windows/native/service/jbosssvc/jboss.c
trunk/utils/windows/native/service/jbosssvc/jboss.rc
Log:
Update JBoss AS service runner
Modified: trunk/utils/windows/native/service/examples/service.bat
===================================================================
--- trunk/utils/windows/native/service/examples/service.bat 2008-03-14 16:01:08 UTC (rev 1437)
+++ trunk/utils/windows/native/service/examples/service.bat 2008-03-16 19:19:58 UTC (rev 1438)
@@ -24,12 +24,12 @@
REM Figure out the running mode
-@if "%1" == "install" goto cmdInstall
-@if "%1" == "uninstall" goto cmdUninstall
-@if "%1" == "start" goto cmdStart
-@if "%1" == "stop" goto cmdStop
-@if "%1" == "restart" goto cmdRestart
-@if "%1" == "signal" goto cmdSignal
+if /I "%1" == "install" goto cmdInstall
+if /I "%1" == "uninstall" goto cmdUninstall
+if /I "%1" == "start" goto cmdStart
+if /I "%1" == "stop" goto cmdStop
+if /I "%1" == "restart" goto cmdRestart
+if /I "%1" == "signal" goto cmdSignal
echo Usage: service install^|uninstall^|start^|stop^|restart^|signal
goto cmdEnd
@@ -42,39 +42,62 @@
REM ERR_RET_MODE 6
:errExplain
-@if errorlevel 1 echo Invalid command line parameters
-@if errorlevel 2 echo Failed installing %SVCDISP%
-@if errorlevel 4 echo Failed removing %SVCDISP%
-@if errorlevel 6 echo Unknown service mode for %SVCDISP%
+if errorlevel 1 echo Invalid command line parameters
+if errorlevel 2 echo Failed installing %SVCDISP%
+if errorlevel 4 echo Failed removing %SVCDISP%
+if errorlevel 6 echo Unknown service mode for %SVCDISP%
goto cmdEnd
:cmdInstall
jbosssvc.exe -iwdc %SVCNAME% "%DIRNAME%" "%SVCDISP%" "%SVCDESC%" service.bat
-@if not errorlevel 0 goto errExplain
+if not errorlevel 0 goto errExplain
echo Service %SVCDISP% installed
goto cmdEnd
:cmdUninstall
jbosssvc.exe -u %SVCNAME%
-@if not errorlevel 0 goto errExplain
+if not errorlevel 0 goto errExplain
echo Service %SVCDISP% removed
goto cmdEnd
:cmdStart
REM Executed on service start
-call run.bat >run.log
+del .r.lock 2>&1 | findstr /C:"being used" > nul
+if not errorlevel 1 (
+ echo Could not continue. Locking file already in use.
+ goto cmdEnd
+)
+echo Y > .r.lock
+echo Starting %SVCDISP% > run.log
+call run.bat < .r.lock >> run.log 2>&1
+echo Shutdown service >> run.log
+del .r.lock
goto cmdEnd
:cmdStop
REM Executed on service stop
-call shutdown -S >shutdown.log
+echo Y > .s.lock
+call shutdown -S < .s.lock > shutdown.log 2>&1
+del .s.lock
goto cmdEnd
:cmdRestart
REM Executed on service restart
REM Note. We can only stop and start
-call shutdown -S >>shutdown.log
-call run.bat >>run.log
+echo Y > .s.lock
+call shutdown -S < .s.lock >> shutdown.log 2>&1
+del .s.lock
+:waitRun
+REM Delete lock file
+del .r.lock > nul 2>&1
+REM Wait one second if lock file exist
+jbosssvc.exe -s 1
+if exist ".r.lock" goto waitRun
+echo Y > .r.lock
+echo Restarting %SVCDISP% >> run.log
+call run.bat < .r.lock >> run.log 2>&1
+echo Shutdown service >> run.log
+del .r.lock
goto cmdEnd
:cmdSignal
Modified: trunk/utils/windows/native/service/jbosssch/sch.rc
===================================================================
--- trunk/utils/windows/native/service/jbosssch/sch.rc 2008-03-14 16:01:08 UTC (rev 1437)
+++ trunk/utils/windows/native/service/jbosssch/sch.rc 2008-03-16 19:19:58 UTC (rev 1438)
@@ -38,8 +38,8 @@
#define STR_COMPANY "Red Hat�, Inc."
#define STR_TRADEMARK "� Red Hat Inc."
#define STR_PRODUCT "JBoss Service helper"
-#define STR_VERISON "1.2.2.0"
-#define CSV_VERISON 1,2,2,0
+#define STR_VERISON "1.2.3.0"
+#define CSV_VERISON 1,2,3,0
#define PRIVATE_BUILD 0
#define PRERELEASE_BUILD 0
Modified: trunk/utils/windows/native/service/jbosssvc/jboss.c
===================================================================
--- trunk/utils/windows/native/service/jbosssvc/jboss.c 2008-03-14 16:01:08 UTC (rev 1437)
+++ trunk/utils/windows/native/service/jbosssvc/jboss.c 2008-03-16 19:19:58 UTC (rev 1438)
@@ -127,6 +127,8 @@
static enum _service_mode_e _service_mode = mode_none;
static HANDLE _service_run_event = NULL;
+static HANDLE _service_run_hproc = NULL;
+static DWORD _service_run_pid = 0;
static BOOL IsWindowsNT()
{
@@ -265,11 +267,13 @@
" service.bat\n");
fprintf(stderr, " -u service\n");
fprintf(stderr, " -t service\n");
+ fprintf(stderr, " -s\n");
fprintf(stderr, "Options:\n");
fprintf(stderr, " -d Service display name\n");
fprintf(stderr, " -c Service description\n");
fprintf(stderr, " -w Service working path\n");
fprintf(stderr, " -l Turn info logging On\n");
+ fprintf(stderr, " -s Sleep 1 second and exit\n");
ExitProcess(ERR_RET_USAGE);
}
@@ -649,11 +653,42 @@
return bResult;
}
+static BOOL TerminateProcessGroup(HANDLE hProcess, DWORD dwProcessId, UINT retCode)
+{
+ HANDLE hProcessSnap;
+ PROCESSENTRY32 pe32;
+ hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
+ if (hProcessSnap == INVALID_HANDLE_VALUE) {
+ return FALSE;
+ }
+
+ pe32.dwSize = sizeof(PROCESSENTRY32);
+
+ if (!Process32First(hProcessSnap, &pe32)) {
+ CloseHandle(hProcessSnap);
+ return FALSE;
+ }
+
+ do {
+ if (pe32.th32ParentProcessID == dwProcessId) {
+ HANDLE hP = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pe32.th32ProcessID);
+ if (hP) {
+ TerminateProcess(hP, retCode);
+ CloseHandle(hP);
+ }
+ }
+ } while (Process32Next(hProcessSnap, &pe32));
+
+ CloseHandle(hProcessSnap);
+ return TerminateProcess(hProcess, retCode);
+
+}
+
/* Executed when the service receives stop event */
static DWORD ServiceStop()
{
- DWORD rv;
+ int i = 0;
PROCESS_INFORMATION prInfo;
char cmd[MAX_CMDLINE + 1];
@@ -663,24 +698,26 @@
}
BuildCommandLine(cmd, "stop");
AddToMessageLog(FALSE, "Stopping service %s", _service_name);
+
ReportServiceStatus(SERVICE_STOP_PENDING, NO_ERROR, 0);
- if (RunChildProcess(_cmd_exe, cmd, &prInfo)) {
- rv = WaitForSingleObject(prInfo.hProcess, INFINITE);
+ while (RunChildProcess(_cmd_exe, cmd, &prInfo)) {
+ WaitForSingleObject(prInfo.hProcess, INFINITE);
AddToMessageLog(FALSE, "Stopped service %s", _service_name);
CloseHandle(prInfo.hProcess);
CloseHandle(prInfo.hThread);
- rv = WaitForSingleObject(_service_run_event, INFINITE);
- AddToMessageLog(FALSE, "Stopped service child %s", _service_name);
-
- ReportServiceStatus(SERVICE_STOPPED, NO_ERROR, 0);
- return 0;
+ ReportServiceStatus(SERVICE_STOP_PENDING, NO_ERROR, 0);
+ if (WaitForSingleObject(_service_run_event, 10000) == WAIT_OBJECT_0)
+ break;
+ if (i++ > 4) {
+ ReportServiceStatus(SERVICE_STOP_PENDING, NO_ERROR, 0);
+ TerminateProcessGroup(_service_run_hproc, _service_run_pid, 1);
+ AddToMessageLog(FALSE, "Service terminated %s", _service_name);
+ }
}
- else {
- ReportServiceStatus(SERVICE_STOPPED, NO_ERROR, 0);
- AddToMessageLog(TRUE, "Stopping service %s", _service_name);
- return 1;
- }
+ ReportServiceStatus(SERVICE_STOPPED, NO_ERROR, 0);
+ AddToMessageLog(FALSE, "Stopping service %s", _service_name);
+ return 0;
}
/* Executed when the service receives restart event */
@@ -778,7 +815,12 @@
ReportServiceStatus(SERVICE_RUNNING, NO_ERROR, 0);
SetConsoleCtrlHandler((PHANDLER_ROUTINE)ConsoleHandler, TRUE);
+ _service_run_hproc = prInfo.hProcess;
+ _service_run_pid = prInfo.dwProcessId;
rv = WaitForSingleObject(prInfo.hProcess, INFINITE);
+ _service_run_hproc = NULL;
+ _service_run_pid = 0;
+
AddToMessageLog(FALSE, "Finished service %s", _service_name);
ReportServiceStatus(SERVICE_STOP_PENDING, NO_ERROR, 0);
SetEvent(_service_run_event);
@@ -800,8 +842,7 @@
DWORD rc;
_service_status.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
_service_status.dwCurrentState = SERVICE_START_PENDING;
- _service_status.dwControlsAccepted = SERVICE_ACCEPT_STOP |
- SERVICE_ACCEPT_PAUSE_CONTINUE;
+ _service_status.dwControlsAccepted = SERVICE_ACCEPT_STOP;
_service_status.dwWin32ExitCode = 0;
_service_status.dwCheckPoint = 0;
_service_status.dwWaitHint = 0;
@@ -834,7 +875,7 @@
{
UINT rv = 0;
char *arg;
- int i;
+ int i, l;
int args_left = 1;
int need_desc = 0;
int need_disp = 0;
@@ -857,6 +898,12 @@
while (*++arg != '\0') {
switch (*arg) {
+ case 's':
+ l = atoi(argv[i+1]);
+ Sleep(l * 1000);
+ ExitProcess(0);
+ return;
+ break;
case 'i':
_service_mode = mode_install;
args_left++;
@@ -902,8 +949,12 @@
if ((argc - i) < args_left)
ErrorUsage();
lstrcpy(_service_name, argv[i++]);
+ for (l = 0; l < lstrlen(_service_name); l++) {
+ /* Make service name uppercase */
+ _service_name[l] = toupper((unsigned char)_service_name[l]);
+ }
if (need_path) {
- int l = lstrlen(argv[i]);
+ l = lstrlen(argv[i]);
lstrcpy(_working_path, argv[i++]);
/* Remove trailing backslash */
if (l > 0 && _working_path[l - 1] == '\\')
Modified: trunk/utils/windows/native/service/jbosssvc/jboss.rc
===================================================================
--- trunk/utils/windows/native/service/jbosssvc/jboss.rc 2008-03-14 16:01:08 UTC (rev 1437)
+++ trunk/utils/windows/native/service/jbosssvc/jboss.rc 2008-03-16 19:19:58 UTC (rev 1438)
@@ -34,8 +34,8 @@
#define STR_COMPANY "Red Hat�, Inc."
#define STR_TRADEMARK "� Red Hat Inc."
#define STR_PRODUCT "JBoss Service wrapper"
-#define STR_VERISON "1.2.2.0"
-#define CSV_VERISON 1,2,2,0
+#define STR_VERISON "1.2.3.0"
+#define CSV_VERISON 1,2,3,0
#define PRIVATE_BUILD 0
#define PRERELEASE_BUILD 0
16 years, 9 months
JBoss Native SVN: r1437 - in trunk/utils/windows/native/service/procrun/apps: prunsrv and 1 other directory.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2008-03-14 12:01:08 -0400 (Fri, 14 Mar 2008)
New Revision: 1437
Modified:
trunk/utils/windows/native/service/procrun/apps/prunmgr/prunmgr.c
trunk/utils/windows/native/service/procrun/apps/prunmgr/prunmgr.h
trunk/utils/windows/native/service/procrun/apps/prunmgr/prunmgr.manifest
trunk/utils/windows/native/service/procrun/apps/prunmgr/prunmgr.rc
trunk/utils/windows/native/service/procrun/apps/prunsrv/prunsrv.c
trunk/utils/windows/native/service/procrun/apps/prunsrv/prunsrv.h
trunk/utils/windows/native/service/procrun/apps/prunsrv/prunsrv.rc
Log:
Vista requires the Global prefix for named resources. This is backward compatible, although W2K requires Terminal services installed
Modified: trunk/utils/windows/native/service/procrun/apps/prunmgr/prunmgr.c
===================================================================
--- trunk/utils/windows/native/service/procrun/apps/prunmgr/prunmgr.c 2008-03-13 13:38:07 UTC (rev 1436)
+++ trunk/utils/windows/native/service/procrun/apps/prunmgr/prunmgr.c 2008-03-14 16:01:08 UTC (rev 1437)
@@ -1442,9 +1442,11 @@
HANDLE event;
WCHAR en[SIZ_DESLEN];
int i;
- lstrcpyW(en, szServiceName);
+
+ lstrcpyW(en, L"Global\\");
+ lstrcatW(en, szServiceName);
lstrcatW(en, L"SIGNAL");
- for (i = 0; i < lstrlenW(en); i++) {
+ for (i = 7; i < lstrlenW(en); i++) {
if (en[i] >= L'a' && en[i] <= L'z')
en[i] = en[i] - 32;
}
Modified: trunk/utils/windows/native/service/procrun/apps/prunmgr/prunmgr.h
===================================================================
--- trunk/utils/windows/native/service/procrun/apps/prunmgr/prunmgr.h 2008-03-13 13:38:07 UTC (rev 1436)
+++ trunk/utils/windows/native/service/procrun/apps/prunmgr/prunmgr.h 2008-03-14 16:01:08 UTC (rev 1437)
@@ -25,7 +25,7 @@
#define _PRUNMGR_H
#undef PRG_VERSION
-#define PRG_VERSION "2.0.3.0"
+#define PRG_VERSION "2.0.4.0"
#define PRG_REGROOT L"JBoss\\JBoss Web 2"
#define IDM_TM_EXIT 2000
Modified: trunk/utils/windows/native/service/procrun/apps/prunmgr/prunmgr.manifest
===================================================================
--- trunk/utils/windows/native/service/procrun/apps/prunmgr/prunmgr.manifest 2008-03-13 13:38:07 UTC (rev 1436)
+++ trunk/utils/windows/native/service/procrun/apps/prunmgr/prunmgr.manifest 2008-03-14 16:01:08 UTC (rev 1437)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
-<assemblyIdentity version="2.0.1.0" processorArchitecture="X86" name="JBoss.Web.Service" type="win32" />
+<assemblyIdentity version="2.0.4.0" processorArchitecture="X86" name="JBoss.Web.Service" type="win32" />
<description>JBoss Web Service Manager</description>
<dependency>
<dependentAssembly>
Modified: trunk/utils/windows/native/service/procrun/apps/prunmgr/prunmgr.rc
===================================================================
--- trunk/utils/windows/native/service/procrun/apps/prunmgr/prunmgr.rc 2008-03-13 13:38:07 UTC (rev 1436)
+++ trunk/utils/windows/native/service/procrun/apps/prunmgr/prunmgr.rc 2008-03-14 16:01:08 UTC (rev 1437)
@@ -263,8 +263,8 @@
END
1 VERSIONINFO
- FILEVERSION 2,0,3,0
- PRODUCTVERSION 2,0,3,0
+ FILEVERSION 2,0,4,0
+ PRODUCTVERSION 2,0,4,0
FILEFLAGSMASK 0x3fL
#if defined(_DEBUG)
FILEFLAGS 0x03L
Modified: trunk/utils/windows/native/service/procrun/apps/prunsrv/prunsrv.c
===================================================================
--- trunk/utils/windows/native/service/procrun/apps/prunsrv/prunsrv.c 2008-03-13 13:38:07 UTC (rev 1436)
+++ trunk/utils/windows/native/service/procrun/apps/prunsrv/prunsrv.c 2008-03-14 16:01:08 UTC (rev 1437)
@@ -1161,9 +1161,10 @@
WCHAR en[SIZ_DESLEN];
int i;
PSECURITY_ATTRIBUTES sa = GetNullACL();
- lstrcpyW(en, _service_name);
+ lstrcpyW(en, L"Global\\");
+ lstrcatW(en, _service_name);
lstrcatW(en, PRSRV_SIGNAL);
- for (i = 0; i < lstrlenW(en); i++) {
+ for (i = 7; i < lstrlenW(en); i++) {
if (en[i] >= L'a' && en[i] <= L'z')
en[i] = en[i] - 32;
}
Modified: trunk/utils/windows/native/service/procrun/apps/prunsrv/prunsrv.h
===================================================================
--- trunk/utils/windows/native/service/procrun/apps/prunsrv/prunsrv.h 2008-03-13 13:38:07 UTC (rev 1436)
+++ trunk/utils/windows/native/service/procrun/apps/prunsrv/prunsrv.h 2008-03-14 16:01:08 UTC (rev 1437)
@@ -25,7 +25,7 @@
#define _PRUNSRV_H
#undef PRG_VERSION
-#define PRG_VERSION "2.0.3.0"
+#define PRG_VERSION "2.0.4.0"
#define PRG_REGROOT L"JBoss\\JBoss Web 2"
#endif /* _PRUNSRV_H */
Modified: trunk/utils/windows/native/service/procrun/apps/prunsrv/prunsrv.rc
===================================================================
--- trunk/utils/windows/native/service/procrun/apps/prunsrv/prunsrv.rc 2008-03-13 13:38:07 UTC (rev 1436)
+++ trunk/utils/windows/native/service/procrun/apps/prunsrv/prunsrv.rc 2008-03-14 16:01:08 UTC (rev 1437)
@@ -30,8 +30,8 @@
IDI_MAINICON ICON "../../resources/jboss.ico"
1 VERSIONINFO
- FILEVERSION 2,0,3,0
- PRODUCTVERSION 2,0,3,0
+ FILEVERSION 2,0,4,0
+ PRODUCTVERSION 2,0,4,0
FILEFLAGSMASK 0x3fL
#if defined(_DEBUG)
FILEFLAGS 0x03L
16 years, 9 months
JBoss Native SVN: r1436 - sandbox/httpd/src/native/mod_manager.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-03-13 09:38:07 -0400 (Thu, 13 Mar 2008)
New Revision: 1436
Modified:
sandbox/httpd/src/native/mod_manager/mod_manager.c
Log:
Adapt the code to the handler logic.
Modified: sandbox/httpd/src/native/mod_manager/mod_manager.c
===================================================================
--- sandbox/httpd/src/native/mod_manager/mod_manager.c 2008-03-13 13:37:06 UTC (rev 1435)
+++ sandbox/httpd/src/native/mod_manager/mod_manager.c 2008-03-13 13:38:07 UTC (rev 1436)
@@ -142,44 +142,20 @@
*/
return OK;
}
-static manager_process_connection(conn_rec *c)
+/* Process the requests from the ModClusterService */
+static int manager_handler(request_rec *r)
{
- mod_manager_config *mconf = ap_get_module_config(c->base_server->module_config, &manager_module);
- apr_socket_t *client_socket = ap_get_module_config(c->conn_config, &core_module);
- node_mess locnode;
- apr_status_t rv;
- apr_size_t len;
- char *balancer;
-
- if (!mconf->enable) {
+ apr_bucket_brigade *input_brigade;
+ char buff[4096];
+ int bufsiz=sizeof(buff);
+ if (strcmp(r->handler, "mod-cluster"))
return DECLINED;
- }
- /* XXX: Check that the node is allowed to send to httpd */
-
- /* get the balancer corresponding to the port */
- balancer = getbalancer(c->base_server, mconf->baldata, c->local_addr);
- if (balancer)
- strcpy((char *)&locnode.node.balancer, balancer);
- else
- locnode.node.balancer[0] = '\0';
-
- /* read the data from jboss node (that fills only the first part of the structure) */
- len = 128; /* sizeof(locnode) quick hack use the java test program */
- while (rv = apr_socket_recv(client_socket, (char *) &locnode, &len) == APR_SUCCESS) {
- len = 128; /* sizeof(locnode); */
- switch (htonl(locnode.type)) {
- case 1: /* "I am alive message" from TC */
- rv = insert_update_node(nodestatsmem, &locnode.node);
- if (rv != APR_SUCCESS) {
- ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_EMERG, 0, c->base_server,
- "manager_process_connection insert_update_node failed");
- }
- break;
- default:
- ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_EMERG, 0, c->base_server, "manager_process_connection unknown message %d", htonl(locnode.type));
- }
- }
- return OK;
+ input_brigade = apr_brigade_create(r->connection->pool, r->connection->bucket_alloc);
+ ap_get_brigade(r->input_filters, input_brigade, AP_MODE_READBYTES, APR_BLOCK_READ, sizeof(buff));
+ apr_brigade_flatten(input_brigade, buff, &bufsiz);
+ buff[bufsiz] = '\0';
+ ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL, "%s %s manager_handler buff %s", r->method, r->uri, buff);
+ return (OK);
}
/*
@@ -203,45 +179,6 @@
mconf->basefilename = apr_pstrdup(cmd->pool, word);
return NULL;
}
-AP_DECLARE_NONSTD(const char *) cmd_manager_enableport(cmd_parms *cmd, void *mconfig, int arg)
-{
- mod_manager_config *mconf = ap_get_module_config(cmd->server->module_config, &manager_module);
- mconf->enable = arg;
- return NULL;
-}
-AP_DECLARE_NONSTD(const char *) cmd_manager_uselocalport(cmd_parms *cmd, void *mconfig, const char *word)
-{
- mod_manager_config *mconf = ap_get_module_config(cmd->server->module_config, &manager_module);
- char *name = NULL;
- char *ptr;
- if (cmd->directive->parent &&
- strncasecmp(cmd->directive->parent->directive,
- "<Proxy", 6) == 0) {
- const char *pargs = cmd->directive->parent->args;
- name = ap_getword_conf(cmd->temp_pool, &pargs);
- if ((ptr = ap_strchr(name, '>')))
- *ptr = '\0';
- if (strncasecmp(name, "balancer://", 11) == 0) {
- /* store the port and the balancer in the conf */
- struct baldata *baldata = mconf->baldata;
- if (baldata) {
- while (baldata->next)
- baldata = baldata->next;
- baldata->next = apr_palloc(cmd->pool, sizeof(struct baldata));
- baldata = baldata->next;
- } else {
- mconf->baldata = apr_palloc(cmd->pool, sizeof(struct baldata));
- baldata = mconf->baldata;
- }
- baldata->next = NULL;
- baldata->balancer = apr_pstrdup(cmd->pool, &name[11]);
- baldata->port = atoi(word);
- return NULL;
- }
- return apr_pstrcat(cmd->temp_pool, "UseLocalPort: balancer not ok: ", name, NULL);
- }
- return "UseLocalPort should be in a <Proxy balancer /> directive";
-}
static const command_rec manager_cmds[] =
{
AP_INIT_TAKE1(
@@ -249,14 +186,14 @@
cmd_manager_maxcontext,
NULL,
OR_ALL,
- "Maxcontext - number max context support by mod_manager"
+ "Maxcontext - number max context support by mod_cluster"
),
AP_INIT_TAKE1(
"Maxnode",
cmd_manager_maxnode,
NULL,
OR_ALL,
- "Maxnode - number max node support by mod_manager"
+ "Maxnode - number max node support by mod_cluster"
),
AP_INIT_TAKE1(
"MemManagerFile",
@@ -265,18 +202,6 @@
OR_ALL,
"MemManagerFile - base name of the files used to create/attach to shared memory"
),
- AP_INIT_TAKE1(
- "UseLocalPort",
- cmd_manager_uselocalport,
- NULL,
- OR_ALL,
- "UseLocalPort - Port used to fill balancer nodes"
- ),
- AP_INIT_FLAG("EnableLocalPort",
- cmd_manager_enableport,
- NULL,
- RSRC_CONF,
- "Run a TCP receiver on this host"),
{NULL}
};
@@ -288,8 +213,8 @@
/* Create the shared tables for mod_proxy_cluster */
ap_hook_post_config(manager_init, NULL, NULL, APR_HOOK_MIDDLE);
- /* Process the connections from jboss nodes */
- ap_hook_process_connection(manager_process_connection, NULL, NULL, APR_HOOK_MIDDLE);
+ /* Process the request from the ModClusterService */
+ ap_hook_handler(manager_handler, NULL, NULL, APR_HOOK_MIDDLE);
/* Register nodes table provider */
ap_register_provider(p, "manager" , "shared", "0", &storage);
16 years, 9 months
JBoss Native SVN: r1435 - sandbox/httpd/src/java.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-03-13 09:37:06 -0400 (Thu, 13 Mar 2008)
New Revision: 1435
Added:
sandbox/httpd/src/java/ConfigMethod.java
sandbox/httpd/src/java/DisableMethod.java
sandbox/httpd/src/java/EnableMethod.java
sandbox/httpd/src/java/RemoveMethod.java
sandbox/httpd/src/java/StatusMethod.java
sandbox/httpd/src/java/StopMethod.java
sandbox/httpd/src/java/TestHttpClient.java
Log:
Add basic Method for prototyping.
Added: sandbox/httpd/src/java/ConfigMethod.java
===================================================================
--- sandbox/httpd/src/java/ConfigMethod.java (rev 0)
+++ sandbox/httpd/src/java/ConfigMethod.java 2008-03-13 13:37:06 UTC (rev 1435)
@@ -0,0 +1,9 @@
+import org.apache.commons.httpclient.methods.PostMethod;
+public class ConfigMethod extends PostMethod {
+ public String getName() {
+ return "CONFIG";
+ }
+ public ConfigMethod(String uri) {
+ super(uri);
+ }
+}
Added: sandbox/httpd/src/java/DisableMethod.java
===================================================================
--- sandbox/httpd/src/java/DisableMethod.java (rev 0)
+++ sandbox/httpd/src/java/DisableMethod.java 2008-03-13 13:37:06 UTC (rev 1435)
@@ -0,0 +1,9 @@
+import org.apache.commons.httpclient.methods.PostMethod;
+public class DisableMethod extends PostMethod {
+ public String getName() {
+ return "DISABLE-APP";
+ }
+ public DisableMethod(String uri) {
+ super(uri);
+ }
+}
Added: sandbox/httpd/src/java/EnableMethod.java
===================================================================
--- sandbox/httpd/src/java/EnableMethod.java (rev 0)
+++ sandbox/httpd/src/java/EnableMethod.java 2008-03-13 13:37:06 UTC (rev 1435)
@@ -0,0 +1,9 @@
+import org.apache.commons.httpclient.methods.PostMethod;
+public class EnableMethod extends PostMethod {
+ public String getName() {
+ return "ENABLE-APP";
+ }
+ public EnableMethod(String uri) {
+ super(uri);
+ }
+}
Added: sandbox/httpd/src/java/RemoveMethod.java
===================================================================
--- sandbox/httpd/src/java/RemoveMethod.java (rev 0)
+++ sandbox/httpd/src/java/RemoveMethod.java 2008-03-13 13:37:06 UTC (rev 1435)
@@ -0,0 +1,9 @@
+import org.apache.commons.httpclient.methods.PostMethod;
+public class RemoveMethod extends PostMethod {
+ public String getName() {
+ return "REMOVE-APP";
+ }
+ public RemoveMethod(String uri) {
+ super(uri);
+ }
+}
Added: sandbox/httpd/src/java/StatusMethod.java
===================================================================
--- sandbox/httpd/src/java/StatusMethod.java (rev 0)
+++ sandbox/httpd/src/java/StatusMethod.java 2008-03-13 13:37:06 UTC (rev 1435)
@@ -0,0 +1,9 @@
+import org.apache.commons.httpclient.methods.PostMethod;
+public class StatusMethod extends PostMethod {
+ public String getName() {
+ return "STATUS";
+ }
+ public StatusMethod(String uri) {
+ super(uri);
+ }
+}
Added: sandbox/httpd/src/java/StopMethod.java
===================================================================
--- sandbox/httpd/src/java/StopMethod.java (rev 0)
+++ sandbox/httpd/src/java/StopMethod.java 2008-03-13 13:37:06 UTC (rev 1435)
@@ -0,0 +1,9 @@
+import org.apache.commons.httpclient.methods.PostMethod;
+public class StopMethod extends PostMethod {
+ public String getName() {
+ return "STOP-APP";
+ }
+ public StopMethod(String uri) {
+ super(uri);
+ }
+}
Added: sandbox/httpd/src/java/TestHttpClient.java
===================================================================
--- sandbox/httpd/src/java/TestHttpClient.java (rev 0)
+++ sandbox/httpd/src/java/TestHttpClient.java 2008-03-13 13:37:06 UTC (rev 1435)
@@ -0,0 +1,57 @@
+import org.apache.commons.httpclient.*;
+import org.apache.commons.httpclient.methods.*;
+
+public class TestHttpClient
+{
+
+ /**
+ *
+ * Usage:
+ * java TestHttpClient http://mywebserver:80/ test
+ *
+ * @param args command line arguments
+ * Argument 0 is a URL to a web server
+ * Argument 1 is the command to execute.
+ *
+ */
+ public static void main(String[] args) throws Exception
+ {
+ if (args.length != 2)
+ {
+ System.err.println("missing command line arguments");
+ System.exit(1);
+ }
+ runit(args[0], args[1]);
+ }
+ public static int runit(String URL, String Command) throws Exception
+ {
+
+ HttpClient httpClient = new HttpClient();
+ DisableMethod pm = new DisableMethod(URL);
+ System.out.println("Connecting to " + URL);
+ pm.addParameter("firstname","moi");
+ pm.addParameter("lastname", "me");
+ pm.addParameter("context", "/myapp");
+ pm.addParameter("context", "/yourapp");
+ pm.addParameter("context", "/hisapp");
+/*
+ pm.setRequestEntity(new StringRequestEntity("firstname=moi-meme&lastname=toi-meme&comment=test",
+ "application/x-www-form-urlencoded",
+ "UTF8"));
+ */
+ Integer connectionTimeout = 40000;
+ pm.getParams().setParameter("http.socket.timeout", connectionTimeout);
+ pm.getParams().setParameter("http.connection.timeout", connectionTimeout);
+ httpClient.getParams().setParameter("http.socket.timeout", connectionTimeout);
+ httpClient.getParams().setParameter("http.connection.timeout", connectionTimeout);
+
+ int httpResponseCode = 0;
+ try {
+ httpResponseCode = httpClient.executeMethod(pm);
+ System.out.println("response: " + httpResponseCode);
+ } catch(HttpException e) {
+ e.printStackTrace();
+ }
+ return httpResponseCode;
+ }
+}
16 years, 9 months
JBoss Native SVN: r1434 - sandbox/httpd.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-03-13 04:24:46 -0400 (Thu, 13 Mar 2008)
New Revision: 1434
Removed:
sandbox/httpd/proxy/
Log:
Remove useless try.
16 years, 9 months
JBoss Native SVN: r1433 - trunk/utils/windows/native/service/jbosssvc.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2008-03-11 11:49:40 -0400 (Tue, 11 Mar 2008)
New Revision: 1433
Modified:
trunk/utils/windows/native/service/jbosssvc/jboss.c
Log:
Always handle LOGOFF event
Modified: trunk/utils/windows/native/service/jbosssvc/jboss.c
===================================================================
--- trunk/utils/windows/native/service/jbosssvc/jboss.c 2008-03-06 20:02:14 UTC (rev 1432)
+++ trunk/utils/windows/native/service/jbosssvc/jboss.c 2008-03-11 15:49:40 UTC (rev 1433)
@@ -742,12 +742,19 @@
}
else
return FALSE;
+ break;
case CTRL_C_EVENT:
case CTRL_CLOSE_EVENT:
case CTRL_SHUTDOWN_EVENT:
ServiceStop();
return TRUE;
break;
+ case CTRL_LOGOFF_EVENT:
+ if (_service_mode == mode_run) {
+ ServiceStop();
+ }
+ return TRUE;
+ break;
}
return FALSE;
16 years, 10 months
JBoss Native SVN: r1432 - trunk/build/unix.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2008-03-06 15:02:14 -0500 (Thu, 06 Mar 2008)
New Revision: 1432
Modified:
trunk/build/unix/package.list
Log:
We can again have anything as package version
Modified: trunk/build/unix/package.list
===================================================================
--- trunk/build/unix/package.list 2008-03-06 19:56:24 UTC (rev 1431)
+++ trunk/build/unix/package.list 2008-03-06 20:02:14 UTC (rev 1432)
@@ -3,12 +3,12 @@
jboss-native|2.0.1|TOMCAT_NATIVE_1_1_11|apr:v:1.2.9|apu:v:1.2.8|api:v:1.2.1|ssl:v:0.9.8e|zlib:v:1.2.3
jboss-native|2.0.2|TOMCAT_NATIVE_1_1_11|apr:v:1.2.9|apu:v:1.2.8|api:v:1.2.1|ssl:v:0.9.8e|zlib:v:1.2.3
jboss-native|2.0.3|TOMCAT_NATIVE_1_1_12|apr:v:1.2.8|apu:v:1.2.8|api:v:1.2.1|ssl:v:0.9.8e|zlib:v:1.2.3
-jboss-native|2.0.4_dev|trunk|apr:v:1.2.8|apu:v:1.2.8|api:v:1.2.1|ssl:v:0.9.8e|zlib:v:1.2.3
+jboss-native|2.0.4-dev|trunk|apr:v:1.2.8|apu:v:1.2.8|api:v:1.2.1|ssl:v:0.9.8e|zlib:v:1.2.3
# SIGHT
jboss-sight|1.0.0|trunk|apr:v:1.2.9|apu:v:1.2.8|api:v:1.2.1
jboss-sight|1.0.1|trunk|apr:v:1.2.8|apu:v:1.2.8|api:v:1.2.1
jboss-sight|1.0.2|trunk|apr:v:1.2.8|apu:v:1.2.8|api:v:1.2.1
-jboss-sight|1.0.3_dev|trunk|apr:v:1.2.8|apu:v:1.2.8|api:v:1.2.1
+jboss-sight|1.0.3-dev|trunk|apr:v:1.2.8|apu:v:1.2.8|api:v:1.2.1
# httpd
jboss-httpd|0.0.1|2.2.6
-rhel-httpd|0.0.1|httpd-2_2_3-11_el5_1_3|apr:r:apr-1_2_7-11|apu:r:apr-util-1_2_7-7_el5|api:v:1.2.1|ssl:r:openssl-0_9_8b-8_3_el5_0_2|zlib:v:1.2.3|jk:v:1.2.26|iconv:v:1.11|expat:v:1.95.8
+rhel-httpd|2.2.3-11.el5_1.3|httpd-2_2_3-11_el5_1_3|apr:r:apr-1_2_7-11|apu:r:apr-util-1_2_7-7_el5|api:v:1.2.1|ssl:r:openssl-0_9_8b-8_3_el5_0_2|zlib:v:1.2.3|jk:v:1.2.26|iconv:v:1.11|expat:v:1.95.8
16 years, 10 months
JBoss Native SVN: r1431 - trunk/build/unix.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2008-03-06 14:56:24 -0500 (Thu, 06 Mar 2008)
New Revision: 1431
Modified:
trunk/build/unix/build.sh
Log:
Properly terminate the if then fi
Modified: trunk/build/unix/build.sh
===================================================================
--- trunk/build/unix/build.sh 2008-03-06 19:45:00 UTC (rev 1430)
+++ trunk/build/unix/build.sh 2008-03-06 19:56:24 UTC (rev 1431)
@@ -1122,13 +1122,15 @@
override ${build_top}/buildtest.${PACKAGE}.sh ${TMPROOTBASE} ${package_output_dir} ${build_cache_dir} ${IPLOCAL} ${has_ssl}
if [ $? -ne 0 ]; then
echo "buildtest.${PACKAGE} ${TMPROOTBASE} failed"
- exit 1
+ exit 1
+ fi
# try to build from the source tarball
override ${build_top}/util/buildfromtar ${TMPROOTBASE}/src ${build_output_dir} ${package_src_name} ${BUILD_WIN} ${has_ssl} ${build_version} ${PACKAGE}
if [ $? -ne 0 ]; then
echo "buildfromtar in ${TMPROOTBASE}/src failed"
- exit 1
+ exit 1
+ fi
fi
echo ""
echo "SUCCESS : `basename $0` $LastChangedDate$"
16 years, 10 months