Author: gtrasuk
Date: Tue Apr  3 04:00:28 2012
New Revision: 1308672

URL: http://svn.apache.org/viewvc?rev=1308672&view=rev
Log:
Added changes to test file for policy parser.  Policy parser will be extended 
to parse a complete configuration for the service-starter deployer, including 
classpath configuration, initialization of the application's Configuration 
special values and the values currently held in 'service-starter.properties'.  
Decoupling this setup from the code makes it simple to allow for "privileged" 
service deployments that can manipulate the container; simply have another 
deployer instance that is setup to use the container's classloader as its 
parent, and also convey the container context into the configuration.

Also added in the deploy and deploy-privileged folders into the test 
configuration.

Added:
    river/jtsk/skunk/surrogate/testfiles/testroot/profile/default/deploy/
    
river/jtsk/skunk/surrogate/testfiles/testroot/profile/default/deploy-privileged/
    
river/jtsk/skunk/surrogate/testfiles/testroot/profile/default/deploy-privileged/readme.txt
    
river/jtsk/skunk/surrogate/testfiles/testroot/profile/default/deploy/readme.txt
Modified:
    river/jtsk/skunk/surrogate/src/org/apache/river/container/core-config.xml
    
river/jtsk/skunk/surrogate/test/org/apache/river/container/security/SecurityManagerTest.java
    
river/jtsk/skunk/surrogate/test/org/apache/river/container/security/sample.policy
    river/jtsk/skunk/surrogate/testfiles/testroot/profile/default/config.xml

Modified: 
river/jtsk/skunk/surrogate/src/org/apache/river/container/core-config.xml
URL: 
http://svn.apache.org/viewvc/river/jtsk/skunk/surrogate/src/org/apache/river/container/core-config.xml?rev=1308672&r1=1308671&r2=1308672&view=diff
==============================================================================
--- river/jtsk/skunk/surrogate/src/org/apache/river/container/core-config.xml 
(original)
+++ river/jtsk/skunk/surrogate/src/org/apache/river/container/core-config.xml 
Tue Apr  3 04:00:28 2012
@@ -5,7 +5,7 @@
     Created on : December 10, 2010, 6:39 PM
     Author     : trasukg
     Description:
-        This is the core congifuration that is processed by the
+        This is the core configuration that is processed by the
         Bootstrap system prior to processing the profile's config.xml
 
         Items defined in this config are subject to being overwritten by the

Modified: 
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=1308672&r1=1308671&r2=1308672&view=diff
==============================================================================
--- 
river/jtsk/skunk/surrogate/test/org/apache/river/container/security/SecurityManagerTest.java
 (original)
+++ 
river/jtsk/skunk/surrogate/test/org/apache/river/container/security/SecurityManagerTest.java
 Tue Apr  3 04:00:28 2012
@@ -65,4 +65,8 @@ public class SecurityManagerTest {
         /* Shutdown the container. */
         p.destroy();
     }
+
+    private void waitForContainerStartupMessage(InputStream pOut) {
+        throw new UnsupportedOperationException("Not yet implemented");
+    }
 }

Modified: 
river/jtsk/skunk/surrogate/test/org/apache/river/container/security/sample.policy
URL: 
http://svn.apache.org/viewvc/river/jtsk/skunk/surrogate/test/org/apache/river/container/security/sample.policy?rev=1308672&r1=1308671&r2=1308672&view=diff
==============================================================================
--- 
river/jtsk/skunk/surrogate/test/org/apache/river/container/security/sample.policy
 (original)
+++ 
river/jtsk/skunk/surrogate/test/org/apache/river/container/security/sample.policy
 Tue Apr  3 04:00:28 2012
@@ -1,5 +1,41 @@
 // Sample file that our policy file parser should be able to process.
 
+// Grants given to all applications.
 grant {
+    java.security.FilePermission "${serviceArchive}" "read";
+}
+
+// If the archive includes 'security.policy', grant the lesser of maximal
+// and the requests in 'security.policy'.  Decline to start the app if 
+// requested grants exceed the maximal grant below.
+maximal grant {
     java.security.AllPermission;
+}
+
+classloader {
+    // Variables required to set up the application classloader.
+    //For a privileged application deployer, parent=containerClassLoader;
+    parent=systemClassLoader;
+
+    platformJars= 
+        commons-vfs-1.0.jar
+        commons-logging-1.1.1.jar
+        jsk-platform.jar
+        jsk-lib.jar
+        jsk-resources.jar
+        RiverSurrogate.jar(org.apache.river.container.liaison.Strings,
+            org.apache.river.container.liaison.VirtualFileSystemConfiguration, 
+            
org.apache.river.container.liaison.VirtualFileSystemConfiguration$MyConfigurationFile,
 
+            "META-INF/services/*");
+
+    platformCodebase=jsk-dl.jar;
+}
+
+configuration {
+    // Anything on the left-hand side of '=' is set into the application config
+    // as a "special variable, accessible through '$name'.
+    discoveryGroup=defaultDiscoveryGroup;
+    
+    // For privileged deployer, include 
+    // context=context;
 }
\ No newline at end of file

Modified: 
river/jtsk/skunk/surrogate/testfiles/testroot/profile/default/config.xml
URL: 
http://svn.apache.org/viewvc/river/jtsk/skunk/surrogate/testfiles/testroot/profile/default/config.xml?rev=1308672&r1=1308671&r2=1308672&view=diff
==============================================================================
--- river/jtsk/skunk/surrogate/testfiles/testroot/profile/default/config.xml 
(original)
+++ river/jtsk/skunk/surrogate/testfiles/testroot/profile/default/config.xml 
Tue Apr  3 04:00:28 2012
@@ -5,8 +5,27 @@
     Created on : December 10, 2010, 6:39 PM
     Author     : trasukg
     Description:
-        Purpose of the document follows.
+        Configuration file in the 'profile' directory selected by the 
+        command line.
 -->
+<!--
+    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.
+
+ -->
 
 <cfg:container-config  xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
    xmlns:cfg='http://river.apache.org/xml/ns/container/config/1.0'
@@ -18,6 +37,17 @@
     </cfg:discovery-context>
     <cfg:component class="org.apache.river.container.work.BasicWorkManager"/>
     <cfg:component class="org.apache.river.container.codebase.ClassServer"/>
-    <cfg:component class="org.apache.river.container.StarterServiceDeployer"/>
+
+    <!-- Deployer for 'service-starter'-style applications. -->
+    <cfg:component class="org.apache.river.container.StarterServiceDeployer">
+        <property name="policy" value="service-starter.policy"/>
+        <property name="deployDirectory" value="deploy"/>
+    </cfg:component>
+    
+    <!-- Deployer for 'system apps' like the remote deployment service -->
+    <cfg:component class="org.apache.river.container.StarterServiceDeployer">
+        <property name="policy" value="privileged-services.policy"/>
+        <property name="deployDirectory" value="deploy-privileged"/>
+    </cfg:component>
     <cfg:component class="org.apache.river.container.ShowContextToConsole"/>
 </cfg:container-config>

Added: 
river/jtsk/skunk/surrogate/testfiles/testroot/profile/default/deploy-privileged/readme.txt
URL: 
http://svn.apache.org/viewvc/river/jtsk/skunk/surrogate/testfiles/testroot/profile/default/deploy-privileged/readme.txt?rev=1308672&view=auto
==============================================================================
--- 
river/jtsk/skunk/surrogate/testfiles/testroot/profile/default/deploy-privileged/readme.txt
 (added)
+++ 
river/jtsk/skunk/surrogate/testfiles/testroot/profile/default/deploy-privileged/readme.txt
 Tue Apr  3 04:00:28 2012
@@ -0,0 +1,2 @@
+This file is only here to ensure that the parent directory is 
+preserved in version control.
\ No newline at end of file

Added: 
river/jtsk/skunk/surrogate/testfiles/testroot/profile/default/deploy/readme.txt
URL: 
http://svn.apache.org/viewvc/river/jtsk/skunk/surrogate/testfiles/testroot/profile/default/deploy/readme.txt?rev=1308672&view=auto
==============================================================================
--- 
river/jtsk/skunk/surrogate/testfiles/testroot/profile/default/deploy/readme.txt 
(added)
+++ 
river/jtsk/skunk/surrogate/testfiles/testroot/profile/default/deploy/readme.txt 
Tue Apr  3 04:00:28 2012
@@ -0,0 +1,2 @@
+This file is only here to ensure that the parent directory is 
+preserved in version control.
\ No newline at end of file


Reply via email to