Continuing work on restructuring the River Surrogate Container skunkworks project into a Maven build.
As of this commit, - the classes in river-container-core build OK, but the tests fail because they are still looking for files in locations that are not yet present in the Maven build. - Reggie-module sub-project builds a jar file that contains the Reggie module. -Work continues on building the test-container. Project: http://git-wip-us.apache.org/repos/asf/river-container/repo Commit: http://git-wip-us.apache.org/repos/asf/river-container/commit/d9db78ac Tree: http://git-wip-us.apache.org/repos/asf/river-container/tree/d9db78ac Diff: http://git-wip-us.apache.org/repos/asf/river-container/diff/d9db78ac Branch: refs/heads/master Commit: d9db78ac2b9429c996beb01d81fd852231906aaf Parents: 7e747be Author: Greg Trasuk <[email protected]> Authored: Wed Jul 31 09:50:28 2013 -0400 Committer: Greg Trasuk <[email protected]> Committed: Wed Jul 31 09:50:28 2013 -0400 ---------------------------------------------------------------------- pom.xml | 4 +- reggie-module/pom.xml | 55 +++++++++++++ reggie-module/src/assemble/module.xml | 39 +++++++++ reggie-module/src/main/root/reggie.config | 12 +++ reggie-module/src/main/root/start.properties | 20 +++++ river-container-core/pom.xml | 4 +- test-container/pom.xml | 60 ++++++++++++++ test-container/src/assemble/test-container.xml | 25 ++++++ .../profile/default/class-server.properties | 17 ++++ .../src/main/root/profile/default/config.xml | 61 ++++++++++++++ .../default/deploy-privileged/readme.txt | 2 + .../main/root/profile/default/deploy/readme.txt | 2 + .../root/profile/default/service-starter.cfg | 83 ++++++++++++++++++++ 13 files changed, 381 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/river-container/blob/d9db78ac/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 10f4733..fe9fe4c 100644 --- a/pom.xml +++ b/pom.xml @@ -1,12 +1,14 @@ <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> - <groupId>org.apache.river</groupId> + <groupId>org.apache.river.container</groupId> <artifactId>river-container</artifactId> <version>1.0-SNAPSHOT</version> <packaging>pom</packaging> <name>river-container</name> <modules> <module>river-container-core</module> + <module>test-container</module> + <module>reggie-module</module> </modules> </project> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/river-container/blob/d9db78ac/reggie-module/pom.xml ---------------------------------------------------------------------- diff --git a/reggie-module/pom.xml b/reggie-module/pom.xml new file mode 100644 index 0000000..a80bce6 --- /dev/null +++ b/reggie-module/pom.xml @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <artifactId>river-container</artifactId> + <groupId>org.apache.river.container</groupId> + <version>1.0-SNAPSHOT</version> + </parent> + <groupId>org.apache.river.container</groupId> + <artifactId>reggie-module</artifactId> + <version>1.0-SNAPSHOT</version> + <packaging>pom</packaging> + <name>reggie-module</name> + + <dependencies> + <dependency> + <groupId>org.apache.river</groupId> + <artifactId>reggie</artifactId> + <version>2.2.1</version> + <scope>compile</scope> + </dependency> + + <dependency> + <groupId>org.apache.river</groupId> + <artifactId>reggie-dl</artifactId> + <version>2.2.1</version> + <scope>compile</scope> + </dependency> + + </dependencies> + + <build> + <plugins> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <configuration> + <descriptor>src/assemble/module.xml</descriptor> + <appendAssemblyId>false</appendAssemblyId> + </configuration> + <executions> + <execution> + <id>ssar</id> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + + </execution> + </executions> + </plugin> + + </plugins> + </build> + +</project> http://git-wip-us.apache.org/repos/asf/river-container/blob/d9db78ac/reggie-module/src/assemble/module.xml ---------------------------------------------------------------------- diff --git a/reggie-module/src/assemble/module.xml b/reggie-module/src/assemble/module.xml new file mode 100644 index 0000000..2837409 --- /dev/null +++ b/reggie-module/src/assemble/module.xml @@ -0,0 +1,39 @@ +<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd"> + <id>ssar</id> + + <formats> + <format>jar</format> + </formats> + <includeBaseDirectory>false</includeBaseDirectory> + + <fileSets> + + <fileSet> + <directory>${basedir}/src/main/root</directory> + <includes> + <include>**/**</include> + <include>*</include> + </includes> + <outputDirectory>/</outputDirectory> + </fileSet> + + </fileSets> + <dependencySets> + <dependencySet> + <outputDirectory>/lib</outputDirectory> + <includes> + <include>org.apache.river:reggie</include> + </includes> + </dependencySet> + + <dependencySet> + <outputDirectory>/lib-dl</outputDirectory> + <includes> + <include>org.apache.river:reggie-dl</include> + </includes> + </dependencySet> + </dependencySets> + +</assembly> http://git-wip-us.apache.org/repos/asf/river-container/blob/d9db78ac/reggie-module/src/main/root/reggie.config ---------------------------------------------------------------------- diff --git a/reggie-module/src/main/root/reggie.config b/reggie-module/src/main/root/reggie.config new file mode 100644 index 0000000..4d3e4be --- /dev/null +++ b/reggie-module/src/main/root/reggie.config @@ -0,0 +1,12 @@ +import net.jini.jeri.BasicILFactory; +import net.jini.jeri.BasicJeriExporter; +import net.jini.jeri.tcp.TcpServerEndpoint; + +com.sun.jini.reggie { + + initialLookupGroups = new String[] {$discoveryGroup}; + initialMemberGroups = new String[] {$discoveryGroup}; + + serverExporter = new BasicJeriExporter(TcpServerEndpoint.getInstance(0), + new BasicILFactory()); +} http://git-wip-us.apache.org/repos/asf/river-container/blob/d9db78ac/reggie-module/src/main/root/start.properties ---------------------------------------------------------------------- diff --git a/reggie-module/src/main/root/start.properties b/reggie-module/src/main/root/start.properties new file mode 100644 index 0000000..394df4b --- /dev/null +++ b/reggie-module/src/main/root/start.properties @@ -0,0 +1,20 @@ + + # 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. + # + +startClass=com.sun.jini.reggie.TransientRegistrarImpl +startParameters=reggie.config http://git-wip-us.apache.org/repos/asf/river-container/blob/d9db78ac/river-container-core/pom.xml ---------------------------------------------------------------------- diff --git a/river-container-core/pom.xml b/river-container-core/pom.xml index d99b171..2c62f54 100644 --- a/river-container-core/pom.xml +++ b/river-container-core/pom.xml @@ -3,11 +3,11 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <modelVersion>4.0.0</modelVersion> <parent> - <groupId>org.apache.river</groupId> + <groupId>org.apache.river.container</groupId> <artifactId>river-container</artifactId> <version>1.0-SNAPSHOT</version> </parent> - <groupId>org.apache.river</groupId> + <groupId>org.apache.river.container</groupId> <artifactId>river-container-core</artifactId> <version>1.0-SNAPSHOT</version> <name>river-container-core</name> http://git-wip-us.apache.org/repos/asf/river-container/blob/d9db78ac/test-container/pom.xml ---------------------------------------------------------------------- diff --git a/test-container/pom.xml b/test-container/pom.xml new file mode 100644 index 0000000..995c784 --- /dev/null +++ b/test-container/pom.xml @@ -0,0 +1,60 @@ +<?xml version="1.0"?> +<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.river.container</groupId> + <artifactId>river-container</artifactId> + <version>1.0-SNAPSHOT</version> + </parent> + <groupId>org.apache.river.container</groupId> + <artifactId>test-container</artifactId> + <version>1.0-SNAPSHOT</version> + <name>test-container</name> + <url>http://maven.apache.org</url> + <packaging>pom</packaging> + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + </properties> + <dependencies> + <dependency> + <groupId>org.apache.river.container</groupId> + <artifactId>river-container-core</artifactId> + <version>1.0-SNAPSHOT</version> + <scope>compile</scope> + </dependency> + + <dependency> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <version>1.1.3</version> + </dependency> + <dependency> + <groupId>commons-vfs</groupId> + <artifactId>commons-vfs</artifactId> + <version>1.0</version> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <executions> + <execution> + <id>test-container</id> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + <configuration> + <descriptors> + <descriptor>src/assemble/test-container.xml</descriptor> + </descriptors> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> http://git-wip-us.apache.org/repos/asf/river-container/blob/d9db78ac/test-container/src/assemble/test-container.xml ---------------------------------------------------------------------- diff --git a/test-container/src/assemble/test-container.xml b/test-container/src/assemble/test-container.xml new file mode 100644 index 0000000..11b04fd --- /dev/null +++ b/test-container/src/assemble/test-container.xml @@ -0,0 +1,25 @@ +<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd"> + <id>test-container</id> + <formats> + <format>dir</format> + </formats> + <includeBaseDirectory>false</includeBaseDirectory> + + <fileSets> + <fileSet> + <outputDirectory>/</outputDirectory> + <directory>src/main/root</directory> + </fileSet> + </fileSets> + <dependencySets> + <dependencySet> + <outputDirectory>/lib</outputDirectory> + <includes> + <include>*:*</include> + </includes> + </dependencySet> + </dependencySets> + +</assembly> http://git-wip-us.apache.org/repos/asf/river-container/blob/d9db78ac/test-container/src/main/root/profile/default/class-server.properties ---------------------------------------------------------------------- diff --git a/test-container/src/main/root/profile/default/class-server.properties b/test-container/src/main/root/profile/default/class-server.properties new file mode 100644 index 0000000..6957c40 --- /dev/null +++ b/test-container/src/main/root/profile/default/class-server.properties @@ -0,0 +1,17 @@ +# 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. + # +initialPort=8080 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/river-container/blob/d9db78ac/test-container/src/main/root/profile/default/config.xml ---------------------------------------------------------------------- diff --git a/test-container/src/main/root/profile/default/config.xml b/test-container/src/main/root/profile/default/config.xml new file mode 100644 index 0000000..06108ed --- /dev/null +++ b/test-container/src/main/root/profile/default/config.xml @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + Document : config.xml + Created on : December 10, 2010, 6:39 PM + Author : trasukg + Description: + 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' + xsi:schemaLocation='http://river.apache.org/xml/ns/container/config/1.0 file:/home/trasukg/development/surrogate/src/schemas/config.xsd'> + <cfg:property name="deploymentDirectory" value="deploy"/> + + <cfg:property name="defaultDiscoveryGroup" value="RiverContainerDefault"/> + <cfg:component class="org.apache.river.container.work.ContextualWorkManager"/> + <cfg:component class="org.apache.river.container.work.BasicWorkManager"/> + <cfg:component class="org.apache.river.container.codebase.ClassServer"/> + + <!-- Deployer for 'service-starter'-style applications. --> + <cfg:component class="org.apache.river.container.deployer.StarterServiceDeployer"> + <cfg:property name="config" value="service-starter.cfg"/> + <cfg:property name="deployDirectory" value="deploy"/> + </cfg:component> + + <!-- Deployer for applications that are in the 'deploy' directory + at startup. --> + <cfg:component class="org.apache.river.container.deployer.StartupDeployer"> + <cfg:property name="config" value="service-starter.cfg"/> + <cfg:property name="deployDirectory" value="deploy"/> + </cfg:component> + + <!-- Deployer for 'system apps' like the remote deployment service + <cfg:component class="org.apache.river.container.deployer.StarterServiceDeployer"> + <cfg:property name="config" value="privileged-services.cfg"/> + <cfg:property name="deployDirectory" value="deploy-privileged"/> + </cfg:component> + --> + + <cfg:component class="org.apache.river.container.ShowContextToConsole"/> +</cfg:container-config> http://git-wip-us.apache.org/repos/asf/river-container/blob/d9db78ac/test-container/src/main/root/profile/default/deploy-privileged/readme.txt ---------------------------------------------------------------------- diff --git a/test-container/src/main/root/profile/default/deploy-privileged/readme.txt b/test-container/src/main/root/profile/default/deploy-privileged/readme.txt new file mode 100644 index 0000000..eb900da --- /dev/null +++ b/test-container/src/main/root/profile/default/deploy-privileged/readme.txt @@ -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 http://git-wip-us.apache.org/repos/asf/river-container/blob/d9db78ac/test-container/src/main/root/profile/default/deploy/readme.txt ---------------------------------------------------------------------- diff --git a/test-container/src/main/root/profile/default/deploy/readme.txt b/test-container/src/main/root/profile/default/deploy/readme.txt new file mode 100644 index 0000000..eb900da --- /dev/null +++ b/test-container/src/main/root/profile/default/deploy/readme.txt @@ -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 http://git-wip-us.apache.org/repos/asf/river-container/blob/d9db78ac/test-container/src/main/root/profile/default/service-starter.cfg ---------------------------------------------------------------------- diff --git a/test-container/src/main/root/profile/default/service-starter.cfg b/test-container/src/main/root/profile/default/service-starter.cfg new file mode 100644 index 0000000..7c6cff7 --- /dev/null +++ b/test-container/src/main/root/profile/default/service-starter.cfg @@ -0,0 +1,83 @@ +/* + * 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. + */ + +// Sample file that our policy file parser should be able to process. + +// Grants given to all applications. +grant { + //java.security.AllPermission; + //java.io.FilePermission "${serviceArchive}" "read"; + java.io.FilePermission "-" "read"; + java.net.SocketPermission "*" "connect,listen,accept,resolve"; + + // Required for VFSFileManager + java.util.PropertyPermission "java.io.tmpdir" "read"; + java.util.PropertyPermission "os.*" "read"; + java.util.PropertyPermission "path.*" "read"; + java.lang.RuntimePermission "getClassLoader"; + java.lang.RuntimePermission "setContextClassLoader"; + /* net.jini.security.Security requires createSecurityManager, but we + don't grant 'setSecurityManager'. */ + java.lang.RuntimePermission "createSecurityManager"; + java.lang.RuntimePermission "getProtectionDomain"; + java.lang.RuntimePermission "setFactory"; + java.lang.RuntimePermission "modifyThread"; + java.lang.RuntimePermission "modifyThreadGroup"; + java.security.SecurityPermission "getDomainCombiner"; + java.security.SecurityPermission "createAccessControlContext"; + java.security.SecurityPermission "getPolicy"; + net.jini.security.policy.UmbrellaGrantPermission; + com.sun.jini.thread.ThreadPoolPermission "getSystemThreadPool"; + com.sun.jini.thread.ThreadPoolPermission "getUserThreadPool"; + com.sun.jini.discovery.internal.EndpointInternalsPermission "set"; + com.sun.jini.discovery.internal.EndpointInternalsPermission "get"; + java.lang.reflect.ReflectPermission "suppressAccessChecks"; + net.jini.export.ExportPermission "exportRemoteInterface.*"; + net.jini.discovery.DiscoveryPermission "*"; + java.lang.RuntimePermission "shutdownHooks"; + java.util.PropertyPermission "*" "read"; +} + +classloader { + // Variables required to set up the application classloader. + //For a privileged application deployer, parent=containerClassLoader; + parent systemClassLoader; + + jars { + 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/*") + } + + codebase {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
