You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2013/06/18 17:51:40 UTC
svn commit: r1494181 - in /activemq/activemq-apollo/trunk: ./
apollo-broker/src/main/resources/org/
apollo-broker/src/main/resources/org/apache/
apollo-broker/src/main/resources/org/apache/activemq/
apollo-broker/src/main/resources/org/apache/activemq/...
Author: chirino
Date: Tue Jun 18 15:51:39 2013
New Revision: 1494181
URL: http://svn.apache.org/r1494181
Log:
Reorganizing bits around so that an Apollo instance can be created and booted within a user webapp more easily.
- Broker instance creation logic is now inside the broker module. And supports a couple more options so that the created broker can work well when inside a webapp.
- The JMX mbean can now be configured with the advertised web admin url.
- The web module now deploy it's webapp resources and classes a distinct jars for easier embedding in .war files.
- Added an example war module that embeds apollo.
Added:
activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/
activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/
activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/
activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/
activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/
activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/bin/
activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/bin/apollo-broker
- copied, changed from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/bin/apollo-broker
activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/bin/apollo-broker-service
- copied, changed from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/bin/apollo-broker-service
activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/bin/apollo-broker-service.xml
- copied, changed from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/bin/apollo-broker-service.xml
activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/bin/apollo-broker.cmd
- copied, changed from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/bin/apollo-broker.cmd
activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/etc/
activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/etc/apollo-ssl.xml
- copied, changed from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/apollo-ssl.xml
activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/etc/apollo.xml
- copied, changed from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/apollo.xml
activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/etc/black-list.txt
- copied, changed from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/black-list.txt
activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/etc/groups.properties
- copied, changed from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/groups.properties
activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/etc/log4j.properties
- copied, changed from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/log4j.properties
activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/etc/login.config
- copied, changed from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/login.config
activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/etc/users.properties
- copied, changed from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/users.properties
activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/BrokerCreate.scala (contents, props changed)
- copied, changed from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Create.scala
activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/
activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/Create.scala (with props)
activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/DashHelp.scala
- copied, changed from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/DashHelp.scala
activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/Decrypt.scala
- copied, changed from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Decrypt.scala
activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/DiskBenchmark.scala
- copied, changed from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/DiskBenchmark.scala
activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/Encrypt.scala
- copied, changed from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Encrypt.scala
activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/Exit.scala
- copied, changed from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Exit.scala
activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/Help.scala
- copied, changed from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Help.scala
activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/Helper.scala
- copied, changed from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Helper.scala
activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/Run.scala
- copied, changed from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Run.scala
activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/StoreExport.scala
- copied, changed from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/StoreExport.scala
activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/StoreImport.scala
- copied, changed from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/StoreImport.scala
activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/Version.scala
- copied, changed from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Version.scala
activemq/activemq-apollo/trunk/apollo-war/
activemq/activemq-apollo/trunk/apollo-war/pom.xml
activemq/activemq-apollo/trunk/apollo-war/src/
activemq/activemq-apollo/trunk/apollo-war/src/main/
activemq/activemq-apollo/trunk/apollo-war/src/main/webapp/
activemq/activemq-apollo/trunk/apollo-war/src/main/webapp/WEB-INF/
activemq/activemq-apollo/trunk/apollo-war/src/main/webapp/WEB-INF/web.xml
activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/ApolloApplication.scala
Removed:
activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/bin/apollo-broker
activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/bin/apollo-broker-service
activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/bin/apollo-broker-service.xml
activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/bin/apollo-broker.cmd
activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/apollo-ssl.xml
activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/apollo.xml
activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/black-list.txt
activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/groups.properties
activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/log4j.properties
activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/login.config
activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/users.properties
activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Create.scala
activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/DashHelp.scala
activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Decrypt.scala
activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/DiskBenchmark.scala
activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Encrypt.scala
activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Exit.scala
activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Help.scala
activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Helper.scala
activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Run.scala
activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/StoreExport.scala
activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/StoreImport.scala
activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Version.scala
Modified:
activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala
activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jetty/JettyWebServer.scala
activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jetty/WebSocketTransportFactory.scala
activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/OSGI-INF/blueprint/broker.xml
activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/osgi/BrokerService.scala
activemq/activemq-apollo/trunk/apollo-jmx/src/main/scala/org/apache/activemq/apollo/broker/jmx/JMXSystemServiceFactory.scala
activemq/activemq-apollo/trunk/apollo-jmx/src/main/scala/org/apache/activemq/apollo/broker/jmx/dto/JmxDTO.java
activemq/activemq-apollo/trunk/apollo-web/pom.xml
activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/Boot.scala
activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/WebModule.scala
activemq/activemq-apollo/trunk/pom.xml
Copied: activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/bin/apollo-broker (from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/bin/apollo-broker)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/bin/apollo-broker?p2=activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/bin/apollo-broker&p1=activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/bin/apollo-broker&r1=1492820&r2=1494181&rev=1494181&view=diff
==============================================================================
(empty)
Copied: activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/bin/apollo-broker-service (from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/bin/apollo-broker-service)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/bin/apollo-broker-service?p2=activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/bin/apollo-broker-service&p1=activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/bin/apollo-broker-service&r1=1492820&r2=1494181&rev=1494181&view=diff
==============================================================================
(empty)
Copied: activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/bin/apollo-broker-service.xml (from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/bin/apollo-broker-service.xml)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/bin/apollo-broker-service.xml?p2=activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/bin/apollo-broker-service.xml&p1=activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/bin/apollo-broker-service.xml&r1=1492820&r2=1494181&rev=1494181&view=diff
==============================================================================
(empty)
Copied: activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/bin/apollo-broker.cmd (from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/bin/apollo-broker.cmd)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/bin/apollo-broker.cmd?p2=activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/bin/apollo-broker.cmd&p1=activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/bin/apollo-broker.cmd&r1=1492820&r2=1494181&rev=1494181&view=diff
==============================================================================
(empty)
Copied: activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/etc/apollo-ssl.xml (from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/apollo-ssl.xml)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/etc/apollo-ssl.xml?p2=activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/etc/apollo-ssl.xml&p1=activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/apollo-ssl.xml&r1=1492820&r2=1494181&rev=1494181&view=diff
==============================================================================
(empty)
Copied: activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/etc/apollo.xml (from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/apollo.xml)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/etc/apollo.xml?p2=activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/etc/apollo.xml&p1=activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/apollo.xml&r1=1492820&r2=1494181&rev=1494181&view=diff
==============================================================================
(empty)
Copied: activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/etc/black-list.txt (from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/black-list.txt)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/etc/black-list.txt?p2=activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/etc/black-list.txt&p1=activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/black-list.txt&r1=1492820&r2=1494181&rev=1494181&view=diff
==============================================================================
(empty)
Copied: activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/etc/groups.properties (from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/groups.properties)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/etc/groups.properties?p2=activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/etc/groups.properties&p1=activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/groups.properties&r1=1492820&r2=1494181&rev=1494181&view=diff
==============================================================================
(empty)
Copied: activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/etc/log4j.properties (from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/log4j.properties)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/etc/log4j.properties?p2=activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/etc/log4j.properties&p1=activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/log4j.properties&r1=1492820&r2=1494181&rev=1494181&view=diff
==============================================================================
(empty)
Copied: activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/etc/login.config (from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/login.config)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/etc/login.config?p2=activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/etc/login.config&p1=activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/login.config&r1=1492820&r2=1494181&rev=1494181&view=diff
==============================================================================
(empty)
Copied: activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/etc/users.properties (from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/users.properties)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/etc/users.properties?p2=activemq/activemq-apollo/trunk/apollo-broker/src/main/resources/org/apache/activemq/apollo/broker/etc/users.properties&p1=activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/users.properties&r1=1492820&r2=1494181&rev=1494181&view=diff
==============================================================================
(empty)
Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala?rev=1494181&r1=1494180&r2=1494181&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala Tue Jun 18 15:51:39 2013
@@ -270,6 +270,12 @@ class Broker() extends BaseService with
@BeanProperty
var config: BrokerDTO = new BrokerDTO
+ /**
+ * A reference to a container that created the broker.
+ * This might something like an ServletContext or an OSGi service factory.
+ */
+ var container:AnyRef = _
+
config.virtual_hosts.add({
val rc = new VirtualHostDTO
rc.id = "default"
Copied: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/BrokerCreate.scala (from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Create.scala)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/BrokerCreate.scala?p2=activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/BrokerCreate.scala&p1=activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Create.scala&r1=1492820&r2=1494181&rev=1494181&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Create.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/BrokerCreate.scala Tue Jun 18 15:51:39 2013
@@ -14,47 +14,23 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.activemq.apollo.cli.commands
+package org.apache.activemq.apollo.broker
-import org.apache.felix.gogo.commands.{Action, Option => option, Argument => argument, Command => command}
-import org.fusesource.jansi.Ansi.Color._
-import org.fusesource.jansi.Ansi.Attribute._
-import Helper._
import java.io._
import org.apache.activemq.apollo.util.FileSupport._
import java.util.regex.{Pattern, Matcher}
-import org.apache.felix.service.command.CommandSession
import org.apache.activemq.apollo.broker.Broker
+import scala.Predef._
-object Create {
- val IS_WINDOWS = System.getProperty("os.name").toLowerCase().trim().startsWith("win");
-}
-
-/**
- * The apollo create command
- */
-@command(scope="apollo", name = "create", description = "creates a new broker instance")
-class Create extends Action {
+class BrokerCreate {
- import Create._
-
- @argument(name = "directory", description = "The instance directory to hold the broker's configuration and data", index=0, required=true)
var directory:File = _
-
- @option(name = "--host", description = "The host name of the broker")
var host:String = _
-
- @option(name = "--force", description = "Overwrite configuration at destination directory")
var force = false
-
- @option(name = "--home", description = "Directory where apollo is installed")
- val home: String = System.getProperty("apollo.home")
-
- @option(name = "--with-ssl", description = "Generate an SSL enabled configuraiton")
- val with_ssl = true
-
- @option(name = "--encoding", description = "The encoding that text files should use")
- val encoding = "UTF-8"
+ var base: String = _
+ var home: String = System.getProperty("apollo.home")
+ var with_ssl = true
+ var encoding = "UTF-8"
var broker_security_config =
"""
@@ -73,9 +49,12 @@ class Create extends Action {
var create_login_config = true
var create_log_config = true
- def execute(session: CommandSession) = {
+ var println = (value:Any)=>{}
+
+
+ val IS_WINDOWS = System.getProperty("os.name").toLowerCase().trim().startsWith("win");
- def println(value:Any) = session.getConsole.println(value)
+ def run() = {
try {
println("Creating apollo instance at: %s".format(directory))
@@ -88,7 +67,7 @@ class Create extends Action {
etc.mkdirs
if (create_log_config) {
- write("etc/log4j.properties", etc/"log4j.properties", false, true)
+ write("etc/log4j.properties", etc/"log4j.properties", true, true)
}
if ( create_login_config ) {
@@ -190,8 +169,8 @@ class Create extends Action {
} catch {
- case x:Helper.Failure=>
- println(ansi.a(INTENSITY_BOLD).fg(RED).a("ERROR: ").reset.a(x.getMessage))
+ case x:Exception =>
+ println("ERROR: "+x.getMessage)
}
null
@@ -204,7 +183,7 @@ class Create extends Action {
if( filter || text ) {
val out = new ByteArrayOutputStream()
- using(getClass.getResourceAsStream(source)) { in=>
+ using(this.getClass.getResourceAsStream(source)) { in=>
copy(in, out)
}
@@ -227,6 +206,10 @@ class Create extends Action {
replace("${java.home}", cp(System.getProperty("java.home")))
replace("${store_config}", store_config)
+ if( base !=null ) {
+ replace("${apollo.base}", base)
+ }
+
replace("${broker_security_config}", broker_security_config)
replace("${host_security_config}", host_security_config)
}
@@ -241,7 +224,7 @@ class Create extends Action {
} else {
using(new FileOutputStream(target)) { out=>
- using(getClass.getResourceAsStream(source)) { in=>
+ using(this.getClass.getResourceAsStream(source)) { in=>
copy(in, out)
}
}
@@ -250,7 +233,7 @@ class Create extends Action {
def can_load(name:String) = {
try {
- getClass.getClassLoader.loadClass(name)
+ this.getClass.getClassLoader.loadClass(name)
true
} catch {
case _:Throwable => false
@@ -308,4 +291,4 @@ class Create extends Action {
process.exitValue
}
-}
\ No newline at end of file
+}
Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jetty/JettyWebServer.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jetty/JettyWebServer.scala?rev=1494181&r1=1494180&r2=1494181&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jetty/JettyWebServer.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jetty/JettyWebServer.scala Tue Jun 18 15:51:39 2013
@@ -59,7 +59,13 @@ object JettyWebServerFactory extends Web
if( !enabled ) {
return null
}
- new JettyWebServer(broker)
+
+ broker.container match {
+ case sc:ServletContext =>
+ null
+ case null =>
+ new JettyWebServer(broker)
+ }
}
}
Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jetty/WebSocketTransportFactory.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jetty/WebSocketTransportFactory.scala?rev=1494181&r1=1494180&r2=1494181&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jetty/WebSocketTransportFactory.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jetty/WebSocketTransportFactory.scala Tue Jun 18 15:51:39 2013
@@ -58,7 +58,14 @@ object WebSocketTransportFactory extends
def bind(location: String): TransportServer = {
var uri: URI = new URI(location)
uri.getScheme match {
- case "ws" | "wss" => WsTransportServer(uri)
+ case "ws" | "wss" =>
+ try {
+ WsTransportServer(uri)
+ } catch {
+ // We might not have jetty on the class path.
+ case e:java.lang.NoClassDefFoundError =>
+ null
+ }
case _ => null
}
}
Modified: activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/OSGI-INF/blueprint/broker.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/OSGI-INF/blueprint/broker.xml?rev=1494181&r1=1494180&r2=1494181&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/OSGI-INF/blueprint/broker.xml (original)
+++ activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/OSGI-INF/blueprint/broker.xml Tue Jun 18 15:51:39 2013
@@ -32,13 +32,13 @@
<command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.0.0">
<command name="apollo/encrypt">
- <action class="org.apache.activemq.apollo.cli.commands.Encrypt"/>
+ <action class="org.apache.activemq.apollo.commands.Encrypt"/>
</command>
<command name="apollo/decrypt">
- <action class="org.apache.activemq.apollo.cli.commands.Decrypt"/>
+ <action class="org.apache.activemq.apollo.commands.Decrypt"/>
</command>
<command name="apollo/version">
- <action class="org.apache.activemq.apollo.cli.commands.Version"/>
+ <action class="org.apache.activemq.apollo.commands.Version"/>
</command>
</command-bundle>
Modified: activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/osgi/BrokerService.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/osgi/BrokerService.scala?rev=1494181&r1=1494180&r2=1494181&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/osgi/BrokerService.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/osgi/BrokerService.scala Tue Jun 18 15:51:39 2013
@@ -17,7 +17,7 @@
package org.apache.activemq.apollo.cli.osgi
-import org.apache.activemq.apollo.broker.Broker
+import org.apache.activemq.apollo.broker.{BrokerCreate, Broker}
import org.fusesource.hawtdispatch._
import org.apache.activemq.apollo.dto.{XmlCodec, BrokerDTO}
import org.osgi.framework._
@@ -26,7 +26,6 @@ import org.apache.activemq.apollo.util._
import FileSupport._
import java.util.{Hashtable, Dictionary, Properties}
import org.osgi.service.cm.{Configuration, ConfigurationAdmin}
-import org.apache.activemq.apollo.cli.commands.Create
import org.apache.felix.service.command.CommandSession
import java.io._
import java.lang.{UnsupportedOperationException, String}
@@ -64,8 +63,9 @@ object BrokerService extends Log {
info("Initializing apollo instance directory: "+basedir)
// Lets create a broker instance since it does not exist.
- val create = new Create()
+ val create = new BrokerCreate()
create.directory = basedir
+ create.home = null
// Lets just reuse Karaf's Logging and Authentication configurations
create.create_log_config = false
@@ -90,16 +90,7 @@ object BrokerService extends Log {
<config allow="admin"/>
</acl>
"""
- create.execute(new CommandSession(){
- def put(name: String, value: AnyRef) = throw new UnsupportedOperationException()
- def getKeyboard: InputStream = throw new UnsupportedOperationException()
- def get(name: String): AnyRef = throw new UnsupportedOperationException()
- def format(target: AnyRef, level: Int): CharSequence = throw new UnsupportedOperationException()
- def execute(commandline: CharSequence): AnyRef = throw new UnsupportedOperationException()
- def convert(`type` : Class[_], instance: AnyRef): AnyRef = throw new UnsupportedOperationException()
- def getConsole: PrintStream = new PrintStream(new ByteArrayOutputStream())
- def close() {}
- })
+ create.run()
}
// in case the config gets injected.
Added: activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/Create.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/Create.scala?rev=1494181&view=auto
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/Create.scala (added)
+++ activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/Create.scala Tue Jun 18 15:51:39 2013
@@ -0,0 +1,62 @@
+/**
+ * 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.activemq.apollo.cli.commands
+
+import org.apache.felix.gogo.commands.{Action, Option => option, Argument => argument, Command => command}
+import java.io._
+import org.apache.felix.service.command.CommandSession
+import scala.Predef._
+import org.apache.activemq.apollo.broker.BrokerCreate
+
+/**
+ * The apollo create command
+ */
+@command(scope = "apollo", name = "create", description = "creates a new broker instance")
+class Create extends Action {
+
+ @argument(name = "directory", description = "The instance directory to hold the broker's configuration and data", index=0, required=true)
+ var directory:File = _
+
+ @option(name = "--host", description = "The host name of the broker")
+ var host:String = _
+
+ @option(name = "--force", description = "Overwrite configuration at destination directory")
+ var force = false
+
+ @option(name = "--home", description = "Directory where apollo is installed")
+ var home: String = _
+
+ @option(name = "--with-ssl", description = "Generate an SSL enabled configuraiton")
+ var with_ssl = true
+
+ @option(name = "--encoding", description = "The encoding that text files should use")
+ var encoding:String = _
+
+ def execute(session: CommandSession) = {
+ val create = new BrokerCreate
+ if( directory!=null ) create.directory = directory
+ if( host!=null ) create.host = host
+ create.force = force
+ if( home!=null ) create.home = home
+ create.with_ssl = with_ssl
+ if( encoding!=null ) create.encoding = encoding
+ create.println = { value =>
+ session.getConsole.println(value)
+ }
+ create.run()
+ }
+}
\ No newline at end of file
Propchange: activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/Create.scala
------------------------------------------------------------------------------
svn:executable = *
Copied: activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/DashHelp.scala (from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/DashHelp.scala)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/DashHelp.scala?p2=activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/DashHelp.scala&p1=activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/DashHelp.scala&r1=1492820&r2=1494181&rev=1494181&view=diff
==============================================================================
(empty)
Copied: activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/Decrypt.scala (from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Decrypt.scala)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/Decrypt.scala?p2=activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/Decrypt.scala&p1=activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Decrypt.scala&r1=1492820&r2=1494181&rev=1494181&view=diff
==============================================================================
(empty)
Copied: activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/DiskBenchmark.scala (from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/DiskBenchmark.scala)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/DiskBenchmark.scala?p2=activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/DiskBenchmark.scala&p1=activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/DiskBenchmark.scala&r1=1492820&r2=1494181&rev=1494181&view=diff
==============================================================================
(empty)
Copied: activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/Encrypt.scala (from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Encrypt.scala)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/Encrypt.scala?p2=activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/Encrypt.scala&p1=activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Encrypt.scala&r1=1492820&r2=1494181&rev=1494181&view=diff
==============================================================================
(empty)
Copied: activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/Exit.scala (from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Exit.scala)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/Exit.scala?p2=activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/Exit.scala&p1=activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Exit.scala&r1=1492820&r2=1494181&rev=1494181&view=diff
==============================================================================
(empty)
Copied: activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/Help.scala (from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Help.scala)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/Help.scala?p2=activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/Help.scala&p1=activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Help.scala&r1=1492820&r2=1494181&rev=1494181&view=diff
==============================================================================
(empty)
Copied: activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/Helper.scala (from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Helper.scala)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/Helper.scala?p2=activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/Helper.scala&p1=activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Helper.scala&r1=1492820&r2=1494181&rev=1494181&view=diff
==============================================================================
(empty)
Copied: activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/Run.scala (from r1492820, 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/commands/Run.scala?p2=activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/Run.scala&p1=activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Run.scala&r1=1492820&r2=1494181&rev=1494181&view=diff
==============================================================================
(empty)
Copied: activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/StoreExport.scala (from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/StoreExport.scala)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/StoreExport.scala?p2=activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/StoreExport.scala&p1=activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/StoreExport.scala&r1=1492820&r2=1494181&rev=1494181&view=diff
==============================================================================
(empty)
Copied: activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/StoreImport.scala (from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/StoreImport.scala)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/StoreImport.scala?p2=activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/StoreImport.scala&p1=activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/StoreImport.scala&r1=1492820&r2=1494181&rev=1494181&view=diff
==============================================================================
(empty)
Copied: activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/Version.scala (from r1492820, activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Version.scala)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/Version.scala?p2=activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/commands/Version.scala&p1=activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Version.scala&r1=1492820&r2=1494181&rev=1494181&view=diff
==============================================================================
(empty)
Modified: activemq/activemq-apollo/trunk/apollo-jmx/src/main/scala/org/apache/activemq/apollo/broker/jmx/JMXSystemServiceFactory.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-jmx/src/main/scala/org/apache/activemq/apollo/broker/jmx/JMXSystemServiceFactory.scala?rev=1494181&r1=1494180&r2=1494181&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-jmx/src/main/scala/org/apache/activemq/apollo/broker/jmx/JMXSystemServiceFactory.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-jmx/src/main/scala/org/apache/activemq/apollo/broker/jmx/JMXSystemServiceFactory.scala Tue Jun 18 15:51:39 2013
@@ -47,7 +47,7 @@ class JMXSystemService(val broker: Broke
protected def _start(on_completed: Task) = {
if ( enabled && platform_mbean_server!=null ) {
- platform_mbean_server.registerMBean(new JmxBroker(broker), broker_object_name)
+ platform_mbean_server.registerMBean(new JmxBroker(broker, config), broker_object_name)
info("Registered Broker in JMX")
}
on_completed.run()
@@ -71,8 +71,8 @@ trait JmxBrokerMBean {
def getWebAdminUrl:String
}
-class JmxBroker(val broker: Broker) extends JmxBrokerMBean {
+class JmxBroker(val broker: Broker, val config:JmxDTO) extends JmxBrokerMBean {
def getVersion = Broker.version
def getState = broker.service_state.toString
- def getWebAdminUrl = broker.web_admin_url
+ def getWebAdminUrl = Option(config.admin_url).getOrElse(broker.web_admin_url)
}
Modified: activemq/activemq-apollo/trunk/apollo-jmx/src/main/scala/org/apache/activemq/apollo/broker/jmx/dto/JmxDTO.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-jmx/src/main/scala/org/apache/activemq/apollo/broker/jmx/dto/JmxDTO.java?rev=1494181&r1=1494180&r2=1494181&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-jmx/src/main/scala/org/apache/activemq/apollo/broker/jmx/dto/JmxDTO.java (original)
+++ activemq/activemq-apollo/trunk/apollo-jmx/src/main/scala/org/apache/activemq/apollo/broker/jmx/dto/JmxDTO.java Tue Jun 18 15:51:39 2013
@@ -38,6 +38,12 @@ public class JmxDTO extends CustomServic
@XmlAttribute
public Boolean enabled;
+ /**
+ * Administration URL for the broker service that gets advertised over JMX. If
+ * not set, it will be automatically calculated.
+ */
+ @XmlAttribute(name = "admin_url")
+ public String admin_url;
@Override
public boolean equals(Object o) {
@@ -47,6 +53,8 @@ public class JmxDTO extends CustomServic
JmxDTO jmxDTO = (JmxDTO) o;
+ if (admin_url != null ? !admin_url.equals(jmxDTO.admin_url) : jmxDTO.admin_url != null)
+ return false;
if (enabled != null ? !enabled.equals(jmxDTO.enabled) : jmxDTO.enabled != null)
return false;
@@ -57,6 +65,7 @@ public class JmxDTO extends CustomServic
public int hashCode() {
int result = super.hashCode();
result = 31 * result + (enabled != null ? enabled.hashCode() : 0);
+ result = 31 * result + (admin_url != null ? admin_url.hashCode() : 0);
return result;
}
}
\ No newline at end of file
Added: activemq/activemq-apollo/trunk/apollo-war/pom.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-war/pom.xml?rev=1494181&view=auto
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-war/pom.xml (added)
+++ activemq/activemq-apollo/trunk/apollo-war/pom.xml Tue Jun 18 15:51:39 2013
@@ -0,0 +1,236 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<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/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>apollo-scala</artifactId>
+ <version>99-trunk-SNAPSHOT</version>
+ <relativePath>../apollo-scala</relativePath>
+ </parent>
+
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>apollo-war</artifactId>
+ <packaging>war</packaging>
+ <version>99-trunk-SNAPSHOT</version>
+
+ <name>${project.artifactId}</name>
+ <description>Packages Apollo so it be be run in a Web container.</description>
+
+ <properties>
+ <jetty-port>8080</jetty-port>
+ </properties>
+
+ <dependencies>
+
+ <!-- Core Dependency -->
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>apollo-broker</artifactId>
+ <version>99-trunk-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>apollo-cli</artifactId>
+ <version>99-trunk-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>apollo-leveldb</artifactId>
+ <version>99-trunk-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.xerial.snappy</groupId>
+ <artifactId>snappy-java</artifactId>
+ <version>1.0.3</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.iq80.snappy</groupId>
+ <artifactId>snappy</artifactId>
+ <version>0.2</version>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>apollo-bdb</artifactId>
+ <version>99-trunk-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>apollo-stomp</artifactId>
+ <version>99-trunk-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>apollo-openwire</artifactId>
+ <version>99-trunk-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>apollo-mqtt</artifactId>
+ <version>99-trunk-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>apollo-amqp</artifactId>
+ <version>99-trunk-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>apollo-web</artifactId>
+ <version>99-trunk-SNAPSHOT</version>
+ <classifier>classes</classifier>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>apollo-jmx</artifactId>
+ <version>99-trunk-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jasypt</groupId>
+ <artifactId>jasypt</artifactId>
+ <version>${jasypt-version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>${slf4j-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>${slf4j-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>${log4j-version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-server</artifactId>
+ <version>${jersey-version}</version>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+
+ <plugins>
+
+ <!-- we are going to generate the webapp resources -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>2.3</version>
+ <configuration>
+ <warSourceDirectory>${project.build.directory}/webapp</warSourceDirectory>
+ </configuration>
+ </plugin>
+
+ <!-- reuse the web resources in the -web module -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.8</version>
+ <executions>
+ <execution>
+ <id>unpack</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>apollo-web</artifactId>
+ <version>99-trunk-SNAPSHOT</version>
+ <classifier>resources</classifier>
+ <type>jar</type>
+ <overWrite>false</overWrite>
+ <outputDirectory>${project.build.directory}/webapp</outputDirectory>
+ <excludes>WEB-INF/web.xml</excludes>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.6</version>
+ <executions>
+ <execution>
+ <id>copy-resources</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${project.build.directory}/webapp</outputDirectory>
+ <resources>
+ <resource>
+ <directory>src/main/webapp</directory>
+ <filtering>false</filtering>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <!-- let the jetty plugin know where the webapp resources are located -->
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-maven-plugin</artifactId>
+ <version>${jetty-plugin-version}</version>
+ <configuration>
+ <webAppSourceDirectory>${project.build.directory}/webapp</webAppSourceDirectory>
+ <webAppConfig>
+ <contextPath>/</contextPath>
+ </webAppConfig>
+ <scanIntervalSeconds>0</scanIntervalSeconds>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+
+ <profiles>
+ </profiles>
+
+</project>
+
Added: activemq/activemq-apollo/trunk/apollo-war/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-war/src/main/webapp/WEB-INF/web.xml?rev=1494181&view=auto
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-war/src/main/webapp/WEB-INF/web.xml (added)
+++ activemq/activemq-apollo/trunk/apollo-war/src/main/webapp/WEB-INF/web.xml Tue Jun 18 15:51:39 2013
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ version="2.5">
+
+ <display-name>Apollo</display-name>
+
+ <description>
+ The Apollo Web Application
+ </description>
+
+ <filter>
+ <filter-name>ApolloApplication</filter-name>
+ <filter-class>org.apache.activemq.apollo.web.ApolloApplication</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>ApolloApplication</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <filter>
+ <filter-name>static</filter-name>
+ <filter-class>org.apache.activemq.apollo.web.StaticContentFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>static</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <filter>
+ <filter-name>TemplateEngineFilter</filter-name>
+ <filter-class>org.fusesource.scalate.servlet.TemplateEngineFilter</filter-class>
+ <init-param>
+ <param-name>boot.class</param-name>
+ <param-value>org.apache.activemq.apollo.web.Boot</param-value>
+ </init-param>
+ </filter>
+ <filter-mapping>
+ <filter-name>TemplateEngineFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <servlet>
+ <servlet-name>jersey</servlet-name>
+ <servlet-class>org.apache.activemq.apollo.web.JerseyServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>jersey</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+ <error-page>
+ <error-code>500</error-code>
+ <location>/WEB-INF/scalate/errors/500.scaml</location>
+ </error-page>
+
+ <mime-mapping>
+ <extension>woff</extension>
+ <mime-type>font/woff</mime-type>
+ </mime-mapping>
+ <mime-mapping>
+ <extension>ttf</extension>
+ <mime-type>font/ttf</mime-type>
+ </mime-mapping>
+
+</web-app>
Modified: activemq/activemq-apollo/trunk/apollo-web/pom.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/pom.xml?rev=1494181&r1=1494180&r2=1494181&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/pom.xml (original)
+++ activemq/activemq-apollo/trunk/apollo-web/pom.xml Tue Jun 18 15:51:39 2013
@@ -94,6 +94,12 @@
<version>${josql-version}</version>
</dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>${slf4j-version}</version>
+ <scope>provided</scope>
+ </dependency>
<!-- Scala Support -->
<dependency>
@@ -157,39 +163,13 @@
<version>${scalatest-version}</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>${slf4j-version}</version>
- <scope>test</scope>
- </dependency>
-
+
</dependencies>
<build>
<plugins>
- <!-- <plugin>
- <groupId>org.fusesource.mvnplugins</groupId>
- <artifactId>maven-fab-plugin</artifactId>
- <version>1.26</version>
- <configuration>
- <descriptor>
- <Name>web</Name>
- <Long-Description></Long-Description>
- <Extends>${project.groupId}:apollo-cli:${project.version}</Extends>
- </descriptor>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- </executions>
- </plugin> -->
-
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
@@ -264,8 +244,9 @@
</goals>
<configuration>
<outputDirectory>${basedir}/target/classes/META-INF/services/org.apache.activemq.apollo</outputDirectory>
- <finalName>webapp-resources</finalName>
+ <finalName>webapp</finalName>
<classesDirectory>${basedir}/src/main/webapp</classesDirectory>
+ <classifier>resources</classifier>
<excludes>
<exclude>META-INF/**</exclude>
<exclude>**/*.scaml</exclude>
@@ -274,7 +255,23 @@
</excludes>
</configuration>
</execution>
+
+ <!-- embed the wabapp resources in jar as resource -->
+ <execution>
+ <id>webapp.classes</id>
+ <phase>package</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ <configuration>
+ <classifier>classes</classifier>
+ <excludes>
+ <exclude>**/*.jar</exclude>
+ </excludes>
+ </configuration>
+ </execution>
</executions>
+
<configuration>
<archive>
<manifestEntries>
Added: activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/ApolloApplication.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/ApolloApplication.scala?rev=1494181&view=auto
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/ApolloApplication.scala (added)
+++ activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/ApolloApplication.scala Tue Jun 18 15:51:39 2013
@@ -0,0 +1,152 @@
+/**
+ * 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.activemq.apollo.web
+
+import javax.servlet._
+import java.io.File
+import org.apache.activemq.apollo.util.FileSupport._
+import java.security.{Security, Provider}
+import org.apache.activemq.apollo.broker.{BrokerCreate, ConfigStore, Broker}
+import org.fusesource.hawtdispatch._
+import org.apache.activemq.apollo.util.{Service, ServiceControl, FileMonitor}
+import scala.collection.mutable.ListBuffer
+import org.apache.log4j.PropertyConfigurator
+
+/**
+ * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
+ */
+class ApolloApplication extends Filter {
+
+ var broker_services = List[Service]()
+ var broker:Broker = _
+
+ def init(filterConfig: FilterConfig):Unit = {
+ val sc = filterConfig.getServletContext
+ val webapp_basedir = new File(sc.getRealPath("/"))
+
+ val base = webapp_basedir.getParentFile / (webapp_basedir.getName + "-broker")
+
+ val etc = base / "etc"
+ val conf = etc / "apollo.xml"
+
+ // If the instance data has not yet be initialized.. lets initialize it
+ if( !conf.exists() ) {
+ val create = new BrokerCreate
+ create.directory = base
+ create.base = base.getCanonicalPath
+ create.broker_security_config = "<jmx admin_url='"+sc.getContextPath+"'/>"
+ create.host_security_config = ""
+ create.home = null
+ println("Generating broker instance directory at: "+create.base)
+ create.run()
+ }
+
+ if( !conf.exists ) {
+ sys.error("Could not create the broker instance.");
+ }
+
+ val log4j_config = etc / "log4j.properties"
+ PropertyConfigurator.configure(log4j_config.getCanonicalPath)
+
+// if( System.getProperty("java.security.auth.login.config")==null ) {
+// val login_config = etc / "login.config"
+// if( login_config.exists ) {
+// System.setProperty("java.security.auth.login.config", login_config.getCanonicalPath)
+// }
+// }
+
+ val tmp = base / "tmp"
+ tmp.mkdirs
+
+ // Load the configs and start the brokers up.
+ println("Loading configuration file '%s'.".format(conf))
+
+ // Use bouncycastle if it's installed.
+ try {
+ var loader = this.getClass.getClassLoader
+ var clazz = loader.loadClass("org.bouncycastle.jce.provider.BouncyCastleProvider")
+ val bouncycastle_provider = clazz.newInstance().asInstanceOf[Provider]
+ Security.insertProviderAt(bouncycastle_provider, 2)
+ Broker.info("Loaded the Bouncy Castle security provider.")
+ } catch {
+ case e:Throwable => // ignore, we can live without bouncycastle
+ }
+
+ broker = new Broker()
+ broker.container = sc;
+
+ val validation_messages = ListBuffer[String]()
+ try {
+ broker.config = ConfigStore.load(conf, validation_messages += _)
+ } finally {
+ if( !validation_messages.isEmpty && broker.config.validation != "hide") {
+ Broker.warn("")
+ Broker.warn("Broker configuration file failed the following validations:")
+ validation_messages.foreach{ v =>
+ Broker.warn("")
+ Broker.warn(" "+v)
+ }
+ Broker.warn("")
+ }
+ }
+
+ if( broker.config.validation == "strict" && !validation_messages.isEmpty) {
+ Broker.error("Strict validation was configured, shutting down")
+ return
+ }
+
+ broker.tmp = tmp
+ ServiceControl.start(broker)
+
+ val broker_config_monitor = new FileMonitor(conf,broker.dispatch_queue {
+ broker.console_log.info("Reloading configuration file '%s'.".format(conf))
+ broker.update(ConfigStore.load(conf, x=> broker.console_log.info(x) ), ^{
+ })
+ })
+
+ val log4j_config_monitor = new FileMonitor(log4j_config, {
+ PropertyConfigurator.configure(log4j_config.getCanonicalPath)
+ })
+//
+// var jul_config = etc / "jul.properties"
+// val jul_config_monitor = if ( jul_config.exists()) {
+// new FileMonitor(jul_config, {
+// using(new FileInputStream(jul_config)) { is =>
+// LogManager.getLogManager.readConfiguration(is)
+// }
+// })
+// } else {
+// null
+// }
+//
+// if(jul_config_monitor!=null) jul_config_monitor.start(NOOP)
+
+ log4j_config_monitor.start(NOOP)
+ broker_config_monitor.start(NOOP)
+ broker_services = List(log4j_config_monitor, broker_config_monitor, broker)
+ }
+
+ def destroy():Unit = {
+ ServiceControl.stop(broker_services, "stopping broker")
+ }
+
+ def doFilter(request: ServletRequest, response: ServletResponse, chain: FilterChain):Unit = {
+ request.setAttribute("APOLLO_BROKER", broker);
+ chain.doFilter(request, response)
+ }
+
+}
\ No newline at end of file
Modified: activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/Boot.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/Boot.scala?rev=1494181&r1=1494180&r2=1494181&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/Boot.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/Boot.scala Tue Jun 18 15:51:39 2013
@@ -19,12 +19,18 @@ package org.apache.activemq.apollo.web
import org.fusesource.scalate.TemplateEngine
import org.apache.activemq.apollo.broker.Broker
+object Boot {
+ @volatile
+ var booted = false
+}
+
/**
* @author <a href="http://hiramchirino.com">Hiram Chirino</a>
*
*/
class Boot(engine: TemplateEngine) {
-
+
+
// Put some references to the jersey classes in our code so that the osgi
// metadata creates the proper imports.
val we_are_using = Array(
@@ -32,6 +38,7 @@ class Boot(engine: TemplateEngine) {
)
def run: Unit = {
+ Boot.booted = true
engine.packagePrefix = "org.apache.activemq.apollo.web.templates"
}
}
\ No newline at end of file
Modified: activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/WebModule.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/WebModule.scala?rev=1494181&r1=1494180&r2=1494181&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/WebModule.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/WebModule.scala Tue Jun 18 15:51:39 2013
@@ -18,7 +18,7 @@ package org.apache.activemq.apollo.web
import org.apache.activemq.apollo.util.ClassFinder
import collection.immutable.TreeMap
-import collection.mutable.LinkedHashMap
+import scala.collection.mutable.{ListBuffer, LinkedHashMap}
import resources._
import org.fusesource.scalate.jersey._
import com.wordnik.swagger.jaxrs.ApiHelpMessageBodyWriter
@@ -56,31 +56,34 @@ object DefaultWebModule extends WebModul
override def priority: Int = 100
- override def web_resources = Set(
- classOf[RootResource],
+ override def web_resources = {
+ var rc = ListBuffer[Class[_]]()
- classOf[ApolloApiListing],
- classOf[ApiHelpMessageBodyWriter],
-
- classOf[BrokerResourceHTML],
- classOf[BrokerResourceJSON],
- classOf[BrokerResourceHelp],
-
- classOf[SessionResourceHTML],
- classOf[SessionResourceJSON],
- classOf[SessionResourceHelp],
-
- classOf[ConfigurationResourceHTML],
- classOf[ConfigurationResourceJSON],
- classOf[ConfigurationResourceHelp],
-
- classOf[JacksonJsonProvider],
- classOf[JaxrsExceptionMapper],
- classOf[ScalateTemplateProvider],
- classOf[ScalateTemplateProcessor]
+ // HTML is representation only available if Scalate is enabled in the webapp.
+ if( Boot.booted ) {
+ rc += classOf[BrokerResourceHTML]
+ rc += classOf[SessionResourceHTML]
+ rc += classOf[ConfigurationResourceHTML]
+ rc += classOf[ScalateTemplateProvider]
+ rc += classOf[ScalateTemplateProcessor]
+ }
+ rc += classOf[RootResource]
+ rc += classOf[ApolloApiListing]
+ rc += classOf[ApiHelpMessageBodyWriter]
+ rc += classOf[BrokerResourceJSON]
+ rc += classOf[BrokerResourceHelp]
+ rc += classOf[SessionResourceJSON]
+ rc += classOf[SessionResourceHelp]
+ rc += classOf[ConfigurationResourceJSON]
+ rc += classOf[ConfigurationResourceHelp]
+ rc += classOf[JacksonJsonProvider]
+ rc += classOf[JaxrsExceptionMapper]
+ rc.toSet
+ }
- )
+ override def root_redirect: String = {
- override def root_redirect: String = "console/index.html"
+ "console/index.html"
+ }
}
\ No newline at end of file
Modified: activemq/activemq-apollo/trunk/pom.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/pom.xml?rev=1494181&r1=1494180&r2=1494181&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/pom.xml (original)
+++ activemq/activemq-apollo/trunk/pom.xml Tue Jun 18 15:51:39 2013
@@ -186,6 +186,7 @@
<module>apollo-openwire</module>
<module>apollo-jmx</module>
<module>apollo-distro</module>
+ <module>apollo-war</module>
</modules>
<scm>