changeset 1321:33064daddba9

Agent Proxy distribution This patch adds changes to distribution files, along with some new ones. Of note, this patch adds a JAAS configuration file used by the Agent Proxy containing our two LoginModules. The other main addition is a script to run the Agent Proxy server with all necessary arguments. Reviewed-by: jerboaa Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2013-November/008715.html PR1460
author Elliott Baron <ebaron@redhat.com>
date Thu, 14 Nov 2013 11:33:46 -0500
parents 9732c67863d5
children a5241b7a3e64
files distribution/assembly/core-assembly.xml distribution/config/agent_proxy_jaas.conf distribution/config/commands/agent.properties distribution/config/commands/service.properties distribution/config/commands/storage.properties distribution/pom.xml distribution/scripts/thermostat distribution/scripts/thermostat-agent-proxy
diffstat 8 files changed, 96 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/distribution/assembly/core-assembly.xml	Thu Nov 14 11:33:02 2013 -0500
+++ b/distribution/assembly/core-assembly.xml	Thu Nov 14 11:33:46 2013 -0500
@@ -59,6 +59,8 @@
         <include>com.redhat.thermostat:thermostat-agent-core</include>
         <include>com.redhat.thermostat:thermostat-agent-cli</include>
         <include>com.redhat.thermostat:thermostat-agent-command</include>
+        <include>com.redhat.thermostat:thermostat-agent-proxy-common</include>
+        <include>com.redhat.thermostat:thermostat-agent-proxy-server</include>
         <include>com.redhat.thermostat:thermostat-killvm-agent</include>
         <include>com.redhat.thermostat:thermostat-killvm-client-swing</include>
         <include>com.redhat.thermostat:thermostat-common-core</include>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/distribution/config/agent_proxy_jaas.conf	Thu Nov 14 11:33:46 2013 -0500
@@ -0,0 +1,7 @@
+UnixLogin {
+   com.sun.security.auth.module.UnixLoginModule required debug=false;
+};
+
+AgentProxyLogin {
+   com.redhat.thermostat.agent.proxy.server.AgentProxyLoginModule required debug=false;
+};
--- a/distribution/config/commands/agent.properties	Thu Nov 14 11:33:02 2013 -0500
+++ b/distribution/config/commands/agent.properties	Thu Nov 14 11:33:46 2013 -0500
@@ -7,6 +7,7 @@
           com.redhat.thermostat.process=${project.version}, \
           com.redhat.thermostat.common.core=${project.version}, \
           com.redhat.thermostat.agent.cli=${project.version}, \
+          com.redhat.thermostat.agent.proxy.common=${project.version}, \
           com.redhat.thermostat.common.command=${project.version}, \
           com.redhat.thermostat.agent.command=${project.version}, \
           com.redhat.thermostat.killvm.agent=${project.version}, \
--- a/distribution/config/commands/service.properties	Thu Nov 14 11:33:02 2013 -0500
+++ b/distribution/config/commands/service.properties	Thu Nov 14 11:33:46 2013 -0500
@@ -9,6 +9,7 @@
           com.redhat.thermostat.common.command=${project.version}, \
           com.redhat.thermostat.agent.command=${project.version}, \
           com.redhat.thermostat.agent.cli=${project.version}, \
+          com.redhat.thermostat.agent.proxy.common=${project.version}, \
           org.jboss.netty=${netty.version}
 
 description = starts and stops the thermostat storage and agent
--- a/distribution/config/commands/storage.properties	Thu Nov 14 11:33:02 2013 -0500
+++ b/distribution/config/commands/storage.properties	Thu Nov 14 11:33:46 2013 -0500
@@ -3,6 +3,7 @@
           com.redhat.thermostat.agent.cli=${project.version}, \
           com.redhat.thermostat.common.command=${project.version}, \
           com.redhat.thermostat.agent.command=${project.version}, \
+          com.redhat.thermostat.agent.proxy.common=${project.version}, \
           org.apache.commons.codec=${commons-codec.osgi-version}, \
           org.jboss.netty=${netty.version}
 
--- a/distribution/pom.xml	Thu Nov 14 11:33:02 2013 -0500
+++ b/distribution/pom.xml	Thu Nov 14 11:33:46 2013 -0500
@@ -153,6 +153,7 @@
                     <include>thermostat-users.properties</include>
                     <include>thermostat-roles.properties</include>
                     <include>thermostat_jaas.conf</include>
+                    <include>agent_proxy_jaas.conf</include>
                     <include>db.properties</include>
                     <include>logging.properties</include>
                     <include>osgi-export.properties</include>
@@ -216,6 +217,8 @@
                       todir="${project.build.directory}/image/libs/native" />
                 <copy file="${main.basedir}/agent/core/target/libUserNameUtilWrapper.so"
                       todir="${project.build.directory}/image/libs/native" />
+                <copy file="${main.basedir}/agent/proxy/server/target/libAgentProxy.so"
+                      todir="${project.build.directory}/image/libs/native" />
                 <copy file="${main.basedir}/laf-utils/target/libGTKThemeUtils.so"
                       todir="${project.build.directory}/image/libs/native" />
               </target>
@@ -319,6 +322,11 @@
     </dependency>
     <dependency>
       <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-agent-proxy-server</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
       <artifactId>thermostat-killvm-agent</artifactId>
       <version>${project.version}</version>
     </dependency>
--- a/distribution/scripts/thermostat	Thu Nov 14 11:33:02 2013 -0500
+++ b/distribution/scripts/thermostat	Thu Nov 14 11:33:46 2013 -0500
@@ -60,6 +60,8 @@
 SERVICE_CLASSPATH="${SERVICE_CLASSPATH}:${THERMOSTAT_LIBS}/thermostat-launcher-@project.version@.jar"
 SERVICE_CLASSPATH="${SERVICE_CLASSPATH}:${THERMOSTAT_LIBS}/thermostat-main-@project.version@.jar"
 SERVICE_CLASSPATH="${SERVICE_CLASSPATH}:${THERMOSTAT_LIBS}/thermostat-shared-config-@project.version@.jar"
+# This needs to be on the classpath for the RMI registry to find it
+SERVICE_CLASSPATH="${SERVICE_CLASSPATH}:${THERMOSTAT_LIBS}/thermostat-agent-proxy-common-@project.version@.jar"
 # FIXME: Remove once jfreechart is a real OSGi bundle upstream
 SERVICE_CLASSPATH="${SERVICE_CLASSPATH}:${THERMOSTAT_LIBS}/jfreechart-@jfreechart.version@.jar"
 SERVICE_CLASSPATH="${SERVICE_CLASSPATH}:${THERMOSTAT_LIBS}/jcommon-@jcommon.version@.jar"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/distribution/scripts/thermostat-agent-proxy	Thu Nov 14 11:33:46 2013 -0500
@@ -0,0 +1,74 @@
+#!/bin/bash
+#
+# Copyright 2012, 2013 Red Hat, Inc.
+#
+# This file is part of Thermostat.
+#
+# Thermostat is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published
+# by the Free Software Foundation; either version 2, or (at your
+# option) any later version.
+#
+# Thermostat 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
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Thermostat; see the file COPYING.  If not see
+# <http://www.gnu.org/licenses/>.
+#
+# Linking this code with other modules is making a combined work
+# based on this code.  Thus, the terms and conditions of the GNU
+# General Public License cover the whole combination.
+#
+# As a special exception, the copyright holders of this code give
+# you permission to link this code with independent modules to
+# produce an executable, regardless of the license terms of these
+# independent modules, and to copy and distribute the resulting
+# executable under terms of your choice, provided that you also
+# meet, for each linked independent module, the terms and conditions
+# of the license of that module.  An independent module is a module
+# which is not derived from or based on this code.  If you modify
+# this code, you may extend this exception to your version of the
+# library, but you are not obligated to do so.  If you do not wish
+# to do so, delete this exception statement from your version.
+#
+#####################################################################
+#
+# Some necessary variables.
+JAVA_DIR="@java.dir@"
+JAVA="@java.home@/bin/java"
+
+if [ x"$THERMOSTAT_INSTALL_DIR" = x ] ; then
+  THERMOSTAT_INSTALL_DIR="@thermostat.home@"
+fi
+# Not always are installation directory and thermostat home one and
+# the same location.
+if [ x"$THERMOSTAT_HOME" = x ] ; then
+  THERMOSTAT_HOME=${THERMOSTAT_INSTALL_DIR}
+fi
+THERMOSTAT_LIBS="${THERMOSTAT_HOME}/libs"
+
+# Need tools from the JVM
+TOOLS_JAR="@java.home@/../lib/tools.jar"
+
+# JARs necessary for the server
+SERVICE_CLASSPATH="${THERMOSTAT_LIBS}/thermostat-common-core-@project.version@.jar"
+SERVICE_CLASSPATH="${SERVICE_CLASSPATH}:${THERMOSTAT_LIBS}/thermostat-shared-config-@project.version@.jar"
+SERVICE_CLASSPATH="${SERVICE_CLASSPATH}:${THERMOSTAT_LIBS}/thermostat-agent-proxy-common-@project.version@.jar"
+SERVICE_CLASSPATH="${SERVICE_CLASSPATH}:${THERMOSTAT_LIBS}/thermostat-agent-proxy-server-@project.version@.jar"
+SERVICE_CLASSPATH="${TOOLS_JAR}:${SERVICE_CLASSPATH}"
+
+AGENT_PROXY_CLASS="com.redhat.thermostat.agent.proxy.server.AgentProxy"
+
+JAAS_CONFIG="${THERMOSTAT_HOME}/etc/agent_proxy_jaas.conf"
+
+# Set this to remote debug
+if [ x"$THERMOSTAT_DEBUG" != x ] ; then
+  DEBUG_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=1082"
+fi
+
+# Start server
+${JAVA} -cp ${SERVICE_CLASSPATH} ${DEBUG_OPTS} "-Djava.security.auth.login.config=${JAAS_CONFIG}" \
+"-Djava.rmi.server.randomIDs=true" ${AGENT_PROXY_CLASS} "$1"