river-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtra...@apache.org
Subject svn commit: r1645728 - in /river/river-examples/river-examples/trunk/browser: ./ src/main/java/org/apache/river/examples/browser/ src/test/java/ src/test/java/org/ src/test/java/org/apache/ src/test/java/org/apache/river/ src/test/java/org/apache/river...
Date Mon, 15 Dec 2014 19:34:49 GMT
Author: gtrasuk
Date: Mon Dec 15 19:34:49 2014
New Revision: 1645728

URL: http://svn.apache.org/r1645728
Log:
River-examples is able to run the browser successfully.

Added:
    river/river-examples/river-examples/trunk/browser/src/main/java/org/apache/river/examples/browser/ShowSecuritySetup.java
    river/river-examples/river-examples/trunk/browser/src/test/java/
    river/river-examples/river-examples/trunk/browser/src/test/java/org/
    river/river-examples/river-examples/trunk/browser/src/test/java/org/apache/
    river/river-examples/river-examples/trunk/browser/src/test/java/org/apache/river/
    river/river-examples/river-examples/trunk/browser/src/test/java/org/apache/river/examples/
    river/river-examples/river-examples/trunk/browser/src/test/java/org/apache/river/examples/browser/
Modified:
    river/river-examples/river-examples/trunk/browser/pom.xml
    river/river-examples/river-examples/trunk/browser/src/main/java/org/apache/river/examples/browser/Browser.java

Modified: river/river-examples/river-examples/trunk/browser/pom.xml
URL: http://svn.apache.org/viewvc/river/river-examples/river-examples/trunk/browser/pom.xml?rev=1645728&r1=1645727&r2=1645728&view=diff
==============================================================================
--- river/river-examples/river-examples/trunk/browser/pom.xml (original)
+++ river/river-examples/river-examples/trunk/browser/pom.xml Mon Dec 15 19:34:49 2014
@@ -36,6 +36,29 @@
             <groupId>org.apache.river</groupId>
             <artifactId>outrigger-dl</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.river.tools.rt</groupId>
+            <artifactId>start</artifactId>
+            <version>1.0-SNAPSHOT</version>
+        </dependency>
     </dependencies>
 
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                
+                <configuration>
+                    <archive>
+                        <manifest>
+                            <addClasspath>true</addClasspath>
+                            <mainClass>org.apache.river.examples.browser.Browser</mainClass>
+                        </manifest>
+                    </archive>
+                </configuration>
+               
+            </plugin>
+        </plugins>
+    </build>
 </project>

Modified: river/river-examples/river-examples/trunk/browser/src/main/java/org/apache/river/examples/browser/Browser.java
URL: http://svn.apache.org/viewvc/river/river-examples/river-examples/trunk/browser/src/main/java/org/apache/river/examples/browser/Browser.java?rev=1645728&r1=1645727&r2=1645728&view=diff
==============================================================================
--- river/river-examples/river-examples/trunk/browser/src/main/java/org/apache/river/examples/browser/Browser.java
(original)
+++ river/river-examples/river-examples/trunk/browser/src/main/java/org/apache/river/examples/browser/Browser.java
Mon Dec 15 19:34:49 2014
@@ -22,7 +22,7 @@ import com.sun.jini.config.Config;
 import com.sun.jini.logging.Levels;
 import com.sun.jini.outrigger.JavaSpaceAdmin;
 import com.sun.jini.proxy.BasicProxyTrustVerifier;
-import com.sun.jini.start.LifeCycle;
+import org.apache.river.tools.rt.start.LifeCycle;
 import java.awt.BorderLayout;
 import java.awt.Component;
 import java.awt.event.ActionEvent;
@@ -137,7 +137,7 @@ import net.jini.space.JavaSpace;
  * @author Sun Microsystems, Inc.
  */
 public class Browser extends JFrame {
-    static final String BROWSER = "com.sun.jini.example.browser";
+    static final String BROWSER = Browser.class.getPackage().getName();
     static final Logger logger = Logger.getLogger(BROWSER);
 
     private transient SecurityContext ctx;

Added: river/river-examples/river-examples/trunk/browser/src/main/java/org/apache/river/examples/browser/ShowSecuritySetup.java
URL: http://svn.apache.org/viewvc/river/river-examples/river-examples/trunk/browser/src/main/java/org/apache/river/examples/browser/ShowSecuritySetup.java?rev=1645728&view=auto
==============================================================================
--- river/river-examples/river-examples/trunk/browser/src/main/java/org/apache/river/examples/browser/ShowSecuritySetup.java
(added)
+++ river/river-examples/river-examples/trunk/browser/src/main/java/org/apache/river/examples/browser/ShowSecuritySetup.java
Mon Dec 15 19:34:49 2014
@@ -0,0 +1,59 @@
+/*
+ * 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.
+ */
+package org.apache.river.examples.browser;
+
+import java.security.Policy;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import net.jini.security.policy.DynamicPolicyProvider;
+import net.jini.security.policy.PolicyInitializationException;
+
+/**
+ *
+ * This is a quick class to print out the security manager and policy provider,
+ * primarily to verify whether a command line invocation is working correctly.
+ */
+public class ShowSecuritySetup {
+
+    public static void main(String[] args) {
+        SecurityManager securityManager = System.getSecurityManager();
+        if (securityManager == null) {
+            System.out.println("No security manager installed.");
+            return;
+        }
+        System.out.println("Security Manager is " + System.getSecurityManager().getClass().getName());
+        Policy policy = Policy.getPolicy();
+        System.out.println("Policy is " + policy.getClass().getName());
+        try {
+            Class dynPolicyClass = Class.forName("net.jini.security.policy.DynamicPolicyProvider");
+            System.out.println("Loaded policy provider class " + dynPolicyClass.getName());
+        } catch (ClassNotFoundException ex) {
+            System.out.println("Couldn't find DynamicPolicyProvider.");
+        }
+        try {
+            System.out.println("Attempting to set the policy...");
+            policy = new DynamicPolicyProvider();
+            Policy.setPolicy(policy);
+            policy = Policy.getPolicy();
+            System.out.println("Policy is " + policy.getClass().getName());
+        } catch (PolicyInitializationException ex) {
+            Logger.getLogger(ShowSecuritySetup.class.getName()).log(Level.SEVERE, null, ex);
+        }
+
+    }
+}



Mime
View raw message