JBoss Native SVN: r1150 - trunk/build/unix.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2007-10-29 04:24:53 -0400 (Mon, 29 Oct 2007)
New Revision: 1150
Modified:
trunk/build/unix/package.list
Log:
Oops. We still use 0.9.8e
Modified: trunk/build/unix/package.list
===================================================================
--- trunk/build/unix/package.list 2007-10-29 08:22:20 UTC (rev 1149)
+++ trunk/build/unix/package.list 2007-10-29 08:24:53 UTC (rev 1150)
@@ -2,7 +2,7 @@
# add new versions of package after existing ones.
jboss-native|2.0.2|1.2.9|1.2.8|0.9.8e|TOMCAT_NATIVE_1_1_11
jboss-native|2.0.3|1.2.8|1.2.8|0.9.8e|TOMCAT_NATIVE_1_1_11
-jboss-native|2.0.3-dev|1.2.8|1.2.8|0.9.8f|trunk
+jboss-native|2.0.3-dev|1.2.8|1.2.8|0.9.8e|trunk
# SIGHT
jboss-sight|1.0.0|1.2.9|1.2.8||trunk
jboss-sight|1.0.1|1.2.8|1.2.8||trunk
17 years, 2 months
JBoss Native SVN: r1149 - in trunk: sight and 3 other directories.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2007-10-29 04:22:20 -0400 (Mon, 29 Oct 2007)
New Revision: 1149
Modified:
trunk/build/unix/package.list
trunk/sight/build.xml
trunk/sight/native/CHANGES
trunk/sight/native/include/sight_version.h
trunk/sight/native/os/windows/libsight.rc
Log:
Upgrade SIGHT version to 1.0.2
Modified: trunk/build/unix/package.list
===================================================================
--- trunk/build/unix/package.list 2007-10-29 08:12:38 UTC (rev 1148)
+++ trunk/build/unix/package.list 2007-10-29 08:22:20 UTC (rev 1149)
@@ -2,7 +2,8 @@
# add new versions of package after existing ones.
jboss-native|2.0.2|1.2.9|1.2.8|0.9.8e|TOMCAT_NATIVE_1_1_11
jboss-native|2.0.3|1.2.8|1.2.8|0.9.8e|TOMCAT_NATIVE_1_1_11
-jboss-native|2.0.3-dev|1.2.8|1.2.8|0.9.8e|trunk
+jboss-native|2.0.3-dev|1.2.8|1.2.8|0.9.8f|trunk
# SIGHT
jboss-sight|1.0.0|1.2.9|1.2.8||trunk
jboss-sight|1.0.1|1.2.8|1.2.8||trunk
+jboss-sight|1.0.2|1.2.8|1.2.8||trunk
Modified: trunk/sight/build.xml
===================================================================
--- trunk/sight/build.xml 2007-10-29 08:12:38 UTC (rev 1148)
+++ trunk/sight/build.xml 2007-10-29 08:22:20 UTC (rev 1149)
@@ -12,8 +12,8 @@
<!-- Initialization properties -->
<property name="name" value="System information gathering hybrid tool"/>
<property name="title" value="JBoss system information gathering hybrid tool library"/>
- <property name="version" value="1.0.1"/>
- <property name="version.number" value="101"/>
+ <property name="version" value="1.0.2"/>
+ <property name="version.number" value="102"/>
<property name="project" value="sight"/>
<property name="build.dir" value="./dist"/>
<property name="build.src" value="${build.dir}/src"/>
Modified: trunk/sight/native/CHANGES
===================================================================
--- trunk/sight/native/CHANGES 2007-10-29 08:12:38 UTC (rev 1148)
+++ trunk/sight/native/CHANGES 2007-10-29 08:22:20 UTC (rev 1149)
@@ -1 +1,5 @@
+Changes for SIGHT 1.0.2
+ - Added close method for Directory
+ - Added open and close methods for File
+
Changes for SIGHT 1.0.0
Modified: trunk/sight/native/include/sight_version.h
===================================================================
--- trunk/sight/native/include/sight_version.h 2007-10-29 08:12:38 UTC (rev 1148)
+++ trunk/sight/native/include/sight_version.h 2007-10-29 08:22:20 UTC (rev 1149)
@@ -72,7 +72,7 @@
#define SIGHT_MINOR_VERSION 0
/** patch level */
-#define SIGHT_PATCH_VERSION 1
+#define SIGHT_PATCH_VERSION 2
/**
* This symbol is defined for internal, "development" copies of SIGHT.
Modified: trunk/sight/native/os/windows/libsight.rc
===================================================================
--- trunk/sight/native/os/windows/libsight.rc 2007-10-29 08:12:38 UTC (rev 1148)
+++ trunk/sight/native/os/windows/libsight.rc 2007-10-29 08:22:20 UTC (rev 1149)
@@ -30,7 +30,7 @@
LANGUAGE 0x9,0x1
1 11 logmessages.bin
-#define STR_COPYRIGHT "Copyright � 2006 Red Hat Middleware, LLC. " \
+#define STR_COPYRIGHT "Copyright � 2007 Red Hat Middleware, LLC. " \
"or its licensors, as applicable."
#define STR_LICENSE "Distributable under LGPL license. " \
@@ -39,8 +39,8 @@
#define STR_COMPANY "Red Hat�, Inc."
#define STR_TRADEMARK "� Red Hat Inc."
#define STR_PRODUCT "System information gathering hybrid tool"
-#define STR_VERISON "1.0.1.0"
-#define CSV_VERISON 1,0,1,0
+#define STR_VERISON "1.0.2.0"
+#define CSV_VERISON 1,0,2,0
#define PRIVATE_BUILD 0
#define PRERELEASE_BUILD 0
17 years, 2 months
JBoss Native SVN: r1148 - trunk/sight/java/org/jboss/sight.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2007-10-29 04:12:38 -0400 (Mon, 29 Oct 2007)
New Revision: 1148
Modified:
trunk/sight/java/org/jboss/sight/File.java
Log:
Add open and close File methods
Modified: trunk/sight/java/org/jboss/sight/File.java
===================================================================
--- trunk/sight/java/org/jboss/sight/File.java 2007-10-29 08:02:45 UTC (rev 1147)
+++ trunk/sight/java/org/jboss/sight/File.java 2007-10-29 08:12:38 UTC (rev 1148)
@@ -138,8 +138,7 @@
throws NullPointerException, OperatingSystemException
{
super(0);
- create0(INSTANCE, name, FileMode.bitmapOf(flags),
- FileProtection.bitmapOf(perm));
+ open(name, flags, perm);
}
/**
@@ -178,11 +177,57 @@
throws NullPointerException, OperatingSystemException
{
super(parent.POOL);
+ open(name, flags, perm);
+ }
+
+ /**
+ * Open the specified file.
+ * @param name The full path to the file (using / on all systems)
+ * @param flags Or'ed value of:
+ * <PRE>
+ * APR_FOPEN_READ open for reading
+ * APR_FOPEN_WRITE open for writing
+ * APR_FOPEN_CREATE create the file if not there
+ * APR_FOPEN_APPEND file ptr is set to end prior to all writes
+ * APR_FOPEN_TRUNCATE set length to zero if file exists
+ * APR_FOPEN_BINARY not a text file (This flag is ignored on
+ * UNIX because it has no meaning)
+ * APR_FOPEN_BUFFERED buffer the data. Default is non-buffered
+ * APR_FOPEN_EXCL return error if APR_FOPEN_CREATE and file exists
+ * APR_FOPEN_DELONCLOSE delete the file after closing.
+ * APR_FOPEN_XTHREAD Platform dependent tag to open the file
+ * for use across multiple threads
+ * APR_FOPEN_SHARELOCK Platform dependent support for higher
+ * level locked read/write access to support
+ * writes across process/machines
+ * APR_FOPEN_SENDFILE_ENABLED Open with appropriate platform semantics
+ * for sendfile operations. Advisory only,
+ * apr_socket_sendfile does not check this flag.
+ * </PRE>
+ * @param perm Access permissions for file.
+ * <P>
+ * If perm is OS_DEFAULT and the file is being created,
+ * appropriate default permissions will be used.
+ * </P>
+ */
+ public void open(String name, EnumSet<FileMode> flags,
+ EnumSet<FileProtection> perm)
+ throws NullPointerException, OperatingSystemException
+ {
create0(INSTANCE, name, FileMode.bitmapOf(flags),
FileProtection.bitmapOf(perm));
}
/**
+ * Close the File.
+ * This is synonim for destroy method
+ */
+ public void close()
+ {
+ destroy();
+ }
+
+ /**
* Create a temporary file
* @param template The template to use when creating a temp file.
* @param flags The flags to open the file with. If this is zero,
17 years, 2 months
JBoss Native SVN: r1147 - trunk/sight/test/org/jboss/sight.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2007-10-29 04:02:45 -0400 (Mon, 29 Oct 2007)
New Revision: 1147
Added:
trunk/sight/test/org/jboss/sight/MutexTest.java
Modified:
trunk/sight/test/org/jboss/sight/DirectoryTest.java
trunk/sight/test/org/jboss/sight/ShmTest.java
Log:
Tune up Test suite
Modified: trunk/sight/test/org/jboss/sight/DirectoryTest.java
===================================================================
--- trunk/sight/test/org/jboss/sight/DirectoryTest.java 2007-10-29 08:02:20 UTC (rev 1146)
+++ trunk/sight/test/org/jboss/sight/DirectoryTest.java 2007-10-29 08:02:45 UTC (rev 1147)
@@ -60,6 +60,18 @@
assertEquals(Error.APR_SUCCESS, rc);
rc = Directory.makeRecursive("bar/foo", FileProtection.OS_DEFAULT);
assertEquals(Error.APR_SUCCESS, rc);
+
+ FileInfo fi;
+ Directory dir = new Directory("bar");
+ DirectoryIterator di = dir.getContent(EnumSet.of(FileInfoFlags.DIRENT));
+ fi = di.next();
+ assertEquals(".", fi.BaseName);
+ fi = di.next();
+ assertEquals("..", fi.BaseName);
+ fi = di.next();
+ assertEquals("foo", fi.BaseName);
+ dir.close();
+
rc = Directory.remove("bar/foo");
assertEquals(Error.APR_SUCCESS, rc);
rc = Directory.remove("bar");
Added: trunk/sight/test/org/jboss/sight/MutexTest.java
===================================================================
--- trunk/sight/test/org/jboss/sight/MutexTest.java (rev 0)
+++ trunk/sight/test/org/jboss/sight/MutexTest.java 2007-10-29 08:02:45 UTC (rev 1147)
@@ -0,0 +1,104 @@
+/*
+ * SIGHT - System information gathering hybrid tool
+ *
+ * Copyright(c) 2007 Red Hat Middleware, LLC,
+ * and individual contributors as indicated by the @authors tag.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library in the file COPYING.LIB;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ *
+ */
+package org.jboss.sight;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+
+/**
+ * Process Mutext Test.
+ *
+ */
+public class MutexTest extends TestCase
+{
+
+ int counter = 0;
+
+ public static void main(String[] args)
+ {
+ junit.textui.TestRunner.run(MutexTest.class);
+ }
+
+ protected void setUp()
+ throws Exception
+ {
+ Library.initialize("");
+ }
+
+ protected void tearDown()
+ throws Exception
+ {
+ Library.shutdown();
+ }
+
+ class MutexTestClient extends Thread
+ {
+ Mutex m;
+
+ MutexTestClient()
+ throws Exception
+ {
+ m = new Mutex("./ProcessMutex.lock", MutexType.DEFAULT);
+ }
+
+ public void run() {
+ /* First one should be locked */
+ int rv = m.tryLock();
+
+ assertTrue(Status.APR_STATUS_IS_EBUSY(rv));
+ try {
+ rv = m.lock();
+ assertEquals(0, counter);
+ assertEquals(Error.APR_SUCCESS, rv);
+ rv = m.unlock();
+ assertEquals(Error.APR_SUCCESS, rv);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+
+ public void testMutex()
+ throws Exception
+ {
+ Mutex m = new Mutex("./ProcessMutex.lock", MutexType.DEFAULT);
+
+ m.lock();
+ new MutexTestClient().start();
+ /* Settle up */
+ Thread.sleep(1000);
+ m.unlock();
+ for (; counter < 10; counter++) {
+ m.lock();
+ Thread.sleep(10);
+ m.unlock();
+ }
+ assertNotNull(m.getName());
+
+ m.destroy();
+ }
+
+}
Property changes on: trunk/sight/test/org/jboss/sight/MutexTest.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/sight/test/org/jboss/sight/ShmTest.java
===================================================================
--- trunk/sight/test/org/jboss/sight/ShmTest.java 2007-10-29 08:02:20 UTC (rev 1146)
+++ trunk/sight/test/org/jboss/sight/ShmTest.java 2007-10-29 08:02:45 UTC (rev 1147)
@@ -43,7 +43,7 @@
protected void setUp()
throws Exception
{
- Library.initialize(null);
+ Library.initialize("");
}
protected void tearDown()
@@ -52,28 +52,27 @@
Library.shutdown();
}
- public void testShmCreate()
+ public void testShm()
throws Exception
{
int size = 64 * 1024;
- Shm shm = new Shm("C:\\TEMP\\SharedMemory.bin", size);
- ByteBuffer bb = shm.getBytes();
-
+ Shm shmc = new Shm("./SharedMemory.bin", size);
+ ByteBuffer bb = shmc.getBytes();
+
assertEquals(size, bb.capacity());
bb.putInt(0xCAFEBABE);
bb.putInt(0xDEADBEEF);
- }
- public void testShmOpen()
- throws Exception
- {
- int size = 64 * 1024;
- Shm shm = new Shm("C:\\TEMP\\SharedMemory.bin", size);
- ByteBuffer bb = shm.getBytes();
-
- assertEquals(size, bb.capacity());
- assertEquals(0xCAFEBABE, bb.getInt());
- assertEquals(0xDEADBEEF, bb.getInt());
+ /* Attach Shared memory */
+ Shm shma = new Shm();
+
+ int rv = shma.attach("./SharedMemory.bin");
+ assertEquals(rv, Error.APR_SUCCESS);
+ assertEquals(size, shma.size());
+
+ ByteBuffer br = shma.getBytes();
+ assertEquals(0xCAFEBABE, br.getInt());
+ assertEquals(0xDEADBEEF, br.getInt());
}
}
17 years, 2 months
JBoss Native SVN: r1146 - trunk/sight/java/org/jboss/sight.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2007-10-29 04:02:20 -0400 (Mon, 29 Oct 2007)
New Revision: 1146
Modified:
trunk/sight/java/org/jboss/sight/Directory.java
Log:
Add synonim close for Directory.destroy()
Modified: trunk/sight/java/org/jboss/sight/Directory.java
===================================================================
--- trunk/sight/java/org/jboss/sight/Directory.java 2007-10-26 07:43:50 UTC (rev 1145)
+++ trunk/sight/java/org/jboss/sight/Directory.java 2007-10-29 08:02:20 UTC (rev 1146)
@@ -224,4 +224,13 @@
return size0(INSTANCE, recursive, Path);
}
+ /**
+ * Close the directory.
+ * This is synonim for destroy method
+ */
+ public void close()
+ {
+ destroy();
+ }
+
}
17 years, 2 months
JBoss Native SVN: r1145 - in sandbox: examples and 1 other directory.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2007-10-26 03:43:50 -0400 (Fri, 26 Oct 2007)
New Revision: 1145
Added:
sandbox/examples/
sandbox/examples/.deps
sandbox/examples/Makefile.in
sandbox/examples/buildconf
sandbox/examples/configure.in
sandbox/examples/mod_redirect.c
Log:
Add an example for case 19020... Base for examples for customer support.
Added: sandbox/examples/.deps
===================================================================
Added: sandbox/examples/Makefile.in
===================================================================
--- sandbox/examples/Makefile.in (rev 0)
+++ sandbox/examples/Makefile.in 2007-10-26 07:43:50 UTC (rev 1145)
@@ -0,0 +1,30 @@
+#
+# Copyright 2007 Red Hat Middleware, LLC.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software distributed
+# under the License is distributed on an "AS IS" BASIS,i
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+APACHE_BASE = @APACHE_BASE@
+top_builddir = @APACHE_BASE@
+# For .deps.
+builddir = @MANAGER_BASE@
+
+MOD_OBJS_LO=
+
+include $(APACHE_BASE)/build/rules.mk
+SH_COMPILE = $(LIBTOOL) --mode=compile $(BASE_CC) -I../common -prefer-pic -c $< && touch $@
+
+all: mod_redirect.so
+
+mod_redirect.so: mod_redirect.la
+ $(APACHE_BASE)/build/instdso.sh SH_LIBTOOL='$(LIBTOOL)' mod_redirect.la `pwd`
+
+mod_redirect.la: mod_redirect.slo
+ $(SH_LINK) -rpath $(libexecdir) -module -avoid-version mod_redirect.lo $(MOD_OBJS_LO)
Added: sandbox/examples/buildconf
===================================================================
--- sandbox/examples/buildconf (rev 0)
+++ sandbox/examples/buildconf 2007-10-26 07:43:50 UTC (rev 1145)
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+rm -rf aclocal.m4 autom4te*.cache
+
+echo "Creating configure ..."
+### do some work to toss config.cache?
+if ${AUTOCONF:-autoconf}; then
+ :
+else
+ echo "autoconf failed"
+ exit 1
+fi
Property changes on: sandbox/examples/buildconf
___________________________________________________________________
Name: svn:executable
+ *
Added: sandbox/examples/configure.in
===================================================================
--- sandbox/examples/configure.in (rev 0)
+++ sandbox/examples/configure.in 2007-10-26 07:43:50 UTC (rev 1145)
@@ -0,0 +1,24 @@
+dnl configure for mod_redirect
+dnl
+
+AC_INIT(mod_redirect.c)
+
+AC_MSG_CHECKING(for Apache httpd installation)
+AC_ARG_WITH(apache,
+[ --with-apache[=DIR] DIR is the apache base installation
+],
+[ if test "$withval" = "yes"; then
+ withval=/usr/local/etc/httpd
+ fi
+ if test "$withval" != "no"; then
+ APACHE_BASE=$withval
+ else
+ AC_MSG_ERROR(mod_redirect need a valid apache location)
+ fi
+],
+[ AC_MSG_ERROR(Please use --with-apache[=DIR])])
+MANAGER_BASE=`pwd`
+
+AC_SUBST(APACHE_BASE)
+AC_SUBST(MANAGER_BASE)
+AC_OUTPUT(Makefile)
Added: sandbox/examples/mod_redirect.c
===================================================================
--- sandbox/examples/mod_redirect.c (rev 0)
+++ sandbox/examples/mod_redirect.c 2007-10-26 07:43:50 UTC (rev 1145)
@@ -0,0 +1,61 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "httpd.h"
+#include "http_config.h"
+#include "http_core.h"
+#include "http_log.h"
+#include "http_main.h"
+#include "http_protocol.h"
+#include "http_request.h"
+#include "util_script.h"
+#include "http_connection.h"
+#ifdef HAVE_UNIX_SUEXEC
+#include "unixd.h"
+#endif
+#include "scoreboard.h"
+#include "mpm_common.h"
+
+#include "apr_strings.h"
+
+#include <stdio.h>
+
+
+/* example of redirect for case 19020 */
+static int x_handler(request_rec *r)
+{
+ char locbuf[2048];
+ snprintf(locbuf, sizeof(locbuf), "%s", "http://example.com:7779/t.gif");
+ apr_table_setn (r->headers_out, "Location", locbuf);
+ return (HTTP_TEMPORARY_REDIRECT);
+}
+static void x_register_hooks(apr_pool_t *p)
+{
+ ap_hook_handler(x_handler, NULL, NULL, APR_HOOK_MIDDLE);
+}
+static void *x_create_dir_config(apr_pool_t *pool, char *x)
+{
+ return NULL;
+}
+module AP_MODULE_DECLARE_DATA redirect_module =
+{
+ STANDARD20_MODULE_STUFF,
+ x_create_dir_config, /* per-directory config creator */
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ x_register_hooks, /* set up other request processing hooks */
+};
17 years, 2 months
JBoss Native SVN: r1144 - trunk/utils/windows/native/service/classes/org/jboss/windows.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2007-10-23 08:14:07 -0400 (Tue, 23 Oct 2007)
New Revision: 1144
Modified:
trunk/utils/windows/native/service/classes/org/jboss/windows/Service.java
Log:
Add some comments
Modified: trunk/utils/windows/native/service/classes/org/jboss/windows/Service.java
===================================================================
--- trunk/utils/windows/native/service/classes/org/jboss/windows/Service.java 2007-10-23 12:10:18 UTC (rev 1143)
+++ trunk/utils/windows/native/service/classes/org/jboss/windows/Service.java 2007-10-23 12:14:07 UTC (rev 1144)
@@ -43,9 +43,11 @@
SignalHelper.initialize(null);
}
catch(Exception x) {
- // Ignore all native initialization exceptions
+ // Ignore all native initialization exceptions
}
try {
+ // Presume we have at least one argument
+ // (org.jboss.Main)
Class mainClass = Class.forName(args[0]);
Object mainObject = mainClass.newInstance();
@@ -57,10 +59,13 @@
cmdArgs[i] = args[i + 1];
argList[0] = cmdArgs;
Method mainMethod = mainClass.getMethod("main", paramTypes);
+ // Invoke the main method from args[0]
mainMethod.invoke(mainObject, argList);
}
catch (Throwable e) {
+ // Perhaps we should throw some errors here, but they'll be
+ // printed anyhow
System.err.println(e);
}
- }
+ }
}
17 years, 2 months
JBoss Native SVN: r1143 - in trunk/utils/windows/native/service: classes/org/jboss/windows and 1 other directory.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2007-10-23 08:10:18 -0400 (Tue, 23 Oct 2007)
New Revision: 1143
Modified:
trunk/utils/windows/native/service/build.xml
trunk/utils/windows/native/service/classes/org/jboss/windows/Service.java
Log:
Remove dependency on run.jar by using reflection
Modified: trunk/utils/windows/native/service/build.xml
===================================================================
--- trunk/utils/windows/native/service/build.xml 2007-10-22 09:31:59 UTC (rev 1142)
+++ trunk/utils/windows/native/service/build.xml 2007-10-23 12:10:18 UTC (rev 1143)
@@ -12,8 +12,8 @@
<!-- Initialization properties -->
<property name="name" value="JBoss Service Helper"/>
<property name="title" value="JBoss Service Helper Library"/>
- <property name="version" value="1.0.0"/>
- <property name="version.number" value="100"/>
+ <property name="version" value="1.0.1"/>
+ <property name="version.number" value="101"/>
<property name="project" value="jbosssch"/>
<property name="build.dir" value="./dist"/>
<property name="build.src" value="${build.dir}/src"/>
@@ -42,7 +42,6 @@
<!-- Build classpath -->
<path id="classpath">
<pathelement location="${build.dest}/classes"/>
- <pathelement location="./lib/run.jar"/>
</path>
<!-- Test classpath -->
@@ -89,7 +88,7 @@
packagenames="org.jboss.*"
windowtitle="${title} (Version ${version})"
doctitle="<h2>${title}</h2>"
- bottom="Copyright 2006 Red Hat, Inc.<!--
+ bottom="Copyright 2007 Red Hat, Inc.<!--
JBoss, the OpenSource J2EE webOS
Distributable under LGPL license.
Modified: trunk/utils/windows/native/service/classes/org/jboss/windows/Service.java
===================================================================
--- trunk/utils/windows/native/service/classes/org/jboss/windows/Service.java 2007-10-22 09:31:59 UTC (rev 1142)
+++ trunk/utils/windows/native/service/classes/org/jboss/windows/Service.java 2007-10-23 12:10:18 UTC (rev 1143)
@@ -25,6 +25,7 @@
*/
package org.jboss.windows;
+import java.lang.reflect.*;
/**
* Windows sservice helper class.
@@ -33,20 +34,33 @@
{
/**
* This is where the magic begins.
- *
- * <P>Starts up inside of a "jboss" thread group to allow better
- * identification of JBoss threads.
- *
* @param args The command line arguments.
*/
- public static void main(final String[] args) throws Exception
+ public static void main(final String[] args)
+ throws Exception
{
try {
SignalHelper.initialize(null);
}
- catch(Exception e) {
- // Ignore all initialize exceptions
+ catch(Exception x) {
+ // Ignore all native initialization exceptions
}
- org.jboss.Main.main(args);
+ try {
+ Class mainClass = Class.forName(args[0]);
+ Object mainObject = mainClass.newInstance();
+
+ Class paramTypes[] = new Class[1];
+ paramTypes[0] = Class.forName("[Ljava.lang.String;");
+ Object argList[] = new Object[1];
+ String[] cmdArgs = new String[args.length - 1];
+ for (int i = 0; i < cmdArgs.length; i++)
+ cmdArgs[i] = args[i + 1];
+ argList[0] = cmdArgs;
+ Method mainMethod = mainClass.getMethod("main", paramTypes);
+ mainMethod.invoke(mainObject, argList);
+ }
+ catch (Throwable e) {
+ System.err.println(e);
+ }
}
}
17 years, 2 months
JBoss Native SVN: r1142 - trunk/sight/native/os/linux.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2007-10-22 05:31:59 -0400 (Mon, 22 Oct 2007)
New Revision: 1142
Modified:
trunk/sight/native/os/linux/module.c
Log:
Fix typo
Modified: trunk/sight/native/os/linux/module.c
===================================================================
--- trunk/sight/native/os/linux/module.c 2007-10-22 09:22:07 UTC (rev 1141)
+++ trunk/sight/native/os/linux/module.c 2007-10-22 09:31:59 UTC (rev 1142)
@@ -137,7 +137,7 @@
for (j = 0; j < amods->siz; j++) {
char *bp;
- if (((bp = strchr(amods->arr[j], '/'))) {
+ if ((bp = strchr(amods->arr[j], '/'))) {
module_addr_t *ma;
cache_entry_t *me;
char *bn = NULL;
17 years, 2 months
JBoss Native SVN: r1141 - trunk/sight/native/os/linux.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2007-10-22 05:22:07 -0400 (Mon, 22 Oct 2007)
New Revision: 1141
Modified:
trunk/sight/native/os/linux/module.c
Log:
Make sure modules are listed only once for each module with calculated mutiple sizes
Modified: trunk/sight/native/os/linux/module.c
===================================================================
--- trunk/sight/native/os/linux/module.c 2007-10-22 06:58:23 UTC (rev 1140)
+++ trunk/sight/native/os/linux/module.c 2007-10-22 09:22:07 UTC (rev 1141)
@@ -95,6 +95,13 @@
sight_unload_class(_E, &_clazzn);
}
+typedef struct module_addr_t module_addr_t;
+struct module_addr_t {
+ const char *path;
+ unsigned long long base;
+ unsigned long long size;
+};
+
static jobject new_module_class(SIGHT_STDARGS, jint pid, jint id)
{
if (_clazzn.i && _m0000n.i)
@@ -110,7 +117,8 @@
char spath[SIGHT_SBUFFER_SIZ];
jsize j, i = 0, nmods = 0;
jobjectArray mods = NULL;
- sight_arr_t *amods;
+ sight_arr_t *amods = NULL;
+ cache_table_t *cmods = NULL;
UNREFERENCED_O;
if (pid < 0)
@@ -121,41 +129,65 @@
throwAprIOException(_E, apr_get_os_error());
goto cleanup;
}
+ if (!(cmods = cache_new(4))) {
+ throwAprMemoryException(_E, THROW_FMARK,
+ apr_get_os_error());
+ goto cleanup;
+ }
+
for (j = 0; j < amods->siz; j++) {
- if (strchr(amods->arr[j], '/'))
- nmods++;
+ char *bp;
+ if (((bp = strchr(amods->arr[j], '/'))) {
+ module_addr_t *ma;
+ cache_entry_t *me;
+ char *bn = NULL;
+ char *p;
+ unsigned long long b, o;
+
+ if ((bn = strrchr(bp, '/')))
+ bn++;
+ else
+ continue;
+
+ me = cache_add(cmods, bn);
+ if (!me->data) {
+ if (!(ma = (module_addr_t *)sight_calloc(_E,
+ sizeof(module_addr_t),
+ THROW_FMARK))) {
+ goto cleanup;
+ }
+ ma->path = bp;
+ me->data = ma;
+ nmods++;
+ }
+ else
+ ma = (module_addr_t *)me->data;
+ b = strtoull(amods->arr[j], &p, 16);
+ if (p && *p == '-')
+ o = strtoull(p + 1, NULL, 16) - b;
+ else
+ o = 0;
+ if (!ma->base)
+ ma->base = b;
+ ma->size += o;
+ }
}
mods = (*_E)->NewObjectArray(_E, nmods, _clazzn.a, NULL);
if (!mods || (*_E)->ExceptionCheck(_E)) {
goto cleanup;
}
- for (j = 0; j < amods->siz; j++) {
- jobject m;
- char *bp = NULL;
- char *bn = NULL;
- char *p;
- unsigned long long b, o;
- if ((bp = strchr(amods->arr[j], '/'))) {
- if ((bn = strrchr(bp, '/')))
- bn++;
- }
- else
- continue;
- m = new_module_class(_E, _O, pid, i);
+ for (j = 0; j < cmods->siz; j++) {
+ module_addr_t *ma = (module_addr_t *)cmods->list[j]->data;
+ jobject m = new_module_class(_E, _O, pid, i);
if (!m || (*_E)->ExceptionCheck(_E)) {
mods = NULL;
goto cleanup;
}
- SET_IFIELD_S(0000, m, bn);
- SET_IFIELD_S(0001, m, bp);
- b = strtoull(amods->arr[j], &p, 16);
- if (p && *p == '-')
- o = strtoull(p + 1, NULL, 16) - b;
- else
- o = 0;
- SET_IFIELD_J(0002, m, b);
- SET_IFIELD_J(0003, m, o);
+ SET_IFIELD_S(0000, m, cmods->list[j]->key);
+ SET_IFIELD_S(0001, m, ma->path);
+ SET_IFIELD_J(0002, m, ma->base);
+ SET_IFIELD_J(0003, m, ma->size);
(*_E)->SetObjectArrayElement(_E, mods, i++, m);
(*_E)->DeleteLocalRef(_E, m);
@@ -166,5 +198,8 @@
cleanup:
if (amods)
sight_arr_free(amods);
+ if (cmods)
+ cache_free(cmods, NULL);
+
return mods;
}
17 years, 2 months