You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@river.apache.org by gt...@apache.org on 2011/05/25 05:12:06 UTC

svn commit: r1127370 [1/3] - in /river/jtsk/skunk/surrogate: ./ docs/ nbproject/ src/org/apache/river/container/ src/schemas/ test/org/apache/river/container/ test/org/apache/river/container/config/ testfiles/ testfiles/testroot/profile/default/ testfi...

Author: gtrasuk
Date: Wed May 25 03:12:05 2011
New Revision: 1127370

URL: http://svn.apache.org/viewvc?rev=1127370&view=rev
Log:
Finally moved surrogate container development over to the new TLP repository.

Added:
    river/jtsk/skunk/surrogate/docs/ServiceStarterServices.txt
    river/jtsk/skunk/surrogate/src/org/apache/river/container/ServiceStarterArchiveFileSelector.java
    river/jtsk/skunk/surrogate/src/org/apache/river/container/VirtualFileSystemClassLoader.java
    river/jtsk/skunk/surrogate/test/org/apache/river/container/CommonsVFSTest.java
    river/jtsk/skunk/surrogate/test/org/apache/river/container/VFSClassLoaderTest.java
    river/jtsk/skunk/surrogate/testfiles/hosted-reggie.properties
    river/jtsk/skunk/surrogate/testfiles/testroot/profile/default/work/
    river/jtsk/skunk/surrogate/testfiles/testroot/profile/default/work/org.apache.river.container.StarterServiceDeployer/
Modified:
    river/jtsk/skunk/surrogate/README
    river/jtsk/skunk/surrogate/build.xml
    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/nbproject/project.xml
    river/jtsk/skunk/surrogate/src/org/apache/river/container/FileUtility.java
    river/jtsk/skunk/surrogate/src/org/apache/river/container/FileUtilityImpl.java
    river/jtsk/skunk/surrogate/src/org/apache/river/container/MessageNames.java
    river/jtsk/skunk/surrogate/src/org/apache/river/container/Messages.properties
    river/jtsk/skunk/surrogate/src/org/apache/river/container/ProfileConfigReader.java
    river/jtsk/skunk/surrogate/src/org/apache/river/container/SettableCodebaseClassLoader.java
    river/jtsk/skunk/surrogate/src/org/apache/river/container/StarterServiceDeployer.java
    river/jtsk/skunk/surrogate/src/org/apache/river/container/Strings.java
    river/jtsk/skunk/surrogate/src/org/apache/river/container/core-config.xml
    river/jtsk/skunk/surrogate/src/schemas/config.xsd
    river/jtsk/skunk/surrogate/test/org/apache/river/container/AnnotatedClassDeployerTest.java
    river/jtsk/skunk/surrogate/test/org/apache/river/container/config/config-test-doc.xml
    river/jtsk/skunk/surrogate/testfiles/testroot/profile/default/config.xml

Modified: river/jtsk/skunk/surrogate/README
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/surrogate/README?rev=1127370&r1=1127369&r2=1127370&view=diff
==============================================================================
--- river/jtsk/skunk/surrogate/README (original)
+++ river/jtsk/skunk/surrogate/README Wed May 25 03:12:05 2011
@@ -7,16 +7,35 @@ project contents checked into Subversion
 
 To build correctly, you need to define a few libraries in Netbeans:  To do this,
 right-click on the RiverSurrogate node in the Projects tab and select
-"Properties", then select the "Libraries" node.  Define a library called
-'ApacheRiverPlatform' containing 'jsk-platform.jar' and 'jsk-resources.jar' from the
-River distribution.  Define another library called 'ApacheRiverLib' containing
-'jsk-lib.jar'.  The project properties should already include these libraries in
+"Properties", then select the "Libraries" node.  Define the following libraries:
+
+ApacheRiverPlatform
+    jsk-platform.jar
+    jsk-resources.jar
+from the River distribution.
+
+ApacheRiverLib
+    jsk-lib.jar
+
+ApacheCommonsLogging-1_1_1
+    commons-logging-1.1.1.jar
+from the Apache Commons Logging v1.1.1 distribution
+
+ApacheCommonsVFS-1_0
+    commons-vfs-1.0.jar
+from the Apache Commons VFS v1.0 distribution.
+
+The project properties should already include these libraries in
 the compile classpath.
 
-The property file parser is generated using the 'JavaCC' tool (version 5.0) currently
-available from 'https://javacc.dev.java.net/'.  Download and unpack the tool
-to a convenient location, then create a library as above called 'JavaCC' that
-contains the javacc home directory as its 'sources' directory.
+The permission file parser is generated using the 'JavaCC' tool (version 5.0)
+currently available from 'https://javacc.dev.java.net/'.  Download and unpack
+the tool to a convenient location, then create a library as above called
+'JavaCC' that contains the javacc home directory as its 'sources' directory.
 
 The configuration file schema is bound using JAXB.  It may be necessary to ensure
-that Netbeans has the JAXB libraries defined.
\ No newline at end of file
+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/build.xml
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/surrogate/build.xml?rev=1127370&r1=1127369&r2=1127370&view=diff
==============================================================================
--- river/jtsk/skunk/surrogate/build.xml (original)
+++ river/jtsk/skunk/surrogate/build.xml Wed May 25 03:12:05 2011
@@ -101,6 +101,26 @@
             file="${basedir}/testfiles/SampleSurrogate.MF"/>
         <jar basedir="${build.test.sample-surrogate.dir}"
         jarfile="${basedir}/build/test/files/sample-surrogate.jar"/>
+        <antcall target="-build-reggie-module" inheritall="true"/>
+    </target>
+
+    <!--
+    Build the module that hosts reggie in a starter-deployed module.
+    -->
+    <target name='-build-reggie-module'>
+        <mkdir dir="${basedir}/build/test/files"/>
+        <property name="build.test.reggie-module.dir"
+            value="${basedir}/build/test/reggie-module"/>
+
+        <mkdir dir="${build.test.reggie-module.dir}"/>
+        <copy tofile="${build.test.reggie-module.dir}/start.properties"
+            file="${basedir}/testfiles/hosted-reggie.properties"/>
+        <copy todir="${build.test.reggie-module.dir}"
+            file="dist/lib/reggie.jar"/>
+        <copy todir="${build.test.reggie-module.dir}"
+            file="dist/lib/reggie-dl.jar"/>
+        <jar basedir="${build.test.reggie-module.dir}"
+        jarfile="${basedir}/build/test/files/reggie-module.jar"/>
     </target>
 
     <!-- Pre-compiler target to run javacc against our parser sources. -->

Added: river/jtsk/skunk/surrogate/docs/ServiceStarterServices.txt
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/surrogate/docs/ServiceStarterServices.txt?rev=1127370&view=auto
==============================================================================
--- river/jtsk/skunk/surrogate/docs/ServiceStarterServices.txt (added)
+++ river/jtsk/skunk/surrogate/docs/ServiceStarterServices.txt Wed May 25 03:12:05 2011
@@ -0,0 +1,60 @@
+Deploying Services Designed for ServiceStarter API
+==================================================
+
+Partly for compatability, but mainly so we can host the "core" River services
+like Reggie, the container needs to be able to deploy services written for the
+service starter interface.
+
+Under service starter, a service is started by creating an instance of it
+using a constructor that includes configuration options.  The first
+configuration option is the name of a configuration file that would be read
+by the ConfigurationFile configuration provider.
+
+Under the container, the service cannot directly read the configuration file
+since it doesn't know the actual location of the file relative to the startup
+directory.  Additionally, we might want to supplement the configuration with
+global config from the container; for instance, if we're deploying several
+services plus reggie, we would probably want to specify the discovery groups
+in just one location, rather than in every config file.
+
+River's ConfigurationProvider allows us to substitute a different configuration
+instance class in place of ConfigurationFile (see ConfigurationProvider javadoc)
+so we can create a different provider that reads the file through the container.
+This replacement configuration provider can also access global configuration.
+
+The class loader hierarchy for the service-starter deployment looks like:
+
+System CL
+  |
+  v
+Service CL (River API's, container-liaison classes, service jars)
+
+Packaging the Service Implementation
+------------------------------------
+Deployment jar file contains:
+
+- Service jar files
+- jar files for codebase
+- Configuration file
+    - Indicates the service class and the name of the permissions file, as
+    well as which jars are part of the codebase and classpath.
+- deployment descriptor.
+- Permissions file (defines maximum permissions required)
+
+The file should be named ending in a '.ssar' extension (service starter archive)
+and placed in the appropriate container profile's deployment directory (e.g.
+default/deploy/reggie.ssar).
+
+Deployment
+----------
+When the starter service deployer finds the archive, it:
+- unpacks the archive into a working directory
+- Creates a classloader that includes the jar files called out in the
+starter service deployer's configuration file (this will typically include
+'jsk-platform.jar', 'jdk-lib.jar', and 'RiverContainerLiaison.jar', plus the
+jar files referenced in the deployed service's 'service.properties' file.  This
+classloader will be annotated with a codebase that allows all the jar files in
+the deployer config file's codebase element, plus all the jar files called out
+in the service configuration file.
+- Registers the appropriate codebase files with the codebase service.
+- Instantiates the service and runs it.
\ No newline at end of file