JBoss Native SVN: r1954 - trunk/mod_cluster/native/mod_manager.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-10-13 09:01:38 -0400 (Mon, 13 Oct 2008)
New Revision: 1954
Modified:
trunk/mod_cluster/native/mod_manager/mod_manager.c
Log:
Don't allow command with missing JVMRoute.
Modified: trunk/mod_cluster/native/mod_manager/mod_manager.c
===================================================================
--- trunk/mod_cluster/native/mod_manager/mod_manager.c 2008-10-13 12:08:37 UTC (rev 1953)
+++ trunk/mod_cluster/native/mod_manager/mod_manager.c 2008-10-13 13:01:38 UTC (rev 1954)
@@ -59,6 +59,7 @@
#define SBALBIG "SYNTAX: Balancer field too big"
#define SBAFBIG "SYNTAX: A field is too big"
#define SROUBIG "SYNTAX: JVMRoute field too big"
+#define SROUBAD "SYNTAX: JVMRoute can't be empty"
#define SDOMBIG "SYNTAX: Domain field too big"
#define SHOSBIG "SYNTAX: Host field too big"
#define SPORBIG "SYNTAX: Port field too big"
@@ -674,6 +675,13 @@
i++;
i++;
}
+
+ /* Check for JVMRoute */
+ if (nodeinfo.mess.JVMRoute[0] == '\0') {
+ *errtype = TYPESYNTAX;
+ return SROUBAD;
+ }
+
/* Insert or update balancer description */
if (insert_update_balancer(balancerstatsmem, &balancerinfo) != APR_SUCCESS) {
*errtype = TYPEMEM;
@@ -869,6 +877,7 @@
return SMESPAR;
}
+ memset(&nodeinfo.mess, '\0', sizeof(nodeinfo.mess));
/* Map nothing by default */
vhost = apr_palloc(r->pool, sizeof(struct cluster_host));
vhost->host = NULL;
@@ -902,6 +911,12 @@
i++;
}
+ /* Check for JVMRoute */
+ if (nodeinfo.mess.JVMRoute[0] == '\0') {
+ *errtype = TYPESYNTAX;
+ return SROUBAD;
+ }
+
/* Read the node */
node = read_node(nodestatsmem, &nodeinfo);
if (node == NULL) {
16 years, 3 months
JBoss Native SVN: r1953 - in trunk/mod_cluster: src and 8 other directories.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-10-13 08:08:37 -0400 (Mon, 13 Oct 2008)
New Revision: 1953
Added:
trunk/mod_cluster/build-tomcat.xml
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/MCMPJBURLEncoder.java
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/MCMPTCURLEncoder.java
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/MCMPURLEncoder.java
trunk/mod_cluster/src/tomcat/
trunk/mod_cluster/src/tomcat/org/
trunk/mod_cluster/src/tomcat/org/jboss/
trunk/mod_cluster/src/tomcat/org/jboss/logging/
trunk/mod_cluster/src/tomcat/org/jboss/logging/DynamicLogger.java
trunk/mod_cluster/src/tomcat/org/jboss/logging/Logger.java
trunk/mod_cluster/src/tomcat/org/jboss/logging/LoggerPlugin.java
trunk/mod_cluster/src/tomcat/org/jboss/logging/MDC.java
trunk/mod_cluster/src/tomcat/org/jboss/logging/MDCProvider.java
trunk/mod_cluster/src/tomcat/org/jboss/logging/MDCSupport.java
trunk/mod_cluster/src/tomcat/org/jboss/logging/NDC.java
trunk/mod_cluster/src/tomcat/org/jboss/logging/NDCProvider.java
trunk/mod_cluster/src/tomcat/org/jboss/logging/NDCSupport.java
trunk/mod_cluster/src/tomcat/org/jboss/logging/NullLoggerPlugin.java
trunk/mod_cluster/src/tomcat/org/jboss/logging/NullMDCProvider.java
trunk/mod_cluster/src/tomcat/org/jboss/logging/NullNDCProvider.java
trunk/mod_cluster/src/tomcat/org/jboss/logging/jdk/
trunk/mod_cluster/src/tomcat/org/jboss/logging/jdk/JDK14LoggerPlugin.java
trunk/mod_cluster/src/tomcat/org/jboss/logging/jdk/JDKMDCProvider.java
trunk/mod_cluster/src/tomcat/org/jboss/logging/jdk/JDKNDCProvider.java
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/DefaultJBossWebEventHandler.java
trunk/mod_cluster/src/main/java/org/jboss/modcluster/Utils.java
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/MCMPUtils.java
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java
Log:
Add what is needed to get it run with TC6.0.x
Added: trunk/mod_cluster/build-tomcat.xml
===================================================================
--- trunk/mod_cluster/build-tomcat.xml (rev 0)
+++ trunk/mod_cluster/build-tomcat.xml 2008-10-13 12:08:37 UTC (rev 1953)
@@ -0,0 +1,59 @@
+<?xml version="1.0"?>
+<!--
+ * Copyright(c) 2008 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
+ *
+ * @author Jean-Frederic Clere
+ * @version $Revision$
+-->
+<project name="tomcat" default="all" basedir=".">
+
+ <!-- See "build.properties.sample" in the top level directory for all -->
+ <!-- property values you must customize for successful building!!! -->
+ <property file="${user.home}/build.properties"/>
+ <property file="build.properties"/>
+
+ <property file="build.properties.default"/>
+
+ <property name="out.dir" value="${basedir}/target/tomcat/"/>
+ <property name="out.classes" value="${basedir}/target/tomcat/classes"/>
+
+ <property name="compile.source" value="1.5"/>
+
+ <target name="compile">
+
+ <mkdir dir="${out.classes}"/>
+
+ <!-- Compile -->
+ <javac srcdir="src/tomcat" destdir="${out.classes}"
+ debug="on" debuglevel="lines,vars,source"
+ deprecation="${compile.deprecation}"
+ source="${compile.source}"
+ optimize="${compile.optimize}">
+ <include name="org/jboss/logging/**" />
+ </javac>
+ </target>
+
+ <target name="all" depends="compile">
+ <jar destfile="${out.dir}/jbosslogging.jar">
+ <fileset dir="${out.classes}"/>
+ </jar>
+ </target>
+</project>
Modified: trunk/mod_cluster/src/main/java/org/jboss/modcluster/DefaultJBossWebEventHandler.java
===================================================================
--- trunk/mod_cluster/src/main/java/org/jboss/modcluster/DefaultJBossWebEventHandler.java 2008-10-13 07:41:25 UTC (rev 1952)
+++ trunk/mod_cluster/src/main/java/org/jboss/modcluster/DefaultJBossWebEventHandler.java 2008-10-13 12:08:37 UTC (rev 1953)
@@ -230,7 +230,7 @@
log.debug(this.sm.getString("modcluster.context.enable", context.getPath(), context.getParent().getName()));
// Send ENABLE-APP if state is started
- if (context.isStarted())
+ if (Utils.isContextStarted(context))
{
MCMPRequest request = MCMPUtils.createEnableAppRequest(context);
this.mcmpHandler.sendRequest(request);
Modified: trunk/mod_cluster/src/main/java/org/jboss/modcluster/Utils.java
===================================================================
--- trunk/mod_cluster/src/main/java/org/jboss/modcluster/Utils.java 2008-10-13 07:41:25 UTC (rev 1952)
+++ trunk/mod_cluster/src/main/java/org/jboss/modcluster/Utils.java 2008-10-13 12:08:37 UTC (rev 1953)
@@ -19,6 +19,32 @@
private static final StringManager sm = StringManager.getManager(Constants.Package);
+ public enum TCtype {
+ JBOSSWEB, TC6, UNKNOWN
+ }
+ // public final static TCtype tctype = TCtype.UNKNOWN;
+ public static TCtype tctype = TCtype.UNKNOWN;
+
+ static
+ {
+
+ if (tctype == tctype.UNKNOWN) {
+ try {
+ Class t = Class.forName("org.apache.catalina.Context");
+ java.lang.reflect.Method m = t.getMethod("isStarted", (Class [])null);
+ if (m != null) {
+ tctype = tctype.JBOSSWEB;
+ } else {
+ tctype = tctype.TC6;
+ }
+ } catch (NoSuchMethodException ex) {
+ tctype = tctype.TC6;
+ } catch (ClassNotFoundException ex) {
+ tctype = tctype.TC6;
+ }
+ }
+ }
+
/**
* Find the most likely connector the proxy server should connect to, or
* accept connections from.
@@ -102,6 +128,32 @@
return result.toString();
}
+ /**
+ * Check if the context is started.
+ *
+ * @param context
+ * @return true if the context is started (or if we don't know) false otherwise.
+ */
+ public static boolean isContextStarted(Context context)
+ {
+ boolean ret = true;
+ if (tctype == tctype.JBOSSWEB)
+ ret = context.isStarted();
+ return ret;
+ }
+
+ /**
+ * Tell if running under JBossWEB
+ * @return true running under JBossWEB/AS5.0x. False TC6 or AS4.2.x AS4.3.x
+ */
+ public static boolean isJBossWEB()
+ {
+ if (tctype == tctype.JBOSSWEB)
+ return true;
+ else
+ return false;
+ }
+
public static void establishJvmRouteAndConnectorAddress(Engine engine, MCMPHandler mcmpHandler) throws IOException
{
Connector connector = findProxyConnector(engine.getService().findConnectors());
@@ -154,4 +206,4 @@
private Utils()
{
}
-}
\ No newline at end of file
+}
Modified: trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/MCMPUtils.java
===================================================================
--- trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/MCMPUtils.java 2008-10-13 07:41:25 UTC (rev 1952)
+++ trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/MCMPUtils.java 2008-10-13 12:08:37 UTC (rev 1953)
@@ -251,7 +251,7 @@
for (Container element2: children2)
{
Context ctx = (Context) element2;
- if (ctx.isStarted())
+ if (Utils.isContextStarted(ctx))
{
requests.add(MCMPUtils.createEnableAppRequest(ctx));
}
Modified: trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java
===================================================================
--- trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java 2008-10-13 07:41:25 UTC (rev 1952)
+++ trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java 2008-10-13 12:08:37 UTC (rev 1953)
@@ -61,6 +61,7 @@
import org.jboss.modcluster.mcmp.MCMPRequest;
import org.jboss.modcluster.mcmp.MCMPServerState;
import org.jboss.modcluster.mcmp.MCMPUtils;
+import org.jboss.modcluster.Utils;
import org.jboss.modcluster.mcmp.ResetRequestSource;
import org.jboss.modcluster.mcmp.MCMPServerState.State;
@@ -579,18 +580,19 @@
String jvmRoute = request.getJvmRoute();
Map<String, String> parameters = request.getParameters();
- UEncoder encoder = new UEncoder();
- CharChunk body = null;
+ MCMPURLEncoder body = null;
// First, encode the POST body
try
{
- body = encoder.encodeURL("", 0, 0);
- body.recycle();
+ if (Utils.isJBossWEB())
+ body = new MCMPJBURLEncoder();
+ else
+ body = new MCMPTCURLEncoder();
if (jvmRoute != null)
{
- body = this.encodeParameter(encoder, "JVMRoute", jvmRoute, !parameters.isEmpty());
+ body.encodeParameter(this.sm, "JVMRoute", jvmRoute, !parameters.isEmpty());
}
Iterator<Map.Entry<String, String>> entries = parameters.entrySet().iterator();
@@ -599,7 +601,7 @@
{
Map.Entry<String, String> entry = entries.next();
- body = this.encodeParameter(encoder, entry.getKey(), entry.getValue(), entries.hasNext());
+ body.encodeParameter(this.sm, entry.getKey(), entry.getValue(), entries.hasNext());
}
}
catch (IOException e)
Added: trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/MCMPJBURLEncoder.java
===================================================================
--- trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/MCMPJBURLEncoder.java (rev 0)
+++ trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/MCMPJBURLEncoder.java 2008-10-13 12:08:37 UTC (rev 1953)
@@ -0,0 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.modcluster.mcmp.impl;
+
+import java.io.IOException;
+
+import org.apache.tomcat.util.buf.CharChunk;
+import org.apache.tomcat.util.buf.UEncoder;
+import org.apache.catalina.util.StringManager;
+
+/**
+ * Allow to use TC and JBoss url converter.
+ *
+ * @author Jean-Frederic Clere
+ */
+public class MCMPJBURLEncoder implements MCMPURLEncoder
+{
+
+ private CharChunk body = null;
+ private UEncoder encoder;
+
+ public MCMPJBURLEncoder() throws IOException {
+ encoder = new UEncoder();
+
+ body = encoder.encodeURL("", 0, 0);
+ body.recycle();
+ }
+ /* Add parameter to the buffer */
+ public void encodeParameter(StringManager sm, String key, String value, boolean hasNext) throws IOException {
+ if (value == null)
+ {
+ throw new IllegalArgumentException(sm.getString("modcluster.error.nullAttribute", key));
+ }
+
+ encoder.encodeURL(key, 0, key.length()).append('=');
+
+ CharChunk body = encoder.encodeURL(value, 0, value.length());
+
+ if (hasNext)
+ {
+ body.append('&');
+ }
+ }
+
+ /* Return the length of the encoded data */
+ public int getLength() {
+ return body.getLength();
+ }
+
+ /* Return the length of the encoded data */
+ public int getStart() {
+ return body.getStart();
+ }
+
+ /* buffer of the encoded data */
+ public char[] getBuffer() {
+ return body.getBuffer();
+ }
+}
Added: trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/MCMPTCURLEncoder.java
===================================================================
--- trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/MCMPTCURLEncoder.java (rev 0)
+++ trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/MCMPTCURLEncoder.java 2008-10-13 12:08:37 UTC (rev 1953)
@@ -0,0 +1,111 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.modcluster.mcmp.impl;
+
+import java.io.IOException;
+import java.io.CharArrayWriter;
+import java.io.Writer;
+import java.lang.reflect.Method;
+
+
+import org.apache.tomcat.util.buf.UEncoder;
+import org.apache.catalina.util.StringManager;
+
+/**
+ * Allow to use TC and JBoss url converter.
+ *
+ * @author Jean-Frederic Clere
+ */
+public class MCMPTCURLEncoder implements MCMPURLEncoder
+{
+
+ private CharArrayWriter body = null;
+ private UEncoder encoder = null;
+ private char[] buff = null;
+
+ private static Method method = null;
+
+ static {
+ try {
+ Class [] classes = new Class[2];
+ classes[0] = java.io.Writer.class;
+ classes[1] = java.lang.String.class;
+ method = Class.forName("org.apache.tomcat.util.buf.UEncoder").getMethod("urlEncode", classes);
+ } catch (Exception ex) {
+ }
+ }
+
+ MCMPTCURLEncoder() {
+ encoder = new UEncoder();
+
+ body = new CharArrayWriter();
+ }
+ /* Add parameter to the buffer */
+ public void encodeParameter(StringManager sm, String key, String value, boolean hasNext) throws IOException {
+ Object [] objects = new Object[2];
+ objects[0] = body;
+ objects[1] = key;
+ if (value == null)
+ {
+ throw new IllegalArgumentException(sm.getString("modcluster.error.nullAttribute", key));
+ }
+
+ try {
+ method.invoke(encoder, objects);
+ } catch (Exception ex) {
+ body.write(key);
+ }
+ body.write('=');
+
+ objects[1] = value;
+ try {
+ method.invoke(encoder, objects);
+ } catch (Exception ex) {
+ body.write(value);
+ }
+
+ if (hasNext)
+ {
+ body.write('&');
+ }
+ }
+
+ /* Return the length of the encoded data */
+ public int getLength() {
+ if (buff == null)
+ buff = body.toCharArray();
+ return buff.length;
+ }
+
+ /* Return the start of the encoded data */
+ public int getStart() {
+ return 0;
+ }
+
+ /* buffer of the encoded data */
+ public char[] getBuffer() {
+ if (buff == null)
+ buff = body.toCharArray();
+ return buff;
+ }
+}
Added: trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/MCMPURLEncoder.java
===================================================================
--- trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/MCMPURLEncoder.java (rev 0)
+++ trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/MCMPURLEncoder.java 2008-10-13 12:08:37 UTC (rev 1953)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.modcluster.mcmp.impl;
+
+import java.io.IOException;
+import org.apache.catalina.util.StringManager;
+
+/**
+ * Allow to use TC and JBoss url converter.
+ *
+ * @author Jean-Frederic Clere
+ */
+public interface MCMPURLEncoder
+{
+
+ /* Add parameter to the buffer */
+ void encodeParameter(StringManager sm, String key, String value, boolean hasNext) throws IOException;
+
+ /* Return the length of the encoded data */
+ int getLength();
+
+ /* Return the start of the encoded data */
+ int getStart();
+
+ /* buffer of the encoded data */
+ char[] getBuffer();
+}
Added: trunk/mod_cluster/src/tomcat/org/jboss/logging/DynamicLogger.java
===================================================================
--- trunk/mod_cluster/src/tomcat/org/jboss/logging/DynamicLogger.java (rev 0)
+++ trunk/mod_cluster/src/tomcat/org/jboss/logging/DynamicLogger.java 2008-10-13 12:08:37 UTC (rev 1953)
@@ -0,0 +1,265 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.logging;
+
+/**
+ * An extension of the JBoss Logger that adds a log()
+ * primitive that maps to a dynamically defined log level.
+ *
+ * TODO - Make sure serialization works correctly
+ *
+ * @author <a href="mailto:dimitris@jboss.org">Dimitris Andreadis</a>
+ * @version <tt>$Revision: 515 $</tt>
+ *
+ * @since 4.0.3
+ */
+public class DynamicLogger extends Logger
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -5963699806863917370L;
+
+ /** No logging */
+ public static final int LOG_LEVEL_NONE = 0;
+
+ /** Fatal level logging */
+ public static final int LOG_LEVEL_FATAL = 1;
+
+ /** Error level logging */
+ public static final int LOG_LEVEL_ERROR = 2;
+
+ /** Warn level logging */
+ public static final int LOG_LEVEL_WARN = 3;
+
+ /** Info level logging */
+ public static final int LOG_LEVEL_INFO = 4;
+
+ /** Debug level logging */
+ public static final int LOG_LEVEL_DEBUG = 5;
+
+ /** Trace level logging */
+ public static final int LOG_LEVEL_TRACE = 6;
+
+ /** The available log level strings */
+ public final static String[] LOG_LEVEL_STRINGS =
+ { "NONE", "FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE" };
+
+ /** The log level to use for the "log" primitive */
+ private int logLevel = LOG_LEVEL_DEBUG;
+
+ /**
+ * Create a DynamicLogger instance given the logger name.
+ *
+ * @param name the logger name
+ * @return the dynamic logger
+ */
+ public static DynamicLogger getDynamicLogger(String name)
+ {
+ return new DynamicLogger(name);
+ }
+
+ /**
+ * Create a DynamicLogger instance given the logger name with the given suffix.
+ *
+ * <p>This will include a logger seperator between classname and suffix
+ *
+ * @param name The logger name
+ * @param suffix A suffix to append to the classname.
+ * @return the dynamic logger
+ */
+ public static DynamicLogger getDynamicLogger(String name, String suffix)
+ {
+ return new DynamicLogger(name + "." + suffix);
+ }
+
+ /**
+ * Create a DynamicLogger instance given the logger class. This simply
+ * calls create(clazz.getName()).
+ *
+ * @param clazz the Class whose name will be used as the logger name
+ * @return the dynamic logger
+ */
+ public static DynamicLogger getDynamicLogger(Class clazz)
+ {
+ return new DynamicLogger(clazz.getName());
+ }
+
+ /**
+ * Create a DynamicLogger instance given the logger class with the given suffix.
+ *
+ * <p>This will include a logger seperator between classname and suffix
+ *
+ * @param clazz The Class whose name will be used as the logger name.
+ * @param suffix A suffix to append to the classname.
+ * @return the dynamic logger
+ */
+ public static DynamicLogger getDynamicLogger(Class clazz, String suffix)
+ {
+ return new DynamicLogger(clazz.getName() + "." + suffix);
+ }
+
+ /**
+ * Create a new DynamicLogger.
+ *
+ * @param name the log name
+ */
+ protected DynamicLogger(final String name)
+ {
+ super(name);
+ }
+
+ /**
+ * Sets the logLevel for the log() primitive
+ *
+ * @param logLevel between LOG_LEVEL_NONE and LOG_LEVEL_TRACE
+ */
+ public void setLogLevel(int logLevel)
+ {
+ if (logLevel >= LOG_LEVEL_NONE && logLevel <= LOG_LEVEL_TRACE)
+ {
+ this.logLevel = logLevel;
+ }
+ }
+
+ /**
+ * Gets the logLevel of the log() primitive
+ *
+ * @return the logLevel of the log() primitive
+ */
+ public int getLogLevel()
+ {
+ return logLevel;
+ }
+
+ /**
+ * Sets the logLevel of the log() primitive
+ *
+ * @param logLevelString the log level in String form
+ */
+ public void setLogLevelAsString(String logLevelString)
+ {
+ if (logLevelString != null)
+ {
+ logLevelString = logLevelString.toUpperCase().trim();
+
+ for (int i = 0; i <= LOG_LEVEL_TRACE; i++)
+ {
+ if (logLevelString.equals(LOG_LEVEL_STRINGS[i]))
+ {
+ // match
+ this.logLevel = i;
+ break;
+ }
+ }
+ }
+ }
+
+ /**
+ * Gets the logLevel of the log() primitive in String form
+ *
+ * @return the logLevel of the log() primitive in String form
+ */
+ public String getLogLevelAsString()
+ {
+ return LOG_LEVEL_STRINGS[logLevel];
+ }
+
+ /**
+ * Logs a message using dynamic log level
+ *
+ * @param message the message to log
+ */
+ public void log(Object message)
+ {
+ switch (logLevel)
+ {
+ case LOG_LEVEL_TRACE:
+ super.trace(message);
+ break;
+
+ case LOG_LEVEL_DEBUG:
+ super.debug(message);
+ break;
+
+ case LOG_LEVEL_INFO:
+ super.info(message);
+ break;
+
+ case LOG_LEVEL_WARN:
+ super.warn(message);
+ break;
+
+ case LOG_LEVEL_ERROR:
+ super.error(message);
+ break;
+
+ case LOG_LEVEL_FATAL:
+ super.fatal(message);
+ break;
+
+ case LOG_LEVEL_NONE:
+ default:
+ // do nothing
+ break;
+ }
+ }
+
+ /**
+ * Logs a message and a throwable using dynamic log level
+ *
+ * @param message the message to log
+ * @param t the throwable to log
+ */
+ public void log(Object message, Throwable t)
+ {
+ switch (logLevel)
+ {
+ case LOG_LEVEL_TRACE:
+ super.trace(message, t);
+ break;
+
+ case LOG_LEVEL_DEBUG:
+ super.debug(message, t);
+ break;
+
+ case LOG_LEVEL_INFO:
+ super.info(message, t);
+ break;
+
+ case LOG_LEVEL_WARN:
+ super.warn(message, t);
+ break;
+
+ case LOG_LEVEL_ERROR:
+ super.error(message, t);
+ break;
+
+ case LOG_LEVEL_FATAL:
+ super.fatal(message, t);
+ break;
+
+ case LOG_LEVEL_NONE:
+ default:
+ // do nothing
+ break;
+ }
+ }
+}
Added: trunk/mod_cluster/src/tomcat/org/jboss/logging/Logger.java
===================================================================
--- trunk/mod_cluster/src/tomcat/org/jboss/logging/Logger.java (rev 0)
+++ trunk/mod_cluster/src/tomcat/org/jboss/logging/Logger.java 2008-10-13 12:08:37 UTC (rev 1953)
@@ -0,0 +1,434 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.logging;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.Serializable;
+
+/**
+ * Logger wrapper that tries to dynamically load a log4j class to
+ * determine if log4j is available in the VM. If it is the case,
+ * a log4j delegate is built and used. In the contrary, a null
+ * logger is used. This class cannot directly reference log4j
+ * classes otherwise the JVM will try to load it and make it fail.
+ * To set
+ *
+ * <p>Only exposes the relevent factory and logging methods.
+ *
+ * <p>For JBoss the logging should be done as follows:
+ * <ul>
+ * <li>FATAL - JBoss is likely to/will crash
+ * <li>ERROR - A definite problem
+ * <li>WARN - Likely to be a problem, or it could be JBoss
+ * detected a problem it can recover from
+ * <li>INFO - Lifecycle low volume, e.g. "Bound x into jndi",
+ * things that are of interest to a user
+ * <li>DEBUG - Lifecycle low volume but necessarily of interest
+ * to the user, e.g. "Starting listener thread"
+ * <li>TRACE - High volume detailed logging
+ * </ul>
+ *
+ * @see #isTraceEnabled
+ * @see #trace(Object)
+ * @see #trace(Object,Throwable)
+ *
+ * @version <tt>$Revision: 515 $</tt>
+ * @author Scott.Stark(a)jboss.org
+ * @author <a href="mailto:jason@planet57.com">Jason Dillon</a>
+ * @author <a href="mailto:sacha.labourey@cogito-info.ch">Sacha Labourey</a>
+ */
+public class Logger implements Serializable
+{
+ /** Serialization */
+ private static final long serialVersionUID = 4232175575988879434L;
+
+ /** The system property to look for an externalized LoggerPlugin implementation class */
+ protected static String PLUGIN_CLASS_PROP = "org.jboss.logging.Logger.pluginClass";
+
+ /** The default LoggerPlugin implementation is log4j */
+ protected static final String DEFAULT_PLUGIN_CLASS_NAME = "org.jboss.logging.jdk.JDK14LoggerPlugin";
+
+ /** The LoggerPlugin implementation class to use */
+ protected static Class pluginClass = null;
+
+ /** The class name of the LoggerPlugin implementation class to use */
+ protected static String pluginClassName = null;
+
+ static
+ {
+ init();
+ }
+
+ /** The logger name. */
+ private final String name;
+
+ /** The logger plugin delegate */
+ protected transient LoggerPlugin loggerDelegate = null;
+
+ /** The LoggerPlugin implementation class name in use
+ *
+ * @return LoggerPlugin implementation class name
+ */
+ public static String getPluginClassName()
+ {
+ return Logger.pluginClassName;
+ }
+
+ /**
+ * Set the LoggerPlugin implementation class name in use
+ *
+ * @param pluginClassName the LoggerPlugin implementation class name
+ */
+ public static void setPluginClassName(String pluginClassName)
+ {
+ if (pluginClassName.equals(Logger.pluginClassName) == false)
+ {
+ Logger.pluginClassName = pluginClassName;
+ init();
+ }
+ }
+
+ /**
+ * Creates new Logger the given logger name.
+ *
+ * @param name the logger name.
+ */
+ protected Logger(final String name)
+ {
+ this.name = name;
+ this.loggerDelegate = getDelegatePlugin(name);
+ }
+
+ /**
+ * Return the name of this logger.
+ *
+ * @return The name of this logger.
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * Get the logger plugin delegate
+ *
+ * @return the delegate
+ */
+ public LoggerPlugin getLoggerPlugin()
+ {
+ return this.loggerDelegate;
+ }
+
+ /**
+ * Check to see if the TRACE level is enabled for this logger.
+ *
+ * @return true if a {@link #trace(Object)} method invocation would pass
+ * the msg to the configured appenders, false otherwise.
+ */
+ public boolean isTraceEnabled()
+ {
+ return loggerDelegate.isTraceEnabled();
+ }
+
+ /**
+ * Issue a log msg with a level of TRACE.
+ *
+ * @param message the message
+ */
+ public void trace(Object message)
+ {
+ loggerDelegate.trace(message);
+ }
+
+ /**
+ * Issue a log msg and throwable with a level of TRACE.
+ *
+ * @param message the message
+ * @param t the throwable
+ */
+ public void trace(Object message, Throwable t)
+ {
+ loggerDelegate.trace(message, t);
+ }
+
+ /**
+ * Check to see if the DEBUG level is enabled for this logger.
+ *
+ * @deprecated DEBUG is for low volume logging, you don't need this
+ * @return true if a {@link #trace(Object)} method invocation would pass
+ * the msg to the configured appenders, false otherwise.
+ */
+ public boolean isDebugEnabled()
+ {
+ return loggerDelegate.isDebugEnabled();
+ }
+
+ /**
+ * Issue a log msg with a level of DEBUG.
+ *
+ * @param message the message
+ */
+ public void debug(Object message)
+ {
+ loggerDelegate.debug(message);
+ }
+
+ /**
+ * Issue a log msg and throwable with a level of DEBUG.
+ *
+ * @param message the message
+ * @param t the throwable
+ */
+ public void debug(Object message, Throwable t)
+ {
+ loggerDelegate.debug(message, t);
+ }
+
+ /**
+ * Check to see if the INFO level is enabled for this logger.
+ *
+ * @deprecated INFO is for low volume information, you don't need this
+ * @return true if a {@link #info(Object)} method invocation would pass
+ * the msg to the configured appenders, false otherwise.
+ */
+ public boolean isInfoEnabled()
+ {
+ return loggerDelegate.isInfoEnabled();
+ }
+
+ /**
+ * Issue a log msg with a level of INFO.
+ *
+ * @param message the message
+ */
+ public void info(Object message)
+ {
+ loggerDelegate.info(message);
+ }
+
+ /**
+ * Issue a log msg and throwable with a level of INFO.
+ *
+ * @param message the message
+ * @param t the throwable
+ */
+ public void info(Object message, Throwable t)
+ {
+ loggerDelegate.info(message, t);
+ }
+
+ /**
+ * Issue a log msg with a level of WARN.
+ *
+ * @param message the message
+ */
+ public void warn(Object message)
+ {
+ loggerDelegate.warn(message);
+ }
+
+ /**
+ * Issue a log msg and throwable with a level of WARN.
+ *
+ * @param message the message
+ * @param t the throwable
+ */
+ public void warn(Object message, Throwable t)
+ {
+ loggerDelegate.warn(message, t);
+ }
+
+ /**
+ * Issue a log msg with a level of ERROR.
+ *
+ * @param message the message
+ */
+ public void error(Object message)
+ {
+ loggerDelegate.error(message);
+ }
+
+ /**
+ * Issue a log msg and throwable with a level of ERROR.
+ *
+ * @param message the message
+ * @param t the throwable
+ */
+ public void error(Object message, Throwable t)
+ {
+ loggerDelegate.error(message, t);
+ }
+
+ /**
+ * Issue a log msg with a level of FATAL.
+ *
+ * @param message the message
+ */
+ public void fatal(Object message)
+ {
+ loggerDelegate.fatal(message);
+ }
+
+ /**
+ * Issue a log msg and throwable with a level of FATAL.
+ *
+ * @param message the message
+ * @param t the throwable
+ */
+ public void fatal(Object message, Throwable t)
+ {
+ loggerDelegate.fatal(message, t);
+ }
+
+ /**
+ * Custom serialization to reinitalize the delegate
+ *
+ * @param stream the object stream
+ * @throws IOException for any error
+ * @throws ClassNotFoundException if a class is not found during deserialization
+ */
+ private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException
+ {
+ // restore non-transient fields (aka name)
+ stream.defaultReadObject();
+
+ // Restore logging
+ if (pluginClass == null)
+ {
+ init();
+ }
+ this.loggerDelegate = getDelegatePlugin(name);
+ }
+
+ /**
+ * Create a Logger instance given the logger name.
+ *
+ * @param name the logger name
+ * @return the logger
+ */
+ public static Logger getLogger(String name)
+ {
+ return new Logger(name);
+ }
+
+ /**
+ * Create a Logger instance given the logger name with the given suffix.
+ *
+ * <p>This will include a logger seperator between classname and suffix
+ *
+ * @param name the logger name
+ * @param suffix a suffix to append to the classname.
+ * @return the logger
+ */
+ public static Logger getLogger(String name, String suffix)
+ {
+ return new Logger(name + "." + suffix);
+ }
+
+ /**
+ * Create a Logger instance given the logger class. This simply
+ * calls create(clazz.getName()).
+ *
+ * @param clazz the Class whose name will be used as the logger name
+ * @return the logger
+ */
+ public static Logger getLogger(Class clazz)
+ {
+ return new Logger(clazz.getName());
+ }
+
+ /**
+ * Create a Logger instance given the logger class with the given suffix.
+ *
+ * <p>This will include a logger seperator between classname and suffix
+ *
+ * @param clazz the Class whose name will be used as the logger name.
+ * @param suffix a suffix to append to the classname.
+ * @return the logger
+ */
+ public static Logger getLogger(Class clazz, String suffix)
+ {
+ return new Logger(clazz.getName() + "." + suffix);
+ }
+
+ /**
+ * Get the delegate plugin
+ *
+ * @param name the name of the logger
+ * @return the plugin
+ */
+ protected static LoggerPlugin getDelegatePlugin(String name)
+ {
+ LoggerPlugin plugin = null;
+ try
+ {
+ plugin = (LoggerPlugin) pluginClass.newInstance();
+ }
+ catch (Throwable e)
+ {
+ plugin = new NullLoggerPlugin();
+ }
+ try
+ {
+ plugin.init(name);
+ }
+ catch (Throwable e)
+ {
+ String extraInfo = e.getMessage();
+ System.err.println("Failed to initalize plugin: " + plugin
+ + (extraInfo != null ? ", cause: " + extraInfo : ""));
+ plugin = new NullLoggerPlugin();
+ }
+
+ return plugin;
+ }
+
+ /**
+ * Initialize the LoggerPlugin class to use as the delegate to the
+ * logging system. This first checks to see if a pluginClassName has
+ * been specified via the {@link #setPluginClassName(String)} method,
+ * then the PLUGIN_CLASS_PROP system property and finally the
+ * LOG4J_PLUGIN_CLASS_NAME default. If the LoggerPlugin implementation
+ * class cannot be loaded the default NullLoggerPlugin will be used.
+ */
+ protected static void init()
+ {
+ try
+ {
+ // See if there is a PLUGIN_CLASS_PROP specified
+ if (pluginClassName == null)
+ {
+ pluginClassName = System.getProperty(PLUGIN_CLASS_PROP, DEFAULT_PLUGIN_CLASS_NAME);
+ }
+
+ // Try to load the plugin via the TCL
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ pluginClass = cl.loadClass(pluginClassName);
+ }
+ catch (Throwable e)
+ {
+ // The plugin could not be setup, default to a null logger
+ pluginClass = org.jboss.logging.NullLoggerPlugin.class;
+ }
+ }
+}
Added: trunk/mod_cluster/src/tomcat/org/jboss/logging/LoggerPlugin.java
===================================================================
--- trunk/mod_cluster/src/tomcat/org/jboss/logging/LoggerPlugin.java (rev 0)
+++ trunk/mod_cluster/src/tomcat/org/jboss/logging/LoggerPlugin.java 2008-10-13 12:08:37 UTC (rev 1953)
@@ -0,0 +1,158 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.logging;
+
+/**
+ * Defines a "pluggable" login module. In fact, this is only used to split between
+ * log4j and /dev/null. Choice is made in org.jboss.logging.Logger
+ *
+ * @see org.jboss.logging.Logger
+ * @see org.jboss.logging.NullLoggerPlugin
+ *
+ * @author <a href="mailto:sacha.labourey@cogito-info.ch">Sacha Labourey</a>.
+ * @version $Revision: 515 $
+ */
+public interface LoggerPlugin
+{
+ /**
+ * Initialise the logger with the given name
+ *
+ * @param name the name
+ */
+ void init(String name);
+
+ /**
+ * Check to see if the TRACE level is enabled for this logger.
+ *
+ * @return true if a {@link #trace(Object)} method invocation would pass
+ * the msg to the configured appenders, false otherwise.
+ */
+ boolean isTraceEnabled();
+
+ /**
+ * Issue a log msg with a level of TRACE.
+ *
+ * @param message the message
+ */
+ void trace(Object message);
+
+ /**
+ * Issue a log msg and throwable with a level of TRACE.
+ *
+ * @param message the message
+ * @param t the throwable
+ */
+ void trace(Object message, Throwable t);
+
+ /**
+ * Check to see if the DEBUG level is enabled for this logger.
+ *
+ * @deprecated DEBUG is for low volume logging, you don't need this
+ * @return true if a {@link #trace(Object)} method invocation would pass
+ * the msg to the configured appenders, false otherwise.
+ */
+ boolean isDebugEnabled();
+
+ /**
+ * Issue a log msg with a level of DEBUG.
+ *
+ * @param message the message
+ */
+ void debug(Object message);
+
+ /**
+ * Issue a log msg and throwable with a level of DEBUG.
+ *
+ * @param message the message
+ * @param t the throwable
+ */
+ void debug(Object message, Throwable t);
+
+ /**
+ * Check to see if the INFO level is enabled for this logger.
+ *
+ * @deprecated INFO is for low volume information, you don't need this
+ * @return true if a {@link #info(Object)} method invocation would pass
+ * the msg to the configured appenders, false otherwise.
+ */
+ boolean isInfoEnabled();
+
+ /**
+ * Issue a log msg with a level of INFO.
+ *
+ * @param message the message
+ */
+ void info(Object message);
+
+ /**
+ * Issue a log msg and throwable with a level of INFO.
+ *
+ * @param message the message
+ * @param t the throwable
+ */
+ void info(Object message, Throwable t);
+
+ /**
+ * Issue a log msg with a level of WARN.
+ *
+ * @param message the message
+ */
+ void warn(Object message);
+
+ /**
+ * Issue a log msg and throwable with a level of WARN.
+ *
+ * @param message the message
+ * @param t the throwable
+ */
+ void warn(Object message, Throwable t);
+
+ /**
+ * Issue a log msg with a level of ERROR.
+ *
+ * @param message the message
+ */
+ void error(Object message);
+
+ /**
+ * Issue a log msg and throwable with a level of ERROR.
+ *
+ * @param message the message
+ * @param t the throwable
+ */
+ void error(Object message, Throwable t);
+
+ /**
+ * Issue a log msg with a level of FATAL.
+ *
+ * @param message the message
+ */
+ void fatal(Object message);
+
+ /**
+ * Issue a log msg and throwable with a level of FATAL.
+ *
+ * @param message the message
+ * @param t the throwable
+ */
+ void fatal(Object message, Throwable t);
+}
Added: trunk/mod_cluster/src/tomcat/org/jboss/logging/MDC.java
===================================================================
--- trunk/mod_cluster/src/tomcat/org/jboss/logging/MDC.java (rev 0)
+++ trunk/mod_cluster/src/tomcat/org/jboss/logging/MDC.java 2008-10-13 12:08:37 UTC (rev 1953)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.logging;
+
+import java.util.Map;
+
+/**
+ * A "Map Diagnostic Context" abstraction.
+ *
+ * @author Jason T. Greene
+ */
+public class MDC
+{
+ private final static MDCProvider mdc;
+
+ static
+ {
+ MDCProvider m = null;
+ if (NDCSupport.class.isAssignableFrom(Logger.pluginClass))
+ {
+
+ try
+ {
+ m = ((MDCSupport) Logger.pluginClass.newInstance()).getMDCProvider();
+ }
+ catch (Throwable t)
+ {
+ // Eat
+ }
+ }
+
+ if (m == null)
+ m = new NullMDCProvider();
+
+ mdc = m;
+ }
+
+ public static void put(String key, Object val)
+ {
+ mdc.put(key, val);
+ }
+
+ public static Object get(String key)
+ {
+ return mdc.get(key);
+ }
+
+ public static void remove(String key)
+ {
+ mdc.remove(key);
+ }
+
+ public static Map<String, Object> getMap()
+ {
+ return mdc.getMap();
+ }
+}
Added: trunk/mod_cluster/src/tomcat/org/jboss/logging/MDCProvider.java
===================================================================
--- trunk/mod_cluster/src/tomcat/org/jboss/logging/MDCProvider.java (rev 0)
+++ trunk/mod_cluster/src/tomcat/org/jboss/logging/MDCProvider.java 2008-10-13 12:08:37 UTC (rev 1953)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.logging;
+
+import java.util.Map;
+
+/**
+ * MDC SPI for the backend logging implementation.
+ *
+ * @author Jason T. Greene
+ */
+public interface MDCProvider
+{
+ public void put(String key, Object value);
+
+ public Object get(String key);
+
+ public void remove(String key);
+
+ public Map<String, Object> getMap();
+}
Added: trunk/mod_cluster/src/tomcat/org/jboss/logging/MDCSupport.java
===================================================================
--- trunk/mod_cluster/src/tomcat/org/jboss/logging/MDCSupport.java (rev 0)
+++ trunk/mod_cluster/src/tomcat/org/jboss/logging/MDCSupport.java 2008-10-13 12:08:37 UTC (rev 1953)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.logging;
+
+/**
+ * Indicates that a Logger plugin supports MDC.
+ *
+ * @author Jason T. Greene
+ */
+public interface MDCSupport
+{
+ public MDCProvider getMDCProvider();
+}
Added: trunk/mod_cluster/src/tomcat/org/jboss/logging/NDC.java
===================================================================
--- trunk/mod_cluster/src/tomcat/org/jboss/logging/NDC.java (rev 0)
+++ trunk/mod_cluster/src/tomcat/org/jboss/logging/NDC.java 2008-10-13 12:08:37 UTC (rev 1953)
@@ -0,0 +1,90 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.logging;
+
+
+/**
+ * A "Nested Diagnostic Context" abstraction.
+ *
+ * @author Jason T. Greene
+ */
+public class NDC
+{
+ private final static NDCProvider ndc;
+
+ static
+ {
+ NDCProvider n = null;
+ if (NDCSupport.class.isAssignableFrom(Logger.pluginClass))
+ {
+
+ try
+ {
+ n = ((NDCSupport) Logger.pluginClass.newInstance()).getNDCProvider();
+ }
+ catch (Throwable t)
+ {
+ // Eat
+ }
+ }
+
+ if (n == null)
+ n = new NullNDCProvider();
+
+ ndc = n;
+ }
+
+ public static void clear()
+ {
+ ndc.clear();
+ }
+
+ public static String get()
+ {
+ return ndc.get();
+ }
+
+ public static int getDepth()
+ {
+ return ndc.getDepth();
+ }
+
+ public static String pop()
+ {
+ return ndc.pop();
+ }
+
+ public static String peek()
+ {
+ return ndc.peek();
+ }
+
+ public static void push(String message)
+ {
+ ndc.push(message);
+ }
+
+ public static void setMaxDepth(int maxDepth)
+ {
+ ndc.setMaxDepth(maxDepth);
+ }
+}
Added: trunk/mod_cluster/src/tomcat/org/jboss/logging/NDCProvider.java
===================================================================
--- trunk/mod_cluster/src/tomcat/org/jboss/logging/NDCProvider.java (rev 0)
+++ trunk/mod_cluster/src/tomcat/org/jboss/logging/NDCProvider.java 2008-10-13 12:08:37 UTC (rev 1953)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.logging;
+
+
+/**
+ * An NDC SPI for the backend logging implementation.
+ *
+ * @author Jason T. Greene
+ */
+public interface NDCProvider
+{
+ public void clear();
+
+ public String get();
+
+ public int getDepth();
+
+ public String pop();
+
+ public String peek();
+
+ public void push(String message);
+
+ public void setMaxDepth(int maxDepth);
+}
\ No newline at end of file
Added: trunk/mod_cluster/src/tomcat/org/jboss/logging/NDCSupport.java
===================================================================
--- trunk/mod_cluster/src/tomcat/org/jboss/logging/NDCSupport.java (rev 0)
+++ trunk/mod_cluster/src/tomcat/org/jboss/logging/NDCSupport.java 2008-10-13 12:08:37 UTC (rev 1953)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.logging;
+
+/**
+ * Indicates that a logger plugin supports NDC.
+ *
+ * @author Jason T. Greene
+ */
+public interface NDCSupport
+{
+ public NDCProvider getNDCProvider();
+}
Added: trunk/mod_cluster/src/tomcat/org/jboss/logging/NullLoggerPlugin.java
===================================================================
--- trunk/mod_cluster/src/tomcat/org/jboss/logging/NullLoggerPlugin.java (rev 0)
+++ trunk/mod_cluster/src/tomcat/org/jboss/logging/NullLoggerPlugin.java 2008-10-13 12:08:37 UTC (rev 1953)
@@ -0,0 +1,115 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.logging;
+
+/**
+ * LoggerPlugin implementation producing no output at all. Used for client
+ * side logging when no log4j.jar is available on the classpath.
+ *
+ * @see org.jboss.logging.Logger
+ * @see org.jboss.logging.LoggerPlugin
+ *
+ * @author <a href="mailto:sacha.labourey@cogito-info.ch">Sacha Labourey</a>.
+ * @version $Revision: 515 $
+ */
+public class NullLoggerPlugin implements LoggerPlugin
+{
+ public void init(String name)
+ {
+ /* don't care */
+ }
+
+ public boolean isTraceEnabled()
+ {
+ return false;
+ }
+
+ public void trace(Object message)
+ {
+ // nothing
+ }
+
+ public void trace(Object message, Throwable t)
+ {
+ // nothing
+ }
+
+ public boolean isDebugEnabled()
+ {
+ return false;
+ }
+
+ public void debug(Object message)
+ {
+ // nothing
+ }
+
+ public void debug(Object message, Throwable t)
+ {
+ // nothing
+ }
+
+ public boolean isInfoEnabled()
+ {
+ return false;
+ }
+
+ public void info(Object message)
+ {
+ // nothing
+ }
+
+ public void info(Object message, Throwable t)
+ {
+ // nothing
+ }
+
+ public void error(Object message)
+ {
+ // nothing
+ }
+
+ public void error(Object message, Throwable t)
+ {
+ // nothing
+ }
+
+ public void fatal(Object message)
+ {
+ // nothing
+ }
+
+ public void fatal(Object message, Throwable t)
+ {
+ // nothing
+ }
+
+ public void warn(Object message)
+ {
+ // nothing
+ }
+
+ public void warn(Object message, Throwable t)
+ {
+ // nothing
+ }
+}
Added: trunk/mod_cluster/src/tomcat/org/jboss/logging/NullMDCProvider.java
===================================================================
--- trunk/mod_cluster/src/tomcat/org/jboss/logging/NullMDCProvider.java (rev 0)
+++ trunk/mod_cluster/src/tomcat/org/jboss/logging/NullMDCProvider.java 2008-10-13 12:08:37 UTC (rev 1953)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.logging;
+
+import java.util.Map;
+
+/**
+ * An MDC provider which does nothing.
+ *
+ * @author Jason T. Greene
+ */
+public class NullMDCProvider implements MDCProvider
+{
+ public Object get(String key)
+ {
+ return null;
+ }
+
+ public Map<String, Object> getMap()
+ {
+ return null;
+ }
+
+ public void put(String key, Object val)
+ {
+ }
+
+ public void remove(String key)
+ {
+ }
+}
\ No newline at end of file
Added: trunk/mod_cluster/src/tomcat/org/jboss/logging/NullNDCProvider.java
===================================================================
--- trunk/mod_cluster/src/tomcat/org/jboss/logging/NullNDCProvider.java (rev 0)
+++ trunk/mod_cluster/src/tomcat/org/jboss/logging/NullNDCProvider.java 2008-10-13 12:08:37 UTC (rev 1953)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.logging;
+
+import java.util.Stack;
+
+/**
+ * An NDC provider which does nothing.
+ *
+ * @author Jason T. Greene
+ */
+public class NullNDCProvider implements NDCProvider
+{
+ public void clear()
+ {
+ }
+
+ public Stack cloneStack()
+ {
+ return null;
+ }
+
+ public String get()
+ {
+ return null;
+ }
+
+ public int getDepth()
+ {
+ return 0;
+ }
+
+ public void inherit(Stack stack)
+ {
+ }
+
+ public String peek()
+ {
+ return null;
+ }
+
+ public String pop()
+ {
+ return null;
+ }
+
+ public void push(String message)
+ {
+ }
+
+ public void remove()
+ {
+ }
+
+ public void setMaxDepth(int maxDepth)
+ {
+ }
+}
Added: trunk/mod_cluster/src/tomcat/org/jboss/logging/jdk/JDK14LoggerPlugin.java
===================================================================
--- trunk/mod_cluster/src/tomcat/org/jboss/logging/jdk/JDK14LoggerPlugin.java (rev 0)
+++ trunk/mod_cluster/src/tomcat/org/jboss/logging/jdk/JDK14LoggerPlugin.java 2008-10-13 12:08:37 UTC (rev 1953)
@@ -0,0 +1,154 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.logging.jdk;
+
+import java.util.logging.Logger;
+import java.util.logging.Level;
+
+import org.jboss.logging.LoggerPlugin;
+import org.jboss.logging.MDCProvider;
+import org.jboss.logging.MDCSupport;
+import org.jboss.logging.NDCProvider;
+import org.jboss.logging.NDCSupport;
+
+/** An example LoggerPlugin which uses the JDK java.util.logging framework.
+ *
+ * @author Scott.Stark(a)jboss.org
+ * @version $Revison:$
+ */
+public class JDK14LoggerPlugin implements LoggerPlugin, MDCSupport, NDCSupport
+{
+ private Logger log;
+
+ public void init(String name)
+ {
+ log = Logger.getLogger(name);
+ }
+
+ public boolean isTraceEnabled()
+ {
+ return log.isLoggable(Level.FINER);
+ }
+
+ public void trace(Object message)
+ {
+ log(Level.FINER, String.valueOf(message), null);
+ }
+
+ public void trace(Object message, Throwable t)
+ {
+ log(Level.FINER, String.valueOf(message), t);
+ }
+
+ public boolean isDebugEnabled()
+ {
+ return log.isLoggable(Level.FINE);
+ }
+
+ public void debug(Object message)
+ {
+ log(Level.FINE, String.valueOf(message), null);
+ }
+
+ public void debug(Object message, Throwable t)
+ {
+ log(Level.FINE, String.valueOf(message), t);
+ }
+
+ public boolean isInfoEnabled()
+ {
+ return log.isLoggable(Level.INFO);
+ }
+
+ public void info(Object message)
+ {
+ log(Level.INFO, String.valueOf(message), null);
+ }
+
+ public void info(Object message, Throwable t)
+ {
+ log(Level.INFO, String.valueOf(message), t);
+ }
+
+ public void warn(Object message)
+ {
+ log(Level.WARNING, String.valueOf(message), null);
+ }
+
+ public void warn(Object message, Throwable t)
+ {
+ log(Level.WARNING, String.valueOf(message), t);
+ }
+
+ public void error(Object message)
+ {
+ log(Level.SEVERE, String.valueOf(message), null);
+ }
+
+ public void error(Object message, Throwable t)
+ {
+ log(Level.SEVERE, String.valueOf(message), t);
+ }
+
+ public void fatal(Object message)
+ {
+ log(Level.SEVERE, String.valueOf(message), null);
+ }
+
+ public void fatal(Object message, Throwable t)
+ {
+ log(Level.SEVERE, String.valueOf(message), t);
+ }
+
+ // From commons-logging
+ private void log(Level level, String msg, Throwable ex) {
+ if (log.isLoggable(level)) {
+ // Get the stack trace.
+ Throwable dummyException = new Throwable();
+ StackTraceElement locations[] = dummyException.getStackTrace();
+ // Caller will be the third element
+ String cname = "unknown";
+ String method = "unknown";
+ if (locations != null && locations.length > 3) {
+ StackTraceElement caller = locations[3];
+ cname = caller.getClassName();
+ method = caller.getMethodName();
+ }
+ if (ex == null) {
+ log.logp(level, cname, method, msg);
+ } else {
+ log.logp(level, cname, method, msg, ex);
+ }
+ }
+ }
+
+ public NDCProvider getNDCProvider()
+ {
+ return new JDKNDCProvider();
+ }
+
+ public MDCProvider getMDCProvider()
+ {
+ return new JDKMDCProvider();
+ }
+}
Added: trunk/mod_cluster/src/tomcat/org/jboss/logging/jdk/JDKMDCProvider.java
===================================================================
--- trunk/mod_cluster/src/tomcat/org/jboss/logging/jdk/JDKMDCProvider.java (rev 0)
+++ trunk/mod_cluster/src/tomcat/org/jboss/logging/jdk/JDKMDCProvider.java 2008-10-13 12:08:37 UTC (rev 1953)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.logging.jdk;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.logging.MDCProvider;
+
+/**
+ * MDC implementation for JDK logging.
+ *
+ * @author Jason T. Greene
+ */
+public class JDKMDCProvider implements MDCProvider
+{
+ private ThreadLocal<Map<String, Object>> map = new ThreadLocal<Map<String, Object>>();
+
+ public Object get(String key)
+ {
+ return map.get() == null ? null : map.get().get(key);
+ }
+
+ public Map<String, Object> getMap()
+ {
+ return map.get();
+ }
+
+ public void put(String key, Object value)
+ {
+ Map<String, Object> map = this.map.get();
+ if (map == null)
+ {
+ map = new HashMap<String, Object>();
+ this.map.set(map);
+ }
+
+ map.put(key, value);
+ }
+
+ public void remove(String key)
+ {
+ Map<String, Object> map = this.map.get();
+ if (map == null)
+ return;
+
+ map.remove(key);
+ }
+}
\ No newline at end of file
Added: trunk/mod_cluster/src/tomcat/org/jboss/logging/jdk/JDKNDCProvider.java
===================================================================
--- trunk/mod_cluster/src/tomcat/org/jboss/logging/jdk/JDKNDCProvider.java (rev 0)
+++ trunk/mod_cluster/src/tomcat/org/jboss/logging/jdk/JDKNDCProvider.java 2008-10-13 12:08:37 UTC (rev 1953)
@@ -0,0 +1,149 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.logging.jdk;
+
+import java.util.ArrayList;
+import java.util.EmptyStackException;
+import java.util.Stack;
+
+import org.jboss.logging.NDCProvider;
+
+/**
+ * NDC implementation for JDK logging
+ *
+ * @author Jason T. Greene
+ */
+public class JDKNDCProvider implements NDCProvider
+{
+ private class ArrayStack<E> extends ArrayList<E>
+ {
+ private static final long serialVersionUID = -8520038422243642840L;
+
+ public E pop()
+ {
+ int size = size();
+ if (size == 0)
+ throw new EmptyStackException();
+
+ return remove(size - 1);
+ }
+
+ public E peek()
+ {
+ int size = size();
+ if (size == 0)
+ throw new EmptyStackException();
+
+ return get(size - 1);
+ }
+
+ public void push(E val)
+ {
+ add(val);
+ }
+
+ public void setSize(int newSize)
+ {
+ int size = size();
+ if (newSize >= size || newSize < 0)
+ return;
+
+ removeRange(newSize, size);
+ }
+ }
+
+ private class Entry
+ {
+ private String merged;
+ private String current;
+
+ public Entry(String current)
+ {
+ this.merged = current;
+ this.current = current;
+ }
+
+ public Entry(Entry parent, String current)
+ {
+ this.merged = parent.merged + ' ' + current;
+ this.current = current;
+ }
+ }
+
+ private ThreadLocal<ArrayStack<Entry>> stack = new ThreadLocal<ArrayStack<Entry>>();
+
+ public void clear()
+ {
+ ArrayStack<Entry> stack = this.stack.get();
+ if (stack != null)
+ stack.clear();
+ }
+
+ public String get()
+ {
+ ArrayStack<Entry> stack = this.stack.get();
+
+ return stack == null || stack.isEmpty() ? null : stack.peek().merged;
+ }
+
+ public int getDepth()
+ {
+ ArrayStack<Entry> stack = this.stack.get();
+
+ return stack == null ? 0 : stack.size();
+ }
+
+ public String peek()
+ {
+ ArrayStack<Entry> stack = this.stack.get();
+
+ return stack == null || stack.isEmpty() ? "" : stack.peek().current;
+ }
+
+ public String pop()
+ {
+ ArrayStack<Entry> stack = this.stack.get();
+
+ return stack == null || stack.isEmpty() ? "" : stack.pop().current;
+ }
+
+ public void push(String message)
+ {
+ ArrayStack<Entry> stack = this.stack.get();
+
+ if (stack == null)
+ {
+ stack = new ArrayStack<Entry>();
+ this.stack.set(stack);
+ }
+
+ stack.push(stack.isEmpty() ? new Entry(message) : new Entry(stack.peek(), message));
+ }
+
+ public void setMaxDepth(int maxDepth)
+ {
+ ArrayStack<Entry> stack = this.stack.get();
+
+ if (stack != null)
+ stack.setSize(maxDepth);
+ }
+}
16 years, 3 months
JBoss Native SVN: r1952 - trunk/build/unix.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2008-10-13 03:41:25 -0400 (Mon, 13 Oct 2008)
New Revision: 1952
Modified:
trunk/build/unix/buildsrc.jboss-httpd.sh
trunk/build/unix/package.list
Log:
Add dist/dev as backup URL for ASF httpd location
Modified: trunk/build/unix/buildsrc.jboss-httpd.sh
===================================================================
--- trunk/build/unix/buildsrc.jboss-httpd.sh 2008-10-12 18:14:30 UTC (rev 1951)
+++ trunk/build/unix/buildsrc.jboss-httpd.sh 2008-10-13 07:41:25 UTC (rev 1952)
@@ -45,10 +45,12 @@
# here we use a released tarball
if $BUILD_WIN ; then
URL=http://archive.apache.org/dist/httpd/httpd-${native_tag}-win32-src.zip
+ URLDEV=http://httpd.apache.org/dev/dist/httpd-${native_tag}-win32-src.zip
else
URL=http://archive.apache.org/dist/httpd/httpd-${native_tag}.tar.gz
+ URLDEV=http://httpd.apache.org/dev/dist/httpd-${native_tag}.tar.gz
fi
- util/ckeckdownload.sh $build_cache_dir $package_src_dir $build_top httpd-${native_tag} $URL NONE
+ util/ckeckdownload.sh $build_cache_dir $package_src_dir $build_top httpd-${native_tag} $URL $URLDEV
fi
dirsources=`ls ${native_dist}/srclib/ | grep httpd-`
Modified: trunk/build/unix/package.list
===================================================================
--- trunk/build/unix/package.list 2008-10-12 18:14:30 UTC (rev 1951)
+++ trunk/build/unix/package.list 2008-10-13 07:41:25 UTC (rev 1952)
@@ -14,5 +14,6 @@
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.8|api:v:1.2.1|ssl:v:0.9.8e|zlib:v:1.2.3
+jboss-httpd|2.2.10|2.2.10|api:v:1.2.1|ssl:v:0.9.8i|zlib:v:1.2.3
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
rhel-httpd|2.2.8-1.el5s2|httpd-2_2_8-1_el5s2|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|cluster:t:trunk
16 years, 3 months
JBoss Native SVN: r1951 - in trunk/httpd/httpd-2.2/srclib: apr-util and 1 other directory.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2008-10-12 14:14:30 -0400 (Sun, 12 Oct 2008)
New Revision: 1951
Modified:
trunk/httpd/httpd-2.2/srclib/apr-util/NMAKEapu
trunk/httpd/httpd-2.2/srclib/apr-util/NMAKEmakefile
trunk/httpd/httpd-2.2/srclib/apr/NMAKEmakefile
Log:
More httpd 2.2.9+ build patches
Modified: trunk/httpd/httpd-2.2/srclib/apr/NMAKEmakefile
===================================================================
--- trunk/httpd/httpd-2.2/srclib/apr/NMAKEmakefile 2008-10-12 15:21:29 UTC (rev 1950)
+++ trunk/httpd/httpd-2.2/srclib/apr/NMAKEmakefile 2008-10-12 18:14:30 UTC (rev 1951)
@@ -112,6 +112,11 @@
$(WORKDIR)\groupinfo.obj \
$(WORKDIR)\userinfo.obj
+!IF EXIST($(SRCDIR)\file_io\win32\buffer.c)
+OBJECTS = $(OBJECTS) \
+ $(WORKDIR)\buffer.obj
+!ENDIF
+
HEADERS = $(SRCDIR)\include\apr.h
!IF "$(TARGET)" == "DLL"
Modified: trunk/httpd/httpd-2.2/srclib/apr-util/NMAKEapu
===================================================================
--- trunk/httpd/httpd-2.2/srclib/apr-util/NMAKEapu 2008-10-12 15:21:29 UTC (rev 1950)
+++ trunk/httpd/httpd-2.2/srclib/apr-util/NMAKEapu 2008-10-12 18:14:30 UTC (rev 1951)
@@ -109,9 +109,6 @@
$(WORKDIR)\sdbm_pair.obj \
$(WORKDIR)\apr_base64.obj \
$(WORKDIR)\apr_hooks.obj \
- $(WORKDIR)\apr_ldap_init.obj \
- $(WORKDIR)\apr_ldap_url.obj \
- $(WORKDIR)\apr_ldap_option.obj \
$(WORKDIR)\apr_date.obj \
$(WORKDIR)\apr_queue.obj \
$(WORKDIR)\apr_reslist.obj \
@@ -130,15 +127,28 @@
OBJECTS = $(OBJECTS) \
$(WORKDIR)\apu_dso.obj \
$(WORKDIR)\apr_thread_pool.obj \
- $(WORKDIR)\apr_memcache.obj \
+ $(WORKDIR)\apr_memcache.obj
+
!ENDIF
!IF EXIST($(SRCDIR)\LDAP\apr_ldap_stub.c)
+OBJECTS = $(OBJECTS) \
+ $(WORKDIR)\apr_ldap_stub.obj \
+ $(WORKDIR)\apr_ldap_url.obj
+
!IF "$(TARGET)" == "LIB"
OBJECTS = $(OBJECTS) \
- $(WORKDIR)\apr_ldap_rebind.obj \
- $(WORKDIR)\apr_ldap_stub.obj
+ $(WORKDIR)\apr_ldap_init.obj \
+ $(WORKDIR)\apr_ldap_option.obj \
+ $(WORKDIR)\apr_ldap_rebind.obj
+
!ENDIF
+!ELSE
+OBJECTS = $(OBJECTS) \
+ $(WORKDIR)\apr_ldap_init.obj \
+ $(WORKDIR)\apr_ldap_option.obj \
+ $(WORKDIR)\apr_ldap_url.obj
+
!ENDIF
HEADERS = \
Modified: trunk/httpd/httpd-2.2/srclib/apr-util/NMAKEmakefile
===================================================================
--- trunk/httpd/httpd-2.2/srclib/apr-util/NMAKEmakefile 2008-10-12 15:21:29 UTC (rev 1950)
+++ trunk/httpd/httpd-2.2/srclib/apr-util/NMAKEmakefile 2008-10-12 18:14:30 UTC (rev 1951)
@@ -22,7 +22,12 @@
# ====================================================================
#
+!IF !DEFINED(APR_DECLARE_STATIC) || "$(APR_DECLARE_STATIC)" == ""
TARGET=DLL
+!ELSE
+TARGET=LIB
+!ENDIF
+
!IF !DEFINED(SRCDIR) || "$(SRCDIR)" == ""
SRCDIR = .
!ENDIF
16 years, 3 months
JBoss Native SVN: r1950 - trunk/httpd/httpd-2.2/srclib/apr-util.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2008-10-12 11:21:29 -0400 (Sun, 12 Oct 2008)
New Revision: 1950
Modified:
trunk/httpd/httpd-2.2/srclib/apr-util/NMAKEapuldap
Log:
Use libaprutil.rc as rc template
Modified: trunk/httpd/httpd-2.2/srclib/apr-util/NMAKEapuldap
===================================================================
--- trunk/httpd/httpd-2.2/srclib/apr-util/NMAKEapuldap 2008-10-12 15:15:59 UTC (rev 1949)
+++ trunk/httpd/httpd-2.2/srclib/apr-util/NMAKEapuldap 2008-10-12 15:21:29 UTC (rev 1950)
@@ -84,8 +84,8 @@
$(OBJECTS): $(SRCDIR)\include\*.h $(SRCDIR)\include\private\*.h
!IF "$(TARGET)" == "DLL"
-$(BUILDRES): $(PROJECT).rc $(HEADERS)
- $(RC) $(RCFLAGS) /i "$(WITH_APR)\include" /i "$(SRCDIR)\include" /d "APU_VERSION_ONLY" /d DLL_NAME="$(PROJECT)" /fo $(BUILDRES) $(PROJECT).rc
+$(BUILDRES): libaprutil.rc $(HEADERS)
+ $(RC) $(RCFLAGS) /i "$(WITH_APR)\include" /i "$(SRCDIR)\include" /d "APU_VERSION_ONLY" /d DLL_NAME="$(PROJECT)" /fo $(BUILDRES) libaprutil.rc
$(BUILDBIN): $(WORKDIR) $(HEADERS) $(OBJECTS) $(BUILDRES)
$(LINK) $(LFLAGS) $(OBJECTS) $(BUILDRES) $(LIBS) $(LDIRS) /pdb:$(BUILDPDB) /out:$(BUILDBIN)
IF EXIST $(BUILDMFT) \
16 years, 3 months
JBoss Native SVN: r1949 - trunk/httpd/httpd-2.2/srclib/apr-util.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2008-10-12 11:15:59 -0400 (Sun, 12 Oct 2008)
New Revision: 1949
Added:
trunk/httpd/httpd-2.2/srclib/apr-util/NMAKEapu
trunk/httpd/httpd-2.2/srclib/apr-util/NMAKEapuldap
Modified:
trunk/httpd/httpd-2.2/srclib/apr-util/NMAKEmakefile
Log:
Apr 1.3+ has modules for ldap
Added: trunk/httpd/httpd-2.2/srclib/apr-util/NMAKEapu
===================================================================
--- trunk/httpd/httpd-2.2/srclib/apr-util/NMAKEapu (rev 0)
+++ trunk/httpd/httpd-2.2/srclib/apr-util/NMAKEapu 2008-10-12 15:15:59 UTC (rev 1949)
@@ -0,0 +1,243 @@
+# Copyright 2001-2008 The Apache Software Foundation or its licensors, as
+# applicable.
+#
+# 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,
+# 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.
+#
+# ====================================================================
+#
+# NMAKEmakefile Master apr-util makefile.
+# Usage:
+# DLL=1 Build DLL version
+# DEBUG=1 Build DEBUG version of APR
+#
+# Originally contributed by Mladen Turk <mturk redhat.com>
+#
+# ====================================================================
+#
+
+
+!IF !DEFINED(APR_DECLARE_STATIC) || "$(APR_DECLARE_STATIC)" == ""
+TARGET=DLL
+CFLAGS = -DAPR_DECLARE_EXPORT -DAPU_DECLARE_EXPORT $(CFLAGS)
+PROJECT = libaprutil-1
+APR_LIB = libapr-1.lib
+API_LIB = libapriconv-1.lib
+API_CFLAGS = -DAPI_DECLARE_EXPORT
+!ELSE
+TARGET=LIB
+CFLAGS = -DAPR_DECLARE_STATIC -DAPU_DECLARE_STATIC $(CFLAGS)
+PROJECT = aprutil-1
+APR_LIB = apr-1.lib
+API_LIB = apriconv-1.lib
+API_CFLAGS = -DAPI_DECLARE_STATIC
+!ENDIF
+
+!IFDEF WITH_GNU_ICONV
+API_LIB = libiconv-1.lib
+!ELSE
+CFLAGS = $(CFLAGS) $(API_CFLAGS)
+!ENDIF
+
+CFLAGS = $(CFLAGS) -DAPU_USE_SDBM -DVERSION=\"expat_1.95.2\"
+
+!IF !DEFINED(SRCDIR) || "$(SRCDIR)" == ""
+SRCDIR = .
+!ENDIF
+
+!include <..\..\NMAKEcommon.inc>
+!include <..\..\NMAKEhttpd.inc>
+
+!IFNDEF WITH_APR
+WITH_APR=..\apr
+!ENDIF
+
+!IFDEF WITH_GNU_ICONV
+WITH_API=..\libiconv
+!ENDIF
+!IFNDEF WITH_API
+WITH_API=..\apr-iconv
+!ENDIF
+
+LDIRS = /libpath:"$(WITH_APR)\$(WORKDIR)" /libpath:"$(WITH_API)\$(WORKDIR)"
+
+!IF "$(TARGET)" == "DLL"
+LFLAGS = $(LFLAGS) user32.lib psapi.lib gdi32.lib shlwapi.lib wldap32.lib ole32.lib $(APR_LIB) $(API_LIB)
+!ENDIF
+
+INCLUDES = -I$(SRCDIR)\include -I$(SRCDIR)\include\private -I$(SRCDIR)\xml\expat\lib -I$(WITH_APR)\include -I$(WITH_API)\include
+PDBFLAGS = -Fo$(WORKDIR)\ -Fd$(WORKDIR)\$(PROJECT)-src
+OBJECTS = \
+ $(WORKDIR)\apr_brigade.obj \
+ $(WORKDIR)\apr_buckets.obj \
+ $(WORKDIR)\apr_buckets_alloc.obj \
+ $(WORKDIR)\apr_buckets_eos.obj \
+ $(WORKDIR)\apr_buckets_file.obj \
+ $(WORKDIR)\apr_buckets_flush.obj \
+ $(WORKDIR)\apr_buckets_heap.obj \
+ $(WORKDIR)\apr_buckets_mmap.obj \
+ $(WORKDIR)\apr_buckets_pipe.obj \
+ $(WORKDIR)\apr_buckets_pool.obj \
+ $(WORKDIR)\apr_buckets_refcount.obj \
+ $(WORKDIR)\apr_buckets_simple.obj \
+ $(WORKDIR)\apr_buckets_socket.obj \
+ $(WORKDIR)\apr_md4.obj \
+ $(WORKDIR)\apr_md5.obj \
+ $(WORKDIR)\apr_sha1.obj \
+ $(WORKDIR)\getuuid.obj \
+ $(WORKDIR)\uuid.obj \
+ $(WORKDIR)\apr_dbd.obj \
+ $(WORKDIR)\apr_dbd_pgsql.obj \
+ $(WORKDIR)\apr_dbd_sqlite2.obj \
+ $(WORKDIR)\apr_dbd_sqlite3.obj \
+ $(WORKDIR)\apr_dbm.obj \
+ $(WORKDIR)\apr_dbm_berkeleydb.obj \
+ $(WORKDIR)\apr_dbm_gdbm.obj \
+ $(WORKDIR)\apr_dbm_sdbm.obj \
+ $(WORKDIR)\sdbm.obj \
+ $(WORKDIR)\sdbm_hash.obj \
+ $(WORKDIR)\sdbm_lock.obj \
+ $(WORKDIR)\sdbm_pair.obj \
+ $(WORKDIR)\apr_base64.obj \
+ $(WORKDIR)\apr_hooks.obj \
+ $(WORKDIR)\apr_ldap_init.obj \
+ $(WORKDIR)\apr_ldap_url.obj \
+ $(WORKDIR)\apr_ldap_option.obj \
+ $(WORKDIR)\apr_date.obj \
+ $(WORKDIR)\apr_queue.obj \
+ $(WORKDIR)\apr_reslist.obj \
+ $(WORKDIR)\apr_rmm.obj \
+ $(WORKDIR)\apu_version.obj \
+ $(WORKDIR)\apr_strmatch.obj \
+ $(WORKDIR)\apr_uri.obj \
+ $(WORKDIR)\xlate.obj \
+ $(WORKDIR)\apr_xml.obj \
+ $(WORKDIR)\xmlparse.obj \
+ $(WORKDIR)\xmlrole.obj \
+ $(WORKDIR)\xmltok.obj
+
+# Include APU 1.3 sources
+!IF EXIST($(SRCDIR)\misc\apu_dso.c)
+OBJECTS = $(OBJECTS) \
+ $(WORKDIR)\apu_dso.obj \
+ $(WORKDIR)\apr_thread_pool.obj \
+ $(WORKDIR)\apr_memcache.obj \
+!ENDIF
+
+!IF EXIST($(SRCDIR)\LDAP\apr_ldap_stub.c)
+!IF "$(TARGET)" == "LIB"
+OBJECTS = $(OBJECTS) \
+ $(WORKDIR)\apr_ldap_rebind.obj \
+ $(WORKDIR)\apr_ldap_stub.obj
+!ENDIF
+!ENDIF
+
+HEADERS = \
+ $(SRCDIR)\include\apu.h \
+ $(SRCDIR)\include\apu_want.h \
+ $(SRCDIR)\include\apr_ldap.h \
+ $(SRCDIR)\include\private\apu_config.h \
+ $(SRCDIR)\include\private\apu_select_dbm.h \
+ $(SRCDIR)\xml\expat\lib\config.h \
+ $(SRCDIR)\xml\expat\lib\expat.h
+
+!IF "$(TARGET)" == "DLL"
+BUILDBIN = $(WORKDIR)\$(PROJECT).dll
+BUILDPDB = $(WORKDIR)\$(PROJECT).pdb
+BUILDRES = $(WORKDIR)\$(PROJECT).res
+BUILDMFT = $(BUILDBIN).manifest
+!ELSE
+BUILDBIN = $(WORKDIR)\$(PROJECT).lib
+!ENDIF
+
+all : $(BUILDINS) $(WORKDIR) $(HEADERS) $(BUILDBIN)
+
+$(WORKDIR) :
+ @$(MAKEWORKDIR)
+
+.SUFFIXES : .hw .h.in
+
+{$(SRCDIR)\include}.hw{$(SRCDIR)\include}.h:
+ @copy /Y $< $@ >NUL
+
+{$(SRCDIR)\xml\expat\lib}.h.in{$(SRCDIR)\xml\expat\lib}.h:
+ @copy /Y $< $@ >NUL
+
+{$(SRCDIR)\include\private}.hw{$(SRCDIR)\include\private}.h:
+ @copy /Y $< $@ >NUL
+
+$(SRCDIR)\xml\expat\lib\config.h :
+ @copy /Y $(SRCDIR)\xml\expat\lib\winconfig.h $@ >NUL
+
+{$(SRCDIR)\buckets}.c{$(WORKDIR)}.obj:
+ $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
+
+{$(SRCDIR)\crypto}.c{$(WORKDIR)}.obj:
+ $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
+
+{$(SRCDIR)\dbd}.c{$(WORKDIR)}.obj:
+ $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
+
+{$(SRCDIR)\dbm}.c{$(WORKDIR)}.obj:
+ $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
+
+{$(SRCDIR)\dbm\sdbm}.c{$(WORKDIR)}.obj:
+ $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
+
+{$(SRCDIR)\encoding}.c{$(WORKDIR)}.obj:
+ $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
+
+{$(SRCDIR)\hooks}.c{$(WORKDIR)}.obj:
+ $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
+
+{$(SRCDIR)\ldap}.c{$(WORKDIR)}.obj:
+ $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
+
+{$(SRCDIR)\misc}.c{$(WORKDIR)}.obj:
+ $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
+
+{$(SRCDIR)\memcache}.c{$(WORKDIR)}.obj:
+ $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
+
+{$(SRCDIR)\strmatch}.c{$(WORKDIR)}.obj:
+ $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
+
+{$(SRCDIR)\uri}.c{$(WORKDIR)}.obj:
+ $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
+
+{$(SRCDIR)\xlate}.c{$(WORKDIR)}.obj:
+ $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
+
+{$(SRCDIR)\xml}.c{$(WORKDIR)}.obj:
+ $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
+
+{$(SRCDIR)\xml\expat\lib}.c{$(WORKDIR)}.obj:
+ $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
+
+$(OBJECTS): $(SRCDIR)\include\*.h $(SRCDIR)\include\private\*.h
+
+!IF "$(TARGET)" == "DLL"
+$(BUILDRES): libaprutil.rc $(HEADERS)
+ $(RC) $(RCFLAGS) /i "$(WITH_APR)\include" /i "$(SRCDIR)\include" /d "APU_VERSION_ONLY" /fo $(BUILDRES) libaprutil.rc
+$(BUILDBIN): $(WORKDIR) $(HEADERS) $(OBJECTS) $(BUILDRES)
+ $(LINK) $(LFLAGS) $(OBJECTS) $(BUILDRES) $(LIBS) $(LDIRS) /pdb:$(BUILDPDB) /out:$(BUILDBIN)
+ IF EXIST $(BUILDMFT) \
+ mt -nologo -manifest $(BUILDMFT) -outputresource:$(BUILDBIN);2
+!ELSE
+$(BUILDBIN): $(WORKDIR) $(HEADERS) $(OBJECTS)
+ $(LINK) $(LFLAGS) $(OBJECTS) $(LDIRS) /out:$(BUILDBIN)
+!ENDIF
+
+clean:
+ @$(CLEANTARGET)
+
+install: $(BUILDINS) $(WORKDIR) $(BUILDBIN)
Added: trunk/httpd/httpd-2.2/srclib/apr-util/NMAKEapuldap
===================================================================
--- trunk/httpd/httpd-2.2/srclib/apr-util/NMAKEapuldap (rev 0)
+++ trunk/httpd/httpd-2.2/srclib/apr-util/NMAKEapuldap 2008-10-12 15:15:59 UTC (rev 1949)
@@ -0,0 +1,102 @@
+# Copyright 2001-2008 The Apache Software Foundation or its licensors, as
+# applicable.
+#
+# 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,
+# 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.
+#
+# ====================================================================
+#
+# NMAKEmakefile Master apr-util ldap module makefile.
+# Usage:
+# DLL=1 Build DLL version
+# DEBUG=1 Build DEBUG version of APR
+#
+# Originally contributed by Mladen Turk <mturk redhat.com>
+#
+# ====================================================================
+#
+
+
+!IF !DEFINED(APR_DECLARE_STATIC) || "$(APR_DECLARE_STATIC)" == ""
+TARGET=DLL
+CFLAGS = -DAPR_DECLARE_EXPORT -DAPU_DECLARE_EXPORT $(CFLAGS)
+PROJECT = apr_ldap-1
+APR_LIB = libapr-1.lib
+APU_LIB = libaprutil-1.lib
+!ENDIF
+
+!IF !DEFINED(SRCDIR) || "$(SRCDIR)" == ""
+SRCDIR = .
+!ENDIF
+
+!include <..\..\NMAKEcommon.inc>
+!include <..\..\NMAKEhttpd.inc>
+
+!IFNDEF WITH_APR
+WITH_APR=..\apr
+!ENDIF
+
+LDIRS = /libpath:"$(WITH_APR)\$(WORKDIR)" /libpath:"$(WORKDIR)"
+
+!IF "$(TARGET)" == "DLL"
+LFLAGS = $(LFLAGS) user32.lib psapi.lib gdi32.lib shlwapi.lib wldap32.lib ole32.lib $(APR_LIB) $(APU_LIB)
+!ENDIF
+
+INCLUDES = -I$(SRCDIR)\include -I$(SRCDIR)\include\private -I$(WITH_APR)\include
+PDBFLAGS = -Fo$(WORKDIR)\ -Fd$(WORKDIR)\$(PROJECT)-src
+OBJECTS = \
+ $(WORKDIR)\apr_ldap_init.obj \
+ $(WORKDIR)\apr_ldap_option.obj \
+ $(WORKDIR)\apr_ldap_rebind.obj
+
+HEADERS = \
+ $(SRCDIR)\include\apr_ldap.h \
+
+!IF "$(TARGET)" == "DLL"
+BUILDBIN = $(WORKDIR)\$(PROJECT).dll
+BUILDPDB = $(WORKDIR)\$(PROJECT).pdb
+BUILDRES = $(WORKDIR)\$(PROJECT).res
+BUILDMFT = $(BUILDBIN).manifest
+!ENDIF
+
+all : $(BUILDINS) $(WORKDIR) $(HEADERS) $(BUILDBIN)
+
+$(WORKDIR) :
+ @$(MAKEWORKDIR)
+
+.SUFFIXES : .hw .h.in
+
+{$(SRCDIR)\include}.hw{$(SRCDIR)\include}.h:
+ @copy /Y $< $@ >NUL
+
+{$(SRCDIR)\ldap}.c{$(WORKDIR)}.obj:
+ $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
+
+$(OBJECTS): $(SRCDIR)\include\*.h $(SRCDIR)\include\private\*.h
+
+!IF "$(TARGET)" == "DLL"
+$(BUILDRES): $(PROJECT).rc $(HEADERS)
+ $(RC) $(RCFLAGS) /i "$(WITH_APR)\include" /i "$(SRCDIR)\include" /d "APU_VERSION_ONLY" /d DLL_NAME="$(PROJECT)" /fo $(BUILDRES) $(PROJECT).rc
+$(BUILDBIN): $(WORKDIR) $(HEADERS) $(OBJECTS) $(BUILDRES)
+ $(LINK) $(LFLAGS) $(OBJECTS) $(BUILDRES) $(LIBS) $(LDIRS) /pdb:$(BUILDPDB) /out:$(BUILDBIN)
+ IF EXIST $(BUILDMFT) \
+ mt -nologo -manifest $(BUILDMFT) -outputresource:$(BUILDBIN);2
+!ENDIF
+
+clean:
+ @$(CLEANTARGET)
+
+!IF "$(TARGET)" == "DLL" && EXIST($(SRCDIR)\ldap\apr_ldap_stub.c)
+install: $(BUILDINS) $(WORKDIR) $(BUILDBIN)
+!ELSE
+install:
+!ENDIF
Modified: trunk/httpd/httpd-2.2/srclib/apr-util/NMAKEmakefile
===================================================================
--- trunk/httpd/httpd-2.2/srclib/apr-util/NMAKEmakefile 2008-10-12 14:09:22 UTC (rev 1948)
+++ trunk/httpd/httpd-2.2/srclib/apr-util/NMAKEmakefile 2008-10-12 15:15:59 UTC (rev 1949)
@@ -1,4 +1,4 @@
-# Copyright 2001-2007 The Apache Software Foundation or its licensors, as
+# Copyright 2001-2008 The Apache Software Foundation or its licensors, as
# applicable.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,41 +15,14 @@
#
# ====================================================================
#
-# NMAKEmakefile Master APR-UTIL makefile.
-# Usage:
-# DLL=1 Build DLL version
-# DEBUG=1 Build DEBUG version of APR
+# NMAKEmakefile Master apr-util makefile.
#
# Originally contributed by Mladen Turk <mturk redhat.com>
#
# ====================================================================
#
-
-!IF !DEFINED(APR_DECLARE_STATIC) || "$(APR_DECLARE_STATIC)" == ""
TARGET=DLL
-CFLAGS = -DAPR_DECLARE_EXPORT -DAPU_DECLARE_EXPORT $(CFLAGS)
-PROJECT = libaprutil-1
-APR_LIB = libapr-1.lib
-API_LIB = libapriconv-1.lib
-API_CFLAGS = -DAPI_DECLARE_EXPORT
-!ELSE
-TARGET=LIB
-CFLAGS = -DAPR_DECLARE_STATIC -DAPU_DECLARE_STATIC $(CFLAGS)
-PROJECT = aprutil-1
-APR_LIB = apr-1.lib
-API_LIB = apriconv-1.lib
-API_CFLAGS = -DAPI_DECLARE_STATIC
-!ENDIF
-
-!IFDEF WITH_GNU_ICONV
-API_LIB = libiconv-1.lib
-!ELSE
-CFLAGS = $(CFLAGS) $(API_CFLAGS)
-!ENDIF
-
-CFLAGS = $(CFLAGS) -DAPU_USE_SDBM -DVERSION=\"expat_1.95.2\"
-
!IF !DEFINED(SRCDIR) || "$(SRCDIR)" == ""
SRCDIR = .
!ENDIF
@@ -57,184 +30,17 @@
!include <..\..\NMAKEcommon.inc>
!include <..\..\NMAKEhttpd.inc>
-!IFNDEF WITH_APR
-WITH_APR=..\apr
-!ENDIF
+MODULES = \
+ $(SRCDIR)\NMAKEapu \
+ $(SRCDIR)\NMAKEapuldap
-!IFDEF WITH_GNU_ICONV
-WITH_API=..\libiconv
-!ENDIF
-!IFNDEF WITH_API
-WITH_API=..\apr-iconv
-!ENDIF
+$(MODULES):
+ @$(MAKE) -nologo -f $@ PREFIX=$(PREFIX) install
-LDIRS = /libpath:"$(WITH_APR)\$(WORKDIR)" /libpath:"$(WITH_API)\$(WORKDIR)"
-
-!IF "$(TARGET)" == "DLL"
-LFLAGS = $(LFLAGS) user32.lib psapi.lib gdi32.lib shlwapi.lib wldap32.lib ole32.lib $(APR_LIB) $(API_LIB)
-!ENDIF
-
-INCLUDES = -I$(SRCDIR)\include -I$(SRCDIR)\include\private -I$(SRCDIR)\xml\expat\lib -I$(WITH_APR)\include -I$(WITH_API)\include
-PDBFLAGS = -Fo$(WORKDIR)\ -Fd$(WORKDIR)\$(PROJECT)-src
-OBJECTS = \
- $(WORKDIR)\apr_brigade.obj \
- $(WORKDIR)\apr_buckets.obj \
- $(WORKDIR)\apr_buckets_alloc.obj \
- $(WORKDIR)\apr_buckets_eos.obj \
- $(WORKDIR)\apr_buckets_file.obj \
- $(WORKDIR)\apr_buckets_flush.obj \
- $(WORKDIR)\apr_buckets_heap.obj \
- $(WORKDIR)\apr_buckets_mmap.obj \
- $(WORKDIR)\apr_buckets_pipe.obj \
- $(WORKDIR)\apr_buckets_pool.obj \
- $(WORKDIR)\apr_buckets_refcount.obj \
- $(WORKDIR)\apr_buckets_simple.obj \
- $(WORKDIR)\apr_buckets_socket.obj \
- $(WORKDIR)\apr_md4.obj \
- $(WORKDIR)\apr_md5.obj \
- $(WORKDIR)\apr_sha1.obj \
- $(WORKDIR)\getuuid.obj \
- $(WORKDIR)\uuid.obj \
- $(WORKDIR)\apr_dbd.obj \
- $(WORKDIR)\apr_dbd_pgsql.obj \
- $(WORKDIR)\apr_dbd_sqlite2.obj \
- $(WORKDIR)\apr_dbd_sqlite3.obj \
- $(WORKDIR)\apr_dbm.obj \
- $(WORKDIR)\apr_dbm_berkeleydb.obj \
- $(WORKDIR)\apr_dbm_gdbm.obj \
- $(WORKDIR)\apr_dbm_sdbm.obj \
- $(WORKDIR)\sdbm.obj \
- $(WORKDIR)\sdbm_hash.obj \
- $(WORKDIR)\sdbm_lock.obj \
- $(WORKDIR)\sdbm_pair.obj \
- $(WORKDIR)\apr_base64.obj \
- $(WORKDIR)\apr_hooks.obj \
- $(WORKDIR)\apr_ldap_init.obj \
- $(WORKDIR)\apr_ldap_url.obj \
- $(WORKDIR)\apr_ldap_option.obj \
- $(WORKDIR)\apr_date.obj \
- $(WORKDIR)\apr_queue.obj \
- $(WORKDIR)\apr_reslist.obj \
- $(WORKDIR)\apr_rmm.obj \
- $(WORKDIR)\apu_version.obj \
- $(WORKDIR)\apr_strmatch.obj \
- $(WORKDIR)\apr_uri.obj \
- $(WORKDIR)\xlate.obj \
- $(WORKDIR)\apr_xml.obj \
- $(WORKDIR)\xmlparse.obj \
- $(WORKDIR)\xmlrole.obj \
- $(WORKDIR)\xmltok.obj
-
-# Include APU 1.3 sources
-!IF EXIST($(SRCDIR)\misc\apu_dso.c)
-OBJECTS = $(OBJECTS) \
- $(WORKDIR)\apu_dso.obj \
- $(WORKDIR)\apr_thread_pool.obj \
- $(WORKDIR)\apr_memcache.obj \
- $(WORKDIR)\apr_ldap_rebind.obj \
- $(WORKDIR)\apr_ldap_stub.obj
-!ENDIF
-
-HEADERS = \
- $(SRCDIR)\include\apu.h \
- $(SRCDIR)\include\apu_want.h \
- $(SRCDIR)\include\apr_ldap.h \
- $(SRCDIR)\include\private\apu_config.h \
- $(SRCDIR)\include\private\apu_select_dbm.h \
- $(SRCDIR)\xml\expat\lib\config.h \
- $(SRCDIR)\xml\expat\lib\expat.h
-
-!IF "$(TARGET)" == "DLL"
-BUILDBIN = $(WORKDIR)\$(PROJECT).dll
-BUILDPDB = $(WORKDIR)\$(PROJECT).pdb
-BUILDRES = $(WORKDIR)\$(PROJECT).res
-BUILDMFT = $(BUILDBIN).manifest
-!ELSE
-BUILDBIN = $(WORKDIR)\$(PROJECT).lib
-!ENDIF
-
-all : $(BUILDINS) $(WORKDIR) $(HEADERS) $(BUILDBIN)
-
-$(WORKDIR) :
+$(WORKDIR):
@$(MAKEWORKDIR)
-.SUFFIXES : .hw .h.in
-
-{$(SRCDIR)\include}.hw{$(SRCDIR)\include}.h:
- @copy /Y $< $@ >NUL
-
-{$(SRCDIR)\xml\expat\lib}.h.in{$(SRCDIR)\xml\expat\lib}.h:
- @copy /Y $< $@ >NUL
-
-{$(SRCDIR)\include\private}.hw{$(SRCDIR)\include\private}.h:
- @copy /Y $< $@ >NUL
-
-$(SRCDIR)\xml\expat\lib\config.h :
- @copy /Y $(SRCDIR)\xml\expat\lib\winconfig.h $@ >NUL
-
-{$(SRCDIR)\buckets}.c{$(WORKDIR)}.obj:
- $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
-
-{$(SRCDIR)\crypto}.c{$(WORKDIR)}.obj:
- $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
-
-{$(SRCDIR)\dbd}.c{$(WORKDIR)}.obj:
- $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
-
-{$(SRCDIR)\dbm}.c{$(WORKDIR)}.obj:
- $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
-
-{$(SRCDIR)\dbm\sdbm}.c{$(WORKDIR)}.obj:
- $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
-
-{$(SRCDIR)\encoding}.c{$(WORKDIR)}.obj:
- $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
-
-{$(SRCDIR)\hooks}.c{$(WORKDIR)}.obj:
- $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
-
-{$(SRCDIR)\ldap}.c{$(WORKDIR)}.obj:
- $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
-
-{$(SRCDIR)\misc}.c{$(WORKDIR)}.obj:
- $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
-
-{$(SRCDIR)\memcache}.c{$(WORKDIR)}.obj:
- $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
-
-{$(SRCDIR)\strmatch}.c{$(WORKDIR)}.obj:
- $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
-
-{$(SRCDIR)\uri}.c{$(WORKDIR)}.obj:
- $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
-
-{$(SRCDIR)\xlate}.c{$(WORKDIR)}.obj:
- $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
-
-{$(SRCDIR)\xml}.c{$(WORKDIR)}.obj:
- $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
-
-{$(SRCDIR)\xml\expat\lib}.c{$(WORKDIR)}.obj:
- $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
-
-$(OBJECTS): $(SRCDIR)\include\*.h $(SRCDIR)\include\private\*.h
-
-!IF "$(TARGET)" == "DLL"
-$(BUILDRES): libaprutil.rc $(HEADERS)
- $(RC) $(RCFLAGS) /i "$(WITH_APR)\include" /i "$(SRCDIR)\include" /d "APU_VERSION_ONLY" /fo $(BUILDRES) libaprutil.rc
-$(BUILDBIN): $(WORKDIR) $(HEADERS) $(OBJECTS) $(BUILDRES)
- $(LINK) $(LFLAGS) $(OBJECTS) $(BUILDRES) $(LIBS) $(LDIRS) /pdb:$(BUILDPDB) /out:$(BUILDBIN)
- IF EXIST $(BUILDMFT) \
- mt -nologo -manifest $(BUILDMFT) -outputresource:$(BUILDBIN);2
-!ELSE
-$(BUILDBIN): $(WORKDIR) $(HEADERS) $(OBJECTS)
- $(LINK) $(LFLAGS) $(OBJECTS) $(LDIRS) /out:$(BUILDBIN)
-!ENDIF
-
-clean:
- @$(CLEANTARGET)
-
-install: $(BUILDINS) $(WORKDIR) $(BUILDBIN)
+install: $(WORKDIR) $(MODULES)
@xcopy "$(SRCDIR)\include\*.h" "$(BUILDINC)" /Y /Q
@xcopy "$(WORKDIR)\*.lib" "$(BUILDLIB)" /Y /Q
@xcopy "$(WORKDIR)\*.dll" "$(BUILDOUT)" /Y /Q 2>NUL
16 years, 3 months
JBoss Native SVN: r1948 - trunk/httpd/httpd-2.2/srclib/iconv.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2008-10-12 10:09:22 -0400 (Sun, 12 Oct 2008)
New Revision: 1948
Modified:
trunk/httpd/httpd-2.2/srclib/iconv/NMAKEmakefile
Log:
Use correct test for GNU iconv presence
Modified: trunk/httpd/httpd-2.2/srclib/iconv/NMAKEmakefile
===================================================================
--- trunk/httpd/httpd-2.2/srclib/iconv/NMAKEmakefile 2008-10-12 14:00:49 UTC (rev 1947)
+++ trunk/httpd/httpd-2.2/srclib/iconv/NMAKEmakefile 2008-10-12 14:09:22 UTC (rev 1948)
@@ -112,7 +112,7 @@
clean:
@$(CLEANTARGET)
-!IF EXIST($(SRCDIR)\include\iconv.h)
+!IF EXIST($(SRCDIR)\include\iconv.h.in)
install: $(BUILDINS) $(WORKDIR) $(HEADERS) $(BUILDBIN)
@xcopy "$(SRCDIR)\include\iconv.h" "$(BUILDINC)" /Y /Q
@xcopy "$(WORKDIR)\*.lib" "$(BUILDLIB)" /Y /Q
16 years, 3 months
JBoss Native SVN: r1947 - in trunk/httpd/httpd-2.2: modules/cache and 4 other directories.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2008-10-12 10:00:49 -0400 (Sun, 12 Oct 2008)
New Revision: 1947
Modified:
trunk/httpd/httpd-2.2/modules/advertise/NMAKEadvertise
trunk/httpd/httpd-2.2/modules/cache/NMAKEmemcache
trunk/httpd/httpd-2.2/modules/mod_manager/NMAKEmanager
trunk/httpd/httpd-2.2/modules/mod_slotmem/NMAKEslotmem
trunk/httpd/httpd-2.2/modules/proxy/NMAKEmakefile
trunk/httpd/httpd-2.2/modules/proxy/NMAKEproxycluster
trunk/httpd/httpd-2.2/srclib/iconv/NMAKEmakefile
Log:
Allow building httpd 2.2.9+.
Modified: trunk/httpd/httpd-2.2/modules/advertise/NMAKEadvertise
===================================================================
--- trunk/httpd/httpd-2.2/modules/advertise/NMAKEadvertise 2008-10-12 11:16:44 UTC (rev 1946)
+++ trunk/httpd/httpd-2.2/modules/advertise/NMAKEadvertise 2008-10-12 14:00:49 UTC (rev 1947)
@@ -60,4 +60,9 @@
IF EXIST $(BUILDMFT) \
mt -nologo -manifest $(BUILDMFT) -outputresource:$(BUILDBIN);2
+!IF EXIST($(SRCDIR)\mod_advertise.c)
install: $(BUILDBIN)
+!ELSE
+install:
+ @echo Skipping $(PROJECT) build.
+!ENDIF
Modified: trunk/httpd/httpd-2.2/modules/cache/NMAKEmemcache
===================================================================
--- trunk/httpd/httpd-2.2/modules/cache/NMAKEmemcache 2008-10-12 11:16:44 UTC (rev 1946)
+++ trunk/httpd/httpd-2.2/modules/cache/NMAKEmemcache 2008-10-12 14:00:49 UTC (rev 1947)
@@ -46,6 +46,9 @@
RCFLAGS = $(RCFLAGS) /d BIN_NAME="$(PROJECT).so" /d LONG_NAME="mem_cache_module for Apache"
OBJECTS = \
+ $(WORKDIR)\cache_cache.obj \
+ $(WORKDIR)\cache_hash.obj \
+ $(WORKDIR)\cache_pqueue.obj \
$(WORKDIR)\mod_mem_cache.obj \
{$(SRCDIR)}.c{$(WORKDIR)}.obj:
Modified: trunk/httpd/httpd-2.2/modules/mod_manager/NMAKEmanager
===================================================================
--- trunk/httpd/httpd-2.2/modules/mod_manager/NMAKEmanager 2008-10-12 11:16:44 UTC (rev 1946)
+++ trunk/httpd/httpd-2.2/modules/mod_manager/NMAKEmanager 2008-10-12 14:00:49 UTC (rev 1947)
@@ -64,4 +64,9 @@
IF EXIST $(BUILDMFT) \
mt -nologo -manifest $(BUILDMFT) -outputresource:$(BUILDBIN);2
+!IF EXIST($(SRCDIR)\mod_manager.c)
install: $(BUILDBIN)
+!ELSE
+install:
+ @echo Skipping $(PROJECT) build.
+!ENDIF
Modified: trunk/httpd/httpd-2.2/modules/mod_slotmem/NMAKEslotmem
===================================================================
--- trunk/httpd/httpd-2.2/modules/mod_slotmem/NMAKEslotmem 2008-10-12 11:16:44 UTC (rev 1946)
+++ trunk/httpd/httpd-2.2/modules/mod_slotmem/NMAKEslotmem 2008-10-12 14:00:49 UTC (rev 1947)
@@ -61,4 +61,9 @@
IF EXIST $(BUILDMFT) \
mt -nologo -manifest $(BUILDMFT) -outputresource:$(BUILDBIN);2
+!IF EXIST($(SRCDIR)\mod_sharedmem.c)
install: $(BUILDBIN)
+!ELSE
+install:
+ @echo Skipping $(PROJECT) build.
+!ENDIF
Modified: trunk/httpd/httpd-2.2/modules/proxy/NMAKEmakefile
===================================================================
--- trunk/httpd/httpd-2.2/modules/proxy/NMAKEmakefile 2008-10-12 11:16:44 UTC (rev 1946)
+++ trunk/httpd/httpd-2.2/modules/proxy/NMAKEmakefile 2008-10-12 14:00:49 UTC (rev 1947)
@@ -36,13 +36,8 @@
$(SRCDIR)\NMAKEproxyhttp \
$(SRCDIR)\NMAKEproxyftp \
$(SRCDIR)\NMAKEproxyconnect \
- $(SRCDIR)\NMAKEproxybalancer
-
-!IF EXIST($(SRCDIR)\mod_proxy_cluster.c)
-MODULES = \
- $(MODULES) \
+ $(SRCDIR)\NMAKEproxybalancer \
$(SRCDIR)\NMAKEproxycluster
-!ENDIF
$(MODULES):
@$(MAKE) -nologo -f $@ PREFIX=$(PREFIX) install
Modified: trunk/httpd/httpd-2.2/modules/proxy/NMAKEproxycluster
===================================================================
--- trunk/httpd/httpd-2.2/modules/proxy/NMAKEproxycluster 2008-10-12 11:16:44 UTC (rev 1946)
+++ trunk/httpd/httpd-2.2/modules/proxy/NMAKEproxycluster 2008-10-12 14:00:49 UTC (rev 1947)
@@ -60,5 +60,10 @@
IF EXIST $(BUILDMFT) \
mt -nologo -manifest $(BUILDMFT) -outputresource:$(BUILDBIN);2
+!IF EXIST($(SRCDIR)\mod_proxy_cluster.c)
install: $(BUILDBIN)
@xcopy "$(WORKDIR)\$(PROJECT).lib" "$(BUILDLIB)" /Y /Q
+!ELSE
+install:
+ @echo Skipping $(PROJECT) build.
+!ENDIF
Modified: trunk/httpd/httpd-2.2/srclib/iconv/NMAKEmakefile
===================================================================
--- trunk/httpd/httpd-2.2/srclib/iconv/NMAKEmakefile 2008-10-12 11:16:44 UTC (rev 1946)
+++ trunk/httpd/httpd-2.2/srclib/iconv/NMAKEmakefile 2008-10-12 14:00:49 UTC (rev 1947)
@@ -112,7 +112,12 @@
clean:
@$(CLEANTARGET)
+!IF EXIST($(SRCDIR)\include\iconv.h)
install: $(BUILDINS) $(WORKDIR) $(HEADERS) $(BUILDBIN)
@xcopy "$(SRCDIR)\include\iconv.h" "$(BUILDINC)" /Y /Q
@xcopy "$(WORKDIR)\*.lib" "$(BUILDLIB)" /Y /Q
@xcopy "$(WORKDIR)\*.dll" "$(BUILDOUT)" /Y /Q 2>NUL
+!ELSE
+install:
+ @echo Skipping $(PROJECT) build.
+!ENDIF
16 years, 3 months
JBoss Native SVN: r1946 - in trunk/httpd/httpd-2.2: srclib/apr-util and 1 other directories.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2008-10-12 07:16:44 -0400 (Sun, 12 Oct 2008)
New Revision: 1946
Modified:
trunk/httpd/httpd-2.2/modules/proxy/NMAKEmakefile
trunk/httpd/httpd-2.2/srclib/apr-util/NMAKEmakefile
trunk/httpd/httpd-2.2/support/win32/NMAKEapachemonitor
Log:
Allow building httpd 2.2.9+
Modified: trunk/httpd/httpd-2.2/modules/proxy/NMAKEmakefile
===================================================================
--- trunk/httpd/httpd-2.2/modules/proxy/NMAKEmakefile 2008-10-09 14:24:37 UTC (rev 1945)
+++ trunk/httpd/httpd-2.2/modules/proxy/NMAKEmakefile 2008-10-12 11:16:44 UTC (rev 1946)
@@ -36,8 +36,13 @@
$(SRCDIR)\NMAKEproxyhttp \
$(SRCDIR)\NMAKEproxyftp \
$(SRCDIR)\NMAKEproxyconnect \
- $(SRCDIR)\NMAKEproxybalancer \
+ $(SRCDIR)\NMAKEproxybalancer
+
+!IF EXIST($(SRCDIR)\mod_proxy_cluster.c)
+MODULES = \
+ $(MODULES) \
$(SRCDIR)\NMAKEproxycluster
+!ENDIF
$(MODULES):
@$(MAKE) -nologo -f $@ PREFIX=$(PREFIX) install
Modified: trunk/httpd/httpd-2.2/srclib/apr-util/NMAKEmakefile
===================================================================
--- trunk/httpd/httpd-2.2/srclib/apr-util/NMAKEmakefile 2008-10-09 14:24:37 UTC (rev 1945)
+++ trunk/httpd/httpd-2.2/srclib/apr-util/NMAKEmakefile 2008-10-12 11:16:44 UTC (rev 1946)
@@ -125,6 +125,16 @@
$(WORKDIR)\xmlrole.obj \
$(WORKDIR)\xmltok.obj
+# Include APU 1.3 sources
+!IF EXIST($(SRCDIR)\misc\apu_dso.c)
+OBJECTS = $(OBJECTS) \
+ $(WORKDIR)\apu_dso.obj \
+ $(WORKDIR)\apr_thread_pool.obj \
+ $(WORKDIR)\apr_memcache.obj \
+ $(WORKDIR)\apr_ldap_rebind.obj \
+ $(WORKDIR)\apr_ldap_stub.obj
+!ENDIF
+
HEADERS = \
$(SRCDIR)\include\apu.h \
$(SRCDIR)\include\apu_want.h \
@@ -189,6 +199,9 @@
{$(SRCDIR)\misc}.c{$(WORKDIR)}.obj:
$(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
+{$(SRCDIR)\memcache}.c{$(WORKDIR)}.obj:
+ $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
+
{$(SRCDIR)\strmatch}.c{$(WORKDIR)}.obj:
$(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
Modified: trunk/httpd/httpd-2.2/support/win32/NMAKEapachemonitor
===================================================================
--- trunk/httpd/httpd-2.2/support/win32/NMAKEapachemonitor 2008-10-09 14:24:37 UTC (rev 1945)
+++ trunk/httpd/httpd-2.2/support/win32/NMAKEapachemonitor 2008-10-12 11:16:44 UTC (rev 1946)
@@ -33,7 +33,7 @@
!include <..\..\NMAKEhttpd.inc>
LDIRS = /libpath:"$(BUILDLIB)"
-LFLAGS = $(LFLAGS) user32.lib psapi.lib gdi32.lib shlwapi.lib ole32.lib comctl32.lib comdlg32.lib advapi32.lib shell32.lib $(APR) $(APU) $(API)
+LFLAGS = $(LFLAGS) user32.lib psapi.lib gdi32.lib shlwapi.lib ole32.lib comctl32.lib comdlg32.lib advapi32.lib shell32.lib wtsapi32.lib $(APR) $(APU) $(API)
CFLAGS = $(CFLAGS) -DAPR_DECLARE_STATIC -DAPU_DECLARE_STATIC -DSTRICT
INCLUDES = -I$(SRCDIR) -I$(BUILDINC)
16 years, 3 months
JBoss Native SVN: r1945 - trunk/mod_cluster/test/java.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-10-09 10:24:37 -0400 (Thu, 09 Oct 2008)
New Revision: 1945
Modified:
trunk/mod_cluster/test/java/build.xml
Log:
Arrange the location of the war file.
Modified: trunk/mod_cluster/test/java/build.xml
===================================================================
--- trunk/mod_cluster/test/java/build.xml 2008-10-09 14:21:33 UTC (rev 1944)
+++ trunk/mod_cluster/test/java/build.xml 2008-10-09 14:24:37 UTC (rev 1945)
@@ -80,6 +80,9 @@
<ant dir="Clients/JBWEB-117/" target="build">
</ant>
+ <!-- Copy the class file in the ouput directory -->
+ <copy file="Clients/JBWEB-117/JBWEB-117.war" todir="${test.classes}"/>
+
</target>
<target name="all" depends="compile">
16 years, 3 months