activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1465001 - in /activemq/activemq-apollo/trunk: apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Run.scala apollo-util/src/main/scala/org/apache/activemq/apollo/util/Scala2JavaHelper.scala
Date Fri, 05 Apr 2013 15:09:11 GMT
Author: chirino
Date: Fri Apr  5 15:09:11 2013
New Revision: 1465001

URL: http://svn.apache.org/r1465001
Log:
If bouncycastle is in the classpath, add it as a security provider.

Modified:
    activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Run.scala
    activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/Scala2JavaHelper.scala

Modified: activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Run.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Run.scala?rev=1465001&r1=1465000&r2=1465001&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Run.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Run.scala
Fri Apr  5 15:09:11 2013
@@ -27,9 +27,12 @@ import org.apache.log4j.PropertyConfigur
 import java.io.{FileInputStream, File}
 import java.util.logging.LogManager
 import org.apache.activemq.apollo.dto.BrokerDTO
-import collection.mutable.ListBuffer
+import scala.collection.mutable.ListBuffer
 import java.lang.Thread.UncaughtExceptionHandler
 import java.lang.Throwable
+import java.security.{Security, Provider}
+import scala._
+import scala.AnyRef
 
 /**
  * The apollo run command
@@ -89,6 +92,17 @@ class Run extends Action {
 
       def println(value:String) = session.getConsole.println(value)
 
+      // Use bouncycastle if it's installed.
+      try {
+        var loader: ClassLoader = getClass.getClassLoader
+        var clazz: Class[_] = loader.loadClass("org.bouncycastle.jce.provider.BouncyCastleProvider")
+        val bouncycastle_provider = clazz.newInstance().asInstanceOf[Provider]
+        Security.insertProviderAt(bouncycastle_provider, 2)
+        println("Loaded the Bouncy Castle security provider.")
+      } catch {
+        case e:Throwable => // ignore, we can live without bouncycastle
+      }
+
       // Load the configs and start the brokers up.
       println("Loading configuration file '%s'.".format(conf))
 

Modified: activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/Scala2JavaHelper.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/Scala2JavaHelper.scala?rev=1465001&r1=1465000&r2=1465001&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/Scala2JavaHelper.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/Scala2JavaHelper.scala
Fri Apr  5 15:09:11 2013
@@ -16,7 +16,6 @@
  */
 package org.apache.activemq.apollo.util
 
-import org.apache.activemq.apollo.util.Log
 import scala.Function1
 import scala.runtime.BoxedUnit
 



Mime
View raw message