Author: jbonofre Date: Tue Nov 15 13:18:22 2011 New Revision: 1202172 URL: http://svn.apache.org/viewvc?rev=1202172&view=rev Log: Add assembly distribution files
Added: incubator/kalumet/trunk/assembly/src/main/distribution/agent/bin/ incubator/kalumet/trunk/assembly/src/main/distribution/agent/bin/agent (with props) incubator/kalumet/trunk/assembly/src/main/distribution/agent/bin/agent.bat incubator/kalumet/trunk/assembly/src/main/distribution/agent/conf/ incubator/kalumet/trunk/assembly/src/main/distribution/agent/conf/agent.conf incubator/kalumet/trunk/assembly/src/main/distribution/agent/conf/log4j.xml incubator/kalumet/trunk/assembly/src/main/distribution/agent/conf/templates/ incubator/kalumet/trunk/assembly/src/main/distribution/agent/conf/templates/notifier.html incubator/kalumet/trunk/assembly/src/main/distribution/agent/conf/templates/publisher.xsl Added: incubator/kalumet/trunk/assembly/src/main/distribution/agent/bin/agent URL: http://svn.apache.org/viewvc/incubator/kalumet/trunk/assembly/src/main/distribution/agent/bin/agent?rev=1202172&view=auto ============================================================================== --- incubator/kalumet/trunk/assembly/src/main/distribution/agent/bin/agent (added) +++ incubator/kalumet/trunk/assembly/src/main/distribution/agent/bin/agent Tue Nov 15 13:18:22 2011 @@ -0,0 +1,168 @@ +#!/bin/sh +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# get the Kalumet agent basedir +DIRNAME=`dirname $0` +PROGNAME=`basename $0` + +# define java heap memory configuration +if [ "x$JAVA_MIN_MEN" = "x" ]; then + JAVA_MIN_MEM=64m + export JAVA_MIN_MEM +fi + +if [ "x$JAVA_MAX_MEM" = "x" ]; then + JAVA_MAX_MEM=128m + export JAVA_MAX_MEM +fi + +KALUMET_AGENT_HOME=`cd $DIRNAME/..; pwd` +cd $KALUMET_AGENT_HOME + +# load rc file +if [ -f $KALUMET_AGENT_HOME/conf/agent.rc ] ; then + . $KALUMET_AGENT_HOME/conf/agent.rc +fi + +# detect OS +cygwin=false; +darwin=false; +aix=false; +os400=false; +case "`uname`" in + CYGWIN*) + cygwin=true + ;; + Darwin*) + darwin=true + ;; + AIX*) + aix=true + ;; + OS400) + os400=true + ;; +esac +# define AIX specific environment variables +if $aix; then + export LDR_CNTRL=MAXDATA=0xB0000000@DSA + export IBM_JAVA_HEAPDUMP_TEXT=true +fi + +# define the file descriptors limit +# use the maximum available, or set MAX_FD != -1 to use that +if [ "x$MAX_FD" = "x" ]; then + MAX_FD="maximum" +fi +# increase the maximum file descriptors if we can +if [ "$os400" = "false" ] && [ "$cygwin" = "false" ]; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ]; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ]; then + # use the system max + MAX_FD="$MAX_FD_LIMIT" + fi + + ulimit -n $MAX_FD + if [ $? -ne 0 ]; then + echo "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + echo "Could not query system maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# support for loading native libraries +LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:$KALUMET_AGENT_HOME/lib" + +# for cygwin, set PATH from LD_LIBRARY_PATH +if $cygwin; then + LD_LIBRARY_PATH=`cygpath --path --windows "$LD_LIBRARY_PATH"` + PATH="$PATH;$LD_LIBRARY_PATH" + export PATH +fi +export LD_LIBRARY_PATH + +# setup the Java Virtual Machine +if $cygwin; then + [ -n "$JAVA" ] && JAVA=`cygpath --unix "$JAVA"` + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi +if [ "x$JAVA" = "x" ]; then + if [ "x$JAVA_HOME" != "x" ]; then + if [ ! -d "$JAVA_HOME" ]; then + echo "JAVA_HOME is not valid: $JAVA_HOME" + exit 1 + fi + JAVA="$JAVA_HOME/bin/java" + else + echo "JAVA_HOME not set; results may vary" + JAVA="java" + fi +fi + +# detect JVM +echo "`$JAVA -version`" +if $JAVA -version 2>&1 | grep "IBM" ; then + JVM_VENDOR="IBM" +elif $os400; then + JVM_VENDOR="IBM" +else + JVM_VENDOR="SUN" +fi + +# setup default java options +DEFAULT_JAVA_OPTS="-Xms$JAVA_MIN_MEM -Xmx$JAVA_MAX_MEM -Dcom.sun.management.jmxremote" + +# set JVM vendor specific JVM flags +if [ "$JVM_VENDOR" = "SUN" ]; then + DEFAULT_JAVA_OPTS="-server $DEFAULT_JAVA_OPTS" +elif [ "$JVM_VENDOR" = "IBM" ]; then + if $os400; then + DEFAULT_JAVA_OPTS="$DEFAULT_JAVA_OPTS" + elif $aix; then + DEFAULT_JAVA_OPTS="-Xverify:none -Xlp $DEFAULT_JAVA_OPTS" + else + DEFAULT_JAVA_OPTS="-Xverify:none $DEFAULT_JAVA_OPTS" + fi +fi + +# define classworlds +CLASSPATH=$KALUMET_AGENT_HOME/lib/classworlds-1.1.jar +CLASSWORLDS_CONF=$KALUMET_AGENT_HOME/conf/agent.conf + +# for cygwin, switch paths to Windows format before running java +if $cygwin; then + KALUMET_AGENT_HOME=`cygpath --path --windows "$KALUMET_AGENT_HOME"` + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + CLASSWORLDS_CONF=`cygpath --path --windows "$CLASSWORLDS_CONF"` + CYGHOME=`cygpath --windows "$CYGHOME"` +fi + +if [ "x$JAVA_OPTS" = "x" ]; then + JAVA_OPTS="$DEFAULT_JAVA_OPTS" +fi + +# starting the JVM +exec $JAVA \ + $JAVA_OPTS \ + -classpath "$CLASSPATH" \ + -Dclassworlds.conf="$CLASSWORLDS_CONF" \ + -Dkalumet.agent.home="$KALUMET_AGENT_HOME" \ + org.codehaus.classworlds.Launcher \ + "$@" \ No newline at end of file Propchange: incubator/kalumet/trunk/assembly/src/main/distribution/agent/bin/agent ------------------------------------------------------------------------------ svn:executable = * Added: incubator/kalumet/trunk/assembly/src/main/distribution/agent/bin/agent.bat URL: http://svn.apache.org/viewvc/incubator/kalumet/trunk/assembly/src/main/distribution/agent/bin/agent.bat?rev=1202172&view=auto ============================================================================== --- incubator/kalumet/trunk/assembly/src/main/distribution/agent/bin/agent.bat (added) +++ incubator/kalumet/trunk/assembly/src/main/distribution/agent/bin/agent.bat Tue Nov 15 13:18:22 2011 @@ -0,0 +1,61 @@ +@echo off +rem +rem +rem Licensed to the Apache Software Foundation (ASF) under one or more +rem contributor license agreements. See the NOTICE file distributed with +rem this work for additional information regarding copyright ownership. +rem The ASF licenses this file to You under the Apache License, Version 2.0 +rem (the "License"); you may not use this file except in compliance with +rem the License. You may obtain a copy of the License at +rem +rem http://www.apache.org/licenses/LICENSE-2.0 +rem +rem Unless required by applicable law or agreed to in writing, software +rem distributed under the License is distributed on an "AS IS" BASIS, +rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +rem See the License for the specific language governing permissions and +rem limitations under the License. +rem + +if not "%ECHO%" == "" echo %ECHO% + +setlocal +set DIRNAME=%~dp0% +set PROGNAME=%~nx0% + +set KALUMET_AGENT_HOME=%DIRNAME%.. +cd %KALUMET_AGENT_HOME% + +if "%JAVA_MIN_MEM%" == "" set JAVA_MIN_MEM=64m + +if "%JAVA_MAX_MEM%" == "" set JAVA_MAX_MEM=128m + +set DEFAULT_JAVA_OPTS=-server -Xms%JAVA_MIN_MEM% -Xmx%JAVA_MAX_MEM% -Dcom.sun.management.jmxremote + +rem Load configuration file +if exist "%KALUMET_AGENT_HOME%\conf\agent-rc.cmd" call %KALUMET_AGENT_HOME%\conf\agent-rc.cmd + +rem Support for loading native libraries +set PATH=%PATH%;%KALUMET_AGENT_HOME\lib + +title Apache Kalumet Agent + +rem Setup the Java Virtual Machine +if not "%JAVA%" == "" goto :Check_JAVA_END + set JAVA=java + if "%JAVA_HOME%" == "" call :warn JAVA_HOME not set; results may vary + if not "%JAVA_HOME%" == "" set JAVA=%JAVA_HOME%\bin\java + if not exist "%JAVA_HOME%" ( + call :warn JAVA_HOME is not valid: %JAVA_HOME% + goto END + ) +:Check_JAVA_END + +rem Setup the classworlds +set CLASSPATH=%KALUMET_HOME%\lib\classworlds-1.1.jar +set CLASSWORLDS_CONF=%KALUMET_HOME%\conf\agent.conf + +if "%JAVA_OPTS%" == "" set JAVA_OPTS=%DEFAULT_JAVA_OPTS% + +rem Execute the JVM +"%JAVA%" %JAVA_OPTS% -classpath "%CLASSPATH%" -Dclassworlds.conf="%CLASSWORLDS_CONF%" -Dkalumet.agent.home="%KALUMET_AGENT_HOME%" org.codehaus.classworlds.Launcher %* \ No newline at end of file Added: incubator/kalumet/trunk/assembly/src/main/distribution/agent/conf/agent.conf URL: http://svn.apache.org/viewvc/incubator/kalumet/trunk/assembly/src/main/distribution/agent/conf/agent.conf?rev=1202172&view=auto ============================================================================== --- incubator/kalumet/trunk/assembly/src/main/distribution/agent/conf/agent.conf (added) +++ incubator/kalumet/trunk/assembly/src/main/distribution/agent/conf/agent.conf Tue Nov 15 13:18:22 2011 @@ -0,0 +1,23 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +main is org.apache.kalumet.agent.Main from app + +[app] + load ${kalumet.agent.home}/conf + load ${kalumet.agent.home}/lib/*.jar + load ${kalumet.agent.home}/lib/extras/*.jar \ No newline at end of file Added: incubator/kalumet/trunk/assembly/src/main/distribution/agent/conf/log4j.xml URL: http://svn.apache.org/viewvc/incubator/kalumet/trunk/assembly/src/main/distribution/agent/conf/log4j.xml?rev=1202172&view=auto ============================================================================== --- incubator/kalumet/trunk/assembly/src/main/distribution/agent/conf/log4j.xml (added) +++ incubator/kalumet/trunk/assembly/src/main/distribution/agent/conf/log4j.xml Tue Nov 15 13:18:22 2011 @@ -0,0 +1,96 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +--> +<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> + +<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false"> + + <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender"> + <param name="threshold" value="DEBUG"/> + <layout class="org.apache.log4j.PatternLayout"> + <param name="ConversionPattern" value="%-5p - %30c{1} - %m%n"/> + </layout> + </appender> + + <appender name="FILE" class="org.apache.log4j.FileAppender"> + <param name="threshold" value="DEBUG"/> + <param name="File" value="log/agent.log"/> + <layout class="org.apache.log4j.PatternLayout"> + <param name="ConversionPattern" value="%d{ABSOLUTE} | %-5p | %-10t | %-24.24c{1} | %-30.30C %4L | %m%n"/> + </layout> + </appender> + + <logger name="org.apache"> + <level value="WARN"/> + </logger> + + <logger name="org.quartz"> + <level value="WARN"/> + </logger> + + <logger name="org.apache.kalumet"> + <!-- To enable debug logging, replace the INFO by DEBUG --> + <level value="INFO"/> + </logger> + + <root> + <level value="INFO"/> + <appender-ref ref="CONSOLE"/> + <appender-ref ref="FILE"/> + </root> + + +</log4j:configuration> + +<!-- + +Log4J Configuration Quick Reference: +==================================== + +Priority order is DEBUG < INFO < WARN < ERROR < FATAL + +PatternLayout conversion characters: + +%c Category of the logging event +%C Fully qualified class name of the caller +%d Date of the logging event (example: %d{HH:mm:ss,SSS} ) +%F File name where the logging request was issued (caution: extremely slow) +%l Location information of the caller (caution: extremely slow) +%L Line number from where the logging request was issued (caution: extremely slow) +%m Application-supplied message +%M Method name from where the logging request was issued (caution: extremely slow) +%n Line separator +%p Priority of the logging event +%r Number of milliseconds since the start of the application +%t Name of the thread that generated the logging event +%x Nested diagnotic context associated with the thread +%% A single percent sign + +Format modifiers examples: + +%20c Left pad with spaces if category is less than 20 characters long +%-20c Right pad with spaces if category is less than 20 characters long +%.30c Truncate from the beginning if category is more than 30 chars long +%20.30c Left pad 20 chars + truncate from beginning if more than 30 chars +%-20.30c Right pad 20 chars + truncate from beginning if more than 30 chars + +Examples: "%r [%t] %-5p %c %x - %m\n" +"%-6r [%15.15t] %-5p %30.30c %x - %m\n" + +--> \ No newline at end of file Added: incubator/kalumet/trunk/assembly/src/main/distribution/agent/conf/templates/notifier.html URL: http://svn.apache.org/viewvc/incubator/kalumet/trunk/assembly/src/main/distribution/agent/conf/templates/notifier.html?rev=1202172&view=auto ============================================================================== --- incubator/kalumet/trunk/assembly/src/main/distribution/agent/conf/templates/notifier.html (added) +++ incubator/kalumet/trunk/assembly/src/main/distribution/agent/conf/templates/notifier.html Tue Nov 15 13:18:22 2011 @@ -0,0 +1,15 @@ +<html> +<head> + <title>Apache Kalumet Agent Environment {0} Update Notification</title> +</head> +<body style="margin: 0; padding: 0; background-color: #ffffff"> + <div id="header" style="background-color: #f0f0f0; width: 100%; font: bold 12px helvetica, sans-serif; color: black"> + Apache Kalumet Agent Environment {0} Update Notification + </div> + <div id="central" style="width: 100%; font: 10px helvetica, sans-serif; align: center"> + The update will begin in {1} minute(s).<br/> + Please, save your work and quit the environment.<br/> + Thanks.<br/> + </div> +</body> +</html> \ No newline at end of file Added: incubator/kalumet/trunk/assembly/src/main/distribution/agent/conf/templates/publisher.xsl URL: http://svn.apache.org/viewvc/incubator/kalumet/trunk/assembly/src/main/distribution/agent/conf/templates/publisher.xsl?rev=1202172&view=auto ============================================================================== --- incubator/kalumet/trunk/assembly/src/main/distribution/agent/conf/templates/publisher.xsl (added) +++ incubator/kalumet/trunk/assembly/src/main/distribution/agent/conf/templates/publisher.xsl Tue Nov 15 13:18:22 2011 @@ -0,0 +1,135 @@ +<?xml version="1.0"?> +<!-- + ********************************* + * Kalumet Mail Publisher XSL * + * Author : Jean-Baptiste ONOFRE * + * E-mail : j...@nanthrax.net * + ********************************* + + This XSL is optionnal. It's used to send a HTML e-mail + when an Kalumet agent publish an update result. +--> + +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + + <xsl:output method="html"/> + + <xsl:template match="/"> + <html> + <head> + <title>Apache Kalumet Agent Update Report</title> + <xsl:call-template name="style"/> + </head> + <body> + <div id="header"> + Apache Kalumet Agent Update Report <xsl:value-of select="updatelog/@title"/> + </div> + <div id="central"> + <br/> + <table width="90%" border="1" cellspacing="0" cellpadding="2"> + <tr> + <td><b>Updated Environment</b></td> + <td><xsl:value-of select="updatelog/@title"/></td> + </tr> + <tr> + <td><b>Final Status</b></td> + <td><xsl:value-of select="updatelog/@status"/></td> + </tr> + <tr> + <td><b>Update Date</b></td> + <td><xsl:value-of select="updatelog/@time"/></td> + </tr> + <tr> + <td><b>Errors</b></td> + <td> + <font color="red"> + <xsl:apply-templates select="updatelog/updatemessage[@priority = 'error']"/> + </font> + <br/> + </td> + </tr> + <tr> + <td><b>Warnings</b></td> + <td> + <font color="red"> + <xsl:apply-templates select="updatelog/updatemessage[@priority = 'warn']"/> + </font> + <br/> + </td> + </tr> + <tr> + <td><b>Applications Summary</b></td> + <td> + <xsl:apply-templates select="updatelog/updatemessage[@priority = 'summary']"/> + </td> + </tr> + <tr> + <td><b>Output Log</b></td> + <td> + <font size="1"> + <xsl:apply-templates select="updatelog/updatemessage"/> + </font> + </td> + </tr> + </table> + </div> + <div id="footer"> + <hr/> + Copyright (c) 2009 - BuildProcess Team - All Rights Reserved + </div> + </body> + </html> + </xsl:template> + + <xsl:template match="updatemessage"> + <ul> + <li><xsl:value-of select="."/></li> + </ul> + </xsl:template> + + <xsl:template name="style"> + <style> + <xsl:text> +body { + margin: 0; + padding: 0; + background-color: #ffffff; +} + +#header { + background-color: #f0f0f0; + width: 100%; + font: bold 14px helvetica, sans-serif; + color: black; +} + +#central { + width: 100%; + font: 10px helvetica, sans-serif; + align: center; +} + +#central table { + background-color: #bfbfbf; + margin-left: 5%; +} + +#central tr { + vertical-align: top; +} + +#footer { + width: 100%; + clear: both; + margin-top: 10px; + padding-top: 10px; + position: relative; + font: 8px gill sans, helvetica, sans-serif; + text-align: center; +} + + </xsl:text> + </style> + </xsl:template> + +</xsl:stylesheet>