Author: gtrasuk
Date: Wed Mar 28 18:52:32 2012
New Revision: 1306536

URL: http://svn.apache.org/viewvc?rev=1306536&view=rev
Log:
Beginning to implement the remote deployer, and also see about the security 
manager.

Added:
    
river/jtsk/skunk/surrogate/test/org/apache/river/container/security/SecurityManagerTest.java
Modified:
    river/jtsk/skunk/surrogate/README
    river/jtsk/skunk/surrogate/nbproject/build-impl.xml
    river/jtsk/skunk/surrogate/nbproject/genfiles.properties
    river/jtsk/skunk/surrogate/nbproject/project.properties
    
river/jtsk/skunk/surrogate/src/org/apache/river/container/AbstractConnector.java
    
river/jtsk/skunk/surrogate/src/org/apache/river/container/StarterServiceDeployer.java
    
river/jtsk/skunk/surrogate/src/org/apache/river/container/codebase/ClassServer.java

Modified: river/jtsk/skunk/surrogate/README
URL: 
http://svn.apache.org/viewvc/river/jtsk/skunk/surrogate/README?rev=1306536&r1=1306535&r2=1306536&view=diff
==============================================================================
--- river/jtsk/skunk/surrogate/README (original)
+++ river/jtsk/skunk/surrogate/README Wed Mar 28 18:52:32 2012
@@ -25,6 +25,15 @@ ApacheCommonsVFS-1_0
     commons-vfs-1.0.jar
 from the Apache Commons VFS v1.0 distribution.
 
+ApacheRiverServices
+    fiddler.jar
+    reggie.jar
+    outrigger.jar
+    norm.jar
+    mahalo.jar
+    mercury.jar
+from the Apache River distribution.
+
 The project properties should already include these libraries in
 the compile classpath.
 
@@ -36,6 +45,3 @@ the tool to a convenient location, then 
 The configuration file schema is bound using JAXB.  It may be necessary to 
ensure
 that Netbeans has the JAXB libraries defined.
 
-The project has a dependency on the jar file called 'RiverContainerLiaison.jar'
-which is created by the project called 'RiverContainerLiaison', which should be
-also checked out from the svn repository in the same directory as this project.

Modified: river/jtsk/skunk/surrogate/nbproject/build-impl.xml
URL: 
http://svn.apache.org/viewvc/river/jtsk/skunk/surrogate/nbproject/build-impl.xml?rev=1306536&r1=1306535&r2=1306536&view=diff
==============================================================================
--- river/jtsk/skunk/surrogate/nbproject/build-impl.xml (original)
+++ river/jtsk/skunk/surrogate/nbproject/build-impl.xml Wed Mar 28 18:52:32 2012
@@ -20,10 +20,10 @@ is divided into following sections:
 
         -->
 <project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1"; 
xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3"; 
xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc"; basedir=".." 
default="default" name="RiverSurrogate-impl">
-    <fail message="Please build using Ant 1.7.1 or higher.">
+    <fail message="Please build using Ant 1.8.0 or higher.">
         <condition>
             <not>
-                <antversion atleast="1.7.1"/>
+                <antversion atleast="1.8.0"/>
             </not>
         </condition>
     </fail>
@@ -198,6 +198,7 @@ is divided into following sections:
         <property name="javac.fork" value="${jdkBug6558476}"/>
         <property name="jar.index" value="false"/>
         <property name="jar.index.metainf" value="${jar.index}"/>
+        <property name="copylibs.rebase" value="true"/>
         <available file="${meta.inf.dir}/persistence.xml" 
property="has.persistence.xml"/>
     </target>
     <target name="-post-init">
@@ -384,6 +385,7 @@ is divided into following sections:
                 <property environment="env"/>
                 <resolve name="profiler.current.path" 
value="${profiler.info.pathvar}"/>
                 <java classname="@{classname}" dir="${profiler.info.dir}" 
fork="true" jvm="${profiler.info.jvm}">
+                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
                     <jvmarg value="${profiler.info.jvmargs.agent}"/>
                     <jvmarg line="${profiler.info.jvmargs}"/>
                     <env key="${profiler.info.pathvar}" 
path="${profiler.info.agentpath}:${profiler.current.path}"/>
@@ -514,7 +516,7 @@ is divided into following sections:
                     </chainedmapper>
                 </pathconvert>
                 <taskdef 
classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" 
classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
-                <copylibs compress="${jar.compress}" index="${jar.index}" 
indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" 
manifest="@{manifest}" 
runtimeclasspath="${run.classpath.without.build.classes.dir}">
+                <copylibs compress="${jar.compress}" index="${jar.index}" 
indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" 
manifest="@{manifest}" rebase="${copylibs.rebase}" 
runtimeclasspath="${run.classpath.without.build.classes.dir}">
                     <fileset dir="${build.classes.dir}"/>
                     <manifest>
                         <attribute name="Class-Path" value="${jar.classpath}"/>
@@ -839,6 +841,14 @@ is divided into following sections:
             -->
     <target depends="init" if="have.sources" name="-javadoc-build">
         <mkdir dir="${dist.javadoc.dir}"/>
+        <condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" 
value="-J${endorsed.classpath.cmd.line.arg}">
+            <and>
+                <isset property="endorsed.classpath.cmd.line.arg"/>
+                <not>
+                    <equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
+                </not>
+            </and>
+        </condition>
         <javadoc additionalparam="${javadoc.additionalparam}" 
author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" 
docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" 
noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" 
notree="${javadoc.notree}" private="${javadoc.private}" 
source="${javac.source}" splitindex="${javadoc.splitindex}" 
use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" 
windowtitle="${javadoc.windowtitle}">
             <classpath>
                 <path path="${javac.classpath}"/>
@@ -850,6 +860,7 @@ is divided into following sections:
                 <include name="**/*.java"/>
                 <exclude name="*.java"/>
             </fileset>
+            <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
         </javadoc>
         <copy todir="${dist.javadoc.dir}">
             <fileset dir="${src.dir}" excludes="${excludes}" 
includes="${includes}">

Modified: river/jtsk/skunk/surrogate/nbproject/genfiles.properties
URL: 
http://svn.apache.org/viewvc/river/jtsk/skunk/surrogate/nbproject/genfiles.properties?rev=1306536&r1=1306535&r2=1306536&view=diff
==============================================================================
--- river/jtsk/skunk/surrogate/nbproject/genfiles.properties (original)
+++ river/jtsk/skunk/surrogate/nbproject/genfiles.properties Wed Mar 28 
18:52:32 2012
@@ -4,8 +4,8 @@ [email protected]
 # This file is used by a NetBeans-based IDE to track changes in generated 
files such as build-impl.xml.
 # Do not edit this file. You may delete it but then the IDE will never 
regenerate such files for you.
 nbproject/build-impl.xml.data.CRC32=092f50fa
-nbproject/build-impl.xml.script.CRC32=e736d5f2
-nbproject/[email protected]
+nbproject/build-impl.xml.script.CRC32=ddb15c4d
+nbproject/[email protected]
 nbproject/management-build-impl.xml.data.CRC32=318d2fde
 nbproject/management-build-impl.xml.script.CRC32=630dcf8f
 nbproject/[email protected]

Modified: river/jtsk/skunk/surrogate/nbproject/project.properties
URL: 
http://svn.apache.org/viewvc/river/jtsk/skunk/surrogate/nbproject/project.properties?rev=1306536&r1=1306535&r2=1306536&view=diff
==============================================================================
--- river/jtsk/skunk/surrogate/nbproject/project.properties (original)
+++ river/jtsk/skunk/surrogate/nbproject/project.properties Wed Mar 28 18:52:32 
2012
@@ -1,97 +1,98 @@
-annotation.processing.enabled=true
-annotation.processing.enabled.in.editor=false
-annotation.processing.run.all.processors=true
-annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
-application.title=surrogate
-application.vendor=trasukg
-build.classes.dir=${build.dir}/classes
-build.classes.excludes=**/*.java,**/*.form
-# This directory is removed when the project is cleaned:
-build.dir=build
-build.generated.dir=${build.dir}/generated
-build.generated.sources.dir=${build.dir}/generated-sources
-# Only compile against the classpath explicitly listed here:
-build.sysclasspath=ignore
-build.test.classes.dir=${build.dir}/test/classes
-build.test.results.dir=${build.dir}/test/results
-# Uncomment to specify the preferred debugger connection transport:
-#debug.transport=dt_socket
-debug.classpath=\
-    ${run.classpath}
-debug.test.classpath=\
-    ${run.test.classpath}
-# This directory is removed when the project is cleaned:
-dist.dir=dist
-dist.jar=${dist.dir}/RiverSurrogate.jar
-dist.javadoc.dir=${dist.dir}/javadoc
-endorsed.classpath=
-#endorsed.classpath=\
-#    ${libs.JAXB-ENDORSED.classpath}
-excludes=
-includes=**
-jar.archive.disabled=${jnlp.enabled}
-jar.compress=false
-jar.index=${jnlp.enabled}
-javac.classpath=\
-    ${libs.ApacheCommonsLogging-1_1_1.classpath}:\
-    ${libs.ApacheCommonsVFS-1_0.classpath}:\
-    ${libs.ApacheRiverLib.classpath}:\
-    ${libs.ApacheRiverServices.classpath}:\
-    ${libs.ApacheRiverPlatform.classpath}
-# Space-separated list of extra javac options
-javac.compilerargs=
-javac.deprecation=false
-javac.processorpath=\
-    ${javac.classpath}:\
-    ${libs.JavaCC.classpath}:\
-    ${libs.jaxb.classpath}
-javac.source=1.6
-javac.target=1.6
-javac.test.classpath=\
-    ${javac.classpath}:\
-    ${build.classes.dir}:\
-    ${libs.junit_4.classpath}
-javac.test.processorpath=\
-    ${javac.test.classpath}
-javadoc.additionalparam=
-javadoc.author=false
-javadoc.encoding=${source.encoding}
-javadoc.noindex=false
-javadoc.nonavbar=false
-javadoc.notree=false
-javadoc.private=false
-javadoc.splitindex=true
-javadoc.use=true
-javadoc.version=false
-javadoc.windowtitle=
-jaxbwiz.gensrc.classpath=${libs.jaxb.classpath}
-jaxbwiz.xjcdef.classpath=${libs.jaxb.classpath}
-jaxbwiz.xjcrun.classpath=${libs.jaxb.classpath}
-jnlp.codebase.type=web
-jnlp.codebase.url=$$$$codebase
-jnlp.descriptor=application
-jnlp.enabled=false
-jnlp.mixed.code=default
-jnlp.offline-allowed=false
-jnlp.signed=false
-jnlp.signing=
-jnlp.signing.alias=
-jnlp.signing.keystore=
-main.class=org.apache.river.container.Bootstrap
-manifest.file=manifest.mf
-meta.inf.dir=${src.dir}/META-INF
-mkdist.disabled=false
-platform.active=default_platform
-run.classpath=\
-    ${build.classes.dir}:\
-    ${javac.classpath}
-# Space-separated list of JVM arguments used when running the project
-# (you may also define separate properties like run-sys-prop.name=value 
instead of -Dname=value
-# or test-sys-prop.name=value to set system properties for unit tests):
-run.jvmargs=-classpath lib/RiverSurrogate.jar 
-Djava.util.logging.config.file=../../testfiles/logging.properties
-run.test.classpath=\
-    ${javac.test.classpath}:\
-    ${build.test.classes.dir}
-source.encoding=UTF-8
-src.dir=src
-test.src.dir=test
+annotation.processing.enabled=true
+annotation.processing.enabled.in.editor=false
+annotation.processing.processors.list=
+annotation.processing.run.all.processors=true
+annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
+application.title=surrogate
+application.vendor=trasukg
+build.classes.dir=${build.dir}/classes
+build.classes.excludes=**/*.java,**/*.form
+# This directory is removed when the project is cleaned:
+build.dir=build
+build.generated.dir=${build.dir}/generated
+build.generated.sources.dir=${build.dir}/generated-sources
+# Only compile against the classpath explicitly listed here:
+build.sysclasspath=ignore
+build.test.classes.dir=${build.dir}/test/classes
+build.test.results.dir=${build.dir}/test/results
+# Uncomment to specify the preferred debugger connection transport:
+#debug.transport=dt_socket
+debug.classpath=\
+    ${run.classpath}
+debug.test.classpath=\
+    ${run.test.classpath}
+# This directory is removed when the project is cleaned:
+dist.dir=dist
+dist.jar=${dist.dir}/RiverSurrogate.jar
+dist.javadoc.dir=${dist.dir}/javadoc
+endorsed.classpath=
+#endorsed.classpath=\
+#    ${libs.JAXB-ENDORSED.classpath}
+excludes=
+includes=**
+jar.archive.disabled=${jnlp.enabled}
+jar.compress=false
+jar.index=${jnlp.enabled}
+javac.classpath=\
+    ${libs.ApacheCommonsLogging-1_1_1.classpath}:\
+    ${libs.ApacheCommonsVFS-1_0.classpath}:\
+    ${libs.ApacheRiverLib.classpath}:\
+    ${libs.ApacheRiverServices.classpath}:\
+    ${libs.ApacheRiverPlatform.classpath}
+# Space-separated list of extra javac options
+javac.compilerargs=
+javac.deprecation=false
+javac.processorpath=\
+    ${javac.classpath}:\
+    ${libs.JavaCC.classpath}:\
+    ${libs.jaxb.classpath}
+javac.source=1.6
+javac.target=1.6
+javac.test.classpath=\
+    ${javac.classpath}:\
+    ${build.classes.dir}:\
+    ${libs.junit_4.classpath}
+javac.test.processorpath=\
+    ${javac.test.classpath}
+javadoc.additionalparam=
+javadoc.author=false
+javadoc.encoding=${source.encoding}
+javadoc.noindex=false
+javadoc.nonavbar=false
+javadoc.notree=false
+javadoc.private=false
+javadoc.splitindex=true
+javadoc.use=true
+javadoc.version=false
+javadoc.windowtitle=
+jaxbwiz.gensrc.classpath=${libs.jaxb.classpath}
+jaxbwiz.xjcdef.classpath=${libs.jaxb.classpath}
+jaxbwiz.xjcrun.classpath=${libs.jaxb.classpath}
+jnlp.codebase.type=web
+jnlp.codebase.url=$$$$codebase
+jnlp.descriptor=application
+jnlp.enabled=false
+jnlp.mixed.code=default
+jnlp.offline-allowed=false
+jnlp.signed=false
+jnlp.signing=
+jnlp.signing.alias=
+jnlp.signing.keystore=
+main.class=org.apache.river.container.Bootstrap
+manifest.file=manifest.mf
+meta.inf.dir=${src.dir}/META-INF
+mkdist.disabled=false
+platform.active=default_platform
+run.classpath=\
+    ${build.classes.dir}:\
+    ${javac.classpath}
+# Space-separated list of JVM arguments used when running the project
+# (you may also define separate properties like run-sys-prop.name=value 
instead of -Dname=value
+# or test-sys-prop.name=value to set system properties for unit tests):
+run.jvmargs=-classpath lib/RiverSurrogate.jar 
-Djava.util.logging.config.file=../../testfiles/logging.properties
+run.test.classpath=\
+    ${javac.test.classpath}:\
+    ${build.test.classes.dir}
+source.encoding=UTF-8
+src.dir=src
+test.src.dir=test

Modified: 
river/jtsk/skunk/surrogate/src/org/apache/river/container/AbstractConnector.java
URL: 
http://svn.apache.org/viewvc/river/jtsk/skunk/surrogate/src/org/apache/river/container/AbstractConnector.java?rev=1306536&r1=1306535&r2=1306536&view=diff
==============================================================================
--- 
river/jtsk/skunk/surrogate/src/org/apache/river/container/AbstractConnector.java
 (original)
+++ 
river/jtsk/skunk/surrogate/src/org/apache/river/container/AbstractConnector.java
 Wed Mar 28 18:52:32 2012
@@ -39,7 +39,7 @@ public class AbstractConnector {
     public void processSurrogateHostingRequest(URL surrogatePackage) {
         // Allocate a working directory
         File workingDir=host.newWorkDirectory();
-        // TODO: Unpack the surrogate jar into the working directory
+        
         SurrogateInstaller installer= (SurrogateInstaller)
                 host.getAttribute(Names.SURROGATE_INSTALLER);
 

Modified: 
river/jtsk/skunk/surrogate/src/org/apache/river/container/StarterServiceDeployer.java
URL: 
http://svn.apache.org/viewvc/river/jtsk/skunk/surrogate/src/org/apache/river/container/StarterServiceDeployer.java?rev=1306536&r1=1306535&r2=1306536&view=diff
==============================================================================
--- 
river/jtsk/skunk/surrogate/src/org/apache/river/container/StarterServiceDeployer.java
 (original)
+++ 
river/jtsk/skunk/surrogate/src/org/apache/river/container/StarterServiceDeployer.java
 Wed Mar 28 18:52:32 2012
@@ -309,7 +309,6 @@ public class StarterServiceDeployer {
         final String[] args = constructArgs(argLine);
 
         launchService(cl, startProps, args);
-        // TODO: Call the main class/method.
         log.log(Level.INFO, MessageNames.COMPLETED_SERVICE_DEPLOYMENT, 
serviceName);
     }
 

Modified: 
river/jtsk/skunk/surrogate/src/org/apache/river/container/codebase/ClassServer.java
URL: 
http://svn.apache.org/viewvc/river/jtsk/skunk/surrogate/src/org/apache/river/container/codebase/ClassServer.java?rev=1306536&r1=1306535&r2=1306536&view=diff
==============================================================================
--- 
river/jtsk/skunk/surrogate/src/org/apache/river/container/codebase/ClassServer.java
 (original)
+++ 
river/jtsk/skunk/surrogate/src/org/apache/river/container/codebase/ClassServer.java
 Wed Mar 28 18:52:32 2012
@@ -213,7 +213,7 @@ public class ClassServer implements Code
     @return 
     */
     public String getHost() {
-        return server.getInetAddress().getHostName();
+        return server.getInetAddress().getHostAddress();
     }
     
     /** Read up to CRLF, return false if EOF */

Added: 
river/jtsk/skunk/surrogate/test/org/apache/river/container/security/SecurityManagerTest.java
URL: 
http://svn.apache.org/viewvc/river/jtsk/skunk/surrogate/test/org/apache/river/container/security/SecurityManagerTest.java?rev=1306536&view=auto
==============================================================================
--- 
river/jtsk/skunk/surrogate/test/org/apache/river/container/security/SecurityManagerTest.java
 (added)
+++ 
river/jtsk/skunk/surrogate/test/org/apache/river/container/security/SecurityManagerTest.java
 Wed Mar 28 18:52:32 2012
@@ -0,0 +1,68 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.apache.river.container.security;
+
+import java.io.IOException;
+import java.io.InputStream;
+import org.junit.*;
+
+/**
+ * 
+ * In order to test the security infrastructure, we need to setup a secure
+ * environment and then see if certain activities are denied.
+ * 
+ * How to do this?
+ * 
+ * One option would be to setup a plain application in a "secured" environment
+ * and have that application try to check access for a permission it doesn't
+ * have.
+ * 
+ * Another option is to run a JUnit test inside the "secured" environment, and
+ * verify that the allowed operation passes and the disallowed operation fails.
+ * 
+ * So... we'll need some infrastructure to run JUnit test suites inside the
+ * container.
+ * 
+ * @author trasukg
+ */
+public class SecurityManagerTest {
+    
+    public SecurityManagerTest() {
+    }
+
+    @BeforeClass
+    public static void setUpClass() throws Exception {
+    }
+
+    @AfterClass
+    public static void tearDownClass() throws Exception {
+    }
+    
+    @Before
+    public void setUp() {
+    }
+    
+    @After
+    public void tearDown() {
+    }
+    
+    @Test
+    public void testSecuritySetup() throws IOException {
+        /* Design by Magic... */
+        /* Start the container. */
+        Process p=Runtime.getRuntime().exec("Run the container");
+        InputStream pOut=p.getInputStream();
+        waitForContainerStartupMessage(pOut);
+        /* Deploy the test app to the container.  Test app starts up and runs 
the
+         * JUnit tests.
+         */
+        /* Confirm that the JUnit test was run.  If at all possible, just get 
the
+         * Result of the JUnit tests.
+         */
+        /* Undeploy the test app. */
+        /* Shutdown the container. */
+        p.destroy();
+    }
+}


Reply via email to