jruby-activemq 5.5.1-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.md +6 -0
- data/LICENSE +619 -0
- data/README.md +15 -0
- data/Rakefile +34 -0
- data/apache-activemq-5.5.1/LICENSE +619 -0
- data/apache-activemq-5.5.1/NOTICE +85 -0
- data/apache-activemq-5.5.1/README.txt +63 -0
- data/apache-activemq-5.5.1/WebConsole-README.txt +42 -0
- data/apache-activemq-5.5.1/activemq-all-5.5.1.jar +0 -0
- data/apache-activemq-5.5.1/bin/activemq +653 -0
- data/apache-activemq-5.5.1/bin/activemq-admin +155 -0
- data/apache-activemq-5.5.1/bin/linux-x86-32/activemq +543 -0
- data/apache-activemq-5.5.1/bin/linux-x86-32/libwrapper.so +0 -0
- data/apache-activemq-5.5.1/bin/linux-x86-32/wrapper +0 -0
- data/apache-activemq-5.5.1/bin/linux-x86-32/wrapper.conf +139 -0
- data/apache-activemq-5.5.1/bin/linux-x86-64/activemq +543 -0
- data/apache-activemq-5.5.1/bin/linux-x86-64/libwrapper.so +0 -0
- data/apache-activemq-5.5.1/bin/linux-x86-64/wrapper +0 -0
- data/apache-activemq-5.5.1/bin/linux-x86-64/wrapper.conf +139 -0
- data/apache-activemq-5.5.1/bin/macosx/activemq +537 -0
- data/apache-activemq-5.5.1/bin/macosx/libwrapper.jnilib +0 -0
- data/apache-activemq-5.5.1/bin/macosx/wrapper +0 -0
- data/apache-activemq-5.5.1/bin/macosx/wrapper.conf +139 -0
- data/apache-activemq-5.5.1/bin/run.jar +0 -0
- data/apache-activemq-5.5.1/bin/wrapper.jar +0 -0
- data/apache-activemq-5.5.1/conf/activemq-command.xml +52 -0
- data/apache-activemq-5.5.1/conf/activemq-demo.xml +289 -0
- data/apache-activemq-5.5.1/conf/activemq-dynamic-network-broker1.xml +108 -0
- data/apache-activemq-5.5.1/conf/activemq-dynamic-network-broker2.xml +109 -0
- data/apache-activemq-5.5.1/conf/activemq-jdbc.xml +98 -0
- data/apache-activemq-5.5.1/conf/activemq-scalability.xml +77 -0
- data/apache-activemq-5.5.1/conf/activemq-security.xml +132 -0
- data/apache-activemq-5.5.1/conf/activemq-specjms.xml +118 -0
- data/apache-activemq-5.5.1/conf/activemq-static-network-broker1.xml +100 -0
- data/apache-activemq-5.5.1/conf/activemq-static-network-broker2.xml +100 -0
- data/apache-activemq-5.5.1/conf/activemq-stomp.xml +133 -0
- data/apache-activemq-5.5.1/conf/activemq-throughput.xml +82 -0
- data/apache-activemq-5.5.1/conf/activemq.xml +136 -0
- data/apache-activemq-5.5.1/conf/broker-localhost.cert +0 -0
- data/apache-activemq-5.5.1/conf/broker.ks +0 -0
- data/apache-activemq-5.5.1/conf/broker.ts +0 -0
- data/apache-activemq-5.5.1/conf/camel.xml +66 -0
- data/apache-activemq-5.5.1/conf/client.ks +0 -0
- data/apache-activemq-5.5.1/conf/client.ts +0 -0
- data/apache-activemq-5.5.1/conf/credentials-enc.properties +22 -0
- data/apache-activemq-5.5.1/conf/credentials.properties +22 -0
- data/apache-activemq-5.5.1/conf/jetty-realm.properties +20 -0
- data/apache-activemq-5.5.1/conf/jetty.xml +112 -0
- data/apache-activemq-5.5.1/conf/jmx.access +18 -0
- data/apache-activemq-5.5.1/conf/jmx.password +18 -0
- data/apache-activemq-5.5.1/conf/log4j.properties +75 -0
- data/apache-activemq-5.5.1/conf/logging.properties +25 -0
- data/apache-activemq-5.5.1/data/activemq.log +0 -0
- data/apache-activemq-5.5.1/docs/index.html +22 -0
- data/apache-activemq-5.5.1/example/build.xml +317 -0
- data/apache-activemq-5.5.1/example/conf/activemq.xml +41 -0
- data/apache-activemq-5.5.1/example/conf/log4j.properties +39 -0
- data/apache-activemq-5.5.1/example/conf/resin-web.xml +35 -0
- data/apache-activemq-5.5.1/example/conf/web.xml +40 -0
- data/apache-activemq-5.5.1/example/perfharness/perfharness-activemq.sh +49 -0
- data/apache-activemq-5.5.1/example/ruby/README.txt +27 -0
- data/apache-activemq-5.5.1/example/ruby/catstomp.rb +49 -0
- data/apache-activemq-5.5.1/example/ruby/listener.rb +51 -0
- data/apache-activemq-5.5.1/example/ruby/publisher.rb +67 -0
- data/apache-activemq-5.5.1/example/ruby/stompcat.rb +50 -0
- data/apache-activemq-5.5.1/example/src/CommandLineSupport.java +120 -0
- data/apache-activemq-5.5.1/example/src/ConsumerTool.java +353 -0
- data/apache-activemq-5.5.1/example/src/EmbeddedBroker.java +41 -0
- data/apache-activemq-5.5.1/example/src/Log4jJMSAppenderExample.java +70 -0
- data/apache-activemq-5.5.1/example/src/ProducerAndConsumerTool.java +51 -0
- data/apache-activemq-5.5.1/example/src/ProducerTool.java +247 -0
- data/apache-activemq-5.5.1/example/src/RequesterTool.java +257 -0
- data/apache-activemq-5.5.1/example/src/StompExample.java +59 -0
- data/apache-activemq-5.5.1/example/src/TopicListener.java +118 -0
- data/apache-activemq-5.5.1/example/src/TopicPublisher.java +205 -0
- data/apache-activemq-5.5.1/example/src/jndi.properties +17 -0
- data/apache-activemq-5.5.1/example/src/log4j-jms.properties +31 -0
- data/apache-activemq-5.5.1/example/transactions/README.txt +40 -0
- data/apache-activemq-5.5.1/example/transactions/build.xml +113 -0
- data/apache-activemq-5.5.1/example/transactions/src/Retailer.java +107 -0
- data/apache-activemq-5.5.1/example/transactions/src/Supplier.java +135 -0
- data/apache-activemq-5.5.1/example/transactions/src/TransactionsDemo.java +47 -0
- data/apache-activemq-5.5.1/example/transactions/src/Vendor.java +302 -0
- data/apache-activemq-5.5.1/lib/a.sh +3 -0
- data/apache-activemq-5.5.1/lib/activation-1.1.jar +0 -0
- data/apache-activemq-5.5.1/lib/activemq-camel-5.5.1.jar +0 -0
- data/apache-activemq-5.5.1/lib/activemq-console-5.5.1.jar +0 -0
- data/apache-activemq-5.5.1/lib/activemq-core-5.5.1.jar +0 -0
- data/apache-activemq-5.5.1/lib/activemq-jaas-5.5.1.jar +0 -0
- data/apache-activemq-5.5.1/lib/activemq-protobuf-1.1.jar +0 -0
- data/apache-activemq-5.5.1/lib/activemq-rar.txt +20 -0
- data/apache-activemq-5.5.1/lib/activemq-web-5.5.1.jar +0 -0
- data/apache-activemq-5.5.1/lib/camel-core-2.7.0.jar +0 -0
- data/apache-activemq-5.5.1/lib/camel-jetty-2.7.0.jar +0 -0
- data/apache-activemq-5.5.1/lib/camel-jms-2.7.0.jar +0 -0
- data/apache-activemq-5.5.1/lib/camel-spring-2.7.0.jar +0 -0
- data/apache-activemq-5.5.1/lib/geronimo-j2ee-management_1.1_spec-1.0.1.jar +0 -0
- data/apache-activemq-5.5.1/lib/geronimo-jms_1.1_spec-1.1.1.jar +0 -0
- data/apache-activemq-5.5.1/lib/geronimo-jta_1.0.1B_spec-1.0.1.jar +0 -0
- data/apache-activemq-5.5.1/lib/jaxb-api-2.1.jar +0 -0
- data/apache-activemq-5.5.1/lib/jaxb-impl-2.1.6.jar +0 -0
- data/apache-activemq-5.5.1/lib/jcl-over-slf4j-1.5.11.jar +0 -0
- data/apache-activemq-5.5.1/lib/kahadb-5.5.1.jar +0 -0
- data/apache-activemq-5.5.1/lib/optional/activeio-core-3.1.2.jar +0 -0
- data/apache-activemq-5.5.1/lib/optional/activemq-jmdns_1.0-5.5.1.jar +0 -0
- data/apache-activemq-5.5.1/lib/optional/activemq-optional-5.5.1.jar +0 -0
- data/apache-activemq-5.5.1/lib/optional/activemq-pool-5.5.1.jar +0 -0
- data/apache-activemq-5.5.1/lib/optional/activemq-spring-5.5.1.jar +0 -0
- data/apache-activemq-5.5.1/lib/optional/activemq-xmpp-5.5.1.jar +0 -0
- data/apache-activemq-5.5.1/lib/optional/commons-beanutils-1.6.1.jar +0 -0
- data/apache-activemq-5.5.1/lib/optional/commons-codec-1.2.jar +0 -0
- data/apache-activemq-5.5.1/lib/optional/commons-collections-3.2.1.jar +0 -0
- data/apache-activemq-5.5.1/lib/optional/commons-dbcp-1.2.2.jar +0 -0
- data/apache-activemq-5.5.1/lib/optional/commons-httpclient-3.1.jar +0 -0
- data/apache-activemq-5.5.1/lib/optional/commons-lang-2.4.jar +0 -0
- data/apache-activemq-5.5.1/lib/optional/commons-net-2.0.jar +0 -0
- data/apache-activemq-5.5.1/lib/optional/commons-pool-1.5.4.jar +0 -0
- data/apache-activemq-5.5.1/lib/optional/geronimo-j2ee-connector_1.5_spec-2.0.0.jar +0 -0
- data/apache-activemq-5.5.1/lib/optional/jasypt-1.7.jar +0 -0
- data/apache-activemq-5.5.1/lib/optional/jettison-1.2.jar +0 -0
- data/apache-activemq-5.5.1/lib/optional/josql-1.5.jar +0 -0
- data/apache-activemq-5.5.1/lib/optional/log4j-1.2.14.jar +0 -0
- data/apache-activemq-5.5.1/lib/optional/slf4j-log4j12-1.5.11.jar +0 -0
- data/apache-activemq-5.5.1/lib/optional/spring-aop-3.0.3.RELEASE.jar +0 -0
- data/apache-activemq-5.5.1/lib/optional/spring-asm-3.0.3.RELEASE.jar +0 -0
- data/apache-activemq-5.5.1/lib/optional/spring-beans-3.0.3.RELEASE.jar +0 -0
- data/apache-activemq-5.5.1/lib/optional/spring-context-3.0.3.RELEASE.jar +0 -0
- data/apache-activemq-5.5.1/lib/optional/spring-core-3.0.3.RELEASE.jar +0 -0
- data/apache-activemq-5.5.1/lib/optional/spring-expression-3.0.3.RELEASE.jar +0 -0
- data/apache-activemq-5.5.1/lib/optional/spring-jms-3.0.3.RELEASE.jar +0 -0
- data/apache-activemq-5.5.1/lib/optional/spring-oxm-tiger-1.5.8.jar +0 -0
- data/apache-activemq-5.5.1/lib/optional/spring-tx-3.0.3.RELEASE.jar +0 -0
- data/apache-activemq-5.5.1/lib/optional/stax2-api-3.0.1.jar +0 -0
- data/apache-activemq-5.5.1/lib/optional/velocity-1.6.2.jar +0 -0
- data/apache-activemq-5.5.1/lib/optional/woodstox-core-asl-4.0.7.jar +0 -0
- data/apache-activemq-5.5.1/lib/optional/xbean-spring-3.7.jar +0 -0
- data/apache-activemq-5.5.1/lib/optional/xpp3-1.1.4c.jar +0 -0
- data/apache-activemq-5.5.1/lib/optional/xstream-1.3.1.jar +0 -0
- data/apache-activemq-5.5.1/lib/slf4j-api-1.5.11.jar +0 -0
- data/apache-activemq-5.5.1/lib/stax-1.2.0.jar +0 -0
- data/apache-activemq-5.5.1/lib/stax-api-1.0.1.jar +0 -0
- data/apache-activemq-5.5.1/lib/web/commons-management-1.0.jar +0 -0
- data/apache-activemq-5.5.1/lib/web/core-3.1.1.jar +0 -0
- data/apache-activemq-5.5.1/lib/web/geronimo-servlet_2.5_spec-1.2.jar +0 -0
- data/apache-activemq-5.5.1/lib/web/jdom-1.0.jar +0 -0
- data/apache-activemq-5.5.1/lib/web/jetty-all-server-7.1.6.v20100715.jar +0 -0
- data/apache-activemq-5.5.1/lib/web/jetty-websocket-7.1.6.v20100715.jar +0 -0
- data/apache-activemq-5.5.1/lib/web/jsp-2.1-glassfish-2.1.v20100127.jar +0 -0
- data/apache-activemq-5.5.1/lib/web/jsp-api-2.1-glassfish-2.1.v20100127.jar +0 -0
- data/apache-activemq-5.5.1/lib/web/rome-0.8.jar +0 -0
- data/apache-activemq-5.5.1/lib/web/sitemesh-2.2.1.jar +0 -0
- data/apache-activemq-5.5.1/lib/web/spring-web-3.0.3.RELEASE.jar +0 -0
- data/apache-activemq-5.5.1/lib/web/spring-webmvc-3.0.3.RELEASE.jar +0 -0
- data/apache-activemq-5.5.1/user-guide.html +119 -0
- data/apache-activemq-5.5.1/webapps/admin/404.html +137 -0
- data/apache-activemq-5.5.1/webapps/admin/500.html +138 -0
- data/apache-activemq-5.5.1/webapps/admin/META-INF/LICENSE +1026 -0
- data/apache-activemq-5.5.1/webapps/admin/META-INF/NOTICE +107 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/classes/org/apache/activemq/web/WebConsoleStarter.class +0 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/CopyMessage.class +0 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/CreateDestination.class +0 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/CreateSubscriber.class +0 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/DeleteDestination.class +0 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/DeleteJob.class +0 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/DeleteMessage.class +0 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/DeleteSubscriber.class +0 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/MoveMessage.class +0 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/PurgeDestination.class +0 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/SendMessage.class +0 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/classes/org/apache/activemq/web/filter/ApplicationContextFilter$1.class +0 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/classes/org/apache/activemq/web/filter/ApplicationContextFilter$2.class +0 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/classes/org/apache/activemq/web/filter/ApplicationContextFilter.class +0 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/classes/org/apache/activemq/web/handler/BindingBeanNameUrlHandlerMapping.class +0 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/decorators.xml +30 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/dispatcher-servlet.xml +62 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/jspf/headertags.jspf +21 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/jspf/old.jspf +21 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/tags/form/checkbox.tag +18 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/tags/form/forEachMapEntry.tag +29 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/tags/form/option.tag +20 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/tags/form/short.tag +29 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/tags/form/text.tag +30 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/tags/form/tooltip.tag +29 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/tags/form/uri.tag +18 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/tags/jms/forEachConnection.tag +35 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/tags/jms/forEachMessage.tag +34 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/tags/jms/formatTimestamp.tag +29 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/tags/jms/persistent.tag +27 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/web.xml +187 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/webconsole-default.xml +26 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/webconsole-embedded.xml +45 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/webconsole-invm.xml +41 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/webconsole-jndi.xml +39 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/webconsole-properties.xml +39 -0
- data/apache-activemq-5.5.1/webapps/admin/WEB-INF/webconsole-query.xml +25 -0
- data/apache-activemq-5.5.1/webapps/admin/browse.jsp +64 -0
- data/apache-activemq-5.5.1/webapps/admin/connection.jsp +138 -0
- data/apache-activemq-5.5.1/webapps/admin/connections.jsp +85 -0
- data/apache-activemq-5.5.1/webapps/admin/decorators/main.jsp +165 -0
- data/apache-activemq-5.5.1/webapps/admin/decorators/panel.jsp +31 -0
- data/apache-activemq-5.5.1/webapps/admin/decorators/printable.jsp +31 -0
- data/apache-activemq-5.5.1/webapps/admin/graph.jsp +67 -0
- data/apache-activemq-5.5.1/webapps/admin/images/activemq-logo.png +0 -0
- data/apache-activemq-5.5.1/webapps/admin/images/asf-logo.png +0 -0
- data/apache-activemq-5.5.1/webapps/admin/images/big-bullet.png +0 -0
- data/apache-activemq-5.5.1/webapps/admin/images/black-footer-bottom.png +0 -0
- data/apache-activemq-5.5.1/webapps/admin/images/black-footer-left.png +0 -0
- data/apache-activemq-5.5.1/webapps/admin/images/black-footer-right.png +0 -0
- data/apache-activemq-5.5.1/webapps/admin/images/bottom-red-bar.png +0 -0
- data/apache-activemq-5.5.1/webapps/admin/images/checker-bg.png +0 -0
- data/apache-activemq-5.5.1/webapps/admin/images/content-left.png +0 -0
- data/apache-activemq-5.5.1/webapps/admin/images/content-right.png +0 -0
- data/apache-activemq-5.5.1/webapps/admin/images/feed_atom.png +0 -0
- data/apache-activemq-5.5.1/webapps/admin/images/feed_rss.png +0 -0
- data/apache-activemq-5.5.1/webapps/admin/images/left-box-bottom.png +0 -0
- data/apache-activemq-5.5.1/webapps/admin/images/left-box-right.png +0 -0
- data/apache-activemq-5.5.1/webapps/admin/images/left-box-top.png +0 -0
- data/apache-activemq-5.5.1/webapps/admin/images/oval-arrow.png +0 -0
- data/apache-activemq-5.5.1/webapps/admin/images/right-box-bottom.png +0 -0
- data/apache-activemq-5.5.1/webapps/admin/images/right-box-left.png +0 -0
- data/apache-activemq-5.5.1/webapps/admin/images/right-box-top.png +0 -0
- data/apache-activemq-5.5.1/webapps/admin/images/small-bullet-gray.png +0 -0
- data/apache-activemq-5.5.1/webapps/admin/images/small-bullet-red.png +0 -0
- data/apache-activemq-5.5.1/webapps/admin/images/spacer.gif +0 -0
- data/apache-activemq-5.5.1/webapps/admin/images/top-red-bar.png +0 -0
- data/apache-activemq-5.5.1/webapps/admin/images/white-header-left.png +0 -0
- data/apache-activemq-5.5.1/webapps/admin/images/white-header-right.png +0 -0
- data/apache-activemq-5.5.1/webapps/admin/images/white-header-top.png +0 -0
- data/apache-activemq-5.5.1/webapps/admin/index.jsp +65 -0
- data/apache-activemq-5.5.1/webapps/admin/js/common.js +121 -0
- data/apache-activemq-5.5.1/webapps/admin/js/css.js +145 -0
- data/apache-activemq-5.5.1/webapps/admin/js/mochi/MochiKit.js +4804 -0
- data/apache-activemq-5.5.1/webapps/admin/js/mochi/__package__.js +14 -0
- data/apache-activemq-5.5.1/webapps/admin/js/plotkit/Base.js +332 -0
- data/apache-activemq-5.5.1/webapps/admin/js/plotkit/Canvas.js +707 -0
- data/apache-activemq-5.5.1/webapps/admin/js/plotkit/Layout.js +588 -0
- data/apache-activemq-5.5.1/webapps/admin/js/plotkit/SVG.js +677 -0
- data/apache-activemq-5.5.1/webapps/admin/js/plotkit/SweetCanvas.js +281 -0
- data/apache-activemq-5.5.1/webapps/admin/js/plotkit/SweetSVG.js +196 -0
- data/apache-activemq-5.5.1/webapps/admin/js/plotkit/dummy.svg +15 -0
- data/apache-activemq-5.5.1/webapps/admin/js/plotkit/iecanvas.htc +389 -0
- data/apache-activemq-5.5.1/webapps/admin/js/prettify.js +1424 -0
- data/apache-activemq-5.5.1/webapps/admin/js/standardista-table-sorting.js +434 -0
- data/apache-activemq-5.5.1/webapps/admin/message.jsp +185 -0
- data/apache-activemq-5.5.1/webapps/admin/network.jsp +52 -0
- data/apache-activemq-5.5.1/webapps/admin/queueConsumers.jsp +79 -0
- data/apache-activemq-5.5.1/webapps/admin/queueGraph.jsp +68 -0
- data/apache-activemq-5.5.1/webapps/admin/queues.jsp +78 -0
- data/apache-activemq-5.5.1/webapps/admin/scheduled.jsp +67 -0
- data/apache-activemq-5.5.1/webapps/admin/send.jsp +173 -0
- data/apache-activemq-5.5.1/webapps/admin/styles/prettify.css +44 -0
- data/apache-activemq-5.5.1/webapps/admin/styles/site.css +206 -0
- data/apache-activemq-5.5.1/webapps/admin/styles/sorttable.css +70 -0
- data/apache-activemq-5.5.1/webapps/admin/styles/type-settings.css +177 -0
- data/apache-activemq-5.5.1/webapps/admin/subscribers.jsp +158 -0
- data/apache-activemq-5.5.1/webapps/admin/test/dummy.jsp +52 -0
- data/apache-activemq-5.5.1/webapps/admin/test/index.jsp +84 -0
- data/apache-activemq-5.5.1/webapps/admin/test/systemProperties.jsp +53 -0
- data/apache-activemq-5.5.1/webapps/admin/topics.jsp +66 -0
- data/apache-activemq-5.5.1/webapps/admin/xml/queues.jsp +34 -0
- data/apache-activemq-5.5.1/webapps/admin/xml/topics.jsp +29 -0
- data/apache-activemq-5.5.1/webapps/demo/META-INF/LICENSE +494 -0
- data/apache-activemq-5.5.1/webapps/demo/META-INF/NOTICE +82 -0
- data/apache-activemq-5.5.1/webapps/demo/WEB-INF/web.xml +111 -0
- data/apache-activemq-5.5.1/webapps/demo/chat.css +76 -0
- data/apache-activemq-5.5.1/webapps/demo/chat.html +219 -0
- data/apache-activemq-5.5.1/webapps/demo/index.html +181 -0
- data/apache-activemq-5.5.1/webapps/demo/js/amq.js +307 -0
- data/apache-activemq-5.5.1/webapps/demo/js/amq_dojo_adapter.js +84 -0
- data/apache-activemq-5.5.1/webapps/demo/js/amq_jquery_adapter.js +88 -0
- data/apache-activemq-5.5.1/webapps/demo/js/amq_prototype_adapter.js +84 -0
- data/apache-activemq-5.5.1/webapps/demo/js/chat.js +209 -0
- data/apache-activemq-5.5.1/webapps/demo/js/dojo.js +16 -0
- data/apache-activemq-5.5.1/webapps/demo/js/jquery-1.4.2.min.js +154 -0
- data/apache-activemq-5.5.1/webapps/demo/js/prototype.js +4874 -0
- data/apache-activemq-5.5.1/webapps/demo/portfolio/portfolio.html +87 -0
- data/apache-activemq-5.5.1/webapps/demo/portfolio/portfolio.js +91 -0
- data/apache-activemq-5.5.1/webapps/demo/sandbox/index.html +31 -0
- data/apache-activemq-5.5.1/webapps/demo/sandbox/portfolio.html +93 -0
- data/apache-activemq-5.5.1/webapps/demo/sandbox/portfolio.js +49 -0
- data/apache-activemq-5.5.1/webapps/demo/sandbox/util.js +52 -0
- data/apache-activemq-5.5.1/webapps/demo/sandbox/webmq.js +149 -0
- data/apache-activemq-5.5.1/webapps/demo/send.html +51 -0
- data/apache-activemq-5.5.1/webapps/demo/style.css +440 -0
- data/apache-activemq-5.5.1/webapps/demo/test/amq_test.html +311 -0
- data/apache-activemq-5.5.1/webapps/demo/test/assets/README +4 -0
- data/apache-activemq-5.5.1/webapps/demo/test/assets/jsunittest.js +1017 -0
- data/apache-activemq-5.5.1/webapps/demo/test/assets/unittest.css +54 -0
- data/apache-activemq-5.5.1/webapps/favicon.ico +0 -0
- data/apache-activemq-5.5.1/webapps/fileserver/META-INF/LICENSE +203 -0
- data/apache-activemq-5.5.1/webapps/fileserver/META-INF/NOTICE +5 -0
- data/apache-activemq-5.5.1/webapps/fileserver/WEB-INF/classes/org/apache/activemq/util/FilenameGuardFilter$GuardedHttpServletRequest.class +0 -0
- data/apache-activemq-5.5.1/webapps/fileserver/WEB-INF/classes/org/apache/activemq/util/FilenameGuardFilter.class +0 -0
- data/apache-activemq-5.5.1/webapps/fileserver/WEB-INF/classes/org/apache/activemq/util/IOHelper.class +0 -0
- data/apache-activemq-5.5.1/webapps/fileserver/WEB-INF/classes/org/apache/activemq/util/RestFilter.class +0 -0
- data/apache-activemq-5.5.1/webapps/fileserver/WEB-INF/web.xml +56 -0
- data/apache-activemq-5.5.1/webapps/fileserver/index.html +30 -0
- data/apache-activemq-5.5.1/webapps/index.html +145 -0
- data/apache-activemq-5.5.1/webapps/styles/site.css +206 -0
- data/apache-activemq-5.5.1/webapps/styles/type-settings.css +177 -0
- data/lib/activemq.rb +11 -0
- metadata +382 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!--
|
|
3
|
+
Licensed to the Apache Software Foundation (ASF) under one or more
|
|
4
|
+
contributor license agreements. See the NOTICE file distributed with
|
|
5
|
+
this work for additional information regarding copyright ownership.
|
|
6
|
+
The ASF licenses this file to You under the Apache License, Version 2.0
|
|
7
|
+
(the "License"); you may not use this file except in compliance with
|
|
8
|
+
the License. You may obtain a copy of the License at
|
|
9
|
+
|
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
|
|
12
|
+
Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
See the License for the specific language governing permissions and
|
|
16
|
+
limitations under the License.
|
|
17
|
+
-->
|
|
18
|
+
<project name="transactions" default="help" basedir=".">
|
|
19
|
+
|
|
20
|
+
<property name="class.dir" value="target/classes" />
|
|
21
|
+
<property name="activemq.home" value="../.." />
|
|
22
|
+
|
|
23
|
+
<!-- example program defaults -->
|
|
24
|
+
<property name="url" value="tcp://localhost:61616" />
|
|
25
|
+
<target name="help">
|
|
26
|
+
<echo>
|
|
27
|
+
For the full demo:
|
|
28
|
+
ant transactions_demo -Durl=tcp://hostname:1234
|
|
29
|
+
For the indicual components:
|
|
30
|
+
ant retailer -Durl=tcp://hostname:1234
|
|
31
|
+
ant vendor -Durl=tcp://hostname:1234
|
|
32
|
+
ant hdsupplier -Durl=tcp://hostname:1234
|
|
33
|
+
ant monitorsupplier -Durl=tcp://hostname:1234
|
|
34
|
+
</echo>
|
|
35
|
+
</target>
|
|
36
|
+
|
|
37
|
+
<target name="clean">
|
|
38
|
+
<delete dir="target" quiet="true" />
|
|
39
|
+
<delete dir="${class.dir}" quiet="true" />
|
|
40
|
+
</target>
|
|
41
|
+
|
|
42
|
+
<target name="init">
|
|
43
|
+
<mkdir dir="${class.dir}" />
|
|
44
|
+
|
|
45
|
+
<path id="javac.classpath">
|
|
46
|
+
<pathelement path="${class.dir}" />
|
|
47
|
+
<pathelement path="../conf" />
|
|
48
|
+
<fileset dir="${activemq.home}/lib">
|
|
49
|
+
<include name="**/*.jar" />
|
|
50
|
+
</fileset>
|
|
51
|
+
</path>
|
|
52
|
+
</target>
|
|
53
|
+
|
|
54
|
+
<target name="compile" depends="init" description="Compile all Java">
|
|
55
|
+
<javac srcdir="src" destdir="${class.dir}" debug="true">
|
|
56
|
+
<classpath refid="javac.classpath" />
|
|
57
|
+
</javac>
|
|
58
|
+
</target>
|
|
59
|
+
|
|
60
|
+
<target name="transactions_demo" depends="compile" description="Runs the full demo">
|
|
61
|
+
<java classname="TransactionsDemo" fork="yes">
|
|
62
|
+
<classpath refid="javac.classpath" />
|
|
63
|
+
<jvmarg value="-server" />
|
|
64
|
+
<sysproperty key="activemq.home" value="${activemq.home}"/>
|
|
65
|
+
<arg value="${url}" />
|
|
66
|
+
<arg value="${user}" />
|
|
67
|
+
<arg value="${password}" />
|
|
68
|
+
</java>
|
|
69
|
+
</target>
|
|
70
|
+
|
|
71
|
+
<target name="retailer" depends="compile" description="Runs the retailer">
|
|
72
|
+
<java classname="Retailer" fork="yes">
|
|
73
|
+
<classpath refid="javac.classpath" />
|
|
74
|
+
<jvmarg value="-server" />
|
|
75
|
+
<sysproperty key="activemq.home" value="${activemq.home}"/>
|
|
76
|
+
<arg value="${url}" />
|
|
77
|
+
<arg value="${user}" />
|
|
78
|
+
<arg value="${password}" />
|
|
79
|
+
</java>
|
|
80
|
+
</target>
|
|
81
|
+
<target name="vendor" depends="compile" description="Runs the vendor">
|
|
82
|
+
<java classname="Vendor" fork="yes">
|
|
83
|
+
<classpath refid="javac.classpath" />
|
|
84
|
+
<jvmarg value="-server" />
|
|
85
|
+
<sysproperty key="activemq.home" value="${activemq.home}"/>
|
|
86
|
+
<arg value="${url}" />
|
|
87
|
+
<arg value="${user}" />
|
|
88
|
+
<arg value="${password}" />
|
|
89
|
+
</java>
|
|
90
|
+
</target>
|
|
91
|
+
<target name="hdsupplier" depends="compile" description="Runs the Hard Drive Supplier">
|
|
92
|
+
<java classname="Supplier" fork="yes">
|
|
93
|
+
<classpath refid="javac.classpath" />
|
|
94
|
+
<jvmarg value="-server" />
|
|
95
|
+
<sysproperty key="activemq.home" value="${activemq.home}"/>
|
|
96
|
+
<arg value="HardDrive" />
|
|
97
|
+
<arg value="${url}" />
|
|
98
|
+
<arg value="${user}" />
|
|
99
|
+
<arg value="${password}" />
|
|
100
|
+
</java>
|
|
101
|
+
</target>
|
|
102
|
+
<target name="monitorsupplier" depends="compile" description="Runs the Monitor Supplier">
|
|
103
|
+
<java classname="Supplier" fork="yes">
|
|
104
|
+
<classpath refid="javac.classpath" />
|
|
105
|
+
<jvmarg value="-server" />
|
|
106
|
+
<sysproperty key="activemq.home" value="${activemq.home}"/>
|
|
107
|
+
<arg value="Monitor" />
|
|
108
|
+
<arg value="${url}" />
|
|
109
|
+
<arg value="${user}" />
|
|
110
|
+
<arg value="${password}" />
|
|
111
|
+
</java>
|
|
112
|
+
</target>
|
|
113
|
+
</project>
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
3
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
4
|
+
* this work for additional information regarding copyright ownership.
|
|
5
|
+
* The ASF licenses this file to You under the Apache License, Version 2.0
|
|
6
|
+
* (the "License"); you may not use this file except in compliance with
|
|
7
|
+
* the License. You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import org.apache.activemq.ActiveMQConnectionFactory;
|
|
18
|
+
import javax.jms.Connection;
|
|
19
|
+
import javax.jms.Destination;
|
|
20
|
+
import javax.jms.JMSException;
|
|
21
|
+
import javax.jms.MapMessage;
|
|
22
|
+
import javax.jms.MessageConsumer;
|
|
23
|
+
import javax.jms.MessageProducer;
|
|
24
|
+
import javax.jms.Session;
|
|
25
|
+
import javax.jms.TemporaryQueue;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The Retailer orders computers from the Vendor by sending a message via
|
|
29
|
+
* the VendorOrderQueue. It then syncronously receives the reponse message
|
|
30
|
+
* and reports if the order was successful or not.
|
|
31
|
+
*/
|
|
32
|
+
public class Retailer implements Runnable {
|
|
33
|
+
private String url;
|
|
34
|
+
private String user;
|
|
35
|
+
private String password;
|
|
36
|
+
|
|
37
|
+
public Retailer(String url, String user, String password) {
|
|
38
|
+
this.url = url;
|
|
39
|
+
this.user = user;
|
|
40
|
+
this.password = password;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
public void run() {
|
|
44
|
+
ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(user, password, url);
|
|
45
|
+
try {
|
|
46
|
+
Connection connection = connectionFactory.createConnection();
|
|
47
|
+
|
|
48
|
+
// The Retailer's session is non-trasacted.
|
|
49
|
+
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
|
|
50
|
+
Destination vendorOrderQueue = session.createQueue("VendorOrderQueue");
|
|
51
|
+
TemporaryQueue retailerConfirmQueue = session.createTemporaryQueue();
|
|
52
|
+
|
|
53
|
+
MessageProducer producer = session.createProducer(vendorOrderQueue);
|
|
54
|
+
MessageConsumer replyConsumer = session.createConsumer(retailerConfirmQueue);
|
|
55
|
+
|
|
56
|
+
connection.start();
|
|
57
|
+
|
|
58
|
+
for (int i = 0; i < 5; i++) {
|
|
59
|
+
MapMessage message = session.createMapMessage();
|
|
60
|
+
message.setString("Item", "Computer(s)");
|
|
61
|
+
int quantity = (int)(Math.random() * 4) + 1;
|
|
62
|
+
message.setInt("Quantity", quantity);
|
|
63
|
+
message.setJMSReplyTo(retailerConfirmQueue);
|
|
64
|
+
producer.send(message);
|
|
65
|
+
System.out.println("Retailer: Ordered " + quantity + " computers.");
|
|
66
|
+
|
|
67
|
+
MapMessage reply = (MapMessage) replyConsumer.receive();
|
|
68
|
+
if (reply.getBoolean("OrderAccepted")) {
|
|
69
|
+
System.out.println("Retailer: Order Filled");
|
|
70
|
+
} else {
|
|
71
|
+
System.out.println("Retailer: Order Not Filled");
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Send a non-MapMessage to signal the end
|
|
76
|
+
producer.send(session.createMessage());
|
|
77
|
+
|
|
78
|
+
replyConsumer.close();
|
|
79
|
+
connection.close();
|
|
80
|
+
|
|
81
|
+
} catch (JMSException e) {
|
|
82
|
+
e.printStackTrace();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
public static void main(String[] args) {
|
|
87
|
+
String url = "tcp://localhost:61616";
|
|
88
|
+
String user = null;
|
|
89
|
+
String password = null;
|
|
90
|
+
|
|
91
|
+
if (args.length >= 1) {
|
|
92
|
+
url = args[0];
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (args.length >= 2) {
|
|
96
|
+
user = args[1];
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (args.length >= 3) {
|
|
100
|
+
password = args[2];
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
Retailer r = new Retailer(url, user, password);
|
|
104
|
+
|
|
105
|
+
new Thread(r, "Retailer").start();
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
3
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
4
|
+
* this work for additional information regarding copyright ownership.
|
|
5
|
+
* The ASF licenses this file to You under the Apache License, Version 2.0
|
|
6
|
+
* (the "License"); you may not use this file except in compliance with
|
|
7
|
+
* the License. You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import java.util.Random;
|
|
18
|
+
|
|
19
|
+
import javax.jms.Connection;
|
|
20
|
+
import javax.jms.Destination;
|
|
21
|
+
import javax.jms.JMSException;
|
|
22
|
+
import javax.jms.MapMessage;
|
|
23
|
+
import javax.jms.Message;
|
|
24
|
+
import javax.jms.MessageConsumer;
|
|
25
|
+
import javax.jms.MessageProducer;
|
|
26
|
+
import javax.jms.Session;
|
|
27
|
+
|
|
28
|
+
import org.apache.activemq.ActiveMQConnectionFactory;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The Supplier synchronously receives the order from the Vendor and
|
|
32
|
+
* randomly responds with either the number ordered, or some lower
|
|
33
|
+
* quantity.
|
|
34
|
+
*/
|
|
35
|
+
public class Supplier implements Runnable {
|
|
36
|
+
private String url;
|
|
37
|
+
private String user;
|
|
38
|
+
private String password;
|
|
39
|
+
private final String ITEM;
|
|
40
|
+
private final String QUEUE;
|
|
41
|
+
|
|
42
|
+
public Supplier(String item, String queue, String url, String user, String password) {
|
|
43
|
+
this.url = url;
|
|
44
|
+
this.user = user;
|
|
45
|
+
this.password = password;
|
|
46
|
+
this.ITEM = item;
|
|
47
|
+
this.QUEUE = queue;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public void run() {
|
|
51
|
+
ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(user, password, url);
|
|
52
|
+
Session session = null;
|
|
53
|
+
Destination orderQueue;
|
|
54
|
+
try {
|
|
55
|
+
Connection connection = connectionFactory.createConnection();
|
|
56
|
+
|
|
57
|
+
session = connection.createSession(true, Session.SESSION_TRANSACTED);
|
|
58
|
+
orderQueue = session.createQueue(QUEUE);
|
|
59
|
+
MessageConsumer consumer = session.createConsumer(orderQueue);
|
|
60
|
+
|
|
61
|
+
connection.start();
|
|
62
|
+
|
|
63
|
+
while (true) {
|
|
64
|
+
Message message = consumer.receive();
|
|
65
|
+
MessageProducer producer = session.createProducer(message.getJMSReplyTo());
|
|
66
|
+
MapMessage orderMessage;
|
|
67
|
+
if (message instanceof MapMessage) {
|
|
68
|
+
orderMessage = (MapMessage) message;
|
|
69
|
+
} else {
|
|
70
|
+
// End of Stream
|
|
71
|
+
producer.send(session.createMessage());
|
|
72
|
+
session.commit();
|
|
73
|
+
producer.close();
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
int quantity = orderMessage.getInt("Quantity");
|
|
78
|
+
System.out.println(ITEM + " Supplier: Vendor ordered " + quantity + " " + orderMessage.getString("Item"));
|
|
79
|
+
|
|
80
|
+
MapMessage outMessage = session.createMapMessage();
|
|
81
|
+
outMessage.setInt("VendorOrderNumber", orderMessage.getInt("VendorOrderNumber"));
|
|
82
|
+
outMessage.setString("Item", ITEM);
|
|
83
|
+
|
|
84
|
+
quantity = Math.min(
|
|
85
|
+
orderMessage.getInt("Quantity"),
|
|
86
|
+
new Random().nextInt(orderMessage.getInt("Quantity") * 10));
|
|
87
|
+
outMessage.setInt("Quantity", quantity);
|
|
88
|
+
|
|
89
|
+
producer.send(outMessage);
|
|
90
|
+
System.out.println(ITEM + " Supplier: Sent " + quantity + " " + ITEM + "(s)");
|
|
91
|
+
session.commit();
|
|
92
|
+
System.out.println(ITEM + " Supplier: committed transaction");
|
|
93
|
+
producer.close();
|
|
94
|
+
}
|
|
95
|
+
connection.close();
|
|
96
|
+
} catch (JMSException e) {
|
|
97
|
+
e.printStackTrace();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
public static void main(String[] args) {
|
|
102
|
+
String url = "tcp://localhost:61616";
|
|
103
|
+
String user = null;
|
|
104
|
+
String password = null;
|
|
105
|
+
String item = "HardDrive";
|
|
106
|
+
|
|
107
|
+
if (args.length >= 1) {
|
|
108
|
+
item = args[0];
|
|
109
|
+
}
|
|
110
|
+
String queue;
|
|
111
|
+
if ("HardDrive".equals(item)) {
|
|
112
|
+
queue = "StorageOrderQueue";
|
|
113
|
+
} else if ("Monitor".equals(item)) {
|
|
114
|
+
queue = "MonitorOrderQueue";
|
|
115
|
+
} else {
|
|
116
|
+
throw new IllegalArgumentException("Item must be either HardDrive or Monitor");
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (args.length >= 2) {
|
|
120
|
+
url = args[1];
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
if (args.length >= 3) {
|
|
124
|
+
user = args[2];
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if (args.length >= 4) {
|
|
128
|
+
password = args[3];
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
Supplier s = new Supplier(item, queue, url, user, password);
|
|
132
|
+
|
|
133
|
+
new Thread(s, "Supplier " + item).start();
|
|
134
|
+
}
|
|
135
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
3
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
4
|
+
* this work for additional information regarding copyright ownership.
|
|
5
|
+
* The ASF licenses this file to You under the Apache License, Version 2.0
|
|
6
|
+
* (the "License"); you may not use this file except in compliance with
|
|
7
|
+
* the License. You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
public class TransactionsDemo {
|
|
18
|
+
|
|
19
|
+
public static void main(String[] args) {
|
|
20
|
+
String url = "tcp://localhost:61616";
|
|
21
|
+
String user = null;
|
|
22
|
+
String password = null;
|
|
23
|
+
|
|
24
|
+
if (args.length >= 1) {
|
|
25
|
+
url = args[0];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (args.length >= 2) {
|
|
29
|
+
user = args[1];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (args.length >= 3) {
|
|
33
|
+
password = args[2];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
Retailer r = new Retailer(url, user, password);
|
|
37
|
+
Vendor v = new Vendor(url, user, password);
|
|
38
|
+
Supplier s1 = new Supplier("HardDrive", "StorageOrderQueue", url, user, password);
|
|
39
|
+
Supplier s2 = new Supplier("Monitor", "MonitorOrderQueue", url, user, password);
|
|
40
|
+
|
|
41
|
+
new Thread(r, "Retailer").start();
|
|
42
|
+
new Thread(v, "Vendor").start();
|
|
43
|
+
new Thread(s1, "Supplier 1").start();
|
|
44
|
+
new Thread(s2, "Supplier 2").start();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
}
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
3
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
4
|
+
* this work for additional information regarding copyright ownership.
|
|
5
|
+
* The ASF licenses this file to You under the Apache License, Version 2.0
|
|
6
|
+
* (the "License"); you may not use this file except in compliance with
|
|
7
|
+
* the License. You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import java.util.HashMap;
|
|
18
|
+
import java.util.Map;
|
|
19
|
+
import java.util.Random;
|
|
20
|
+
|
|
21
|
+
import javax.jms.Connection;
|
|
22
|
+
import javax.jms.Destination;
|
|
23
|
+
import javax.jms.JMSException;
|
|
24
|
+
import javax.jms.MapMessage;
|
|
25
|
+
import javax.jms.Message;
|
|
26
|
+
import javax.jms.MessageConsumer;
|
|
27
|
+
import javax.jms.MessageListener;
|
|
28
|
+
import javax.jms.MessageProducer;
|
|
29
|
+
import javax.jms.Session;
|
|
30
|
+
import javax.jms.TemporaryQueue;
|
|
31
|
+
|
|
32
|
+
import org.apache.activemq.ActiveMQConnectionFactory;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The Vendor synchronously, and in a single transaction, receives the
|
|
36
|
+
* order from VendorOrderQueue and sends messages to the two Suppliers via
|
|
37
|
+
* MonitorOrderQueue and StorageOrderQueue.
|
|
38
|
+
* The responses are received asynchronously; when both responses come
|
|
39
|
+
* back, the order confirmation message is sent back to the Retailer.
|
|
40
|
+
*/
|
|
41
|
+
public class Vendor implements Runnable, MessageListener {
|
|
42
|
+
private String url;
|
|
43
|
+
private String user;
|
|
44
|
+
private String password;
|
|
45
|
+
private Session asyncSession;
|
|
46
|
+
private int numSuppliers = 2;
|
|
47
|
+
private Object supplierLock = new Object();
|
|
48
|
+
|
|
49
|
+
public Vendor(String url, String user, String password) {
|
|
50
|
+
this.url = url;
|
|
51
|
+
this.user = user;
|
|
52
|
+
this.password = password;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
public void run() {
|
|
56
|
+
ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(user, password, url);
|
|
57
|
+
Session session = null;
|
|
58
|
+
Destination orderQueue;
|
|
59
|
+
Destination monitorOrderQueue;
|
|
60
|
+
Destination storageOrderQueue;
|
|
61
|
+
TemporaryQueue vendorConfirmQueue;
|
|
62
|
+
MessageConsumer orderConsumer = null;
|
|
63
|
+
MessageProducer monitorProducer = null;
|
|
64
|
+
MessageProducer storageProducer = null;
|
|
65
|
+
|
|
66
|
+
try {
|
|
67
|
+
Connection connection = connectionFactory.createConnection();
|
|
68
|
+
|
|
69
|
+
session = connection.createSession(true, Session.SESSION_TRANSACTED);
|
|
70
|
+
orderQueue = session.createQueue("VendorOrderQueue");
|
|
71
|
+
monitorOrderQueue = session.createQueue("MonitorOrderQueue");
|
|
72
|
+
storageOrderQueue = session.createQueue("StorageOrderQueue");
|
|
73
|
+
|
|
74
|
+
orderConsumer = session.createConsumer(orderQueue);
|
|
75
|
+
monitorProducer = session.createProducer(monitorOrderQueue);
|
|
76
|
+
storageProducer = session.createProducer(storageOrderQueue);
|
|
77
|
+
|
|
78
|
+
Connection asyncconnection = connectionFactory.createConnection();
|
|
79
|
+
asyncSession = asyncconnection.createSession(true, Session.SESSION_TRANSACTED);
|
|
80
|
+
|
|
81
|
+
vendorConfirmQueue = asyncSession.createTemporaryQueue();
|
|
82
|
+
MessageConsumer confirmConsumer = asyncSession.createConsumer(vendorConfirmQueue);
|
|
83
|
+
confirmConsumer.setMessageListener(this);
|
|
84
|
+
|
|
85
|
+
asyncconnection.start();
|
|
86
|
+
|
|
87
|
+
connection.start();
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
while (true) {
|
|
91
|
+
Order order = null;
|
|
92
|
+
try {
|
|
93
|
+
Message inMessage = orderConsumer.receive();
|
|
94
|
+
MapMessage message;
|
|
95
|
+
if (inMessage instanceof MapMessage) {
|
|
96
|
+
message = (MapMessage) inMessage;
|
|
97
|
+
|
|
98
|
+
} else {
|
|
99
|
+
// end of stream
|
|
100
|
+
Message outMessage = session.createMessage();
|
|
101
|
+
outMessage.setJMSReplyTo(vendorConfirmQueue);
|
|
102
|
+
monitorProducer.send(outMessage);
|
|
103
|
+
storageProducer.send(outMessage);
|
|
104
|
+
session.commit();
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Randomly throw an exception in here to simulate a Database error
|
|
109
|
+
// and trigger a rollback of the transaction
|
|
110
|
+
if (new Random().nextInt(3) == 0) {
|
|
111
|
+
throw new JMSException("Simulated Database Error.");
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
order = new Order(message);
|
|
115
|
+
|
|
116
|
+
MapMessage orderMessage = session.createMapMessage();
|
|
117
|
+
orderMessage.setJMSReplyTo(vendorConfirmQueue);
|
|
118
|
+
orderMessage.setInt("VendorOrderNumber", order.getOrderNumber());
|
|
119
|
+
int quantity = message.getInt("Quantity");
|
|
120
|
+
System.out.println("Vendor: Retailer ordered " + quantity + " " + message.getString("Item"));
|
|
121
|
+
|
|
122
|
+
orderMessage.setInt("Quantity", quantity);
|
|
123
|
+
orderMessage.setString("Item", "Monitor");
|
|
124
|
+
monitorProducer.send(orderMessage);
|
|
125
|
+
System.out.println("Vendor: ordered " + quantity + " Monitor(s)");
|
|
126
|
+
|
|
127
|
+
orderMessage.setString("Item", "HardDrive");
|
|
128
|
+
storageProducer.send(orderMessage);
|
|
129
|
+
System.out.println("Vendor: ordered " + quantity + " Hard Drive(s)");
|
|
130
|
+
|
|
131
|
+
session.commit();
|
|
132
|
+
System.out.println("Vendor: Comitted Transaction 1");
|
|
133
|
+
|
|
134
|
+
} catch (JMSException e) {
|
|
135
|
+
System.out.println("Vendor: JMSException Occured: " + e.getMessage());
|
|
136
|
+
e.printStackTrace();
|
|
137
|
+
session.rollback();
|
|
138
|
+
System.out.println("Vendor: Rolled Back Transaction.");
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
synchronized (supplierLock) {
|
|
143
|
+
while (numSuppliers > 0) {
|
|
144
|
+
try {
|
|
145
|
+
supplierLock.wait();
|
|
146
|
+
} catch (InterruptedException e) {
|
|
147
|
+
e.printStackTrace();
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
connection.close();
|
|
153
|
+
asyncconnection.close();
|
|
154
|
+
|
|
155
|
+
} catch (JMSException e) {
|
|
156
|
+
e.printStackTrace();
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
public void onMessage(Message message) {
|
|
162
|
+
if (!(message instanceof MapMessage)) {
|
|
163
|
+
synchronized(supplierLock) {
|
|
164
|
+
numSuppliers--;
|
|
165
|
+
supplierLock.notifyAll();
|
|
166
|
+
}
|
|
167
|
+
try {
|
|
168
|
+
asyncSession.commit();
|
|
169
|
+
return;
|
|
170
|
+
} catch (JMSException e) {
|
|
171
|
+
e.printStackTrace();
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
int orderNumber = -1;
|
|
176
|
+
try {
|
|
177
|
+
MapMessage componentMessage = (MapMessage) message;
|
|
178
|
+
|
|
179
|
+
orderNumber = componentMessage.getInt("VendorOrderNumber");
|
|
180
|
+
Order order = Order.getOrder(orderNumber);
|
|
181
|
+
order.processSubOrder(componentMessage);
|
|
182
|
+
asyncSession.commit();
|
|
183
|
+
|
|
184
|
+
if (! "Pending".equals(order.getStatus())) {
|
|
185
|
+
System.out.println("Vendor: Completed processing for order " + orderNumber);
|
|
186
|
+
|
|
187
|
+
MessageProducer replyProducer = asyncSession.createProducer(order.getMessage().getJMSReplyTo());
|
|
188
|
+
MapMessage replyMessage = asyncSession.createMapMessage();
|
|
189
|
+
if ("Fulfilled".equals(order.getStatus())) {
|
|
190
|
+
replyMessage.setBoolean("OrderAccepted", true);
|
|
191
|
+
System.out.println("Vendor: sent " + order.quantity + " computer(s)");
|
|
192
|
+
} else {
|
|
193
|
+
replyMessage.setBoolean("OrderAccepted", false);
|
|
194
|
+
System.out.println("Vendor: unable to send " + order.quantity + " computer(s)");
|
|
195
|
+
}
|
|
196
|
+
replyProducer.send(replyMessage);
|
|
197
|
+
asyncSession.commit();
|
|
198
|
+
System.out.println("Vender: committed transaction 2");
|
|
199
|
+
}
|
|
200
|
+
} catch (JMSException e) {
|
|
201
|
+
e.printStackTrace();
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
public static class Order {
|
|
206
|
+
private static Map<Integer, Order> pendingOrders = new HashMap<Integer, Order>();
|
|
207
|
+
private static int nextOrderNumber = 1;
|
|
208
|
+
|
|
209
|
+
private int orderNumber;
|
|
210
|
+
private int quantity;
|
|
211
|
+
private MapMessage monitor = null;
|
|
212
|
+
private MapMessage storage = null;
|
|
213
|
+
private MapMessage message;
|
|
214
|
+
private String status;
|
|
215
|
+
|
|
216
|
+
public Order(MapMessage message) {
|
|
217
|
+
this.orderNumber = nextOrderNumber++;
|
|
218
|
+
this.message = message;
|
|
219
|
+
try {
|
|
220
|
+
this.quantity = message.getInt("Quantity");
|
|
221
|
+
} catch (JMSException e) {
|
|
222
|
+
e.printStackTrace();
|
|
223
|
+
this.quantity = 0;
|
|
224
|
+
}
|
|
225
|
+
status = "Pending";
|
|
226
|
+
pendingOrders.put(orderNumber, this);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
public Object getStatus() {
|
|
230
|
+
return status;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
public int getOrderNumber() {
|
|
234
|
+
return orderNumber;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
public static int getOutstandingOrders() {
|
|
238
|
+
return pendingOrders.size();
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
public static Order getOrder(int number) {
|
|
242
|
+
return pendingOrders.get(number);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
public MapMessage getMessage() {
|
|
246
|
+
return message;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
public void processSubOrder(MapMessage message) {
|
|
250
|
+
String itemName = null;
|
|
251
|
+
try {
|
|
252
|
+
itemName = message.getString("Item");
|
|
253
|
+
} catch (JMSException e) {
|
|
254
|
+
e.printStackTrace();
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
if ("Monitor".equals(itemName)) {
|
|
258
|
+
monitor = message;
|
|
259
|
+
} else if ("HardDrive".equals(itemName)) {
|
|
260
|
+
storage = message;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
if (null != monitor && null != storage) {
|
|
264
|
+
// Received both messages
|
|
265
|
+
try {
|
|
266
|
+
if (quantity > monitor.getInt("Quantity")) {
|
|
267
|
+
status = "Cancelled";
|
|
268
|
+
} else if (quantity > storage.getInt("Quantity")) {
|
|
269
|
+
status = "Cancelled";
|
|
270
|
+
} else {
|
|
271
|
+
status = "Fulfilled";
|
|
272
|
+
}
|
|
273
|
+
} catch (JMSException e) {
|
|
274
|
+
e.printStackTrace();
|
|
275
|
+
status = "Cancelled";
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
public static void main(String[] args) {
|
|
282
|
+
String url = "tcp://localhost:61616";
|
|
283
|
+
String user = null;
|
|
284
|
+
String password = null;
|
|
285
|
+
|
|
286
|
+
if (args.length >= 1) {
|
|
287
|
+
url = args[0];
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
if (args.length >= 2) {
|
|
291
|
+
user = args[1];
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
if (args.length >= 3) {
|
|
295
|
+
password = args[2];
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
Vendor v = new Vendor(url, user, password);
|
|
299
|
+
|
|
300
|
+
new Thread(v, "Vendor").start();
|
|
301
|
+
}
|
|
302
|
+
}
|