diff --git a/uk.ac.diamond.org.apache.activemq/.classpath b/uk.ac.diamond.org.apache.activemq/.classpath index 259e6d13e..672ae0656 100644 --- a/uk.ac.diamond.org.apache.activemq/.classpath +++ b/uk.ac.diamond.org.apache.activemq/.classpath @@ -1,5 +1,25 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/DEPENDENCIES b/uk.ac.diamond.org.apache.activemq/META-INF/DEPENDENCIES deleted file mode 100644 index eb5376651..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/DEPENDENCIES +++ /dev/null @@ -1,285 +0,0 @@ -// ------------------------------------------------------------------ -// Transitive dependencies of this project determined from the -// maven pom organized by organization. -// ------------------------------------------------------------------ - -ActiveMQ :: All JAR bundle - - -From: 'an unknown organization' - - AOP alliance (http://aopalliance.sourceforge.net) aopalliance:aopalliance:jar:1.0 - License: Public Domain - - FindBugs-jsr305 (http://findbugs.sourceforge.net/) com.google.code.findbugs:jsr305:jar:1.3.9 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - Guava: Google Core Libraries for Java (http://code.google.com/p/guava-libraries/guava) com.google.guava:guava:jar:12.0 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - hadoop-core org.apache.hadoop:hadoop-core:jar:1.0.0 - - - Bouncy Castle PKIX, CMS, EAC, TSP, PKCS, OCSP, CMP, and CRMF APIs (http://www.bouncycastle.org/java.html) org.bouncycastle:bcpkix-jdk15on:jar:1.47 - License: Bouncy Castle Licence (http://www.bouncycastle.org/licence.html) - - Bouncy Castle Provider (http://www.bouncycastle.org/java.html) org.bouncycastle:bcprov-jdk15on:jar:1.47 - License: Bouncy Castle Licence (http://www.bouncycastle.org/licence.html) - - leveldb (http://github.com/dain/leveldb/leveldb) org.iq80.leveldb:leveldb:jar:0.6 - License: Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0.html) - - leveldb-api (http://github.com/dain/leveldb/leveldb-api) org.iq80.leveldb:leveldb-api:jar:0.6 - License: Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0.html) - - snappy (http://github.com/dain/snappy) org.iq80.snappy:snappy:jar:0.2 - License: Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0.html) - - XML Pull Parsing API (http://www.xmlpull.org) xmlpull:xmlpull:jar:1.1.3.1 - License: Public Domain (http://www.xmlpull.org/v1/download/unpacked/LICENSE.txt) - -From: 'Apache Software Foundation' (http://www.apache.org) - - Apache Log4j (http://logging.apache.org/log4j/1.2/) log4j:log4j:bundle:1.2.17 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - Apache Log4j (http://logging.apache.org/log4j/1.2/) log4j:log4j:bundle:1.2.17 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - Annotation 1.0 (http://geronimo.apache.org/specs/geronimo-annotation_1.0_spec) org.apache.geronimo.specs:geronimo-annotation_1.0_spec:jar:1.1.1 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - Annotation 1.0 (http://geronimo.apache.org/specs/geronimo-annotation_1.0_spec) org.apache.geronimo.specs:geronimo-annotation_1.0_spec:jar:1.1.1 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - J2EE Management 1.1 (http://geronimo.apache.org/specs/geronimo-j2ee-management_1.1_spec) org.apache.geronimo.specs:geronimo-j2ee-management_1.1_spec:jar:1.0.1 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - J2EE Management 1.1 (http://geronimo.apache.org/specs/geronimo-j2ee-management_1.1_spec) org.apache.geronimo.specs:geronimo-j2ee-management_1.1_spec:jar:1.0.1 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - JMS 1.1 (http://geronimo.apache.org/specs/geronimo-jms_1.1_spec) org.apache.geronimo.specs:geronimo-jms_1.1_spec:jar:1.1.1 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - JMS 1.1 (http://geronimo.apache.org/specs/geronimo-jms_1.1_spec) org.apache.geronimo.specs:geronimo-jms_1.1_spec:jar:1.1.1 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - -From: 'Apache Software Foundation' (http://www.apache.org/) - - JTA (http://geronimo.apache.org/geronimo-jta_1.0.1B_spec) org.apache.geronimo.specs:geronimo-jta_1.0.1B_spec:jar:1.0.1 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - -From: 'Extreme! Lab, Indiana University' (http://www.extreme.indiana.edu/) - - MXP1: Xml Pull Parser 3rd Edition (XPP3) (http://www.extreme.indiana.edu/xgws/xsoap/xpp/mxp1/) xpp3:xpp3_min:jar:1.1.4c - License: Indiana University Extreme! Lab Software License, vesion 1.1.1 (http://www.extreme.indiana.edu/viewcvs/~checkout~/XPP3/java/LICENSE.txt) License: Public Domain (http://creativecommons.org/licenses/publicdomain) - -From: 'FasterXML' (http://fasterxml.com) - - Jackson (http://jackson.codehaus.org) org.codehaus.jackson:jackson-core-asl:jar:1.9.12 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - Data Mapper for Jackson (http://jackson.codehaus.org) org.codehaus.jackson:jackson-mapper-asl:jar:1.9.12 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - -From: 'FuseSource, Corp.' (http://fusesource.com/) - - hawtbuf (http://hawtbuf.fusesource.org/hawtbuf) org.fusesource.hawtbuf:hawtbuf:bundle:1.9 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - hawtbuf (http://hawtbuf.fusesource.org/hawtbuf) org.fusesource.hawtbuf:hawtbuf:bundle:1.9 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - hawtbuf-proto (http://hawtbuf.fusesource.org/hawtbuf-proto) org.fusesource.hawtbuf:hawtbuf-proto:bundle:1.9 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - hawtdispatch (http://hawtdispatch.fusesource.org/hawtdispatch/) org.fusesource.hawtdispatch:hawtdispatch:bundle:1.18 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - hawtdispatch-scala (http://hawtdispatch.fusesource.org/hawtdispatch-scala/) org.fusesource.hawtdispatch:hawtdispatch-scala:bundle:1.18 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - hawtdispatch-transport (http://hawtdispatch.fusesource.org/hawtdispatch-transport/) org.fusesource.hawtdispatch:hawtdispatch-transport:bundle:1.18 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - HawtJNI Runtime (http://hawtjni.fusesource.org/hawtjni-runtime) org.fusesource.hawtjni:hawtjni-runtime:jar:1.8 - License: Eclipse Public License - v 1.0 (http://www.eclipse.org/legal/epl-v10.html) License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - leveldbjni (http://leveldbjni.fusesource.org/leveldbjni) org.fusesource.leveldbjni:leveldbjni:jar:1.7 - License: The BSD 3-Clause License (http://www.opensource.org/licenses/BSD-3-Clause) - - mqtt-client (http://mqtt-client.fusesource.org/mqtt-client/) org.fusesource.mqtt-client:mqtt-client:bundle:1.6 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - -From: 'LAMP/EPFL' (http://lamp.epfl.ch/) - - scala-library (http://www.scala-lang.org/) org.scala-lang:scala-library:jar:2.9.1 - License: BSD-like (http://www.scala-lang.org/downloads/license.html) - -From: 'Mort Bay Consulting' (http://www.mortbay.com) - - Jetty :: Http Utility (http://www.eclipse.org/jetty/jetty-http) org.eclipse.jetty:jetty-http:jar:7.6.9.v20130131 - License: Apache Software License - Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) License: Eclipse Public License - Version 1.0 (http://www.eclipse.org/org/documents/epl-v10.php) - - Jetty :: IO Utility (http://www.eclipse.org/jetty/jetty-io) org.eclipse.jetty:jetty-io:jar:7.6.9.v20130131 - License: Apache Software License - Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) License: Eclipse Public License - Version 1.0 (http://www.eclipse.org/org/documents/epl-v10.php) - - Jetty :: Utilities (http://www.eclipse.org/jetty/jetty-util) org.eclipse.jetty:jetty-util:jar:7.6.9.v20130131 - License: Apache Software License - Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) License: Eclipse Public License - Version 1.0 (http://www.eclipse.org/org/documents/epl-v10.php) - - Jetty :: Websocket (http://www.eclipse.org/jetty/jetty-websocket) org.eclipse.jetty:jetty-websocket:jar:7.6.9.v20130131 - License: Apache Software License - Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) License: Eclipse Public License - Version 1.0 (http://www.eclipse.org/org/documents/epl-v10.php) - - Jetty :: Aggregate :: All Server (http://www.eclipse.org/jetty/jetty-aggregate-project/jetty-all-server) org.eclipse.jetty.aggregate:jetty-all-server:jar:7.6.9.v20130131 - License: Apache Software License - Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) License: Eclipse Public License - Version 1.0 (http://www.eclipse.org/org/documents/epl-v10.php) - - Jetty Orbit :: Activation (http://www.eclipse.org/jetty/jetty-orbit/javax.activation) org.eclipse.jetty.orbit:javax.activation:orbit:1.1.0.v201105071233 - License: Apache Software License - Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) License: Eclipse Public License - Version 1.0 (http://www.eclipse.org/org/documents/epl-v10.php) - - Jetty Orbit :: Annotation (http://www.eclipse.org/jetty/jetty-orbit/javax.annotation) org.eclipse.jetty.orbit:javax.annotation:orbit:1.1.0.v201108011116 - License: Apache Software License - Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) License: Eclipse Public License - Version 1.0 (http://www.eclipse.org/org/documents/epl-v10.php) - - Jetty Orbit :: Glassfish Mail (http://www.eclipse.org/jetty/jetty-orbit/javax.mail.glassfish) org.eclipse.jetty.orbit:javax.mail.glassfish:orbit:1.4.1.v201005082020 - License: Apache Software License - Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) License: Eclipse Public License - Version 1.0 (http://www.eclipse.org/org/documents/epl-v10.php) - - Jetty Orbit :: JASPI API (http://www.eclipse.org/jetty/jetty-orbit/javax.security.auth.message) org.eclipse.jetty.orbit:javax.security.auth.message:orbit:1.0.0.v201108011116 - License: Apache Software License - Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) License: Eclipse Public License - Version 1.0 (http://www.eclipse.org/org/documents/epl-v10.php) - - Jetty Orbit :: Servlet API (http://www.eclipse.org/jetty/jetty-orbit/javax.servlet) org.eclipse.jetty.orbit:javax.servlet:orbit:2.5.0.v201103041518 - License: Apache Software License - Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) License: Eclipse Public License - Version 1.0 (http://www.eclipse.org/org/documents/epl-v10.php) - - Jetty Server (http://www.eclipse.org/jetty/jetty-parent/project/modules/jetty) org.mortbay.jetty:jetty:jar:6.1.26 - License: Apache Software License - Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) License: Eclipse Public License - Version 1.0 (http://www.eclipse.org/org/documents/epl-v10.php) - - Jetty Utilities (http://www.eclipse.org/jetty/jetty-parent/project/jetty-util) org.mortbay.jetty:jetty-util:jar:6.1.26 - License: Apache Software License - Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) License: Eclipse Public License - Version 1.0 (http://www.eclipse.org/org/documents/epl-v10.php) - - Glassfish Jasper (http://jetty.mortbay.org/project/modules/jsp-2.1) org.mortbay.jetty:jsp-2.1:jar:6.1.14 - License: CDDL 1.0 (https://glassfish.dev.java.net/public/CDDLv1.0.html) - - Glassfish Jasper API (http://jetty.mortbay.org/project/modules/jsp-api-2.1) org.mortbay.jetty:jsp-api-2.1:jar:6.1.14 - License: Apache License Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) - - Servlet Specification API (http://jetty.mortbay.org/servlet-api) org.mortbay.jetty:servlet-api:jar:2.5-20081211 - License: Apache License Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) - - Servlet Specification 2.5 API (http://jetty.mortbay.org/project/modules/servlet-api-2.5) org.mortbay.jetty:servlet-api-2.5:jar:6.1.14 - License: CDDL 1.0 (https://glassfish.dev.java.net/public/CDDLv1.0.html) - -From: 'Oracle Corporation' (http://www.oracle.com/) - - JAXB Reference Implementation (http://jaxb.java.net/) com.sun.xml.bind:jaxb-impl:jar:2.2.6 - License: CDDL 1.1 (https://glassfish.java.net/public/CDDL+GPL_1_1.html) License: GPL2 w/ CPE (https://glassfish.java.net/public/CDDL+GPL_1_1.html) - -From: 'QOS.ch' (http://www.qos.ch) - - SLF4J API Module (http://www.slf4j.org) org.slf4j:slf4j-api:jar:1.7.5 - License: MIT License (http://www.opensource.org/licenses/mit-license.php) - - SLF4J API Module (http://www.slf4j.org) org.slf4j:slf4j-api:jar:1.7.5 - License: MIT License (http://www.opensource.org/licenses/mit-license.php) - - SLF4J LOG4J-12 Binding (http://www.slf4j.org) org.slf4j:slf4j-log4j12:jar:1.7.5 - License: MIT License (http://www.opensource.org/licenses/mit-license.php) - - SLF4J LOG4J-12 Binding (http://www.slf4j.org) org.slf4j:slf4j-log4j12:jar:1.7.5 - License: MIT License (http://www.opensource.org/licenses/mit-license.php) - -From: 'SpringSource' (http://springsource.org/spring-framework) - - Spring AOP (https://github.com/SpringSource/spring-framework) org.springframework:spring-aop:jar:3.2.4.RELEASE - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - Spring Beans (https://github.com/SpringSource/spring-framework) org.springframework:spring-beans:jar:3.2.4.RELEASE - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - Spring Context (https://github.com/SpringSource/spring-framework) org.springframework:spring-context:jar:3.2.4.RELEASE - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - Spring Core (https://github.com/SpringSource/spring-framework) org.springframework:spring-core:jar:3.2.4.RELEASE - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - Spring Expression Language (SpEL) (https://github.com/SpringSource/spring-framework) org.springframework:spring-expression:jar:3.2.4.RELEASE - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - Spring JMS (https://github.com/SpringSource/spring-framework) org.springframework:spring-jms:jar:3.2.4.RELEASE - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - Spring Transaction (https://github.com/SpringSource/spring-framework) org.springframework:spring-tx:jar:3.2.4.RELEASE - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - -From: 'The Apache Software Foundation' (http://commons.apache.org/) - - Commons Configuration (http://commons.apache.org/${pom.artifactId.substring(8)}/) commons-configuration:commons-configuration:jar:1.6 - License: The Apache Software License, Version 2.0 (/LICENSE.txt) - -From: 'The Apache Software Foundation' (http://jakarta.apache.org) - - Digester (http://jakarta.apache.org/commons/digester/) commons-digester:commons-digester:jar:1.8 - License: The Apache Software License, Version 2.0 (/LICENSE.txt) - -From: 'The Apache Software Foundation' (http://www.apache.org) - - Apache XBean :: Spring (http://geronimo.apache.org/maven/xbean/3.14/xbean-spring) org.apache.xbean:xbean-spring:bundle:3.14 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - -From: 'The Apache Software Foundation' (http://www.apache.org/) - - ant (http://www.apache.org/ant/) ant:ant:jar:1.6.5 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - Commons BeanUtils (http://commons.apache.org/beanutils/) commons-beanutils:commons-beanutils:jar:1.8.3 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - Commons BeanUtils Core (http://commons.apache.org/beanutils/) commons-beanutils:commons-beanutils-core:jar:1.8.0 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - Commons Codec (http://commons.apache.org/codec/) commons-codec:commons-codec:jar:1.6 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - Commons Collections (http://commons.apache.org/collections/) commons-collections:commons-collections:jar:3.2.1 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - Commons Daemon (http://commons.apache.org/daemon/) commons-daemon:commons-daemon:jar:1.0.15 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - Commons Lang (http://commons.apache.org/lang/) commons-lang:commons-lang:jar:2.6 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - Commons Logging (http://commons.apache.org/proper/commons-logging/) commons-logging:commons-logging:jar:1.1.3 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - Commons Net (http://commons.apache.org/proper/commons-net/) commons-net:commons-net:jar:3.3 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - Commons Pool (http://commons.apache.org/pool/) commons-pool:commons-pool:jar:1.6 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - ActiveIO :: Core (http://activemq.apache.org/activeio-core/) org.apache.activemq:activeio-core:bundle:3.1.4 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - ActiveMQ :: AMQP (http://activemq.apache.org/activemq-amqp) org.apache.activemq:activemq-amqp:jar:5.9.0 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - ActiveMQ :: AMQP (http://activemq.apache.org/activemq-amqp) org.apache.activemq:activemq-amqp:jar:5.9.0 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - ActiveMQ :: Broker (http://activemq.apache.org/activemq-broker) org.apache.activemq:activemq-broker:jar:5.9.0 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - ActiveMQ :: Broker (http://activemq.apache.org/activemq-broker) org.apache.activemq:activemq-broker:jar:5.9.0 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - ActiveMQ :: Camel (http://activemq.apache.org/activemq-camel) org.apache.activemq:activemq-camel:bundle:5.9.0 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - ActiveMQ :: Camel (http://activemq.apache.org/activemq-camel) org.apache.activemq:activemq-camel:bundle:5.9.0 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - ActiveMQ :: Client (http://activemq.apache.org/activemq-client) org.apache.activemq:activemq-client:jar:5.9.0 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - ActiveMQ :: Client (http://activemq.apache.org/activemq-client) org.apache.activemq:activemq-client:jar:5.9.0 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - ActiveMQ :: Console (http://activemq.apache.org/activemq-console) org.apache.activemq:activemq-console:jar:5.9.0 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - ActiveMQ :: Console (http://activemq.apache.org/activemq-console) org.apache.activemq:activemq-console:jar:5.9.0 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - ActiveMQ :: HTTP Protocol Support (http://activemq.apache.org/activemq-http) org.apache.activemq:activemq-http:jar:5.9.0 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - ActiveMQ :: HTTP Protocol Support (http://activemq.apache.org/activemq-http) org.apache.activemq:activemq-http:jar:5.9.0 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - ActiveMQ :: JAAS (http://activemq.apache.org/activemq-jaas) org.apache.activemq:activemq-jaas:jar:5.9.0 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - ActiveMQ :: JDBC Store (http://activemq.apache.org/activemq-jdbc-store) org.apache.activemq:activemq-jdbc-store:jar:5.9.0 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - ActiveMQ :: JDBC Store (http://activemq.apache.org/activemq-jdbc-store) org.apache.activemq:activemq-jdbc-store:jar:5.9.0 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - ActiveMQ :: Generic JMS Pool (http://activemq.apache.org/activemq-jms-pool) org.apache.activemq:activemq-jms-pool:jar:5.9.0 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - ActiveMQ :: KahaDB Store (http://activemq.apache.org/activemq-kahadb-store) org.apache.activemq:activemq-kahadb-store:jar:5.9.0 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - ActiveMQ :: KahaDB Store (http://activemq.apache.org/activemq-kahadb-store) org.apache.activemq:activemq-kahadb-store:jar:5.9.0 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - ActiveMQ :: LevelDB Store (http://activemq.apache.org/activemq-leveldb-store) org.apache.activemq:activemq-leveldb-store:jar:5.9.0 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - ActiveMQ :: LevelDB Store (http://activemq.apache.org/activemq-leveldb-store) org.apache.activemq:activemq-leveldb-store:jar:5.9.0 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - ActiveMQ :: MQTT Protocol (http://activemq.apache.org/activemq-mqtt) org.apache.activemq:activemq-mqtt:jar:5.9.0 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - ActiveMQ :: MQTT Protocol (http://activemq.apache.org/activemq-mqtt) org.apache.activemq:activemq-mqtt:jar:5.9.0 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - ActiveMQ :: Openwire Legacy Support (http://activemq.apache.org/activemq-openwire-legacy) org.apache.activemq:activemq-openwire-legacy:jar:5.9.0 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - ActiveMQ :: Openwire Legacy Support (http://activemq.apache.org/activemq-openwire-legacy) org.apache.activemq:activemq-openwire-legacy:jar:5.9.0 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - ActiveMQ :: Pool (http://activemq.apache.org/activemq-pool) org.apache.activemq:activemq-pool:jar:5.9.0 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - ActiveMQ :: Spring (http://activemq.apache.org/activemq-spring) org.apache.activemq:activemq-spring:jar:5.9.0 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - ActiveMQ :: Spring (http://activemq.apache.org/activemq-spring) org.apache.activemq:activemq-spring:jar:5.9.0 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - ActiveMQ :: STOMP Protocol (http://activemq.apache.org/activemq-stomp) org.apache.activemq:activemq-stomp:jar:5.9.0 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - ActiveMQ :: STOMP Protocol (http://activemq.apache.org/activemq-stomp) org.apache.activemq:activemq-stomp:jar:5.9.0 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - ActiveMQ Protocol Buffers Implementation and Compiler (http://activemq.apache.org/activemq-protobuf) org.apache.activemq.protobuf:activemq-protobuf:maven-plugin:1.1 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - ActiveMQ Protocol Buffers Implementation and Compiler (http://activemq.apache.org/activemq-protobuf) org.apache.activemq.protobuf:activemq-protobuf:maven-plugin:1.1 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - Camel :: Core (http://camel.apache.org/camel-parent/camel-core) org.apache.camel:camel-core:bundle:2.12.1 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - Camel :: JMS (http://camel.apache.org/camel-parent/components/camel-jms) org.apache.camel:camel-jms:bundle:2.12.1 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - Camel :: Spring (http://camel.apache.org/camel-parent/components/camel-spring) org.apache.camel:camel-spring:bundle:2.12.1 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - HttpClient (http://hc.apache.org/httpcomponents-client) org.apache.httpcomponents:httpclient:jar:4.2.5 - License: Apache License (LICENSE.txt) - - HttpCore (http://hc.apache.org/httpcomponents-core-ga) org.apache.httpcomponents:httpcore:jar:4.2.4 - License: Apache License (LICENSE.txt) - - proton-api (http://qpid.apache.org/proton/proton-j/proton-api) org.apache.qpid:proton-api:jar:0.5 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - proton-j-impl (http://qpid.apache.org/proton/proton-j/proton-j-impl) org.apache.qpid:proton-j-impl:jar:0.5 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - proton-jms (http://qpid.apache.org/proton/proton-j/contrib/proton-jms) org.apache.qpid:proton-jms:jar:0.5 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - Apache ServiceMix :: Bundles :: josql (http://servicemix.apache.org/bundles-pom/org.apache.servicemix.bundles.josql/) org.apache.servicemix.bundles:org.apache.servicemix.bundles.josql:bundle:1.5_5 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - Apache Velocity (http://velocity.apache.org/engine/devel/) org.apache.velocity:velocity:jar:1.7 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - -From: 'The JASYPT team' (http://www.jasypt.org) - - JASYPT: Java Simplified Encryption (http://www.jasypt.org) org.jasypt:jasypt:jar:1.9.1 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - - JASYPT: Java Simplified Encryption (http://www.jasypt.org) org.jasypt:jasypt:jar:1.9.1 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - -From: 'xerial.org' (http://www.xerial.org/) - - Snappy for Java (http://github.com/xerial/snappy-java/) org.xerial.snappy:snappy-java:bundle:1.1.0-M4 - License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) - -From: 'XStream' (http://xstream.codehaus.org) - - XStream Core (http://codehaus.org/xstream-parent/xstream/) com.thoughtworks.xstream:xstream:jar:1.4.4 - License: BSD style (http://xstream.codehaus.org/license.html) - - - - diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/LICENSE b/uk.ac.diamond.org.apache.activemq/META-INF/LICENSE deleted file mode 100644 index d64569567..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed 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. diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/LICENSE.txt b/uk.ac.diamond.org.apache.activemq/META-INF/LICENSE.txt deleted file mode 100644 index d64569567..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed 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. diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/MANIFEST.MF b/uk.ac.diamond.org.apache.activemq/META-INF/MANIFEST.MF index b97740066..44f733947 100644 --- a/uk.ac.diamond.org.apache.activemq/META-INF/MANIFEST.MF +++ b/uk.ac.diamond.org.apache.activemq/META-INF/MANIFEST.MF @@ -3,7 +3,26 @@ Bundle-ManifestVersion: 2 Bundle-Name: Activemq Bundle-SymbolicName: uk.ac.diamond.org.apache.activemq Bundle-Version: 5.9.0 -Bundle-ClassPath: . +Bundle-ClassPath: jars/activemq-amqp-5.9.0.jar, + jars/activemq-broker-5.9.0.jar, + jars/activemq-camel-5.9.0.jar, + jars/activemq-client-5.9.0.jar, + jars/activemq-console-5.9.0.jar, + jars/activemq-http-5.9.0.jar, + jars/activemq-jdbc-store-5.9.0.jar, + jars/activemq-kahadb-store-5.9.0.jar, + jars/activemq-leveldb-store-5.9.0.jar, + jars/activemq-mqtt-5.9.0.jar, + jars/activemq-openwire-legacy-5.9.0.jar, + jars/activemq-protobuf-1.1.jar, + jars/activemq-spring-5.9.0.jar, + jars/activemq-stomp-5.9.0.jar, + jars/geronimo-j2ee-management_1.1_spec-1.0.1.jar, + jars/geronimo-jms_1.1_spec-1.1.1.jar, + jars/geronimo-jta_1.0.1B_spec-1.0.1.jar, + jars/hawtbuf-1.9.jar, + jars/jasypt-1.9.1.jar, + jars/log4j-1.2.17.jar Bundle-Vendor: Diamond Light Source (Apache Foundation) Export-Package: javax.jms, org.apache.activemq, diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/NOTICE b/uk.ac.diamond.org.apache.activemq/META-INF/NOTICE deleted file mode 100644 index d128f9c9f..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/NOTICE +++ /dev/null @@ -1,162 +0,0 @@ -// ------------------------------------------------------------------ -// NOTICE file corresponding to the section 4d of The Apache License, -// Version 2.0, in this case for Apache ActiveMQ -// ------------------------------------------------------------------ - -Apache ActiveMQ -Copyright 2005-2008 The Apache Software Foundation - -This product includes software developed at -The Apache Software Foundation (http://www.apache.org/). - - -ActiveMQ :: All JAR bundle -Copyright 2005-2013 The Apache Software Foundation - -ActiveMQ :: Camel -Copyright 2005-2013 The Apache Software Foundation - -ActiveMQ :: Spring -Copyright 2005-2013 The Apache Software Foundation - -ActiveMQ :: Console -Copyright 2005-2013 The Apache Software Foundation - -Apache Geronimo -Copyright 2003-2008 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - - Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) - - Licensed 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. - ---------------------------------- - -This distribution includes cryptographic software. The country in -which you currently reside may have restrictions on the import, -possession, use, and/or re-export to another country, of -encryption software. BEFORE using any encryption software, please -check your country's laws, regulations and policies concerning the -import, possession, or use, and re-export of encryption software, to -see if this is permitted. See http://www.wassenaar.org/ for more -information. - -The U.S. Government Department of Commerce, Bureau of Industry and -Security (BIS), has classified this software as Export Commodity -Control Number (ECCN) 5D002.C.1, which includes information security -software using or performing cryptographic functions with asymmetric -algorithms. The form and manner of this distribution makes it -eligible for export under the License Exception ENC Technology -Software Unrestricted (TSU) exception (see the BIS Export -Administration Regulations, Section 740.13) for both object code and -source code. - -The following provides more details on the cryptographic software -used (note that this software is not included in the distribution): - - * The PBE Encryption facilities require the Java Cryptography - extensions: http://java.sun.com/javase/technologies/security/. - -Distributions of this software may include software developed by -The Apache Software Foundation (http://www.apache.org/). - -ICU License - ICU 1.8.1 and later - -COPYRIGHT AND PERMISSION NOTICE - -Copyright (c) 1995-2006 International Business Machines -Corporation and others - -All rights reserved. - -Permission is hereby granted, free of charge, to any -person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the -Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, -distribute, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, -provided that the above copyright notice(s) and this -permission notice appear in all copies of the Software and -that both the above copyright notice(s) and this -permission notice appear in supporting documentation. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO -EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN -THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL -INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE -USE OR PERFORMANCE OF THIS SOFTWARE. - -Except as contained in this notice, the name of a copyright -holder shall not be used in advertising or otherwise to -promote the sale, use or other dealings in this Software -without prior written authorization of the copyright holder. - -ActiveMQ :: STOMP Protocol -Copyright 2005-2013 The Apache Software Foundation - -ActiveMQ :: Broker -Copyright 2005-2013 The Apache Software Foundation - -ActiveMQ :: AMQP -Copyright 2005-2013 The Apache Software Foundation - -ActiveMQ :: MQTT Protocol -Copyright 2005-2013 The Apache Software Foundation - -========================================================================= -== Apache Notice == -========================================================================= - -========================================================================= -== Protocol Buffers Notice == -========================================================================= - -This product includes software developed by the Protocol Buffers -project (http://code.google.com/apis/protocolbuffers). - -ActiveMQ :: HTTP Protocol Support -Copyright 2005-2013 The Apache Software Foundation - -ActiveMQ :: KahaDB Store -Copyright 2005-2013 The Apache Software Foundation - -ActiveMQ :: JDBC Store -Copyright 2005-2013 The Apache Software Foundation - -ActiveMQ :: LevelDB Store -Copyright 2005-2013 The Apache Software Foundation - -Apache log4j -Copyright 2007 The Apache Software Foundation - -ActiveMQ :: Client -Copyright 2005-2013 The Apache Software Foundation - -ActiveMQ :: Openwire Legacy Support -Copyright 2005-2013 The Apache Software Foundation - -ActiveMQ :: JAAS -Copyright 2005-2013 The Apache Software Foundation - - This product includes software developed by - The Apache Software Foundation (http://www.apache.org/). - diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/log4j/log4j/pom.properties b/uk.ac.diamond.org.apache.activemq/META-INF/maven/log4j/log4j/pom.properties deleted file mode 100644 index 812c2fbbf..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/log4j/log4j/pom.properties +++ /dev/null @@ -1,5 +0,0 @@ -#Generated by org.apache.felix.bundleplugin -#Sun May 06 13:24:49 CEST 2012 -version=1.2.17 -groupId=log4j -artifactId=log4j diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/log4j/log4j/pom.xml b/uk.ac.diamond.org.apache.activemq/META-INF/maven/log4j/log4j/pom.xml deleted file mode 100644 index 93881cd3a..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/log4j/log4j/pom.xml +++ /dev/null @@ -1,592 +0,0 @@ - - - - 4.0.0 - log4j - log4j - bundle - Apache Log4j - 1.2.17 - Apache Log4j 1.2 - http://logging.apache.org/log4j/1.2/ - - Bugzilla - https://issues.apache.org/bugzilla/describecomponents.cgi?product=Log4j - - - Gump - http://vmgump.apache.org/gump/public/logging-log4j-12/logging-log4j-12/index.html - - 1999 - - - log4j-user - log4j-user-subscribe@logging.apache.org - log4j-user-unsubscribe@logging.apache.org - log4j-user@logging.apache.org - http://mail-archives.apache.org/mod_mbox/logging-log4j-user/ - - http://marc.info/?l=log4j-user - http://dir.gmane.org/gmane.comp.jakarta.log4j.user - - - - log4j-dev - log4j-dev-subscribe@logging.apache.org - log4j-dev-unsubscribe@logging.apache.org - log4j-dev@logging.apache.org - http://mail-archives.apache.org/mod_mbox/logging-log4j-dev/ - - http://marc.info/?l=log4j-dev - http://dir.gmane.org/gmane.comp.jakarta.log4j.devel - - - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - scm:svn:http://svn.apache.org/repos/asf/logging/log4j/tags/v1_2_17_rc3 - scm:svn:https://svn.apache.org/repos/asf/logging/log4j/tags/v1_2_17_rc3 - http://svn.apache.org/viewvc/logging/log4j/tags/v1_2_17_rc3 - - - Apache Software Foundation - http://www.apache.org - - - - - org.apache.maven.plugins - maven-resources-plugin - - UTF-8 - - - - maven-surefire-plugin - 2.5 - - tests - plain - pertest - true - - org/apache/log4j/LevelTest.java - org/apache/log4j/PriorityTest.java - org/apache/log4j/CategoryTest.java - org/apache/log4j/FileAppenderTest.java - org/apache/log4j/LogManagerTest.java - org/apache/log4j/helpers.LogLogTest.java - org/apache/log4j/LayoutTest.java - org/apache/log4j/helpers.DateLayoutTest.java - org/apache/log4j/TTCCLayoutTest.java - org/apache/log4j/xml.XMLLayoutTest.java - org/apache/log4j/HTMLLayoutTest.java - org/apache/log4j/PatternLayoutTest.java - org/apache/log4j/spi.LoggingEventTest.java - org/apache/log4j/spi.ThrowableInformationTest.java - org/apache/log4j/spi.LocationInfoTest.java - org/apache/log4j/PropertyConfiguratorTest.java - org/apache/log4j/MinimumTestCase.java - org/apache/log4j/LoggerTestCase.java - org/apache/log4j/PatternLayoutTestCase.java - org/apache/log4j/HierarchyThresholdTestCase.java - org/apache/log4j/xml/DOMTestCase.java - org/apache/log4j/xml/CustomLevelTestCase.java - org/apache/log4j/customLogger/XLoggerTestCase.java - - - org/apache/log4j/xml/XMLLayoutTestCase.java - org/apache/log4j/xml/AsyncAppenderTestCase.java - org/apache/log4j/varia/LevelMatchFilterTestCase.java - - - org/apache/log4j/helpers/BoundedFIFOTestCase.java - org/apache/log4j/helpers/CyclicBufferTestCase.java - org/apache/log4j/helpers/PatternParserTestCase.java - org/apache/log4j/or/ORTestCase.java - org/apache/log4j/DRFATestCase.java - org/apache/log4j/RFATestCase.java - org/apache/log4j/varia/ERFATestCase.java - org/apache/log4j/net/SyslogAppenderTest - org/apache/log4j/nt/NTEventLogAppenderTest - org/apache/log4j/net/SocketAppenderTest - - - - - maven-compiler-plugin - 2.1 - - 1.4 - 1.4 - UTF-8 - - - - maven-jar-plugin - 2.3 - - - - - org.apache.log4j - - * - log4j - ${project.version} - "Apache Software Foundation" - - - - - - - - maven-antrun-plugin - 1.2 - - - - process-classes - ntdll - - - - - - - - - - - - run - - - - - test-compile - mkdir_tests_output - - - - - - - run - - - - clean - rmdir_tests_output - - - - - - - - run - - - - test - runAll - - - - - - - - - - - run - - - - - site - untag-site - - - - - - - - - - - run - - - - post-site - post-site - - - - - - - run - - - - site-deploy - site-deploy - - - - - - - run - - - - javadoc.resources - generate-sources - - run - - - - - - - - - - - - - - - - ant - ant-nodeps - 1.6.5 - - - ant-contrib - ant-contrib - 1.0b2 - - - ant - ant-junit - 1.6.5 - - - junit - junit - 3.8.1 - compile - - - sun.jdk - tools - 1.4.2 - system - ${tools.jar} - - - - - maven-assembly-plugin - 2.2-beta-5 - - - src/assembly/bin.xml - - false - - - - - assembly - - - - - - - maven-javadoc-plugin - 2.7 - - true - .svn - UTF-8 - UTF-8 - - - - - jar - javadoc - - - - site - pre-site - - javadoc - - - - - - maven-release-plugin - 2.0-beta-9 - - - package site-deploy assembly:attached deploy - - - - maven-source-plugin - 2.1.1 - - - - jar - - - - - - - org.codehaus.mojo - clirr-maven-plugin - 2.2.2 - - 1.2.15 - - - - org.codehaus.mojo - rat-maven-plugin - 1.0-alpha-3 - - - tests/witness/** - tests/output/** - tests/classes/** - - - - - org.apache.felix - maven-bundle-plugin - 2.1.0 - true - - - - !org.apache.log4j.lf5.*, - !org.apache.log4j.chainsaw.*, - org.apache.log4j.*;version=1.2.17;-noimport:=true - - !javax.swing.*, - !com.ibm.uvm.tools.*, - !com.sun.jdmk.comm.*, - javax.jmdns.*;resolution:=optional, - javax.jms.*;resolution:=optional, - javax.mail.*;resolution:=optional, - * - http://logging.apache.org/log4j/1.2 - - - - - maven-site-plugin - 3.1 - - ${basedir}/src/site/maven-site.vm - true - - - - package - - site - - - - - - tests/src/java - - - tests/resources - - - - - - - maven-project-info-reports-plugin - 2.4 - - - - scm - dependencies - cim - issue-tracking - mailing-list - license - - - - - - maven-jxr-plugin - 2.1 - - - maven-changes-plugin - 2.7 - - - - changes-report - - - - - - - - - mac - - - mac - - - - ${java.home}/../Classes/classes.jar - ${user.home}/.m2/repository - build - - - - default - - true - - - ${java.home}/../lib/tools.jar - ${user.home}/.m2/repository - build - - - - - - maven2-repository.dev.java.net - Java.net Repository for Maven - http://download.java.net/maven/2/ - default - - - - - javax.mail - mail - 1.4.3 - true - - - org.apache.openejb - javaee-api - 5.0-2 - jar - provided - - - - oro - oro - 2.0.8 - test - - - junit - junit - 3.8.2 - test - - - org.apache.geronimo.specs - geronimo-jms_1.1_spec - 1.0 - true - - - - - logging.repo - scp://people.apache.org/www/people.apache.org/builds/logging/repo/ - - - logging.site - scp://localhost/${user.dir}/target/site-deploy - - - - diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq.protobuf/activemq-protobuf/pom.properties b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq.protobuf/activemq-protobuf/pom.properties deleted file mode 100644 index d0d5561f5..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq.protobuf/activemq-protobuf/pom.properties +++ /dev/null @@ -1,5 +0,0 @@ -#Generated by Maven -#Tue Aug 03 14:19:49 CEST 2010 -version=1.1 -groupId=org.apache.activemq.protobuf -artifactId=activemq-protobuf diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq.protobuf/activemq-protobuf/pom.xml b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq.protobuf/activemq-protobuf/pom.xml deleted file mode 100644 index 7ee527208..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq.protobuf/activemq-protobuf/pom.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - 4.0.0 - - org.apache.activemq.protobuf - activemq-protobuf-pom - 1.1 - - - org.apache.activemq.protobuf - activemq-protobuf - 1.1 - maven-plugin - - ActiveMQ Protocol Buffers Implementation and Compiler - - - A Simpler Protocol Buffer Java API. Includes a Proto to Java compiler. - - - - - org.apache.maven - maven-plugin-api - 2.0 - true - - - org.apache.maven - maven-project - 2.0 - true - - - - junit - junit - 4.4 - test - - - - - - - maven-compiler-plugin - - 1.5 - 1.5 - - - - maven-surefire-plugin - - - **/*Test.java - - - - - org.codehaus.mojo - javacc-maven-plugin - 2.4.1 - - - javacc - - javacc - - - - - - - - diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-all/pom.properties b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-all/pom.properties deleted file mode 100644 index 38f58374d..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-all/pom.properties +++ /dev/null @@ -1,5 +0,0 @@ -#Generated by Maven -#Mon Oct 14 23:53:14 IST 2013 -version=5.9.0 -groupId=org.apache.activemq -artifactId=activemq-all diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-all/pom.xml b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-all/pom.xml deleted file mode 100644 index 414292481..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-all/pom.xml +++ /dev/null @@ -1,389 +0,0 @@ - - - - - 4.0.0 - - - org.apache.activemq - activemq-parent - 5.9.0 - - - activemq-all - jar - ActiveMQ :: All JAR bundle - Puts together an ActiveMQ jar bundle - - - - - - ${project.groupId} - activemq-camel - - - ${project.groupId} - activemq-console - - - - ${project.groupId} - activemq-stomp - - - ${project.groupId} - activemq-amqp - - - ${project.groupId} - activemq-mqtt - - - ${project.groupId} - activemq-http - - - - ${project.groupId} - activemq-kahadb-store - - - ${project.groupId} - activemq-jdbc-store - - - ${project.groupId} - activemq-leveldb-store - - - org.apache.geronimo.specs - geronimo-annotation_1.0_spec - - - org.slf4j - slf4j-log4j12 - - - - - - - - - org.apache.maven.plugins - maven-shade-plugin - ${maven-shade-plugin-version} - - - package - - shade - - - - - - ${project.groupId}:activemq-client - ${project.groupId}:activemq-openwire-legacy - ${project.groupId}:activemq-camel - - ${project.groupId}:activemq-jaas - ${project.groupId}:activemq-broker - ${project.groupId}:activemq-console - ${project.groupId}:activemq-spring - - ${project.groupId}:activemq-amqp - ${project.groupId}:activemq-http - ${project.groupId}:activemq-mqtt - ${project.groupId}:activemq-stomp - - ${project.groupId}:activemq-kahadb-store - ${project.groupId}:activemq-leveldb-store - ${project.groupId}:activemq-jdbc-store - - org.apache.activemq.protobuf:activemq-protobuf - org.fusesource.hawtbuf:hawtbuf - org.jasypt:jasypt - org.apache.geronimo.specs:geronimo-jms_1.1_spec - org.apache.geronimo.specs:geronimo-jta_1.0.1B_spec - org.apache.geronimo.specs:geronimo-j2ee-management_1.1_spec - org.apache.geronimo.specs:geronimo-annotation_1.0_spec - org.slf4j:slf4j-api - org.slf4j:slf4j-log4j12 - log4j:log4j - - - - - - Apache ActiveMQ - - - - META-INF/spring.handlers - - - - META-INF/services/com.sun.tools.xjc.Plugin - - - - META-INF/spring.schemas - - - - - - - - - - - - - deploy - - deploy - - - org.apache.maven.plugins - maven-source-plugin - ${maven-source-plugin-version} - - false - - - - attach-sources - - jar - - - - - - - - - apache-release - - - - - ${project.groupId} - activemq-client - ${project.version} - sources - true - - - ${project.groupId} - activemq-openwire-legacy - ${project.version} - sources - true - - - ${project.groupId} - activemq-camel - ${project.version} - sources - true - - - ${project.groupId} - activemq-jaas - ${project.version} - sources - true - - - ${project.groupId} - activemq-broker - ${project.version} - sources - true - - - ${project.groupId} - activemq-console - ${project.version} - sources - true - - - ${project.groupId} - activemq-spring - ${project.version} - sources - true - - - ${project.groupId} - activemq-amqp - ${project.version} - sources - true - - - ${project.groupId} - activemq-http - ${project.version} - sources - true - - - ${project.groupId} - activemq-mqtt - ${project.version} - sources - true - - - ${project.groupId} - activemq-stomp - ${project.version} - sources - true - - - ${project.groupId} - activemq-kahadb-store - ${project.version} - sources - true - - - ${project.groupId} - activemq-jdbc-store - ${project.version} - sources - true - - - ${project.groupId} - activemq-leveldb-store - ${project.version} - sources - true - - - org.apache.activemq.protobuf - activemq-protobuf - ${activemq-protobuf-version} - sources - true - - - org.fusesource.hawtbuf - hawtbuf - ${hawtbuf-version} - sources - true - - - org.jasypt - jasypt - ${jasypt-version} - sources - true - - - org.apache.geronimo.specs - geronimo-jms_1.1_spec - 1.1.1 - sources - true - - - - org.apache.geronimo.specs - geronimo-j2ee-management_1.1_spec - 1.0.1 - sources - true - - - org.apache.geronimo.specs - geronimo-annotation_1.0_spec - 1.1.1 - sources - true - - - org.slf4j - slf4j-api - ${slf4j-version} - sources - true - - - org.slf4j - slf4j-log4j12 - ${slf4j-version} - sources - true - - - log4j - log4j - ${log4j-version} - sources - true - - - - - - - maven-source-plugin - - true - - - - maven-assembly-plugin - - - uber-sources-jar - package - - single - - - - ${basedir}/src/main/descriptors/uber-sources.xml - - true - - - - - - - - - - diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-amqp/pom.properties b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-amqp/pom.properties deleted file mode 100644 index 1e837c7e3..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-amqp/pom.properties +++ /dev/null @@ -1,5 +0,0 @@ -#Generated by Maven -#Mon Oct 14 23:50:20 IST 2013 -version=5.9.0 -groupId=org.apache.activemq -artifactId=activemq-amqp diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-amqp/pom.xml b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-amqp/pom.xml deleted file mode 100644 index 174e94532..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-amqp/pom.xml +++ /dev/null @@ -1,162 +0,0 @@ - - - - - 4.0.0 - - - org.apache.activemq - activemq-parent - 5.9.0 - - - activemq-amqp - jar - - ActiveMQ :: AMQP - ActiveMQ implementaiton of AMQP messaging protocol - - - - org.apache.activemq - activemq-broker - - - org.slf4j - slf4j-api - - - org.apache.qpid - proton-jms - ${qpid-proton-version} - - - org.fusesource.hawtbuf - hawtbuf - ${hawtbuf-version} - - - - - org.apache.qpid - qpid-amqp-1-0-client-jms - ${qpid-jms-version} - test - - - org.apache.activemq - activemq-kahadb-store - test - - - ${project.groupId} - activemq-jaas - test - - - - - org.fusesource.joram-jms-tests - joram-jms-tests - 1.0 - test - - - - org.eclipse.jetty.aggregate - jetty-all-server - test - - - org.apache.activemq - activemq-broker - test-jar - test - - - org.apache.activemq - activemq-spring - test - - - org.apache.activemq - activemq-leveldb-store - test - - - junit - junit - test - - - org.slf4j - slf4j-log4j12 - test - - - - - - - swiftmq-client - - swiftmq-client-home - - - - com.swiftmq - swiftmq - 9.2.0 - system - ${swiftmq-client-home}/jars/swiftmq.jar - - - com.swiftmq - swiftmq-amqp - 9.2.0 - system - ${swiftmq-client-home}/jars/amqp.jar - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.7 - - - add-test-source - generate-sources - - add-test-source - - - - ${basedir}/src/test-swiftmq/java - - - - - - - - - - diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-broker/pom.properties b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-broker/pom.properties deleted file mode 100644 index 994610fa9..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-broker/pom.properties +++ /dev/null @@ -1,5 +0,0 @@ -#Generated by Maven -#Mon Oct 14 23:44:52 IST 2013 -version=5.9.0 -groupId=org.apache.activemq -artifactId=activemq-broker diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-broker/pom.xml b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-broker/pom.xml deleted file mode 100644 index eba6d4557..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-broker/pom.xml +++ /dev/null @@ -1,223 +0,0 @@ - - - - - 4.0.0 - - - org.apache.activemq - activemq-parent - 5.9.0 - - - activemq-broker - jar - ActiveMQ :: Broker - The ActiveMQ Message Broker implementation - - - -Xmx512M - - - - - - - - org.apache.activemq - activemq-client - - - org.apache.activemq - activemq-openwire-legacy - - - - - - - - org.osgi - org.osgi.core - provided - true - - - org.apache.activemq - activemq-jaas - true - - - - - xalan - xalan - true - - - - - - - junit - junit - test - - - org.slf4j - slf4j-log4j12 - test - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - ${javase-javadoc-url} - ${javaee-javadoc-url} - ${slf4j-javadoc-url} - http://junit.sourceforge.net/javadoc/ - - ${basedir}/../etc/css/stylesheet.css - true - 256m - ${source-version} - - - JMS Client - org.apache.activemq:org.apache.activemq.command - - - JMS Client support classes for working with BLOBs and JNDI - org.apache.activemq.blob:org.apache.activemq.jndi - - - Enterprise Integration Pattern support via Camel - org.apache.activemq.camel:org.apache.activemq.camel.* - - - Spring support - org.apache.activemq.spring:org.apache.activemq.xbean:org.apache.activemq.pool - - - JMS Client Implementation classes - org.apache.activemq.filter:org.apache.activemq.management:org.apache.activemq.selector:org.apache.activemq.thread - - - Broker implementation - org.apache.activemq.advisory:org.apache.activemq.broker:org.apache.activemq.broker.*:org.apache.activemq.state:org.apache.activemq.security:org.apache.activemq.transaction - - - Broker Persistent Store - org.apache.activemq.store:org.apache.activemq.store.* - - - Kaha fast file based storage - org.apache.activemq.kaha:org.apache.activemq.kaha.* - - - Transports - org.apache.activemq.transport:org.apache.activemq.transport.* - - - Memory handling - org.apache.activemq.memory:org.apache.activemq.memory.* - - - Networks of Brokers - org.apache.activemq.network:org.apache.activemq.network.* - - - OpenWire support - org.apache.activemq.openwire:org.apache.activemq.openwire.* - - - Utility classes - org.apache.activemq.util:org.apache.activemq.wireformat:org.apache.activemq.proxy - - - - - - org.codehaus.mojo - findbugs-maven-plugin - ${findbugs-maven-plugin-version} - - Normal - Default - - - - - - - - - maven-surefire-plugin - - always - ${surefire.argLine} - alphabetical - - - org.apache.activemq.default.directory.prefix - target/ - - - - - - **/*Test.* - - - - - org.apache.maven.plugins - maven-clean-plugin - - - - ${basedir}/activemq-data - - - - - - - maven-jar-plugin - - - - test-jar - - - - - - - - - diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-camel/pom.properties b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-camel/pom.properties deleted file mode 100644 index 4beb2ea82..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-camel/pom.properties +++ /dev/null @@ -1,5 +0,0 @@ -#Generated by org.apache.felix.bundleplugin -#Mon Oct 14 23:52:16 IST 2013 -version=5.9.0 -groupId=org.apache.activemq -artifactId=activemq-camel diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-camel/pom.xml b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-camel/pom.xml deleted file mode 100644 index 544293e97..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-camel/pom.xml +++ /dev/null @@ -1,205 +0,0 @@ - - - - - 4.0.0 - - - org.apache.activemq - activemq-parent - 5.9.0 - - - activemq-camel - ActiveMQ :: Camel - ActiveMQ component for Camel - bundle - - - - org.springframework.jms*;version="[3,4)", - - - org.apache.activemq.camel*;version=${project.version};-noimport:=true - - - - - - - - - - org.slf4j - slf4j-api - - - org.apache.camel - camel-jms - - - ${project.groupId} - activemq-spring - - - - - ${project.groupId} - activemq-pool - - - org.apache.geronimo.specs - geronimo-annotation_1.0_spec - true - - - - - ${project.groupId} - activemq-unit-tests - test-jar - test - - - ${project.groupId} - activemq-broker - test-jar - test - - - org.apache.camel - camel-test - test - - - org.apache.camel - camel-test-spring - test - - - org.springframework - spring-test - test - - - junit - junit - test - - - org.hamcrest - hamcrest-all - test - - - org.apache.derby - derby - true - test - - - org.apache.xbean - xbean-spring - true - test - - - org.apache.geronimo.components - geronimo-transaction - true - test - - - org.objectweb.howl - howl - 1.0.1-1 - true - test - - - org.apache.openejb - openejb-core - 3.1.2 - true - test - - - org.jencks - jencks - 2.2 - true - test - - - ${project.groupId} - activemq-ra - true - test - - - org.jencks - jencks-amqpool - 2.2 - true - test - - - org.apache.camel - camel-jdbc - ${camel-version} - true - test - - - org.slf4j - slf4j-log4j12 - test - - - log4j - log4j - true - test - - - - - - - - maven-surefire-plugin - - pertest - false - true - -Xmx512M - - - org.apache.activemq.default.directory.prefix - target/ - - - - **/JmsJdbcXALoadTest.java - - - - - - - diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-client/pom.properties b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-client/pom.properties deleted file mode 100644 index 8fb50591c..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-client/pom.properties +++ /dev/null @@ -1,5 +0,0 @@ -#Generated by Maven -#Mon Oct 14 23:43:07 IST 2013 -version=5.9.0 -groupId=org.apache.activemq -artifactId=activemq-client diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-client/pom.xml b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-client/pom.xml deleted file mode 100644 index bfee19cee..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-client/pom.xml +++ /dev/null @@ -1,292 +0,0 @@ - - - - - 4.0.0 - - - org.apache.activemq - activemq-parent - 5.9.0 - - - activemq-client - jar - ActiveMQ :: Client - The ActiveMQ Client implementation - - - -Xmx512M - - - - - - - - org.slf4j - slf4j-api - - - org.apache.geronimo.specs - geronimo-jms_1.1_spec - - - org.fusesource.hawtbuf - hawtbuf - ${hawtbuf-version} - - - - - org.apache.geronimo.specs - geronimo-j2ee-management_1.1_spec - - - - - commons-net - commons-net - true - - - - javax.jmdns - jmdns - true - - - - - - - junit - junit - test - - - org.slf4j - slf4j-log4j12 - test - - - - - - - org.apache.activemq - activemq-openwire-generator - true - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - ${javase-javadoc-url} - ${javaee-javadoc-url} - ${slf4j-javadoc-url} - http://junit.sourceforge.net/javadoc/ - - ${basedir}/../etc/css/stylesheet.css - true - 256m - ${source-version} - - - JMS Client - org.apache.activemq:org.apache.activemq.command - - - JMS Client support classes for working with BLOBs and JNDI - org.apache.activemq.blob:org.apache.activemq.jndi - - - Enterprise Integration Pattern support via Camel - org.apache.activemq.camel:org.apache.activemq.camel.* - - - Spring support - org.apache.activemq.spring:org.apache.activemq.xbean:org.apache.activemq.pool - - - JMS Client Implementation classes - org.apache.activemq.filter:org.apache.activemq.management:org.apache.activemq.selector:org.apache.activemq.thread - - - Broker implementation - org.apache.activemq.advisory:org.apache.activemq.broker:org.apache.activemq.broker.*:org.apache.activemq.state:org.apache.activemq.security:org.apache.activemq.transaction - - - Broker Persistent Store - org.apache.activemq.store:org.apache.activemq.store.* - - - Kaha fast file based storage - org.apache.activemq.kaha:org.apache.activemq.kaha.* - - - Transports - org.apache.activemq.transport:org.apache.activemq.transport.* - - - Memory handling - org.apache.activemq.memory:org.apache.activemq.memory.* - - - Networks of Brokers - org.apache.activemq.network:org.apache.activemq.network.* - - - OpenWire support - org.apache.activemq.openwire:org.apache.activemq.openwire.* - - - Utility classes - org.apache.activemq.util:org.apache.activemq.wireformat:org.apache.activemq.proxy - - - - - - org.codehaus.mojo - findbugs-maven-plugin - ${findbugs-maven-plugin-version} - - Normal - Default - - - - - - - - - ${project.basedir}/src/main/resources - - **/* - - - - ${project.basedir}/src/main/filtered-resources - true - - **/* - - - - - - - maven-surefire-plugin - - always - ${surefire.argLine} - alphabetical - - - org.apache.activemq.default.directory.prefix - target/ - - - - - - **/*Test.* - - - - - - org.codehaus.mojo - javacc-maven-plugin - - - generate-sources - - ${basedir}/src/main/grammar - ${basedir}/target/generated-sources/javacc - org.apache.activemq.selector - - - javacc - - - - - - - - - - - - openwire-generate - - - org.apache.activemq - activemq-openwire-generator - ${project.version} - true - - - - - - org.apache.maven.plugins - maven-antrun-plugin - - - default - generate-sources - - run - - - - - - Running OpenWire Generator - - - - - - - - - - - - - diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-console/pom.properties b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-console/pom.properties deleted file mode 100644 index 6a14d81d8..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-console/pom.properties +++ /dev/null @@ -1,5 +0,0 @@ -#Generated by Maven -#Mon Oct 14 23:50:43 IST 2013 -version=5.9.0 -groupId=org.apache.activemq -artifactId=activemq-console diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-console/pom.xml b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-console/pom.xml deleted file mode 100644 index 9bd5be0ef..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-console/pom.xml +++ /dev/null @@ -1,196 +0,0 @@ - - - - - 4.0.0 - - - org.apache.activemq - activemq-parent - 5.9.0 - - - activemq-console - ActiveMQ :: Console - ActiveMQ Management Console - - - - org.apache.activemq*;resolution:=optional, - org.springframework*;resolution:=optional, - sun.management*;resolution:=optional, - org.josql*;resolution:=optional, - org.apache.velocity*;resolution:=optional, - org.apache.commons.daemon*;resolution:=optional, - * - - - org.apache.activemq.console*;version=${project.version};-noimport:=true, - - - - - - ${project.groupId} - activemq-kahadb-store - - - ${project.groupId} - activeio-core - - - - - org.apache.geronimo.specs - geronimo-jms_1.1_spec - - - commons-pool - commons-pool - - - org.apache.xbean - xbean-spring - - - org.slf4j - slf4j-api - - - - - org.fusesource.hawtbuf - hawtbuf-proto - ${hawtbuf-version} - - - org.codehaus.jackson - jackson-core-asl - ${jackson-version} - - - org.codehaus.jackson - jackson-mapper-asl - ${jackson-version} - - - ${project.groupId} - activemq-broker - test-jar - test - - - - - org.springframework - spring-context - test - - - org.slf4j - slf4j-log4j12 - test - - - log4j - log4j - test - - - org.apache.derby - derby - test - - - junit - junit - test - - - org.apache.velocity - velocity - - - commons-collections - commons-collections - - - commons-lang - commons-lang - ${commons-lang-version} - - - org.apache.servicemix.bundles - org.apache.servicemix.bundles.josql - - - org.jasypt - jasypt - - - commons-daemon - commons-daemon - - - - - - - - maven-surefire-plugin - - pertest - false - true - - - org.apache.activemq.default.directory.prefix - target/ - - - - - - **/*Test* - - - - - - org.fusesource.hawtbuf - hawtbuf-protoc - ${hawtbuf-version} - - alt - - - - - compile - - - - - - - - - diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-http/pom.properties b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-http/pom.properties deleted file mode 100644 index 0e4a46ef9..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-http/pom.properties +++ /dev/null @@ -1,5 +0,0 @@ -#Generated by Maven -#Mon Oct 14 23:52:46 IST 2013 -version=5.9.0 -groupId=org.apache.activemq -artifactId=activemq-http diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-http/pom.xml b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-http/pom.xml deleted file mode 100644 index 9f027b628..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-http/pom.xml +++ /dev/null @@ -1,189 +0,0 @@ - - - - - 4.0.0 - - - org.apache.activemq - activemq-parent - 5.9.0 - - - activemq-http - jar - ActiveMQ :: HTTP Protocol Support - ActiveMQ HTTP Protocol Support - - - - ${project.groupId} - activemq-spring - - - ${project.groupId} - activemq-stomp - - - ${project.groupId} - activemq-mqtt - - - org.slf4j - slf4j-api - - - org.eclipse.jetty.aggregate - jetty-all-server - - - org.eclipse.jetty - jetty-websocket - ${jetty-version} - - - org.apache.httpcomponents - httpclient - - - com.thoughtworks.xstream - xstream - - - - - - - ${project.groupId} - activemq-unit-tests - test-jar - test - - - ${project.groupId} - activemq-broker - test-jar - test - - - junit - junit - compile - true - - - org.slf4j - slf4j-log4j12 - test - - - org.seleniumhq.selenium - selenium-java - 2.25.0 - test - - - org.seleniumhq.selenium - selenium-chrome-driver - 2.25.0 - test - - - org.seleniumhq.selenium - selenium-firefox-driver - 2.25.0 - test - - - - - - maven-jar-plugin - - - ${project.build.outputDirectory}/META-INF/MANIFEST.MF - - - - - org.apache.felix - maven-bundle-plugin - - - ${project.artifactId} - org.apache.activemq.activemq-core - - org.apache.activemq.transport.http*;version=${project.version};-noimport:=;-split-package:=merge-last, - org.apache.activemq.transport.https*;version=${project.version};-noimport:=;-split-package:=merge-last - - - org.eclipse.jetty*;version="[7.5,8.0)";resolution:=optional, - !org.apache.activemq.transport.ws*;version=${project.version}, - !org.apache.activemq.transport.xstream;version=${project.version}, - !org.apache.activemq.transport.util;version=${project.version}, - org.apache.activemq*;version=${project.version};resolution:=optional - - - - - - bundle-manifest - process-classes - - manifest - - - - - - - maven-surefire-plugin - - always - - - - - - - activemq.tests-quick - - true - - - - - maven-surefire-plugin - - - - **/perf/* - - **/load/* - org/apache/activemq/transport/http/HttpClientReconnectTest.* - org/apache/activemq/transport/http/HttpJmsDurableTopicSendReceiveTest.* - org/apache/activemq/transport/http/HttpPersistentSendAndReceiveTest.* - org/apache/activemq/transport/http/HttpSpringTest.* - - - - - - - - diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-jdbc-store/pom.properties b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-jdbc-store/pom.properties deleted file mode 100644 index b0a8b7ec7..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-jdbc-store/pom.properties +++ /dev/null @@ -1,5 +0,0 @@ -#Generated by Maven -#Mon Oct 14 23:46:48 IST 2013 -version=5.9.0 -groupId=org.apache.activemq -artifactId=activemq-jdbc-store diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-jdbc-store/pom.xml b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-jdbc-store/pom.xml deleted file mode 100644 index 32c268af2..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-jdbc-store/pom.xml +++ /dev/null @@ -1,100 +0,0 @@ - - - - - 4.0.0 - - - org.apache.activemq - activemq-parent - 5.9.0 - - - activemq-jdbc-store - jar - ActiveMQ :: JDBC Store - The ActiveMQ JDBC Store Implementation - - - -Xmx512M - - - - - org.apache.activemq - activemq-broker - - - org.apache.derby - derby - true - - - ${project.groupId} - activeio-core - true - - - - - - - org.codehaus.mojo - findbugs-maven-plugin - ${findbugs-maven-plugin-version} - - Normal - Default - - - - - - - - - maven-surefire-plugin - - always - ${surefire.argLine} - alphabetical - - - org.apache.activemq.default.directory.prefix - target/ - - - - - - **/*Test.* - - - - - - diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-kahadb-store/pom.properties b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-kahadb-store/pom.properties deleted file mode 100644 index 8088c09c6..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-kahadb-store/pom.properties +++ /dev/null @@ -1,5 +0,0 @@ -#Generated by Maven -#Mon Oct 14 23:45:34 IST 2013 -version=5.9.0 -groupId=org.apache.activemq -artifactId=activemq-kahadb-store diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-kahadb-store/pom.xml b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-kahadb-store/pom.xml deleted file mode 100644 index daf3a28a0..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-kahadb-store/pom.xml +++ /dev/null @@ -1,263 +0,0 @@ - - - - - 4.0.0 - - - org.apache.activemq - activemq-parent - 5.9.0 - - - activemq-kahadb-store - jar - ActiveMQ :: KahaDB Store - The ActiveMQ KahaDB Store Implementation - - - - - - - - org.apache.activemq - activemq-broker - - - ${project.groupId} - activeio-core - true - - - org.apache.activemq.protobuf - activemq-protobuf - false - - - - - - - - org.osgi - org.osgi.core - provided - true - - - org.apache.activemq - activemq-jaas - true - - - org.apache.geronimo.specs - geronimo-jta_1.0.1B_spec - true - - - org.apache.geronimo.specs - geronimo-j2ee-management_1.1_spec - - - org.apache.geronimo.specs - geronimo-annotation_1.0_spec - true - - - org.apache.geronimo.specs - geronimo-jacc_1.1_spec - true - - - com.thoughtworks.xstream - xstream - true - - - org.codehaus.jettison - jettison - true - - - - - org.apache.xbean - xbean-spring - true - - - org.springframework - spring-context - - - xalan - xalan - true - - - commons-net - commons-net - - - - - - - ${project.groupId} - activemq-broker - test-jar - test - - - junit - junit - test - - - org.slf4j - slf4j-log4j12 - test - - - log4j - log4j - test - - - - - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - org.apache.activemq.protobuf - activemq-protobuf - [0.0.0,) - - compile - - - - - - - - - - - - - - - maven-surefire-plugin - - always - ${surefire.argLine} - alphabetical - - - - org.apache.activemq.default.directory.prefix - target/ - - - - - - **/*Test.* - - - - - org.apache.activemq.protobuf - activemq-protobuf - - - - compile - - - - - - - - - activemq.tests.aix.excludes - - - os.name - AIX - - - - - - maven-surefire-plugin - - - **/PListImplTest.* - - - - - - - - activemq.tests.solaris.excludes - - - os.name - SunOS - - - - - - maven-surefire-plugin - - - **/PListImplTest.* - **/BTreeIndexTest.* - - - - - - - - diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-leveldb-store/pom.properties b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-leveldb-store/pom.properties deleted file mode 100644 index f8f4882b9..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-leveldb-store/pom.properties +++ /dev/null @@ -1,5 +0,0 @@ -#Generated by Maven -#Mon Oct 14 23:47:49 IST 2013 -version=5.9.0 -groupId=org.apache.activemq -artifactId=activemq-leveldb-store diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-leveldb-store/pom.xml b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-leveldb-store/pom.xml deleted file mode 100644 index 8cb06b2b3..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-leveldb-store/pom.xml +++ /dev/null @@ -1,437 +0,0 @@ - - - - - 4.0.0 - - - org.apache.activemq - activemq-parent - 5.9.0 - - - activemq-leveldb-store - jar - - ActiveMQ :: LevelDB Store - ActiveMQ LevelDB Store Implementation - - - - - - org.scala-lang - scala-library - ${scala-version} - compile - - - - org.apache.activemq - activemq-broker - provided - - - - org.slf4j - slf4j-api - compile - - - org.fusesource.hawtbuf - hawtbuf-proto - ${hawtbuf-version} - - - org.fusesource.hawtdispatch - hawtdispatch-scala - ${hawtdispatch-version} - - - org.iq80.leveldb - leveldb-api - ${leveldb-version} - - - org.iq80.leveldb - leveldb - ${leveldb-version} - - - org.fusesource.leveldbjni - leveldbjni - ${leveldbjni-version} - - - - - - - - org.fusesource.hawtdispatch - hawtdispatch-transport - ${hawtdispatch-version} - provided - - - - org.linkedin - org.linkedin.zookeeper-impl - ${linkedin-zookeeper-version} - provided - - - org.linkedin - org.linkedin.util-core - ${linkedin-zookeeper-version} - provided - - - org.apache.zookeeper - zookeeper - ${zookeeper-version} - provided - - - - org.osgi - org.osgi.core - ${org.osgi.core-version} - provided - - - org.osgi - org.osgi.compendium - ${org.osgi.core-version} - provided - - - - - org.xerial.snappy - snappy-java - ${snappy-version} - - - org.iq80.snappy - snappy - 0.2 - - - org.codehaus.jackson - jackson-core-asl - ${jackson-version} - - - org.codehaus.jackson - jackson-mapper-asl - ${jackson-version} - - - org.apache.hadoop - hadoop-core - ${hadoop-version} - - - - commons-cli - commons-cli - - - xmlenc - xmlenc - - - commons-codec - commons-codec - - - org.apache.commons - commons-math - - - commons-net - commons-net - - - commons-httpclient - commons-httpclient - - - tomcat - jasper-runtime - - - tomcat - jasper-compiler - - - commons-el - commons-el - - - net.java.dev.jets3t - jets3t - - - net.sf.kosmosfs - kfs - - - hsqldb - hsqldb - - - oro - oro - - - org.eclipse.jdt - core - - - - - - - org.slf4j - slf4j-log4j12 - test - - - log4j - log4j - test - - - org.apache.activemq - activemq-broker - test-jar - test - - - org.apache.activemq - activemq-kahadb-store - test - - - - - org.apache.hadoop - hadoop-test - ${hadoop-version} - test - - - commons-lang - commons-lang - 2.6 - test - - - org.mortbay.jetty - jetty - 6.1.26 - test - - - org.mortbay.jetty - jetty-util - 6.1.26 - test - - - tomcat - jasper-runtime - 5.5.12 - test - - - tomcat - jasper-compiler - 5.5.12 - test - - - org.mortbay.jetty - jsp-api-2.1 - 6.1.14 - test - - - org.mortbay.jetty - jsp-2.1 - 6.1.14 - test - - - org.apache.commons - commons-math - 2.2 - test - - - org.scalatest - scalatest_${scala-version} - ${scalatest-version} - test - - - junit - junit - test - - - - - - - net.alchim31.maven - scala-maven-plugin - ${scala-plugin-version} - - - compile - - compile - - compile - - - test-compile - - testCompile - - test-compile - - - process-resources - - compile - - - - - - -Xmx1024m - -Xss8m - - ${scala-version} - - -deprecation - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - false - - false - true - false - - **/EnqueueRateScenariosTest.* - **/DFSLevelDB*.* - - - - - org.fusesource.hawtbuf - hawtbuf-protoc - ${hawtbuf-version} - - alt - - - - - compile - - - - - - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - org.fusesource.hawtbuf - hawtbuf-protoc - [${hawtbuf-version},) - - compile - - - - - - - - - - - - - - - diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-mqtt/pom.properties b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-mqtt/pom.properties deleted file mode 100644 index dfa3f3959..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-mqtt/pom.properties +++ /dev/null @@ -1,5 +0,0 @@ -#Generated by Maven -#Mon Oct 14 23:46:26 IST 2013 -version=5.9.0 -groupId=org.apache.activemq -artifactId=activemq-mqtt diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-mqtt/pom.xml b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-mqtt/pom.xml deleted file mode 100644 index 214a3638d..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-mqtt/pom.xml +++ /dev/null @@ -1,245 +0,0 @@ - - - - - 4.0.0 - - - org.apache.activemq - activemq-parent - 5.9.0 - - - activemq-mqtt - jar - ActiveMQ :: MQTT Protocol - The ActiveMQ MQTT Protocol Implementation - - - - - - - - org.apache.activemq - activemq-broker - - - - ${project.groupId} - activeio-core - true - - - org.apache.activemq.protobuf - activemq-protobuf - false - - - org.fusesource.mqtt-client - mqtt-client - - - org.fusesource.hawtdispatch - hawtdispatch-transport - ${hawtdispatch-version} - - - - - - - - org.osgi - org.osgi.core - provided - true - - - org.apache.activemq - activemq-jaas - true - - - org.apache.geronimo.specs - geronimo-jta_1.0.1B_spec - true - - - org.apache.geronimo.specs - geronimo-j2ee-management_1.1_spec - - - org.apache.geronimo.specs - geronimo-annotation_1.0_spec - true - - - org.apache.geronimo.specs - geronimo-jacc_1.1_spec - true - - - com.thoughtworks.xstream - xstream - true - - - org.codehaus.jettison - jettison - true - - - - - org.apache.xbean - xbean-spring - true - - - org.springframework - spring-context - - - xalan - xalan - true - - - commons-net - commons-net - - - - - - - ${project.groupId} - activemq-broker - test-jar - test - - - - junit - junit - test - - - org.slf4j - slf4j-log4j12 - test - - - log4j - log4j - test - - - - - - - ${project.basedir}/src/main/resources - - **/* - - - - ${project.basedir}/src/main/filtered-resources - true - - **/* - - - - - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - org.apache.activemq.protobuf - activemq-protobuf - [0.0.0,) - - compile - - - - - - - - - - - - - - - maven-surefire-plugin - - always - ${surefire.argLine} - alphabetical - - - - - org.apache.activemq.default.directory.prefix - target/ - - - - - - **/*Test.* - - - - - org.apache.activemq.protobuf - activemq-protobuf - - - - compile - - - - - - - - diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-openwire-legacy/pom.properties b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-openwire-legacy/pom.properties deleted file mode 100644 index cb8de3940..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-openwire-legacy/pom.properties +++ /dev/null @@ -1,5 +0,0 @@ -#Generated by Maven -#Mon Oct 14 23:43:50 IST 2013 -version=5.9.0 -groupId=org.apache.activemq -artifactId=activemq-openwire-legacy diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-openwire-legacy/pom.xml b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-openwire-legacy/pom.xml deleted file mode 100644 index bc2e41ee3..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-openwire-legacy/pom.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - 4.0.0 - - - org.apache.activemq - activemq-parent - 5.9.0 - - - activemq-openwire-legacy - jar - ActiveMQ :: Openwire Legacy Support - The ActiveMQ Openwire Legacy Support Module - - - - org.apache.activemq - activemq-client - - - - diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-spring/pom.properties b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-spring/pom.properties deleted file mode 100644 index 38d098cd4..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-spring/pom.properties +++ /dev/null @@ -1,5 +0,0 @@ -#Generated by Maven -#Mon Oct 14 23:49:44 IST 2013 -version=5.9.0 -groupId=org.apache.activemq -artifactId=activemq-spring diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-spring/pom.xml b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-spring/pom.xml deleted file mode 100644 index 2625be88e..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-spring/pom.xml +++ /dev/null @@ -1,297 +0,0 @@ - - - - - 4.0.0 - - - org.apache.activemq - activemq-parent - 5.9.0 - - - activemq-spring - ActiveMQ :: Spring - ActiveMQ Spring Integration - - - - javax.transaction*;resolution:=optional, - org.apache.geronimo.transaction.manager*;resolution:=optional, - org.springframework*;resolution:=optional - - - - - - - - - - org.slf4j - slf4j-api - - - org.apache.xbean - xbean-spring - - - org.apache.activemq - activemq-broker - - - org.apache.activemq - activemq-jdbc-store - true - - - org.apache.activemq - activemq-kahadb-store - true - - - ${project.groupId} - activeio-core - true - - - org.apache.activemq - activemq-leveldb-store - true - - - - - org.fusesource.hawtdispatch - hawtdispatch-transport - ${hawtdispatch-version} - provided - - - org.fusesource.fabric - fabric-groups - 7.2.0.redhat-024 - provided - - - org.fusesource.fabric - fabric-linkedin-zookeeper - 7.2.0.redhat-024 - provided - - - org.fusesource.fabric - fabric-zookeeper - 7.2.0.redhat-024 - provided - - - org.osgi - org.osgi.core - ${org.osgi.core-version} - provided - true - - - org.osgi - org.osgi.compendium - ${org.osgi.core-version} - provided - - - - - org.apache.activemq - activemq-mqtt - true - - - org.apache.activemq - activemq-stomp - true - - - ${project.groupId} - activemq-pool - - - org.apache.geronimo.components - geronimo-transaction - true - - - org.apache.geronimo.specs - geronimo-jta_1.0.1B_spec - - - org.apache.geronimo.specs - geronimo-annotation_1.0_spec - true - - - commons-pool - commons-pool - - - org.springframework - spring-beans - - - org.springframework - spring-test - test - - - ${project.groupId} - activemq-broker - test-jar - test - - - junit - junit - test - - - org.springframework - spring-jms - test - - - log4j - log4j - test - - - org.jencks - jencks - 2.2 - test - - - org.slf4j - slf4j-log4j12 - test - - - ${project.groupId} - activemq-ra - test - - - org.springframework.osgi - spring-osgi-core - provided - true - - - org.springframework - org.springframework.context - - - org.springframework - org.springframework.beans - - - org.springframework - org.springframework.aop - - - org.springframework - org.springframework.core - - - - - - - - - org.apache.xbean - maven-xbean-plugin - 3.12 - - - process-classes - - - ${basedir}/../activemq-client/src/main/java - ${basedir}/../activemq-broker/src/main/java - ${basedir}/../activemq-leveldb-store/src/main/java - ${basedir}/../activemq-jdbc-store/src/main/java - ${basedir}/../activemq-kahadb-store/src/main/java - ${basedir}/../activemq-mqtt/src/main/java - ${basedir}/../activemq-stomp/src/main/java - ${basedir}/../activemq-partition/src/main/java - ${basedir}/../activemq-runtime-config/src/main/java - - false - http://activemq.apache.org/schema/core - ${basedir}/target/classes/activemq.xsd - ${basedir}/target/classes - false - org.apache.activemq.broker.jmx.AnnotatedMBean,org.apache.activemq.broker.jmx.DestinationViewMBean - - - mapping - - - - - - com.thoughtworks.qdox - qdox - 1.12 - - - - - org.apache.maven.plugins - maven-antrun-plugin - - - site - site - - - Running the XSDDoc task - - - - - - - - run - - - - - - xsddoc - maven-xsddoc-plugin - 1.0 - - - - - - - diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-stomp/pom.properties b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-stomp/pom.properties deleted file mode 100644 index cd6fd64ad..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-stomp/pom.properties +++ /dev/null @@ -1,5 +0,0 @@ -#Generated by Maven -#Mon Oct 14 23:46:02 IST 2013 -version=5.9.0 -groupId=org.apache.activemq -artifactId=activemq-stomp diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-stomp/pom.xml b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-stomp/pom.xml deleted file mode 100644 index cb6e7da98..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.activemq/activemq-stomp/pom.xml +++ /dev/null @@ -1,143 +0,0 @@ - - - - - 4.0.0 - - - org.apache.activemq - activemq-parent - 5.9.0 - - - activemq-stomp - jar - ActiveMQ :: STOMP Protocol - The ActiveMQ STOMP Protocol Implementation - - - - - - - - ${project.groupId} - activemq-broker - - - - - - - com.thoughtworks.xstream - xstream - true - - - org.codehaus.jettison - jettison - true - - - - - - - - ${project.groupId} - activemq-kahadb-store - test - - - ${project.groupId} - activemq-broker - test-jar - test - - - ${project.groupId} - activemq-jaas - test - - - junit - junit - test - - - org.slf4j - slf4j-log4j12 - test - - - log4j - log4j - test - - - - - - - ${project.basedir}/src/main/resources - - **/* - - - - ${project.basedir}/src/main/filtered-resources - true - - **/* - - - - - - - maven-surefire-plugin - - always - ${surefire.argLine} - alphabetical - false - - - org.apache.activemq.default.directory.prefix - target/ - - - - - - **/*Test.* - - - - - - diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.geronimo.specs/geronimo-annotation_1.0_spec/pom.properties b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.geronimo.specs/geronimo-annotation_1.0_spec/pom.properties deleted file mode 100644 index b1fc57320..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.geronimo.specs/geronimo-annotation_1.0_spec/pom.properties +++ /dev/null @@ -1,5 +0,0 @@ -#Generated by Maven -#Fri Feb 01 10:26:50 CET 2008 -version=1.1.1 -groupId=org.apache.geronimo.specs -artifactId=geronimo-annotation_1.0_spec diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.geronimo.specs/geronimo-annotation_1.0_spec/pom.xml b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.geronimo.specs/geronimo-annotation_1.0_spec/pom.xml deleted file mode 100644 index 9d8fc9d09..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.geronimo.specs/geronimo-annotation_1.0_spec/pom.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - 4.0.0 - - - org.apache.geronimo.specs - specs - 1.4 - ../pom.xml - - - geronimo-annotation_1.0_spec - jar - Annotation 1.0 - 1.1.1 - - - javax.annotation* - 1.0 - - - - scm:svn:https://svn.apache.org/repos/asf/geronimo/specs/tags/geronimo-annotation_1.0_spec-1.1.1 - scm:svn:https://svn.apache.org/repos/asf/geronimo/specs/tags/geronimo-annotation_1.0_spec-1.1.1 - scm:svn:https://svn.apache.org/repos/asf/geronimo/specs/tags/geronimo-annotation_1.0_spec-1.1.1 - - - diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.geronimo.specs/geronimo-j2ee-management_1.1_spec/pom.properties b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.geronimo.specs/geronimo-j2ee-management_1.1_spec/pom.properties deleted file mode 100644 index 3de46328a..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.geronimo.specs/geronimo-j2ee-management_1.1_spec/pom.properties +++ /dev/null @@ -1,5 +0,0 @@ -#Generated by Maven -#Fri Feb 01 11:42:20 CET 2008 -version=1.0.1 -groupId=org.apache.geronimo.specs -artifactId=geronimo-j2ee-management_1.1_spec diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.geronimo.specs/geronimo-j2ee-management_1.1_spec/pom.xml b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.geronimo.specs/geronimo-j2ee-management_1.1_spec/pom.xml deleted file mode 100644 index 85eb7498b..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.geronimo.specs/geronimo-j2ee-management_1.1_spec/pom.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - 4.0.0 - - - org.apache.geronimo.specs - specs - 1.4 - ../pom.xml - - - geronimo-j2ee-management_1.1_spec - jar - J2EE Management 1.1 - 1.0.1 - - - javax.management.j2ee* - 1.1 - javax.ejb*;resolution:=optional,* - - - - - org.apache.geronimo.specs - geronimo-ejb_3.0_spec - 1.0.1 - provided - - - - - scm:svn:https://svn.apache.org/repos/asf/geronimo/specs/tags/geronimo-j2ee-management_1.1_spec-1.0.1 - scm:svn:https://svn.apache.org/repos/asf/geronimo/specs/tags/geronimo-j2ee-management_1.1_spec-1.0.1 - scm:svn:https://svn.apache.org/repos/asf/geronimo/specs/tags/geronimo-j2ee-management_1.1_spec-1.0.1 - - - diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.geronimo.specs/geronimo-jms_1.1_spec/pom.properties b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.geronimo.specs/geronimo-jms_1.1_spec/pom.properties deleted file mode 100644 index 2795622c2..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.geronimo.specs/geronimo-jms_1.1_spec/pom.properties +++ /dev/null @@ -1,5 +0,0 @@ -#Generated by Maven -#Fri Feb 01 11:35:25 CET 2008 -version=1.1.1 -groupId=org.apache.geronimo.specs -artifactId=geronimo-jms_1.1_spec diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.geronimo.specs/geronimo-jms_1.1_spec/pom.xml b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.geronimo.specs/geronimo-jms_1.1_spec/pom.xml deleted file mode 100644 index be3219cc7..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.geronimo.specs/geronimo-jms_1.1_spec/pom.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - 4.0.0 - - - org.apache.geronimo.specs - specs - 1.4 - ../pom.xml - - - geronimo-jms_1.1_spec - jar - JMS 1.1 - 1.1.1 - - - javax.jms* - 1.1 - - - - - mockobjects - mockobjects-core - 0.09 - test - - - - mockobjects - mockobjects-jdk1.4-j2ee1.3 - 0.09 - test - - - - - scm:svn:https://svn.apache.org/repos/asf/geronimo/specs/tags/geronimo-jms_1.1_spec-1.1.1 - scm:svn:https://svn.apache.org/repos/asf/geronimo/specs/tags/geronimo-jms_1.1_spec-1.1.1 - scm:svn:https://svn.apache.org/repos/asf/geronimo/specs/tags/geronimo-jms_1.1_spec-1.1.1 - - - diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.geronimo.specs/geronimo-jta_1.0.1B_spec/pom.properties b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.geronimo.specs/geronimo-jta_1.0.1B_spec/pom.properties deleted file mode 100644 index 26fdb6de3..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.geronimo.specs/geronimo-jta_1.0.1B_spec/pom.properties +++ /dev/null @@ -1,5 +0,0 @@ -#Generated by Maven -#Mon Jun 19 11:04:52 EDT 2006 -version=1.0.1 -groupId=org.apache.geronimo.specs -artifactId=geronimo-jta_1.0.1B_spec diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.geronimo.specs/geronimo-jta_1.0.1B_spec/pom.xml b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.geronimo.specs/geronimo-jta_1.0.1B_spec/pom.xml deleted file mode 100644 index 3cbdb8e9d..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.apache.geronimo.specs/geronimo-jta_1.0.1B_spec/pom.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - specs - org.apache.geronimo.specs - 1.1 - - 4.0.0 - geronimo-jta_1.0.1B_spec - JTA - ${geronimoSpecsJtaVersion} - - - scm:svn:http://svn.apache.org/repos/asf/geronimo/specs/trunk/geronimo-spec-jta/ - scm:svn:http://svn.apache.org/repos/asf/geronimo/specs/trunk/geronimo-spec-jta/ - http://svn.apache.org/viewcvs.cgi/geronimo/specs/trunk/geronimo-spec-jta/ - - - diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.fusesource.hawtbuf/hawtbuf/pom.properties b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.fusesource.hawtbuf/hawtbuf/pom.properties deleted file mode 100644 index fa6d06c59..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.fusesource.hawtbuf/hawtbuf/pom.properties +++ /dev/null @@ -1,5 +0,0 @@ -#Generated by org.apache.felix.bundleplugin -#Mon Feb 27 12:12:00 EST 2012 -version=1.9 -groupId=org.fusesource.hawtbuf -artifactId=hawtbuf diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.fusesource.hawtbuf/hawtbuf/pom.xml b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.fusesource.hawtbuf/hawtbuf/pom.xml deleted file mode 100644 index 915de40ae..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.fusesource.hawtbuf/hawtbuf/pom.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - - 4.0.0 - - - org.fusesource.hawtbuf - hawtbuf-project - 1.9 - - - org.fusesource.hawtbuf - hawtbuf - 1.9 - bundle - - ${project.artifactId} - - - * - - - - - - commons-logging - commons-logging - ${commons-logging-version} - true - - - - - junit - junit - ${junit-version} - test - - - log4j - log4j - test - ${log4j-version} - - - - - - - - - - maven-jar-plugin - - - - test-jar - - - - - - - - - diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.jasypt/jasypt/pom.properties b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.jasypt/jasypt/pom.properties deleted file mode 100644 index 093316430..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.jasypt/jasypt/pom.properties +++ /dev/null @@ -1,5 +0,0 @@ -#Generated by Maven -#Thu Aug 22 01:51:47 CEST 2013 -version=1.9.1 -groupId=org.jasypt -artifactId=jasypt diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.jasypt/jasypt/pom.xml b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.jasypt/jasypt/pom.xml deleted file mode 100644 index dbb762b36..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.jasypt/jasypt/pom.xml +++ /dev/null @@ -1,270 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - 4.0.0 - org.jasypt - jasypt - jar - 1.9.1 - JASYPT: Java Simplified Encryption - http://www.jasypt.org - - Java library which enables encryption in java apps with minimum effort. - - - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - The JASYPT team - http://www.jasypt.org - - - - scm:svn:http://svn.code.sf.net/p/jasypt/code/tags/jasypt/jasypt-1.9.1 - scm:svn:https://svn.code.sf.net/p/jasypt/code/tags/jasypt/jasypt-1.9.1 - scm:svn:https://svn.code.sf.net/p/jasypt/code/tags/jasypt/jasypt-1.9.1 - - - - - dfernandez - Daniel Fernandez - dfernandez AT users.sourceforge.net - - Project admin - - - - - - - sonatype-nexus-snapshots - Sonatype Nexus Snapshots - https://oss.sonatype.org/content/repositories/snapshots - - - sonatype-nexus-snapshots - Sonatype Nexus Snapshots - https://oss.sonatype.org/service/local/staging/deploy/maven2 - - - - - - sonatype-nexus-snapshots - Sonatype Nexus Snapshots - https://oss.sonatype.org/content/repositories/snapshots - - true - - - - - - - - - - - src/main/resources - - - - . - META-INF - - LICENSE.txt - NOTICE.txt - - - - - - - - src/test/resources - - - - - - - org.apache.maven.plugins - maven-site-plugin - 2.1 - - - - org.apache.maven.plugins - maven-compiler-plugin - 2.3.2 - - 1.4 - 1.4 - US-ASCII - - - - - org.apache.maven.plugins - maven-resources-plugin - 2.5 - - US-ASCII - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.7 - - protected - java.lang - org.jasypt.contrib.* - - - - package - - jar - - - - - - - org.apache.maven.plugins - maven-source-plugin - 2.1.2 - - - package - - jar - - - - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.1 - - - sign-artifacts - verify - - sign - - - - - - - org.apache.maven.plugins - maven-assembly-plugin - 2.2 - - - src/assembly/lite.xml - - - - - make-assembly-deps - package - - single - - - - - - - org.apache.maven.plugins - maven-release-plugin - 2.1 - - https://svn.code.sf.net/p/jasypt/code/tags/jasypt - - - - - - - - - - - - - - com.ibm.icu - icu4j - 3.4.4 - provided - true - - - - javax.servlet - servlet-api - 2.4 - provided - true - - - - org.bouncycastle - bcprov-jdk12 - 130 - test - - - - junit - junit - 3.8.1 - test - - - - commons-lang - commons-lang - 2.1 - test - - - - - - - diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.slf4j/slf4j-api/pom.properties b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.slf4j/slf4j-api/pom.properties deleted file mode 100644 index 843f637cc..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.slf4j/slf4j-api/pom.properties +++ /dev/null @@ -1,5 +0,0 @@ -#Generated by Maven -#Mon Mar 25 21:49:23 CET 2013 -version=1.7.5 -groupId=org.slf4j -artifactId=slf4j-api diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.slf4j/slf4j-api/pom.xml b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.slf4j/slf4j-api/pom.xml deleted file mode 100644 index 3ea5231af..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.slf4j/slf4j-api/pom.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - - org.slf4j - slf4j-parent - 1.7.5 - - - 4.0.0 - - org.slf4j - slf4j-api - jar - SLF4J API Module - The slf4j API - - http://www.slf4j.org - - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - once - plain - false - - **/AllTest.java - **/PackageTest.java - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - ${parsedVersion.osgiVersion} - ${project.description} - ${project.version} - - ${project.build.outputDirectory}/META-INF/MANIFEST.MF - - - - - bundle-test-jar - package - - jar - test-jar - - - - - - - org.apache.maven.plugins - maven-antrun-plugin - - - process-classes - - run - - - - - - Removing slf4j-api's dummy StaticLoggerBinder and StaticMarkerBinder - - - - - - - - - - \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.slf4j/slf4j-log4j12/pom.properties b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.slf4j/slf4j-log4j12/pom.properties deleted file mode 100644 index 4caa0dc9b..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.slf4j/slf4j-log4j12/pom.properties +++ /dev/null @@ -1,5 +0,0 @@ -#Generated by Maven -#Mon Mar 25 21:49:28 CET 2013 -version=1.7.5 -groupId=org.slf4j -artifactId=slf4j-log4j12 diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.slf4j/slf4j-log4j12/pom.xml b/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.slf4j/slf4j-log4j12/pom.xml deleted file mode 100644 index 70d6d3e53..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/org.slf4j/slf4j-log4j12/pom.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - org.slf4j - slf4j-parent - 1.7.5 - - - 4.0.0 - - org.slf4j - slf4j-log4j12 - jar - SLF4J LOG4J-12 Binding - SLF4J LOG4J-12 Binding - http://www.slf4j.org - - - - - org.slf4j - slf4j-api - - - - log4j - log4j - - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - ${parsedVersion.osgiVersion} - ${project.description} - ${project.version} - - ${project.build.outputDirectory}/META-INF/MANIFEST.MF - - - - - - - \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/maven/plugin.xml b/uk.ac.diamond.org.apache.activemq/META-INF/maven/plugin.xml deleted file mode 100644 index 1378ac83a..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/maven/plugin.xml +++ /dev/null @@ -1,133 +0,0 @@ - - - ActiveMQ Protocol Buffers Implementation and Compiler - A Simpler Protocol Buffer Java API. Includes a Proto to Java compiler. - org.apache.activemq.protobuf - activemq-protobuf - 1.1 - activemq-protobuf - false - true - - - compile - A Maven Mojo so that the Proto compiler can be used with maven. - false - true - false - false - false - true - process-sources - org.apache.activemq.protobuf.compiler.ProtoMojo - java - per-lookup - once-per-session - - - outputDirectory - java.io.File - false - true - The directory where the output files will be located. - - - project - org.apache.maven.project.MavenProject - true - false - The maven project. - - - sourceDirectory - java.io.File - false - true - The directory where the proto files (<code>*.proto</code>) are -located. - - - type - java.lang.String - false - true - The type of generator to run. - - - - ${outputDirectory} - - ${sourceDirectory} - ${project} - - - - - - org.apache.maven - maven-plugin-api - jar - 2.0 - - - org.apache.maven - maven-project - jar - 2.0 - - - org.apache.maven - maven-profile - jar - 2.0 - - - org.apache.maven - maven-model - jar - 2.0 - - - org.codehaus.plexus - plexus-utils - jar - 1.0.4 - - - org.codehaus.plexus - plexus-container-default - jar - 1.0-alpha-8 - - - classworlds - classworlds - jar - 1.1-alpha-2 - - - org.apache.maven - maven-artifact-manager - jar - 2.0 - - - org.apache.maven - maven-repository-metadata - jar - 2.0 - - - org.apache.maven - maven-artifact - jar - 2.0 - - - org.apache.maven.wagon - wagon-provider-api - jar - 1.0-alpha-5 - - - \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org.apache.activemq.console.command.Command b/uk.ac.diamond.org.apache.activemq/META-INF/services/org.apache.activemq.console.command.Command deleted file mode 100644 index 64749c646..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org.apache.activemq.console.command.Command +++ /dev/null @@ -1,28 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -org.apache.activemq.console.command.CreateCommand -org.apache.activemq.console.command.StartCommand -org.apache.activemq.console.command.ShutdownCommand -org.apache.activemq.console.command.ListCommand -org.apache.activemq.console.command.AmqBrowseCommand -org.apache.activemq.console.command.QueryCommand -org.apache.activemq.console.command.BstatCommand -org.apache.activemq.console.command.DstatCommand -org.apache.activemq.console.command.EncryptCommand -org.apache.activemq.console.command.DecryptCommand -org.apache.activemq.console.command.StoreExportCommand -org.apache.activemq.console.command.PurgeCommand diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/broker/broker b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/broker/broker deleted file mode 100644 index 47b64ca68..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/broker/broker +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.broker.DefaultBrokerFactory diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/broker/properties b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/broker/properties deleted file mode 100644 index 6b7516bae..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/broker/properties +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.broker.PropertiesBrokerFactory diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/broker/xbean b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/broker/xbean deleted file mode 100644 index baa4b1ebc..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/broker/xbean +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.xbean.XBeanBrokerFactory \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/groups/bucket b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/groups/bucket deleted file mode 100644 index 5d8d791e3..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/groups/bucket +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.broker.region.group.MessageGroupHashBucketFactory diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/groups/cached b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/groups/cached deleted file mode 100644 index 92372736f..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/groups/cached +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.broker.region.group.CachedMessageGroupMapFactory diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/groups/simple b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/groups/simple deleted file mode 100644 index 30591d7cd..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/groups/simple +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.broker.region.group.SimpleMessageGroupMapFactory diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/apache_derby_embedded_jdbc_driver b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/apache_derby_embedded_jdbc_driver deleted file mode 100644 index 59008c8d9..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/apache_derby_embedded_jdbc_driver +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.store.jdbc.adapter.DB2JDBCAdapter diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/axion_jdbc_driver b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/axion_jdbc_driver deleted file mode 100644 index ebd44ae98..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/axion_jdbc_driver +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.store.jdbc.adapter.AxionJDBCAdapter \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/hsql_database_engine_driver b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/hsql_database_engine_driver deleted file mode 100644 index 5d84ff8a5..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/hsql_database_engine_driver +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.store.jdbc.adapter.HsqldbJDBCAdapter \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/i-net_sprinta_2000 b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/i-net_sprinta_2000 deleted file mode 100644 index 18ae53d2a..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/i-net_sprinta_2000 +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.store.jdbc.adapter.TransactJDBCAdapter \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/ibm_db2_jdbc_universal_driver_architecture b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/ibm_db2_jdbc_universal_driver_architecture deleted file mode 100644 index 7c3b0d6e4..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/ibm_db2_jdbc_universal_driver_architecture +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.store.jdbc.adapter.DB2JDBCAdapter \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/ibm_informix_jdbc_driver_for_ibm_informix_dynamic_server b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/ibm_informix_jdbc_driver_for_ibm_informix_dynamic_server deleted file mode 100644 index 14f612a8d..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/ibm_informix_jdbc_driver_for_ibm_informix_dynamic_server +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.store.jdbc.adapter.InformixJDBCAdapter \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/jconnect__tm__for_jdbc__tm_ b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/jconnect__tm__for_jdbc__tm_ deleted file mode 100644 index 72a2f4538..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/jconnect__tm__for_jdbc__tm_ +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.store.jdbc.adapter.SybaseJDBCAdapter \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/jtds_type_4_jdbc_driver_for_ms_sql_server_and_sybase b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/jtds_type_4_jdbc_driver_for_ms_sql_server_and_sybase deleted file mode 100644 index 18ae53d2a..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/jtds_type_4_jdbc_driver_for_ms_sql_server_and_sybase +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.store.jdbc.adapter.TransactJDBCAdapter \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/lock/microsoft_jdbc_driver_4_0_for_sql_server b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/lock/microsoft_jdbc_driver_4_0_for_sql_server deleted file mode 100644 index 8eb77e58f..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/lock/microsoft_jdbc_driver_4_0_for_sql_server +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.store.jdbc.adapter.TransactDatabaseLocker \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/lock/microsoft_sql_server_2005_jdbc_driver b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/lock/microsoft_sql_server_2005_jdbc_driver deleted file mode 100644 index 8eb77e58f..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/lock/microsoft_sql_server_2005_jdbc_driver +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.store.jdbc.adapter.TransactDatabaseLocker \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/lock/microsoft_sql_server_jdbc_driver_2_0 b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/lock/microsoft_sql_server_jdbc_driver_2_0 deleted file mode 100644 index 8eb77e58f..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/lock/microsoft_sql_server_jdbc_driver_2_0 +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.store.jdbc.adapter.TransactDatabaseLocker \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/lock/microsoft_sql_server_jdbc_driver_3_0 b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/lock/microsoft_sql_server_jdbc_driver_3_0 deleted file mode 100644 index 8eb77e58f..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/lock/microsoft_sql_server_jdbc_driver_3_0 +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.store.jdbc.adapter.TransactDatabaseLocker \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/microsoft_jdbc_driver_4_0_for_sql_server b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/microsoft_jdbc_driver_4_0_for_sql_server deleted file mode 100644 index 18ae53d2a..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/microsoft_jdbc_driver_4_0_for_sql_server +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.store.jdbc.adapter.TransactJDBCAdapter \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/microsoft_sql_server_2005_jdbc_driver b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/microsoft_sql_server_2005_jdbc_driver deleted file mode 100644 index 18ae53d2a..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/microsoft_sql_server_2005_jdbc_driver +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.store.jdbc.adapter.TransactJDBCAdapter \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/microsoft_sql_server_jdbc_driver_2_0 b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/microsoft_sql_server_jdbc_driver_2_0 deleted file mode 100644 index 18ae53d2a..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/microsoft_sql_server_jdbc_driver_2_0 +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.store.jdbc.adapter.TransactJDBCAdapter \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/microsoft_sql_server_jdbc_driver_3_0 b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/microsoft_sql_server_jdbc_driver_3_0 deleted file mode 100644 index 18ae53d2a..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/microsoft_sql_server_jdbc_driver_3_0 +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.store.jdbc.adapter.TransactJDBCAdapter \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/mysql-ab_jdbc_driver b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/mysql-ab_jdbc_driver deleted file mode 100644 index 54ddcb454..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/mysql-ab_jdbc_driver +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.store.jdbc.adapter.MySqlJDBCAdapter \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/mysql_connector_java b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/mysql_connector_java deleted file mode 100644 index f61c7feaa..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/mysql_connector_java +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.store.jdbc.adapter.MySqlJDBCAdapter \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/oracle_jdbc_driver b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/oracle_jdbc_driver deleted file mode 100644 index 0ab67f69d..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/oracle_jdbc_driver +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.store.jdbc.adapter.OracleJDBCAdapter \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/postgresql_native_driver b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/postgresql_native_driver deleted file mode 100644 index d9b4438bd..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/postgresql_native_driver +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.store.jdbc.adapter.PostgresqlJDBCAdapter \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/sap_db b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/sap_db deleted file mode 100644 index 120a4ac4e..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/sap_db +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.store.jdbc.adapter.MaxDBJDBCAdapter \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/sqlserver b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/sqlserver deleted file mode 100644 index 18ae53d2a..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/store/jdbc/sqlserver +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.store.jdbc.adapter.TransactJDBCAdapter \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/amqp b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/amqp deleted file mode 100644 index 9e09d1896..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/amqp +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.amqp.AmqpTransportFactory diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/amqp+nio b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/amqp+nio deleted file mode 100644 index 40bf30f95..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/amqp+nio +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.amqp.AmqpNioTransportFactory diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/amqp+nio+ssl b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/amqp+nio+ssl deleted file mode 100644 index 25af0bd66..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/amqp+nio+ssl +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.amqp.AmqpNioSslTransportFactory \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/amqp+ssl b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/amqp+ssl deleted file mode 100644 index 9c47006d1..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/amqp+ssl +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.amqp.AMQPSslTransportFactory diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/discovery b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/discovery deleted file mode 100644 index 929c93875..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/discovery +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.discovery.DiscoveryTransportFactory diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/discoveryagent/http b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/discoveryagent/http deleted file mode 100644 index 6c6ff93e5..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/discoveryagent/http +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.discovery.http.HTTPDiscoveryAgentFactory diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/discoveryagent/masterslave b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/discoveryagent/masterslave deleted file mode 100644 index c05b94ae1..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/discoveryagent/masterslave +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.discovery.masterslave.MasterSlaveDiscoveryAgentFactory diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/discoveryagent/multicast b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/discoveryagent/multicast deleted file mode 100644 index 966830fe0..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/discoveryagent/multicast +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.discovery.multicast.MulticastDiscoveryAgentFactory diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/discoveryagent/simple b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/discoveryagent/simple deleted file mode 100644 index 9436f0488..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/discoveryagent/simple +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.discovery.simple.SimpleDiscoveryAgentFactory diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/discoveryagent/static b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/discoveryagent/static deleted file mode 100644 index 9436f0488..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/discoveryagent/static +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.discovery.simple.SimpleDiscoveryAgentFactory diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/discoveryagent/zeroconf b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/discoveryagent/zeroconf deleted file mode 100644 index b520b30e7..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/discoveryagent/zeroconf +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.discovery.zeroconf.ZeroconfDiscoveryAgentFactory diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/failover b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/failover deleted file mode 100644 index 81c2151a8..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/failover +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.failover.FailoverTransportFactory diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/fanout b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/fanout deleted file mode 100644 index 62d5dd622..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/fanout +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.fanout.FanoutTransportFactory diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/frametranslator/jms-advisory-json b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/frametranslator/jms-advisory-json deleted file mode 100644 index e7fb9adbe..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/frametranslator/jms-advisory-json +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.stomp.JmsFrameTranslator \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/frametranslator/jms-advisory-xml b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/frametranslator/jms-advisory-xml deleted file mode 100644 index e7fb9adbe..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/frametranslator/jms-advisory-xml +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.stomp.JmsFrameTranslator \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/frametranslator/jms-byte b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/frametranslator/jms-byte deleted file mode 100644 index e7fb9adbe..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/frametranslator/jms-byte +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.stomp.JmsFrameTranslator \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/frametranslator/jms-json b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/frametranslator/jms-json deleted file mode 100644 index e7fb9adbe..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/frametranslator/jms-json +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.stomp.JmsFrameTranslator \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/frametranslator/jms-map-json b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/frametranslator/jms-map-json deleted file mode 100644 index e7fb9adbe..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/frametranslator/jms-map-json +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.stomp.JmsFrameTranslator \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/frametranslator/jms-map-xml b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/frametranslator/jms-map-xml deleted file mode 100644 index e7fb9adbe..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/frametranslator/jms-map-xml +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.stomp.JmsFrameTranslator \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/frametranslator/jms-object-json b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/frametranslator/jms-object-json deleted file mode 100644 index e7fb9adbe..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/frametranslator/jms-object-json +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.stomp.JmsFrameTranslator \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/frametranslator/jms-object-xml b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/frametranslator/jms-object-xml deleted file mode 100644 index e7fb9adbe..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/frametranslator/jms-object-xml +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.stomp.JmsFrameTranslator \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/frametranslator/jms-xml b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/frametranslator/jms-xml deleted file mode 100644 index e7fb9adbe..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/frametranslator/jms-xml +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.stomp.JmsFrameTranslator \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/http b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/http deleted file mode 100644 index a36a3c9d8..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/http +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.http.HttpTransportFactory diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/https b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/https deleted file mode 100644 index b7ca03831..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/https +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.https.HttpsTransportFactory diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/logwriters/custom b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/logwriters/custom deleted file mode 100644 index d890090dc..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/logwriters/custom +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.logwriters.CustomLogWriter diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/logwriters/default b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/logwriters/default deleted file mode 100644 index af6c31421..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/logwriters/default +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.logwriters.DefaultLogWriter diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/mock b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/mock deleted file mode 100644 index dd3c85a94..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/mock +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.mock.MockTransportFactory diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/mqtt b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/mqtt deleted file mode 100644 index 8f3e21667..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/mqtt +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.mqtt.MQTTTransportFactory diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/mqtt+nio b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/mqtt+nio deleted file mode 100644 index d957bd5a5..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/mqtt+nio +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.mqtt.MQTTNIOTransportFactory diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/mqtt+nio+ssl b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/mqtt+nio+ssl deleted file mode 100644 index e814d7bd0..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/mqtt+nio+ssl +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.mqtt.MQTTNIOSSLTransportFactory \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/mqtt+ssl b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/mqtt+ssl deleted file mode 100644 index 91f6ab496..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/mqtt+ssl +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.mqtt.MQTTSslTransportFactory diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/multicast b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/multicast deleted file mode 100644 index 4665bbefe..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/multicast +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.multicast.MulticastTransportFactory diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/nio b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/nio deleted file mode 100644 index 4a0aa6233..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/nio +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.nio.NIOTransportFactory diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/nio+ssl b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/nio+ssl deleted file mode 100644 index 5ad7411a4..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/nio+ssl +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.nio.NIOSSLTransportFactory \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/peer b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/peer deleted file mode 100644 index 0825a9b39..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/peer +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.peer.PeerTransportFactory diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/ssl b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/ssl deleted file mode 100644 index c2576c624..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/ssl +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.tcp.SslTransportFactory diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/stomp b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/stomp deleted file mode 100644 index 4704ed9d6..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/stomp +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.stomp.StompTransportFactory diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/stomp+nio b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/stomp+nio deleted file mode 100644 index 80a304c28..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/stomp+nio +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.stomp.StompNIOTransportFactory diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/stomp+nio+ssl b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/stomp+nio+ssl deleted file mode 100644 index 715daad3e..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/stomp+nio+ssl +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.stomp.StompNIOSSLTransportFactory \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/stomp+ssl b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/stomp+ssl deleted file mode 100644 index f62079bab..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/stomp+ssl +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.stomp.StompSslTransportFactory diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/tcp b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/tcp deleted file mode 100644 index ab6badf0d..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/tcp +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.tcp.TcpTransportFactory diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/udp b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/udp deleted file mode 100644 index 29d860d88..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/udp +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.udp.UdpTransportFactory diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/vm b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/vm deleted file mode 100644 index 3ee3536ec..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/vm +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.vm.VMTransportFactory diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/ws b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/ws deleted file mode 100644 index 3783dfc90..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/ws +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.ws.WSTransportFactory \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/wss b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/wss deleted file mode 100644 index 792384e70..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/transport/wss +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.wss.WSSTransportFactory \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/wireformat/amqp b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/wireformat/amqp deleted file mode 100644 index b2990235c..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/wireformat/amqp +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.amqp.AmqpWireFormatFactory \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/wireformat/default b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/wireformat/default deleted file mode 100644 index 1b993e1d1..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/wireformat/default +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.openwire.OpenWireFormatFactory diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/wireformat/mqtt b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/wireformat/mqtt deleted file mode 100644 index fab0c94f8..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/wireformat/mqtt +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.mqtt.MQTTWireFormatFactory \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/wireformat/stomp b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/wireformat/stomp deleted file mode 100644 index 7f8052734..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/wireformat/stomp +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.stomp.StompWireFormatFactory \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/wireformat/xstream b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/wireformat/xstream deleted file mode 100644 index d5e2d63b7..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/activemq/wireformat/xstream +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -class=org.apache.activemq.transport.xstream.XStreamWireFormatFactory \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/camel/TypeConverter b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/camel/TypeConverter deleted file mode 100644 index b3817f26e..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/camel/TypeConverter +++ /dev/null @@ -1,19 +0,0 @@ -# -# 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. -# - -org.apache.activemq.camel.converter.ActiveMQConverter -org.apache.activemq.camel.converter.ActiveMQMessageConverter \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/camel/component/activemq b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/camel/component/activemq deleted file mode 100644 index 7df5d454b..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/camel/component/activemq +++ /dev/null @@ -1,18 +0,0 @@ -# -# 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. -# - -class=org.apache.activemq.camel.component.ActiveMQComponent diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/camel/component/activemq.journal b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/camel/component/activemq.journal deleted file mode 100644 index bac5c4621..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/camel/component/activemq.journal +++ /dev/null @@ -1,18 +0,0 @@ -# -# 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. -# - -class=org.apache.activemq.camel.component.JournalComponent diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/camel/component/broker b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/camel/component/broker deleted file mode 100644 index 186f4ab63..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/camel/component/broker +++ /dev/null @@ -1,18 +0,0 @@ -# -# 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. -# - -class=org.apache.activemq.camel.component.broker.BrokerComponent diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/xbean/spring/http/activemq.apache.org/schema/core b/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/xbean/spring/http/activemq.apache.org/schema/core deleted file mode 100644 index aa9fc3e81..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/services/org/apache/xbean/spring/http/activemq.apache.org/schema/core +++ /dev/null @@ -1,389 +0,0 @@ -# NOTE: this file is autogenerated by Apache XBean - -# beans -abortSlowAckConsumerStrategy = org.apache.activemq.broker.region.policy.AbortSlowAckConsumerStrategy - -abortSlowConsumerStrategy = org.apache.activemq.broker.region.policy.AbortSlowConsumerStrategy - -authenticationUser = org.apache.activemq.security.AuthenticationUser -org.apache.activemq.security.AuthenticationUser(java.lang.String,java.lang.String,java.lang.String).parameterNames = username password groups - -authorizationEntry = org.apache.activemq.security.XBeanAuthorizationEntry -authorizationEntry.initMethod = afterPropertiesSet - -authorizationMap = org.apache.activemq.security.XBeanAuthorizationMap -authorizationMap.initMethod = afterPropertiesSet - -authorizationPlugin = org.apache.activemq.security.AuthorizationPlugin -org.apache.activemq.security.AuthorizationPlugin(org.apache.activemq.security.AuthorizationMap).parameterNames = map - -axionJDBCAdapter = org.apache.activemq.store.jdbc.adapter.AxionJDBCAdapter - -blobJDBCAdapter = org.apache.activemq.store.jdbc.adapter.BlobJDBCAdapter - -broker = org.apache.activemq.xbean.XBeanBrokerService -broker.initMethod = afterPropertiesSet -broker.destroyMethod = destroy -broker.advisorySupport.propertyEditor = org.apache.activemq.util.BooleanEditor -broker.deleteAllMessagesOnStartup.propertyEditor = org.apache.activemq.util.BooleanEditor -broker.passiveSlave.propertyEditor = org.apache.activemq.util.BooleanEditor -broker.persistent.propertyEditor = org.apache.activemq.util.BooleanEditor -broker.schedulerSupport.propertyEditor = org.apache.activemq.util.BooleanEditor -broker.shutdownOnSlaveFailure.propertyEditor = org.apache.activemq.util.BooleanEditor -broker.systemExitOnShutdown.propertyEditor = org.apache.activemq.util.BooleanEditor -broker.useJmx.propertyEditor = org.apache.activemq.util.BooleanEditor -broker.waitForSlave.propertyEditor = org.apache.activemq.util.BooleanEditor - -brokerService = org.apache.activemq.broker.BrokerService -brokerService.advisorySupport.propertyEditor = org.apache.activemq.util.BooleanEditor -brokerService.deleteAllMessagesOnStartup.propertyEditor = org.apache.activemq.util.BooleanEditor -brokerService.passiveSlave.propertyEditor = org.apache.activemq.util.BooleanEditor -brokerService.persistent.propertyEditor = org.apache.activemq.util.BooleanEditor -brokerService.schedulerSupport.propertyEditor = org.apache.activemq.util.BooleanEditor -brokerService.shutdownOnSlaveFailure.propertyEditor = org.apache.activemq.util.BooleanEditor -brokerService.systemExitOnShutdown.propertyEditor = org.apache.activemq.util.BooleanEditor -brokerService.useJmx.propertyEditor = org.apache.activemq.util.BooleanEditor -brokerService.waitForSlave.propertyEditor = org.apache.activemq.util.BooleanEditor - -bytesJDBCAdapter = org.apache.activemq.store.jdbc.adapter.BytesJDBCAdapter - -cachedLDAPAuthorizationMap = org.apache.activemq.security.CachedLDAPAuthorizationMap - -cachedMessageGroupMapFactory = org.apache.activemq.broker.region.group.CachedMessageGroupMapFactory - -compositeDemandForwardingBridge = org.apache.activemq.network.CompositeDemandForwardingBridge -org.apache.activemq.network.CompositeDemandForwardingBridge(org.apache.activemq.network.NetworkBridgeConfiguration,org.apache.activemq.transport.Transport,org.apache.activemq.transport.Transport).parameterNames = configuration localBroker remoteBroker - -compositeQueue = org.apache.activemq.broker.region.virtual.CompositeQueue - -compositeTopic = org.apache.activemq.broker.region.virtual.CompositeTopic - -conditionalNetworkBridgeFilterFactory = org.apache.activemq.network.ConditionalNetworkBridgeFilterFactory - -connectionDotFilePlugin = org.apache.activemq.broker.view.ConnectionDotFilePlugin - -connectionFactory = org.apache.activemq.spring.ActiveMQConnectionFactory -connectionFactory.initMethod = afterPropertiesSet - -constantPendingMessageLimitStrategy = org.apache.activemq.broker.region.policy.ConstantPendingMessageLimitStrategy - -database-locker = org.apache.activemq.store.jdbc.DefaultDatabaseLocker - -db2JDBCAdapter = org.apache.activemq.store.jdbc.adapter.DB2JDBCAdapter - -defaultIOExceptionHandler = org.apache.activemq.util.DefaultIOExceptionHandler - -defaultJDBCAdapter = org.apache.activemq.store.jdbc.adapter.DefaultJDBCAdapter - -defaultNetworkBridgeFilterFactory = org.apache.activemq.network.DefaultNetworkBridgeFilterFactory - -defaultUsageCapacity = org.apache.activemq.usage.DefaultUsageCapacity - -demandForwardingBridge = org.apache.activemq.network.DemandForwardingBridge -org.apache.activemq.network.DemandForwardingBridge(org.apache.activemq.network.NetworkBridgeConfiguration,org.apache.activemq.transport.Transport,org.apache.activemq.transport.Transport).parameterNames = configuration localBroker remoteBroker - -destinationDotFilePlugin = org.apache.activemq.broker.view.DestinationDotFilePlugin - -destinationEntry = org.apache.activemq.filter.DefaultDestinationMapEntry - -destinationPathSeparatorPlugin = org.apache.activemq.broker.util.DestinationPathSeparatorBroker - -discarding = org.apache.activemq.broker.region.policy.DiscardingDeadLetterStrategy - -discardingDLQBrokerPlugin = org.apache.activemq.plugin.DiscardingDLQBrokerPlugin - -fileCursor = org.apache.activemq.broker.region.policy.FilePendingSubscriberMessageStoragePolicy - -fileDurableSubscriberCursor = org.apache.activemq.broker.region.policy.FilePendingDurableSubscriberMessageStoragePolicy - -fileQueueCursor = org.apache.activemq.broker.region.policy.FilePendingQueueMessageStoragePolicy - -filteredDestination = org.apache.activemq.broker.region.virtual.FilteredDestination - -filteredKahaDB = org.apache.activemq.store.kahadb.FilteredKahaDBPersistenceAdapter -org.apache.activemq.store.kahadb.FilteredKahaDBPersistenceAdapter(org.apache.activemq.command.ActiveMQDestination,org.apache.activemq.store.PersistenceAdapter).parameterNames = destination adapter - -fixedCountSubscriptionRecoveryPolicy = org.apache.activemq.broker.region.policy.FixedCountSubscriptionRecoveryPolicy - -fixedSizedSubscriptionRecoveryPolicy = org.apache.activemq.broker.region.policy.FixedSizedSubscriptionRecoveryPolicy - -forcePersistencyModeBroker = org.apache.activemq.plugin.ForcePersistencyModeBroker -org.apache.activemq.plugin.ForcePersistencyModeBroker(org.apache.activemq.broker.Broker).parameterNames = next - -forcePersistencyModeBrokerPlugin = org.apache.activemq.plugin.ForcePersistencyModeBrokerPlugin - -forwardingBridge = org.apache.activemq.network.ForwardingBridge -org.apache.activemq.network.ForwardingBridge(org.apache.activemq.transport.Transport,org.apache.activemq.transport.Transport).parameterNames = localBroker remoteBroker - -hsqldb-jdbc-adapter = org.apache.activemq.store.jdbc.adapter.HsqldbJDBCAdapter - -imageBasedJDBCAdaptor = org.apache.activemq.store.jdbc.adapter.ImageBasedJDBCAdaptor - -inboundQueueBridge = org.apache.activemq.network.jms.InboundQueueBridge -org.apache.activemq.network.jms.InboundQueueBridge(java.lang.String).parameterNames = inboundQueueName - -inboundTopicBridge = org.apache.activemq.network.jms.InboundTopicBridge -org.apache.activemq.network.jms.InboundTopicBridge(java.lang.String).parameterNames = inboundTopicName - -individualDeadLetterStrategy = org.apache.activemq.broker.region.policy.IndividualDeadLetterStrategy - -informixJDBCAdapter = org.apache.activemq.store.jdbc.adapter.InformixJDBCAdapter - -jDBCIOExceptionHandler = org.apache.activemq.store.jdbc.JDBCIOExceptionHandler - -jaasAuthenticationPlugin = org.apache.activemq.security.JaasAuthenticationPlugin - -jaasCertificateAuthenticationPlugin = org.apache.activemq.security.JaasCertificateAuthenticationPlugin - -jaasDualAuthenticationPlugin = org.apache.activemq.security.JaasDualAuthenticationPlugin - -jdbcPersistenceAdapter = org.apache.activemq.store.jdbc.JDBCPersistenceAdapter -org.apache.activemq.store.jdbc.JDBCPersistenceAdapter(javax.sql.DataSource,org.apache.activemq.wireformat.WireFormat).parameterNames = ds wireFormat - -jmsQueueConnector = org.apache.activemq.network.jms.JmsQueueConnector - -jmsTopicConnector = org.apache.activemq.network.jms.JmsTopicConnector - -jobSchedulerUsage = org.apache.activemq.usage.JobSchedulerUsage -jobSchedulerUsage.limit.propertyEditor = org.apache.activemq.util.MemoryPropertyEditor -jobSchedulerUsage.percentUsageMinDelta.propertyEditor = org.apache.activemq.util.MemoryPropertyEditor -org.apache.activemq.usage.JobSchedulerUsage(java.lang.String,org.apache.activemq.broker.scheduler.JobSchedulerStore).parameterNames = name store -org.apache.activemq.usage.JobSchedulerUsage(org.apache.activemq.usage.JobSchedulerUsage,java.lang.String).parameterNames = parent name - -journalPersistenceAdapter = org.apache.activemq.store.journal.JournalPersistenceAdapter -org.apache.activemq.store.journal.JournalPersistenceAdapter(org.apache.activeio.journal.Journal,org.apache.activemq.store.PersistenceAdapter,org.apache.activemq.thread.TaskRunnerFactory).parameterNames = journal longTermPersistence taskRunnerFactory - -journalPersistenceAdapterFactory = org.apache.activemq.store.journal.JournalPersistenceAdapterFactory -journalPersistenceAdapterFactory.journalLogFileSize.propertyEditor = org.apache.activemq.util.MemoryIntPropertyEditor - -journaledJDBC = org.apache.activemq.store.PersistenceAdapterFactoryBean -journaledJDBC.journalLogFileSize.propertyEditor = org.apache.activemq.util.MemoryIntPropertyEditor - -kahaDB = org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter -kahaDB.indexCacheSize.propertyEditor = org.apache.activemq.util.MemoryPropertyEditor -kahaDB.indexWriteBatchSize.propertyEditor = org.apache.activemq.util.MemoryPropertyEditor -kahaDB.journalMaxFileLength.propertyEditor = org.apache.activemq.util.MemoryIntPropertyEditor -kahaDB.journalMaxWriteBatchSize.propertyEditor = org.apache.activemq.util.MemoryPropertyEditor - -lDAPAuthorizationMap = org.apache.activemq.security.LDAPAuthorizationMap -org.apache.activemq.security.LDAPAuthorizationMap(java.util.Map).parameterNames = options - -lastImageSubscriptionRecoveryPolicy = org.apache.activemq.broker.region.policy.LastImageSubscriptionRecoveryPolicy - -ldapNetworkConnector = org.apache.activemq.network.LdapNetworkConnector -ldapNetworkConnector.prefetchSize.propertyEditor = org.apache.activemq.util.MemoryIntPropertyEditor - -lease-database-locker = org.apache.activemq.store.jdbc.LeaseDatabaseLocker - -levelDB = org.apache.activemq.store.leveldb.LevelDBPersistenceAdapter - -loggingBrokerPlugin = org.apache.activemq.broker.util.LoggingBrokerPlugin -loggingBrokerPlugin.initMethod = afterPropertiesSet - -mKahaDB = org.apache.activemq.store.kahadb.MultiKahaDBPersistenceAdapter -mKahaDB.journalMaxFileLength.propertyEditor = org.apache.activemq.util.MemoryIntPropertyEditor -mKahaDB.journalWriteBatchSize.propertyEditor = org.apache.activemq.util.MemoryIntPropertyEditor - -managementContext = org.apache.activemq.broker.jmx.ManagementContext -managementContext.connectorPort.propertyEditor = org.apache.activemq.util.MemoryIntPropertyEditor -managementContext.createConnector.propertyEditor = org.apache.activemq.util.BooleanEditor -managementContext.rmiServerPort.propertyEditor = org.apache.activemq.util.MemoryIntPropertyEditor -org.apache.activemq.broker.jmx.ManagementContext(javax.management.MBeanServer).parameterNames = server - -maxdb-jdbc-adapter = org.apache.activemq.store.jdbc.adapter.MaxDBJDBCAdapter - -memoryPersistenceAdapter = org.apache.activemq.store.memory.MemoryPersistenceAdapter - -memoryUsage = org.apache.activemq.usage.MemoryUsage -memoryUsage.limit.propertyEditor = org.apache.activemq.util.MemoryPropertyEditor -memoryUsage.percentUsageMinDelta.propertyEditor = org.apache.activemq.util.MemoryPropertyEditor -org.apache.activemq.usage.MemoryUsage(org.apache.activemq.usage.MemoryUsage).parameterNames = parent -org.apache.activemq.usage.MemoryUsage(java.lang.String).parameterNames = name -org.apache.activemq.usage.MemoryUsage(org.apache.activemq.usage.MemoryUsage,java.lang.String).parameterNames = parent name -org.apache.activemq.usage.MemoryUsage(org.apache.activemq.usage.MemoryUsage,java.lang.String,float).parameterNames = parent name portion - -messageGroupHashBucketFactory = org.apache.activemq.broker.region.group.MessageGroupHashBucketFactory - -mirroredQueue = org.apache.activemq.broker.region.virtual.MirroredQueue - -multicastNetworkConnector = org.apache.activemq.network.MulticastNetworkConnector -multicastNetworkConnector.prefetchSize.propertyEditor = org.apache.activemq.util.MemoryIntPropertyEditor -org.apache.activemq.network.MulticastNetworkConnector(java.net.URI).parameterNames = remoteURI - -multicastTraceBrokerPlugin = org.apache.activemq.broker.util.MulticastTraceBrokerPlugin - -mysql-jdbc-adapter = org.apache.activemq.store.jdbc.adapter.MySqlJDBCAdapter - -networkConnector = org.apache.activemq.network.DiscoveryNetworkConnector -networkConnector.prefetchSize.propertyEditor = org.apache.activemq.util.MemoryIntPropertyEditor -org.apache.activemq.network.DiscoveryNetworkConnector(java.net.URI).parameterNames = discoveryURI - -noSubscriptionRecoveryPolicy = org.apache.activemq.broker.region.policy.NoSubscriptionRecoveryPolicy - -oldestMessageEvictionStrategy = org.apache.activemq.broker.region.policy.OldestMessageEvictionStrategy - -oldestMessageWithLowestPriorityEvictionStrategy = org.apache.activemq.broker.region.policy.OldestMessageWithLowestPriorityEvictionStrategy - -oracleBlobJDBCAdapter = org.apache.activemq.store.jdbc.adapter.OracleBlobJDBCAdapter - -oracleJDBCAdapter = org.apache.activemq.store.jdbc.adapter.OracleJDBCAdapter - -outboundQueueBridge = org.apache.activemq.network.jms.OutboundQueueBridge -org.apache.activemq.network.jms.OutboundQueueBridge(java.lang.String).parameterNames = outboundQueueName - -outboundTopicBridge = org.apache.activemq.network.jms.OutboundTopicBridge -org.apache.activemq.network.jms.OutboundTopicBridge(java.lang.String).parameterNames = outboundTopicName - -pListStoreImpl = org.apache.activemq.store.kahadb.plist.PListStoreImpl - -partitionBrokerPlugin = org.apache.activemq.partition.PartitionBrokerPlugin - -policyEntry = org.apache.activemq.broker.region.policy.PolicyEntry -policyEntry.memoryLimit.propertyEditor = org.apache.activemq.util.MemoryPropertyEditor - -policyMap = org.apache.activemq.broker.region.policy.PolicyMap - -pooledConnectionFactory = org.apache.activemq.pool.PooledConnectionFactoryBean -pooledConnectionFactory.initMethod = afterPropertiesSet -pooledConnectionFactory.destroyMethod = destroy - -postgresql-jdbc-adapter = org.apache.activemq.store.jdbc.adapter.PostgresqlJDBCAdapter - -prefetchPolicy = org.apache.activemq.ActiveMQPrefetchPolicy - -prefetchRatePendingMessageLimitStrategy = org.apache.activemq.broker.region.policy.PrefetchRatePendingMessageLimitStrategy - -priorityDispatchPolicy = org.apache.activemq.broker.region.policy.PriorityDispatchPolicy - -priorityNetworkDispatchPolicy = org.apache.activemq.broker.region.policy.PriorityNetworkDispatchPolicy - -proxyConnector = org.apache.activemq.proxy.ProxyConnector - -publishedAddressPolicy = org.apache.activemq.broker.PublishedAddressPolicy - -queryBasedSubscriptionRecoveryPolicy = org.apache.activemq.broker.region.policy.QueryBasedSubscriptionRecoveryPolicy - -queue = org.apache.activemq.command.ActiveMQQueue -org.apache.activemq.command.ActiveMQQueue(java.lang.String).parameterNames = name - -queueDispatchSelector = org.apache.activemq.broker.region.QueueDispatchSelector -org.apache.activemq.broker.region.QueueDispatchSelector(org.apache.activemq.command.ActiveMQDestination).parameterNames = destination - -reconnectionPolicy = org.apache.activemq.network.jms.ReconnectionPolicy - -redeliveryPlugin = org.apache.activemq.broker.util.RedeliveryPlugin - -redeliveryPolicy = org.apache.activemq.RedeliveryPolicy - -redeliveryPolicyMap = org.apache.activemq.broker.region.policy.RedeliveryPolicyMap - -replicatedLevelDB = org.apache.activemq.store.leveldb.ReplicatedLevelDBPersistenceAdapter - -roundRobinDispatchPolicy = org.apache.activemq.broker.region.policy.RoundRobinDispatchPolicy - -runtimeConfigurationPlugin = org.apache.activemq.plugin.RuntimeConfigurationPlugin - -shared-file-locker = org.apache.activemq.store.SharedFileLocker - -sharedDeadLetterStrategy = org.apache.activemq.broker.region.policy.SharedDeadLetterStrategy - -simpleAuthenticationPlugin = org.apache.activemq.security.SimpleAuthenticationPlugin -org.apache.activemq.security.SimpleAuthenticationPlugin(java.util.List).parameterNames = users - -simpleAuthorizationMap = org.apache.activemq.security.SimpleAuthorizationMap -org.apache.activemq.security.SimpleAuthorizationMap(org.apache.activemq.filter.DestinationMap,org.apache.activemq.filter.DestinationMap,org.apache.activemq.filter.DestinationMap).parameterNames = writeACLs readACLs adminACLs - -simpleDispatchPolicy = org.apache.activemq.broker.region.policy.SimpleDispatchPolicy - -simpleDispatchSelector = org.apache.activemq.broker.region.policy.SimpleDispatchSelector -org.apache.activemq.broker.region.policy.SimpleDispatchSelector(org.apache.activemq.command.ActiveMQDestination).parameterNames = destination - -simpleJmsMessageConvertor = org.apache.activemq.network.jms.SimpleJmsMessageConvertor - -simpleMessageGroupMapFactory = org.apache.activemq.broker.region.group.SimpleMessageGroupMapFactory - -sslContext = org.apache.activemq.spring.SpringSslContext -sslContext.initMethod = afterPropertiesSet - -statements = org.apache.activemq.store.jdbc.Statements - -statisticsBrokerPlugin = org.apache.activemq.plugin.StatisticsBrokerPlugin - -storeCursor = org.apache.activemq.broker.region.policy.StorePendingQueueMessageStoragePolicy - -storeDurableSubscriberCursor = org.apache.activemq.broker.region.policy.StorePendingDurableSubscriberMessageStoragePolicy - -storeUsage = org.apache.activemq.usage.StoreUsage -storeUsage.limit.propertyEditor = org.apache.activemq.util.MemoryPropertyEditor -storeUsage.percentUsageMinDelta.propertyEditor = org.apache.activemq.util.MemoryPropertyEditor -org.apache.activemq.usage.StoreUsage(java.lang.String,org.apache.activemq.store.PersistenceAdapter).parameterNames = name store -org.apache.activemq.usage.StoreUsage(org.apache.activemq.usage.StoreUsage,java.lang.String).parameterNames = parent name - -streamJDBCAdapter = org.apache.activemq.store.jdbc.adapter.StreamJDBCAdapter - -strictOrderDispatchPolicy = org.apache.activemq.broker.region.policy.StrictOrderDispatchPolicy - -sybase-jdbc-adapter = org.apache.activemq.store.jdbc.adapter.SybaseJDBCAdapter - -systemUsage = org.apache.activemq.usage.SystemUsage -org.apache.activemq.usage.SystemUsage(java.lang.String,org.apache.activemq.store.PersistenceAdapter,org.apache.activemq.store.PListStore,org.apache.activemq.broker.scheduler.JobSchedulerStore).parameterNames = name adapter tempStore jobSchedulerStore -org.apache.activemq.usage.SystemUsage(org.apache.activemq.usage.SystemUsage,java.lang.String).parameterNames = parent name - -taskRunnerFactory = org.apache.activemq.thread.TaskRunnerFactory -org.apache.activemq.thread.TaskRunnerFactory(java.lang.String).parameterNames = name -org.apache.activemq.thread.TaskRunnerFactory(java.lang.String,int,boolean,int,boolean).parameterNames = name priority daemon maxIterationsPerRun dedicatedTaskRunner -org.apache.activemq.thread.TaskRunnerFactory(java.lang.String,int,boolean,int,boolean,int).parameterNames = name priority daemon maxIterationsPerRun dedicatedTaskRunner maxThreadPoolSize - -tempDestinationAuthorizationEntry = org.apache.activemq.security.TempDestinationAuthorizationEntry - -tempQueue = org.apache.activemq.command.ActiveMQTempQueue -org.apache.activemq.command.ActiveMQTempQueue(java.lang.String).parameterNames = name -org.apache.activemq.command.ActiveMQTempQueue(org.apache.activemq.command.ConnectionId,long).parameterNames = connectionId sequenceId - -tempTopic = org.apache.activemq.command.ActiveMQTempTopic -org.apache.activemq.command.ActiveMQTempTopic(java.lang.String).parameterNames = name -org.apache.activemq.command.ActiveMQTempTopic(org.apache.activemq.command.ConnectionId,long).parameterNames = connectionId sequenceId - -tempUsage = org.apache.activemq.usage.TempUsage -tempUsage.limit.propertyEditor = org.apache.activemq.util.MemoryPropertyEditor -tempUsage.percentUsageMinDelta.propertyEditor = org.apache.activemq.util.MemoryPropertyEditor -org.apache.activemq.usage.TempUsage(java.lang.String,org.apache.activemq.store.PListStore).parameterNames = name store -org.apache.activemq.usage.TempUsage(org.apache.activemq.usage.TempUsage,java.lang.String).parameterNames = parent name - -timeStampingBrokerPlugin = org.apache.activemq.broker.util.TimeStampingBrokerPlugin - -timedSubscriptionRecoveryPolicy = org.apache.activemq.broker.region.policy.TimedSubscriptionRecoveryPolicy - -topic = org.apache.activemq.command.ActiveMQTopic -org.apache.activemq.command.ActiveMQTopic(java.lang.String).parameterNames = name - -traceBrokerPathPlugin = org.apache.activemq.broker.util.TraceBrokerPathPlugin - -transact-database-locker = org.apache.activemq.store.jdbc.adapter.TransactDatabaseLocker - -transact-jdbc-adapter = org.apache.activemq.store.jdbc.adapter.TransactJDBCAdapter - -transportConnector = org.apache.activemq.broker.TransportConnector -org.apache.activemq.broker.TransportConnector(org.apache.activemq.transport.TransportServer).parameterNames = server - -udpTraceBrokerPlugin = org.apache.activemq.broker.util.UDPTraceBrokerPlugin - -uniquePropertyMessageEvictionStrategy = org.apache.activemq.broker.region.policy.UniquePropertyMessageEvictionStrategy - -usageCapacity = org.apache.activemq.usage.UsageCapacity - -virtualDestinationInterceptor = org.apache.activemq.broker.region.virtual.VirtualDestinationInterceptor - -virtualSelectorCacheBrokerPlugin = org.apache.activemq.plugin.SubQueueSelectorCacheBrokerPlugin - -virtualTopic = org.apache.activemq.broker.region.virtual.VirtualTopic - -vmCursor = org.apache.activemq.broker.region.policy.VMPendingSubscriberMessageStoragePolicy - -vmDurableCursor = org.apache.activemq.broker.region.policy.VMPendingDurableSubscriberMessageStoragePolicy - -vmQueueCursor = org.apache.activemq.broker.region.policy.VMPendingQueueMessageStoragePolicy - -xaConnectionFactory = org.apache.activemq.spring.ActiveMQXAConnectionFactory -xaConnectionFactory.initMethod = afterPropertiesSet - diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/spring.handlers b/uk.ac.diamond.org.apache.activemq/META-INF/spring.handlers deleted file mode 100644 index 3dae87309..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/spring.handlers +++ /dev/null @@ -1,8 +0,0 @@ -#Generated by xbean-spring -#Mon Oct 14 23:49:43 IST 2013 -http\://activemq.apache.org/schema/core=org.apache.xbean.spring.context.v2.XBeanNamespaceHandler - -#Generated by xbean-spring -#Mon Oct 14 23:49:43 IST 2013 -http\://activemq.apache.org/schema/core=org.apache.xbean.spring.context.v2.XBeanNamespaceHandler - diff --git a/uk.ac.diamond.org.apache.activemq/META-INF/spring.schemas b/uk.ac.diamond.org.apache.activemq/META-INF/spring.schemas deleted file mode 100644 index 1626f1cdc..000000000 --- a/uk.ac.diamond.org.apache.activemq/META-INF/spring.schemas +++ /dev/null @@ -1,80 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -http\://activemq.org/config/1.0=activemq.xsd -http\://activemq.org/config/1.0/1.0.xsd=activemq.xsd -http\://activemq.apache.org/schema/core=activemq.xsd -http\://activemq.apache.org/schema/core/activemq-core.xsd=activemq.xsd -http\://activemq.apache.org/schema/core/activemq-core-5.0.0.xsd=activemq.xsd -http\://activemq.apache.org/schema/core/activemq-core-5.1.0.xsd=activemq.xsd -http\://activemq.apache.org/schema/core/activemq-core-5.2.0.xsd=activemq.xsd -http\://activemq.apache.org/schema/core/activemq-core-5.3.0.xsd=activemq.xsd -http\://activemq.apache.org/schema/core/activemq-core-5.3.1.xsd=activemq.xsd -http\://activemq.apache.org/schema/core/activemq-core-5.3.2.xsd=activemq.xsd -http\://activemq.apache.org/schema/core/activemq-core-5.4.0.xsd=activemq.xsd -http\://activemq.apache.org/schema/core/activemq-core-5.4.1.xsd=activemq.xsd -http\://activemq.apache.org/schema/core/activemq-core-5.4.2.xsd=activemq.xsd -http\://activemq.apache.org/schema/core/activemq-core-5.5.0.xsd=activemq.xsd -http\://activemq.apache.org/schema/core/activemq-core-5.5.1.xsd=activemq.xsd -http\://activemq.apache.org/schema/core/activemq-core-5.6.0.xsd=activemq.xsd -http\://activemq.apache.org/schema/core/activemq-core-5.7.0.xsd=activemq.xsd -http\://activemq.apache.org/schema/core/activemq-core-5.8.0.xsd=activemq.xsd -http\://activemq.apache.org/schema/core/activemq-core-5.9.0.xsd=activemq.xsd -http\://activemq.apache.org/schema/core/activemq-core-5.10.0.xsd=activemq.xsd - -http\://camel.apache.org/schema/osgi/camel-osgi.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/spring/camel-spring.xsd=camel-spring.xsd - -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- -http\://activemq.org/config/1.0=activemq.xsd -http\://activemq.org/config/1.0/1.0.xsd=activemq.xsd -http\://activemq.apache.org/schema/core=activemq.xsd -http\://activemq.apache.org/schema/core/activemq-core.xsd=activemq.xsd -http\://activemq.apache.org/schema/core/activemq-core-5.0.0.xsd=activemq.xsd -http\://activemq.apache.org/schema/core/activemq-core-5.1.0.xsd=activemq.xsd -http\://activemq.apache.org/schema/core/activemq-core-5.2.0.xsd=activemq.xsd -http\://activemq.apache.org/schema/core/activemq-core-5.3.0.xsd=activemq.xsd -http\://activemq.apache.org/schema/core/activemq-core-5.3.1.xsd=activemq.xsd -http\://activemq.apache.org/schema/core/activemq-core-5.3.2.xsd=activemq.xsd -http\://activemq.apache.org/schema/core/activemq-core-5.4.0.xsd=activemq.xsd -http\://activemq.apache.org/schema/core/activemq-core-5.4.1.xsd=activemq.xsd -http\://activemq.apache.org/schema/core/activemq-core-5.4.2.xsd=activemq.xsd -http\://activemq.apache.org/schema/core/activemq-core-5.5.0.xsd=activemq.xsd -http\://activemq.apache.org/schema/core/activemq-core-5.5.1.xsd=activemq.xsd -http\://activemq.apache.org/schema/core/activemq-core-5.6.0.xsd=activemq.xsd -http\://activemq.apache.org/schema/core/activemq-core-5.7.0.xsd=activemq.xsd -http\://activemq.apache.org/schema/core/activemq-core-5.8.0.xsd=activemq.xsd -http\://activemq.apache.org/schema/core/activemq-core-5.9.0.xsd=activemq.xsd -http\://activemq.apache.org/schema/core/activemq-core-5.10.0.xsd=activemq.xsd - -http\://camel.apache.org/schema/osgi/camel-osgi.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/spring/camel-spring.xsd=camel-spring.xsd - diff --git a/uk.ac.diamond.org.apache.activemq/README.txt b/uk.ac.diamond.org.apache.activemq/README.txt index 0c115f50a..ac73ce2fb 100644 --- a/uk.ac.diamond.org.apache.activemq/README.txt +++ b/uk.ac.diamond.org.apache.activemq/README.txt @@ -1,7 +1,2 @@ -Plugin is build from the active-mq-all.jar. - -After doing this the slf4j implementation in active-mq-all is deleted from this bundle. This avoids build conflicts. -The dependency on org.slf4j is then added to the bundle so that it comes from somewhere. - This bundle is in the scanning build on the dawnsci update site. Changes to it should be published to that site. Instructions to do this are in org.eclipse.dawnsci.third.site/README.txt \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/activemq.xsd b/uk.ac.diamond.org.apache.activemq/activemq.xsd deleted file mode 100644 index c11bc479d..000000000 --- a/uk.ac.diamond.org.apache.activemq/activemq.xsd +++ /dev/null @@ -1,9720 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  • - - ]]>
    -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Mirrored -Queues should be supported by default if they have not been -explicitly configured. - ]]> - - - - - - - - - - - Virtual -Topics should be supported by default if they have not been -explicitly configured. - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Mirrored -Queues should be supported by default if they have not been -explicitly configured. - ]]> - - - - - - - - - - - Virtual -Topics should be supported by default if they have not been -explicitly configured. - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Message Groups functionality. - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DOT file creator plugin which -creates a DOT file showing the current connections - ]]> - - - - - - - - - - - - - - - - - Spring enhanced connection -factory which will automatically use the Spring bean name as the clientIDPrefix property -so that connections created have client IDs related to your Spring.xml file for -easier comprehension from JMX. - ]]> - - - - - - - - - - - - - - - - - - - Note: access to this clientInternalExceptionListener will not be serialized if it is associated with more than -on connection (as it will be if more than one connection is subsequently created by this connection factory) - ]]> - - - - - - - - - - - - - Note: access to this exceptionLinstener will not be serialized if it is associated with more than -on connection (as it will be if more than one connection is subsequently created by this connection factory) - ]]> - - - - - - - - prefetch -policy for consumers created by this connection. - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - connection -URL used to connect to the ActiveMQ broker. - ]]> - - - - - - - - - - - - - - - - - Note: access to this clientInternalExceptionListener will not be serialized if it is associated with more than -on connection (as it will be if more than one connection is subsequently created by this connection factory) - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - dispatched -synchronously or asynchronously by the broker. For non-durable -topics for example we typically dispatch synchronously by default to -minimize context switches which boost performance. However sometimes its -better to go slower to ensure that a single blocked consumer socket does -not block delivery to other consumers. - ]]> - - - - - Note: access to this exceptionLinstener will not be serialized if it is associated with more than -on connection (as it will be if more than one connection is subsequently created by this connection factory) - ]]> - - - - - Message Groups - ]]> - - - - - - - Nested -Structures of Map and List objects - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - prefetch -policy for consumers created by this connection. - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Async Sends which -adds a massive performance boost; but means that the send() method will -return immediately whether the message has been sent or not which could -lead to message loss. - ]]> - - - - - - - - - - - - - - - - - - - - - - start -the connection so this option makes the default case to create a -warning if the user forgets. To disable the warning just set the value to < -0 (say -1). - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - sub-classing is -encouraged to override the default implementation of methods to account for differences in JDBC Driver -implementations.

    The JDBCAdapter inserts and extracts BLOB data using the getBytes()/setBytes() operations.

    -The databases/JDBC drivers that use this adapter are: -

      -
    • -
    - ]]>
    -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DOT -file creator plugin which creates a DOT file showing the current topic & queue hierarchies. - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  • Sybase
  • -
  • MS SQL
  • - - ]]>
    -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - container name field and subscription id field must be reduced to 150 characters. -Therefore be sure not to use longer names for container name and subscription id than 150 characters. - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - java.security.auth.login.config system property -is not defined then it is set to the location of the login.config file on the classpath. - ]]> - - - - - - - - - - - - - - - - - - - - - - java.security.auth.login.config system property -is not defined then it is set to the location of the login.config file on the classpath. - ]]> - - - - - - - - - - - - - - - - - - - - - - java.security.auth.login.config system property -is not defined then it is set to the location of the login.config file on the classpath. - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - null -if the broker name was not set. - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Message -Groups functionality. - ]]> - - - - - - - - - - - - - - - - - - Mirrored -Queue using a prefix and postfix to define the topic name on which to mirror the queue to. - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - multicast://address:port - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Subclassing is encouraged to override the default -implementation of methods to account for differences -in JDBC Driver implementations. -

    -The JDBCAdapter inserts and extracts BLOB data using the -getBytes()/setBytes() operations. -

    -The databases/JDBC drivers that use this adapter are: -

      -
    • -
    - ]]>
    -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - -Subclassing is encouraged to override the default -implementation of methods to account for differences -in JDBC Driver implementations. -

    - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Message Groups -functionality. - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Message Groups -functionality. - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -The resourceName property should be used along with the {@link org.apache.activemq.jms.pool.GenericResourceManager} and have -the same value than its resourceName property. This will make sure the transaction manager -maps correctly the connection factory to the recovery process. - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Subclassing is encouraged to override the default -implementation of methods to account for differences -in JDBC Driver implementations. -

    -The JDBCAdapter inserts and extracts BLOB data using the -getBytes()/setBytes() operations. -

    -The databases/JDBC drivers that use this adapter are: -

      -
    • -
    - ]]>
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Message Groups functionality. - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  • Axion
  • - - ]]>
    -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Virtual Topics. - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - -This stops the build-up of unwanted messages, especially when consumers may -disconnect from time to time when using virtual destinations. -

    -This is influenced by code snippets developed by Maciej Rakowicz - ]]> - - - - - - - - - - - - - - - - - Virtual -Topics using a prefix and postfix. The virtual destination creates a -wildcard that is then used to look up all active queue subscriptions which -match. - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Spring enhanced XA connection -factory which will automatically use the Spring bean name as the clientIDPrefix property -so that connections created have client IDs related to your Spring.xml file for -easier comprehension from JMX. - ]]> - - - - - - - - - - - - - - - - - - - Note: access to this clientInternalExceptionListener will not be serialized if it is associated with more than -on connection (as it will be if more than one connection is subsequently created by this connection factory) - ]]> - - - - - - - - - - - - - Note: access to this exceptionLinstener will not be serialized if it is associated with more than -on connection (as it will be if more than one connection is subsequently created by this connection factory) - ]]> - - - - - - - - prefetch -policy for consumers created by this connection. - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - connection -URL used to connect to the ActiveMQ broker. - ]]> - - - - - - - - - - - - - - - - - Note: access to this clientInternalExceptionListener will not be serialized if it is associated with more than -on connection (as it will be if more than one connection is subsequently created by this connection factory) - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - dispatched -synchronously or asynchronously by the broker. For non-durable -topics for example we typically dispatch synchronously by default to -minimize context switches which boost performance. However sometimes its -better to go slower to ensure that a single blocked consumer socket does -not block delivery to other consumers. - ]]> - - - - - Note: access to this exceptionLinstener will not be serialized if it is associated with more than -on connection (as it will be if more than one connection is subsequently created by this connection factory) - ]]> - - - - - Message Groups - ]]> - - - - - - - Nested -Structures of Map and List objects - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - prefetch -policy for consumers created by this connection. - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Async Sends which -adds a massive performance boost; but means that the send() method will -return immediately whether the message has been sent or not which could -lead to message loss. - ]]> - - - - - - - - - - - - - - - - - - - - - - start -the connection so this option makes the default case to create a -warning if the user forgets. To disable the warning just set the value to < -0 (say -1). - ]]> - - - - - - - - - - - diff --git a/uk.ac.diamond.org.apache.activemq/activemq.xsd.html b/uk.ac.diamond.org.apache.activemq/activemq.xsd.html deleted file mode 100644 index a87629f6e..000000000 --- a/uk.ac.diamond.org.apache.activemq/activemq.xsd.html +++ /dev/null @@ -1,2951 +0,0 @@ - - - -Schema for namespace: http://activemq.apache.org/schema/core - - - - - - - -

    Root Element

    - - - -
    ElementDescriptionClass
    brokerAn ActiveMQ Message Broker. It consists of a number of transport -connectors, network connectors and a bunch of properties which can be used to -configure the broker as its lazily created.org.apache.activemq.xbean.XBeanBrokerService
    - -

    Element Summary

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ElementDescriptionClass
    abortSlowAckConsumerStrategyAbort slow consumers when they reach the configured threshold of slowness, - -default is that a consumer that has not Ack'd a message for 30 seconds is slow.org.apache.activemq.broker.region.policy.AbortSlowAckConsumerStrategy
    abortSlowConsumerStrategyAbort slow consumers when they reach the configured threshold of slowness, default is slow for 30 secondsorg.apache.activemq.broker.region.policy.AbortSlowConsumerStrategy
    authenticationUserA helper object used to configure simple authentiaction pluginorg.apache.activemq.security.AuthenticationUser
    authorizationEntryRepresents an entry in a {@link DefaultAuthorizationMap} for assigning -different operations (read, write, admin) of user roles to a specific -destination or a hierarchical wildcard area of destinations.org.apache.activemq.security.XBeanAuthorizationEntry
    authorizationMaporg.apache.activemq.security.XBeanAuthorizationMap
    authorizationPluginAn authorization plugin where each operation on a destination is checked -against an authorizationMaporg.apache.activemq.security.AuthorizationPlugin
    axionJDBCAdapterAxion specific Adapter. - -Axion does not seem to support ALTER statements or sub-selects. This means: -- We cannot auto upgrade the schema was we roll out new versions of ActiveMQ -- We cannot delete durable sub messages that have be acknowledged by all consumers.org.apache.activemq.store.jdbc.adapter.AxionJDBCAdapter
    blobJDBCAdapterThis JDBCAdapter inserts and extracts BLOB data using the getBlob()/setBlob() -operations. This is a little more involved since to insert a blob you have -to: - -1: insert empty blob. 2: select the blob 3: finally update the blob with data -value. - -The databases/JDBC drivers that use this adapter are: -
      -
    • -
    org.apache.activemq.store.jdbc.adapter.BlobJDBCAdapter
    brokerAn ActiveMQ Message Broker. It consists of a number of transport -connectors, network connectors and a bunch of properties which can be used to -configure the broker as its lazily created.org.apache.activemq.xbean.XBeanBrokerService
    brokerServiceManages the life-cycle of an ActiveMQ Broker. A BrokerService consists of a -number of transport connectors, network connectors and a bunch of properties -which can be used to configure the broker as its lazily created.org.apache.activemq.broker.BrokerService
    bytesJDBCAdapterThis JDBCAdapter inserts and extracts BLOB data using the -setBytes()/getBytes() operations. The databases/JDBC drivers that use this -adapter are:org.apache.activemq.store.jdbc.adapter.BytesJDBCAdapter
    cachedLDAPAuthorizationMapA {@link DefaultAuthorizationMap} implementation which uses LDAP to initialize and update authorization -policy.org.apache.activemq.security.CachedLDAPAuthorizationMap
    cachedMessageGroupMapFactoryA factory to create instances of {@link org.apache.activemq.broker.region.group.CachedMessageGroupMap} when implementing the -Message Groups functionality.org.apache.activemq.broker.region.group.CachedMessageGroupMapFactory
    compositeDemandForwardingBridgeA demand forwarding bridge which works with multicast style transports where -a single Transport could be communicating with multiple remote brokersorg.apache.activemq.network.CompositeDemandForwardingBridge
    compositeQueueRepresents a virtual queue which forwards to a number of other destinations.org.apache.activemq.broker.region.virtual.CompositeQueue
    compositeTopicRepresents a virtual topic which forwards to a number of other destinations.org.apache.activemq.broker.region.virtual.CompositeTopic
    conditionalNetworkBridgeFilterFactoryimplement conditional behavior for queue consumers, allows replaying back to -origin if no consumers are present on the local broker after a configurable -delay, irrespective of the TTL. Also allows rate limiting of messages -through the network, useful for static includesorg.apache.activemq.network.ConditionalNetworkBridgeFilterFactory
    connectionDotFilePluginA DOT file creator plugin which -creates a DOT file showing the current connectionsorg.apache.activemq.broker.view.ConnectionDotFilePlugin
    connectionFactoryA Spring enhanced connection -factory which will automatically use the Spring bean name as the clientIDPrefix property -so that connections created have client IDs related to your Spring.xml file for -easier comprehension from JMX.org.apache.activemq.spring.ActiveMQConnectionFactory
    constantPendingMessageLimitStrategyThis PendingMessageLimitStrategy is configured to a constant value for all subscriptions.org.apache.activemq.broker.region.policy.ConstantPendingMessageLimitStrategy
    database-lockerRepresents an exclusive lock on a database to avoid multiple brokers running -against the same logical database.org.apache.activemq.store.jdbc.DefaultDatabaseLocker
    db2JDBCAdapterorg.apache.activemq.store.jdbc.adapter.DB2JDBCAdapter
    defaultIOExceptionHandlerorg.apache.activemq.util.DefaultIOExceptionHandler
    defaultJDBCAdapterImplements all the default JDBC operations that are used by the JDBCPersistenceAdapter.

    sub-classing is -encouraged to override the default implementation of methods to account for differences in JDBC Driver -implementations.

    The JDBCAdapter inserts and extracts BLOB data using the getBytes()/setBytes() operations.

    -The databases/JDBC drivers that use this adapter are: -

      -
    • -
    org.apache.activemq.store.jdbc.adapter.DefaultJDBCAdapter
    defaultNetworkBridgeFilterFactoryimplement default behavior, filter that will not allow re-send to origin -based on brokerPath and which respects networkTTLorg.apache.activemq.network.DefaultNetworkBridgeFilterFactory
    defaultUsageCapacityIdentify if a limit has been reachedorg.apache.activemq.usage.DefaultUsageCapacity
    demandForwardingBridgeForwards messages from the local broker to the remote broker based on demand.org.apache.activemq.network.DemandForwardingBridge
    destinationDotFilePluginA DOT -file creator plugin which creates a DOT file showing the current topic & queue hierarchies.org.apache.activemq.broker.view.DestinationDotFilePlugin
    destinationEntryA default entry in a DestinationMap which holds a single value.org.apache.activemq.filter.DefaultDestinationMapEntry
    destinationPathSeparatorPluginorg.apache.activemq.broker.util.DestinationPathSeparatorBroker
    discardingDead Letter Strategy that discards all messagesorg.apache.activemq.broker.region.policy.DiscardingDeadLetterStrategy
    discardingDLQBrokerPluginorg.apache.activemq.plugin.DiscardingDLQBrokerPlugin
    fileCursorPending messagesorg.apache.activemq.broker.region.policy.FilePendingSubscriberMessageStoragePolicy
    fileDurableSubscriberCursorPending messages for durable subscribersorg.apache.activemq.broker.region.policy.FilePendingDurableSubscriberMessageStoragePolicy
    fileQueueCursorPendingorg.apache.activemq.broker.region.policy.FilePendingQueueMessageStoragePolicy
    filteredDestinationRepresents a destination which is filtered using some predicate such as a selector -so that messages are only dispatched to the destination if they match the filter.org.apache.activemq.broker.region.virtual.FilteredDestination
    filteredKahaDBorg.apache.activemq.store.kahadb.FilteredKahaDBPersistenceAdapter
    fixedCountSubscriptionRecoveryPolicyThis implementation of {@link SubscriptionRecoveryPolicy} will keep a fixed -count of last messages.org.apache.activemq.broker.region.policy.FixedCountSubscriptionRecoveryPolicy
    fixedSizedSubscriptionRecoveryPolicyThis implementation of {@link SubscriptionRecoveryPolicy} will keep a fixed -amount of memory available in RAM for message history which is evicted in -time order.org.apache.activemq.broker.region.policy.FixedSizedSubscriptionRecoveryPolicy
    forcePersistencyModeBrokerA Plugin which allows to force every incoming message to be PERSISTENT or NON-PERSISTENT. - -Useful, if you have set the broker usage policy to process ONLY persistent or ONLY non-persistent -messages.org.apache.activemq.plugin.ForcePersistencyModeBroker
    forcePersistencyModeBrokerPluginA Plugin which allows to force every incoming message to be PERSISTENT or NON-PERSISTENT. - -Useful, if you have set the broker usage policy to process ONLY persistent or ONLY non-persistent -messages.org.apache.activemq.plugin.ForcePersistencyModeBrokerPlugin
    forwardingBridgeForwards all messages from the local broker to the remote broker.org.apache.activemq.network.ForwardingBridge
    hsqldb-jdbc-adapterorg.apache.activemq.store.jdbc.adapter.HsqldbJDBCAdapter
    imageBasedJDBCAdaptorProvides JDBCAdapter since that uses -IMAGE datatype to hold binary data. - -The databases/JDBC drivers that use this adapter are: -
      -
    • Sybase
    • -
    • MS SQL
    • -
    org.apache.activemq.store.jdbc.adapter.ImageBasedJDBCAdaptor
    inboundQueueBridgeCreate an Inbound Queue Bridge. By default this class uses the sname name for -both the inbound and outbound queue. This behavior can be overridden however -by using the setter methods to configure both the inbound and outboud queue names -separately.org.apache.activemq.network.jms.InboundQueueBridge
    inboundTopicBridgeCreate an Inbound Topic Bridge. By default this class uses the topic name for -both the inbound and outbound topic. This behavior can be overridden however -by using the setter methods to configure both the inbound and outboud topic names -separately.org.apache.activemq.network.jms.InboundTopicBridge
    individualDeadLetterStrategyA {@link DeadLetterStrategy} where each destination has its own individual -DLQ using the subject naming hierarchy.org.apache.activemq.broker.region.policy.IndividualDeadLetterStrategy
    informixJDBCAdapterJDBC Adapter for Informix database. -Because Informix database restricts length of composite primary keys, length of -container name field and subscription id field must be reduced to 150 characters. -Therefore be sure not to use longer names for container name and subscription id than 150 characters.org.apache.activemq.store.jdbc.adapter.InformixJDBCAdapter
    jDBCIOExceptionHandlerorg.apache.activemq.store.jdbc.JDBCIOExceptionHandler
    jaasAuthenticationPluginProvides a JAAS based authentication pluginorg.apache.activemq.security.JaasAuthenticationPlugin
    jaasCertificateAuthenticationPluginProvides a JAAS based SSL certificate authentication pluginorg.apache.activemq.security.JaasCertificateAuthenticationPlugin
    jaasDualAuthenticationPluginProvides a JAAS based authentication pluginorg.apache.activemq.security.JaasDualAuthenticationPlugin
    jdbcPersistenceAdapterA {@link PersistenceAdapter} implementation using JDBC for persistence -storage. - -This persistence adapter will correctly remember prepared XA transactions, -but it will not keep track of local transaction commits so that operations -performed against the Message store are done as a single uow.org.apache.activemq.store.jdbc.JDBCPersistenceAdapter
    jmsQueueConnectorA Bridge to other JMS Queue providersorg.apache.activemq.network.jms.JmsQueueConnector
    jmsTopicConnectorA Bridge to other JMS Topic providersorg.apache.activemq.network.jms.JmsTopicConnector
    jobSchedulerUsageUsed to keep track of how much of something is being used so that a -productive working set usage can be controlled. Main use case is manage -memory usage.org.apache.activemq.usage.JobSchedulerUsage
    journalPersistenceAdapterAn implementation of {@link PersistenceAdapter} designed for use with a -{@link Journal} and then check pointing asynchronously on a timeout with some -other long term persistent storage.org.apache.activemq.store.journal.JournalPersistenceAdapter
    journalPersistenceAdapterFactoryFactory class that can create PersistenceAdapter objects.org.apache.activemq.store.journal.JournalPersistenceAdapterFactory
    journaledJDBCCreates a default persistence model using the Journal and JDBCorg.apache.activemq.store.PersistenceAdapterFactoryBean
    kahaDBAn implementation of {@link PersistenceAdapter} designed for use with -KahaDB - Embedded Lightweight Non-Relational Databaseorg.apache.activemq.store.kahadb.KahaDBPersistenceAdapter
    lDAPAuthorizationMapAn {@link AuthorizationMap} which uses LDAPorg.apache.activemq.security.LDAPAuthorizationMap
    lastImageSubscriptionRecoveryPolicyThis implementation of {@link SubscriptionRecoveryPolicy} will only keep the -last message.org.apache.activemq.broker.region.policy.LastImageSubscriptionRecoveryPolicy
    ldapNetworkConnectorclass to create dynamic network connectors listed in an directory server -using the LDAP v3 protocol as defined in RFC 2251, the entries listed in the -directory server must implement the ipHost and ipService objectClasses as -defined in RFC 2307.org.apache.activemq.network.LdapNetworkConnector
    lease-database-lockerRepresents an exclusive lease on a database to avoid multiple brokers running -against the same logical database.org.apache.activemq.store.jdbc.LeaseDatabaseLocker
    levelDBAn implementation of {@link org.apache.activemq.store.PersistenceAdapter} designed for use with -LevelDB - Embedded Lightweight Non-Relational Databaseorg.apache.activemq.store.leveldb.LevelDBPersistenceAdapter
    loggingBrokerPluginA simple Broker intercepter which allows you to enable/disable logging.org.apache.activemq.broker.util.LoggingBrokerPlugin
    mKahaDBAn implementation of {@link org.apache.activemq.store.PersistenceAdapter} that supports -distribution of destinations across multiple kahaDB persistence adaptersorg.apache.activemq.store.kahadb.MultiKahaDBPersistenceAdapter
    managementContextAn abstraction over JMX mbean registrationorg.apache.activemq.broker.jmx.ManagementContext
    maxdb-jdbc-adapterJDBC Adapter for the MaxDB database.org.apache.activemq.store.jdbc.adapter.MaxDBJDBCAdapter
    memoryPersistenceAdapterorg.apache.activemq.store.memory.MemoryPersistenceAdapter
    memoryUsageUsed to keep track of how much of something is being used so that a -productive working set usage can be controlled. Main use case is manage -memory usage.org.apache.activemq.usage.MemoryUsage
    messageGroupHashBucketFactoryA factory to create instances of {@link SimpleMessageGroupMap} when -implementing the Message -Groups functionality.org.apache.activemq.broker.region.group.MessageGroupHashBucketFactory
    mirroredQueueCreates Mirrored -Queue using a prefix and postfix to define the topic name on which to mirror the queue to.org.apache.activemq.broker.region.virtual.MirroredQueue
    multicastNetworkConnectorA network connector which uses some kind of multicast-like transport that -communicates with potentially many remote brokers over a single logical -{@link Transport} instance such as when using multicast. - -This implementation does not depend on multicast at all; any other group -based transport could be used.org.apache.activemq.network.MulticastNetworkConnector
    multicastTraceBrokerPluginA Broker interceptor which allows you to trace all operations to a Multicast -socket.org.apache.activemq.broker.util.MulticastTraceBrokerPlugin
    mysql-jdbc-adapterorg.apache.activemq.store.jdbc.adapter.MySqlJDBCAdapter
    networkConnectorA network connector which uses a discovery agent to detect the remote brokers -available and setup a connection to each available remote brokerorg.apache.activemq.network.DiscoveryNetworkConnector
    noSubscriptionRecoveryPolicyThis SubscriptionRecoveryPolicy disable recovery of messages.org.apache.activemq.broker.region.policy.NoSubscriptionRecoveryPolicy
    oldestMessageEvictionStrategyAn eviction strategy which evicts the oldest message first (which is the -default).org.apache.activemq.broker.region.policy.OldestMessageEvictionStrategy
    oldestMessageWithLowestPriorityEvictionStrategyAn eviction strategy which evicts the oldest message with the lowest priority first.org.apache.activemq.broker.region.policy.OldestMessageWithLowestPriorityEvictionStrategy
    oracleBlobJDBCAdapterImplements all the default JDBC operations that are used -by the JDBCPersistenceAdapter. -

    -Subclassing is encouraged to override the default -implementation of methods to account for differences -in JDBC Driver implementations. -

    -The JDBCAdapter inserts and extracts BLOB data using the -getBytes()/setBytes() operations. -

    -The databases/JDBC drivers that use this adapter are: -

      -
    • -
    org.apache.activemq.store.jdbc.adapter.OracleBlobJDBCAdapter
    oracleJDBCAdapterImplements all the default JDBC operations that are used -by the JDBCPersistenceAdapter. -

    -Subclassing is encouraged to override the default -implementation of methods to account for differences -in JDBC Driver implementations. -

    org.apache.activemq.store.jdbc.adapter.OracleJDBCAdapter
    outboundQueueBridgeCreate an Outbound Queue Bridge. By default the bridge uses the same -name for both the inbound and outbound queues, however this can be altered -by using the public setter methods to configure both inbound and outbound -queue names.org.apache.activemq.network.jms.OutboundQueueBridge
    outboundTopicBridgeCreate an Outbound Topic Bridge. By default the bridge uses the same -name for both the inbound and outbound topics, however this can be altered -by using the public setter methods to configure both inbound and outbound -topic names.org.apache.activemq.network.jms.OutboundTopicBridge
    pListStoreImplorg.apache.activemq.store.kahadb.plist.PListStoreImpl
    partitionBrokerPluginA BrokerPlugin which partitions client connections over a cluster of brokers.org.apache.activemq.partition.PartitionBrokerPlugin
    policyEntryRepresents an entry in a {@link PolicyMap} for assigning policies to a -specific destination or a hierarchical wildcard area of destinations.org.apache.activemq.broker.region.policy.PolicyEntry
    policyMapRepresents a destination based configuration of policies so that individual -destinations or wildcard hierarchies of destinations can be configured using -different policies.org.apache.activemq.broker.region.policy.PolicyMap
    pooledConnectionFactorySimple factory bean used to create a jencks connection pool. -Depending on the properties set, it will create a simple pool, -a transaction aware connection pool, or a jca aware connection pool. - -
    -
    -  
    -  
    -  
    -
    -
    - -The resourceName property should be used along with the {@link org.apache.activemq.jms.pool.GenericResourceManager} and have -the same value than its resourceName property. This will make sure the transaction manager -maps correctly the connection factory to the recovery process.
    org.apache.activemq.pool.PooledConnectionFactoryBean
    postgresql-jdbc-adapterImplements all the default JDBC operations that are used -by the JDBCPersistenceAdapter. -

    -Subclassing is encouraged to override the default -implementation of methods to account for differences -in JDBC Driver implementations. -

    -The JDBCAdapter inserts and extracts BLOB data using the -getBytes()/setBytes() operations. -

    -The databases/JDBC drivers that use this adapter are: -

      -
    • -
    org.apache.activemq.store.jdbc.adapter.PostgresqlJDBCAdapter
    prefetchPolicyDefines the prefetch message policies for different types of consumersorg.apache.activemq.ActiveMQPrefetchPolicy
    prefetchRatePendingMessageLimitStrategyThis PendingMessageLimitStrategy sets the maximum pending message limit value to be -a multiplier of the prefetch limit of the subscription.org.apache.activemq.broker.region.policy.PrefetchRatePendingMessageLimitStrategy
    priorityDispatchPolicyPriority dispatch policy that sends a message to every subscription that -matches the message in consumer priority order.org.apache.activemq.broker.region.policy.PriorityDispatchPolicy
    priorityNetworkDispatchPolicydispatch policy that ignores lower priority duplicate network consumers, -used in conjunction with network bridge suppresDuplicateTopicSubscriptionsorg.apache.activemq.broker.region.policy.PriorityNetworkDispatchPolicy
    proxyConnectororg.apache.activemq.proxy.ProxyConnector
    publishedAddressPolicyPolicy object that controls how a TransportConnector publishes the connector's -address to the outside world. By default the connector will publish itself -using the resolved host name of the bound server socket.org.apache.activemq.broker.PublishedAddressPolicy
    queryBasedSubscriptionRecoveryPolicyThis implementation of {@link SubscriptionRecoveryPolicy} will perform a user -specific query mechanism to load any messages they may have missed.org.apache.activemq.broker.region.policy.QueryBasedSubscriptionRecoveryPolicy
    queueAn ActiveMQ Queueorg.apache.activemq.command.ActiveMQQueue
    queueDispatchSelectorQueue dispatch policy that determines if a message can be sent to a subscriptionorg.apache.activemq.broker.region.QueueDispatchSelector
    reconnectionPolicyA policy object that defines how a {@link JmsConnector} deals with -reconnection of the local and foreign connections.org.apache.activemq.network.jms.ReconnectionPolicy
    redeliveryPluginReplace regular DLQ handling with redelivery via a resend to the original destination -after a delay -A destination matching RedeliveryPolicy controls the quantity and delay for re-sends -If there is no matching policy or an existing policy limit is exceeded by default -regular DLQ processing resumes. This is controlled via sendToDlqIfMaxRetriesExceeded -and fallbackToDeadLetterorg.apache.activemq.broker.util.RedeliveryPlugin
    redeliveryPolicyConfiguration options for a messageConsumer used to control how messages are re-delivered when they -are rolled back. -May be used server side on a per destination basis via the Broker RedeliveryPluginorg.apache.activemq.RedeliveryPolicy
    redeliveryPolicyMapRepresents a destination based configuration of policies so that individual -destinations or wildcard hierarchies of destinations can be configured using -different policies.org.apache.activemq.broker.region.policy.RedeliveryPolicyMap
    replicatedLevelDBAn implementation of {@link org.apache.activemq.store.PersistenceAdapter} designed for use with -LevelDB - Embedded Lightweight Non-Relational Databaseorg.apache.activemq.store.leveldb.ReplicatedLevelDBPersistenceAdapter
    roundRobinDispatchPolicySimple dispatch policy that sends a message to every subscription that -matches the message.org.apache.activemq.broker.region.policy.RoundRobinDispatchPolicy
    runtimeConfigurationPluginBroker plugin that will monitor the broker xml configuration for -changes and selectively apply those changes to the running broker.org.apache.activemq.plugin.RuntimeConfigurationPlugin
    shared-file-lockerRepresents an exclusive lock on a database to avoid multiple brokers running -against the same logical database.org.apache.activemq.store.SharedFileLocker
    sharedDeadLetterStrategyA default implementation of {@link DeadLetterStrategy} which uses -a constant destination.org.apache.activemq.broker.region.policy.SharedDeadLetterStrategy
    simpleAuthenticationPluginProvides a simple authentication pluginorg.apache.activemq.security.SimpleAuthenticationPlugin
    simpleAuthorizationMapAn AuthorizationMap which is configured with individual DestinationMaps for -each operation.org.apache.activemq.security.SimpleAuthorizationMap
    simpleDispatchPolicySimple dispatch policy that sends a message to every subscription that -matches the message.org.apache.activemq.broker.region.policy.SimpleDispatchPolicy
    simpleDispatchSelectorSimple dispatch policy that determines if a message can be sent to a subscriptionorg.apache.activemq.broker.region.policy.SimpleDispatchSelector
    simpleJmsMessageConvertorConverts Message from one JMS to anotherorg.apache.activemq.network.jms.SimpleJmsMessageConvertor
    simpleMessageGroupMapFactoryA factory to create instances of {@link SimpleMessageGroupMap} when implementing the -Message Groups functionality.org.apache.activemq.broker.region.group.SimpleMessageGroupMapFactory
    sslContextExtends the SslContext so that it's easier to configure from spring.org.apache.activemq.spring.SpringSslContext
    statementsorg.apache.activemq.store.jdbc.Statements
    statisticsBrokerPluginA StatisticsBrokerPlugin -You can retrieve a Map Message for a Destination - or -Broker containing statistics as key-value pairs The message must contain a -replyTo Destination - else its ignored -To retrieve stats on the broker send a empty message to ActiveMQ.Statistics.Broker (Queue or Topic) -With a replyTo set to the destination you want the stats returned to. -To retrieve stats for a destination - e.g. foo - send an empty message to ActiveMQ.Statistics.Destination.foo -- this works with wildcards to - you get a message for each wildcard match on the replyTo destination. -The stats message is a MapMessage populated with statistics for the targetorg.apache.activemq.plugin.StatisticsBrokerPlugin
    storeCursorPending messagesorg.apache.activemq.broker.region.policy.StorePendingQueueMessageStoragePolicy
    storeDurableSubscriberCursorPending messages for a durableorg.apache.activemq.broker.region.policy.StorePendingDurableSubscriberMessageStoragePolicy
    storeUsageUsed to keep track of how much of something is being used so that a -productive working set usage can be controlled. Main use case is manage -memory usage.org.apache.activemq.usage.StoreUsage
    streamJDBCAdapterThis JDBCAdapter inserts and extracts BLOB data using the -setBinaryStream()/getBinaryStream() operations. - -The databases/JDBC drivers that use this adapter are: -
      -
    • Axion
    • -
    org.apache.activemq.store.jdbc.adapter.StreamJDBCAdapter
    strictOrderDispatchPolicyDispatch policy that causes every subscription to see messages in the same -order.org.apache.activemq.broker.region.policy.StrictOrderDispatchPolicy
    sybase-jdbc-adapterA JDBC Adapter for Sybase databasesorg.apache.activemq.store.jdbc.adapter.SybaseJDBCAdapter
    systemUsageHolder for Usage instances for memory, store and temp files Main use case is -manage memory usage.org.apache.activemq.usage.SystemUsage
    taskRunnerFactoryManages the thread pool for long running tasks. Long running tasks are not -always active but when they are active, they may need a few iterations of -processing for them to become idle. The manager ensures that each task is -processes but that no one task overtakes the system. This is kinda like -cooperative multitasking.org.apache.activemq.thread.TaskRunnerFactory
    tempDestinationAuthorizationEntryRepresents an entry in a {@link DefaultAuthorizationMap} for assigning -different operations (read, write, admin) of user roles to a temporary -destinationorg.apache.activemq.security.TempDestinationAuthorizationEntry
    tempQueueAn ActiveMQ Temporary Queue Destinationorg.apache.activemq.command.ActiveMQTempQueue
    tempTopicAn ActiveMQ Temporary Topic Destinationorg.apache.activemq.command.ActiveMQTempTopic
    tempUsageUsed to keep track of how much of something is being used so that a -productive working set usage can be controlled. Main use case is manage -memory usage.org.apache.activemq.usage.TempUsage
    timeStampingBrokerPluginA Broker interceptor which updates a JMS Client's timestamp on the message -with a broker timestamp. Useful when the clocks on client machines are known -to not be correct and you can only trust the time set on the broker machines. - -Enabling this plugin will break JMS compliance since the timestamp that the -producer sees on the messages after as send() will be different from the -timestamp the consumer will observe when he receives the message. This plugin -is not enabled in the default ActiveMQ configuration. - -2 new attributes have been added which will allow the administrator some override control -over the expiration time for incoming messages: - -Attribute 'zeroExpirationOverride' can be used to apply an expiration -time to incoming messages with no expiration defined (messages that would never expire) - -Attribute 'ttlCeiling' can be used to apply a limit to the expiration timeorg.apache.activemq.broker.util.TimeStampingBrokerPlugin
    timedSubscriptionRecoveryPolicyThis implementation of {@link SubscriptionRecoveryPolicy} will keep a timed -buffer of messages around in memory and use that to recover new -subscriptions.org.apache.activemq.broker.region.policy.TimedSubscriptionRecoveryPolicy
    topicAn ActiveMQ Topicorg.apache.activemq.command.ActiveMQTopic
    traceBrokerPathPluginThe TraceBrokerPathPlugin can be used in a network of Brokers. Each Broker -that has the plugin configured, will add it's brokerName to the content -of a JMS Property. If all Brokers have this property enabled, the path the -message actually took through the network can be seen in the defined property.org.apache.activemq.broker.util.TraceBrokerPathPlugin
    transact-database-lockerRepresents an exclusive lock on a database to avoid multiple brokers running -against the same logical database.org.apache.activemq.store.jdbc.adapter.TransactDatabaseLocker
    transact-jdbc-adapterA JDBC Adapter for Transact-SQL based databases such as SQL Server or Sybaseorg.apache.activemq.store.jdbc.adapter.TransactJDBCAdapter
    transportConnectororg.apache.activemq.broker.TransportConnector
    udpTraceBrokerPluginA Broker interceptor which allows you to trace all operations to a UDP -socket.org.apache.activemq.broker.util.UDPTraceBrokerPlugin
    uniquePropertyMessageEvictionStrategyAn eviction strategy which evicts the oldest message within messages with the same property valueorg.apache.activemq.broker.region.policy.UniquePropertyMessageEvictionStrategy
    usageCapacityIdentify if a limit has been reachedorg.apache.activemq.usage.UsageCapacity
    virtualDestinationInterceptorImplements Virtual Topics.org.apache.activemq.broker.region.virtual.VirtualDestinationInterceptor
    virtualSelectorCacheBrokerPluginA plugin which allows the caching of the selector from a subscription queue. -

    -This stops the build-up of unwanted messages, especially when consumers may -disconnect from time to time when using virtual destinations. -

    -This is influenced by code snippets developed by Maciej Rakowicz

    org.apache.activemq.plugin.SubQueueSelectorCacheBrokerPlugin
    virtualTopicCreates Virtual -Topics using a prefix and postfix. The virtual destination creates a -wildcard that is then used to look up all active queue subscriptions which -match.org.apache.activemq.broker.region.virtual.VirtualTopic
    vmCursorPending messages heldorg.apache.activemq.broker.region.policy.VMPendingSubscriberMessageStoragePolicy
    vmDurableCursorPendingorg.apache.activemq.broker.region.policy.VMPendingDurableSubscriberMessageStoragePolicy
    vmQueueCursorPending messagesorg.apache.activemq.broker.region.policy.VMPendingQueueMessageStoragePolicy
    xaConnectionFactoryA Spring enhanced XA connection -factory which will automatically use the Spring bean name as the clientIDPrefix property -so that connections created have client IDs related to your Spring.xml file for -easier comprehension from JMX.org.apache.activemq.spring.ActiveMQXAConnectionFactory
    - - -

    Element Detail

    -

    Element: abortSlowAckConsumerStrategy

    - - - - - - - - - - -
    AttributeTypeDescription
    abortConnectionxs:booleanabort the consumers connection rather than sending a stop command to the remote consumer
    checkPeriodxs:longtime in milliseconds between checks for slow subscriptions
    ignoreIdleConsumersxs:booleanReturns whether the strategy is configured to ignore consumers that are simply idle, i.e -consumers that have no pending acks (dispatch queue is empty).
    ignoreNetworkConsumersxs:booleanSets whether the strategy is configured to ignore consumers that are part of a network -connection to another broker. - -When configured to not ignore idle consumers this strategy acts not only on consumers -that are actually slow but also on any consumer that has not received any messages for -the maxTimeSinceLastAck. This allows for a way to evict idle consumers while also -aborting slow consumers however for a network subscription this can create a lot of -unnecessary churn and if the abort connection option is also enabled this can result -in the entire network connection being torn down and rebuilt for no reason.
    maxSlowCountxs:longnumber of times a subscription can be deemed slow before triggering abort -effect depends on dispatch rate as slow determination is done on dispatch
    maxSlowDurationxs:longtime in milliseconds that a sub can remain slow before triggering -an abort.
    maxTimeSinceLastAckxs:longGets the maximum time since last Ack before a subscription is considered to be slow.
    namexs:string
    - - - -
    ElementTypeDescription
    brokerServicedestinationPathSeparatorPlugin | forcePersistencyModeBroker | loggingBrokerPlugin | multicastTraceBrokerPlugin | redeliveryPlugin | timeStampingBrokerPlugin | traceBrokerPathPlugin | udpTraceBrokerPlugin
    -

    Element: abortSlowConsumerStrategy

    - - - - - - - -
    AttributeTypeDescription
    abortConnectionxs:booleanabort the consumers connection rather than sending a stop command to the remote consumer
    checkPeriodxs:longtime in milliseconds between checks for slow subscriptions
    maxSlowCountxs:longnumber of times a subscription can be deemed slow before triggering abort -effect depends on dispatch rate as slow determination is done on dispatch
    maxSlowDurationxs:longtime in milliseconds that a sub can remain slow before triggering -an abort.
    namexs:string
    - - - -
    ElementTypeDescription
    brokerServicedestinationPathSeparatorPlugin | forcePersistencyModeBroker | loggingBrokerPlugin | multicastTraceBrokerPlugin | redeliveryPlugin | timeStampingBrokerPlugin | traceBrokerPathPlugin | udpTraceBrokerPlugin
    -

    Element: authenticationUser

    - - - - - -
    AttributeTypeDescription
    groupsxs:string
    passwordxs:string
    usernamexs:string
    -

    Element: authorizationEntry

    - - - - - - - - - - -
    AttributeTypeDescription
    adminxs:string
    groupClassxs:string
    queuexs:stringA helper method to set the destination from a configuration file
    readxs:string
    tempQueuexs:boolean
    tempTopicxs:boolean
    topicxs:stringA helper method to set the destination from a configuration file
    writexs:string
    - - - - - - -
    ElementTypeDescription
    adminACLs(<spring:bean/>)*
    destinationqueue | tempQueue | tempTopic | topic
    readACLs(<spring:bean/>)*
    writeACLs(<spring:bean/>)*
    -

    Element: authorizationMap

    - - - -
    AttributeTypeDescription
    groupClassxs:string
    - - - - - - -
    ElementTypeDescription
    authorizationEntries(<spring:bean/>)*Sets the individual entries on the authorization map
    defaultEntryauthorizationEntry | tempDestinationAuthorizationEntry
    entries(<spring:bean/>)*A helper method to allow the destination map to be populated from a -dependency injection framework such as Spring
    tempDestinationAuthorizationEntrytempDestinationAuthorizationEntry
    -

    Element: authorizationPlugin

    - - - -
    ElementTypeDescription
    mapauthorizationMap | cachedLDAPAuthorizationMap | lDAPAuthorizationMap | simpleAuthorizationMap
    -

    Element: axionJDBCAdapter

    - - - - - -
    AttributeTypeDescription
    batchStatmentsxs:boolean
    maxRowsxs:integerthe max value for statement maxRows, used to limit jdbc queries
    useExternalMessageReferencesxs:boolean
    - - - -
    ElementTypeDescription
    statementsstatements
    -

    Element: blobJDBCAdapter

    - - - - - -
    AttributeTypeDescription
    batchStatmentsxs:boolean
    maxRowsxs:integerthe max value for statement maxRows, used to limit jdbc queries
    useExternalMessageReferencesxs:boolean
    - - - -
    ElementTypeDescription
    statementsstatements
    -

    Element: broker

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    AttributeTypeDescription
    advisorySupportxs:stringAllows the support of advisory messages to be disabled for performance -reasons.
    allowTempAutoCreationOnSendxs:booleanenable if temp destinations need to be propagated through a network when -advisorySupport==false. This is used in conjunction with the policy -gcInactiveDestinations for matching temps so they can get removed -when inactive
    brokerIdxs:string
    brokerNamexs:stringSets the name of this broker; which must be unique in the network
    brokerObjectNamexs:stringSets the JMX ObjectName for this broker
    cacheTempDestinationsxs:boolean
    consumerSystemUsagePortionxs:integer
    dataDirectoryxs:stringSets the directory in which the data files will be stored by default for -the JDBC and Journal persistence adaptors.
    dataDirectoryFilexs:stringSets the directory in which the data files will be stored by default for -the JDBC and Journal persistence adaptors.
    dedicatedTaskRunnerxs:boolean
    deleteAllMessagesOnStartupxs:stringSets whether or not all messages are deleted on startup - mostly only -useful for testing.
    enableStatisticsxs:booleanSets whether or not the Broker's services enable statistics or not.
    keepDurableSubsActivexs:boolean
    maxPurgedDestinationsPerSweepxs:integer
    mbeanInvocationTimeoutxs:longGets the time in Milliseconds that an invocation of an MBean method will wait before -failing. The default value is to wait forever (zero).
    monitorConnectionSplitsxs:boolean
    networkConnectorStartAsyncxs:boolean
    offlineDurableSubscriberTaskSchedulexs:long
    offlineDurableSubscriberTimeoutxs:long
    passiveSlavexs:stringGet the passiveSlave
    persistenceThreadPriorityxs:integer
    persistentxs:stringSets whether or not persistence is enabled or disabled.
    populateJMSXUserIDxs:booleanSets whether or not the broker should populate the JMSXUserID header.
    populateUserNameInMBeansxs:booleanShould MBeans that support showing the Authenticated User Name information have this -value filled in or not.
    producerSystemUsagePortionxs:integer
    restartAllowedxs:booleanSets if the broker allowed to restart on shutdown.
    schedulePeriodForDestinationPurgexs:integer
    schedulerDirectoryxs:string
    schedulerDirectoryFilexs:string
    schedulerSupportxs:string
    shutdownOnMasterFailurexs:boolean
    shutdownOnSlaveFailurexs:string
    splitSystemUsageForProducersConsumersxs:boolean
    startxs:booleanSets whether or not the broker is started along with the ApplicationContext it is defined within. -Normally you would want the broker to start up along with the ApplicationContext but sometimes when working -with JUnit tests you may wish to start and stop the broker explicitly yourself.
    startAsyncxs:boolean
    storeOpenWireVersionxs:integer
    supportFailOverxs:boolean
    systemExitOnShutdownxs:string
    systemExitOnShutdownExitCodexs:integer
    taskRunnerPriorityxs:integer
    timeBeforePurgeTempDestinationsxs:integer
    tmpDataDirectoryxs:string
    useAuthenticatedPrincipalForJMSXUserIDxs:boolean
    useJmxxs:stringSets whether or not the Broker's services should be exposed into JMX or -not.
    useLocalHostBrokerNamexs:boolean
    useLoggingForShutdownErrorsxs:booleanSets whether or not we should use commons-logging when reporting errors -when shutting down the broker
    useMirroredQueuesxs:booleanSets whether or not Mirrored -Queues should be supported by default if they have not been -explicitly configured.
    useShutdownHookxs:booleanSets whether or not we should use a shutdown handler to close down the -broker cleanly if the JVM is terminated. It is recommended you leave this -enabled.
    useTempMirroredQueuesxs:boolean
    useVirtualTopicsxs:booleanSets whether or not Virtual -Topics should be supported by default if they have not been -explicitly configured.
    vmConnectorURIxs:string
    waitForSlavexs:string
    waitForSlaveTimeoutxs:long
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ElementTypeDescription
    adminView<spring:bean/>Returns the administration view of the broker; used to create and destroy -resources such as queues and topics. Note this method returns null if JMX -is disabled.
    brokerContext<spring:bean/>
    consumerSystemUsagesystemUsage
    destinationFactory<spring:bean/>
    destinationInterceptors(mirroredQueue | virtualDestinationInterceptor)*Sets the destination interceptors to use
    destinationPolicypolicyMapSets the destination specific policies available either for exact -destinations or for wildcard areas of destinations.
    destinations(queue | tempQueue | tempTopic | topic)*Sets the destinations which should be loaded/created on startup
    ioExceptionHandlerdefaultIOExceptionHandler | jDBCIOExceptionHandleroverride the Default IOException handler, called when persistence adapter -has experiences File or JDBC I/O Exceptions
    jmsBridgeConnectors(jmsQueueConnector | jmsTopicConnector)*
    jobSchedulerStore<spring:bean/>
    managementContextmanagementContext
    messageAuthorizationPolicy<spring:bean/>Sets the policy used to decide if the current connection is authorized to -consume a given message
    networkConnectorURIs(<spring:bean/>)*
    networkConnectors(ldapNetworkConnector | multicastNetworkConnector | networkConnector)*Sets the network connectors which this broker will use to connect to -other brokers in a federated network
    persistenceAdapterjdbcPersistenceAdapter | journalPersistenceAdapter | kahaDB | levelDB | mKahaDB | memoryPersistenceAdapter | replicatedLevelDBSets the persistence adaptor implementation to use for this broker
    persistenceFactoryjournalPersistenceAdapterFactory | journaledJDBC
    persistenceTaskRunnerFactorytaskRunnerFactory
    plugins(authorizationPlugin | connectionDotFilePlugin | destinationDotFilePlugin | destinationPathSeparatorPlugin | discardingDLQBrokerPlugin | forcePersistencyModeBrokerPlugin | jaasAuthenticationPlugin | jaasCertificateAuthenticationPlugin | jaasDualAuthenticationPlugin | loggingBrokerPlugin | multicastTraceBrokerPlugin | partitionBrokerPlugin | redeliveryPlugin | runtimeConfigurationPlugin | simpleAuthenticationPlugin | statisticsBrokerPlugin | timeStampingBrokerPlugin | traceBrokerPathPlugin | udpTraceBrokerPlugin | virtualSelectorCacheBrokerPlugin)*Sets a number of broker plugins to install such as for security -authentication or authorization
    producerSystemUsagesystemUsage
    proxyConnectors(<spring:bean/>)*Sets the network connectors which this broker will use to connect to -other brokers in a federated network
    regionBrokerdestinationPathSeparatorPlugin | forcePersistencyModeBroker | loggingBrokerPlugin | multicastTraceBrokerPlugin | redeliveryPlugin | timeStampingBrokerPlugin | traceBrokerPathPlugin | udpTraceBrokerPlugin
    services(broker | brokerService | database-locker | forwardingBridge | inboundQueueBridge | inboundTopicBridge | jdbcPersistenceAdapter | jmsQueueConnector | jmsTopicConnector | jobSchedulerUsage | journalPersistenceAdapterFactory | journaledJDBC | kahaDB | ldapNetworkConnector | lease-database-locker | levelDB | mKahaDB | managementContext | memoryUsage | multicastNetworkConnector | networkConnector | outboundQueueBridge | outboundTopicBridge | pListStoreImpl | proxyConnector | replicatedLevelDB | shared-file-locker | storeUsage | systemUsage | tempUsage | transact-database-locker)*Sets the services associated with this broker.
    shutdownHooks(<spring:bean/>)*Sets hooks to be executed when broker shut down
    sslContextsslContext
    systemUsagesystemUsage
    taskRunnerFactorytaskRunnerFactory
    tempDataStorelevelDB | pListStoreImpl | replicatedLevelDB
    transportConnectorURIs(<spring:bean/>)*
    transportConnectors(transportConnector)*Sets the transport connectors which this broker will listen on for new -clients
    -

    Element: brokerService

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    AttributeTypeDescription
    advisorySupportxs:stringAllows the support of advisory messages to be disabled for performance -reasons.
    allowTempAutoCreationOnSendxs:booleanenable if temp destinations need to be propagated through a network when -advisorySupport==false. This is used in conjunction with the policy -gcInactiveDestinations for matching temps so they can get removed -when inactive
    brokerIdxs:string
    brokerNamexs:stringSets the name of this broker; which must be unique in the network
    brokerObjectNamexs:stringSets the JMX ObjectName for this broker
    cacheTempDestinationsxs:boolean
    consumerSystemUsagePortionxs:integer
    dataDirectoryxs:stringSets the directory in which the data files will be stored by default for -the JDBC and Journal persistence adaptors.
    dataDirectoryFilexs:stringSets the directory in which the data files will be stored by default for -the JDBC and Journal persistence adaptors.
    dedicatedTaskRunnerxs:boolean
    deleteAllMessagesOnStartupxs:stringSets whether or not all messages are deleted on startup - mostly only -useful for testing.
    enableStatisticsxs:booleanSets whether or not the Broker's services enable statistics or not.
    keepDurableSubsActivexs:boolean
    maxPurgedDestinationsPerSweepxs:integer
    mbeanInvocationTimeoutxs:longGets the time in Milliseconds that an invocation of an MBean method will wait before -failing. The default value is to wait forever (zero).
    monitorConnectionSplitsxs:boolean
    networkConnectorStartAsyncxs:boolean
    offlineDurableSubscriberTaskSchedulexs:long
    offlineDurableSubscriberTimeoutxs:long
    passiveSlavexs:stringGet the passiveSlave
    persistenceThreadPriorityxs:integer
    persistentxs:stringSets whether or not persistence is enabled or disabled.
    populateJMSXUserIDxs:booleanSets whether or not the broker should populate the JMSXUserID header.
    populateUserNameInMBeansxs:booleanShould MBeans that support showing the Authenticated User Name information have this -value filled in or not.
    producerSystemUsagePortionxs:integer
    restartAllowedxs:booleanSets if the broker allowed to restart on shutdown.
    schedulePeriodForDestinationPurgexs:integer
    schedulerDirectoryxs:string
    schedulerDirectoryFilexs:string
    schedulerSupportxs:string
    shutdownOnMasterFailurexs:boolean
    shutdownOnSlaveFailurexs:string
    splitSystemUsageForProducersConsumersxs:boolean
    startAsyncxs:boolean
    storeOpenWireVersionxs:integer
    supportFailOverxs:boolean
    systemExitOnShutdownxs:string
    systemExitOnShutdownExitCodexs:integer
    taskRunnerPriorityxs:integer
    timeBeforePurgeTempDestinationsxs:integer
    tmpDataDirectoryxs:string
    useAuthenticatedPrincipalForJMSXUserIDxs:boolean
    useJmxxs:stringSets whether or not the Broker's services should be exposed into JMX or -not.
    useLocalHostBrokerNamexs:boolean
    useLoggingForShutdownErrorsxs:booleanSets whether or not we should use commons-logging when reporting errors -when shutting down the broker
    useMirroredQueuesxs:booleanSets whether or not Mirrored -Queues should be supported by default if they have not been -explicitly configured.
    useShutdownHookxs:booleanSets whether or not we should use a shutdown handler to close down the -broker cleanly if the JVM is terminated. It is recommended you leave this -enabled.
    useTempMirroredQueuesxs:boolean
    useVirtualTopicsxs:booleanSets whether or not Virtual -Topics should be supported by default if they have not been -explicitly configured.
    vmConnectorURIxs:string
    waitForSlavexs:string
    waitForSlaveTimeoutxs:long
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ElementTypeDescription
    adminView<spring:bean/>Returns the administration view of the broker; used to create and destroy -resources such as queues and topics. Note this method returns null if JMX -is disabled.
    brokerContext<spring:bean/>
    consumerSystemUsagesystemUsage
    destinationFactory<spring:bean/>
    destinationInterceptors(mirroredQueue | virtualDestinationInterceptor)*Sets the destination interceptors to use
    destinationPolicypolicyMapSets the destination specific policies available either for exact -destinations or for wildcard areas of destinations.
    destinations(queue | tempQueue | tempTopic | topic)*Sets the destinations which should be loaded/created on startup
    ioExceptionHandlerdefaultIOExceptionHandler | jDBCIOExceptionHandleroverride the Default IOException handler, called when persistence adapter -has experiences File or JDBC I/O Exceptions
    jmsBridgeConnectors(jmsQueueConnector | jmsTopicConnector)*
    jobSchedulerStore<spring:bean/>
    managementContextmanagementContext
    messageAuthorizationPolicy<spring:bean/>Sets the policy used to decide if the current connection is authorized to -consume a given message
    networkConnectorURIs(<spring:bean/>)*
    networkConnectors(ldapNetworkConnector | multicastNetworkConnector | networkConnector)*Sets the network connectors which this broker will use to connect to -other brokers in a federated network
    persistenceAdapterjdbcPersistenceAdapter | journalPersistenceAdapter | kahaDB | levelDB | mKahaDB | memoryPersistenceAdapter | replicatedLevelDBSets the persistence adaptor implementation to use for this broker
    persistenceFactoryjournalPersistenceAdapterFactory | journaledJDBC
    persistenceTaskRunnerFactorytaskRunnerFactory
    plugins(authorizationPlugin | connectionDotFilePlugin | destinationDotFilePlugin | destinationPathSeparatorPlugin | discardingDLQBrokerPlugin | forcePersistencyModeBrokerPlugin | jaasAuthenticationPlugin | jaasCertificateAuthenticationPlugin | jaasDualAuthenticationPlugin | loggingBrokerPlugin | multicastTraceBrokerPlugin | partitionBrokerPlugin | redeliveryPlugin | runtimeConfigurationPlugin | simpleAuthenticationPlugin | statisticsBrokerPlugin | timeStampingBrokerPlugin | traceBrokerPathPlugin | udpTraceBrokerPlugin | virtualSelectorCacheBrokerPlugin)*Sets a number of broker plugins to install such as for security -authentication or authorization
    producerSystemUsagesystemUsage
    proxyConnectors(<spring:bean/>)*Sets the network connectors which this broker will use to connect to -other brokers in a federated network
    regionBrokerdestinationPathSeparatorPlugin | forcePersistencyModeBroker | loggingBrokerPlugin | multicastTraceBrokerPlugin | redeliveryPlugin | timeStampingBrokerPlugin | traceBrokerPathPlugin | udpTraceBrokerPlugin
    services(broker | brokerService | database-locker | forwardingBridge | inboundQueueBridge | inboundTopicBridge | jdbcPersistenceAdapter | jmsQueueConnector | jmsTopicConnector | jobSchedulerUsage | journalPersistenceAdapterFactory | journaledJDBC | kahaDB | ldapNetworkConnector | lease-database-locker | levelDB | mKahaDB | managementContext | memoryUsage | multicastNetworkConnector | networkConnector | outboundQueueBridge | outboundTopicBridge | pListStoreImpl | proxyConnector | replicatedLevelDB | shared-file-locker | storeUsage | systemUsage | tempUsage | transact-database-locker)*Sets the services associated with this broker.
    shutdownHooks(<spring:bean/>)*Sets hooks to be executed when broker shut down
    sslContextsslContext
    systemUsagesystemUsage
    taskRunnerFactorytaskRunnerFactory
    tempDataStorelevelDB | pListStoreImpl | replicatedLevelDB
    transportConnectorURIs(<spring:bean/>)*
    transportConnectors(transportConnector)*Sets the transport connectors which this broker will listen on for new -clients
    -

    Element: bytesJDBCAdapter

    - - - - - -
    AttributeTypeDescription
    batchStatmentsxs:boolean
    maxRowsxs:integerthe max value for statement maxRows, used to limit jdbc queries
    useExternalMessageReferencesxs:boolean
    - - - -
    ElementTypeDescription
    statementsstatements
    -

    Element: cachedLDAPAuthorizationMap

    - - - - - - - - - - - - - - - - - - - - - -
    AttributeTypeDescription
    adminPermissionGroupSearchFilterxs:string
    authenticationxs:string
    connectionPasswordxs:string
    connectionProtocolxs:string
    connectionURLxs:string
    connectionUsernamexs:string
    groupNameAttributexs:string
    groupObjectClassxs:string
    legacyGroupMappingxs:boolean
    permissionGroupMemberAttributexs:string
    queueSearchBasexs:string
    readPermissionGroupSearchFilterxs:string
    refreshDisabledxs:boolean
    refreshIntervalxs:integer
    tempSearchBasexs:string
    topicSearchBasexs:string
    userNameAttributexs:string
    userObjectClassxs:string
    writePermissionGroupSearchFilterxs:string
    -

    Element: cachedMessageGroupMapFactory

    - - - -
    AttributeTypeDescription
    cacheSizexs:integer
    -

    Element: compositeDemandForwardingBridge

    - - - - -
    AttributeTypeDescription
    createdByDuplexxs:boolean
    mbeanObjectNamexs:string
    - - - - - - - - - - - -
    ElementTypeDescription
    brokerServicebroker | brokerService
    configurationldapNetworkConnector | multicastNetworkConnector | networkConnector
    durableDestinations(queue | tempQueue | tempTopic | topic)*
    dynamicallyIncludedDestinations(queue | tempQueue | tempTopic | topic)*
    excludedDestinations(queue | tempQueue | tempTopic | topic)*
    localBroker<spring:bean/>
    networkBridgeListener<spring:bean/>
    remoteBroker<spring:bean/>
    staticallyIncludedDestinations(queue | tempQueue | tempTopic | topic)*
    -

    Element: compositeQueue

    - - - - - -
    AttributeTypeDescription
    copyMessagexs:booleanSets whether a copy of the message will be sent to each destination. -Defaults to true so that the forward destination is set as the -destination of the message
    forwardOnlyxs:booleanSets if the virtual destination is forward only (and so there is no -physical queue to match the virtual queue) or if there is also a physical -queue with the same name).
    namexs:stringSets the name of this composite destination
    - - - -
    ElementTypeDescription
    forwardTo(<spring:bean/>)*Sets the list of destinations to forward to
    -

    Element: compositeTopic

    - - - - - -
    AttributeTypeDescription
    copyMessagexs:booleanSets whether a copy of the message will be sent to each destination. -Defaults to true so that the forward destination is set as the -destination of the message
    forwardOnlyxs:booleanSets if the virtual destination is forward only (and so there is no -physical queue to match the virtual queue) or if there is also a physical -queue with the same name).
    namexs:stringSets the name of this composite destination
    - - - -
    ElementTypeDescription
    forwardTo(<spring:bean/>)*Sets the list of destinations to forward to
    -

    Element: conditionalNetworkBridgeFilterFactory

    - - - - - - -
    AttributeTypeDescription
    rateDurationxs:integer
    rateLimitxs:integer
    replayDelayxs:integer
    replayWhenNoConsumersxs:boolean
    -

    Element: connectionDotFilePlugin

    - - - -
    AttributeTypeDescription
    filexs:stringSets the destination file name to create the destination diagram
    -

    Element: connectionFactory

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    AttributeTypeDescription
    alwaysSessionAsyncxs:booleanIf this flag is not set then a separate thread is not used for dispatching messages for each Session in -the Connection. However, a separate thread is always used if there is more than one session, or the session -isn't in auto acknowledge or duplicates ok mode. By default this value is set to true and session dispatch -happens asynchronously.
    alwaysSyncSendxs:booleanSet true if always require messages to be sync sent
    auditDepthxs:integer
    auditMaximumProducerNumberxs:integer
    beanNamexs:string
    brokerURLxs:stringSets the connection -URL used to connect to the ActiveMQ broker.
    checkForDuplicatesxs:boolean
    clientIDxs:stringSets the JMS clientID to use for the created connection. Note that this -can only be used by one connection at once so generally its a better idea -to set the clientID on a Connection
    clientIDPrefixxs:stringSets the prefix used by autogenerated JMS Client ID values which are used -if the JMS client does not explicitly specify on.
    closeTimeoutxs:integerSets the timeout before a close is considered complete. Normally a -close() on a connection waits for confirmation from the broker; this -allows that operation to timeout to save the client hanging if there is -no broker
    connectionIDPrefixxs:stringSets the prefix used by connection id generator
    consumerFailoverRedeliveryWaitPeriodxs:long
    copyMessageOnSendxs:booleanShould a JMS message be copied to a new JMS Message object as part of the -send() method in JMS. This is enabled by default to be compliant with the -JMS specification. You can disable it if you do not mutate JMS messages -after they are sent for a performance boost
    disableTimeStampsByDefaultxs:booleanSets whether or not timestamps on messages should be disabled or not. If -you disable them it adds a small performance boost.
    dispatchAsyncxs:booleanEnables or disables the default setting of whether or not consumers have -their messages dispatched -synchronously or asynchronously by the broker. For non-durable -topics for example we typically dispatch synchronously by default to -minimize context switches which boost performance. However sometimes its -better to go slower to ensure that a single blocked consumer socket does -not block delivery to other consumers.
    exclusiveConsumerxs:booleanEnables or disables whether or not queue consumers should be exclusive or -not for example to preserve ordering when not using Message Groups
    maxThreadPoolSizexs:integer
    messagePrioritySupportedxs:boolean
    nestedMapAndListEnabledxs:booleanEnables/disables whether or not Message properties and MapMessage entries -support Nested -Structures of Map and List objects
    nonBlockingRedeliveryxs:booleanWhen true a MessageConsumer will not stop Message delivery before re-delivering Messages -from a rolled back transaction. This implies that message order will not be preserved and -also will result in the TransactedIndividualAck option to be enabled.
    objectMessageSerializationDeferedxs:booleanWhen an object is set on an ObjectMessage, the JMS spec requires the -object to be serialized by that set method. Enabling this flag causes the -object to not get serialized. The object may subsequently get serialized -if the message needs to be sent over a socket or stored to disk.
    optimizeAcknowledgexs:boolean
    optimizeAcknowledgeTimeOutxs:longThe max time in milliseconds between optimized ack batches
    optimizedAckScheduledAckIntervalxs:longGets the configured time interval that is used to force all MessageConsumers that have optimizedAcknowledge enabled -to send an ack for any outstanding Message Acks. By default this value is set to zero meaning that the consumers -will not do any background Message acknowledgment.
    optimizedMessageDispatchxs:booleanIf this flag is set then an larger prefetch limit is used - only -applicable for durable topic subscribers.
    passwordxs:stringSets the JMS password used for connections created from this factory
    producerWindowSizexs:integer
    sendAcksAsyncxs:boolean
    sendTimeoutxs:integer
    statsEnabledxs:boolean
    transactedIndividualAckxs:booleanwhen true, submit individual transacted acks immediately rather than with transaction completion. -This allows the acks to represent delivery status which can be persisted on rollback -Used in conjunction with org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter#setRewriteOnRedelivery(boolean) true
    useAsyncSendxs:booleanForces the use of Async Sends which -adds a massive performance boost; but means that the send() method will -return immediately whether the message has been sent or not which could -lead to message loss.
    useBeanNameAsClientIdPrefixxs:boolean
    useCompressionxs:booleanEnables the use of compression of the message bodies
    useDedicatedTaskRunnerxs:boolean
    useRetroactiveConsumerxs:booleanSets whether or not retroactive consumers are enabled. Retroactive -consumers allow non-durable topic subscribers to receive old messages -that were published before the non-durable subscriber started.
    userNamexs:stringSets the JMS userName used by connections created by this factory
    warnAboutUnstartedConnectionTimeoutxs:longEnables the timeout from a connection creation to when a warning is -generated if the connection is not properly started via -{@link Connection#start()} and a message is received by a consumer. It is -a very common gotcha to forget to start -the connection so this option makes the default case to create a -warning if the user forgets. To disable the warning just set the value to < -0 (say -1).
    watchTopicAdvisoriesxs:boolean
    - - - - - - - - - - - - - - - -
    ElementTypeDescription
    blobTransferPolicy<spring:bean/>Sets the policy used to describe how out-of-band BLOBs (Binary Large -OBjects) are transferred from producers to brokers to consumers
    clientIdGenerator<spring:bean/>
    clientInternalExceptionListener<spring:bean/>Allows an {@link ClientInternalExceptionListener} to be configured on the ConnectionFactory so that when this factory -is used by frameworks which don't expose the Connection such as Spring JmsTemplate, you can register -an exception listener. -

    Note: access to this clientInternalExceptionListener will not be serialized if it is associated with more than -on connection (as it will be if more than one connection is subsequently created by this connection factory)

    connectionIdGenerator<spring:bean/>
    exceptionListener<spring:bean/>Allows an {@link ExceptionListener} to be configured on the ConnectionFactory so that when this factory -is used by frameworks which don't expose the Connection such as Spring JmsTemplate, you can register -an exception listener. -

    Note: access to this exceptionLinstener will not be serialized if it is associated with more than -on connection (as it will be if more than one connection is subsequently created by this connection factory)

    prefetchPolicyprefetchPolicySets the prefetch -policy for consumers created by this connection.
    properties<spring:bean/>Get the properties from this instance for storing in JNDI
    redeliveryPolicyredeliveryPolicySets the global default redelivery policy to be used when a message is delivered -but the session is rolled back
    redeliveryPolicyMapredeliveryPolicyMapSets the global redelivery policy mapping to be used when a message is delivered -but the session is rolled back
    rejectedTaskHandler<spring:bean/>
    sessionTaskRunnertaskRunnerFactory
    transformer<spring:bean/>Sets the transformer used to transform messages before they are sent on -to the JMS bus or when they are received from the bus but before they are -delivered to the JMS client
    transportListener<spring:bean/>Allows a listener to be configured on the ConnectionFactory so that when this factory is used -with frameworks which don't expose the Connection such as Spring JmsTemplate, you can still register -a transport listener.
    -

    Element: constantPendingMessageLimitStrategy

    - - - -
    AttributeTypeDescription
    limitxs:integer
    -

    Element: database-locker

    - - - - - - - -
    AttributeTypeDescription
    createTablesOnStartupxs:boolean
    failIfLockedxs:boolean
    lockAcquireSleepIntervalxs:long
    namexs:string
    queryTimeoutxs:integer
    - - - - - - -
    ElementTypeDescription
    dataSource<spring:bean/>
    exceptionHandler<spring:bean/>
    lockablejdbcPersistenceAdapter | journalPersistenceAdapterFactory | journaledJDBC | kahaDB | levelDB | mKahaDB | replicatedLevelDB
    statementsstatements
    -

    Element: db2JDBCAdapter

    - - - - - -
    AttributeTypeDescription
    batchStatmentsxs:boolean
    maxRowsxs:integerthe max value for statement maxRows, used to limit jdbc queries
    useExternalMessageReferencesxs:boolean
    - - - -
    ElementTypeDescription
    statementsstatements
    -

    Element: defaultIOExceptionHandler

    - - - - - - - - - -
    AttributeTypeDescription
    ignoreAllErrorsxs:boolean
    ignoreNoSpaceErrorsxs:boolean
    ignoreSQLExceptionsxs:boolean
    noSpaceMessagexs:string
    resumeCheckSleepPeriodxs:long
    sqlExceptionMessagexs:string
    stopStartConnectorsxs:boolean
    - - - -
    ElementTypeDescription
    brokerServicebroker | brokerService
    -

    Element: defaultJDBCAdapter

    - - - - - -
    AttributeTypeDescription
    batchStatmentsxs:boolean
    maxRowsxs:integerthe max value for statement maxRows, used to limit jdbc queries
    useExternalMessageReferencesxs:boolean
    - - - -
    ElementTypeDescription
    statementsstatements
    -

    Element: defaultNetworkBridgeFilterFactory

    -

    Element: defaultUsageCapacity

    - - - -
    AttributeTypeDescription
    limitxs:long
    -

    Element: demandForwardingBridge

    - - - - -
    AttributeTypeDescription
    createdByDuplexxs:boolean
    mbeanObjectNamexs:string
    - - - - - - - - - - - -
    ElementTypeDescription
    brokerServicebroker | brokerService
    configurationldapNetworkConnector | multicastNetworkConnector | networkConnector
    durableDestinations(queue | tempQueue | tempTopic | topic)*
    dynamicallyIncludedDestinations(queue | tempQueue | tempTopic | topic)*
    excludedDestinations(queue | tempQueue | tempTopic | topic)*
    localBroker<spring:bean/>
    networkBridgeListener<spring:bean/>
    remoteBroker<spring:bean/>
    staticallyIncludedDestinations(queue | tempQueue | tempTopic | topic)*
    -

    Element: destinationDotFilePlugin

    - - - -
    AttributeTypeDescription
    filexs:stringSets the destination file name to create the destination diagram
    -

    Element: destinationEntry

    - - - - - - -
    AttributeTypeDescription
    queuexs:stringA helper method to set the destination from a configuration file
    tempQueuexs:boolean
    tempTopicxs:boolean
    topicxs:stringA helper method to set the destination from a configuration file
    - - - - -
    ElementTypeDescription
    destinationqueue | tempQueue | tempTopic | topic
    valueauthorizationEntry | destinationEntry | filteredKahaDB | policyEntry | redeliveryPolicy | tempDestinationAuthorizationEntry
    -

    Element: destinationPathSeparatorPlugin

    - - - -
    AttributeTypeDescription
    pathSeparatorxs:string
    - - - - -
    ElementTypeDescription
    adminConnectionContext<spring:bean/>
    nextdestinationPathSeparatorPlugin | forcePersistencyModeBroker | loggingBrokerPlugin | multicastTraceBrokerPlugin | redeliveryPlugin | timeStampingBrokerPlugin | traceBrokerPathPlugin | udpTraceBrokerPlugin
    -

    Element: discarding

    - - - - - -
    AttributeTypeDescription
    enableAuditxs:boolean
    processExpiredxs:boolean
    processNonPersistentxs:boolean
    - - - -
    ElementTypeDescription
    deadLetterQueuequeue | tempQueue | tempTopic | topic
    -

    Element: discardingDLQBrokerPlugin

    - - - - - - - -
    AttributeTypeDescription
    dropAllxs:boolean
    dropOnlyxs:string
    dropTemporaryQueuesxs:boolean
    dropTemporaryTopicsxs:boolean
    reportIntervalxs:integer
    -

    Element: fileCursor

    -

    Element: fileDurableSubscriberCursor

    -

    Element: fileQueueCursor

    -

    Element: filteredDestination

    - - - - - -
    AttributeTypeDescription
    queuexs:stringSets the destination property to the given queue name
    selectorxs:stringSets the JMS selector used to filter messages before forwarding them to this destination
    topicxs:stringSets the destination property to the given topic name
    - - - - -
    ElementTypeDescription
    destinationqueue | tempQueue | tempTopic | topicThe destination to send messages to if they match the filter
    filter<spring:bean/>
    -

    Element: filteredKahaDB

    - - - - - - - -
    AttributeTypeDescription
    perDestinationxs:boolean
    queuexs:stringA helper method to set the destination from a configuration file
    tempQueuexs:boolean
    tempTopicxs:boolean
    topicxs:stringA helper method to set the destination from a configuration file
    - - - - - -
    ElementTypeDescription
    adapterjdbcPersistenceAdapter | journalPersistenceAdapter | kahaDB | levelDB | mKahaDB | memoryPersistenceAdapter | replicatedLevelDB
    destinationqueue | tempQueue | tempTopic | topic
    persistenceAdapterjdbcPersistenceAdapter | journalPersistenceAdapter | kahaDB | levelDB | mKahaDB | memoryPersistenceAdapter | replicatedLevelDB
    -

    Element: fixedCountSubscriptionRecoveryPolicy

    - - - -
    AttributeTypeDescription
    maximumSizexs:integerSets the maximum number of messages that this destination will hold -around in RAM
    - - - -
    ElementTypeDescription
    brokerdestinationPathSeparatorPlugin | forcePersistencyModeBroker | loggingBrokerPlugin | multicastTraceBrokerPlugin | redeliveryPlugin | timeStampingBrokerPlugin | traceBrokerPathPlugin | udpTraceBrokerPlugin
    -

    Element: fixedSizedSubscriptionRecoveryPolicy

    - - - - -
    AttributeTypeDescription
    maximumSizexs:integerSets the maximum amount of RAM in bytes that this buffer can hold in RAM
    useSharedBufferxs:boolean
    - - - - -
    ElementTypeDescription
    brokerdestinationPathSeparatorPlugin | forcePersistencyModeBroker | loggingBrokerPlugin | multicastTraceBrokerPlugin | redeliveryPlugin | timeStampingBrokerPlugin | traceBrokerPathPlugin | udpTraceBrokerPlugin
    buffer<spring:bean/>
    -

    Element: forcePersistencyModeBroker

    - - - -
    AttributeTypeDescription
    persistenceFlagxs:boolean
    - - - - -
    ElementTypeDescription
    adminConnectionContext<spring:bean/>
    nextdestinationPathSeparatorPlugin | forcePersistencyModeBroker | loggingBrokerPlugin | multicastTraceBrokerPlugin | redeliveryPlugin | timeStampingBrokerPlugin | traceBrokerPathPlugin | udpTraceBrokerPlugin
    -

    Element: forcePersistencyModeBrokerPlugin

    - - - -
    AttributeTypeDescription
    persistenceFlagxs:booleanSets the persistency mode.
    -

    Element: forwardingBridge

    - - - - - - - -
    AttributeTypeDescription
    clientIdxs:string
    destinationFilterxs:string
    dispatchAsyncxs:boolean
    prefetchSizexs:integer
    useCompressionxs:boolean
    - - - - - -
    ElementTypeDescription
    localBroker<spring:bean/>
    networkBridgeFailedListener<spring:bean/>
    remoteBroker<spring:bean/>
    -

    Element: hsqldb-jdbc-adapter

    - - - - - -
    AttributeTypeDescription
    batchStatmentsxs:boolean
    maxRowsxs:integerthe max value for statement maxRows, used to limit jdbc queries
    useExternalMessageReferencesxs:boolean
    - - - -
    ElementTypeDescription
    statementsstatements
    -

    Element: imageBasedJDBCAdaptor

    - - - - - -
    AttributeTypeDescription
    batchStatmentsxs:boolean
    maxRowsxs:integerthe max value for statement maxRows, used to limit jdbc queries
    useExternalMessageReferencesxs:boolean
    - - - -
    ElementTypeDescription
    statementsstatements
    -

    Element: inboundQueueBridge

    - - - - - - -
    AttributeTypeDescription
    doHandleReplyToxs:boolean
    inboundQueueNamexs:stringSets the queue name used for the inbound queue, if the outbound queue -name has not been set, then this method uses the same name to configure -the outbound queue name.
    localQueueNamexs:string
    selectorxs:string
    - - - - - - - - - -
    ElementTypeDescription
    consumer<spring:bean/>
    consumerConnection<spring:bean/>
    consumerQueuequeue
    jmsConnectorjmsQueueConnector | jmsTopicConnector
    jmsMessageConvertorsimpleJmsMessageConvertor
    producerConnection<spring:bean/>
    producerQueuequeue
    -

    Element: inboundTopicBridge

    - - - - - - - -
    AttributeTypeDescription
    consumerNamexs:string
    doHandleReplyToxs:boolean
    inboundTopicNamexs:stringSets the topic name used for the inbound topic, if the outbound topic -name has not been set, then this method uses the same name to configure -the outbound topic name.
    localTopicNamexs:string
    selectorxs:string
    - - - - - - - - - -
    ElementTypeDescription
    consumer<spring:bean/>
    consumerConnection<spring:bean/>
    consumerTopictopic
    jmsConnectorjmsQueueConnector | jmsTopicConnector
    jmsMessageConvertorsimpleJmsMessageConvertor
    producerConnection<spring:bean/>
    producerTopictopic
    -

    Element: individualDeadLetterStrategy

    - - - - - - - - - - - - -
    AttributeTypeDescription
    destinationPerDurableSubscriberxs:booleansets whether durable topic subscriptions are to get individual dead letter destinations. -When true, the DLQ is of the form 'topicPrefix.clientId:subscriptionName' -The default is false.
    enableAuditxs:boolean
    processExpiredxs:boolean
    processNonPersistentxs:boolean
    queuePrefixxs:stringSets the prefix to use for all dead letter queues for queue messages
    queueSuffixxs:stringSets the suffix to use for all dead letter queues for queue messages
    topicPrefixxs:stringSets the prefix to use for all dead letter queues for topic messages
    topicSuffixxs:stringSets the suffix to use for all dead letter queues for topic messages
    useQueueForQueueMessagesxs:booleanSets whether a queue or topic should be used for queue messages sent to a -DLQ. The default is to use a Queue
    useQueueForTopicMessagesxs:booleanSets whether a queue or topic should be used for topic messages sent to a -DLQ. The default is to use a Queue
    -

    Element: informixJDBCAdapter

    - - - - - -
    AttributeTypeDescription
    batchStatmentsxs:boolean
    maxRowsxs:integerthe max value for statement maxRows, used to limit jdbc queries
    useExternalMessageReferencesxs:boolean
    - - - -
    ElementTypeDescription
    statementsstatements
    -

    Element: jDBCIOExceptionHandler

    - - - - - - - - - -
    AttributeTypeDescription
    ignoreAllErrorsxs:boolean
    ignoreNoSpaceErrorsxs:boolean
    ignoreSQLExceptionsxs:boolean
    noSpaceMessagexs:string
    resumeCheckSleepPeriodxs:long
    sqlExceptionMessagexs:string
    stopStartConnectorsxs:boolean
    - - - -
    ElementTypeDescription
    brokerServicebroker | brokerService
    -

    Element: jaasAuthenticationPlugin

    - - - - -
    AttributeTypeDescription
    configurationxs:stringSets the JAAS configuration domain name used
    discoverLoginConfigxs:booleanEnables or disables the auto-discovery of the login.config file for JAAS to initialize itself. -This flag is enabled by default such that if the java.security.auth.login.config system property -is not defined then it is set to the location of the login.config file on the classpath.
    -

    Element: jaasCertificateAuthenticationPlugin

    - - - - -
    AttributeTypeDescription
    configurationxs:stringSets the JAAS configuration domain name used
    discoverLoginConfigxs:booleanEnables or disables the auto-discovery of the login.config file for JAAS to initialize itself. -This flag is enabled by default such that if the java.security.auth.login.config system property -is not defined then it is set to the location of the login.config file on the classpath.
    -

    Element: jaasDualAuthenticationPlugin

    - - - - - -
    AttributeTypeDescription
    configurationxs:stringSets the JAAS configuration domain name used
    discoverLoginConfigxs:booleanEnables or disables the auto-discovery of the login.config file for JAAS to initialize itself. -This flag is enabled by default such that if the java.security.auth.login.config system property -is not defined then it is set to the location of the login.config file on the classpath.
    sslConfigurationxs:stringSet the JAAS SSL configuration domain
    -

    Element: jdbcPersistenceAdapter

    - - - - - - - - - - - - - - - - - - - - -
    AttributeTypeDescription
    auditRecoveryDepthxs:integer
    brokerNamexs:string
    changeAutoCommitAllowedxs:booleanWhether the JDBC driver allows to set the auto commit. -Some drivers does not allow changing the auto commit. The default value is true.
    cleanupPeriodxs:integerSets the number of milliseconds until the database is attempted to be -cleaned up for durable topics
    createTablesOnStartupxs:booleanSets whether or not tables are created on startup
    dataDirectoryxs:string
    dataDirectoryFilexs:string
    directoryxs:string
    enableAuditxs:boolean
    lockAcquireSleepIntervalxs:long
    lockKeepAlivePeriodxs:long
    maxAuditDepthxs:integer
    maxProducersToAuditxs:integer
    maxRowsxs:integer
    transactionIsolationxs:integerset the Transaction isolation level to something other that TRANSACTION_READ_UNCOMMITTED -This allowable dirty isolation level may not be achievable in clustered DB environments -so a more restrictive and expensive option may be needed like TRANSACTION_REPEATABLE_READ -see isolation level constants in {@link java.sql.Connection}
    useDatabaseLockxs:boolean
    useExternalMessageReferencesxs:boolean
    useLockxs:boolean
    - - - - - - - - - - - - - -
    ElementTypeDescription
    adapteraxionJDBCAdapter | blobJDBCAdapter | bytesJDBCAdapter | db2JDBCAdapter | defaultJDBCAdapter | hsqldb-jdbc-adapter | imageBasedJDBCAdaptor | informixJDBCAdapter | maxdb-jdbc-adapter | mysql-jdbc-adapter | oracleBlobJDBCAdapter | oracleJDBCAdapter | postgresql-jdbc-adapter | streamJDBCAdapter | sybase-jdbc-adapter | transact-jdbc-adapter
    brokerServicebroker | brokerService
    dataSource<spring:bean/>
    databaseLockerdatabase-locker | lease-database-locker | shared-file-locker | transact-database-lockerSets the database locker strategy to use to lock the database on startup
    ds<spring:bean/>
    lockDataSource<spring:bean/>
    lockerdatabase-locker | lease-database-locker | shared-file-locker | transact-database-locker
    scheduledThreadPoolExecutor<spring:bean/>
    statementsstatements
    usageManagersystemUsage
    wireFormat<spring:bean/>
    -

    Element: jmsQueueConnector

    - - - - - - - - - - - - - - - -
    AttributeTypeDescription
    jndiLocalTemplatexs:string
    jndiOutboundTemplatexs:string
    localClientIdxs:string
    localConnectionFactoryNamexs:string
    localPasswordxs:string
    localUsernamexs:string
    namexs:string
    outboundClientIdxs:string
    outboundPasswordxs:string
    outboundQueueConnectionFactoryNamexs:string
    outboundUsernamexs:string
    preferJndiDestinationLookupxs:booleanSets whether the connector should prefer to first try to find a destination in JNDI before -using JMS semantics to create a Destination. By default the connector will first use JMS -semantics and then fall-back to JNDI lookup, setting this value to true will reverse that -ordering.
    replyToDestinationCacheSizexs:integer
    - - - - - - - - - - - - -
    ElementTypeDescription
    brokerServicebroker | brokerServiceOne way to configure the local connection - this is called by The -BrokerService when the Connector is embedded
    inboundMessageConvertorsimpleJmsMessageConvertor
    inboundQueueBridges(inboundQueueBridge)*
    localQueueConnection<spring:bean/>
    localQueueConnectionFactoryconnectionFactory | xaConnectionFactory
    outboundMessageConvertorsimpleJmsMessageConvertor
    outboundQueueBridges(outboundQueueBridge)*
    outboundQueueConnection<spring:bean/>
    outboundQueueConnectionFactoryconnectionFactory | xaConnectionFactory
    reconnectionPolicyreconnectionPolicy
    -

    Element: jmsTopicConnector

    - - - - - - - - - - - - - - - -
    AttributeTypeDescription
    jndiLocalTemplatexs:string
    jndiOutboundTemplatexs:string
    localClientIdxs:string
    localConnectionFactoryNamexs:string
    localPasswordxs:string
    localUsernamexs:string
    namexs:string
    outboundClientIdxs:string
    outboundPasswordxs:string
    outboundTopicConnectionFactoryNamexs:string
    outboundUsernamexs:string
    preferJndiDestinationLookupxs:booleanSets whether the connector should prefer to first try to find a destination in JNDI before -using JMS semantics to create a Destination. By default the connector will first use JMS -semantics and then fall-back to JNDI lookup, setting this value to true will reverse that -ordering.
    replyToDestinationCacheSizexs:integer
    - - - - - - - - - - - - -
    ElementTypeDescription
    brokerServicebroker | brokerServiceOne way to configure the local connection - this is called by The -BrokerService when the Connector is embedded
    inboundMessageConvertorsimpleJmsMessageConvertor
    inboundTopicBridges(inboundTopicBridge)*
    localTopicConnection<spring:bean/>
    localTopicConnectionFactoryconnectionFactory | xaConnectionFactory
    outboundMessageConvertorsimpleJmsMessageConvertor
    outboundTopicBridges(outboundTopicBridge)*
    outboundTopicConnection<spring:bean/>
    outboundTopicConnectionFactoryconnectionFactory | xaConnectionFactory
    reconnectionPolicyreconnectionPolicy
    -

    Element: jobSchedulerUsage

    - - - - - - - - -
    AttributeTypeDescription
    limitxs:stringSets the memory limit in bytes. Setting the limit in bytes will set the usagePortion to 0 since the UsageManager -is not going to be portion based off the parent. When set using Xbean, values of the form "20 Mb", "1024kb", and -"1g" can be used
    namexs:string
    percentUsagexs:integer
    percentUsageMinDeltaxs:stringSets the minimum number of percentage points the usage has to change before a UsageListener event is fired by the -manager.
    pollingTimexs:integer
    usagePortionxs:float
    - - - - - - -
    ElementTypeDescription
    executor<spring:bean/>
    limiterdefaultUsageCapacity | usageCapacity
    parent<spring:bean/>
    store<spring:bean/>
    -

    Element: journalPersistenceAdapter

    - - - - - - - -
    AttributeTypeDescription
    brokerNamexs:string
    directoryxs:string
    maxCheckpointMessageAddSizexs:integer
    maxCheckpointWorkersxs:integer
    useExternalMessageReferencesxs:boolean
    - - - - - - - - -
    ElementTypeDescription
    brokerServicebroker | brokerService
    journal<spring:bean/>
    longTermPersistencejdbcPersistenceAdapter | journalPersistenceAdapter | kahaDB | levelDB | mKahaDB | memoryPersistenceAdapter | replicatedLevelDB
    persistenceAdapterjdbcPersistenceAdapter | journalPersistenceAdapter | kahaDB | levelDB | mKahaDB | memoryPersistenceAdapter | replicatedLevelDB
    taskRunnerFactorytaskRunnerFactory
    usageManagersystemUsage
    -

    Element: journalPersistenceAdapterFactory

    - - - - - - - - - - - - - - - -
    AttributeTypeDescription
    createTablesOnStartupxs:booleanSets whether or not tables are created on startup
    dataDirectoryxs:string
    dataDirectoryFilexs:string
    journalArchiveDirectoryxs:string
    journalLogFileSizexs:stringSets the size of the journal log files -When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used
    journalLogFilesxs:integerSets the number of journal log files to use
    journalThreadPriorityxs:integerSets the thread priority of the journal thread
    lockKeepAlivePeriodxs:long
    useDatabaseLockxs:booleanSets whether or not an exclusive database lock should be used to enable -JDBC Master/Slave. Enabled by default.
    useDedicatedTaskRunnerxs:boolean
    useJournalxs:booleanEnables or disables the use of the journal. The default is to use the -journal
    useLockxs:boolean
    useQuickJournalxs:booleanEnables or disables the use of quick journal, which keeps messages in the -journal and just stores a reference to the messages in JDBC. Defaults to -false so that messages actually reside long term in the JDBC database.
    - - - - - - - - - - -
    ElementTypeDescription
    adapteraxionJDBCAdapter | blobJDBCAdapter | bytesJDBCAdapter | db2JDBCAdapter | defaultJDBCAdapter | hsqldb-jdbc-adapter | imageBasedJDBCAdaptor | informixJDBCAdapter | maxdb-jdbc-adapter | mysql-jdbc-adapter | oracleBlobJDBCAdapter | oracleJDBCAdapter | postgresql-jdbc-adapter | streamJDBCAdapter | sybase-jdbc-adapter | transact-jdbc-adapter
    brokerServicebroker | brokerService
    dataSource<spring:bean/>
    jdbcAdapterjdbcPersistenceAdapter
    journal<spring:bean/>
    lockerdatabase-locker | lease-database-locker | shared-file-locker | transact-database-locker
    statementsstatements
    taskRunnerFactorytaskRunnerFactory
    -

    Element: journaledJDBC

    - - - - - - - - - - - - - - - -
    AttributeTypeDescription
    createTablesOnStartupxs:booleanSets whether or not tables are created on startup
    dataDirectoryxs:string
    dataDirectoryFilexs:string
    journalArchiveDirectoryxs:string
    journalLogFileSizexs:stringSets the size of the journal log files -When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used
    journalLogFilesxs:integerSets the number of journal log files to use
    journalThreadPriorityxs:integerSets the thread priority of the journal thread
    lockKeepAlivePeriodxs:long
    useDatabaseLockxs:booleanSets whether or not an exclusive database lock should be used to enable -JDBC Master/Slave. Enabled by default.
    useDedicatedTaskRunnerxs:boolean
    useJournalxs:booleanEnables or disables the use of the journal. The default is to use the -journal
    useLockxs:boolean
    useQuickJournalxs:booleanEnables or disables the use of quick journal, which keeps messages in the -journal and just stores a reference to the messages in JDBC. Defaults to -false so that messages actually reside long term in the JDBC database.
    - - - - - - - - - - -
    ElementTypeDescription
    adapteraxionJDBCAdapter | blobJDBCAdapter | bytesJDBCAdapter | db2JDBCAdapter | defaultJDBCAdapter | hsqldb-jdbc-adapter | imageBasedJDBCAdaptor | informixJDBCAdapter | maxdb-jdbc-adapter | mysql-jdbc-adapter | oracleBlobJDBCAdapter | oracleJDBCAdapter | postgresql-jdbc-adapter | streamJDBCAdapter | sybase-jdbc-adapter | transact-jdbc-adapter
    brokerServicebroker | brokerService
    dataSource<spring:bean/>
    jdbcAdapterjdbcPersistenceAdapter
    journal<spring:bean/>
    lockerdatabase-locker | lease-database-locker | shared-file-locker | transact-database-locker
    statementsstatements
    taskRunnerFactorytaskRunnerFactory
    -

    Element: kahaDB

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    AttributeTypeDescription
    archiveCorruptedIndexxs:boolean
    archiveDataLogsxs:boolean
    brokerNamexs:string
    checkForCorruptJournalFilesxs:boolean
    checkpointIntervalxs:longGet the checkpointInterval
    checksumJournalFilesxs:boolean
    cleanupIntervalxs:longGet the cleanupInterval
    concurrentStoreAndDispatchQueuesxs:boolean
    concurrentStoreAndDispatchTopicsxs:boolean
    databaseLockedWaitDelayxs:integer
    directoryxs:stringGet the directory
    directoryArchivexs:string
    enableIndexDiskSyncsxs:boolean
    enableIndexPageCachingxs:boolean
    enableIndexRecoveryFilexs:boolean
    enableIndexWriteAsyncxs:booleanGet the enableIndexWriteAsync
    enableJournalDiskSyncsxs:booleanGet the enableJournalDiskSyncs
    failoverProducersAuditDepthxs:integerset the audit window depth for duplicate suppression (should exceed the max transaction -batch)
    forceRecoverIndexxs:boolean
    ignoreMissingJournalfilesxs:booleanGet the ignoreMissingJournalfiles
    indexCacheSizexs:stringGet the indexCacheSize
    indexLFUEvictionFactorxs:float
    indexWriteBatchSizexs:stringGet the indexWriteBatchSize
    journalMaxFileLengthxs:stringGet the journalMaxFileLength
    journalMaxWriteBatchSizexs:stringGet the journalMaxWriteBatchSize
    lockKeepAlivePeriodxs:long
    maxAsyncJobsxs:integer
    maxFailoverProducersToTrackxs:integerSet the max number of producers (LRU cache) to track for duplicate sends
    rewriteOnRedeliveryxs:booleanWhen true, persist the redelivery status such that the message redelivery flag can survive a broker failure -used with org.apache.activemq.ActiveMQConnectionFactory#setTransactedIndividualAck(boolean) true
    useIndexLFRUEvictionxs:boolean
    useLockxs:boolean
    - - - - - - -
    ElementTypeDescription
    brokerServicebroker | brokerService
    lockerdatabase-locker | lease-database-locker | shared-file-locker | transact-database-locker
    transactionIdTransformer<spring:bean/>
    usageManagersystemUsage
    -

    Element: lDAPAuthorizationMap

    - - - - - - - - - - - - - - - - - - - -
    AttributeTypeDescription
    adminAttributexs:string
    adminBasexs:string
    advisorySearchBasexs:string
    authenticationxs:string
    connectionPasswordxs:string
    connectionProtocolxs:string
    connectionURLxs:string
    connectionUsernamexs:string
    initialContextFactoryxs:string
    queueSearchSubtreeBoolxs:boolean
    readAttributexs:string
    readBasexs:string
    tempSearchBasexs:string
    topicSearchSubtreeBoolxs:boolean
    useAdvisorySearchBasexs:boolean
    writeAttributexs:string
    writeBasexs:string
    - - - - - - -
    ElementTypeDescription
    context<spring:bean/>
    options<spring:bean/>
    queueSearchMatchingFormat<spring:bean/>
    topicSearchMatchingFormat<spring:bean/>
    -

    Element: lastImageSubscriptionRecoveryPolicy

    - - - -
    ElementTypeDescription
    brokerdestinationPathSeparatorPlugin | forcePersistencyModeBroker | loggingBrokerPlugin | multicastTraceBrokerPlugin | redeliveryPlugin | timeStampingBrokerPlugin | traceBrokerPathPlugin | udpTraceBrokerPlugin
    -

    Element: ldapNetworkConnector

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    AttributeTypeDescription
    advisoryForFailedForwardxs:boolean
    alwaysSyncSendxs:boolean
    anonymousAuthenticationxs:booleansets LDAP anonymous authentication access credentials
    basexs:stringsets the base LDAP dn used for lookup operations
    bridgeTempDestinationsxs:boolean
    brokerNamexs:string
    brokerURLxs:string
    conduitSubscriptionsxs:boolean
    consumerPriorityBasexs:integer
    consumerTTLxs:integer
    decreaseNetworkConsumerPriorityxs:boolean
    destinationFilterxs:string
    dispatchAsyncxs:boolean
    duplexxs:boolean
    dynamicOnlyxs:boolean
    localUrixs:string
    messageTTLxs:integer
    namexs:string
    networkTTLxs:integer
    objectNamexs:string
    passwordxs:stringsets the LDAP password for access credentials
    prefetchSizexs:string
    searchEventListenerxs:booleanenables/disable a persistent search to the LDAP server as defined in -draft-ietf-ldapext-psearch-03.txt (2.16.840.1.113730.3.4.3)
    searchFilterxs:stringsets the LDAP search filter as defined in RFC 2254
    searchScopexs:stringsets the LDAP search scope
    staticBridgexs:boolean
    suppressDuplicateQueueSubscriptionsxs:boolean
    suppressDuplicateTopicSubscriptionsxs:boolean
    urixs:stringreturns the next URI from the configured list
    useBrokerNameAsIdSeesxs:boolean
    useCompressionxs:boolean
    userxs:stringsets the LDAP user for access credentials
    userNamexs:string
    - - - - - - - - -
    ElementTypeDescription
    brokerServicebroker | brokerService
    connectionFilter<spring:bean/>
    durableDestinations(<spring:bean/>)*
    dynamicallyIncludedDestinations(<spring:bean/>)*
    excludedDestinations(<spring:bean/>)*
    staticallyIncludedDestinations(<spring:bean/>)*
    -

    Element: lease-database-locker

    - - - - - - - - - -
    AttributeTypeDescription
    createTablesOnStartupxs:boolean
    failIfLockedxs:boolean
    leaseHolderIdxs:string
    lockAcquireSleepIntervalxs:long
    maxAllowableDiffFromDBTimexs:integer
    namexs:string
    queryTimeoutxs:integer
    - - - - - -
    ElementTypeDescription
    dataSource<spring:bean/>
    lockablejdbcPersistenceAdapter | journalPersistenceAdapterFactory | journaledJDBC | kahaDB | levelDB | mKahaDB | replicatedLevelDB
    statementsstatements
    -

    Element: levelDB

    - - - - - - - - - - - - - - - - - - - - - - - - - -
    AttributeTypeDescription
    asyncBufferSizexs:integer
    autoCompactionRatioxs:integer
    brokerNamexs:string
    directoryxs:string
    failoverProducersAuditDepthxs:integer
    flushDelayxs:integer
    indexBlockRestartIntervalxs:integer
    indexBlockSizexs:integer
    indexCacheSizexs:long
    indexCompressionxs:string
    indexFactoryxs:string
    indexMaxOpenFilesxs:integer
    indexWriteBufferSizexs:integer
    lockKeepAlivePeriodxs:long
    logCompressionxs:string
    logDirectoryxs:string
    logSizexs:long
    maxFailoverProducersToTrackxs:integer
    monitorStatsxs:boolean
    paranoidChecksxs:boolean
    syncxs:boolean
    useLockxs:boolean
    verifyChecksumsxs:boolean
    - - - - - - -
    ElementTypeDescription
    brokerServicebroker | brokerService
    lockerdatabase-locker | lease-database-locker | shared-file-locker | transact-database-locker
    transactionIdTransformer<spring:bean/>
    usageManagersystemUsage
    -

    Element: loggingBrokerPlugin

    - - - - - - - - - - - -
    AttributeTypeDescription
    logAllxs:booleanLogger all Events that go through the Plugin
    logConnectionEventsxs:booleanLogger Events that are related to connections
    logConsumerEventsxs:booleanLogger Events that are related to Consumers
    logInternalEventsxs:booleanLogger Events that are normally internal to the broker
    logMessageEventsxs:booleanLogger Events that are related to message processing
    logProducerEventsxs:booleanLogger Events that are related to Producers
    logSessionEventsxs:booleanLogger Events that are related to sessions
    logTransactionEventsxs:booleanLogger Events that are related to transaction processing
    perDestinationLoggerxs:boolean
    - - - - -
    ElementTypeDescription
    adminConnectionContext<spring:bean/>
    nextdestinationPathSeparatorPlugin | forcePersistencyModeBroker | loggingBrokerPlugin | multicastTraceBrokerPlugin | redeliveryPlugin | timeStampingBrokerPlugin | traceBrokerPathPlugin | udpTraceBrokerPlugin
    -

    Element: mKahaDB

    - - - - - - - - -
    AttributeTypeDescription
    brokerNamexs:string
    directoryxs:string
    journalMaxFileLengthxs:stringSet the max file length of the transaction journal -When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can -be used
    journalWriteBatchSizexs:stringSet the max write batch size of the transaction journal -When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can -be used
    lockKeepAlivePeriodxs:long
    useLockxs:boolean
    - - - - - - - -
    ElementTypeDescription
    brokerServicebroker | brokerService
    filteredPersistenceAdapters(<spring:bean/>)*Sets the FilteredKahaDBPersistenceAdapter entries
    lockerdatabase-locker | lease-database-locker | shared-file-locker | transact-database-locker
    transactionStore<spring:bean/>
    usageManagersystemUsage
    -

    Element: managementContext

    - - - - - - - - - - - - - -
    AttributeTypeDescription
    allowRemoteAddressInMBeanNamesxs:boolean
    brokerNamexs:stringGets the broker name this context is used by, may be null -if the broker name was not set.
    connectorHostxs:stringGet the connectorHost
    connectorPathxs:string
    connectorPortxs:string
    createConnectorxs:string
    createMBeanServerxs:boolean
    findTigerMbeanServerxs:booleanEnables/disables the searching for the Java 5 platform MBeanServer
    jmxDomainNamexs:string
    rmiServerPortxs:string
    useMBeanServerxs:boolean
    - - - - - -
    ElementTypeDescription
    MBeanServer<spring:bean/>Get the MBeanServer
    environment<spring:bean/>
    server<spring:bean/>
    -

    Element: maxdb-jdbc-adapter

    - - - - - -
    AttributeTypeDescription
    batchStatmentsxs:boolean
    maxRowsxs:integerthe max value for statement maxRows, used to limit jdbc queries
    useExternalMessageReferencesxs:boolean
    - - - -
    ElementTypeDescription
    statementsstatements
    -

    Element: memoryPersistenceAdapter

    - - - - - - -
    AttributeTypeDescription
    brokerNamexs:string
    createTransactionStorexs:boolean
    directoryxs:string
    useExternalMessageReferencesxs:boolean
    - - - -
    ElementTypeDescription
    usageManagersystemUsage
    -

    Element: memoryUsage

    - - - - - - - - - - - -
    AttributeTypeDescription
    limitxs:stringSets the memory limit in bytes. Setting the limit in bytes will set the usagePortion to 0 since the UsageManager -is not going to be portion based off the parent. When set using Xbean, values of the form "20 Mb", "1024kb", and -"1g" can be used
    namexs:string
    percentOfJvmHeapxs:integer
    percentUsagexs:integer
    percentUsageMinDeltaxs:stringSets the minimum number of percentage points the usage has to change before a UsageListener event is fired by the -manager.
    pollingTimexs:integer
    portionxs:float
    usagexs:long
    usagePortionxs:float
    - - - - - -
    ElementTypeDescription
    executor<spring:bean/>
    limiterdefaultUsageCapacity | usageCapacity
    parent<spring:bean/>
    -

    Element: messageGroupHashBucketFactory

    - - - - -
    AttributeTypeDescription
    bucketCountxs:integerSets the number of hash buckets to use for the message group -functionality. This is only applicable to using message groups to -parallelize processing of a queue while preserving order across an -individual JMSXGroupID header value. This value sets the number of hash -buckets that will be used (i.e. the maximum possible concurrency).
    cacheSizexs:integer
    -

    Element: mirroredQueue

    - - - - - -
    AttributeTypeDescription
    copyMessagexs:booleanSets whether a copy of the message will be sent to each destination. -Defaults to true so that the forward destination is set as the -destination of the message
    postfixxs:stringSets any postix used to identify the queue consumers
    prefixxs:stringSets the prefix wildcard used to identify the queue consumers for a given -topic
    - - - -
    ElementTypeDescription
    brokerServicebroker | brokerService
    -

    Element: multicastNetworkConnector

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    AttributeTypeDescription
    advisoryForFailedForwardxs:boolean
    alwaysSyncSendxs:boolean
    bridgeTempDestinationsxs:boolean
    brokerNamexs:string
    brokerURLxs:string
    conduitSubscriptionsxs:boolean
    consumerPriorityBasexs:integer
    consumerTTLxs:integer
    decreaseNetworkConsumerPriorityxs:boolean
    destinationFilterxs:string
    dispatchAsyncxs:boolean
    duplexxs:boolean
    dynamicOnlyxs:boolean
    localUrixs:string
    messageTTLxs:integer
    namexs:string
    networkTTLxs:integer
    objectNamexs:string
    passwordxs:string
    prefetchSizexs:string
    remoteURIxs:stringSets the remote transport URI to some group transport like -multicast://address:port
    staticBridgexs:boolean
    suppressDuplicateQueueSubscriptionsxs:boolean
    suppressDuplicateTopicSubscriptionsxs:boolean
    useBrokerNameAsIdSeesxs:boolean
    useCompressionxs:boolean
    userNamexs:string
    - - - - - - - - - - - -
    ElementTypeDescription
    bridgecompositeDemandForwardingBridge | demandForwardingBridge
    brokerServicebroker | brokerService
    connectionFilter<spring:bean/>
    durableDestinations(<spring:bean/>)*
    dynamicallyIncludedDestinations(<spring:bean/>)*
    excludedDestinations(<spring:bean/>)*
    localTransport<spring:bean/>
    remoteTransport<spring:bean/>Sets the remote transport implementation
    staticallyIncludedDestinations(<spring:bean/>)*
    -

    Element: multicastTraceBrokerPlugin

    - - - - - - -
    AttributeTypeDescription
    broadcastxs:boolean
    destinationxs:string
    maxTraceDatagramSizexs:integer
    timeToLivexs:integer
    - - - - - - - -
    ElementTypeDescription
    address<spring:bean/>
    adminConnectionContext<spring:bean/>
    nextdestinationPathSeparatorPlugin | forcePersistencyModeBroker | loggingBrokerPlugin | multicastTraceBrokerPlugin | redeliveryPlugin | timeStampingBrokerPlugin | traceBrokerPathPlugin | udpTraceBrokerPlugin
    wireFormat<spring:bean/>
    wireFormatFactory<spring:bean/>
    -

    Element: mysql-jdbc-adapter

    - - - - - - - -
    AttributeTypeDescription
    batchStatmentsxs:boolean
    engineTypexs:string
    maxRowsxs:integerthe max value for statement maxRows, used to limit jdbc queries
    typeStatementxs:string
    useExternalMessageReferencesxs:boolean
    - - - -
    ElementTypeDescription
    statementsstatements
    -

    Element: networkConnector

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    AttributeTypeDescription
    advisoryForFailedForwardxs:boolean
    alwaysSyncSendxs:boolean
    bridgeTempDestinationsxs:boolean
    brokerNamexs:string
    brokerURLxs:string
    conduitSubscriptionsxs:boolean
    consumerPriorityBasexs:integer
    consumerTTLxs:integer
    decreaseNetworkConsumerPriorityxs:boolean
    destinationFilterxs:string
    discoveryURIxs:string
    dispatchAsyncxs:boolean
    duplexxs:boolean
    dynamicOnlyxs:boolean
    localUrixs:string
    messageTTLxs:integer
    namexs:string
    networkTTLxs:integer
    objectNamexs:string
    passwordxs:string
    prefetchSizexs:string
    staticBridgexs:boolean
    suppressDuplicateQueueSubscriptionsxs:boolean
    suppressDuplicateTopicSubscriptionsxs:boolean
    urixs:string
    useBrokerNameAsIdSeesxs:boolean
    useCompressionxs:boolean
    userNamexs:string
    - - - - - - - - - -
    ElementTypeDescription
    brokerServicebroker | brokerService
    connectionFilter<spring:bean/>
    discoveryAgent<spring:bean/>
    durableDestinations(<spring:bean/>)*
    dynamicallyIncludedDestinations(<spring:bean/>)*
    excludedDestinations(<spring:bean/>)*
    staticallyIncludedDestinations(<spring:bean/>)*
    -

    Element: noSubscriptionRecoveryPolicy

    - - - -
    ElementTypeDescription
    brokerdestinationPathSeparatorPlugin | forcePersistencyModeBroker | loggingBrokerPlugin | multicastTraceBrokerPlugin | redeliveryPlugin | timeStampingBrokerPlugin | traceBrokerPathPlugin | udpTraceBrokerPlugin
    -

    Element: oldestMessageEvictionStrategy

    - - - -
    AttributeTypeDescription
    evictExpiredMessagesHighWatermarkxs:integerSets the high water mark on which we will eagerly evict expired messages from RAM
    -

    Element: oldestMessageWithLowestPriorityEvictionStrategy

    - - - -
    AttributeTypeDescription
    evictExpiredMessagesHighWatermarkxs:integerSets the high water mark on which we will eagerly evict expired messages from RAM
    -

    Element: oracleBlobJDBCAdapter

    - - - - - -
    AttributeTypeDescription
    batchStatmentsxs:boolean
    maxRowsxs:integerthe max value for statement maxRows, used to limit jdbc queries
    useExternalMessageReferencesxs:boolean
    - - - -
    ElementTypeDescription
    statementsstatements
    -

    Element: oracleJDBCAdapter

    - - - - - -
    AttributeTypeDescription
    batchStatmentsxs:boolean
    maxRowsxs:integerthe max value for statement maxRows, used to limit jdbc queries
    useExternalMessageReferencesxs:boolean
    - - - -
    ElementTypeDescription
    statementsstatements
    -

    Element: outboundQueueBridge

    - - - - - - -
    AttributeTypeDescription
    doHandleReplyToxs:boolean
    localQueueNamexs:string
    outboundQueueNamexs:stringSets the name of the outbound queue name. If the inbound queue name -has not been set already then this method uses the provided queue name -to set the inbound topic name as well.
    selectorxs:string
    - - - - - - - - - -
    ElementTypeDescription
    consumer<spring:bean/>
    consumerConnection<spring:bean/>
    consumerQueuequeue
    jmsConnectorjmsQueueConnector | jmsTopicConnector
    jmsMessageConvertorsimpleJmsMessageConvertor
    producerConnection<spring:bean/>
    producerQueuequeue
    -

    Element: outboundTopicBridge

    - - - - - - - -
    AttributeTypeDescription
    consumerNamexs:string
    doHandleReplyToxs:boolean
    localTopicNamexs:string
    outboundTopicNamexs:stringSets the name of the outbound topic name. If the inbound topic name -has not been set already then this method uses the provided topic name -to set the inbound topic name as well.
    selectorxs:string
    - - - - - - - - - -
    ElementTypeDescription
    consumer<spring:bean/>
    consumerConnection<spring:bean/>
    consumerTopictopic
    jmsConnectorjmsQueueConnector | jmsTopicConnector
    jmsMessageConvertorsimpleJmsMessageConvertor
    producerConnection<spring:bean/>
    producerTopictopic
    -

    Element: pListStoreImpl

    - - - - - - - - - - - - - -
    AttributeTypeDescription
    cleanupIntervalxs:long
    directoryxs:string
    enableIndexWriteAsyncxs:boolean
    failIfDatabaseIsLockedxs:boolean
    indexCacheSizexs:integer
    indexEnablePageCachingxs:boolean
    indexPageSizexs:integer
    indexWriteBatchSizexs:integer
    journalMaxFileLengthxs:integer
    journalMaxWriteBatchSizexs:integer
    lazyInitxs:boolean
    - - - -
    ElementTypeDescription
    brokerServicebroker | brokerService
    -

    Element: partitionBrokerPlugin

    - - - - -
    AttributeTypeDescription
    configAsJsonxs:string
    minTransferCountxs:integer
    - - - -
    ElementTypeDescription
    config<spring:bean/>
    -

    Element: policyEntry

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    AttributeTypeDescription
    advisoryForConsumedxs:boolean
    advisoryForDeliveryxs:boolean
    advisoryForDiscardingMessagesxs:boolean
    advisoryForFastProducersxs:boolean
    advisoryForSlowConsumersxs:boolean
    advisoryWhenFullxs:boolean
    allConsumersExclusiveByDefaultxs:boolean
    alwaysRetroactivexs:boolean
    blockedProducerWarningIntervalxs:longSet's the interval at which warnings about producers being blocked by -resource usage will be triggered. Values of 0 or less will disable -warnings
    consumersBeforeDispatchStartsxs:integer
    cursorMemoryHighWaterMarkxs:integer
    doOptimzeMessageStoragexs:boolean
    durableTopicPrefetchxs:integerGet the durableTopicPrefetch
    enableAuditxs:boolean
    expireMessagesPeriodxs:long
    gcInactiveDestinationsxs:boolean
    gcWithNetworkConsumersxs:boolean
    inactiveTimoutBeforeGCxs:long
    lazyDispatchxs:boolean
    maxAuditDepthxs:integer
    maxBrowsePageSizexs:integer
    maxExpirePageSizexs:integer
    maxPageSizexs:integer
    maxProducersToAuditxs:integer
    maxQueueAuditDepthxs:integer
    memoryLimitxs:stringWhen set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used
    messageGroupMapFactoryTypexs:string
    minimumMessageSizexs:long
    optimizeMessageStoreInFlightLimitxs:integer
    optimizedDispatchxs:boolean
    prioritizedMessagesxs:boolean
    producerFlowControlxs:boolean
    queuexs:stringA helper method to set the destination from a configuration file
    queueBrowserPrefetchxs:integerGet the queueBrowserPrefetch
    queuePrefetchxs:integerGet the queuePrefetch
    reduceMemoryFootprintxs:boolean
    sendAdvisoryIfNoConsumersxs:booleanSends an advisory message if a non-persistent message is sent and there -are no active consumers
    storeUsageHighWaterMarkxs:integer
    strictOrderDispatchxs:boolean
    tempQueuexs:boolean
    tempTopicxs:boolean
    timeBeforeDispatchStartsxs:integer
    topicxs:stringA helper method to set the destination from a configuration file
    topicPrefetchxs:integerGet the topicPrefetch
    useCachexs:boolean
    useConsumerPriorityxs:boolean
    usePrefetchExtensionxs:boolean
    - - - - - - - - - - - - - - -
    ElementTypeDescription
    deadLetterStrategydiscarding | individualDeadLetterStrategy | sharedDeadLetterStrategySets the policy used to determine which dead letter queue destination -should be used
    destinationqueue | tempQueue | tempTopic | topic
    dispatchPolicypriorityDispatchPolicy | priorityNetworkDispatchPolicy | roundRobinDispatchPolicy | simpleDispatchPolicy | strictOrderDispatchPolicy
    messageEvictionStrategyoldestMessageEvictionStrategy | oldestMessageWithLowestPriorityEvictionStrategy | uniquePropertyMessageEvictionStrategySets the eviction strategy used to decide which message to evict when the -slow consumer needs to discard messages
    messageGroupMapFactorycachedMessageGroupMapFactory | messageGroupHashBucketFactory | simpleMessageGroupMapFactorySets the factory used to create new instances of {MessageGroupMap} used -to implement the Message Groups -functionality.
    networkBridgeFilterFactoryconditionalNetworkBridgeFilterFactory | defaultNetworkBridgeFilterFactory
    pendingDurableSubscriberPolicyfileDurableSubscriberCursor | storeDurableSubscriberCursor | vmDurableCursor
    pendingMessageLimitStrategyconstantPendingMessageLimitStrategy | prefetchRatePendingMessageLimitStrategySets the strategy to calculate the maximum number of messages that are -allowed to be pending on consumers (in addition to their prefetch sizes). -Once the limit is reached, non-durable topics can then start discarding -old messages. This allows us to keep dispatching messages to slow -consumers while not blocking fast consumers and discarding the messages -oldest first.
    pendingQueuePolicyfileQueueCursor | storeCursor | vmQueueCursor
    pendingSubscriberPolicyfileCursor | vmCursor
    slowConsumerStrategyabortSlowAckConsumerStrategy | abortSlowConsumerStrategy
    subscriptionRecoveryPolicyfixedCountSubscriptionRecoveryPolicy | fixedSizedSubscriptionRecoveryPolicy | lastImageSubscriptionRecoveryPolicy | noSubscriptionRecoveryPolicy | queryBasedSubscriptionRecoveryPolicy | timedSubscriptionRecoveryPolicy
    -

    Element: policyMap

    - - - - - -
    ElementTypeDescription
    defaultEntrypolicyEntry
    entries(<spring:bean/>)*A helper method to allow the destination map to be populated from a -dependency injection framework such as Spring
    policyEntries(<spring:bean/>)*Sets the individual entries on the policy map
    -

    Element: pooledConnectionFactory

    - - - - - -
    AttributeTypeDescription
    maxConnectionsxs:integer
    maximumActivexs:integer
    resourceNamexs:string
    - - - - -
    ElementTypeDescription
    connectionFactoryconnectionFactory | xaConnectionFactory
    transactionManager<spring:bean/>
    -

    Element: postgresql-jdbc-adapter

    - - - - - - -
    AttributeTypeDescription
    acksPkNamexs:string
    batchStatmentsxs:boolean
    maxRowsxs:integerthe max value for statement maxRows, used to limit jdbc queries
    useExternalMessageReferencesxs:boolean
    - - - -
    ElementTypeDescription
    statementsstatements
    -

    Element: prefetchPolicy

    - - - - - - - - - - -
    AttributeTypeDescription
    allxs:integer
    durableTopicPrefetchxs:integer
    inputStreamPrefetchxs:integer
    maximumPendingMessageLimitxs:integerSets how many messages a broker will keep around, above the prefetch -limit, for non-durable topics before starting to discard older messages.
    optimizeDurableTopicPrefetchxs:integer
    queueBrowserPrefetchxs:integer
    queuePrefetchxs:integer
    topicPrefetchxs:integer
    -

    Element: prefetchRatePendingMessageLimitStrategy

    - - - -
    AttributeTypeDescription
    multiplierxs:doubleSets the multiplier of the prefetch size which will be used to define the maximum number of pending -messages for non-durable topics before messages are discarded.
    -

    Element: priorityDispatchPolicy

    -

    Element: priorityNetworkDispatchPolicy

    -

    Element: proxyConnector

    - - - - - - - -
    AttributeTypeDescription
    bindxs:string
    localUrixs:string
    namexs:string
    proxyToLocalBrokerxs:boolean
    remotexs:string
    - - - -
    ElementTypeDescription
    server<spring:bean/>
    -

    Element: publishedAddressPolicy

    - - - - -
    AttributeTypeDescription
    clusterClientUriQueryxs:stringGets the URI query that's configured on the published URI that's sent to client's -when the cluster info is updated.
    publishedHostStrategyxs:string
    - - - -
    ElementTypeDescription
    portMapping<spring:bean/>
    -

    Element: queryBasedSubscriptionRecoveryPolicy

    - - - - -
    ElementTypeDescription
    brokerdestinationPathSeparatorPlugin | forcePersistencyModeBroker | loggingBrokerPlugin | multicastTraceBrokerPlugin | redeliveryPlugin | timeStampingBrokerPlugin | traceBrokerPathPlugin | udpTraceBrokerPlugin
    query<spring:bean/>Sets the query strategy to load initial messages
    -

    Element: queue

    - - - - -
    AttributeTypeDescription
    namexs:string
    physicalNamexs:string
    - - - - -
    ElementTypeDescription
    compositeDestinations(queue | tempQueue | tempTopic | topic)*
    properties<spring:bean/>Get the properties from this instance for storing in JNDI
    -

    Element: queueDispatchSelector

    - - - - -
    ElementTypeDescription
    destinationqueue | tempQueue | tempTopic | topic
    exclusiveConsumer<spring:bean/>
    -

    Element: reconnectionPolicy

    - - - - - - - - - - -
    AttributeTypeDescription
    backOffMultiplierxs:doubleGets the multiplier used to grow the delay between connection attempts from the initial -time to the max set time. By default this value is set to 2.0.
    initialReconnectDelayxs:longGets the initial delay value used before a reconnection attempt is made. If the -use exponential back-off value is set to false then this will be the fixed time -between connection attempts. By default this value is set to one second.
    maxInitialConnectAttemptsxs:integerGets the maximum number of times that the {@link JmsConnector} will try -to connect on startup to before it marks itself as failed and does not -try any further connections.
    maxReconnectAttemptsxs:integerGets the number of time that {@link JmsConnector} will attempt to connect -or reconnect before giving up. By default the policy sets this value to -a negative value meaning try forever.
    maxSendRetriesxs:integerGets the maximum number of a times a Message send should be retried before -a JMSExeception is thrown indicating that the operation failed.
    maximumReconnectDelayxs:longGets the maximum delay that is inserted between each attempt to connect -before another attempt is made. The default setting for this value is -30 seconds.
    sendRetyDelayxs:longSet the amount of time the DestionationBridge will wait between attempts -to forward a message. The default policy limits the minimum time between -send attempt to one second.
    useExponentialBackOffxs:booleanGets whether the policy uses the set back-off multiplier to grow the time between -connection attempts.
    -

    Element: redeliveryPlugin

    - - - - -
    AttributeTypeDescription
    fallbackToDeadLetterxs:booleanWhat to do if there is no matching redelivery policy for a destination. -when true, the region broker DLQ processing will be used via sendToDeadLetterQueue -when false, there is no action
    sendToDlqIfMaxRetriesExceededxs:booleanWhat to do if the maxretries on a matching redelivery policy is exceeded. -when true, the region broker DLQ processing will be used via sendToDeadLetterQueue -when false, there is no action
    - - - - - -
    ElementTypeDescription
    adminConnectionContext<spring:bean/>
    nextdestinationPathSeparatorPlugin | forcePersistencyModeBroker | loggingBrokerPlugin | multicastTraceBrokerPlugin | redeliveryPlugin | timeStampingBrokerPlugin | traceBrokerPathPlugin | udpTraceBrokerPlugin
    redeliveryPolicyMapredeliveryPolicyMap
    -

    Element: redeliveryPolicy

    - - - - - - - - - - - - - - -
    AttributeTypeDescription
    backOffMultiplierxs:double
    collisionAvoidancePercentxs:short
    initialRedeliveryDelayxs:long
    maximumRedeliveriesxs:integer
    maximumRedeliveryDelayxs:long
    queuexs:stringA helper method to set the destination from a configuration file
    redeliveryDelayxs:long
    tempQueuexs:boolean
    tempTopicxs:boolean
    topicxs:stringA helper method to set the destination from a configuration file
    useCollisionAvoidancexs:boolean
    useExponentialBackOffxs:boolean
    - - - -
    ElementTypeDescription
    destinationqueue | tempQueue | tempTopic | topic
    -

    Element: redeliveryPolicyMap

    - - - - - -
    ElementTypeDescription
    defaultEntryredeliveryPolicy
    entries(<spring:bean/>)*A helper method to allow the destination map to be populated from a -dependency injection framework such as Spring
    redeliveryPolicyEntries(<spring:bean/>)*Sets the individual entries on the redeliveryPolicyMap
    -

    Element: replicatedLevelDB

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    AttributeTypeDescription
    asyncBufferSizexs:integer
    bindxs:string
    brokerNamexs:string
    containerxs:string
    directoryxs:string
    failoverProducersAuditDepthxs:integer
    flushDelayxs:integer
    hostnamexs:string
    indexBlockRestartIntervalxs:integer
    indexBlockSizexs:integer
    indexCacheSizexs:long
    indexCompressionxs:string
    indexFactoryxs:string
    indexMaxOpenFilesxs:integer
    indexWriteBufferSizexs:integer
    lockKeepAlivePeriodxs:long
    logCompressionxs:string
    logSizexs:long
    maxFailoverProducersToTrackxs:integer
    monitorStatsxs:boolean
    paranoidChecksxs:boolean
    replicasxs:integer
    securityTokenxs:string
    syncxs:string
    useLockxs:boolean
    verifyChecksumsxs:boolean
    weightxs:integer
    zkAddressxs:string
    zkPasswordxs:string
    zkPathxs:string
    zkSessionTmeoutxs:string
    - - - - - -
    ElementTypeDescription
    brokerServicebroker | brokerService
    lockerdatabase-locker | lease-database-locker | shared-file-locker | transact-database-locker
    usageManagersystemUsage
    -

    Element: roundRobinDispatchPolicy

    -

    Element: runtimeConfigurationPlugin

    - - - -
    AttributeTypeDescription
    checkPeriodxs:long
    -

    Element: shared-file-locker

    - - - - - - -
    AttributeTypeDescription
    directoryxs:string
    failIfLockedxs:boolean
    lockAcquireSleepIntervalxs:long
    namexs:string
    - - - -
    ElementTypeDescription
    lockablejdbcPersistenceAdapter | journalPersistenceAdapterFactory | journaledJDBC | kahaDB | levelDB | mKahaDB | replicatedLevelDB
    -

    Element: sharedDeadLetterStrategy

    - - - - - -
    AttributeTypeDescription
    enableAuditxs:boolean
    processExpiredxs:boolean
    processNonPersistentxs:boolean
    - - - -
    ElementTypeDescription
    deadLetterQueuequeue | tempQueue | tempTopic | topic
    -

    Element: simpleAuthenticationPlugin

    - - - - - -
    AttributeTypeDescription
    anonymousAccessAllowedxs:boolean
    anonymousGroupxs:string
    anonymousUserxs:string
    - - - - - -
    ElementTypeDescription
    userGroups<spring:bean/>Sets the groups a user is in. The key is the user name and the value is a -Set of groups
    userPasswords<spring:bean/>Sets the map indexed by user name with the value the password
    users(<spring:bean/>)*Sets individual users for authentication
    -

    Element: simpleAuthorizationMap

    - - - - - - -
    ElementTypeDescription
    adminACLsauthorizationMap | policyMap | redeliveryPolicyMap
    readACLsauthorizationMap | policyMap | redeliveryPolicyMap
    tempDestinationAuthorizationEntrytempDestinationAuthorizationEntry
    writeACLsauthorizationMap | policyMap | redeliveryPolicyMap
    -

    Element: simpleDispatchPolicy

    -

    Element: simpleDispatchSelector

    - - - -
    ElementTypeDescription
    destinationqueue | tempQueue | tempTopic | topic
    -

    Element: simpleJmsMessageConvertor

    - - - -
    ElementTypeDescription
    connection<spring:bean/>
    -

    Element: simpleMessageGroupMapFactory

    -

    Element: sslContext

    - - - - - - - - - - - - - - -
    AttributeTypeDescription
    keyStorexs:string
    keyStoreAlgorithmxs:string
    keyStoreKeyPasswordxs:string
    keyStorePasswordxs:string
    keyStoreTypexs:string
    protocolxs:string
    providerxs:string
    secureRandomAlgorithmxs:string
    trustStorexs:string
    trustStoreAlgorithmxs:string
    trustStorePasswordxs:string
    trustStoreTypexs:string
    - - - - - - -
    ElementTypeDescription
    SSLContext<spring:bean/>
    keyManagers(<spring:bean/>)*
    secureRandom<spring:bean/>
    trustManagers(<spring:bean/>)*
    -

    Element: statements

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    AttributeTypeDescription
    addMessageStatementxs:string
    binaryDataTypexs:string
    clearDurableLastAckInTxStatementxs:string
    clearXidFlagStatementxs:string
    containerNameDataTypexs:string
    createDurableSubStatementxs:string
    currentDateTimeStatementxs:string
    deleteOldMessagesStatementWithPriorityxs:string
    deleteSubscriptionStatementxs:string
    destinationMessageCountStatementxs:string
    dropAckPKAlterStatementEndxs:string
    durableSubAcksTableNamexs:string
    durableSubscriberMessageCountStatementxs:string
    durableSubscriberMessageCountStatementWithPriorityxs:string
    findAcksPendingOutcomeStatementxs:string
    findAllDestinationsStatementxs:string
    findAllDurableSubMessagesStatementxs:string
    findAllDurableSubsStatementxs:string
    findAllMessagesStatementxs:string
    findDurableSubMessagesStatementxs:string
    findDurableSubStatementxs:string
    findLastSequenceIdInAcksStatementxs:string
    findLastSequenceIdInMsgsStatementxs:string
    findMessageByIdStatementxs:string
    findMessageSequenceIdStatementxs:string
    findMessageStatementxs:string
    findNextMessagesStatementxs:string
    findOpsPendingOutcomeStatementxs:string
    findXidByIdStatementxs:string
    insertDurablePriorityAckStatementxs:string
    lastAckedDurableSubscriberMessageStatementxs:string
    lastProducerSequenceIdStatementxs:string
    leaseObtainStatementxs:string
    leaseOwnerStatementxs:string
    leaseUpdateStatementxs:string
    lockCreateStatementxs:string
    lockTableNamexs:string
    lockUpdateStatementxs:string
    longDataTypexs:string
    messageTableNamexs:string
    msgIdDataTypexs:string
    nextDurableSubscriberMessageStatementxs:string
    removeAllMessagesStatementxs:string
    removeAllSubscriptionsStatementxs:string
    removeMessageStatmentxs:string
    selectDurablePriorityAckStatementxs:string
    sequenceDataTypexs:string
    stringIdDataTypexs:string
    tablePrefixxs:string
    updateDurableLastAckInTxStatementxs:string
    updateDurableLastAckStatementxs:string
    updateDurableLastAckWithPriorityInTxStatementxs:string
    updateDurableLastAckWithPriorityStatementxs:string
    updateLastPriorityAckRowOfDurableSubStatementxs:string
    updateMessageStatementxs:string
    updateXidFlagStatementxs:string
    useExternalMessageReferencesxs:boolean
    useLockCreateWhereClausexs:boolean
    - - - - - -
    ElementTypeDescription
    createLockSchemaStatements(<spring:bean/>)*
    createSchemaStatements(<spring:bean/>)*
    dropSchemaStatements(<spring:bean/>)*
    -

    Element: statisticsBrokerPlugin

    -

    Element: storeCursor

    -

    Element: storeDurableSubscriberCursor

    - - - - -
    AttributeTypeDescription
    immediatePriorityDispatchxs:booleanEnsure that new higher priority messages will get an immediate dispatch -rather than wait for the end of the current cursor batch. -Useful when there is a large message backlog and intermittent high priority messages.
    useCachexs:boolean
    -

    Element: storeUsage

    - - - - - - - - -
    AttributeTypeDescription
    limitxs:stringSets the memory limit in bytes. Setting the limit in bytes will set the usagePortion to 0 since the UsageManager -is not going to be portion based off the parent. When set using Xbean, values of the form "20 Mb", "1024kb", and -"1g" can be used
    namexs:string
    percentUsagexs:integer
    percentUsageMinDeltaxs:stringSets the minimum number of percentage points the usage has to change before a UsageListener event is fired by the -manager.
    pollingTimexs:integer
    usagePortionxs:float
    - - - - - - -
    ElementTypeDescription
    executor<spring:bean/>
    limiterdefaultUsageCapacity | usageCapacity
    parent<spring:bean/>
    storejdbcPersistenceAdapter | journalPersistenceAdapter | kahaDB | levelDB | mKahaDB | memoryPersistenceAdapter | replicatedLevelDB
    -

    Element: streamJDBCAdapter

    - - - - - -
    AttributeTypeDescription
    batchStatmentsxs:boolean
    maxRowsxs:integerthe max value for statement maxRows, used to limit jdbc queries
    useExternalMessageReferencesxs:boolean
    - - - -
    ElementTypeDescription
    statementsstatements
    -

    Element: strictOrderDispatchPolicy

    -

    Element: sybase-jdbc-adapter

    - - - - - -
    AttributeTypeDescription
    batchStatmentsxs:boolean
    maxRowsxs:integerthe max value for statement maxRows, used to limit jdbc queries
    useExternalMessageReferencesxs:boolean
    - - - -
    ElementTypeDescription
    statementsstatements
    -

    Element: systemUsage

    - - - - - - -
    AttributeTypeDescription
    namexs:string
    sendFailIfNoSpacexs:booleanSets whether or not a send() should fail if there is no space free. The -default value is false which means to block the send() method until space -becomes available
    sendFailIfNoSpaceAfterTimeoutxs:long
    sendFailIfNoSpaceExplicitySetxs:boolean
    - - - - - - - - - - - -
    ElementTypeDescription
    adapterjdbcPersistenceAdapter | journalPersistenceAdapter | kahaDB | levelDB | mKahaDB | memoryPersistenceAdapter | replicatedLevelDB
    executor<spring:bean/>
    jobSchedulerStore<spring:bean/>
    jobSchedulerUsagejobSchedulerUsage
    memoryUsagememoryUsage
    parentsystemUsage
    storeUsagestoreUsage
    tempStorelevelDB | pListStoreImpl | replicatedLevelDB
    tempUsagetempUsage
    -

    Element: taskRunnerFactory

    - - - - - - - - - -
    AttributeTypeDescription
    daemonxs:boolean
    dedicatedTaskRunnerxs:boolean
    maxIterationsPerRunxs:integer
    maxThreadPoolSizexs:integer
    namexs:string
    priorityxs:integer
    shutdownAwaitTerminationxs:long
    - - - - -
    ElementTypeDescription
    executor<spring:bean/>
    rejectedTaskHandler<spring:bean/>
    -

    Element: tempDestinationAuthorizationEntry

    - - - - - - - - - - -
    AttributeTypeDescription
    adminxs:string
    groupClassxs:string
    queuexs:stringA helper method to set the destination from a configuration file
    readxs:string
    tempQueuexs:boolean
    tempTopicxs:boolean
    topicxs:stringA helper method to set the destination from a configuration file
    writexs:string
    - - - - - - -
    ElementTypeDescription
    adminACLs(<spring:bean/>)*
    destinationqueue | tempQueue | tempTopic | topic
    readACLs(<spring:bean/>)*
    writeACLs(<spring:bean/>)*
    -

    Element: tempQueue

    - - - - - - -
    AttributeTypeDescription
    connectionIdxs:string
    namexs:string
    physicalNamexs:string
    sequenceIdxs:long
    - - - - - -
    ElementTypeDescription
    compositeDestinations(queue | tempQueue | tempTopic | topic)*
    connection<spring:bean/>
    properties<spring:bean/>Get the properties from this instance for storing in JNDI
    -

    Element: tempTopic

    - - - - - - -
    AttributeTypeDescription
    connectionIdxs:string
    namexs:string
    physicalNamexs:string
    sequenceIdxs:long
    - - - - - -
    ElementTypeDescription
    compositeDestinations(queue | tempQueue | tempTopic | topic)*
    connection<spring:bean/>
    properties<spring:bean/>Get the properties from this instance for storing in JNDI
    -

    Element: tempUsage

    - - - - - - - - -
    AttributeTypeDescription
    limitxs:stringSets the memory limit in bytes. Setting the limit in bytes will set the usagePortion to 0 since the UsageManager -is not going to be portion based off the parent. When set using Xbean, values of the form "20 Mb", "1024kb", and -"1g" can be used
    namexs:string
    percentUsagexs:integer
    percentUsageMinDeltaxs:stringSets the minimum number of percentage points the usage has to change before a UsageListener event is fired by the -manager.
    pollingTimexs:integer
    usagePortionxs:float
    - - - - - - -
    ElementTypeDescription
    executor<spring:bean/>
    limiterdefaultUsageCapacity | usageCapacity
    parent<spring:bean/>
    storelevelDB | pListStoreImpl | replicatedLevelDB
    -

    Element: timeStampingBrokerPlugin

    - - - - - -
    AttributeTypeDescription
    futureOnlyxs:boolean
    ttlCeilingxs:longsetter method for ttlCeiling
    zeroExpirationOverridexs:longsetter method for zeroExpirationOverride
    - - - - - -
    ElementTypeDescription
    adminConnectionContext<spring:bean/>
    nextdestinationPathSeparatorPlugin | forcePersistencyModeBroker | loggingBrokerPlugin | multicastTraceBrokerPlugin | redeliveryPlugin | timeStampingBrokerPlugin | traceBrokerPathPlugin | udpTraceBrokerPlugin
    processNetworkMessages<spring:bean/>
    -

    Element: timedSubscriptionRecoveryPolicy

    - - - -
    AttributeTypeDescription
    recoverDurationxs:long
    - - - -
    ElementTypeDescription
    brokerdestinationPathSeparatorPlugin | forcePersistencyModeBroker | loggingBrokerPlugin | multicastTraceBrokerPlugin | redeliveryPlugin | timeStampingBrokerPlugin | traceBrokerPathPlugin | udpTraceBrokerPlugin
    -

    Element: topic

    - - - - -
    AttributeTypeDescription
    namexs:string
    physicalNamexs:string
    - - - - -
    ElementTypeDescription
    compositeDestinations(queue | tempQueue | tempTopic | topic)*
    properties<spring:bean/>Get the properties from this instance for storing in JNDI
    -

    Element: traceBrokerPathPlugin

    - - - -
    AttributeTypeDescription
    stampPropertyxs:string
    - - - - -
    ElementTypeDescription
    adminConnectionContext<spring:bean/>
    nextdestinationPathSeparatorPlugin | forcePersistencyModeBroker | loggingBrokerPlugin | multicastTraceBrokerPlugin | redeliveryPlugin | timeStampingBrokerPlugin | traceBrokerPathPlugin | udpTraceBrokerPlugin
    -

    Element: transact-database-locker

    - - - - - - - -
    AttributeTypeDescription
    createTablesOnStartupxs:boolean
    failIfLockedxs:boolean
    lockAcquireSleepIntervalxs:long
    namexs:string
    queryTimeoutxs:integer
    - - - - - - -
    ElementTypeDescription
    dataSource<spring:bean/>
    exceptionHandler<spring:bean/>
    lockablejdbcPersistenceAdapter | journalPersistenceAdapterFactory | journaledJDBC | kahaDB | levelDB | mKahaDB | replicatedLevelDB
    statementsstatements
    -

    Element: transact-jdbc-adapter

    - - - - - -
    AttributeTypeDescription
    batchStatmentsxs:boolean
    maxRowsxs:integerthe max value for statement maxRows, used to limit jdbc queries
    useExternalMessageReferencesxs:boolean
    - - - -
    ElementTypeDescription
    statementsstatements
    -

    Element: transportConnector

    - - - - - - - - - - - - - - - -
    AttributeTypeDescription
    allowLinkStealingxs:boolean
    auditNetworkProducersxs:booleanEnable a producer audit on network connections, Traps the case of a missing send reply and resend. -Note: does not work with conduit=false, networked composite destinations or networked virtual topics
    disableAsyncDispatchxs:boolean
    discoveryUrixs:string
    enableStatusMonitorxs:boolean
    maximumConsumersAllowedPerConnectionxs:integer
    maximumProducersAllowedPerConnectionxs:integer
    namexs:string
    rebalanceClusterClientsxs:boolean
    updateClusterClientsxs:boolean
    updateClusterClientsOnRemovexs:boolean
    updateClusterFilterxs:string
    urixs:stringSets the server transport URI to use if there is not a -{@link TransportServer} configured via the -{@link #setServer(TransportServer)} method. This value is used to lazy -create a {@link TransportServer} instance
    - - - - - - - - - -
    ElementTypeDescription
    brokerInfo<spring:bean/>
    brokerServicebroker | brokerServiceThis is called by the BrokerService right before it starts the transport.
    discoveryAgent<spring:bean/>
    messageAuthorizationPolicy<spring:bean/>Sets the policy used to decide if the current connection is authorized to -consume a given message
    publishedAddressPolicypublishedAddressPolicyGets the currently configured policy for creating the published connection address of this -TransportConnector.
    server<spring:bean/>
    taskRunnerFactorytaskRunnerFactory
    -

    Element: udpTraceBrokerPlugin

    - - - - - -
    AttributeTypeDescription
    broadcastxs:boolean
    destinationxs:string
    maxTraceDatagramSizexs:integer
    - - - - - - - -
    ElementTypeDescription
    address<spring:bean/>
    adminConnectionContext<spring:bean/>
    nextdestinationPathSeparatorPlugin | forcePersistencyModeBroker | loggingBrokerPlugin | multicastTraceBrokerPlugin | redeliveryPlugin | timeStampingBrokerPlugin | traceBrokerPathPlugin | udpTraceBrokerPlugin
    wireFormat<spring:bean/>
    wireFormatFactory<spring:bean/>
    -

    Element: uniquePropertyMessageEvictionStrategy

    - - - - -
    AttributeTypeDescription
    evictExpiredMessagesHighWatermarkxs:integerSets the high water mark on which we will eagerly evict expired messages from RAM
    propertyNamexs:string
    -

    Element: usageCapacity

    - - - -
    AttributeTypeDescription
    limitxs:long
    -

    Element: virtualDestinationInterceptor

    - - - -
    ElementTypeDescription
    virtualDestinations(compositeQueue | compositeTopic | virtualTopic)*
    -

    Element: virtualSelectorCacheBrokerPlugin

    - - - -
    AttributeTypeDescription
    persistFilexs:stringSets the location of the persistent cache
    -

    Element: virtualTopic

    - - - - - - - -
    AttributeTypeDescription
    localxs:boolean
    namexs:string
    postfixxs:stringSets any postix used to identify the queue consumers
    prefixxs:stringSets the prefix wildcard used to identify the queue consumers for a given -topic
    selectorAwarexs:booleanIndicates whether the selectors of consumers are used to determine dispatch -to a virtual destination, when true only messages matching an existing -consumer will be dispatched.
    -

    Element: vmCursor

    -

    Element: vmDurableCursor

    -

    Element: vmQueueCursor

    -

    Element: xaConnectionFactory

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    AttributeTypeDescription
    alwaysSessionAsyncxs:booleanIf this flag is not set then a separate thread is not used for dispatching messages for each Session in -the Connection. However, a separate thread is always used if there is more than one session, or the session -isn't in auto acknowledge or duplicates ok mode. By default this value is set to true and session dispatch -happens asynchronously.
    alwaysSyncSendxs:booleanSet true if always require messages to be sync sent
    auditDepthxs:integer
    auditMaximumProducerNumberxs:integer
    beanNamexs:string
    brokerURLxs:stringSets the connection -URL used to connect to the ActiveMQ broker.
    checkForDuplicatesxs:boolean
    clientIDxs:stringSets the JMS clientID to use for the created connection. Note that this -can only be used by one connection at once so generally its a better idea -to set the clientID on a Connection
    clientIDPrefixxs:stringSets the prefix used by autogenerated JMS Client ID values which are used -if the JMS client does not explicitly specify on.
    closeTimeoutxs:integerSets the timeout before a close is considered complete. Normally a -close() on a connection waits for confirmation from the broker; this -allows that operation to timeout to save the client hanging if there is -no broker
    connectionIDPrefixxs:stringSets the prefix used by connection id generator
    consumerFailoverRedeliveryWaitPeriodxs:long
    copyMessageOnSendxs:booleanShould a JMS message be copied to a new JMS Message object as part of the -send() method in JMS. This is enabled by default to be compliant with the -JMS specification. You can disable it if you do not mutate JMS messages -after they are sent for a performance boost
    disableTimeStampsByDefaultxs:booleanSets whether or not timestamps on messages should be disabled or not. If -you disable them it adds a small performance boost.
    dispatchAsyncxs:booleanEnables or disables the default setting of whether or not consumers have -their messages dispatched -synchronously or asynchronously by the broker. For non-durable -topics for example we typically dispatch synchronously by default to -minimize context switches which boost performance. However sometimes its -better to go slower to ensure that a single blocked consumer socket does -not block delivery to other consumers.
    exclusiveConsumerxs:booleanEnables or disables whether or not queue consumers should be exclusive or -not for example to preserve ordering when not using Message Groups
    maxThreadPoolSizexs:integer
    messagePrioritySupportedxs:boolean
    nestedMapAndListEnabledxs:booleanEnables/disables whether or not Message properties and MapMessage entries -support Nested -Structures of Map and List objects
    nonBlockingRedeliveryxs:booleanWhen true a MessageConsumer will not stop Message delivery before re-delivering Messages -from a rolled back transaction. This implies that message order will not be preserved and -also will result in the TransactedIndividualAck option to be enabled.
    objectMessageSerializationDeferedxs:booleanWhen an object is set on an ObjectMessage, the JMS spec requires the -object to be serialized by that set method. Enabling this flag causes the -object to not get serialized. The object may subsequently get serialized -if the message needs to be sent over a socket or stored to disk.
    optimizeAcknowledgexs:boolean
    optimizeAcknowledgeTimeOutxs:longThe max time in milliseconds between optimized ack batches
    optimizedAckScheduledAckIntervalxs:longGets the configured time interval that is used to force all MessageConsumers that have optimizedAcknowledge enabled -to send an ack for any outstanding Message Acks. By default this value is set to zero meaning that the consumers -will not do any background Message acknowledgment.
    optimizedMessageDispatchxs:booleanIf this flag is set then an larger prefetch limit is used - only -applicable for durable topic subscribers.
    passwordxs:stringSets the JMS password used for connections created from this factory
    producerWindowSizexs:integer
    sendAcksAsyncxs:boolean
    sendTimeoutxs:integer
    statsEnabledxs:boolean
    transactedIndividualAckxs:booleanwhen true, submit individual transacted acks immediately rather than with transaction completion. -This allows the acks to represent delivery status which can be persisted on rollback -Used in conjunction with org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter#setRewriteOnRedelivery(boolean) true
    useAsyncSendxs:booleanForces the use of Async Sends which -adds a massive performance boost; but means that the send() method will -return immediately whether the message has been sent or not which could -lead to message loss.
    useBeanNameAsClientIdPrefixxs:boolean
    useCompressionxs:booleanEnables the use of compression of the message bodies
    useDedicatedTaskRunnerxs:boolean
    useRetroactiveConsumerxs:booleanSets whether or not retroactive consumers are enabled. Retroactive -consumers allow non-durable topic subscribers to receive old messages -that were published before the non-durable subscriber started.
    userNamexs:stringSets the JMS userName used by connections created by this factory
    warnAboutUnstartedConnectionTimeoutxs:longEnables the timeout from a connection creation to when a warning is -generated if the connection is not properly started via -{@link Connection#start()} and a message is received by a consumer. It is -a very common gotcha to forget to start -the connection so this option makes the default case to create a -warning if the user forgets. To disable the warning just set the value to < -0 (say -1).
    watchTopicAdvisoriesxs:boolean
    xaAckModexs:integer
    - - - - - - - - - - - - - - - -
    ElementTypeDescription
    blobTransferPolicy<spring:bean/>Sets the policy used to describe how out-of-band BLOBs (Binary Large -OBjects) are transferred from producers to brokers to consumers
    clientIdGenerator<spring:bean/>
    clientInternalExceptionListener<spring:bean/>Allows an {@link ClientInternalExceptionListener} to be configured on the ConnectionFactory so that when this factory -is used by frameworks which don't expose the Connection such as Spring JmsTemplate, you can register -an exception listener. -

    Note: access to this clientInternalExceptionListener will not be serialized if it is associated with more than -on connection (as it will be if more than one connection is subsequently created by this connection factory)

    connectionIdGenerator<spring:bean/>
    exceptionListener<spring:bean/>Allows an {@link ExceptionListener} to be configured on the ConnectionFactory so that when this factory -is used by frameworks which don't expose the Connection such as Spring JmsTemplate, you can register -an exception listener. -

    Note: access to this exceptionLinstener will not be serialized if it is associated with more than -on connection (as it will be if more than one connection is subsequently created by this connection factory)

    prefetchPolicyprefetchPolicySets the prefetch -policy for consumers created by this connection.
    properties<spring:bean/>Get the properties from this instance for storing in JNDI
    redeliveryPolicyredeliveryPolicySets the global default redelivery policy to be used when a message is delivered -but the session is rolled back
    redeliveryPolicyMapredeliveryPolicyMapSets the global redelivery policy mapping to be used when a message is delivered -but the session is rolled back
    rejectedTaskHandler<spring:bean/>
    sessionTaskRunnertaskRunnerFactory
    transformer<spring:bean/>Sets the transformer used to transform messages before they are sent on -to the JMS bus or when they are received from the bus but before they are -delivered to the JMS client
    transportListener<spring:bean/>Allows a listener to be configured on the ConnectionFactory so that when this factory is used -with frameworks which don't expose the Connection such as Spring JmsTemplate, you can still register -a transport listener.
    - - - diff --git a/uk.ac.diamond.org.apache.activemq/activemq.xsd.wiki b/uk.ac.diamond.org.apache.activemq/activemq.xsd.wiki deleted file mode 100644 index 6253d238e..000000000 --- a/uk.ac.diamond.org.apache.activemq/activemq.xsd.wiki +++ /dev/null @@ -1,3933 +0,0 @@ -h3. Elements By Type -{anchor:org.apache.activemq.util.IOExceptionHandler-types} -h4. The _[org.apache.activemq.util.IOExceptionHandler|#org.apache.activemq.util.IOExceptionHandler-types]_ Type Implementations - | _[|#defaultIOExceptionHandler-element]_ | {html}{html} | - | _[|#jDBCIOExceptionHandler-element]_ | {html}{html} | - -{anchor:org.apache.activemq.usage.SystemUsage-types} -h4. The _[org.apache.activemq.usage.SystemUsage|#org.apache.activemq.usage.SystemUsage-types]_ Type Implementations - | _[|#systemUsage-element]_ | {html}Holder for Usage instances for memory, store and temp files Main use case is -manage memory usage.{html} | - -{anchor:org.apache.activemq.security.AuthorizationMap-types} -h4. The _[org.apache.activemq.security.AuthorizationMap|#org.apache.activemq.security.AuthorizationMap-types]_ Type Implementations - | _[|#authorizationMap-element]_ | {html}{html} | - | _[|#cachedLDAPAuthorizationMap-element]_ | {html}A {@link DefaultAuthorizationMap} implementation which uses LDAP to initialize and update authorization -policy.{html} | - | _[|#lDAPAuthorizationMap-element]_ | {html}An {@link AuthorizationMap} which uses LDAP{html} | - | _[|#simpleAuthorizationMap-element]_ | {html}An AuthorizationMap which is configured with individual DestinationMaps for -each operation.{html} | - -{anchor:org.apache.activemq.store.jdbc.JDBCAdapter-types} -h4. The _[org.apache.activemq.store.jdbc.JDBCAdapter|#org.apache.activemq.store.jdbc.JDBCAdapter-types]_ Type Implementations - | _[|#axionJDBCAdapter-element]_ | {html}Axion specific Adapter. - -Axion does not seem to support ALTER statements or sub-selects. This means: -- We cannot auto upgrade the schema was we roll out new versions of ActiveMQ -- We cannot delete durable sub messages that have be acknowledged by all consumers.{html} | - | _[|#blobJDBCAdapter-element]_ | {html}This JDBCAdapter inserts and extracts BLOB data using the getBlob()/setBlob() -operations. This is a little more involved since to insert a blob you have -to: - -1: insert empty blob. 2: select the blob 3: finally update the blob with data -value. - -The databases/JDBC drivers that use this adapter are: -
      -
    • -
    {html} | - | _[|#bytesJDBCAdapter-element]_ | {html}This JDBCAdapter inserts and extracts BLOB data using the -setBytes()/getBytes() operations. The databases/JDBC drivers that use this -adapter are:{html} | - | _[|#db2JDBCAdapter-element]_ | {html}{html} | - | _[|#defaultJDBCAdapter-element]_ | {html}Implements all the default JDBC operations that are used by the JDBCPersistenceAdapter.

    sub-classing is -encouraged to override the default implementation of methods to account for differences in JDBC Driver -implementations.

    The JDBCAdapter inserts and extracts BLOB data using the getBytes()/setBytes() operations.

    -The databases/JDBC drivers that use this adapter are: -

      -
    • -
    {html} | - | _[|#hsqldb-jdbc-adapter-element]_ | {html}{html} | - | _[|#imageBasedJDBCAdaptor-element]_ | {html}Provides JDBCAdapter since that uses -IMAGE datatype to hold binary data. - -The databases/JDBC drivers that use this adapter are: -
      -
    • Sybase
    • -
    • MS SQL
    • -
    {html} | - | _[|#informixJDBCAdapter-element]_ | {html}JDBC Adapter for Informix database. -Because Informix database restricts length of composite primary keys, length of -container name field and subscription id field must be reduced to 150 characters. -Therefore be sure not to use longer names for container name and subscription id than 150 characters.{html} | - | _[|#maxdb-jdbc-adapter-element]_ | {html}JDBC Adapter for the MaxDB database.{html} | - | _[|#mysql-jdbc-adapter-element]_ | {html}{html} | - | _[|#oracleBlobJDBCAdapter-element]_ | {html}Implements all the default JDBC operations that are used -by the JDBCPersistenceAdapter. -

    -Subclassing is encouraged to override the default -implementation of methods to account for differences -in JDBC Driver implementations. -

    -The JDBCAdapter inserts and extracts BLOB data using the -getBytes()/setBytes() operations. -

    -The databases/JDBC drivers that use this adapter are: -

      -
    • -
    {html} | - | _[|#oracleJDBCAdapter-element]_ | {html}Implements all the default JDBC operations that are used -by the JDBCPersistenceAdapter. -

    -Subclassing is encouraged to override the default -implementation of methods to account for differences -in JDBC Driver implementations. -

    {html} | - | _[|#postgresql-jdbc-adapter-element]_ | {html}Implements all the default JDBC operations that are used -by the JDBCPersistenceAdapter. -

    -Subclassing is encouraged to override the default -implementation of methods to account for differences -in JDBC Driver implementations. -

    -The JDBCAdapter inserts and extracts BLOB data using the -getBytes()/setBytes() operations. -

    -The databases/JDBC drivers that use this adapter are: -

      -
    • -
    {html} | - | _[|#streamJDBCAdapter-element]_ | {html}This JDBCAdapter inserts and extracts BLOB data using the -setBinaryStream()/getBinaryStream() operations. - -The databases/JDBC drivers that use this adapter are: -
      -
    • Axion
    • -
    {html} | - | _[|#sybase-jdbc-adapter-element]_ | {html}A JDBC Adapter for Sybase databases{html} | - | _[|#transact-jdbc-adapter-element]_ | {html}A JDBC Adapter for Transact-SQL based databases such as SQL Server or Sybase{html} | - -{anchor:javax.jms.Queue-types} -h4. The _[javax.jms.Queue|#javax.jms.Queue-types]_ Type Implementations - | _[|#queue-element]_ | {html}An ActiveMQ Queue{html} | - -{anchor:org.apache.activemq.broker.region.policy.SlowConsumerStrategy-types} -h4. The _[org.apache.activemq.broker.region.policy.SlowConsumerStrategy|#org.apache.activemq.broker.region.policy.SlowConsumerStrategy-types]_ Type Implementations - | _[|#abortSlowAckConsumerStrategy-element]_ | {html}Abort slow consumers when they reach the configured threshold of slowness, - -default is that a consumer that has not Ack'd a message for 30 seconds is slow.{html} | - | _[|#abortSlowConsumerStrategy-element]_ | {html}Abort slow consumers when they reach the configured threshold of slowness, default is slow for 30 seconds{html} | - -{anchor:org.apache.activemq.store.PListStore-types} -h4. The _[org.apache.activemq.store.PListStore|#org.apache.activemq.store.PListStore-types]_ Type Implementations - | _[|#levelDB-element]_ | {html}An implementation of {@link org.apache.activemq.store.PersistenceAdapter} designed for use with -LevelDB - Embedded Lightweight Non-Relational Database{html} | - | _[|#pListStoreImpl-element]_ | {html}{html} | - | _[|#replicatedLevelDB-element]_ | {html}An implementation of {@link org.apache.activemq.store.PersistenceAdapter} designed for use with -LevelDB - Embedded Lightweight Non-Relational Database{html} | - -{anchor:org.apache.activemq.network.NetworkConnector-types} -h4. The _[org.apache.activemq.network.NetworkConnector|#org.apache.activemq.network.NetworkConnector-types]_ Type Implementations - | _[|#ldapNetworkConnector-element]_ | {html}class to create dynamic network connectors listed in an directory server -using the LDAP v3 protocol as defined in RFC 2251, the entries listed in the -directory server must implement the ipHost and ipService objectClasses as -defined in RFC 2307.{html} | - | _[|#multicastNetworkConnector-element]_ | {html}A network connector which uses some kind of multicast-like transport that -communicates with potentially many remote brokers over a single logical -{@link Transport} instance such as when using multicast. - -This implementation does not depend on multicast at all; any other group -based transport could be used.{html} | - | _[|#networkConnector-element]_ | {html}A network connector which uses a discovery agent to detect the remote brokers -available and setup a connection to each available remote broker{html} | - -{anchor:org.apache.activemq.broker.region.virtual.VirtualDestination-types} -h4. The _[org.apache.activemq.broker.region.virtual.VirtualDestination|#org.apache.activemq.broker.region.virtual.VirtualDestination-types]_ Type Implementations - | _[|#compositeQueue-element]_ | {html}Represents a virtual queue which forwards to a number of other destinations.{html} | - | _[|#compositeTopic-element]_ | {html}Represents a virtual topic which forwards to a number of other destinations.{html} | - | _[|#virtualTopic-element]_ | {html}Creates Virtual -Topics using a prefix and postfix. The virtual destination creates a -wildcard that is then used to look up all active queue subscriptions which -match.{html} | - -{anchor:org.apache.activemq.store.jdbc.JDBCPersistenceAdapter-types} -h4. The _[org.apache.activemq.store.jdbc.JDBCPersistenceAdapter|#org.apache.activemq.store.jdbc.JDBCPersistenceAdapter-types]_ Type Implementations - | _[|#jdbcPersistenceAdapter-element]_ | {html}A {@link PersistenceAdapter} implementation using JDBC for persistence -storage. - -This persistence adapter will correctly remember prepared XA transactions, -but it will not keep track of local transaction commits so that operations -performed against the Message store are done as a single uow.{html} | - -{anchor:org.apache.activemq.store.PersistenceAdapterFactory-types} -h4. The _[org.apache.activemq.store.PersistenceAdapterFactory|#org.apache.activemq.store.PersistenceAdapterFactory-types]_ Type Implementations - | _[|#journalPersistenceAdapterFactory-element]_ | {html}Factory class that can create PersistenceAdapter objects.{html} | - | _[|#journaledJDBC-element]_ | {html}Creates a default persistence model using the Journal and JDBC{html} | - -{anchor:org.apache.activemq.usage.MemoryUsage-types} -h4. The _[org.apache.activemq.usage.MemoryUsage|#org.apache.activemq.usage.MemoryUsage-types]_ Type Implementations - | _[|#memoryUsage-element]_ | {html}Used to keep track of how much of something is being used so that a -productive working set usage can be controlled. Main use case is manage -memory usage.{html} | - -{anchor:org.apache.activemq.broker.region.policy.DispatchPolicy-types} -h4. The _[org.apache.activemq.broker.region.policy.DispatchPolicy|#org.apache.activemq.broker.region.policy.DispatchPolicy-types]_ Type Implementations - | _[|#priorityDispatchPolicy-element]_ | {html}Priority dispatch policy that sends a message to every subscription that -matches the message in consumer priority order.{html} | - | _[|#priorityNetworkDispatchPolicy-element]_ | {html}dispatch policy that ignores lower priority duplicate network consumers, -used in conjunction with network bridge suppresDuplicateTopicSubscriptions{html} | - | _[|#roundRobinDispatchPolicy-element]_ | {html}Simple dispatch policy that sends a message to every subscription that -matches the message.{html} | - | _[|#simpleDispatchPolicy-element]_ | {html}Simple dispatch policy that sends a message to every subscription that -matches the message.{html} | - | _[|#strictOrderDispatchPolicy-element]_ | {html}Dispatch policy that causes every subscription to see messages in the same -order.{html} | - -{anchor:org.apache.activemq.usage.TempUsage-types} -h4. The _[org.apache.activemq.usage.TempUsage|#org.apache.activemq.usage.TempUsage-types]_ Type Implementations - | _[|#tempUsage-element]_ | {html}Used to keep track of how much of something is being used so that a -productive working set usage can be controlled. Main use case is manage -memory usage.{html} | - -{anchor:org.apache.activemq.usage.StoreUsage-types} -h4. The _[org.apache.activemq.usage.StoreUsage|#org.apache.activemq.usage.StoreUsage-types]_ Type Implementations - | _[|#storeUsage-element]_ | {html}Used to keep track of how much of something is being used so that a -productive working set usage can be controlled. Main use case is manage -memory usage.{html} | - -{anchor:org.apache.activemq.network.jms.ReconnectionPolicy-types} -h4. The _[org.apache.activemq.network.jms.ReconnectionPolicy|#org.apache.activemq.network.jms.ReconnectionPolicy-types]_ Type Implementations - | _[|#reconnectionPolicy-element]_ | {html}A policy object that defines how a {@link JmsConnector} deals with -reconnection of the local and foreign connections.{html} | - -{anchor:org.apache.activemq.broker.region.policy.SubscriptionRecoveryPolicy-types} -h4. The _[org.apache.activemq.broker.region.policy.SubscriptionRecoveryPolicy|#org.apache.activemq.broker.region.policy.SubscriptionRecoveryPolicy-types]_ Type Implementations - | _[|#fixedCountSubscriptionRecoveryPolicy-element]_ | {html}This implementation of {@link SubscriptionRecoveryPolicy} will keep a fixed -count of last messages.{html} | - | _[|#fixedSizedSubscriptionRecoveryPolicy-element]_ | {html}This implementation of {@link SubscriptionRecoveryPolicy} will keep a fixed -amount of memory available in RAM for message history which is evicted in -time order.{html} | - | _[|#lastImageSubscriptionRecoveryPolicy-element]_ | {html}This implementation of {@link SubscriptionRecoveryPolicy} will only keep the -last message.{html} | - | _[|#noSubscriptionRecoveryPolicy-element]_ | {html}This SubscriptionRecoveryPolicy disable recovery of messages.{html} | - | _[|#queryBasedSubscriptionRecoveryPolicy-element]_ | {html}This implementation of {@link SubscriptionRecoveryPolicy} will perform a user -specific query mechanism to load any messages they may have missed.{html} | - | _[|#timedSubscriptionRecoveryPolicy-element]_ | {html}This implementation of {@link SubscriptionRecoveryPolicy} will keep a timed -buffer of messages around in memory and use that to recover new -subscriptions.{html} | - -{anchor:org.apache.activemq.thread.TaskRunnerFactory-types} -h4. The _[org.apache.activemq.thread.TaskRunnerFactory|#org.apache.activemq.thread.TaskRunnerFactory-types]_ Type Implementations - | _[|#taskRunnerFactory-element]_ | {html}Manages the thread pool for long running tasks. Long running tasks are not -always active but when they are active, they may need a few iterations of -processing for them to become idle. The manager ensures that each task is -processes but that no one task overtakes the system. This is kinda like -cooperative multitasking.{html} | - -{anchor:org.apache.activemq.broker.region.group.MessageGroupMapFactory-types} -h4. The _[org.apache.activemq.broker.region.group.MessageGroupMapFactory|#org.apache.activemq.broker.region.group.MessageGroupMapFactory-types]_ Type Implementations - | _[|#cachedMessageGroupMapFactory-element]_ | {html}A factory to create instances of {@link org.apache.activemq.broker.region.group.CachedMessageGroupMap} when implementing the -Message Groups functionality.{html} | - | _[|#messageGroupHashBucketFactory-element]_ | {html}A factory to create instances of {@link SimpleMessageGroupMap} when -implementing the Message -Groups functionality.{html} | - | _[|#simpleMessageGroupMapFactory-element]_ | {html}A factory to create instances of {@link SimpleMessageGroupMap} when implementing the -Message Groups functionality.{html} | - -{anchor:org.apache.activemq.broker.SslContext-types} -h4. The _[org.apache.activemq.broker.SslContext|#org.apache.activemq.broker.SslContext-types]_ Type Implementations - | _[|#sslContext-element]_ | {html}Extends the SslContext so that it's easier to configure from spring.{html} | - -{anchor:org.apache.activemq.broker.region.DestinationInterceptor-types} -h4. The _[org.apache.activemq.broker.region.DestinationInterceptor|#org.apache.activemq.broker.region.DestinationInterceptor-types]_ Type Implementations - | _[|#mirroredQueue-element]_ | {html}Creates Mirrored -Queue using a prefix and postfix to define the topic name on which to mirror the queue to.{html} | - | _[|#virtualDestinationInterceptor-element]_ | {html}Implements Virtual Topics.{html} | - -{anchor:org.apache.activemq.network.jms.InboundQueueBridge-types} -h4. The _[org.apache.activemq.network.jms.InboundQueueBridge|#org.apache.activemq.network.jms.InboundQueueBridge-types]_ Type Implementations - | _[|#inboundQueueBridge-element]_ | {html}Create an Inbound Queue Bridge. By default this class uses the sname name for -both the inbound and outbound queue. This behavior can be overridden however -by using the setter methods to configure both the inbound and outboud queue names -separately.{html} | - -{anchor:org.apache.activemq.broker.BrokerService-types} -h4. The _[org.apache.activemq.broker.BrokerService|#org.apache.activemq.broker.BrokerService-types]_ Type Implementations - | _[|#broker-element]_ | {html}An ActiveMQ Message Broker. It consists of a number of transport -connectors, network connectors and a bunch of properties which can be used to -configure the broker as its lazily created.{html} | - | _[|#brokerService-element]_ | {html}Manages the life-cycle of an ActiveMQ Broker. A BrokerService consists of a -number of transport connectors, network connectors and a bunch of properties -which can be used to configure the broker as its lazily created.{html} | - -{anchor:org.apache.activemq.network.DemandForwardingBridgeSupport-types} -h4. The _[org.apache.activemq.network.DemandForwardingBridgeSupport|#org.apache.activemq.network.DemandForwardingBridgeSupport-types]_ Type Implementations - | _[|#compositeDemandForwardingBridge-element]_ | {html}A demand forwarding bridge which works with multicast style transports where -a single Transport could be communicating with multiple remote brokers{html} | - | _[|#demandForwardingBridge-element]_ | {html}Forwards messages from the local broker to the remote broker based on demand.{html} | - -{anchor:javax.jms.QueueConnectionFactory-types} -h4. The _[javax.jms.QueueConnectionFactory|#javax.jms.QueueConnectionFactory-types]_ Type Implementations - | _[|#connectionFactory-element]_ | {html}A Spring enhanced connection -factory which will automatically use the Spring bean name as the clientIDPrefix property -so that connections created have client IDs related to your Spring.xml file for -easier comprehension from JMX.{html} | - | _[|#xaConnectionFactory-element]_ | {html}A Spring enhanced XA connection -factory which will automatically use the Spring bean name as the clientIDPrefix property -so that connections created have client IDs related to your Spring.xml file for -easier comprehension from JMX.{html} | - -{anchor:org.apache.activemq.ActiveMQPrefetchPolicy-types} -h4. The _[org.apache.activemq.ActiveMQPrefetchPolicy|#org.apache.activemq.ActiveMQPrefetchPolicy-types]_ Type Implementations - | _[|#prefetchPolicy-element]_ | {html}Defines the prefetch message policies for different types of consumers{html} | - -{anchor:org.apache.activemq.broker.region.policy.PolicyMap-types} -h4. The _[org.apache.activemq.broker.region.policy.PolicyMap|#org.apache.activemq.broker.region.policy.PolicyMap-types]_ Type Implementations - | _[|#policyMap-element]_ | {html}Represents a destination based configuration of policies so that individual -destinations or wildcard hierarchies of destinations can be configured using -different policies.{html} | - -{anchor:org.apache.activemq.network.jms.OutboundTopicBridge-types} -h4. The _[org.apache.activemq.network.jms.OutboundTopicBridge|#org.apache.activemq.network.jms.OutboundTopicBridge-types]_ Type Implementations - | _[|#outboundTopicBridge-element]_ | {html}Create an Outbound Topic Bridge. By default the bridge uses the same -name for both the inbound and outbound topics, however this can be altered -by using the public setter methods to configure both inbound and outbound -topic names.{html} | - -{anchor:org.apache.activemq.RedeliveryPolicy-types} -h4. The _[org.apache.activemq.RedeliveryPolicy|#org.apache.activemq.RedeliveryPolicy-types]_ Type Implementations - | _[|#redeliveryPolicy-element]_ | {html}Configuration options for a messageConsumer used to control how messages are re-delivered when they -are rolled back. -May be used server side on a per destination basis via the Broker RedeliveryPlugin{html} | - -{anchor:org.apache.activemq.Service-types} -h4. The _[org.apache.activemq.Service|#org.apache.activemq.Service-types]_ Type Implementations - | _[|#broker-element]_ | {html}An ActiveMQ Message Broker. It consists of a number of transport -connectors, network connectors and a bunch of properties which can be used to -configure the broker as its lazily created.{html} | - | _[|#brokerService-element]_ | {html}Manages the life-cycle of an ActiveMQ Broker. A BrokerService consists of a -number of transport connectors, network connectors and a bunch of properties -which can be used to configure the broker as its lazily created.{html} | - | _[|#database-locker-element]_ | {html}Represents an exclusive lock on a database to avoid multiple brokers running -against the same logical database.{html} | - | _[|#forwardingBridge-element]_ | {html}Forwards all messages from the local broker to the remote broker.{html} | - | _[|#inboundQueueBridge-element]_ | {html}Create an Inbound Queue Bridge. By default this class uses the sname name for -both the inbound and outbound queue. This behavior can be overridden however -by using the setter methods to configure both the inbound and outboud queue names -separately.{html} | - | _[|#inboundTopicBridge-element]_ | {html}Create an Inbound Topic Bridge. By default this class uses the topic name for -both the inbound and outbound topic. This behavior can be overridden however -by using the setter methods to configure both the inbound and outboud topic names -separately.{html} | - | _[|#jdbcPersistenceAdapter-element]_ | {html}A {@link PersistenceAdapter} implementation using JDBC for persistence -storage. - -This persistence adapter will correctly remember prepared XA transactions, -but it will not keep track of local transaction commits so that operations -performed against the Message store are done as a single uow.{html} | - | _[|#jmsQueueConnector-element]_ | {html}A Bridge to other JMS Queue providers{html} | - | _[|#jmsTopicConnector-element]_ | {html}A Bridge to other JMS Topic providers{html} | - | _[|#jobSchedulerUsage-element]_ | {html}Used to keep track of how much of something is being used so that a -productive working set usage can be controlled. Main use case is manage -memory usage.{html} | - | _[|#journalPersistenceAdapterFactory-element]_ | {html}Factory class that can create PersistenceAdapter objects.{html} | - | _[|#journaledJDBC-element]_ | {html}Creates a default persistence model using the Journal and JDBC{html} | - | _[|#kahaDB-element]_ | {html}An implementation of {@link PersistenceAdapter} designed for use with -KahaDB - Embedded Lightweight Non-Relational Database{html} | - | _[|#ldapNetworkConnector-element]_ | {html}class to create dynamic network connectors listed in an directory server -using the LDAP v3 protocol as defined in RFC 2251, the entries listed in the -directory server must implement the ipHost and ipService objectClasses as -defined in RFC 2307.{html} | - | _[|#lease-database-locker-element]_ | {html}Represents an exclusive lease on a database to avoid multiple brokers running -against the same logical database.{html} | - | _[|#levelDB-element]_ | {html}An implementation of {@link org.apache.activemq.store.PersistenceAdapter} designed for use with -LevelDB - Embedded Lightweight Non-Relational Database{html} | - | _[|#mKahaDB-element]_ | {html}An implementation of {@link org.apache.activemq.store.PersistenceAdapter} that supports -distribution of destinations across multiple kahaDB persistence adapters{html} | - | _[|#managementContext-element]_ | {html}An abstraction over JMX mbean registration{html} | - | _[|#memoryUsage-element]_ | {html}Used to keep track of how much of something is being used so that a -productive working set usage can be controlled. Main use case is manage -memory usage.{html} | - | _[|#multicastNetworkConnector-element]_ | {html}A network connector which uses some kind of multicast-like transport that -communicates with potentially many remote brokers over a single logical -{@link Transport} instance such as when using multicast. - -This implementation does not depend on multicast at all; any other group -based transport could be used.{html} | - | _[|#networkConnector-element]_ | {html}A network connector which uses a discovery agent to detect the remote brokers -available and setup a connection to each available remote broker{html} | - | _[|#outboundQueueBridge-element]_ | {html}Create an Outbound Queue Bridge. By default the bridge uses the same -name for both the inbound and outbound queues, however this can be altered -by using the public setter methods to configure both inbound and outbound -queue names.{html} | - | _[|#outboundTopicBridge-element]_ | {html}Create an Outbound Topic Bridge. By default the bridge uses the same -name for both the inbound and outbound topics, however this can be altered -by using the public setter methods to configure both inbound and outbound -topic names.{html} | - | _[|#pListStoreImpl-element]_ | {html}{html} | - | _[|#proxyConnector-element]_ | {html}{html} | - | _[|#replicatedLevelDB-element]_ | {html}An implementation of {@link org.apache.activemq.store.PersistenceAdapter} designed for use with -LevelDB - Embedded Lightweight Non-Relational Database{html} | - | _[|#shared-file-locker-element]_ | {html}Represents an exclusive lock on a database to avoid multiple brokers running -against the same logical database.{html} | - | _[|#storeUsage-element]_ | {html}Used to keep track of how much of something is being used so that a -productive working set usage can be controlled. Main use case is manage -memory usage.{html} | - | _[|#systemUsage-element]_ | {html}Holder for Usage instances for memory, store and temp files Main use case is -manage memory usage.{html} | - | _[|#tempUsage-element]_ | {html}Used to keep track of how much of something is being used so that a -productive working set usage can be controlled. Main use case is manage -memory usage.{html} | - | _[|#transact-database-locker-element]_ | {html}Represents an exclusive lock on a database to avoid multiple brokers running -against the same logical database.{html} | - -{anchor:org.apache.activemq.broker.region.policy.DeadLetterStrategy-types} -h4. The _[org.apache.activemq.broker.region.policy.DeadLetterStrategy|#org.apache.activemq.broker.region.policy.DeadLetterStrategy-types]_ Type Implementations - | _[|#discarding-element]_ | {html}Dead Letter Strategy that discards all messages{html} | - | _[|#individualDeadLetterStrategy-element]_ | {html}A {@link DeadLetterStrategy} where each destination has its own individual -DLQ using the subject naming hierarchy.{html} | - | _[|#sharedDeadLetterStrategy-element]_ | {html}A default implementation of {@link DeadLetterStrategy} which uses -a constant destination.{html} | - -{anchor:org.apache.activemq.command.ActiveMQDestination-types} -h4. The _[org.apache.activemq.command.ActiveMQDestination|#org.apache.activemq.command.ActiveMQDestination-types]_ Type Implementations - | _[|#queue-element]_ | {html}An ActiveMQ Queue{html} | - | _[|#tempQueue-element]_ | {html}An ActiveMQ Temporary Queue Destination{html} | - | _[|#tempTopic-element]_ | {html}An ActiveMQ Temporary Topic Destination{html} | - | _[|#topic-element]_ | {html}An ActiveMQ Topic{html} | - -{anchor:org.apache.activemq.security.TempDestinationAuthorizationEntry-types} -h4. The _[org.apache.activemq.security.TempDestinationAuthorizationEntry|#org.apache.activemq.security.TempDestinationAuthorizationEntry-types]_ Type Implementations - | _[|#tempDestinationAuthorizationEntry-element]_ | {html}Represents an entry in a {@link DefaultAuthorizationMap} for assigning -different operations (read, write, admin) of user roles to a temporary -destination{html} | - -{anchor:org.apache.activemq.broker.LockableServiceSupport-types} -h4. The _[org.apache.activemq.broker.LockableServiceSupport|#org.apache.activemq.broker.LockableServiceSupport-types]_ Type Implementations - | _[|#jdbcPersistenceAdapter-element]_ | {html}A {@link PersistenceAdapter} implementation using JDBC for persistence -storage. - -This persistence adapter will correctly remember prepared XA transactions, -but it will not keep track of local transaction commits so that operations -performed against the Message store are done as a single uow.{html} | - | _[|#journalPersistenceAdapterFactory-element]_ | {html}Factory class that can create PersistenceAdapter objects.{html} | - | _[|#journaledJDBC-element]_ | {html}Creates a default persistence model using the Journal and JDBC{html} | - | _[|#kahaDB-element]_ | {html}An implementation of {@link PersistenceAdapter} designed for use with -KahaDB - Embedded Lightweight Non-Relational Database{html} | - | _[|#levelDB-element]_ | {html}An implementation of {@link org.apache.activemq.store.PersistenceAdapter} designed for use with -LevelDB - Embedded Lightweight Non-Relational Database{html} | - | _[|#mKahaDB-element]_ | {html}An implementation of {@link org.apache.activemq.store.PersistenceAdapter} that supports -distribution of destinations across multiple kahaDB persistence adapters{html} | - | _[|#replicatedLevelDB-element]_ | {html}An implementation of {@link org.apache.activemq.store.PersistenceAdapter} designed for use with -LevelDB - Embedded Lightweight Non-Relational Database{html} | - -{anchor:javax.jms.Topic-types} -h4. The _[javax.jms.Topic|#javax.jms.Topic-types]_ Type Implementations - | _[|#topic-element]_ | {html}An ActiveMQ Topic{html} | - -{anchor:org.apache.activemq.usage.JobSchedulerUsage-types} -h4. The _[org.apache.activemq.usage.JobSchedulerUsage|#org.apache.activemq.usage.JobSchedulerUsage-types]_ Type Implementations - | _[|#jobSchedulerUsage-element]_ | {html}Used to keep track of how much of something is being used so that a -productive working set usage can be controlled. Main use case is manage -memory usage.{html} | - -{anchor:org.apache.activemq.broker.region.policy.PendingDurableSubscriberMessageStoragePolicy-types} -h4. The _[org.apache.activemq.broker.region.policy.PendingDurableSubscriberMessageStoragePolicy|#org.apache.activemq.broker.region.policy.PendingDurableSubscriberMessageStoragePolicy-types]_ Type Implementations - | _[|#fileDurableSubscriberCursor-element]_ | {html}Pending messages for durable subscribers{html} | - | _[|#storeDurableSubscriberCursor-element]_ | {html}Pending messages for a durable{html} | - | _[|#vmDurableCursor-element]_ | {html}Pending{html} | - -{anchor:javax.jms.TopicConnectionFactory-types} -h4. The _[javax.jms.TopicConnectionFactory|#javax.jms.TopicConnectionFactory-types]_ Type Implementations - | _[|#connectionFactory-element]_ | {html}A Spring enhanced connection -factory which will automatically use the Spring bean name as the clientIDPrefix property -so that connections created have client IDs related to your Spring.xml file for -easier comprehension from JMX.{html} | - | _[|#xaConnectionFactory-element]_ | {html}A Spring enhanced XA connection -factory which will automatically use the Spring bean name as the clientIDPrefix property -so that connections created have client IDs related to your Spring.xml file for -easier comprehension from JMX.{html} | - -{anchor:org.apache.activemq.store.jdbc.Statements-types} -h4. The _[org.apache.activemq.store.jdbc.Statements|#org.apache.activemq.store.jdbc.Statements-types]_ Type Implementations - | _[|#statements-element]_ | {html}{html} | - -{anchor:org.apache.activemq.security.AuthorizationEntry-types} -h4. The _[org.apache.activemq.security.AuthorizationEntry|#org.apache.activemq.security.AuthorizationEntry-types]_ Type Implementations - | _[|#authorizationEntry-element]_ | {html}Represents an entry in a {@link DefaultAuthorizationMap} for assigning -different operations (read, write, admin) of user roles to a specific -destination or a hierarchical wildcard area of destinations.{html} | - | _[|#tempDestinationAuthorizationEntry-element]_ | {html}Represents an entry in a {@link DefaultAuthorizationMap} for assigning -different operations (read, write, admin) of user roles to a temporary -destination{html} | - -{anchor:org.apache.activemq.filter.DestinationMap-types} -h4. The _[org.apache.activemq.filter.DestinationMap|#org.apache.activemq.filter.DestinationMap-types]_ Type Implementations - | _[|#authorizationMap-element]_ | {html}{html} | - | _[|#policyMap-element]_ | {html}Represents a destination based configuration of policies so that individual -destinations or wildcard hierarchies of destinations can be configured using -different policies.{html} | - | _[|#redeliveryPolicyMap-element]_ | {html}Represents a destination based configuration of policies so that individual -destinations or wildcard hierarchies of destinations can be configured using -different policies.{html} | - -{anchor:org.apache.activemq.network.NetworkBridgeConfiguration-types} -h4. The _[org.apache.activemq.network.NetworkBridgeConfiguration|#org.apache.activemq.network.NetworkBridgeConfiguration-types]_ Type Implementations - | _[|#ldapNetworkConnector-element]_ | {html}class to create dynamic network connectors listed in an directory server -using the LDAP v3 protocol as defined in RFC 2251, the entries listed in the -directory server must implement the ipHost and ipService objectClasses as -defined in RFC 2307.{html} | - | _[|#multicastNetworkConnector-element]_ | {html}A network connector which uses some kind of multicast-like transport that -communicates with potentially many remote brokers over a single logical -{@link Transport} instance such as when using multicast. - -This implementation does not depend on multicast at all; any other group -based transport could be used.{html} | - | _[|#networkConnector-element]_ | {html}A network connector which uses a discovery agent to detect the remote brokers -available and setup a connection to each available remote broker{html} | - -{anchor:org.apache.activemq.broker.region.policy.PendingQueueMessageStoragePolicy-types} -h4. The _[org.apache.activemq.broker.region.policy.PendingQueueMessageStoragePolicy|#org.apache.activemq.broker.region.policy.PendingQueueMessageStoragePolicy-types]_ Type Implementations - | _[|#fileQueueCursor-element]_ | {html}Pending{html} | - | _[|#storeCursor-element]_ | {html}Pending messages{html} | - | _[|#vmQueueCursor-element]_ | {html}Pending messages{html} | - -{anchor:org.apache.activemq.broker.region.policy.RedeliveryPolicyMap-types} -h4. The _[org.apache.activemq.broker.region.policy.RedeliveryPolicyMap|#org.apache.activemq.broker.region.policy.RedeliveryPolicyMap-types]_ Type Implementations - | _[|#redeliveryPolicyMap-element]_ | {html}Represents a destination based configuration of policies so that individual -destinations or wildcard hierarchies of destinations can be configured using -different policies.{html} | - -{anchor:org.apache.activemq.broker.region.policy.PendingSubscriberMessageStoragePolicy-types} -h4. The _[org.apache.activemq.broker.region.policy.PendingSubscriberMessageStoragePolicy|#org.apache.activemq.broker.region.policy.PendingSubscriberMessageStoragePolicy-types]_ Type Implementations - | _[|#fileCursor-element]_ | {html}Pending messages{html} | - | _[|#vmCursor-element]_ | {html}Pending messages held{html} | - -{anchor:org.apache.activemq.network.NetworkBridgeFilterFactory-types} -h4. The _[org.apache.activemq.network.NetworkBridgeFilterFactory|#org.apache.activemq.network.NetworkBridgeFilterFactory-types]_ Type Implementations - | _[|#conditionalNetworkBridgeFilterFactory-element]_ | {html}implement conditional behavior for queue consumers, allows replaying back to -origin if no consumers are present on the local broker after a configurable -delay, irrespective of the TTL. Also allows rate limiting of messages -through the network, useful for static includes{html} | - | _[|#defaultNetworkBridgeFilterFactory-element]_ | {html}implement default behavior, filter that will not allow re-send to origin -based on brokerPath and which respects networkTTL{html} | - -{anchor:javax.jms.ConnectionFactory-types} -h4. The _[javax.jms.ConnectionFactory|#javax.jms.ConnectionFactory-types]_ Type Implementations - | _[|#connectionFactory-element]_ | {html}A Spring enhanced connection -factory which will automatically use the Spring bean name as the clientIDPrefix property -so that connections created have client IDs related to your Spring.xml file for -easier comprehension from JMX.{html} | - | _[|#xaConnectionFactory-element]_ | {html}A Spring enhanced XA connection -factory which will automatically use the Spring bean name as the clientIDPrefix property -so that connections created have client IDs related to your Spring.xml file for -easier comprehension from JMX.{html} | - -{anchor:org.apache.activemq.broker.region.policy.PolicyEntry-types} -h4. The _[org.apache.activemq.broker.region.policy.PolicyEntry|#org.apache.activemq.broker.region.policy.PolicyEntry-types]_ Type Implementations - | _[|#policyEntry-element]_ | {html}Represents an entry in a {@link PolicyMap} for assigning policies to a -specific destination or a hierarchical wildcard area of destinations.{html} | - -{anchor:org.apache.activemq.broker.region.policy.PendingMessageLimitStrategy-types} -h4. The _[org.apache.activemq.broker.region.policy.PendingMessageLimitStrategy|#org.apache.activemq.broker.region.policy.PendingMessageLimitStrategy-types]_ Type Implementations - | _[|#constantPendingMessageLimitStrategy-element]_ | {html}This PendingMessageLimitStrategy is configured to a constant value for all subscriptions.{html} | - | _[|#prefetchRatePendingMessageLimitStrategy-element]_ | {html}This PendingMessageLimitStrategy sets the maximum pending message limit value to be -a multiplier of the prefetch limit of the subscription.{html} | - -{anchor:org.apache.activemq.usage.UsageCapacity-types} -h4. The _[org.apache.activemq.usage.UsageCapacity|#org.apache.activemq.usage.UsageCapacity-types]_ Type Implementations - | _[|#defaultUsageCapacity-element]_ | {html}Identify if a limit has been reached{html} | - | _[|#usageCapacity-element]_ | {html}Identify if a limit has been reached{html} | - -{anchor:org.apache.activemq.broker.BrokerPlugin-types} -h4. The _[org.apache.activemq.broker.BrokerPlugin|#org.apache.activemq.broker.BrokerPlugin-types]_ Type Implementations - | _[|#authorizationPlugin-element]_ | {html}An authorization plugin where each operation on a destination is checked -against an authorizationMap{html} | - | _[|#connectionDotFilePlugin-element]_ | {html}A DOT file creator plugin which -creates a DOT file showing the current connections{html} | - | _[|#destinationDotFilePlugin-element]_ | {html}A DOT -file creator plugin which creates a DOT file showing the current topic & queue hierarchies.{html} | - | _[|#destinationPathSeparatorPlugin-element]_ | {html}{html} | - | _[|#discardingDLQBrokerPlugin-element]_ | {html}{html} | - | _[|#forcePersistencyModeBrokerPlugin-element]_ | {html}A Plugin which allows to force every incoming message to be PERSISTENT or NON-PERSISTENT. - -Useful, if you have set the broker usage policy to process ONLY persistent or ONLY non-persistent -messages.{html} | - | _[|#jaasAuthenticationPlugin-element]_ | {html}Provides a JAAS based authentication plugin{html} | - | _[|#jaasCertificateAuthenticationPlugin-element]_ | {html}Provides a JAAS based SSL certificate authentication plugin{html} | - | _[|#jaasDualAuthenticationPlugin-element]_ | {html}Provides a JAAS based authentication plugin{html} | - | _[|#loggingBrokerPlugin-element]_ | {html}A simple Broker intercepter which allows you to enable/disable logging.{html} | - | _[|#multicastTraceBrokerPlugin-element]_ | {html}A Broker interceptor which allows you to trace all operations to a Multicast -socket.{html} | - | _[|#partitionBrokerPlugin-element]_ | {html}A BrokerPlugin which partitions client connections over a cluster of brokers.{html} | - | _[|#redeliveryPlugin-element]_ | {html}Replace regular DLQ handling with redelivery via a resend to the original destination -after a delay -A destination matching RedeliveryPolicy controls the quantity and delay for re-sends -If there is no matching policy or an existing policy limit is exceeded by default -regular DLQ processing resumes. This is controlled via sendToDlqIfMaxRetriesExceeded -and fallbackToDeadLetter{html} | - | _[|#runtimeConfigurationPlugin-element]_ | {html}Broker plugin that will monitor the broker xml configuration for -changes and selectively apply those changes to the running broker.{html} | - | _[|#simpleAuthenticationPlugin-element]_ | {html}Provides a simple authentication plugin{html} | - | _[|#statisticsBrokerPlugin-element]_ | {html}A StatisticsBrokerPlugin -You can retrieve a Map Message for a Destination - or -Broker containing statistics as key-value pairs The message must contain a -replyTo Destination - else its ignored -To retrieve stats on the broker send a empty message to ActiveMQ.Statistics.Broker (Queue or Topic) -With a replyTo set to the destination you want the stats returned to. -To retrieve stats for a destination - e.g. foo - send an empty message to ActiveMQ.Statistics.Destination.foo -- this works with wildcards to - you get a message for each wildcard match on the replyTo destination. -The stats message is a MapMessage populated with statistics for the target{html} | - | _[|#timeStampingBrokerPlugin-element]_ | {html}A Broker interceptor which updates a JMS Client's timestamp on the message -with a broker timestamp. Useful when the clocks on client machines are known -to not be correct and you can only trust the time set on the broker machines. - -Enabling this plugin will break JMS compliance since the timestamp that the -producer sees on the messages after as send() will be different from the -timestamp the consumer will observe when he receives the message. This plugin -is not enabled in the default ActiveMQ configuration. - -2 new attributes have been added which will allow the administrator some override control -over the expiration time for incoming messages: - -Attribute 'zeroExpirationOverride' can be used to apply an expiration -time to incoming messages with no expiration defined (messages that would never expire) - -Attribute 'ttlCeiling' can be used to apply a limit to the expiration time{html} | - | _[|#traceBrokerPathPlugin-element]_ | {html}The TraceBrokerPathPlugin can be used in a network of Brokers. Each Broker -that has the plugin configured, will add it's brokerName to the content -of a JMS Property. If all Brokers have this property enabled, the path the -message actually took through the network can be seen in the defined property.{html} | - | _[|#udpTraceBrokerPlugin-element]_ | {html}A Broker interceptor which allows you to trace all operations to a UDP -socket.{html} | - | _[|#virtualSelectorCacheBrokerPlugin-element]_ | {html}A plugin which allows the caching of the selector from a subscription queue. -

    -This stops the build-up of unwanted messages, especially when consumers may -disconnect from time to time when using virtual destinations. -

    -This is influenced by code snippets developed by Maciej Rakowicz{html} | - -{anchor:org.apache.activemq.network.jms.JmsMesageConvertor-types} -h4. The _[org.apache.activemq.network.jms.JmsMesageConvertor|#org.apache.activemq.network.jms.JmsMesageConvertor-types]_ Type Implementations - | _[|#simpleJmsMessageConvertor-element]_ | {html}Converts Message from one JMS to another{html} | - -{anchor:org.apache.activemq.broker.PublishedAddressPolicy-types} -h4. The _[org.apache.activemq.broker.PublishedAddressPolicy|#org.apache.activemq.broker.PublishedAddressPolicy-types]_ Type Implementations - | _[|#publishedAddressPolicy-element]_ | {html}Policy object that controls how a TransportConnector publishes the connector's -address to the outside world. By default the connector will publish itself -using the resolved host name of the bound server socket.{html} | - -{anchor:org.apache.activemq.broker.Broker-types} -h4. The _[org.apache.activemq.broker.Broker|#org.apache.activemq.broker.Broker-types]_ Type Implementations - | _[|#destinationPathSeparatorPlugin-element]_ | {html}{html} | - | _[|#forcePersistencyModeBroker-element]_ | {html}A Plugin which allows to force every incoming message to be PERSISTENT or NON-PERSISTENT. - -Useful, if you have set the broker usage policy to process ONLY persistent or ONLY non-persistent -messages.{html} | - | _[|#loggingBrokerPlugin-element]_ | {html}A simple Broker intercepter which allows you to enable/disable logging.{html} | - | _[|#multicastTraceBrokerPlugin-element]_ | {html}A Broker interceptor which allows you to trace all operations to a Multicast -socket.{html} | - | _[|#redeliveryPlugin-element]_ | {html}Replace regular DLQ handling with redelivery via a resend to the original destination -after a delay -A destination matching RedeliveryPolicy controls the quantity and delay for re-sends -If there is no matching policy or an existing policy limit is exceeded by default -regular DLQ processing resumes. This is controlled via sendToDlqIfMaxRetriesExceeded -and fallbackToDeadLetter{html} | - | _[|#timeStampingBrokerPlugin-element]_ | {html}A Broker interceptor which updates a JMS Client's timestamp on the message -with a broker timestamp. Useful when the clocks on client machines are known -to not be correct and you can only trust the time set on the broker machines. - -Enabling this plugin will break JMS compliance since the timestamp that the -producer sees on the messages after as send() will be different from the -timestamp the consumer will observe when he receives the message. This plugin -is not enabled in the default ActiveMQ configuration. - -2 new attributes have been added which will allow the administrator some override control -over the expiration time for incoming messages: - -Attribute 'zeroExpirationOverride' can be used to apply an expiration -time to incoming messages with no expiration defined (messages that would never expire) - -Attribute 'ttlCeiling' can be used to apply a limit to the expiration time{html} | - | _[|#traceBrokerPathPlugin-element]_ | {html}The TraceBrokerPathPlugin can be used in a network of Brokers. Each Broker -that has the plugin configured, will add it's brokerName to the content -of a JMS Property. If all Brokers have this property enabled, the path the -message actually took through the network can be seen in the defined property.{html} | - | _[|#udpTraceBrokerPlugin-element]_ | {html}A Broker interceptor which allows you to trace all operations to a UDP -socket.{html} | - -{anchor:org.apache.activemq.broker.TransportConnector-types} -h4. The _[org.apache.activemq.broker.TransportConnector|#org.apache.activemq.broker.TransportConnector-types]_ Type Implementations - | _[|#transportConnector-element]_ | {html}{html} | - -{anchor:org.apache.activemq.network.jms.InboundTopicBridge-types} -h4. The _[org.apache.activemq.network.jms.InboundTopicBridge|#org.apache.activemq.network.jms.InboundTopicBridge-types]_ Type Implementations - | _[|#inboundTopicBridge-element]_ | {html}Create an Inbound Topic Bridge. By default this class uses the topic name for -both the inbound and outbound topic. This behavior can be overridden however -by using the setter methods to configure both the inbound and outboud topic names -separately.{html} | - -{anchor:org.apache.activemq.network.jms.JmsConnector-types} -h4. The _[org.apache.activemq.network.jms.JmsConnector|#org.apache.activemq.network.jms.JmsConnector-types]_ Type Implementations - | _[|#jmsQueueConnector-element]_ | {html}A Bridge to other JMS Queue providers{html} | - | _[|#jmsTopicConnector-element]_ | {html}A Bridge to other JMS Topic providers{html} | - -{anchor:org.apache.activemq.store.PersistenceAdapter-types} -h4. The _[org.apache.activemq.store.PersistenceAdapter|#org.apache.activemq.store.PersistenceAdapter-types]_ Type Implementations - | _[|#jdbcPersistenceAdapter-element]_ | {html}A {@link PersistenceAdapter} implementation using JDBC for persistence -storage. - -This persistence adapter will correctly remember prepared XA transactions, -but it will not keep track of local transaction commits so that operations -performed against the Message store are done as a single uow.{html} | - | _[|#journalPersistenceAdapter-element]_ | {html}An implementation of {@link PersistenceAdapter} designed for use with a -{@link Journal} and then check pointing asynchronously on a timeout with some -other long term persistent storage.{html} | - | _[|#kahaDB-element]_ | {html}An implementation of {@link PersistenceAdapter} designed for use with -KahaDB - Embedded Lightweight Non-Relational Database{html} | - | _[|#levelDB-element]_ | {html}An implementation of {@link org.apache.activemq.store.PersistenceAdapter} designed for use with -LevelDB - Embedded Lightweight Non-Relational Database{html} | - | _[|#mKahaDB-element]_ | {html}An implementation of {@link org.apache.activemq.store.PersistenceAdapter} that supports -distribution of destinations across multiple kahaDB persistence adapters{html} | - | _[|#memoryPersistenceAdapter-element]_ | {html}{html} | - | _[|#replicatedLevelDB-element]_ | {html}An implementation of {@link org.apache.activemq.store.PersistenceAdapter} designed for use with -LevelDB - Embedded Lightweight Non-Relational Database{html} | - -{anchor:org.apache.activemq.network.jms.OutboundQueueBridge-types} -h4. The _[org.apache.activemq.network.jms.OutboundQueueBridge|#org.apache.activemq.network.jms.OutboundQueueBridge-types]_ Type Implementations - | _[|#outboundQueueBridge-element]_ | {html}Create an Outbound Queue Bridge. By default the bridge uses the same -name for both the inbound and outbound queues, however this can be altered -by using the public setter methods to configure both inbound and outbound -queue names.{html} | - -{anchor:org.apache.activemq.broker.Locker-types} -h4. The _[org.apache.activemq.broker.Locker|#org.apache.activemq.broker.Locker-types]_ Type Implementations - | _[|#database-locker-element]_ | {html}Represents an exclusive lock on a database to avoid multiple brokers running -against the same logical database.{html} | - | _[|#lease-database-locker-element]_ | {html}Represents an exclusive lease on a database to avoid multiple brokers running -against the same logical database.{html} | - | _[|#shared-file-locker-element]_ | {html}Represents an exclusive lock on a database to avoid multiple brokers running -against the same logical database.{html} | - | _[|#transact-database-locker-element]_ | {html}Represents an exclusive lock on a database to avoid multiple brokers running -against the same logical database.{html} | - -{anchor:org.apache.activemq.broker.region.policy.MessageEvictionStrategy-types} -h4. The _[org.apache.activemq.broker.region.policy.MessageEvictionStrategy|#org.apache.activemq.broker.region.policy.MessageEvictionStrategy-types]_ Type Implementations - | _[|#oldestMessageEvictionStrategy-element]_ | {html}An eviction strategy which evicts the oldest message first (which is the -default).{html} | - | _[|#oldestMessageWithLowestPriorityEvictionStrategy-element]_ | {html}An eviction strategy which evicts the oldest message with the lowest priority first.{html} | - | _[|#uniquePropertyMessageEvictionStrategy-element]_ | {html}An eviction strategy which evicts the oldest message within messages with the same property value{html} | - -{anchor:org.apache.activemq.broker.jmx.ManagementContext-types} -h4. The _[org.apache.activemq.broker.jmx.ManagementContext|#org.apache.activemq.broker.jmx.ManagementContext-types]_ Type Implementations - | _[|#managementContext-element]_ | {html}An abstraction over JMX mbean registration{html} | - -{anchor:org.apache.activemq.filter.DestinationMapEntry-types} -h4. The _[org.apache.activemq.filter.DestinationMapEntry|#org.apache.activemq.filter.DestinationMapEntry-types]_ Type Implementations - | _[|#authorizationEntry-element]_ | {html}Represents an entry in a {@link DefaultAuthorizationMap} for assigning -different operations (read, write, admin) of user roles to a specific -destination or a hierarchical wildcard area of destinations.{html} | - | _[|#destinationEntry-element]_ | {html}A default entry in a DestinationMap which holds a single value.{html} | - | _[|#filteredKahaDB-element]_ | {html}{html} | - | _[|#policyEntry-element]_ | {html}Represents an entry in a {@link PolicyMap} for assigning policies to a -specific destination or a hierarchical wildcard area of destinations.{html} | - | _[|#redeliveryPolicy-element]_ | {html}Configuration options for a messageConsumer used to control how messages are re-delivered when they -are rolled back. -May be used server side on a per destination basis via the Broker RedeliveryPlugin{html} | - | _[|#tempDestinationAuthorizationEntry-element]_ | {html}Represents an entry in a {@link DefaultAuthorizationMap} for assigning -different operations (read, write, admin) of user roles to a temporary -destination{html} | - - -{anchor:abortSlowAckConsumerStrategy-element} -h3. The _[|#abortSlowAckConsumerStrategy-element]_ Element - {html}Abort slow consumers when they reach the configured threshold of slowness, - -default is that a consumer that has not Ack'd a message for 30 seconds is slow.{html} -h4. Properties - || Property Name || Type || Description || - | abortConnection | _boolean_ | {html}abort the consumers connection rather than sending a stop command to the remote consumer{html} | - | brokerService | _[org.apache.activemq.broker.Broker|#org.apache.activemq.broker.Broker-types]_ | {html}{html} | - | checkPeriod | _long_ | {html}time in milliseconds between checks for slow subscriptions{html} | - | ignoreIdleConsumers | _boolean_ | {html}Returns whether the strategy is configured to ignore consumers that are simply idle, i.e -consumers that have no pending acks (dispatch queue is empty).{html} | - | ignoreNetworkConsumers | _boolean_ | {html}Sets whether the strategy is configured to ignore consumers that are part of a network -connection to another broker. - -When configured to not ignore idle consumers this strategy acts not only on consumers -that are actually slow but also on any consumer that has not received any messages for -the maxTimeSinceLastAck. This allows for a way to evict idle consumers while also -aborting slow consumers however for a network subscription this can create a lot of -unnecessary churn and if the abort connection option is also enabled this can result -in the entire network connection being torn down and rebuilt for no reason.{html} | - | maxSlowCount | _long_ | {html}number of times a subscription can be deemed slow before triggering abort -effect depends on dispatch rate as slow determination is done on dispatch{html} | - | maxSlowDuration | _long_ | {html}time in milliseconds that a sub can remain slow before triggering -an abort.{html} | - | maxTimeSinceLastAck | _long_ | {html}Gets the maximum time since last Ack before a subscription is considered to be slow.{html} | - | name | _java.lang.String_ | {html}{html} | - -{anchor:abortSlowConsumerStrategy-element} -h3. The _[|#abortSlowConsumerStrategy-element]_ Element - {html}Abort slow consumers when they reach the configured threshold of slowness, default is slow for 30 seconds{html} -h4. Properties - || Property Name || Type || Description || - | abortConnection | _boolean_ | {html}abort the consumers connection rather than sending a stop command to the remote consumer{html} | - | brokerService | _[org.apache.activemq.broker.Broker|#org.apache.activemq.broker.Broker-types]_ | {html}{html} | - | checkPeriod | _long_ | {html}time in milliseconds between checks for slow subscriptions{html} | - | maxSlowCount | _long_ | {html}number of times a subscription can be deemed slow before triggering abort -effect depends on dispatch rate as slow determination is done on dispatch{html} | - | maxSlowDuration | _long_ | {html}time in milliseconds that a sub can remain slow before triggering -an abort.{html} | - | name | _java.lang.String_ | {html}{html} | - -{anchor:authenticationUser-element} -h3. The _[|#authenticationUser-element]_ Element - {html}A helper object used to configure simple authentiaction plugin{html} -h4. Properties - || Property Name || Type || Description || - | groups | _java.lang.String_ | {html}{html} | - | password | _java.lang.String_ | {html}{html} | - | username | _java.lang.String_ | {html}{html} | - -{anchor:authorizationEntry-element} -h3. The _[|#authorizationEntry-element]_ Element - {html}Represents an entry in a {@link DefaultAuthorizationMap} for assigning -different operations (read, write, admin) of user roles to a specific -destination or a hierarchical wildcard area of destinations.{html} -h4. Properties - || Property Name || Type || Description || - | admin | _java.lang.String_ | {html}{html} | - | adminACLs | (_java.lang.Object_)\* | {html}{html} | - | destination | _[org.apache.activemq.command.ActiveMQDestination|#org.apache.activemq.command.ActiveMQDestination-types]_ | {html}{html} | - | groupClass | _java.lang.String_ | {html}{html} | - | queue | _java.lang.String_ | {html}A helper method to set the destination from a configuration file{html} | - | read | _java.lang.String_ | {html}{html} | - | readACLs | (_java.lang.Object_)\* | {html}{html} | - | tempQueue | _boolean_ | {html}{html} | - | tempTopic | _boolean_ | {html}{html} | - | topic | _java.lang.String_ | {html}A helper method to set the destination from a configuration file{html} | - | write | _java.lang.String_ | {html}{html} | - | writeACLs | (_java.lang.Object_)\* | {html}{html} | - -{anchor:authorizationMap-element} -h3. The _[|#authorizationMap-element]_ Element - {html}{html} -h4. Properties - || Property Name || Type || Description || - | authorizationEntries | (_java.lang.Object_)\* | {html}Sets the individual entries on the authorization map{html} | - | defaultEntry | _[org.apache.activemq.security.AuthorizationEntry|#org.apache.activemq.security.AuthorizationEntry-types]_ | {html}{html} | - | entries | (_java.lang.Object_)\* | {html}A helper method to allow the destination map to be populated from a -dependency injection framework such as Spring{html} | - | groupClass | _java.lang.String_ | {html}{html} | - | tempDestinationAuthorizationEntry | _[org.apache.activemq.security.TempDestinationAuthorizationEntry|#org.apache.activemq.security.TempDestinationAuthorizationEntry-types]_ | {html}{html} | - -{anchor:authorizationPlugin-element} -h3. The _[|#authorizationPlugin-element]_ Element - {html}An authorization plugin where each operation on a destination is checked -against an authorizationMap{html} -h4. Properties - || Property Name || Type || Description || - | map | _[org.apache.activemq.security.AuthorizationMap|#org.apache.activemq.security.AuthorizationMap-types]_ | {html}{html} | - -{anchor:axionJDBCAdapter-element} -h3. The _[|#axionJDBCAdapter-element]_ Element - {html}Axion specific Adapter. - -Axion does not seem to support ALTER statements or sub-selects. This means: -- We cannot auto upgrade the schema was we roll out new versions of ActiveMQ -- We cannot delete durable sub messages that have be acknowledged by all consumers.{html} -h4. Properties - || Property Name || Type || Description || - | batchStatments | _boolean_ | {html}{html} | - | maxRows | _int_ | {html}the max value for statement maxRows, used to limit jdbc queries{html} | - | statements | _[org.apache.activemq.store.jdbc.Statements|#org.apache.activemq.store.jdbc.Statements-types]_ | {html}{html} | - | useExternalMessageReferences | _boolean_ | {html}{html} | - -{anchor:blobJDBCAdapter-element} -h3. The _[|#blobJDBCAdapter-element]_ Element - {html}This JDBCAdapter inserts and extracts BLOB data using the getBlob()/setBlob() -operations. This is a little more involved since to insert a blob you have -to: - -1: insert empty blob. 2: select the blob 3: finally update the blob with data -value. - -The databases/JDBC drivers that use this adapter are: -

      -
    • -
    {html} -h4. Properties - || Property Name || Type || Description || - | batchStatments | _boolean_ | {html}{html} | - | maxRows | _int_ | {html}the max value for statement maxRows, used to limit jdbc queries{html} | - | statements | _[org.apache.activemq.store.jdbc.Statements|#org.apache.activemq.store.jdbc.Statements-types]_ | {html}{html} | - | useExternalMessageReferences | _boolean_ | {html}{html} | - -{anchor:broker-element} -h3. The _[|#broker-element]_ Element - {html}An ActiveMQ Message Broker. It consists of a number of transport -connectors, network connectors and a bunch of properties which can be used to -configure the broker as its lazily created.{html} -h4. Properties - || Property Name || Type || Description || - | adminView | _org.apache.activemq.broker.jmx.BrokerView_ | {html}Returns the administration view of the broker; used to create and destroy -resources such as queues and topics. Note this method returns null if JMX -is disabled.{html} | - | advisorySupport | _java.lang.String_ | {html}Allows the support of advisory messages to be disabled for performance -reasons.{html} | - | allowTempAutoCreationOnSend | _boolean_ | {html}enable if temp destinations need to be propagated through a network when -advisorySupport==false. This is used in conjunction with the policy -gcInactiveDestinations for matching temps so they can get removed -when inactive{html} | - | brokerContext | _org.apache.activemq.broker.BrokerContext_ | {html}{html} | - | brokerId | _java.lang.String_ | {html}{html} | - | brokerName | _java.lang.String_ | {html}Sets the name of this broker; which must be unique in the network{html} | - | brokerObjectName | _javax.management.ObjectName_ | {html}Sets the JMX ObjectName for this broker{html} | - | cacheTempDestinations | _boolean_ | {html}{html} | - | consumerSystemUsage | _[org.apache.activemq.usage.SystemUsage|#org.apache.activemq.usage.SystemUsage-types]_ | {html}{html} | - | consumerSystemUsagePortion | _int_ | {html}{html} | - | dataDirectory | _java.lang.String_ | {html}Sets the directory in which the data files will be stored by default for -the JDBC and Journal persistence adaptors.{html} | - | dataDirectoryFile | _java.io.File_ | {html}Sets the directory in which the data files will be stored by default for -the JDBC and Journal persistence adaptors.{html} | - | dedicatedTaskRunner | _boolean_ | {html}{html} | - | deleteAllMessagesOnStartup | _java.lang.String_ | {html}Sets whether or not all messages are deleted on startup - mostly only -useful for testing.{html} | - | destinationFactory | _org.apache.activemq.broker.region.DestinationFactory_ | {html}{html} | - | destinationInterceptors | (_[org.apache.activemq.broker.region.DestinationInterceptor|#org.apache.activemq.broker.region.DestinationInterceptor-types]_)\* | {html}Sets the destination interceptors to use{html} | - | destinationPolicy | _[org.apache.activemq.broker.region.policy.PolicyMap|#org.apache.activemq.broker.region.policy.PolicyMap-types]_ | {html}Sets the destination specific policies available either for exact -destinations or for wildcard areas of destinations.{html} | - | destinations | (_[org.apache.activemq.command.ActiveMQDestination|#org.apache.activemq.command.ActiveMQDestination-types]_)\* | {html}Sets the destinations which should be loaded/created on startup{html} | - | enableStatistics | _boolean_ | {html}Sets whether or not the Broker's services enable statistics or not.{html} | - | ioExceptionHandler | _[org.apache.activemq.util.IOExceptionHandler|#org.apache.activemq.util.IOExceptionHandler-types]_ | {html}override the Default IOException handler, called when persistence adapter -has experiences File or JDBC I/O Exceptions{html} | - | jmsBridgeConnectors | (_[org.apache.activemq.network.jms.JmsConnector|#org.apache.activemq.network.jms.JmsConnector-types]_)\* | {html}{html} | - | jobSchedulerStore | _org.apache.activemq.broker.scheduler.JobSchedulerStore_ | {html}{html} | - | keepDurableSubsActive | _boolean_ | {html}{html} | - | managementContext | _[org.apache.activemq.broker.jmx.ManagementContext|#org.apache.activemq.broker.jmx.ManagementContext-types]_ | {html}{html} | - | maxPurgedDestinationsPerSweep | _int_ | {html}{html} | - | mbeanInvocationTimeout | _long_ | {html}Gets the time in Milliseconds that an invocation of an MBean method will wait before -failing. The default value is to wait forever (zero).{html} | - | messageAuthorizationPolicy | _org.apache.activemq.security.MessageAuthorizationPolicy_ | {html}Sets the policy used to decide if the current connection is authorized to -consume a given message{html} | - | monitorConnectionSplits | _boolean_ | {html}{html} | - | networkConnectorStartAsync | _boolean_ | {html}{html} | - | networkConnectorURIs | (_java.lang.String_)\* | {html}{html} | - | networkConnectors | (_[org.apache.activemq.network.NetworkConnector|#org.apache.activemq.network.NetworkConnector-types]_)\* | {html}Sets the network connectors which this broker will use to connect to -other brokers in a federated network{html} | - | offlineDurableSubscriberTaskSchedule | _long_ | {html}{html} | - | offlineDurableSubscriberTimeout | _long_ | {html}{html} | - | passiveSlave | _java.lang.String_ | {html}Get the passiveSlave{html} | - | persistenceAdapter | _[org.apache.activemq.store.PersistenceAdapter|#org.apache.activemq.store.PersistenceAdapter-types]_ | {html}Sets the persistence adaptor implementation to use for this broker{html} | - | persistenceFactory | _[org.apache.activemq.store.PersistenceAdapterFactory|#org.apache.activemq.store.PersistenceAdapterFactory-types]_ | {html}{html} | - | persistenceTaskRunnerFactory | _[org.apache.activemq.thread.TaskRunnerFactory|#org.apache.activemq.thread.TaskRunnerFactory-types]_ | {html}{html} | - | persistenceThreadPriority | _int_ | {html}{html} | - | persistent | _java.lang.String_ | {html}Sets whether or not persistence is enabled or disabled.{html} | - | plugins | (_[org.apache.activemq.broker.BrokerPlugin|#org.apache.activemq.broker.BrokerPlugin-types]_)\* | {html}Sets a number of broker plugins to install such as for security -authentication or authorization{html} | - | populateJMSXUserID | _boolean_ | {html}Sets whether or not the broker should populate the JMSXUserID header.{html} | - | populateUserNameInMBeans | _boolean_ | {html}Should MBeans that support showing the Authenticated User Name information have this -value filled in or not.{html} | - | producerSystemUsage | _[org.apache.activemq.usage.SystemUsage|#org.apache.activemq.usage.SystemUsage-types]_ | {html}{html} | - | producerSystemUsagePortion | _int_ | {html}{html} | - | proxyConnectors | (_java.lang.Object_)\* | {html}Sets the network connectors which this broker will use to connect to -other brokers in a federated network{html} | - | regionBroker | _[org.apache.activemq.broker.Broker|#org.apache.activemq.broker.Broker-types]_ | {html}{html} | - | restartAllowed | _boolean_ | {html}Sets if the broker allowed to restart on shutdown.{html} | - | schedulePeriodForDestinationPurge | _int_ | {html}{html} | - | schedulerDirectory | _java.lang.String_ | {html}{html} | - | schedulerDirectoryFile | _java.io.File_ | {html}{html} | - | schedulerSupport | _java.lang.String_ | {html}{html} | - | services | (_[org.apache.activemq.Service|#org.apache.activemq.Service-types]_)\* | {html}Sets the services associated with this broker.{html} | - | shutdownHooks | (_java.lang.Object_)\* | {html}Sets hooks to be executed when broker shut down{html} | - | shutdownOnMasterFailure | _boolean_ | {html}{html} | - | shutdownOnSlaveFailure | _java.lang.String_ | {html}{html} | - | splitSystemUsageForProducersConsumers | _boolean_ | {html}{html} | - | sslContext | _[org.apache.activemq.broker.SslContext|#org.apache.activemq.broker.SslContext-types]_ | {html}{html} | - | start | _boolean_ | {html}Sets whether or not the broker is started along with the ApplicationContext it is defined within. -Normally you would want the broker to start up along with the ApplicationContext but sometimes when working -with JUnit tests you may wish to start and stop the broker explicitly yourself.{html} | - | startAsync | _boolean_ | {html}{html} | - | storeOpenWireVersion | _int_ | {html}{html} | - | supportFailOver | _boolean_ | {html}{html} | - | systemExitOnShutdown | _java.lang.String_ | {html}{html} | - | systemExitOnShutdownExitCode | _int_ | {html}{html} | - | systemUsage | _[org.apache.activemq.usage.SystemUsage|#org.apache.activemq.usage.SystemUsage-types]_ | {html}{html} | - | taskRunnerFactory | _[org.apache.activemq.thread.TaskRunnerFactory|#org.apache.activemq.thread.TaskRunnerFactory-types]_ | {html}{html} | - | taskRunnerPriority | _int_ | {html}{html} | - | tempDataStore | _[org.apache.activemq.store.PListStore|#org.apache.activemq.store.PListStore-types]_ | {html}{html} | - | timeBeforePurgeTempDestinations | _int_ | {html}{html} | - | tmpDataDirectory | _java.io.File_ | {html}{html} | - | transportConnectorURIs | (_java.lang.String_)\* | {html}{html} | - | transportConnectors | (_[org.apache.activemq.broker.TransportConnector|#org.apache.activemq.broker.TransportConnector-types]_)\* | {html}Sets the transport connectors which this broker will listen on for new -clients{html} | - | useAuthenticatedPrincipalForJMSXUserID | _boolean_ | {html}{html} | - | useJmx | _java.lang.String_ | {html}Sets whether or not the Broker's services should be exposed into JMX or -not.{html} | - | useLocalHostBrokerName | _boolean_ | {html}{html} | - | useLoggingForShutdownErrors | _boolean_ | {html}Sets whether or not we should use commons-logging when reporting errors -when shutting down the broker{html} | - | useMirroredQueues | _boolean_ | {html}Sets whether or not Mirrored -Queues should be supported by default if they have not been -explicitly configured.{html} | - | useShutdownHook | _boolean_ | {html}Sets whether or not we should use a shutdown handler to close down the -broker cleanly if the JVM is terminated. It is recommended you leave this -enabled.{html} | - | useTempMirroredQueues | _boolean_ | {html}{html} | - | useVirtualTopics | _boolean_ | {html}Sets whether or not Virtual -Topics should be supported by default if they have not been -explicitly configured.{html} | - | vmConnectorURI | _java.net.URI_ | {html}{html} | - | waitForSlave | _java.lang.String_ | {html}{html} | - | waitForSlaveTimeout | _long_ | {html}{html} | - -{anchor:brokerService-element} -h3. The _[|#brokerService-element]_ Element - {html}Manages the life-cycle of an ActiveMQ Broker. A BrokerService consists of a -number of transport connectors, network connectors and a bunch of properties -which can be used to configure the broker as its lazily created.{html} -h4. Properties - || Property Name || Type || Description || - | adminView | _org.apache.activemq.broker.jmx.BrokerView_ | {html}Returns the administration view of the broker; used to create and destroy -resources such as queues and topics. Note this method returns null if JMX -is disabled.{html} | - | advisorySupport | _java.lang.String_ | {html}Allows the support of advisory messages to be disabled for performance -reasons.{html} | - | allowTempAutoCreationOnSend | _boolean_ | {html}enable if temp destinations need to be propagated through a network when -advisorySupport==false. This is used in conjunction with the policy -gcInactiveDestinations for matching temps so they can get removed -when inactive{html} | - | brokerContext | _org.apache.activemq.broker.BrokerContext_ | {html}{html} | - | brokerId | _java.lang.String_ | {html}{html} | - | brokerName | _java.lang.String_ | {html}Sets the name of this broker; which must be unique in the network{html} | - | brokerObjectName | _javax.management.ObjectName_ | {html}Sets the JMX ObjectName for this broker{html} | - | cacheTempDestinations | _boolean_ | {html}{html} | - | consumerSystemUsage | _[org.apache.activemq.usage.SystemUsage|#org.apache.activemq.usage.SystemUsage-types]_ | {html}{html} | - | consumerSystemUsagePortion | _int_ | {html}{html} | - | dataDirectory | _java.lang.String_ | {html}Sets the directory in which the data files will be stored by default for -the JDBC and Journal persistence adaptors.{html} | - | dataDirectoryFile | _java.io.File_ | {html}Sets the directory in which the data files will be stored by default for -the JDBC and Journal persistence adaptors.{html} | - | dedicatedTaskRunner | _boolean_ | {html}{html} | - | deleteAllMessagesOnStartup | _java.lang.String_ | {html}Sets whether or not all messages are deleted on startup - mostly only -useful for testing.{html} | - | destinationFactory | _org.apache.activemq.broker.region.DestinationFactory_ | {html}{html} | - | destinationInterceptors | (_[org.apache.activemq.broker.region.DestinationInterceptor|#org.apache.activemq.broker.region.DestinationInterceptor-types]_)\* | {html}Sets the destination interceptors to use{html} | - | destinationPolicy | _[org.apache.activemq.broker.region.policy.PolicyMap|#org.apache.activemq.broker.region.policy.PolicyMap-types]_ | {html}Sets the destination specific policies available either for exact -destinations or for wildcard areas of destinations.{html} | - | destinations | (_[org.apache.activemq.command.ActiveMQDestination|#org.apache.activemq.command.ActiveMQDestination-types]_)\* | {html}Sets the destinations which should be loaded/created on startup{html} | - | enableStatistics | _boolean_ | {html}Sets whether or not the Broker's services enable statistics or not.{html} | - | ioExceptionHandler | _[org.apache.activemq.util.IOExceptionHandler|#org.apache.activemq.util.IOExceptionHandler-types]_ | {html}override the Default IOException handler, called when persistence adapter -has experiences File or JDBC I/O Exceptions{html} | - | jmsBridgeConnectors | (_[org.apache.activemq.network.jms.JmsConnector|#org.apache.activemq.network.jms.JmsConnector-types]_)\* | {html}{html} | - | jobSchedulerStore | _org.apache.activemq.broker.scheduler.JobSchedulerStore_ | {html}{html} | - | keepDurableSubsActive | _boolean_ | {html}{html} | - | managementContext | _[org.apache.activemq.broker.jmx.ManagementContext|#org.apache.activemq.broker.jmx.ManagementContext-types]_ | {html}{html} | - | maxPurgedDestinationsPerSweep | _int_ | {html}{html} | - | mbeanInvocationTimeout | _long_ | {html}Gets the time in Milliseconds that an invocation of an MBean method will wait before -failing. The default value is to wait forever (zero).{html} | - | messageAuthorizationPolicy | _org.apache.activemq.security.MessageAuthorizationPolicy_ | {html}Sets the policy used to decide if the current connection is authorized to -consume a given message{html} | - | monitorConnectionSplits | _boolean_ | {html}{html} | - | networkConnectorStartAsync | _boolean_ | {html}{html} | - | networkConnectorURIs | (_java.lang.String_)\* | {html}{html} | - | networkConnectors | (_[org.apache.activemq.network.NetworkConnector|#org.apache.activemq.network.NetworkConnector-types]_)\* | {html}Sets the network connectors which this broker will use to connect to -other brokers in a federated network{html} | - | offlineDurableSubscriberTaskSchedule | _long_ | {html}{html} | - | offlineDurableSubscriberTimeout | _long_ | {html}{html} | - | passiveSlave | _java.lang.String_ | {html}Get the passiveSlave{html} | - | persistenceAdapter | _[org.apache.activemq.store.PersistenceAdapter|#org.apache.activemq.store.PersistenceAdapter-types]_ | {html}Sets the persistence adaptor implementation to use for this broker{html} | - | persistenceFactory | _[org.apache.activemq.store.PersistenceAdapterFactory|#org.apache.activemq.store.PersistenceAdapterFactory-types]_ | {html}{html} | - | persistenceTaskRunnerFactory | _[org.apache.activemq.thread.TaskRunnerFactory|#org.apache.activemq.thread.TaskRunnerFactory-types]_ | {html}{html} | - | persistenceThreadPriority | _int_ | {html}{html} | - | persistent | _java.lang.String_ | {html}Sets whether or not persistence is enabled or disabled.{html} | - | plugins | (_[org.apache.activemq.broker.BrokerPlugin|#org.apache.activemq.broker.BrokerPlugin-types]_)\* | {html}Sets a number of broker plugins to install such as for security -authentication or authorization{html} | - | populateJMSXUserID | _boolean_ | {html}Sets whether or not the broker should populate the JMSXUserID header.{html} | - | populateUserNameInMBeans | _boolean_ | {html}Should MBeans that support showing the Authenticated User Name information have this -value filled in or not.{html} | - | producerSystemUsage | _[org.apache.activemq.usage.SystemUsage|#org.apache.activemq.usage.SystemUsage-types]_ | {html}{html} | - | producerSystemUsagePortion | _int_ | {html}{html} | - | proxyConnectors | (_java.lang.Object_)\* | {html}Sets the network connectors which this broker will use to connect to -other brokers in a federated network{html} | - | regionBroker | _[org.apache.activemq.broker.Broker|#org.apache.activemq.broker.Broker-types]_ | {html}{html} | - | restartAllowed | _boolean_ | {html}Sets if the broker allowed to restart on shutdown.{html} | - | schedulePeriodForDestinationPurge | _int_ | {html}{html} | - | schedulerDirectory | _java.lang.String_ | {html}{html} | - | schedulerDirectoryFile | _java.io.File_ | {html}{html} | - | schedulerSupport | _java.lang.String_ | {html}{html} | - | services | (_[org.apache.activemq.Service|#org.apache.activemq.Service-types]_)\* | {html}Sets the services associated with this broker.{html} | - | shutdownHooks | (_java.lang.Object_)\* | {html}Sets hooks to be executed when broker shut down{html} | - | shutdownOnMasterFailure | _boolean_ | {html}{html} | - | shutdownOnSlaveFailure | _java.lang.String_ | {html}{html} | - | splitSystemUsageForProducersConsumers | _boolean_ | {html}{html} | - | sslContext | _[org.apache.activemq.broker.SslContext|#org.apache.activemq.broker.SslContext-types]_ | {html}{html} | - | startAsync | _boolean_ | {html}{html} | - | storeOpenWireVersion | _int_ | {html}{html} | - | supportFailOver | _boolean_ | {html}{html} | - | systemExitOnShutdown | _java.lang.String_ | {html}{html} | - | systemExitOnShutdownExitCode | _int_ | {html}{html} | - | systemUsage | _[org.apache.activemq.usage.SystemUsage|#org.apache.activemq.usage.SystemUsage-types]_ | {html}{html} | - | taskRunnerFactory | _[org.apache.activemq.thread.TaskRunnerFactory|#org.apache.activemq.thread.TaskRunnerFactory-types]_ | {html}{html} | - | taskRunnerPriority | _int_ | {html}{html} | - | tempDataStore | _[org.apache.activemq.store.PListStore|#org.apache.activemq.store.PListStore-types]_ | {html}{html} | - | timeBeforePurgeTempDestinations | _int_ | {html}{html} | - | tmpDataDirectory | _java.io.File_ | {html}{html} | - | transportConnectorURIs | (_java.lang.String_)\* | {html}{html} | - | transportConnectors | (_[org.apache.activemq.broker.TransportConnector|#org.apache.activemq.broker.TransportConnector-types]_)\* | {html}Sets the transport connectors which this broker will listen on for new -clients{html} | - | useAuthenticatedPrincipalForJMSXUserID | _boolean_ | {html}{html} | - | useJmx | _java.lang.String_ | {html}Sets whether or not the Broker's services should be exposed into JMX or -not.{html} | - | useLocalHostBrokerName | _boolean_ | {html}{html} | - | useLoggingForShutdownErrors | _boolean_ | {html}Sets whether or not we should use commons-logging when reporting errors -when shutting down the broker{html} | - | useMirroredQueues | _boolean_ | {html}Sets whether or not Mirrored -Queues should be supported by default if they have not been -explicitly configured.{html} | - | useShutdownHook | _boolean_ | {html}Sets whether or not we should use a shutdown handler to close down the -broker cleanly if the JVM is terminated. It is recommended you leave this -enabled.{html} | - | useTempMirroredQueues | _boolean_ | {html}{html} | - | useVirtualTopics | _boolean_ | {html}Sets whether or not Virtual -Topics should be supported by default if they have not been -explicitly configured.{html} | - | vmConnectorURI | _java.net.URI_ | {html}{html} | - | waitForSlave | _java.lang.String_ | {html}{html} | - | waitForSlaveTimeout | _long_ | {html}{html} | - -{anchor:bytesJDBCAdapter-element} -h3. The _[|#bytesJDBCAdapter-element]_ Element - {html}This JDBCAdapter inserts and extracts BLOB data using the -setBytes()/getBytes() operations. The databases/JDBC drivers that use this -adapter are:{html} -h4. Properties - || Property Name || Type || Description || - | batchStatments | _boolean_ | {html}{html} | - | maxRows | _int_ | {html}the max value for statement maxRows, used to limit jdbc queries{html} | - | statements | _[org.apache.activemq.store.jdbc.Statements|#org.apache.activemq.store.jdbc.Statements-types]_ | {html}{html} | - | useExternalMessageReferences | _boolean_ | {html}{html} | - -{anchor:cachedLDAPAuthorizationMap-element} -h3. The _[|#cachedLDAPAuthorizationMap-element]_ Element - {html}A {@link DefaultAuthorizationMap} implementation which uses LDAP to initialize and update authorization -policy.{html} -h4. Properties - || Property Name || Type || Description || - | adminPermissionGroupSearchFilter | _java.lang.String_ | {html}{html} | - | authentication | _java.lang.String_ | {html}{html} | - | connectionPassword | _java.lang.String_ | {html}{html} | - | connectionProtocol | _java.lang.String_ | {html}{html} | - | connectionURL | _java.lang.String_ | {html}{html} | - | connectionUsername | _java.lang.String_ | {html}{html} | - | groupNameAttribute | _java.lang.String_ | {html}{html} | - | groupObjectClass | _java.lang.String_ | {html}{html} | - | legacyGroupMapping | _boolean_ | {html}{html} | - | permissionGroupMemberAttribute | _java.lang.String_ | {html}{html} | - | queueSearchBase | _java.lang.String_ | {html}{html} | - | readPermissionGroupSearchFilter | _java.lang.String_ | {html}{html} | - | refreshDisabled | _boolean_ | {html}{html} | - | refreshInterval | _int_ | {html}{html} | - | tempSearchBase | _java.lang.String_ | {html}{html} | - | topicSearchBase | _java.lang.String_ | {html}{html} | - | userNameAttribute | _java.lang.String_ | {html}{html} | - | userObjectClass | _java.lang.String_ | {html}{html} | - | writePermissionGroupSearchFilter | _java.lang.String_ | {html}{html} | - -{anchor:cachedMessageGroupMapFactory-element} -h3. The _[|#cachedMessageGroupMapFactory-element]_ Element - {html}A factory to create instances of {@link org.apache.activemq.broker.region.group.CachedMessageGroupMap} when implementing the -Message Groups functionality.{html} -h4. Properties - || Property Name || Type || Description || - | cacheSize | _int_ | {html}{html} | - -{anchor:compositeDemandForwardingBridge-element} -h3. The _[|#compositeDemandForwardingBridge-element]_ Element - {html}A demand forwarding bridge which works with multicast style transports where -a single Transport could be communicating with multiple remote brokers{html} -h4. Properties - || Property Name || Type || Description || - | brokerService | _[org.apache.activemq.broker.BrokerService|#org.apache.activemq.broker.BrokerService-types]_ | {html}{html} | - | configuration | _[org.apache.activemq.network.NetworkBridgeConfiguration|#org.apache.activemq.network.NetworkBridgeConfiguration-types]_ | {html}{html} | - | createdByDuplex | _boolean_ | {html}{html} | - | durableDestinations | (_[org.apache.activemq.command.ActiveMQDestination|#org.apache.activemq.command.ActiveMQDestination-types]_)\* | {html}{html} | - | dynamicallyIncludedDestinations | (_[org.apache.activemq.command.ActiveMQDestination|#org.apache.activemq.command.ActiveMQDestination-types]_)\* | {html}{html} | - | excludedDestinations | (_[org.apache.activemq.command.ActiveMQDestination|#org.apache.activemq.command.ActiveMQDestination-types]_)\* | {html}{html} | - | localBroker | _org.apache.activemq.transport.Transport_ | {html}{html} | - | mbeanObjectName | _javax.management.ObjectName_ | {html}{html} | - | networkBridgeListener | _org.apache.activemq.network.NetworkBridgeListener_ | {html}{html} | - | remoteBroker | _org.apache.activemq.transport.Transport_ | {html}{html} | - | staticallyIncludedDestinations | (_[org.apache.activemq.command.ActiveMQDestination|#org.apache.activemq.command.ActiveMQDestination-types]_)\* | {html}{html} | - -{anchor:compositeQueue-element} -h3. The _[|#compositeQueue-element]_ Element - {html}Represents a virtual queue which forwards to a number of other destinations.{html} -h4. Properties - || Property Name || Type || Description || - | copyMessage | _boolean_ | {html}Sets whether a copy of the message will be sent to each destination. -Defaults to true so that the forward destination is set as the -destination of the message{html} | - | forwardOnly | _boolean_ | {html}Sets if the virtual destination is forward only (and so there is no -physical queue to match the virtual queue) or if there is also a physical -queue with the same name).{html} | - | forwardTo | (_java.lang.Object_)\* | {html}Sets the list of destinations to forward to{html} | - | name | _java.lang.String_ | {html}Sets the name of this composite destination{html} | - -{anchor:compositeTopic-element} -h3. The _[|#compositeTopic-element]_ Element - {html}Represents a virtual topic which forwards to a number of other destinations.{html} -h4. Properties - || Property Name || Type || Description || - | copyMessage | _boolean_ | {html}Sets whether a copy of the message will be sent to each destination. -Defaults to true so that the forward destination is set as the -destination of the message{html} | - | forwardOnly | _boolean_ | {html}Sets if the virtual destination is forward only (and so there is no -physical queue to match the virtual queue) or if there is also a physical -queue with the same name).{html} | - | forwardTo | (_java.lang.Object_)\* | {html}Sets the list of destinations to forward to{html} | - | name | _java.lang.String_ | {html}Sets the name of this composite destination{html} | - -{anchor:conditionalNetworkBridgeFilterFactory-element} -h3. The _[|#conditionalNetworkBridgeFilterFactory-element]_ Element - {html}implement conditional behavior for queue consumers, allows replaying back to -origin if no consumers are present on the local broker after a configurable -delay, irrespective of the TTL. Also allows rate limiting of messages -through the network, useful for static includes{html} -h4. Properties - || Property Name || Type || Description || - | rateDuration | _int_ | {html}{html} | - | rateLimit | _int_ | {html}{html} | - | replayDelay | _int_ | {html}{html} | - | replayWhenNoConsumers | _boolean_ | {html}{html} | - -{anchor:connectionDotFilePlugin-element} -h3. The _[|#connectionDotFilePlugin-element]_ Element - {html}A DOT file creator plugin which -creates a DOT file showing the current connections{html} -h4. Properties - || Property Name || Type || Description || - | file | _java.lang.String_ | {html}Sets the destination file name to create the destination diagram{html} | - -{anchor:connectionFactory-element} -h3. The _[|#connectionFactory-element]_ Element - {html}A Spring enhanced connection -factory which will automatically use the Spring bean name as the clientIDPrefix property -so that connections created have client IDs related to your Spring.xml file for -easier comprehension from JMX.{html} -h4. Properties - || Property Name || Type || Description || - | alwaysSessionAsync | _boolean_ | {html}If this flag is not set then a separate thread is not used for dispatching messages for each Session in -the Connection. However, a separate thread is always used if there is more than one session, or the session -isn't in auto acknowledge or duplicates ok mode. By default this value is set to true and session dispatch -happens asynchronously.{html} | - | alwaysSyncSend | _boolean_ | {html}Set true if always require messages to be sync sent{html} | - | auditDepth | _int_ | {html}{html} | - | auditMaximumProducerNumber | _int_ | {html}{html} | - | beanName | _java.lang.String_ | {html}{html} | - | blobTransferPolicy | _org.apache.activemq.blob.BlobTransferPolicy_ | {html}Sets the policy used to describe how out-of-band BLOBs (Binary Large -OBjects) are transferred from producers to brokers to consumers{html} | - | brokerURL | _java.lang.String_ | {html}Sets the connection -URL used to connect to the ActiveMQ broker.{html} | - | checkForDuplicates | _boolean_ | {html}{html} | - | clientID | _java.lang.String_ | {html}Sets the JMS clientID to use for the created connection. Note that this -can only be used by one connection at once so generally its a better idea -to set the clientID on a Connection{html} | - | clientIDPrefix | _java.lang.String_ | {html}Sets the prefix used by autogenerated JMS Client ID values which are used -if the JMS client does not explicitly specify on.{html} | - | clientIdGenerator | _org.apache.activemq.util.IdGenerator_ | {html}{html} | - | clientInternalExceptionListener | _org.apache.activemq.ClientInternalExceptionListener_ | {html}Allows an {@link ClientInternalExceptionListener} to be configured on the ConnectionFactory so that when this factory -is used by frameworks which don't expose the Connection such as Spring JmsTemplate, you can register -an exception listener. -

    Note: access to this clientInternalExceptionListener will not be serialized if it is associated with more than -on connection (as it will be if more than one connection is subsequently created by this connection factory){html} | - | closeTimeout | _int_ | {html}Sets the timeout before a close is considered complete. Normally a -close() on a connection waits for confirmation from the broker; this -allows that operation to timeout to save the client hanging if there is -no broker{html} | - | connectionIDPrefix | _java.lang.String_ | {html}Sets the prefix used by connection id generator{html} | - | connectionIdGenerator | _org.apache.activemq.util.IdGenerator_ | {html}{html} | - | consumerFailoverRedeliveryWaitPeriod | _long_ | {html}{html} | - | copyMessageOnSend | _boolean_ | {html}Should a JMS message be copied to a new JMS Message object as part of the -send() method in JMS. This is enabled by default to be compliant with the -JMS specification. You can disable it if you do not mutate JMS messages -after they are sent for a performance boost{html} | - | disableTimeStampsByDefault | _boolean_ | {html}Sets whether or not timestamps on messages should be disabled or not. If -you disable them it adds a small performance boost.{html} | - | dispatchAsync | _boolean_ | {html}Enables or disables the default setting of whether or not consumers have -their messages dispatched -synchronously or asynchronously by the broker. For non-durable -topics for example we typically dispatch synchronously by default to -minimize context switches which boost performance. However sometimes its -better to go slower to ensure that a single blocked consumer socket does -not block delivery to other consumers.{html} | - | exceptionListener | _javax.jms.ExceptionListener_ | {html}Allows an {@link ExceptionListener} to be configured on the ConnectionFactory so that when this factory -is used by frameworks which don't expose the Connection such as Spring JmsTemplate, you can register -an exception listener. -

    Note: access to this exceptionLinstener will not be serialized if it is associated with more than -on connection (as it will be if more than one connection is subsequently created by this connection factory){html} | - | exclusiveConsumer | _boolean_ | {html}Enables or disables whether or not queue consumers should be exclusive or -not for example to preserve ordering when not using Message Groups{html} | - | maxThreadPoolSize | _int_ | {html}{html} | - | messagePrioritySupported | _boolean_ | {html}{html} | - | nestedMapAndListEnabled | _boolean_ | {html}Enables/disables whether or not Message properties and MapMessage entries -support Nested -Structures of Map and List objects{html} | - | nonBlockingRedelivery | _boolean_ | {html}When true a MessageConsumer will not stop Message delivery before re-delivering Messages -from a rolled back transaction. This implies that message order will not be preserved and -also will result in the TransactedIndividualAck option to be enabled.{html} | - | objectMessageSerializationDefered | _boolean_ | {html}When an object is set on an ObjectMessage, the JMS spec requires the -object to be serialized by that set method. Enabling this flag causes the -object to not get serialized. The object may subsequently get serialized -if the message needs to be sent over a socket or stored to disk.{html} | - | optimizeAcknowledge | _boolean_ | {html}{html} | - | optimizeAcknowledgeTimeOut | _long_ | {html}The max time in milliseconds between optimized ack batches{html} | - | optimizedAckScheduledAckInterval | _long_ | {html}Gets the configured time interval that is used to force all MessageConsumers that have optimizedAcknowledge enabled -to send an ack for any outstanding Message Acks. By default this value is set to zero meaning that the consumers -will not do any background Message acknowledgment.{html} | - | optimizedMessageDispatch | _boolean_ | {html}If this flag is set then an larger prefetch limit is used - only -applicable for durable topic subscribers.{html} | - | password | _java.lang.String_ | {html}Sets the JMS password used for connections created from this factory{html} | - | prefetchPolicy | _[org.apache.activemq.ActiveMQPrefetchPolicy|#org.apache.activemq.ActiveMQPrefetchPolicy-types]_ | {html}Sets the prefetch -policy for consumers created by this connection.{html} | - | producerWindowSize | _int_ | {html}{html} | - | properties | _java.util.Properties_ | {html}Get the properties from this instance for storing in JNDI{html} | - | redeliveryPolicy | _[org.apache.activemq.RedeliveryPolicy|#org.apache.activemq.RedeliveryPolicy-types]_ | {html}Sets the global default redelivery policy to be used when a message is delivered -but the session is rolled back{html} | - | redeliveryPolicyMap | _[org.apache.activemq.broker.region.policy.RedeliveryPolicyMap|#org.apache.activemq.broker.region.policy.RedeliveryPolicyMap-types]_ | {html}Sets the global redelivery policy mapping to be used when a message is delivered -but the session is rolled back{html} | - | rejectedTaskHandler | _java.util.concurrent.RejectedExecutionHandler_ | {html}{html} | - | sendAcksAsync | _boolean_ | {html}{html} | - | sendTimeout | _int_ | {html}{html} | - | sessionTaskRunner | _[org.apache.activemq.thread.TaskRunnerFactory|#org.apache.activemq.thread.TaskRunnerFactory-types]_ | {html}{html} | - | statsEnabled | _boolean_ | {html}{html} | - | transactedIndividualAck | _boolean_ | {html}when true, submit individual transacted acks immediately rather than with transaction completion. -This allows the acks to represent delivery status which can be persisted on rollback -Used in conjunction with org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter#setRewriteOnRedelivery(boolean) true{html} | - | transformer | _org.apache.activemq.MessageTransformer_ | {html}Sets the transformer used to transform messages before they are sent on -to the JMS bus or when they are received from the bus but before they are -delivered to the JMS client{html} | - | transportListener | _org.apache.activemq.transport.TransportListener_ | {html}Allows a listener to be configured on the ConnectionFactory so that when this factory is used -with frameworks which don't expose the Connection such as Spring JmsTemplate, you can still register -a transport listener.{html} | - | useAsyncSend | _boolean_ | {html}Forces the use of Async Sends which -adds a massive performance boost; but means that the send() method will -return immediately whether the message has been sent or not which could -lead to message loss.{html} | - | useBeanNameAsClientIdPrefix | _boolean_ | {html}{html} | - | useCompression | _boolean_ | {html}Enables the use of compression of the message bodies{html} | - | useDedicatedTaskRunner | _boolean_ | {html}{html} | - | useRetroactiveConsumer | _boolean_ | {html}Sets whether or not retroactive consumers are enabled. Retroactive -consumers allow non-durable topic subscribers to receive old messages -that were published before the non-durable subscriber started.{html} | - | userName | _java.lang.String_ | {html}Sets the JMS userName used by connections created by this factory{html} | - | warnAboutUnstartedConnectionTimeout | _long_ | {html}Enables the timeout from a connection creation to when a warning is -generated if the connection is not properly started via -{@link Connection#start()} and a message is received by a consumer. It is -a very common gotcha to forget to start -the connection so this option makes the default case to create a -warning if the user forgets. To disable the warning just set the value to < -0 (say -1).{html} | - | watchTopicAdvisories | _boolean_ | {html}{html} | - -{anchor:constantPendingMessageLimitStrategy-element} -h3. The _[|#constantPendingMessageLimitStrategy-element]_ Element - {html}This PendingMessageLimitStrategy is configured to a constant value for all subscriptions.{html} -h4. Properties - || Property Name || Type || Description || - | limit | _int_ | {html}{html} | - -{anchor:database-locker-element} -h3. The _[|#database-locker-element]_ Element - {html}Represents an exclusive lock on a database to avoid multiple brokers running -against the same logical database.{html} -h4. Properties - || Property Name || Type || Description || - | createTablesOnStartup | _boolean_ | {html}{html} | - | dataSource | _javax.sql.DataSource_ | {html}{html} | - | exceptionHandler | _org.apache.activemq.util.Handler_ | {html}{html} | - | failIfLocked | _boolean_ | {html}{html} | - | lockAcquireSleepInterval | _long_ | {html}{html} | - | lockable | _[org.apache.activemq.broker.LockableServiceSupport|#org.apache.activemq.broker.LockableServiceSupport-types]_ | {html}{html} | - | name | _java.lang.String_ | {html}{html} | - | queryTimeout | _int_ | {html}{html} | - | statements | _[org.apache.activemq.store.jdbc.Statements|#org.apache.activemq.store.jdbc.Statements-types]_ | {html}{html} | - -{anchor:db2JDBCAdapter-element} -h3. The _[|#db2JDBCAdapter-element]_ Element - {html}{html} -h4. Properties - || Property Name || Type || Description || - | batchStatments | _boolean_ | {html}{html} | - | maxRows | _int_ | {html}the max value for statement maxRows, used to limit jdbc queries{html} | - | statements | _[org.apache.activemq.store.jdbc.Statements|#org.apache.activemq.store.jdbc.Statements-types]_ | {html}{html} | - | useExternalMessageReferences | _boolean_ | {html}{html} | - -{anchor:defaultIOExceptionHandler-element} -h3. The _[|#defaultIOExceptionHandler-element]_ Element - {html}{html} -h4. Properties - || Property Name || Type || Description || - | brokerService | _[org.apache.activemq.broker.BrokerService|#org.apache.activemq.broker.BrokerService-types]_ | {html}{html} | - | ignoreAllErrors | _boolean_ | {html}{html} | - | ignoreNoSpaceErrors | _boolean_ | {html}{html} | - | ignoreSQLExceptions | _boolean_ | {html}{html} | - | noSpaceMessage | _java.lang.String_ | {html}{html} | - | resumeCheckSleepPeriod | _long_ | {html}{html} | - | sqlExceptionMessage | _java.lang.String_ | {html}{html} | - | stopStartConnectors | _boolean_ | {html}{html} | - -{anchor:defaultJDBCAdapter-element} -h3. The _[|#defaultJDBCAdapter-element]_ Element - {html}Implements all the default JDBC operations that are used by the JDBCPersistenceAdapter.

    sub-classing is -encouraged to override the default implementation of methods to account for differences in JDBC Driver -implementations.

    The JDBCAdapter inserts and extracts BLOB data using the getBytes()/setBytes() operations.

    -The databases/JDBC drivers that use this adapter are: -

      -
    • -
    {html} -h4. Properties - || Property Name || Type || Description || - | batchStatments | _boolean_ | {html}{html} | - | maxRows | _int_ | {html}the max value for statement maxRows, used to limit jdbc queries{html} | - | statements | _[org.apache.activemq.store.jdbc.Statements|#org.apache.activemq.store.jdbc.Statements-types]_ | {html}{html} | - | useExternalMessageReferences | _boolean_ | {html}{html} | - -{anchor:defaultNetworkBridgeFilterFactory-element} -h3. The _[|#defaultNetworkBridgeFilterFactory-element]_ Element - {html}implement default behavior, filter that will not allow re-send to origin -based on brokerPath and which respects networkTTL{html} - -{anchor:defaultUsageCapacity-element} -h3. The _[|#defaultUsageCapacity-element]_ Element - {html}Identify if a limit has been reached{html} -h4. Properties - || Property Name || Type || Description || - | limit | _long_ | {html}{html} | - -{anchor:demandForwardingBridge-element} -h3. The _[|#demandForwardingBridge-element]_ Element - {html}Forwards messages from the local broker to the remote broker based on demand.{html} -h4. Properties - || Property Name || Type || Description || - | brokerService | _[org.apache.activemq.broker.BrokerService|#org.apache.activemq.broker.BrokerService-types]_ | {html}{html} | - | configuration | _[org.apache.activemq.network.NetworkBridgeConfiguration|#org.apache.activemq.network.NetworkBridgeConfiguration-types]_ | {html}{html} | - | createdByDuplex | _boolean_ | {html}{html} | - | durableDestinations | (_[org.apache.activemq.command.ActiveMQDestination|#org.apache.activemq.command.ActiveMQDestination-types]_)\* | {html}{html} | - | dynamicallyIncludedDestinations | (_[org.apache.activemq.command.ActiveMQDestination|#org.apache.activemq.command.ActiveMQDestination-types]_)\* | {html}{html} | - | excludedDestinations | (_[org.apache.activemq.command.ActiveMQDestination|#org.apache.activemq.command.ActiveMQDestination-types]_)\* | {html}{html} | - | localBroker | _org.apache.activemq.transport.Transport_ | {html}{html} | - | mbeanObjectName | _javax.management.ObjectName_ | {html}{html} | - | networkBridgeListener | _org.apache.activemq.network.NetworkBridgeListener_ | {html}{html} | - | remoteBroker | _org.apache.activemq.transport.Transport_ | {html}{html} | - | staticallyIncludedDestinations | (_[org.apache.activemq.command.ActiveMQDestination|#org.apache.activemq.command.ActiveMQDestination-types]_)\* | {html}{html} | - -{anchor:destinationDotFilePlugin-element} -h3. The _[|#destinationDotFilePlugin-element]_ Element - {html}A DOT -file creator plugin which creates a DOT file showing the current topic & queue hierarchies.{html} -h4. Properties - || Property Name || Type || Description || - | file | _java.lang.String_ | {html}Sets the destination file name to create the destination diagram{html} | - -{anchor:destinationEntry-element} -h3. The _[|#destinationEntry-element]_ Element - {html}A default entry in a DestinationMap which holds a single value.{html} -h4. Properties - || Property Name || Type || Description || - | destination | _[org.apache.activemq.command.ActiveMQDestination|#org.apache.activemq.command.ActiveMQDestination-types]_ | {html}{html} | - | queue | _java.lang.String_ | {html}A helper method to set the destination from a configuration file{html} | - | tempQueue | _boolean_ | {html}{html} | - | tempTopic | _boolean_ | {html}{html} | - | topic | _java.lang.String_ | {html}A helper method to set the destination from a configuration file{html} | - | value | _[org.apache.activemq.filter.DestinationMapEntry|#org.apache.activemq.filter.DestinationMapEntry-types]_ | {html}{html} | - -{anchor:destinationPathSeparatorPlugin-element} -h3. The _[|#destinationPathSeparatorPlugin-element]_ Element - {html}{html} -h4. Properties - || Property Name || Type || Description || - | adminConnectionContext | _org.apache.activemq.broker.ConnectionContext_ | {html}{html} | - | next | _[org.apache.activemq.broker.Broker|#org.apache.activemq.broker.Broker-types]_ | {html}{html} | - | pathSeparator | _java.lang.String_ | {html}{html} | - -{anchor:discarding-element} -h3. The _[|#discarding-element]_ Element - {html}Dead Letter Strategy that discards all messages{html} -h4. Properties - || Property Name || Type || Description || - | deadLetterQueue | _[org.apache.activemq.command.ActiveMQDestination|#org.apache.activemq.command.ActiveMQDestination-types]_ | {html}{html} | - | enableAudit | _boolean_ | {html}{html} | - | processExpired | _boolean_ | {html}{html} | - | processNonPersistent | _boolean_ | {html}{html} | - -{anchor:discardingDLQBrokerPlugin-element} -h3. The _[|#discardingDLQBrokerPlugin-element]_ Element - {html}{html} -h4. Properties - || Property Name || Type || Description || - | dropAll | _boolean_ | {html}{html} | - | dropOnly | _java.lang.String_ | {html}{html} | - | dropTemporaryQueues | _boolean_ | {html}{html} | - | dropTemporaryTopics | _boolean_ | {html}{html} | - | reportInterval | _int_ | {html}{html} | - -{anchor:fileCursor-element} -h3. The _[|#fileCursor-element]_ Element - {html}Pending messages{html} - -{anchor:fileDurableSubscriberCursor-element} -h3. The _[|#fileDurableSubscriberCursor-element]_ Element - {html}Pending messages for durable subscribers{html} - -{anchor:fileQueueCursor-element} -h3. The _[|#fileQueueCursor-element]_ Element - {html}Pending{html} - -{anchor:filteredDestination-element} -h3. The _[|#filteredDestination-element]_ Element - {html}Represents a destination which is filtered using some predicate such as a selector -so that messages are only dispatched to the destination if they match the filter.{html} -h4. Properties - || Property Name || Type || Description || - | destination | _[org.apache.activemq.command.ActiveMQDestination|#org.apache.activemq.command.ActiveMQDestination-types]_ | {html}The destination to send messages to if they match the filter{html} | - | filter | _org.apache.activemq.filter.BooleanExpression_ | {html}{html} | - | queue | _java.lang.String_ | {html}Sets the destination property to the given queue name{html} | - | selector | _java.lang.String_ | {html}Sets the JMS selector used to filter messages before forwarding them to this destination{html} | - | topic | _java.lang.String_ | {html}Sets the destination property to the given topic name{html} | - -{anchor:filteredKahaDB-element} -h3. The _[|#filteredKahaDB-element]_ Element - {html}{html} -h4. Properties - || Property Name || Type || Description || - | adapter | _[org.apache.activemq.store.PersistenceAdapter|#org.apache.activemq.store.PersistenceAdapter-types]_ | {html}{html} | - | destination | _[org.apache.activemq.command.ActiveMQDestination|#org.apache.activemq.command.ActiveMQDestination-types]_ | {html}{html} | - | perDestination | _boolean_ | {html}{html} | - | persistenceAdapter | _[org.apache.activemq.store.PersistenceAdapter|#org.apache.activemq.store.PersistenceAdapter-types]_ | {html}{html} | - | queue | _java.lang.String_ | {html}A helper method to set the destination from a configuration file{html} | - | tempQueue | _boolean_ | {html}{html} | - | tempTopic | _boolean_ | {html}{html} | - | topic | _java.lang.String_ | {html}A helper method to set the destination from a configuration file{html} | - -{anchor:fixedCountSubscriptionRecoveryPolicy-element} -h3. The _[|#fixedCountSubscriptionRecoveryPolicy-element]_ Element - {html}This implementation of {@link SubscriptionRecoveryPolicy} will keep a fixed -count of last messages.{html} -h4. Properties - || Property Name || Type || Description || - | broker | _[org.apache.activemq.broker.Broker|#org.apache.activemq.broker.Broker-types]_ | {html}{html} | - | maximumSize | _int_ | {html}Sets the maximum number of messages that this destination will hold -around in RAM{html} | - -{anchor:fixedSizedSubscriptionRecoveryPolicy-element} -h3. The _[|#fixedSizedSubscriptionRecoveryPolicy-element]_ Element - {html}This implementation of {@link SubscriptionRecoveryPolicy} will keep a fixed -amount of memory available in RAM for message history which is evicted in -time order.{html} -h4. Properties - || Property Name || Type || Description || - | broker | _[org.apache.activemq.broker.Broker|#org.apache.activemq.broker.Broker-types]_ | {html}{html} | - | buffer | _org.apache.activemq.memory.list.MessageList_ | {html}{html} | - | maximumSize | _int_ | {html}Sets the maximum amount of RAM in bytes that this buffer can hold in RAM{html} | - | useSharedBuffer | _boolean_ | {html}{html} | - -{anchor:forcePersistencyModeBroker-element} -h3. The _[|#forcePersistencyModeBroker-element]_ Element - {html}A Plugin which allows to force every incoming message to be PERSISTENT or NON-PERSISTENT. - -Useful, if you have set the broker usage policy to process ONLY persistent or ONLY non-persistent -messages.{html} -h4. Properties - || Property Name || Type || Description || - | adminConnectionContext | _org.apache.activemq.broker.ConnectionContext_ | {html}{html} | - | next | _[org.apache.activemq.broker.Broker|#org.apache.activemq.broker.Broker-types]_ | {html}{html} | - | persistenceFlag | _boolean_ | {html}{html} | - -{anchor:forcePersistencyModeBrokerPlugin-element} -h3. The _[|#forcePersistencyModeBrokerPlugin-element]_ Element - {html}A Plugin which allows to force every incoming message to be PERSISTENT or NON-PERSISTENT. - -Useful, if you have set the broker usage policy to process ONLY persistent or ONLY non-persistent -messages.{html} -h4. Properties - || Property Name || Type || Description || - | persistenceFlag | _boolean_ | {html}Sets the persistency mode.{html} | - -{anchor:forwardingBridge-element} -h3. The _[|#forwardingBridge-element]_ Element - {html}Forwards all messages from the local broker to the remote broker.{html} -h4. Properties - || Property Name || Type || Description || - | clientId | _java.lang.String_ | {html}{html} | - | destinationFilter | _java.lang.String_ | {html}{html} | - | dispatchAsync | _boolean_ | {html}{html} | - | localBroker | _org.apache.activemq.transport.Transport_ | {html}{html} | - | networkBridgeFailedListener | _org.apache.activemq.network.NetworkBridgeListener_ | {html}{html} | - | prefetchSize | _int_ | {html}{html} | - | remoteBroker | _org.apache.activemq.transport.Transport_ | {html}{html} | - | useCompression | _boolean_ | {html}{html} | - -{anchor:hsqldb-jdbc-adapter-element} -h3. The _[|#hsqldb-jdbc-adapter-element]_ Element - {html}{html} -h4. Properties - || Property Name || Type || Description || - | batchStatments | _boolean_ | {html}{html} | - | maxRows | _int_ | {html}the max value for statement maxRows, used to limit jdbc queries{html} | - | statements | _[org.apache.activemq.store.jdbc.Statements|#org.apache.activemq.store.jdbc.Statements-types]_ | {html}{html} | - | useExternalMessageReferences | _boolean_ | {html}{html} | - -{anchor:imageBasedJDBCAdaptor-element} -h3. The _[|#imageBasedJDBCAdaptor-element]_ Element - {html}Provides JDBCAdapter since that uses -IMAGE datatype to hold binary data. - -The databases/JDBC drivers that use this adapter are: -
      -
    • Sybase
    • -
    • MS SQL
    • -
    {html} -h4. Properties - || Property Name || Type || Description || - | batchStatments | _boolean_ | {html}{html} | - | maxRows | _int_ | {html}the max value for statement maxRows, used to limit jdbc queries{html} | - | statements | _[org.apache.activemq.store.jdbc.Statements|#org.apache.activemq.store.jdbc.Statements-types]_ | {html}{html} | - | useExternalMessageReferences | _boolean_ | {html}{html} | - -{anchor:inboundQueueBridge-element} -h3. The _[|#inboundQueueBridge-element]_ Element - {html}Create an Inbound Queue Bridge. By default this class uses the sname name for -both the inbound and outbound queue. This behavior can be overridden however -by using the setter methods to configure both the inbound and outboud queue names -separately.{html} -h4. Properties - || Property Name || Type || Description || - | consumer | _javax.jms.MessageConsumer_ | {html}{html} | - | consumerConnection | _javax.jms.QueueConnection_ | {html}{html} | - | consumerQueue | _[javax.jms.Queue|#javax.jms.Queue-types]_ | {html}{html} | - | doHandleReplyTo | _boolean_ | {html}{html} | - | inboundQueueName | _java.lang.String_ | {html}Sets the queue name used for the inbound queue, if the outbound queue -name has not been set, then this method uses the same name to configure -the outbound queue name.{html} | - | jmsConnector | _[org.apache.activemq.network.jms.JmsConnector|#org.apache.activemq.network.jms.JmsConnector-types]_ | {html}{html} | - | jmsMessageConvertor | _[org.apache.activemq.network.jms.JmsMesageConvertor|#org.apache.activemq.network.jms.JmsMesageConvertor-types]_ | {html}{html} | - | localQueueName | _java.lang.String_ | {html}{html} | - | producerConnection | _javax.jms.QueueConnection_ | {html}{html} | - | producerQueue | _[javax.jms.Queue|#javax.jms.Queue-types]_ | {html}{html} | - | selector | _java.lang.String_ | {html}{html} | - -{anchor:inboundTopicBridge-element} -h3. The _[|#inboundTopicBridge-element]_ Element - {html}Create an Inbound Topic Bridge. By default this class uses the topic name for -both the inbound and outbound topic. This behavior can be overridden however -by using the setter methods to configure both the inbound and outboud topic names -separately.{html} -h4. Properties - || Property Name || Type || Description || - | consumer | _javax.jms.MessageConsumer_ | {html}{html} | - | consumerConnection | _javax.jms.TopicConnection_ | {html}{html} | - | consumerName | _java.lang.String_ | {html}{html} | - | consumerTopic | _[javax.jms.Topic|#javax.jms.Topic-types]_ | {html}{html} | - | doHandleReplyTo | _boolean_ | {html}{html} | - | inboundTopicName | _java.lang.String_ | {html}Sets the topic name used for the inbound topic, if the outbound topic -name has not been set, then this method uses the same name to configure -the outbound topic name.{html} | - | jmsConnector | _[org.apache.activemq.network.jms.JmsConnector|#org.apache.activemq.network.jms.JmsConnector-types]_ | {html}{html} | - | jmsMessageConvertor | _[org.apache.activemq.network.jms.JmsMesageConvertor|#org.apache.activemq.network.jms.JmsMesageConvertor-types]_ | {html}{html} | - | localTopicName | _java.lang.String_ | {html}{html} | - | producerConnection | _javax.jms.TopicConnection_ | {html}{html} | - | producerTopic | _[javax.jms.Topic|#javax.jms.Topic-types]_ | {html}{html} | - | selector | _java.lang.String_ | {html}{html} | - -{anchor:individualDeadLetterStrategy-element} -h3. The _[|#individualDeadLetterStrategy-element]_ Element - {html}A {@link DeadLetterStrategy} where each destination has its own individual -DLQ using the subject naming hierarchy.{html} -h4. Properties - || Property Name || Type || Description || - | destinationPerDurableSubscriber | _boolean_ | {html}sets whether durable topic subscriptions are to get individual dead letter destinations. -When true, the DLQ is of the form 'topicPrefix.clientId:subscriptionName' -The default is false.{html} | - | enableAudit | _boolean_ | {html}{html} | - | processExpired | _boolean_ | {html}{html} | - | processNonPersistent | _boolean_ | {html}{html} | - | queuePrefix | _java.lang.String_ | {html}Sets the prefix to use for all dead letter queues for queue messages{html} | - | queueSuffix | _java.lang.String_ | {html}Sets the suffix to use for all dead letter queues for queue messages{html} | - | topicPrefix | _java.lang.String_ | {html}Sets the prefix to use for all dead letter queues for topic messages{html} | - | topicSuffix | _java.lang.String_ | {html}Sets the suffix to use for all dead letter queues for topic messages{html} | - | useQueueForQueueMessages | _boolean_ | {html}Sets whether a queue or topic should be used for queue messages sent to a -DLQ. The default is to use a Queue{html} | - | useQueueForTopicMessages | _boolean_ | {html}Sets whether a queue or topic should be used for topic messages sent to a -DLQ. The default is to use a Queue{html} | - -{anchor:informixJDBCAdapter-element} -h3. The _[|#informixJDBCAdapter-element]_ Element - {html}JDBC Adapter for Informix database. -Because Informix database restricts length of composite primary keys, length of -container name field and subscription id field must be reduced to 150 characters. -Therefore be sure not to use longer names for container name and subscription id than 150 characters.{html} -h4. Properties - || Property Name || Type || Description || - | batchStatments | _boolean_ | {html}{html} | - | maxRows | _int_ | {html}the max value for statement maxRows, used to limit jdbc queries{html} | - | statements | _[org.apache.activemq.store.jdbc.Statements|#org.apache.activemq.store.jdbc.Statements-types]_ | {html}{html} | - | useExternalMessageReferences | _boolean_ | {html}{html} | - -{anchor:jDBCIOExceptionHandler-element} -h3. The _[|#jDBCIOExceptionHandler-element]_ Element - {html}{html} -h4. Properties - || Property Name || Type || Description || - | brokerService | _[org.apache.activemq.broker.BrokerService|#org.apache.activemq.broker.BrokerService-types]_ | {html}{html} | - | ignoreAllErrors | _boolean_ | {html}{html} | - | ignoreNoSpaceErrors | _boolean_ | {html}{html} | - | ignoreSQLExceptions | _boolean_ | {html}{html} | - | noSpaceMessage | _java.lang.String_ | {html}{html} | - | resumeCheckSleepPeriod | _long_ | {html}{html} | - | sqlExceptionMessage | _java.lang.String_ | {html}{html} | - | stopStartConnectors | _boolean_ | {html}{html} | - -{anchor:jaasAuthenticationPlugin-element} -h3. The _[|#jaasAuthenticationPlugin-element]_ Element - {html}Provides a JAAS based authentication plugin{html} -h4. Properties - || Property Name || Type || Description || - | configuration | _java.lang.String_ | {html}Sets the JAAS configuration domain name used{html} | - | discoverLoginConfig | _boolean_ | {html}Enables or disables the auto-discovery of the login.config file for JAAS to initialize itself. -This flag is enabled by default such that if the java.security.auth.login.config system property -is not defined then it is set to the location of the login.config file on the classpath.{html} | - -{anchor:jaasCertificateAuthenticationPlugin-element} -h3. The _[|#jaasCertificateAuthenticationPlugin-element]_ Element - {html}Provides a JAAS based SSL certificate authentication plugin{html} -h4. Properties - || Property Name || Type || Description || - | configuration | _java.lang.String_ | {html}Sets the JAAS configuration domain name used{html} | - | discoverLoginConfig | _boolean_ | {html}Enables or disables the auto-discovery of the login.config file for JAAS to initialize itself. -This flag is enabled by default such that if the java.security.auth.login.config system property -is not defined then it is set to the location of the login.config file on the classpath.{html} | - -{anchor:jaasDualAuthenticationPlugin-element} -h3. The _[|#jaasDualAuthenticationPlugin-element]_ Element - {html}Provides a JAAS based authentication plugin{html} -h4. Properties - || Property Name || Type || Description || - | configuration | _java.lang.String_ | {html}Sets the JAAS configuration domain name used{html} | - | discoverLoginConfig | _boolean_ | {html}Enables or disables the auto-discovery of the login.config file for JAAS to initialize itself. -This flag is enabled by default such that if the java.security.auth.login.config system property -is not defined then it is set to the location of the login.config file on the classpath.{html} | - | sslConfiguration | _java.lang.String_ | {html}Set the JAAS SSL configuration domain{html} | - -{anchor:jdbcPersistenceAdapter-element} -h3. The _[|#jdbcPersistenceAdapter-element]_ Element - {html}A {@link PersistenceAdapter} implementation using JDBC for persistence -storage. - -This persistence adapter will correctly remember prepared XA transactions, -but it will not keep track of local transaction commits so that operations -performed against the Message store are done as a single uow.{html} -h4. Properties - || Property Name || Type || Description || - | adapter | _[org.apache.activemq.store.jdbc.JDBCAdapter|#org.apache.activemq.store.jdbc.JDBCAdapter-types]_ | {html}{html} | - | auditRecoveryDepth | _int_ | {html}{html} | - | brokerName | _java.lang.String_ | {html}{html} | - | brokerService | _[org.apache.activemq.broker.BrokerService|#org.apache.activemq.broker.BrokerService-types]_ | {html}{html} | - | changeAutoCommitAllowed | _boolean_ | {html}Whether the JDBC driver allows to set the auto commit. -Some drivers does not allow changing the auto commit. The default value is true.{html} | - | cleanupPeriod | _int_ | {html}Sets the number of milliseconds until the database is attempted to be -cleaned up for durable topics{html} | - | createTablesOnStartup | _boolean_ | {html}Sets whether or not tables are created on startup{html} | - | dataDirectory | _java.lang.String_ | {html}{html} | - | dataDirectoryFile | _java.io.File_ | {html}{html} | - | dataSource | _javax.sql.DataSource_ | {html}{html} | - | databaseLocker | _[org.apache.activemq.broker.Locker|#org.apache.activemq.broker.Locker-types]_ | {html}Sets the database locker strategy to use to lock the database on startup{html} | - | directory | _java.io.File_ | {html}{html} | - | ds | _javax.sql.DataSource_ | {html}{html} | - | enableAudit | _boolean_ | {html}{html} | - | lockAcquireSleepInterval | _long_ | {html}{html} | - | lockDataSource | _javax.sql.DataSource_ | {html}{html} | - | lockKeepAlivePeriod | _long_ | {html}{html} | - | locker | _[org.apache.activemq.broker.Locker|#org.apache.activemq.broker.Locker-types]_ | {html}{html} | - | maxAuditDepth | _int_ | {html}{html} | - | maxProducersToAudit | _int_ | {html}{html} | - | maxRows | _int_ | {html}{html} | - | scheduledThreadPoolExecutor | _java.util.concurrent.ScheduledThreadPoolExecutor_ | {html}{html} | - | statements | _[org.apache.activemq.store.jdbc.Statements|#org.apache.activemq.store.jdbc.Statements-types]_ | {html}{html} | - | transactionIsolation | _int_ | {html}set the Transaction isolation level to something other that TRANSACTION_READ_UNCOMMITTED -This allowable dirty isolation level may not be achievable in clustered DB environments -so a more restrictive and expensive option may be needed like TRANSACTION_REPEATABLE_READ -see isolation level constants in {@link java.sql.Connection}{html} | - | usageManager | _[org.apache.activemq.usage.SystemUsage|#org.apache.activemq.usage.SystemUsage-types]_ | {html}{html} | - | useDatabaseLock | _boolean_ | {html}{html} | - | useExternalMessageReferences | _boolean_ | {html}{html} | - | useLock | _boolean_ | {html}{html} | - | wireFormat | _org.apache.activemq.wireformat.WireFormat_ | {html}{html} | - -{anchor:jmsQueueConnector-element} -h3. The _[|#jmsQueueConnector-element]_ Element - {html}A Bridge to other JMS Queue providers{html} -h4. Properties - || Property Name || Type || Description || - | brokerService | _[org.apache.activemq.broker.BrokerService|#org.apache.activemq.broker.BrokerService-types]_ | {html}One way to configure the local connection - this is called by The -BrokerService when the Connector is embedded{html} | - | inboundMessageConvertor | _[org.apache.activemq.network.jms.JmsMesageConvertor|#org.apache.activemq.network.jms.JmsMesageConvertor-types]_ | {html}{html} | - | inboundQueueBridges | (_[org.apache.activemq.network.jms.InboundQueueBridge|#org.apache.activemq.network.jms.InboundQueueBridge-types]_)\* | {html}{html} | - | jndiLocalTemplate | _org.springframework.jndi.JndiTemplate_ | {html}{html} | - | jndiOutboundTemplate | _org.springframework.jndi.JndiTemplate_ | {html}{html} | - | localClientId | _java.lang.String_ | {html}{html} | - | localConnectionFactoryName | _java.lang.String_ | {html}{html} | - | localPassword | _java.lang.String_ | {html}{html} | - | localQueueConnection | _javax.jms.QueueConnection_ | {html}{html} | - | localQueueConnectionFactory | _[javax.jms.QueueConnectionFactory|#javax.jms.QueueConnectionFactory-types]_ | {html}{html} | - | localUsername | _java.lang.String_ | {html}{html} | - | name | _java.lang.String_ | {html}{html} | - | outboundClientId | _java.lang.String_ | {html}{html} | - | outboundMessageConvertor | _[org.apache.activemq.network.jms.JmsMesageConvertor|#org.apache.activemq.network.jms.JmsMesageConvertor-types]_ | {html}{html} | - | outboundPassword | _java.lang.String_ | {html}{html} | - | outboundQueueBridges | (_[org.apache.activemq.network.jms.OutboundQueueBridge|#org.apache.activemq.network.jms.OutboundQueueBridge-types]_)\* | {html}{html} | - | outboundQueueConnection | _javax.jms.QueueConnection_ | {html}{html} | - | outboundQueueConnectionFactory | _[javax.jms.QueueConnectionFactory|#javax.jms.QueueConnectionFactory-types]_ | {html}{html} | - | outboundQueueConnectionFactoryName | _java.lang.String_ | {html}{html} | - | outboundUsername | _java.lang.String_ | {html}{html} | - | preferJndiDestinationLookup | _boolean_ | {html}Sets whether the connector should prefer to first try to find a destination in JNDI before -using JMS semantics to create a Destination. By default the connector will first use JMS -semantics and then fall-back to JNDI lookup, setting this value to true will reverse that -ordering.{html} | - | reconnectionPolicy | _[org.apache.activemq.network.jms.ReconnectionPolicy|#org.apache.activemq.network.jms.ReconnectionPolicy-types]_ | {html}{html} | - | replyToDestinationCacheSize | _int_ | {html}{html} | - -{anchor:jmsTopicConnector-element} -h3. The _[|#jmsTopicConnector-element]_ Element - {html}A Bridge to other JMS Topic providers{html} -h4. Properties - || Property Name || Type || Description || - | brokerService | _[org.apache.activemq.broker.BrokerService|#org.apache.activemq.broker.BrokerService-types]_ | {html}One way to configure the local connection - this is called by The -BrokerService when the Connector is embedded{html} | - | inboundMessageConvertor | _[org.apache.activemq.network.jms.JmsMesageConvertor|#org.apache.activemq.network.jms.JmsMesageConvertor-types]_ | {html}{html} | - | inboundTopicBridges | (_[org.apache.activemq.network.jms.InboundTopicBridge|#org.apache.activemq.network.jms.InboundTopicBridge-types]_)\* | {html}{html} | - | jndiLocalTemplate | _org.springframework.jndi.JndiTemplate_ | {html}{html} | - | jndiOutboundTemplate | _org.springframework.jndi.JndiTemplate_ | {html}{html} | - | localClientId | _java.lang.String_ | {html}{html} | - | localConnectionFactoryName | _java.lang.String_ | {html}{html} | - | localPassword | _java.lang.String_ | {html}{html} | - | localTopicConnection | _javax.jms.TopicConnection_ | {html}{html} | - | localTopicConnectionFactory | _[javax.jms.TopicConnectionFactory|#javax.jms.TopicConnectionFactory-types]_ | {html}{html} | - | localUsername | _java.lang.String_ | {html}{html} | - | name | _java.lang.String_ | {html}{html} | - | outboundClientId | _java.lang.String_ | {html}{html} | - | outboundMessageConvertor | _[org.apache.activemq.network.jms.JmsMesageConvertor|#org.apache.activemq.network.jms.JmsMesageConvertor-types]_ | {html}{html} | - | outboundPassword | _java.lang.String_ | {html}{html} | - | outboundTopicBridges | (_[org.apache.activemq.network.jms.OutboundTopicBridge|#org.apache.activemq.network.jms.OutboundTopicBridge-types]_)\* | {html}{html} | - | outboundTopicConnection | _javax.jms.TopicConnection_ | {html}{html} | - | outboundTopicConnectionFactory | _[javax.jms.TopicConnectionFactory|#javax.jms.TopicConnectionFactory-types]_ | {html}{html} | - | outboundTopicConnectionFactoryName | _java.lang.String_ | {html}{html} | - | outboundUsername | _java.lang.String_ | {html}{html} | - | preferJndiDestinationLookup | _boolean_ | {html}Sets whether the connector should prefer to first try to find a destination in JNDI before -using JMS semantics to create a Destination. By default the connector will first use JMS -semantics and then fall-back to JNDI lookup, setting this value to true will reverse that -ordering.{html} | - | reconnectionPolicy | _[org.apache.activemq.network.jms.ReconnectionPolicy|#org.apache.activemq.network.jms.ReconnectionPolicy-types]_ | {html}{html} | - | replyToDestinationCacheSize | _int_ | {html}{html} | - -{anchor:jobSchedulerUsage-element} -h3. The _[|#jobSchedulerUsage-element]_ Element - {html}Used to keep track of how much of something is being used so that a -productive working set usage can be controlled. Main use case is manage -memory usage.{html} -h4. Properties - || Property Name || Type || Description || - | executor | _java.util.concurrent.ThreadPoolExecutor_ | {html}{html} | - | limit | _java.lang.String_ | {html}Sets the memory limit in bytes. Setting the limit in bytes will set the usagePortion to 0 since the UsageManager -is not going to be portion based off the parent. When set using Xbean, values of the form "20 Mb", "1024kb", and -"1g" can be used{html} | - | limiter | _[org.apache.activemq.usage.UsageCapacity|#org.apache.activemq.usage.UsageCapacity-types]_ | {html}{html} | - | name | _java.lang.String_ | {html}{html} | - | parent | _T_ | {html}{html} | - | percentUsage | _int_ | {html}{html} | - | percentUsageMinDelta | _java.lang.String_ | {html}Sets the minimum number of percentage points the usage has to change before a UsageListener event is fired by the -manager.{html} | - | pollingTime | _int_ | {html}{html} | - | store | _org.apache.activemq.broker.scheduler.JobSchedulerStore_ | {html}{html} | - | usagePortion | _float_ | {html}{html} | - -{anchor:journalPersistenceAdapter-element} -h3. The _[|#journalPersistenceAdapter-element]_ Element - {html}An implementation of {@link PersistenceAdapter} designed for use with a -{@link Journal} and then check pointing asynchronously on a timeout with some -other long term persistent storage.{html} -h4. Properties - || Property Name || Type || Description || - | brokerName | _java.lang.String_ | {html}{html} | - | brokerService | _[org.apache.activemq.broker.BrokerService|#org.apache.activemq.broker.BrokerService-types]_ | {html}{html} | - | directory | _java.io.File_ | {html}{html} | - | journal | _org.apache.activeio.journal.Journal_ | {html}{html} | - | longTermPersistence | _[org.apache.activemq.store.PersistenceAdapter|#org.apache.activemq.store.PersistenceAdapter-types]_ | {html}{html} | - | maxCheckpointMessageAddSize | _int_ | {html}{html} | - | maxCheckpointWorkers | _int_ | {html}{html} | - | persistenceAdapter | _[org.apache.activemq.store.PersistenceAdapter|#org.apache.activemq.store.PersistenceAdapter-types]_ | {html}{html} | - | taskRunnerFactory | _[org.apache.activemq.thread.TaskRunnerFactory|#org.apache.activemq.thread.TaskRunnerFactory-types]_ | {html}{html} | - | usageManager | _[org.apache.activemq.usage.SystemUsage|#org.apache.activemq.usage.SystemUsage-types]_ | {html}{html} | - | useExternalMessageReferences | _boolean_ | {html}{html} | - -{anchor:journalPersistenceAdapterFactory-element} -h3. The _[|#journalPersistenceAdapterFactory-element]_ Element - {html}Factory class that can create PersistenceAdapter objects.{html} -h4. Properties - || Property Name || Type || Description || - | adapter | _[org.apache.activemq.store.jdbc.JDBCAdapter|#org.apache.activemq.store.jdbc.JDBCAdapter-types]_ | {html}{html} | - | brokerService | _[org.apache.activemq.broker.BrokerService|#org.apache.activemq.broker.BrokerService-types]_ | {html}{html} | - | createTablesOnStartup | _boolean_ | {html}Sets whether or not tables are created on startup{html} | - | dataDirectory | _java.lang.String_ | {html}{html} | - | dataDirectoryFile | _java.io.File_ | {html}{html} | - | dataSource | _javax.sql.DataSource_ | {html}{html} | - | jdbcAdapter | _[org.apache.activemq.store.jdbc.JDBCPersistenceAdapter|#org.apache.activemq.store.jdbc.JDBCPersistenceAdapter-types]_ | {html}{html} | - | journal | _org.apache.activeio.journal.Journal_ | {html}{html} | - | journalArchiveDirectory | _java.io.File_ | {html}{html} | - | journalLogFileSize | _java.lang.String_ | {html}Sets the size of the journal log files -When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used{html} | - | journalLogFiles | _int_ | {html}Sets the number of journal log files to use{html} | - | journalThreadPriority | _int_ | {html}Sets the thread priority of the journal thread{html} | - | lockKeepAlivePeriod | _long_ | {html}{html} | - | locker | _[org.apache.activemq.broker.Locker|#org.apache.activemq.broker.Locker-types]_ | {html}{html} | - | statements | _[org.apache.activemq.store.jdbc.Statements|#org.apache.activemq.store.jdbc.Statements-types]_ | {html}{html} | - | taskRunnerFactory | _[org.apache.activemq.thread.TaskRunnerFactory|#org.apache.activemq.thread.TaskRunnerFactory-types]_ | {html}{html} | - | useDatabaseLock | _boolean_ | {html}Sets whether or not an exclusive database lock should be used to enable -JDBC Master/Slave. Enabled by default.{html} | - | useDedicatedTaskRunner | _boolean_ | {html}{html} | - | useJournal | _boolean_ | {html}Enables or disables the use of the journal. The default is to use the -journal{html} | - | useLock | _boolean_ | {html}{html} | - | useQuickJournal | _boolean_ | {html}Enables or disables the use of quick journal, which keeps messages in the -journal and just stores a reference to the messages in JDBC. Defaults to -false so that messages actually reside long term in the JDBC database.{html} | - -{anchor:journaledJDBC-element} -h3. The _[|#journaledJDBC-element]_ Element - {html}Creates a default persistence model using the Journal and JDBC{html} -h4. Properties - || Property Name || Type || Description || - | adapter | _[org.apache.activemq.store.jdbc.JDBCAdapter|#org.apache.activemq.store.jdbc.JDBCAdapter-types]_ | {html}{html} | - | brokerService | _[org.apache.activemq.broker.BrokerService|#org.apache.activemq.broker.BrokerService-types]_ | {html}{html} | - | createTablesOnStartup | _boolean_ | {html}Sets whether or not tables are created on startup{html} | - | dataDirectory | _java.lang.String_ | {html}{html} | - | dataDirectoryFile | _java.io.File_ | {html}{html} | - | dataSource | _javax.sql.DataSource_ | {html}{html} | - | jdbcAdapter | _[org.apache.activemq.store.jdbc.JDBCPersistenceAdapter|#org.apache.activemq.store.jdbc.JDBCPersistenceAdapter-types]_ | {html}{html} | - | journal | _org.apache.activeio.journal.Journal_ | {html}{html} | - | journalArchiveDirectory | _java.io.File_ | {html}{html} | - | journalLogFileSize | _java.lang.String_ | {html}Sets the size of the journal log files -When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used{html} | - | journalLogFiles | _int_ | {html}Sets the number of journal log files to use{html} | - | journalThreadPriority | _int_ | {html}Sets the thread priority of the journal thread{html} | - | lockKeepAlivePeriod | _long_ | {html}{html} | - | locker | _[org.apache.activemq.broker.Locker|#org.apache.activemq.broker.Locker-types]_ | {html}{html} | - | statements | _[org.apache.activemq.store.jdbc.Statements|#org.apache.activemq.store.jdbc.Statements-types]_ | {html}{html} | - | taskRunnerFactory | _[org.apache.activemq.thread.TaskRunnerFactory|#org.apache.activemq.thread.TaskRunnerFactory-types]_ | {html}{html} | - | useDatabaseLock | _boolean_ | {html}Sets whether or not an exclusive database lock should be used to enable -JDBC Master/Slave. Enabled by default.{html} | - | useDedicatedTaskRunner | _boolean_ | {html}{html} | - | useJournal | _boolean_ | {html}Enables or disables the use of the journal. The default is to use the -journal{html} | - | useLock | _boolean_ | {html}{html} | - | useQuickJournal | _boolean_ | {html}Enables or disables the use of quick journal, which keeps messages in the -journal and just stores a reference to the messages in JDBC. Defaults to -false so that messages actually reside long term in the JDBC database.{html} | - -{anchor:kahaDB-element} -h3. The _[|#kahaDB-element]_ Element - {html}An implementation of {@link PersistenceAdapter} designed for use with -KahaDB - Embedded Lightweight Non-Relational Database{html} -h4. Properties - || Property Name || Type || Description || - | archiveCorruptedIndex | _boolean_ | {html}{html} | - | archiveDataLogs | _boolean_ | {html}{html} | - | brokerName | _java.lang.String_ | {html}{html} | - | brokerService | _[org.apache.activemq.broker.BrokerService|#org.apache.activemq.broker.BrokerService-types]_ | {html}{html} | - | checkForCorruptJournalFiles | _boolean_ | {html}{html} | - | checkpointInterval | _long_ | {html}Get the checkpointInterval{html} | - | checksumJournalFiles | _boolean_ | {html}{html} | - | cleanupInterval | _long_ | {html}Get the cleanupInterval{html} | - | concurrentStoreAndDispatchQueues | _boolean_ | {html}{html} | - | concurrentStoreAndDispatchTopics | _boolean_ | {html}{html} | - | databaseLockedWaitDelay | _int_ | {html}{html} | - | directory | _java.io.File_ | {html}Get the directory{html} | - | directoryArchive | _java.io.File_ | {html}{html} | - | enableIndexDiskSyncs | _boolean_ | {html}{html} | - | enableIndexPageCaching | _boolean_ | {html}{html} | - | enableIndexRecoveryFile | _boolean_ | {html}{html} | - | enableIndexWriteAsync | _boolean_ | {html}Get the enableIndexWriteAsync{html} | - | enableJournalDiskSyncs | _boolean_ | {html}Get the enableJournalDiskSyncs{html} | - | failoverProducersAuditDepth | _int_ | {html}set the audit window depth for duplicate suppression (should exceed the max transaction -batch){html} | - | forceRecoverIndex | _boolean_ | {html}{html} | - | ignoreMissingJournalfiles | _boolean_ | {html}Get the ignoreMissingJournalfiles{html} | - | indexCacheSize | _java.lang.String_ | {html}Get the indexCacheSize{html} | - | indexLFUEvictionFactor | _float_ | {html}{html} | - | indexWriteBatchSize | _java.lang.String_ | {html}Get the indexWriteBatchSize{html} | - | journalMaxFileLength | _java.lang.String_ | {html}Get the journalMaxFileLength{html} | - | journalMaxWriteBatchSize | _java.lang.String_ | {html}Get the journalMaxWriteBatchSize{html} | - | lockKeepAlivePeriod | _long_ | {html}{html} | - | locker | _[org.apache.activemq.broker.Locker|#org.apache.activemq.broker.Locker-types]_ | {html}{html} | - | maxAsyncJobs | _int_ | {html}{html} | - | maxFailoverProducersToTrack | _int_ | {html}Set the max number of producers (LRU cache) to track for duplicate sends{html} | - | rewriteOnRedelivery | _boolean_ | {html}When true, persist the redelivery status such that the message redelivery flag can survive a broker failure -used with org.apache.activemq.ActiveMQConnectionFactory#setTransactedIndividualAck(boolean) true{html} | - | transactionIdTransformer | _org.apache.activemq.store.TransactionIdTransformer_ | {html}{html} | - | usageManager | _[org.apache.activemq.usage.SystemUsage|#org.apache.activemq.usage.SystemUsage-types]_ | {html}{html} | - | useIndexLFRUEviction | _boolean_ | {html}{html} | - | useLock | _boolean_ | {html}{html} | - -{anchor:lDAPAuthorizationMap-element} -h3. The _[|#lDAPAuthorizationMap-element]_ Element - {html}An {@link AuthorizationMap} which uses LDAP{html} -h4. Properties - || Property Name || Type || Description || - | adminAttribute | _java.lang.String_ | {html}{html} | - | adminBase | _java.lang.String_ | {html}{html} | - | advisorySearchBase | _java.lang.String_ | {html}{html} | - | authentication | _java.lang.String_ | {html}{html} | - | connectionPassword | _java.lang.String_ | {html}{html} | - | connectionProtocol | _java.lang.String_ | {html}{html} | - | connectionURL | _java.lang.String_ | {html}{html} | - | connectionUsername | _java.lang.String_ | {html}{html} | - | context | _javax.naming.directory.DirContext_ | {html}{html} | - | initialContextFactory | _java.lang.String_ | {html}{html} | - | options | _java.util.Map_ | {html}{html} | - | queueSearchMatchingFormat | _java.text.MessageFormat_ | {html}{html} | - | queueSearchSubtreeBool | _boolean_ | {html}{html} | - | readAttribute | _java.lang.String_ | {html}{html} | - | readBase | _java.lang.String_ | {html}{html} | - | tempSearchBase | _java.lang.String_ | {html}{html} | - | topicSearchMatchingFormat | _java.text.MessageFormat_ | {html}{html} | - | topicSearchSubtreeBool | _boolean_ | {html}{html} | - | useAdvisorySearchBase | _boolean_ | {html}{html} | - | writeAttribute | _java.lang.String_ | {html}{html} | - | writeBase | _java.lang.String_ | {html}{html} | - -{anchor:lastImageSubscriptionRecoveryPolicy-element} -h3. The _[|#lastImageSubscriptionRecoveryPolicy-element]_ Element - {html}This implementation of {@link SubscriptionRecoveryPolicy} will only keep the -last message.{html} -h4. Properties - || Property Name || Type || Description || - | broker | _[org.apache.activemq.broker.Broker|#org.apache.activemq.broker.Broker-types]_ | {html}{html} | - -{anchor:ldapNetworkConnector-element} -h3. The _[|#ldapNetworkConnector-element]_ Element - {html}class to create dynamic network connectors listed in an directory server -using the LDAP v3 protocol as defined in RFC 2251, the entries listed in the -directory server must implement the ipHost and ipService objectClasses as -defined in RFC 2307.{html} -h4. Properties - || Property Name || Type || Description || - | advisoryForFailedForward | _boolean_ | {html}{html} | - | alwaysSyncSend | _boolean_ | {html}{html} | - | anonymousAuthentication | _boolean_ | {html}sets LDAP anonymous authentication access credentials{html} | - | base | _java.lang.String_ | {html}sets the base LDAP dn used for lookup operations{html} | - | bridgeTempDestinations | _boolean_ | {html}{html} | - | brokerName | _java.lang.String_ | {html}{html} | - | brokerService | _[org.apache.activemq.broker.BrokerService|#org.apache.activemq.broker.BrokerService-types]_ | {html}{html} | - | brokerURL | _java.lang.String_ | {html}{html} | - | conduitSubscriptions | _boolean_ | {html}{html} | - | connectionFilter | _org.apache.activemq.network.ConnectionFilter_ | {html}{html} | - | consumerPriorityBase | _int_ | {html}{html} | - | consumerTTL | _int_ | {html}{html} | - | decreaseNetworkConsumerPriority | _boolean_ | {html}{html} | - | destinationFilter | _java.lang.String_ | {html}{html} | - | dispatchAsync | _boolean_ | {html}{html} | - | duplex | _boolean_ | {html}{html} | - | durableDestinations | (_java.lang.Object_)\* | {html}{html} | - | dynamicOnly | _boolean_ | {html}{html} | - | dynamicallyIncludedDestinations | (_java.lang.Object_)\* | {html}{html} | - | excludedDestinations | (_java.lang.Object_)\* | {html}{html} | - | localUri | _java.net.URI_ | {html}{html} | - | messageTTL | _int_ | {html}{html} | - | name | _java.lang.String_ | {html}{html} | - | networkTTL | _int_ | {html}{html} | - | objectName | _javax.management.ObjectName_ | {html}{html} | - | password | _java.lang.String_ | {html}sets the LDAP password for access credentials{html} | - | prefetchSize | _java.lang.String_ | {html}{html} | - | searchEventListener | _boolean_ | {html}enables/disable a persistent search to the LDAP server as defined in -draft-ietf-ldapext-psearch-03.txt (2.16.840.1.113730.3.4.3){html} | - | searchFilter | _java.lang.String_ | {html}sets the LDAP search filter as defined in RFC 2254{html} | - | searchScope | _java.lang.String_ | {html}sets the LDAP search scope{html} | - | staticBridge | _boolean_ | {html}{html} | - | staticallyIncludedDestinations | (_java.lang.Object_)\* | {html}{html} | - | suppressDuplicateQueueSubscriptions | _boolean_ | {html}{html} | - | suppressDuplicateTopicSubscriptions | _boolean_ | {html}{html} | - | uri | _java.net.URI_ | {html}returns the next URI from the configured list{html} | - | useBrokerNameAsIdSees | _boolean_ | {html}{html} | - | useCompression | _boolean_ | {html}{html} | - | user | _java.lang.String_ | {html}sets the LDAP user for access credentials{html} | - | userName | _java.lang.String_ | {html}{html} | - -{anchor:lease-database-locker-element} -h3. The _[|#lease-database-locker-element]_ Element - {html}Represents an exclusive lease on a database to avoid multiple brokers running -against the same logical database.{html} -h4. Properties - || Property Name || Type || Description || - | createTablesOnStartup | _boolean_ | {html}{html} | - | dataSource | _javax.sql.DataSource_ | {html}{html} | - | failIfLocked | _boolean_ | {html}{html} | - | leaseHolderId | _java.lang.String_ | {html}{html} | - | lockAcquireSleepInterval | _long_ | {html}{html} | - | lockable | _[org.apache.activemq.broker.LockableServiceSupport|#org.apache.activemq.broker.LockableServiceSupport-types]_ | {html}{html} | - | maxAllowableDiffFromDBTime | _int_ | {html}{html} | - | name | _java.lang.String_ | {html}{html} | - | queryTimeout | _int_ | {html}{html} | - | statements | _[org.apache.activemq.store.jdbc.Statements|#org.apache.activemq.store.jdbc.Statements-types]_ | {html}{html} | - -{anchor:levelDB-element} -h3. The _[|#levelDB-element]_ Element - {html}An implementation of {@link org.apache.activemq.store.PersistenceAdapter} designed for use with -LevelDB - Embedded Lightweight Non-Relational Database{html} -h4. Properties - || Property Name || Type || Description || - | asyncBufferSize | _int_ | {html}{html} | - | autoCompactionRatio | _int_ | {html}{html} | - | brokerName | _java.lang.String_ | {html}{html} | - | brokerService | _[org.apache.activemq.broker.BrokerService|#org.apache.activemq.broker.BrokerService-types]_ | {html}{html} | - | directory | _java.io.File_ | {html}{html} | - | failoverProducersAuditDepth | _int_ | {html}{html} | - | flushDelay | _int_ | {html}{html} | - | indexBlockRestartInterval | _int_ | {html}{html} | - | indexBlockSize | _int_ | {html}{html} | - | indexCacheSize | _long_ | {html}{html} | - | indexCompression | _java.lang.String_ | {html}{html} | - | indexFactory | _java.lang.String_ | {html}{html} | - | indexMaxOpenFiles | _int_ | {html}{html} | - | indexWriteBufferSize | _int_ | {html}{html} | - | lockKeepAlivePeriod | _long_ | {html}{html} | - | locker | _[org.apache.activemq.broker.Locker|#org.apache.activemq.broker.Locker-types]_ | {html}{html} | - | logCompression | _java.lang.String_ | {html}{html} | - | logDirectory | _java.io.File_ | {html}{html} | - | logSize | _long_ | {html}{html} | - | maxFailoverProducersToTrack | _int_ | {html}{html} | - | monitorStats | _boolean_ | {html}{html} | - | paranoidChecks | _boolean_ | {html}{html} | - | sync | _boolean_ | {html}{html} | - | transactionIdTransformer | _org.apache.activemq.store.TransactionIdTransformer_ | {html}{html} | - | usageManager | _[org.apache.activemq.usage.SystemUsage|#org.apache.activemq.usage.SystemUsage-types]_ | {html}{html} | - | useLock | _boolean_ | {html}{html} | - | verifyChecksums | _boolean_ | {html}{html} | - -{anchor:loggingBrokerPlugin-element} -h3. The _[|#loggingBrokerPlugin-element]_ Element - {html}A simple Broker intercepter which allows you to enable/disable logging.{html} -h4. Properties - || Property Name || Type || Description || - | adminConnectionContext | _org.apache.activemq.broker.ConnectionContext_ | {html}{html} | - | logAll | _boolean_ | {html}Logger all Events that go through the Plugin{html} | - | logConnectionEvents | _boolean_ | {html}Logger Events that are related to connections{html} | - | logConsumerEvents | _boolean_ | {html}Logger Events that are related to Consumers{html} | - | logInternalEvents | _boolean_ | {html}Logger Events that are normally internal to the broker{html} | - | logMessageEvents | _boolean_ | {html}Logger Events that are related to message processing{html} | - | logProducerEvents | _boolean_ | {html}Logger Events that are related to Producers{html} | - | logSessionEvents | _boolean_ | {html}Logger Events that are related to sessions{html} | - | logTransactionEvents | _boolean_ | {html}Logger Events that are related to transaction processing{html} | - | next | _[org.apache.activemq.broker.Broker|#org.apache.activemq.broker.Broker-types]_ | {html}{html} | - | perDestinationLogger | _boolean_ | {html}{html} | - -{anchor:mKahaDB-element} -h3. The _[|#mKahaDB-element]_ Element - {html}An implementation of {@link org.apache.activemq.store.PersistenceAdapter} that supports -distribution of destinations across multiple kahaDB persistence adapters{html} -h4. Properties - || Property Name || Type || Description || - | brokerName | _java.lang.String_ | {html}{html} | - | brokerService | _[org.apache.activemq.broker.BrokerService|#org.apache.activemq.broker.BrokerService-types]_ | {html}{html} | - | directory | _java.io.File_ | {html}{html} | - | filteredPersistenceAdapters | (_java.lang.Object_)\* | {html}Sets the FilteredKahaDBPersistenceAdapter entries{html} | - | journalMaxFileLength | _java.lang.String_ | {html}Set the max file length of the transaction journal -When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can -be used{html} | - | journalWriteBatchSize | _java.lang.String_ | {html}Set the max write batch size of the transaction journal -When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can -be used{html} | - | lockKeepAlivePeriod | _long_ | {html}{html} | - | locker | _[org.apache.activemq.broker.Locker|#org.apache.activemq.broker.Locker-types]_ | {html}{html} | - | transactionStore | _org.apache.activemq.store.kahadb.MultiKahaDBTransactionStore_ | {html}{html} | - | usageManager | _[org.apache.activemq.usage.SystemUsage|#org.apache.activemq.usage.SystemUsage-types]_ | {html}{html} | - | useLock | _boolean_ | {html}{html} | - -{anchor:managementContext-element} -h3. The _[|#managementContext-element]_ Element - {html}An abstraction over JMX mbean registration{html} -h4. Properties - || Property Name || Type || Description || - | MBeanServer | _javax.management.MBeanServer_ | {html}Get the MBeanServer{html} | - | allowRemoteAddressInMBeanNames | _boolean_ | {html}{html} | - | brokerName | _java.lang.String_ | {html}Gets the broker name this context is used by, may be null -if the broker name was not set.{html} | - | connectorHost | _java.lang.String_ | {html}Get the connectorHost{html} | - | connectorPath | _java.lang.String_ | {html}{html} | - | connectorPort | _java.lang.String_ | {html}{html} | - | createConnector | _java.lang.String_ | {html}{html} | - | createMBeanServer | _boolean_ | {html}{html} | - | environment | _java.util.Map_ | {html}{html} | - | findTigerMbeanServer | _boolean_ | {html}Enables/disables the searching for the Java 5 platform MBeanServer{html} | - | jmxDomainName | _java.lang.String_ | {html}{html} | - | rmiServerPort | _java.lang.String_ | {html}{html} | - | server | _javax.management.MBeanServer_ | {html}{html} | - | useMBeanServer | _boolean_ | {html}{html} | - -{anchor:maxdb-jdbc-adapter-element} -h3. The _[|#maxdb-jdbc-adapter-element]_ Element - {html}JDBC Adapter for the MaxDB database.{html} -h4. Properties - || Property Name || Type || Description || - | batchStatments | _boolean_ | {html}{html} | - | maxRows | _int_ | {html}the max value for statement maxRows, used to limit jdbc queries{html} | - | statements | _[org.apache.activemq.store.jdbc.Statements|#org.apache.activemq.store.jdbc.Statements-types]_ | {html}{html} | - | useExternalMessageReferences | _boolean_ | {html}{html} | - -{anchor:memoryPersistenceAdapter-element} -h3. The _[|#memoryPersistenceAdapter-element]_ Element - {html}{html} -h4. Properties - || Property Name || Type || Description || - | brokerName | _java.lang.String_ | {html}{html} | - | createTransactionStore | _boolean_ | {html}{html} | - | directory | _java.io.File_ | {html}{html} | - | usageManager | _[org.apache.activemq.usage.SystemUsage|#org.apache.activemq.usage.SystemUsage-types]_ | {html}{html} | - | useExternalMessageReferences | _boolean_ | {html}{html} | - -{anchor:memoryUsage-element} -h3. The _[|#memoryUsage-element]_ Element - {html}Used to keep track of how much of something is being used so that a -productive working set usage can be controlled. Main use case is manage -memory usage.{html} -h4. Properties - || Property Name || Type || Description || - | executor | _java.util.concurrent.ThreadPoolExecutor_ | {html}{html} | - | limit | _java.lang.String_ | {html}Sets the memory limit in bytes. Setting the limit in bytes will set the usagePortion to 0 since the UsageManager -is not going to be portion based off the parent. When set using Xbean, values of the form "20 Mb", "1024kb", and -"1g" can be used{html} | - | limiter | _[org.apache.activemq.usage.UsageCapacity|#org.apache.activemq.usage.UsageCapacity-types]_ | {html}{html} | - | name | _java.lang.String_ | {html}{html} | - | parent | _T_ | {html}{html} | - | percentOfJvmHeap | _int_ | {html}{html} | - | percentUsage | _int_ | {html}{html} | - | percentUsageMinDelta | _java.lang.String_ | {html}Sets the minimum number of percentage points the usage has to change before a UsageListener event is fired by the -manager.{html} | - | pollingTime | _int_ | {html}{html} | - | portion | _float_ | {html}{html} | - | usage | _long_ | {html}{html} | - | usagePortion | _float_ | {html}{html} | - -{anchor:messageGroupHashBucketFactory-element} -h3. The _[|#messageGroupHashBucketFactory-element]_ Element - {html}A factory to create instances of {@link SimpleMessageGroupMap} when -implementing the Message -Groups functionality.{html} -h4. Properties - || Property Name || Type || Description || - | bucketCount | _int_ | {html}Sets the number of hash buckets to use for the message group -functionality. This is only applicable to using message groups to -parallelize processing of a queue while preserving order across an -individual JMSXGroupID header value. This value sets the number of hash -buckets that will be used (i.e. the maximum possible concurrency).{html} | - | cacheSize | _int_ | {html}{html} | - -{anchor:mirroredQueue-element} -h3. The _[|#mirroredQueue-element]_ Element - {html}Creates Mirrored -Queue using a prefix and postfix to define the topic name on which to mirror the queue to.{html} -h4. Properties - || Property Name || Type || Description || - | brokerService | _[org.apache.activemq.broker.BrokerService|#org.apache.activemq.broker.BrokerService-types]_ | {html}{html} | - | copyMessage | _boolean_ | {html}Sets whether a copy of the message will be sent to each destination. -Defaults to true so that the forward destination is set as the -destination of the message{html} | - | postfix | _java.lang.String_ | {html}Sets any postix used to identify the queue consumers{html} | - | prefix | _java.lang.String_ | {html}Sets the prefix wildcard used to identify the queue consumers for a given -topic{html} | - -{anchor:multicastNetworkConnector-element} -h3. The _[|#multicastNetworkConnector-element]_ Element - {html}A network connector which uses some kind of multicast-like transport that -communicates with potentially many remote brokers over a single logical -{@link Transport} instance such as when using multicast. - -This implementation does not depend on multicast at all; any other group -based transport could be used.{html} -h4. Properties - || Property Name || Type || Description || - | advisoryForFailedForward | _boolean_ | {html}{html} | - | alwaysSyncSend | _boolean_ | {html}{html} | - | bridge | _[org.apache.activemq.network.DemandForwardingBridgeSupport|#org.apache.activemq.network.DemandForwardingBridgeSupport-types]_ | {html}{html} | - | bridgeTempDestinations | _boolean_ | {html}{html} | - | brokerName | _java.lang.String_ | {html}{html} | - | brokerService | _[org.apache.activemq.broker.BrokerService|#org.apache.activemq.broker.BrokerService-types]_ | {html}{html} | - | brokerURL | _java.lang.String_ | {html}{html} | - | conduitSubscriptions | _boolean_ | {html}{html} | - | connectionFilter | _org.apache.activemq.network.ConnectionFilter_ | {html}{html} | - | consumerPriorityBase | _int_ | {html}{html} | - | consumerTTL | _int_ | {html}{html} | - | decreaseNetworkConsumerPriority | _boolean_ | {html}{html} | - | destinationFilter | _java.lang.String_ | {html}{html} | - | dispatchAsync | _boolean_ | {html}{html} | - | duplex | _boolean_ | {html}{html} | - | durableDestinations | (_java.lang.Object_)\* | {html}{html} | - | dynamicOnly | _boolean_ | {html}{html} | - | dynamicallyIncludedDestinations | (_java.lang.Object_)\* | {html}{html} | - | excludedDestinations | (_java.lang.Object_)\* | {html}{html} | - | localTransport | _org.apache.activemq.transport.Transport_ | {html}{html} | - | localUri | _java.net.URI_ | {html}{html} | - | messageTTL | _int_ | {html}{html} | - | name | _java.lang.String_ | {html}{html} | - | networkTTL | _int_ | {html}{html} | - | objectName | _javax.management.ObjectName_ | {html}{html} | - | password | _java.lang.String_ | {html}{html} | - | prefetchSize | _java.lang.String_ | {html}{html} | - | remoteTransport | _org.apache.activemq.transport.Transport_ | {html}Sets the remote transport implementation{html} | - | remoteURI | _java.net.URI_ | {html}Sets the remote transport URI to some group transport like -multicast://address:port{html} | - | staticBridge | _boolean_ | {html}{html} | - | staticallyIncludedDestinations | (_java.lang.Object_)\* | {html}{html} | - | suppressDuplicateQueueSubscriptions | _boolean_ | {html}{html} | - | suppressDuplicateTopicSubscriptions | _boolean_ | {html}{html} | - | useBrokerNameAsIdSees | _boolean_ | {html}{html} | - | useCompression | _boolean_ | {html}{html} | - | userName | _java.lang.String_ | {html}{html} | - -{anchor:multicastTraceBrokerPlugin-element} -h3. The _[|#multicastTraceBrokerPlugin-element]_ Element - {html}A Broker interceptor which allows you to trace all operations to a Multicast -socket.{html} -h4. Properties - || Property Name || Type || Description || - | address | _java.net.SocketAddress_ | {html}{html} | - | adminConnectionContext | _org.apache.activemq.broker.ConnectionContext_ | {html}{html} | - | broadcast | _boolean_ | {html}{html} | - | destination | _java.net.URI_ | {html}{html} | - | maxTraceDatagramSize | _int_ | {html}{html} | - | next | _[org.apache.activemq.broker.Broker|#org.apache.activemq.broker.Broker-types]_ | {html}{html} | - | timeToLive | _int_ | {html}{html} | - | wireFormat | _org.apache.activemq.wireformat.WireFormat_ | {html}{html} | - | wireFormatFactory | _org.apache.activemq.wireformat.WireFormatFactory_ | {html}{html} | - -{anchor:mysql-jdbc-adapter-element} -h3. The _[|#mysql-jdbc-adapter-element]_ Element - {html}{html} -h4. Properties - || Property Name || Type || Description || - | batchStatments | _boolean_ | {html}{html} | - | engineType | _java.lang.String_ | {html}{html} | - | maxRows | _int_ | {html}the max value for statement maxRows, used to limit jdbc queries{html} | - | statements | _[org.apache.activemq.store.jdbc.Statements|#org.apache.activemq.store.jdbc.Statements-types]_ | {html}{html} | - | typeStatement | _java.lang.String_ | {html}{html} | - | useExternalMessageReferences | _boolean_ | {html}{html} | - -{anchor:networkConnector-element} -h3. The _[|#networkConnector-element]_ Element - {html}A network connector which uses a discovery agent to detect the remote brokers -available and setup a connection to each available remote broker{html} -h4. Properties - || Property Name || Type || Description || - | advisoryForFailedForward | _boolean_ | {html}{html} | - | alwaysSyncSend | _boolean_ | {html}{html} | - | bridgeTempDestinations | _boolean_ | {html}{html} | - | brokerName | _java.lang.String_ | {html}{html} | - | brokerService | _[org.apache.activemq.broker.BrokerService|#org.apache.activemq.broker.BrokerService-types]_ | {html}{html} | - | brokerURL | _java.lang.String_ | {html}{html} | - | conduitSubscriptions | _boolean_ | {html}{html} | - | connectionFilter | _org.apache.activemq.network.ConnectionFilter_ | {html}{html} | - | consumerPriorityBase | _int_ | {html}{html} | - | consumerTTL | _int_ | {html}{html} | - | decreaseNetworkConsumerPriority | _boolean_ | {html}{html} | - | destinationFilter | _java.lang.String_ | {html}{html} | - | discoveryAgent | _org.apache.activemq.transport.discovery.DiscoveryAgent_ | {html}{html} | - | discoveryURI | _java.net.URI_ | {html}{html} | - | dispatchAsync | _boolean_ | {html}{html} | - | duplex | _boolean_ | {html}{html} | - | durableDestinations | (_java.lang.Object_)\* | {html}{html} | - | dynamicOnly | _boolean_ | {html}{html} | - | dynamicallyIncludedDestinations | (_java.lang.Object_)\* | {html}{html} | - | excludedDestinations | (_java.lang.Object_)\* | {html}{html} | - | localUri | _java.net.URI_ | {html}{html} | - | messageTTL | _int_ | {html}{html} | - | name | _java.lang.String_ | {html}{html} | - | networkTTL | _int_ | {html}{html} | - | objectName | _javax.management.ObjectName_ | {html}{html} | - | password | _java.lang.String_ | {html}{html} | - | prefetchSize | _java.lang.String_ | {html}{html} | - | staticBridge | _boolean_ | {html}{html} | - | staticallyIncludedDestinations | (_java.lang.Object_)\* | {html}{html} | - | suppressDuplicateQueueSubscriptions | _boolean_ | {html}{html} | - | suppressDuplicateTopicSubscriptions | _boolean_ | {html}{html} | - | uri | _java.net.URI_ | {html}{html} | - | useBrokerNameAsIdSees | _boolean_ | {html}{html} | - | useCompression | _boolean_ | {html}{html} | - | userName | _java.lang.String_ | {html}{html} | - -{anchor:noSubscriptionRecoveryPolicy-element} -h3. The _[|#noSubscriptionRecoveryPolicy-element]_ Element - {html}This SubscriptionRecoveryPolicy disable recovery of messages.{html} -h4. Properties - || Property Name || Type || Description || - | broker | _[org.apache.activemq.broker.Broker|#org.apache.activemq.broker.Broker-types]_ | {html}{html} | - -{anchor:oldestMessageEvictionStrategy-element} -h3. The _[|#oldestMessageEvictionStrategy-element]_ Element - {html}An eviction strategy which evicts the oldest message first (which is the -default).{html} -h4. Properties - || Property Name || Type || Description || - | evictExpiredMessagesHighWatermark | _int_ | {html}Sets the high water mark on which we will eagerly evict expired messages from RAM{html} | - -{anchor:oldestMessageWithLowestPriorityEvictionStrategy-element} -h3. The _[|#oldestMessageWithLowestPriorityEvictionStrategy-element]_ Element - {html}An eviction strategy which evicts the oldest message with the lowest priority first.{html} -h4. Properties - || Property Name || Type || Description || - | evictExpiredMessagesHighWatermark | _int_ | {html}Sets the high water mark on which we will eagerly evict expired messages from RAM{html} | - -{anchor:oracleBlobJDBCAdapter-element} -h3. The _[|#oracleBlobJDBCAdapter-element]_ Element - {html}Implements all the default JDBC operations that are used -by the JDBCPersistenceAdapter. -

    -Subclassing is encouraged to override the default -implementation of methods to account for differences -in JDBC Driver implementations. -

    -The JDBCAdapter inserts and extracts BLOB data using the -getBytes()/setBytes() operations. -

    -The databases/JDBC drivers that use this adapter are: -

      -
    • -
    {html} -h4. Properties - || Property Name || Type || Description || - | batchStatments | _boolean_ | {html}{html} | - | maxRows | _int_ | {html}the max value for statement maxRows, used to limit jdbc queries{html} | - | statements | _[org.apache.activemq.store.jdbc.Statements|#org.apache.activemq.store.jdbc.Statements-types]_ | {html}{html} | - | useExternalMessageReferences | _boolean_ | {html}{html} | - -{anchor:oracleJDBCAdapter-element} -h3. The _[|#oracleJDBCAdapter-element]_ Element - {html}Implements all the default JDBC operations that are used -by the JDBCPersistenceAdapter. -

    -Subclassing is encouraged to override the default -implementation of methods to account for differences -in JDBC Driver implementations. -

    {html} -h4. Properties - || Property Name || Type || Description || - | batchStatments | _boolean_ | {html}{html} | - | maxRows | _int_ | {html}the max value for statement maxRows, used to limit jdbc queries{html} | - | statements | _[org.apache.activemq.store.jdbc.Statements|#org.apache.activemq.store.jdbc.Statements-types]_ | {html}{html} | - | useExternalMessageReferences | _boolean_ | {html}{html} | - -{anchor:outboundQueueBridge-element} -h3. The _[|#outboundQueueBridge-element]_ Element - {html}Create an Outbound Queue Bridge. By default the bridge uses the same -name for both the inbound and outbound queues, however this can be altered -by using the public setter methods to configure both inbound and outbound -queue names.{html} -h4. Properties - || Property Name || Type || Description || - | consumer | _javax.jms.MessageConsumer_ | {html}{html} | - | consumerConnection | _javax.jms.QueueConnection_ | {html}{html} | - | consumerQueue | _[javax.jms.Queue|#javax.jms.Queue-types]_ | {html}{html} | - | doHandleReplyTo | _boolean_ | {html}{html} | - | jmsConnector | _[org.apache.activemq.network.jms.JmsConnector|#org.apache.activemq.network.jms.JmsConnector-types]_ | {html}{html} | - | jmsMessageConvertor | _[org.apache.activemq.network.jms.JmsMesageConvertor|#org.apache.activemq.network.jms.JmsMesageConvertor-types]_ | {html}{html} | - | localQueueName | _java.lang.String_ | {html}{html} | - | outboundQueueName | _java.lang.String_ | {html}Sets the name of the outbound queue name. If the inbound queue name -has not been set already then this method uses the provided queue name -to set the inbound topic name as well.{html} | - | producerConnection | _javax.jms.QueueConnection_ | {html}{html} | - | producerQueue | _[javax.jms.Queue|#javax.jms.Queue-types]_ | {html}{html} | - | selector | _java.lang.String_ | {html}{html} | - -{anchor:outboundTopicBridge-element} -h3. The _[|#outboundTopicBridge-element]_ Element - {html}Create an Outbound Topic Bridge. By default the bridge uses the same -name for both the inbound and outbound topics, however this can be altered -by using the public setter methods to configure both inbound and outbound -topic names.{html} -h4. Properties - || Property Name || Type || Description || - | consumer | _javax.jms.MessageConsumer_ | {html}{html} | - | consumerConnection | _javax.jms.TopicConnection_ | {html}{html} | - | consumerName | _java.lang.String_ | {html}{html} | - | consumerTopic | _[javax.jms.Topic|#javax.jms.Topic-types]_ | {html}{html} | - | doHandleReplyTo | _boolean_ | {html}{html} | - | jmsConnector | _[org.apache.activemq.network.jms.JmsConnector|#org.apache.activemq.network.jms.JmsConnector-types]_ | {html}{html} | - | jmsMessageConvertor | _[org.apache.activemq.network.jms.JmsMesageConvertor|#org.apache.activemq.network.jms.JmsMesageConvertor-types]_ | {html}{html} | - | localTopicName | _java.lang.String_ | {html}{html} | - | outboundTopicName | _java.lang.String_ | {html}Sets the name of the outbound topic name. If the inbound topic name -has not been set already then this method uses the provided topic name -to set the inbound topic name as well.{html} | - | producerConnection | _javax.jms.TopicConnection_ | {html}{html} | - | producerTopic | _[javax.jms.Topic|#javax.jms.Topic-types]_ | {html}{html} | - | selector | _java.lang.String_ | {html}{html} | - -{anchor:pListStoreImpl-element} -h3. The _[|#pListStoreImpl-element]_ Element - {html}{html} -h4. Properties - || Property Name || Type || Description || - | brokerService | _[org.apache.activemq.broker.BrokerService|#org.apache.activemq.broker.BrokerService-types]_ | {html}{html} | - | cleanupInterval | _long_ | {html}{html} | - | directory | _java.io.File_ | {html}{html} | - | enableIndexWriteAsync | _boolean_ | {html}{html} | - | failIfDatabaseIsLocked | _boolean_ | {html}{html} | - | indexCacheSize | _int_ | {html}{html} | - | indexEnablePageCaching | _boolean_ | {html}{html} | - | indexPageSize | _int_ | {html}{html} | - | indexWriteBatchSize | _int_ | {html}{html} | - | journalMaxFileLength | _int_ | {html}{html} | - | journalMaxWriteBatchSize | _int_ | {html}{html} | - | lazyInit | _boolean_ | {html}{html} | - -{anchor:partitionBrokerPlugin-element} -h3. The _[|#partitionBrokerPlugin-element]_ Element - {html}A BrokerPlugin which partitions client connections over a cluster of brokers.{html} -h4. Properties - || Property Name || Type || Description || - | config | _org.apache.activemq.partition.dto.Partitioning_ | {html}{html} | - | configAsJson | _java.lang.String_ | {html}{html} | - | minTransferCount | _int_ | {html}{html} | - -{anchor:policyEntry-element} -h3. The _[|#policyEntry-element]_ Element - {html}Represents an entry in a {@link PolicyMap} for assigning policies to a -specific destination or a hierarchical wildcard area of destinations.{html} -h4. Properties - || Property Name || Type || Description || - | advisoryForConsumed | _boolean_ | {html}{html} | - | advisoryForDelivery | _boolean_ | {html}{html} | - | advisoryForDiscardingMessages | _boolean_ | {html}{html} | - | advisoryForFastProducers | _boolean_ | {html}{html} | - | advisoryForSlowConsumers | _boolean_ | {html}{html} | - | advisoryWhenFull | _boolean_ | {html}{html} | - | allConsumersExclusiveByDefault | _boolean_ | {html}{html} | - | alwaysRetroactive | _boolean_ | {html}{html} | - | blockedProducerWarningInterval | _long_ | {html}Set's the interval at which warnings about producers being blocked by -resource usage will be triggered. Values of 0 or less will disable -warnings{html} | - | consumersBeforeDispatchStarts | _int_ | {html}{html} | - | cursorMemoryHighWaterMark | _int_ | {html}{html} | - | deadLetterStrategy | _[org.apache.activemq.broker.region.policy.DeadLetterStrategy|#org.apache.activemq.broker.region.policy.DeadLetterStrategy-types]_ | {html}Sets the policy used to determine which dead letter queue destination -should be used{html} | - | destination | _[org.apache.activemq.command.ActiveMQDestination|#org.apache.activemq.command.ActiveMQDestination-types]_ | {html}{html} | - | dispatchPolicy | _[org.apache.activemq.broker.region.policy.DispatchPolicy|#org.apache.activemq.broker.region.policy.DispatchPolicy-types]_ | {html}{html} | - | doOptimzeMessageStorage | _boolean_ | {html}{html} | - | durableTopicPrefetch | _int_ | {html}Get the durableTopicPrefetch{html} | - | enableAudit | _boolean_ | {html}{html} | - | expireMessagesPeriod | _long_ | {html}{html} | - | gcInactiveDestinations | _boolean_ | {html}{html} | - | gcWithNetworkConsumers | _boolean_ | {html}{html} | - | inactiveTimoutBeforeGC | _long_ | {html}{html} | - | lazyDispatch | _boolean_ | {html}{html} | - | maxAuditDepth | _int_ | {html}{html} | - | maxBrowsePageSize | _int_ | {html}{html} | - | maxExpirePageSize | _int_ | {html}{html} | - | maxPageSize | _int_ | {html}{html} | - | maxProducersToAudit | _int_ | {html}{html} | - | maxQueueAuditDepth | _int_ | {html}{html} | - | memoryLimit | _java.lang.String_ | {html}When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used{html} | - | messageEvictionStrategy | _[org.apache.activemq.broker.region.policy.MessageEvictionStrategy|#org.apache.activemq.broker.region.policy.MessageEvictionStrategy-types]_ | {html}Sets the eviction strategy used to decide which message to evict when the -slow consumer needs to discard messages{html} | - | messageGroupMapFactory | _[org.apache.activemq.broker.region.group.MessageGroupMapFactory|#org.apache.activemq.broker.region.group.MessageGroupMapFactory-types]_ | {html}Sets the factory used to create new instances of {MessageGroupMap} used -to implement the Message Groups -functionality.{html} | - | messageGroupMapFactoryType | _java.lang.String_ | {html}{html} | - | minimumMessageSize | _long_ | {html}{html} | - | networkBridgeFilterFactory | _[org.apache.activemq.network.NetworkBridgeFilterFactory|#org.apache.activemq.network.NetworkBridgeFilterFactory-types]_ | {html}{html} | - | optimizeMessageStoreInFlightLimit | _int_ | {html}{html} | - | optimizedDispatch | _boolean_ | {html}{html} | - | pendingDurableSubscriberPolicy | _[org.apache.activemq.broker.region.policy.PendingDurableSubscriberMessageStoragePolicy|#org.apache.activemq.broker.region.policy.PendingDurableSubscriberMessageStoragePolicy-types]_ | {html}{html} | - | pendingMessageLimitStrategy | _[org.apache.activemq.broker.region.policy.PendingMessageLimitStrategy|#org.apache.activemq.broker.region.policy.PendingMessageLimitStrategy-types]_ | {html}Sets the strategy to calculate the maximum number of messages that are -allowed to be pending on consumers (in addition to their prefetch sizes). -Once the limit is reached, non-durable topics can then start discarding -old messages. This allows us to keep dispatching messages to slow -consumers while not blocking fast consumers and discarding the messages -oldest first.{html} | - | pendingQueuePolicy | _[org.apache.activemq.broker.region.policy.PendingQueueMessageStoragePolicy|#org.apache.activemq.broker.region.policy.PendingQueueMessageStoragePolicy-types]_ | {html}{html} | - | pendingSubscriberPolicy | _[org.apache.activemq.broker.region.policy.PendingSubscriberMessageStoragePolicy|#org.apache.activemq.broker.region.policy.PendingSubscriberMessageStoragePolicy-types]_ | {html}{html} | - | prioritizedMessages | _boolean_ | {html}{html} | - | producerFlowControl | _boolean_ | {html}{html} | - | queue | _java.lang.String_ | {html}A helper method to set the destination from a configuration file{html} | - | queueBrowserPrefetch | _int_ | {html}Get the queueBrowserPrefetch{html} | - | queuePrefetch | _int_ | {html}Get the queuePrefetch{html} | - | reduceMemoryFootprint | _boolean_ | {html}{html} | - | sendAdvisoryIfNoConsumers | _boolean_ | {html}Sends an advisory message if a non-persistent message is sent and there -are no active consumers{html} | - | slowConsumerStrategy | _[org.apache.activemq.broker.region.policy.SlowConsumerStrategy|#org.apache.activemq.broker.region.policy.SlowConsumerStrategy-types]_ | {html}{html} | - | storeUsageHighWaterMark | _int_ | {html}{html} | - | strictOrderDispatch | _boolean_ | {html}{html} | - | subscriptionRecoveryPolicy | _[org.apache.activemq.broker.region.policy.SubscriptionRecoveryPolicy|#org.apache.activemq.broker.region.policy.SubscriptionRecoveryPolicy-types]_ | {html}{html} | - | tempQueue | _boolean_ | {html}{html} | - | tempTopic | _boolean_ | {html}{html} | - | timeBeforeDispatchStarts | _int_ | {html}{html} | - | topic | _java.lang.String_ | {html}A helper method to set the destination from a configuration file{html} | - | topicPrefetch | _int_ | {html}Get the topicPrefetch{html} | - | useCache | _boolean_ | {html}{html} | - | useConsumerPriority | _boolean_ | {html}{html} | - | usePrefetchExtension | _boolean_ | {html}{html} | - -{anchor:policyMap-element} -h3. The _[|#policyMap-element]_ Element - {html}Represents a destination based configuration of policies so that individual -destinations or wildcard hierarchies of destinations can be configured using -different policies.{html} -h4. Properties - || Property Name || Type || Description || - | defaultEntry | _[org.apache.activemq.broker.region.policy.PolicyEntry|#org.apache.activemq.broker.region.policy.PolicyEntry-types]_ | {html}{html} | - | entries | (_java.lang.Object_)\* | {html}A helper method to allow the destination map to be populated from a -dependency injection framework such as Spring{html} | - | policyEntries | (_java.lang.Object_)\* | {html}Sets the individual entries on the policy map{html} | - -{anchor:pooledConnectionFactory-element} -h3. The _[|#pooledConnectionFactory-element]_ Element - {html}Simple factory bean used to create a jencks connection pool. -Depending on the properties set, it will create a simple pool, -a transaction aware connection pool, or a jca aware connection pool. - -

    -
    -  
    -  
    -  
    -
    -
    - -The resourceName property should be used along with the {@link org.apache.activemq.jms.pool.GenericResourceManager} and have -the same value than its resourceName property. This will make sure the transaction manager -maps correctly the connection factory to the recovery process.{html} -h4. Properties - || Property Name || Type || Description || - | connectionFactory | _[javax.jms.ConnectionFactory|#javax.jms.ConnectionFactory-types]_ | {html}{html} | - | maxConnections | _int_ | {html}{html} | - | maximumActive | _int_ | {html}{html} | - | resourceName | _java.lang.String_ | {html}{html} | - | transactionManager | _java.lang.Object_ | {html}{html} | - -{anchor:postgresql-jdbc-adapter-element} -h3. The _[|#postgresql-jdbc-adapter-element]_ Element - {html}Implements all the default JDBC operations that are used -by the JDBCPersistenceAdapter. -

    -Subclassing is encouraged to override the default -implementation of methods to account for differences -in JDBC Driver implementations. -

    -The JDBCAdapter inserts and extracts BLOB data using the -getBytes()/setBytes() operations. -

    -The databases/JDBC drivers that use this adapter are: -

      -
    • -
    {html} -h4. Properties - || Property Name || Type || Description || - | acksPkName | _java.lang.String_ | {html}{html} | - | batchStatments | _boolean_ | {html}{html} | - | maxRows | _int_ | {html}the max value for statement maxRows, used to limit jdbc queries{html} | - | statements | _[org.apache.activemq.store.jdbc.Statements|#org.apache.activemq.store.jdbc.Statements-types]_ | {html}{html} | - | useExternalMessageReferences | _boolean_ | {html}{html} | - -{anchor:prefetchPolicy-element} -h3. The _[|#prefetchPolicy-element]_ Element - {html}Defines the prefetch message policies for different types of consumers{html} -h4. Properties - || Property Name || Type || Description || - | all | _int_ | {html}{html} | - | durableTopicPrefetch | _int_ | {html}{html} | - | inputStreamPrefetch | _int_ | {html}{html} | - | maximumPendingMessageLimit | _int_ | {html}Sets how many messages a broker will keep around, above the prefetch -limit, for non-durable topics before starting to discard older messages.{html} | - | optimizeDurableTopicPrefetch | _int_ | {html}{html} | - | queueBrowserPrefetch | _int_ | {html}{html} | - | queuePrefetch | _int_ | {html}{html} | - | topicPrefetch | _int_ | {html}{html} | - -{anchor:prefetchRatePendingMessageLimitStrategy-element} -h3. The _[|#prefetchRatePendingMessageLimitStrategy-element]_ Element - {html}This PendingMessageLimitStrategy sets the maximum pending message limit value to be -a multiplier of the prefetch limit of the subscription.{html} -h4. Properties - || Property Name || Type || Description || - | multiplier | _double_ | {html}Sets the multiplier of the prefetch size which will be used to define the maximum number of pending -messages for non-durable topics before messages are discarded.{html} | - -{anchor:priorityDispatchPolicy-element} -h3. The _[|#priorityDispatchPolicy-element]_ Element - {html}Priority dispatch policy that sends a message to every subscription that -matches the message in consumer priority order.{html} - -{anchor:priorityNetworkDispatchPolicy-element} -h3. The _[|#priorityNetworkDispatchPolicy-element]_ Element - {html}dispatch policy that ignores lower priority duplicate network consumers, -used in conjunction with network bridge suppresDuplicateTopicSubscriptions{html} - -{anchor:proxyConnector-element} -h3. The _[|#proxyConnector-element]_ Element - {html}{html} -h4. Properties - || Property Name || Type || Description || - | bind | _java.net.URI_ | {html}{html} | - | localUri | _java.net.URI_ | {html}{html} | - | name | _java.lang.String_ | {html}{html} | - | proxyToLocalBroker | _boolean_ | {html}{html} | - | remote | _java.net.URI_ | {html}{html} | - | server | _org.apache.activemq.transport.TransportServer_ | {html}{html} | - -{anchor:publishedAddressPolicy-element} -h3. The _[|#publishedAddressPolicy-element]_ Element - {html}Policy object that controls how a TransportConnector publishes the connector's -address to the outside world. By default the connector will publish itself -using the resolved host name of the bound server socket.{html} -h4. Properties - || Property Name || Type || Description || - | clusterClientUriQuery | _java.lang.String_ | {html}Gets the URI query that's configured on the published URI that's sent to client's -when the cluster info is updated.{html} | - | portMapping | _java.util.HashMap_ | {html}{html} | - | publishedHostStrategy | _java.lang.String_ | {html}{html} | - -{anchor:queryBasedSubscriptionRecoveryPolicy-element} -h3. The _[|#queryBasedSubscriptionRecoveryPolicy-element]_ Element - {html}This implementation of {@link SubscriptionRecoveryPolicy} will perform a user -specific query mechanism to load any messages they may have missed.{html} -h4. Properties - || Property Name || Type || Description || - | broker | _[org.apache.activemq.broker.Broker|#org.apache.activemq.broker.Broker-types]_ | {html}{html} | - | query | _org.apache.activemq.broker.region.policy.MessageQuery_ | {html}Sets the query strategy to load initial messages{html} | - -{anchor:queue-element} -h3. The _[|#queue-element]_ Element - {html}An ActiveMQ Queue{html} -h4. Properties - || Property Name || Type || Description || - | compositeDestinations | (_[org.apache.activemq.command.ActiveMQDestination|#org.apache.activemq.command.ActiveMQDestination-types]_)\* | {html}{html} | - | name | _java.lang.String_ | {html}{html} | - | physicalName | _java.lang.String_ | {html}{html} | - | properties | _java.util.Properties_ | {html}Get the properties from this instance for storing in JNDI{html} | - -{anchor:queueDispatchSelector-element} -h3. The _[|#queueDispatchSelector-element]_ Element - {html}Queue dispatch policy that determines if a message can be sent to a subscription{html} -h4. Properties - || Property Name || Type || Description || - | destination | _[org.apache.activemq.command.ActiveMQDestination|#org.apache.activemq.command.ActiveMQDestination-types]_ | {html}{html} | - | exclusiveConsumer | _org.apache.activemq.broker.region.Subscription_ | {html}{html} | - -{anchor:reconnectionPolicy-element} -h3. The _[|#reconnectionPolicy-element]_ Element - {html}A policy object that defines how a {@link JmsConnector} deals with -reconnection of the local and foreign connections.{html} -h4. Properties - || Property Name || Type || Description || - | backOffMultiplier | _double_ | {html}Gets the multiplier used to grow the delay between connection attempts from the initial -time to the max set time. By default this value is set to 2.0.{html} | - | initialReconnectDelay | _long_ | {html}Gets the initial delay value used before a reconnection attempt is made. If the -use exponential back-off value is set to false then this will be the fixed time -between connection attempts. By default this value is set to one second.{html} | - | maxInitialConnectAttempts | _int_ | {html}Gets the maximum number of times that the {@link JmsConnector} will try -to connect on startup to before it marks itself as failed and does not -try any further connections.{html} | - | maxReconnectAttempts | _int_ | {html}Gets the number of time that {@link JmsConnector} will attempt to connect -or reconnect before giving up. By default the policy sets this value to -a negative value meaning try forever.{html} | - | maxSendRetries | _int_ | {html}Gets the maximum number of a times a Message send should be retried before -a JMSExeception is thrown indicating that the operation failed.{html} | - | maximumReconnectDelay | _long_ | {html}Gets the maximum delay that is inserted between each attempt to connect -before another attempt is made. The default setting for this value is -30 seconds.{html} | - | sendRetyDelay | _long_ | {html}Set the amount of time the DestionationBridge will wait between attempts -to forward a message. The default policy limits the minimum time between -send attempt to one second.{html} | - | useExponentialBackOff | _boolean_ | {html}Gets whether the policy uses the set back-off multiplier to grow the time between -connection attempts.{html} | - -{anchor:redeliveryPlugin-element} -h3. The _[|#redeliveryPlugin-element]_ Element - {html}Replace regular DLQ handling with redelivery via a resend to the original destination -after a delay -A destination matching RedeliveryPolicy controls the quantity and delay for re-sends -If there is no matching policy or an existing policy limit is exceeded by default -regular DLQ processing resumes. This is controlled via sendToDlqIfMaxRetriesExceeded -and fallbackToDeadLetter{html} -h4. Properties - || Property Name || Type || Description || - | adminConnectionContext | _org.apache.activemq.broker.ConnectionContext_ | {html}{html} | - | fallbackToDeadLetter | _boolean_ | {html}What to do if there is no matching redelivery policy for a destination. -when true, the region broker DLQ processing will be used via sendToDeadLetterQueue -when false, there is no action{html} | - | next | _[org.apache.activemq.broker.Broker|#org.apache.activemq.broker.Broker-types]_ | {html}{html} | - | redeliveryPolicyMap | _[org.apache.activemq.broker.region.policy.RedeliveryPolicyMap|#org.apache.activemq.broker.region.policy.RedeliveryPolicyMap-types]_ | {html}{html} | - | sendToDlqIfMaxRetriesExceeded | _boolean_ | {html}What to do if the maxretries on a matching redelivery policy is exceeded. -when true, the region broker DLQ processing will be used via sendToDeadLetterQueue -when false, there is no action{html} | - -{anchor:redeliveryPolicy-element} -h3. The _[|#redeliveryPolicy-element]_ Element - {html}Configuration options for a messageConsumer used to control how messages are re-delivered when they -are rolled back. -May be used server side on a per destination basis via the Broker RedeliveryPlugin{html} -h4. Properties - || Property Name || Type || Description || - | backOffMultiplier | _double_ | {html}{html} | - | collisionAvoidancePercent | _short_ | {html}{html} | - | destination | _[org.apache.activemq.command.ActiveMQDestination|#org.apache.activemq.command.ActiveMQDestination-types]_ | {html}{html} | - | initialRedeliveryDelay | _long_ | {html}{html} | - | maximumRedeliveries | _int_ | {html}{html} | - | maximumRedeliveryDelay | _long_ | {html}{html} | - | queue | _java.lang.String_ | {html}A helper method to set the destination from a configuration file{html} | - | redeliveryDelay | _long_ | {html}{html} | - | tempQueue | _boolean_ | {html}{html} | - | tempTopic | _boolean_ | {html}{html} | - | topic | _java.lang.String_ | {html}A helper method to set the destination from a configuration file{html} | - | useCollisionAvoidance | _boolean_ | {html}{html} | - | useExponentialBackOff | _boolean_ | {html}{html} | - -{anchor:redeliveryPolicyMap-element} -h3. The _[|#redeliveryPolicyMap-element]_ Element - {html}Represents a destination based configuration of policies so that individual -destinations or wildcard hierarchies of destinations can be configured using -different policies.{html} -h4. Properties - || Property Name || Type || Description || - | defaultEntry | _[org.apache.activemq.RedeliveryPolicy|#org.apache.activemq.RedeliveryPolicy-types]_ | {html}{html} | - | entries | (_java.lang.Object_)\* | {html}A helper method to allow the destination map to be populated from a -dependency injection framework such as Spring{html} | - | redeliveryPolicyEntries | (_java.lang.Object_)\* | {html}Sets the individual entries on the redeliveryPolicyMap{html} | - -{anchor:replicatedLevelDB-element} -h3. The _[|#replicatedLevelDB-element]_ Element - {html}An implementation of {@link org.apache.activemq.store.PersistenceAdapter} designed for use with -LevelDB - Embedded Lightweight Non-Relational Database{html} -h4. Properties - || Property Name || Type || Description || - | asyncBufferSize | _int_ | {html}{html} | - | bind | _java.lang.String_ | {html}{html} | - | brokerName | _java.lang.String_ | {html}{html} | - | brokerService | _[org.apache.activemq.broker.BrokerService|#org.apache.activemq.broker.BrokerService-types]_ | {html}{html} | - | container | _java.lang.String_ | {html}{html} | - | directory | _java.io.File_ | {html}{html} | - | failoverProducersAuditDepth | _int_ | {html}{html} | - | flushDelay | _int_ | {html}{html} | - | hostname | _java.lang.String_ | {html}{html} | - | indexBlockRestartInterval | _int_ | {html}{html} | - | indexBlockSize | _int_ | {html}{html} | - | indexCacheSize | _long_ | {html}{html} | - | indexCompression | _java.lang.String_ | {html}{html} | - | indexFactory | _java.lang.String_ | {html}{html} | - | indexMaxOpenFiles | _int_ | {html}{html} | - | indexWriteBufferSize | _int_ | {html}{html} | - | lockKeepAlivePeriod | _long_ | {html}{html} | - | locker | _[org.apache.activemq.broker.Locker|#org.apache.activemq.broker.Locker-types]_ | {html}{html} | - | logCompression | _java.lang.String_ | {html}{html} | - | logSize | _long_ | {html}{html} | - | maxFailoverProducersToTrack | _int_ | {html}{html} | - | monitorStats | _boolean_ | {html}{html} | - | paranoidChecks | _boolean_ | {html}{html} | - | replicas | _int_ | {html}{html} | - | securityToken | _java.lang.String_ | {html}{html} | - | sync | _java.lang.String_ | {html}{html} | - | usageManager | _[org.apache.activemq.usage.SystemUsage|#org.apache.activemq.usage.SystemUsage-types]_ | {html}{html} | - | useLock | _boolean_ | {html}{html} | - | verifyChecksums | _boolean_ | {html}{html} | - | weight | _int_ | {html}{html} | - | zkAddress | _java.lang.String_ | {html}{html} | - | zkPassword | _java.lang.String_ | {html}{html} | - | zkPath | _java.lang.String_ | {html}{html} | - | zkSessionTmeout | _java.lang.String_ | {html}{html} | - -{anchor:roundRobinDispatchPolicy-element} -h3. The _[|#roundRobinDispatchPolicy-element]_ Element - {html}Simple dispatch policy that sends a message to every subscription that -matches the message.{html} - -{anchor:runtimeConfigurationPlugin-element} -h3. The _[|#runtimeConfigurationPlugin-element]_ Element - {html}Broker plugin that will monitor the broker xml configuration for -changes and selectively apply those changes to the running broker.{html} -h4. Properties - || Property Name || Type || Description || - | checkPeriod | _long_ | {html}{html} | - -{anchor:shared-file-locker-element} -h3. The _[|#shared-file-locker-element]_ Element - {html}Represents an exclusive lock on a database to avoid multiple brokers running -against the same logical database.{html} -h4. Properties - || Property Name || Type || Description || - | directory | _java.io.File_ | {html}{html} | - | failIfLocked | _boolean_ | {html}{html} | - | lockAcquireSleepInterval | _long_ | {html}{html} | - | lockable | _[org.apache.activemq.broker.LockableServiceSupport|#org.apache.activemq.broker.LockableServiceSupport-types]_ | {html}{html} | - | name | _java.lang.String_ | {html}{html} | - -{anchor:sharedDeadLetterStrategy-element} -h3. The _[|#sharedDeadLetterStrategy-element]_ Element - {html}A default implementation of {@link DeadLetterStrategy} which uses -a constant destination.{html} -h4. Properties - || Property Name || Type || Description || - | deadLetterQueue | _[org.apache.activemq.command.ActiveMQDestination|#org.apache.activemq.command.ActiveMQDestination-types]_ | {html}{html} | - | enableAudit | _boolean_ | {html}{html} | - | processExpired | _boolean_ | {html}{html} | - | processNonPersistent | _boolean_ | {html}{html} | - -{anchor:simpleAuthenticationPlugin-element} -h3. The _[|#simpleAuthenticationPlugin-element]_ Element - {html}Provides a simple authentication plugin{html} -h4. Properties - || Property Name || Type || Description || - | anonymousAccessAllowed | _boolean_ | {html}{html} | - | anonymousGroup | _java.lang.String_ | {html}{html} | - | anonymousUser | _java.lang.String_ | {html}{html} | - | userGroups | _java.util.Map_ | {html}Sets the groups a user is in. The key is the user name and the value is a -Set of groups{html} | - | userPasswords | _java.util.Map_ | {html}Sets the map indexed by user name with the value the password{html} | - | users | (_java.lang.Object_)\* | {html}Sets individual users for authentication{html} | - -{anchor:simpleAuthorizationMap-element} -h3. The _[|#simpleAuthorizationMap-element]_ Element - {html}An AuthorizationMap which is configured with individual DestinationMaps for -each operation.{html} -h4. Properties - || Property Name || Type || Description || - | adminACLs | _[org.apache.activemq.filter.DestinationMap|#org.apache.activemq.filter.DestinationMap-types]_ | {html}{html} | - | readACLs | _[org.apache.activemq.filter.DestinationMap|#org.apache.activemq.filter.DestinationMap-types]_ | {html}{html} | - | tempDestinationAuthorizationEntry | _[org.apache.activemq.security.TempDestinationAuthorizationEntry|#org.apache.activemq.security.TempDestinationAuthorizationEntry-types]_ | {html}{html} | - | writeACLs | _[org.apache.activemq.filter.DestinationMap|#org.apache.activemq.filter.DestinationMap-types]_ | {html}{html} | - -{anchor:simpleDispatchPolicy-element} -h3. The _[|#simpleDispatchPolicy-element]_ Element - {html}Simple dispatch policy that sends a message to every subscription that -matches the message.{html} - -{anchor:simpleDispatchSelector-element} -h3. The _[|#simpleDispatchSelector-element]_ Element - {html}Simple dispatch policy that determines if a message can be sent to a subscription{html} -h4. Properties - || Property Name || Type || Description || - | destination | _[org.apache.activemq.command.ActiveMQDestination|#org.apache.activemq.command.ActiveMQDestination-types]_ | {html}{html} | - -{anchor:simpleJmsMessageConvertor-element} -h3. The _[|#simpleJmsMessageConvertor-element]_ Element - {html}Converts Message from one JMS to another{html} -h4. Properties - || Property Name || Type || Description || - | connection | _javax.jms.Connection_ | {html}{html} | - -{anchor:simpleMessageGroupMapFactory-element} -h3. The _[|#simpleMessageGroupMapFactory-element]_ Element - {html}A factory to create instances of {@link SimpleMessageGroupMap} when implementing the -Message Groups functionality.{html} - -{anchor:sslContext-element} -h3. The _[|#sslContext-element]_ Element - {html}Extends the SslContext so that it's easier to configure from spring.{html} -h4. Properties - || Property Name || Type || Description || - | SSLContext | _javax.net.ssl.SSLContext_ | {html}{html} | - | keyManagers | (_java.lang.Object_)\* | {html}{html} | - | keyStore | _java.lang.String_ | {html}{html} | - | keyStoreAlgorithm | _java.lang.String_ | {html}{html} | - | keyStoreKeyPassword | _java.lang.String_ | {html}{html} | - | keyStorePassword | _java.lang.String_ | {html}{html} | - | keyStoreType | _java.lang.String_ | {html}{html} | - | protocol | _java.lang.String_ | {html}{html} | - | provider | _java.lang.String_ | {html}{html} | - | secureRandom | _java.security.SecureRandom_ | {html}{html} | - | secureRandomAlgorithm | _java.lang.String_ | {html}{html} | - | trustManagers | (_java.lang.Object_)\* | {html}{html} | - | trustStore | _java.lang.String_ | {html}{html} | - | trustStoreAlgorithm | _java.lang.String_ | {html}{html} | - | trustStorePassword | _java.lang.String_ | {html}{html} | - | trustStoreType | _java.lang.String_ | {html}{html} | - -{anchor:statements-element} -h3. The _[|#statements-element]_ Element - {html}{html} -h4. Properties - || Property Name || Type || Description || - | addMessageStatement | _java.lang.String_ | {html}{html} | - | binaryDataType | _java.lang.String_ | {html}{html} | - | clearDurableLastAckInTxStatement | _java.lang.String_ | {html}{html} | - | clearXidFlagStatement | _java.lang.String_ | {html}{html} | - | containerNameDataType | _java.lang.String_ | {html}{html} | - | createDurableSubStatement | _java.lang.String_ | {html}{html} | - | createLockSchemaStatements | (_java.lang.String_)\* | {html}{html} | - | createSchemaStatements | (_java.lang.String_)\* | {html}{html} | - | currentDateTimeStatement | _java.lang.String_ | {html}{html} | - | deleteOldMessagesStatementWithPriority | _java.lang.String_ | {html}{html} | - | deleteSubscriptionStatement | _java.lang.String_ | {html}{html} | - | destinationMessageCountStatement | _java.lang.String_ | {html}{html} | - | dropAckPKAlterStatementEnd | _java.lang.String_ | {html}{html} | - | dropSchemaStatements | (_java.lang.String_)\* | {html}{html} | - | durableSubAcksTableName | _java.lang.String_ | {html}{html} | - | durableSubscriberMessageCountStatement | _java.lang.String_ | {html}{html} | - | durableSubscriberMessageCountStatementWithPriority | _java.lang.String_ | {html}{html} | - | findAcksPendingOutcomeStatement | _java.lang.String_ | {html}{html} | - | findAllDestinationsStatement | _java.lang.String_ | {html}{html} | - | findAllDurableSubMessagesStatement | _java.lang.String_ | {html}{html} | - | findAllDurableSubsStatement | _java.lang.String_ | {html}{html} | - | findAllMessagesStatement | _java.lang.String_ | {html}{html} | - | findDurableSubMessagesStatement | _java.lang.String_ | {html}{html} | - | findDurableSubStatement | _java.lang.String_ | {html}{html} | - | findLastSequenceIdInAcksStatement | _java.lang.String_ | {html}{html} | - | findLastSequenceIdInMsgsStatement | _java.lang.String_ | {html}{html} | - | findMessageByIdStatement | _java.lang.String_ | {html}{html} | - | findMessageSequenceIdStatement | _java.lang.String_ | {html}{html} | - | findMessageStatement | _java.lang.String_ | {html}{html} | - | findNextMessagesStatement | _java.lang.String_ | {html}{html} | - | findOpsPendingOutcomeStatement | _java.lang.String_ | {html}{html} | - | findXidByIdStatement | _java.lang.String_ | {html}{html} | - | insertDurablePriorityAckStatement | _java.lang.String_ | {html}{html} | - | lastAckedDurableSubscriberMessageStatement | _java.lang.String_ | {html}{html} | - | lastProducerSequenceIdStatement | _java.lang.String_ | {html}{html} | - | leaseObtainStatement | _java.lang.String_ | {html}{html} | - | leaseOwnerStatement | _java.lang.String_ | {html}{html} | - | leaseUpdateStatement | _java.lang.String_ | {html}{html} | - | lockCreateStatement | _java.lang.String_ | {html}{html} | - | lockTableName | _java.lang.String_ | {html}{html} | - | lockUpdateStatement | _java.lang.String_ | {html}{html} | - | longDataType | _java.lang.String_ | {html}{html} | - | messageTableName | _java.lang.String_ | {html}{html} | - | msgIdDataType | _java.lang.String_ | {html}{html} | - | nextDurableSubscriberMessageStatement | _java.lang.String_ | {html}{html} | - | removeAllMessagesStatement | _java.lang.String_ | {html}{html} | - | removeAllSubscriptionsStatement | _java.lang.String_ | {html}{html} | - | removeMessageStatment | _java.lang.String_ | {html}{html} | - | selectDurablePriorityAckStatement | _java.lang.String_ | {html}{html} | - | sequenceDataType | _java.lang.String_ | {html}{html} | - | stringIdDataType | _java.lang.String_ | {html}{html} | - | tablePrefix | _java.lang.String_ | {html}{html} | - | updateDurableLastAckInTxStatement | _java.lang.String_ | {html}{html} | - | updateDurableLastAckStatement | _java.lang.String_ | {html}{html} | - | updateDurableLastAckWithPriorityInTxStatement | _java.lang.String_ | {html}{html} | - | updateDurableLastAckWithPriorityStatement | _java.lang.String_ | {html}{html} | - | updateLastPriorityAckRowOfDurableSubStatement | _java.lang.String_ | {html}{html} | - | updateMessageStatement | _java.lang.String_ | {html}{html} | - | updateXidFlagStatement | _java.lang.String_ | {html}{html} | - | useExternalMessageReferences | _boolean_ | {html}{html} | - | useLockCreateWhereClause | _boolean_ | {html}{html} | - -{anchor:statisticsBrokerPlugin-element} -h3. The _[|#statisticsBrokerPlugin-element]_ Element - {html}A StatisticsBrokerPlugin -You can retrieve a Map Message for a Destination - or -Broker containing statistics as key-value pairs The message must contain a -replyTo Destination - else its ignored -To retrieve stats on the broker send a empty message to ActiveMQ.Statistics.Broker (Queue or Topic) -With a replyTo set to the destination you want the stats returned to. -To retrieve stats for a destination - e.g. foo - send an empty message to ActiveMQ.Statistics.Destination.foo -- this works with wildcards to - you get a message for each wildcard match on the replyTo destination. -The stats message is a MapMessage populated with statistics for the target{html} - -{anchor:storeCursor-element} -h3. The _[|#storeCursor-element]_ Element - {html}Pending messages{html} - -{anchor:storeDurableSubscriberCursor-element} -h3. The _[|#storeDurableSubscriberCursor-element]_ Element - {html}Pending messages for a durable{html} -h4. Properties - || Property Name || Type || Description || - | immediatePriorityDispatch | _boolean_ | {html}Ensure that new higher priority messages will get an immediate dispatch -rather than wait for the end of the current cursor batch. -Useful when there is a large message backlog and intermittent high priority messages.{html} | - | useCache | _boolean_ | {html}{html} | - -{anchor:storeUsage-element} -h3. The _[|#storeUsage-element]_ Element - {html}Used to keep track of how much of something is being used so that a -productive working set usage can be controlled. Main use case is manage -memory usage.{html} -h4. Properties - || Property Name || Type || Description || - | executor | _java.util.concurrent.ThreadPoolExecutor_ | {html}{html} | - | limit | _java.lang.String_ | {html}Sets the memory limit in bytes. Setting the limit in bytes will set the usagePortion to 0 since the UsageManager -is not going to be portion based off the parent. When set using Xbean, values of the form "20 Mb", "1024kb", and -"1g" can be used{html} | - | limiter | _[org.apache.activemq.usage.UsageCapacity|#org.apache.activemq.usage.UsageCapacity-types]_ | {html}{html} | - | name | _java.lang.String_ | {html}{html} | - | parent | _T_ | {html}{html} | - | percentUsage | _int_ | {html}{html} | - | percentUsageMinDelta | _java.lang.String_ | {html}Sets the minimum number of percentage points the usage has to change before a UsageListener event is fired by the -manager.{html} | - | pollingTime | _int_ | {html}{html} | - | store | _[org.apache.activemq.store.PersistenceAdapter|#org.apache.activemq.store.PersistenceAdapter-types]_ | {html}{html} | - | usagePortion | _float_ | {html}{html} | - -{anchor:streamJDBCAdapter-element} -h3. The _[|#streamJDBCAdapter-element]_ Element - {html}This JDBCAdapter inserts and extracts BLOB data using the -setBinaryStream()/getBinaryStream() operations. - -The databases/JDBC drivers that use this adapter are: -
      -
    • Axion
    • -
    {html} -h4. Properties - || Property Name || Type || Description || - | batchStatments | _boolean_ | {html}{html} | - | maxRows | _int_ | {html}the max value for statement maxRows, used to limit jdbc queries{html} | - | statements | _[org.apache.activemq.store.jdbc.Statements|#org.apache.activemq.store.jdbc.Statements-types]_ | {html}{html} | - | useExternalMessageReferences | _boolean_ | {html}{html} | - -{anchor:strictOrderDispatchPolicy-element} -h3. The _[|#strictOrderDispatchPolicy-element]_ Element - {html}Dispatch policy that causes every subscription to see messages in the same -order.{html} - -{anchor:sybase-jdbc-adapter-element} -h3. The _[|#sybase-jdbc-adapter-element]_ Element - {html}A JDBC Adapter for Sybase databases{html} -h4. Properties - || Property Name || Type || Description || - | batchStatments | _boolean_ | {html}{html} | - | maxRows | _int_ | {html}the max value for statement maxRows, used to limit jdbc queries{html} | - | statements | _[org.apache.activemq.store.jdbc.Statements|#org.apache.activemq.store.jdbc.Statements-types]_ | {html}{html} | - | useExternalMessageReferences | _boolean_ | {html}{html} | - -{anchor:systemUsage-element} -h3. The _[|#systemUsage-element]_ Element - {html}Holder for Usage instances for memory, store and temp files Main use case is -manage memory usage.{html} -h4. Properties - || Property Name || Type || Description || - | adapter | _[org.apache.activemq.store.PersistenceAdapter|#org.apache.activemq.store.PersistenceAdapter-types]_ | {html}{html} | - | executor | _java.util.concurrent.ThreadPoolExecutor_ | {html}{html} | - | jobSchedulerStore | _org.apache.activemq.broker.scheduler.JobSchedulerStore_ | {html}{html} | - | jobSchedulerUsage | _[org.apache.activemq.usage.JobSchedulerUsage|#org.apache.activemq.usage.JobSchedulerUsage-types]_ | {html}{html} | - | memoryUsage | _[org.apache.activemq.usage.MemoryUsage|#org.apache.activemq.usage.MemoryUsage-types]_ | {html}{html} | - | name | _java.lang.String_ | {html}{html} | - | parent | _[org.apache.activemq.usage.SystemUsage|#org.apache.activemq.usage.SystemUsage-types]_ | {html}{html} | - | sendFailIfNoSpace | _boolean_ | {html}Sets whether or not a send() should fail if there is no space free. The -default value is false which means to block the send() method until space -becomes available{html} | - | sendFailIfNoSpaceAfterTimeout | _long_ | {html}{html} | - | sendFailIfNoSpaceExplicitySet | _boolean_ | {html}{html} | - | storeUsage | _[org.apache.activemq.usage.StoreUsage|#org.apache.activemq.usage.StoreUsage-types]_ | {html}{html} | - | tempStore | _[org.apache.activemq.store.PListStore|#org.apache.activemq.store.PListStore-types]_ | {html}{html} | - | tempUsage | _[org.apache.activemq.usage.TempUsage|#org.apache.activemq.usage.TempUsage-types]_ | {html}{html} | - -{anchor:taskRunnerFactory-element} -h3. The _[|#taskRunnerFactory-element]_ Element - {html}Manages the thread pool for long running tasks. Long running tasks are not -always active but when they are active, they may need a few iterations of -processing for them to become idle. The manager ensures that each task is -processes but that no one task overtakes the system. This is kinda like -cooperative multitasking.{html} -h4. Properties - || Property Name || Type || Description || - | daemon | _boolean_ | {html}{html} | - | dedicatedTaskRunner | _boolean_ | {html}{html} | - | executor | _java.util.concurrent.ExecutorService_ | {html}{html} | - | maxIterationsPerRun | _int_ | {html}{html} | - | maxThreadPoolSize | _int_ | {html}{html} | - | name | _java.lang.String_ | {html}{html} | - | priority | _int_ | {html}{html} | - | rejectedTaskHandler | _java.util.concurrent.RejectedExecutionHandler_ | {html}{html} | - | shutdownAwaitTermination | _long_ | {html}{html} | - -{anchor:tempDestinationAuthorizationEntry-element} -h3. The _[|#tempDestinationAuthorizationEntry-element]_ Element - {html}Represents an entry in a {@link DefaultAuthorizationMap} for assigning -different operations (read, write, admin) of user roles to a temporary -destination{html} -h4. Properties - || Property Name || Type || Description || - | admin | _java.lang.String_ | {html}{html} | - | adminACLs | (_java.lang.Object_)\* | {html}{html} | - | destination | _[org.apache.activemq.command.ActiveMQDestination|#org.apache.activemq.command.ActiveMQDestination-types]_ | {html}{html} | - | groupClass | _java.lang.String_ | {html}{html} | - | queue | _java.lang.String_ | {html}A helper method to set the destination from a configuration file{html} | - | read | _java.lang.String_ | {html}{html} | - | readACLs | (_java.lang.Object_)\* | {html}{html} | - | tempQueue | _boolean_ | {html}{html} | - | tempTopic | _boolean_ | {html}{html} | - | topic | _java.lang.String_ | {html}A helper method to set the destination from a configuration file{html} | - | write | _java.lang.String_ | {html}{html} | - | writeACLs | (_java.lang.Object_)\* | {html}{html} | - -{anchor:tempQueue-element} -h3. The _[|#tempQueue-element]_ Element - {html}An ActiveMQ Temporary Queue Destination{html} -h4. Properties - || Property Name || Type || Description || - | compositeDestinations | (_[org.apache.activemq.command.ActiveMQDestination|#org.apache.activemq.command.ActiveMQDestination-types]_)\* | {html}{html} | - | connection | _org.apache.activemq.ActiveMQConnection_ | {html}{html} | - | connectionId | _java.lang.String_ | {html}{html} | - | name | _java.lang.String_ | {html}{html} | - | physicalName | _java.lang.String_ | {html}{html} | - | properties | _java.util.Properties_ | {html}Get the properties from this instance for storing in JNDI{html} | - | sequenceId | _long_ | {html}{html} | - -{anchor:tempTopic-element} -h3. The _[|#tempTopic-element]_ Element - {html}An ActiveMQ Temporary Topic Destination{html} -h4. Properties - || Property Name || Type || Description || - | compositeDestinations | (_[org.apache.activemq.command.ActiveMQDestination|#org.apache.activemq.command.ActiveMQDestination-types]_)\* | {html}{html} | - | connection | _org.apache.activemq.ActiveMQConnection_ | {html}{html} | - | connectionId | _java.lang.String_ | {html}{html} | - | name | _java.lang.String_ | {html}{html} | - | physicalName | _java.lang.String_ | {html}{html} | - | properties | _java.util.Properties_ | {html}Get the properties from this instance for storing in JNDI{html} | - | sequenceId | _long_ | {html}{html} | - -{anchor:tempUsage-element} -h3. The _[|#tempUsage-element]_ Element - {html}Used to keep track of how much of something is being used so that a -productive working set usage can be controlled. Main use case is manage -memory usage.{html} -h4. Properties - || Property Name || Type || Description || - | executor | _java.util.concurrent.ThreadPoolExecutor_ | {html}{html} | - | limit | _java.lang.String_ | {html}Sets the memory limit in bytes. Setting the limit in bytes will set the usagePortion to 0 since the UsageManager -is not going to be portion based off the parent. When set using Xbean, values of the form "20 Mb", "1024kb", and -"1g" can be used{html} | - | limiter | _[org.apache.activemq.usage.UsageCapacity|#org.apache.activemq.usage.UsageCapacity-types]_ | {html}{html} | - | name | _java.lang.String_ | {html}{html} | - | parent | _T_ | {html}{html} | - | percentUsage | _int_ | {html}{html} | - | percentUsageMinDelta | _java.lang.String_ | {html}Sets the minimum number of percentage points the usage has to change before a UsageListener event is fired by the -manager.{html} | - | pollingTime | _int_ | {html}{html} | - | store | _[org.apache.activemq.store.PListStore|#org.apache.activemq.store.PListStore-types]_ | {html}{html} | - | usagePortion | _float_ | {html}{html} | - -{anchor:timeStampingBrokerPlugin-element} -h3. The _[|#timeStampingBrokerPlugin-element]_ Element - {html}A Broker interceptor which updates a JMS Client's timestamp on the message -with a broker timestamp. Useful when the clocks on client machines are known -to not be correct and you can only trust the time set on the broker machines. - -Enabling this plugin will break JMS compliance since the timestamp that the -producer sees on the messages after as send() will be different from the -timestamp the consumer will observe when he receives the message. This plugin -is not enabled in the default ActiveMQ configuration. - -2 new attributes have been added which will allow the administrator some override control -over the expiration time for incoming messages: - -Attribute 'zeroExpirationOverride' can be used to apply an expiration -time to incoming messages with no expiration defined (messages that would never expire) - -Attribute 'ttlCeiling' can be used to apply a limit to the expiration time{html} -h4. Properties - || Property Name || Type || Description || - | adminConnectionContext | _org.apache.activemq.broker.ConnectionContext_ | {html}{html} | - | futureOnly | _boolean_ | {html}{html} | - | next | _[org.apache.activemq.broker.Broker|#org.apache.activemq.broker.Broker-types]_ | {html}{html} | - | processNetworkMessages | _java.lang.Boolean_ | {html}{html} | - | ttlCeiling | _long_ | {html}setter method for ttlCeiling{html} | - | zeroExpirationOverride | _long_ | {html}setter method for zeroExpirationOverride{html} | - -{anchor:timedSubscriptionRecoveryPolicy-element} -h3. The _[|#timedSubscriptionRecoveryPolicy-element]_ Element - {html}This implementation of {@link SubscriptionRecoveryPolicy} will keep a timed -buffer of messages around in memory and use that to recover new -subscriptions.{html} -h4. Properties - || Property Name || Type || Description || - | broker | _[org.apache.activemq.broker.Broker|#org.apache.activemq.broker.Broker-types]_ | {html}{html} | - | recoverDuration | _long_ | {html}{html} | - -{anchor:topic-element} -h3. The _[|#topic-element]_ Element - {html}An ActiveMQ Topic{html} -h4. Properties - || Property Name || Type || Description || - | compositeDestinations | (_[org.apache.activemq.command.ActiveMQDestination|#org.apache.activemq.command.ActiveMQDestination-types]_)\* | {html}{html} | - | name | _java.lang.String_ | {html}{html} | - | physicalName | _java.lang.String_ | {html}{html} | - | properties | _java.util.Properties_ | {html}Get the properties from this instance for storing in JNDI{html} | - -{anchor:traceBrokerPathPlugin-element} -h3. The _[|#traceBrokerPathPlugin-element]_ Element - {html}The TraceBrokerPathPlugin can be used in a network of Brokers. Each Broker -that has the plugin configured, will add it's brokerName to the content -of a JMS Property. If all Brokers have this property enabled, the path the -message actually took through the network can be seen in the defined property.{html} -h4. Properties - || Property Name || Type || Description || - | adminConnectionContext | _org.apache.activemq.broker.ConnectionContext_ | {html}{html} | - | next | _[org.apache.activemq.broker.Broker|#org.apache.activemq.broker.Broker-types]_ | {html}{html} | - | stampProperty | _java.lang.String_ | {html}{html} | - -{anchor:transact-database-locker-element} -h3. The _[|#transact-database-locker-element]_ Element - {html}Represents an exclusive lock on a database to avoid multiple brokers running -against the same logical database.{html} -h4. Properties - || Property Name || Type || Description || - | createTablesOnStartup | _boolean_ | {html}{html} | - | dataSource | _javax.sql.DataSource_ | {html}{html} | - | exceptionHandler | _org.apache.activemq.util.Handler_ | {html}{html} | - | failIfLocked | _boolean_ | {html}{html} | - | lockAcquireSleepInterval | _long_ | {html}{html} | - | lockable | _[org.apache.activemq.broker.LockableServiceSupport|#org.apache.activemq.broker.LockableServiceSupport-types]_ | {html}{html} | - | name | _java.lang.String_ | {html}{html} | - | queryTimeout | _int_ | {html}{html} | - | statements | _[org.apache.activemq.store.jdbc.Statements|#org.apache.activemq.store.jdbc.Statements-types]_ | {html}{html} | - -{anchor:transact-jdbc-adapter-element} -h3. The _[|#transact-jdbc-adapter-element]_ Element - {html}A JDBC Adapter for Transact-SQL based databases such as SQL Server or Sybase{html} -h4. Properties - || Property Name || Type || Description || - | batchStatments | _boolean_ | {html}{html} | - | maxRows | _int_ | {html}the max value for statement maxRows, used to limit jdbc queries{html} | - | statements | _[org.apache.activemq.store.jdbc.Statements|#org.apache.activemq.store.jdbc.Statements-types]_ | {html}{html} | - | useExternalMessageReferences | _boolean_ | {html}{html} | - -{anchor:transportConnector-element} -h3. The _[|#transportConnector-element]_ Element - {html}{html} -h4. Properties - || Property Name || Type || Description || - | allowLinkStealing | _boolean_ | {html}{html} | - | auditNetworkProducers | _boolean_ | {html}Enable a producer audit on network connections, Traps the case of a missing send reply and resend. -Note: does not work with conduit=false, networked composite destinations or networked virtual topics{html} | - | brokerInfo | _org.apache.activemq.command.BrokerInfo_ | {html}{html} | - | brokerService | _[org.apache.activemq.broker.BrokerService|#org.apache.activemq.broker.BrokerService-types]_ | {html}This is called by the BrokerService right before it starts the transport.{html} | - | disableAsyncDispatch | _boolean_ | {html}{html} | - | discoveryAgent | _org.apache.activemq.transport.discovery.DiscoveryAgent_ | {html}{html} | - | discoveryUri | _java.net.URI_ | {html}{html} | - | enableStatusMonitor | _boolean_ | {html}{html} | - | maximumConsumersAllowedPerConnection | _int_ | {html}{html} | - | maximumProducersAllowedPerConnection | _int_ | {html}{html} | - | messageAuthorizationPolicy | _org.apache.activemq.security.MessageAuthorizationPolicy_ | {html}Sets the policy used to decide if the current connection is authorized to -consume a given message{html} | - | name | _java.lang.String_ | {html}{html} | - | publishedAddressPolicy | _[org.apache.activemq.broker.PublishedAddressPolicy|#org.apache.activemq.broker.PublishedAddressPolicy-types]_ | {html}Gets the currently configured policy for creating the published connection address of this -TransportConnector.{html} | - | rebalanceClusterClients | _boolean_ | {html}{html} | - | server | _org.apache.activemq.transport.TransportServer_ | {html}{html} | - | taskRunnerFactory | _[org.apache.activemq.thread.TaskRunnerFactory|#org.apache.activemq.thread.TaskRunnerFactory-types]_ | {html}{html} | - | updateClusterClients | _boolean_ | {html}{html} | - | updateClusterClientsOnRemove | _boolean_ | {html}{html} | - | updateClusterFilter | _java.lang.String_ | {html}{html} | - | uri | _java.net.URI_ | {html}Sets the server transport URI to use if there is not a -{@link TransportServer} configured via the -{@link #setServer(TransportServer)} method. This value is used to lazy -create a {@link TransportServer} instance{html} | - -{anchor:udpTraceBrokerPlugin-element} -h3. The _[|#udpTraceBrokerPlugin-element]_ Element - {html}A Broker interceptor which allows you to trace all operations to a UDP -socket.{html} -h4. Properties - || Property Name || Type || Description || - | address | _java.net.SocketAddress_ | {html}{html} | - | adminConnectionContext | _org.apache.activemq.broker.ConnectionContext_ | {html}{html} | - | broadcast | _boolean_ | {html}{html} | - | destination | _java.net.URI_ | {html}{html} | - | maxTraceDatagramSize | _int_ | {html}{html} | - | next | _[org.apache.activemq.broker.Broker|#org.apache.activemq.broker.Broker-types]_ | {html}{html} | - | wireFormat | _org.apache.activemq.wireformat.WireFormat_ | {html}{html} | - | wireFormatFactory | _org.apache.activemq.wireformat.WireFormatFactory_ | {html}{html} | - -{anchor:uniquePropertyMessageEvictionStrategy-element} -h3. The _[|#uniquePropertyMessageEvictionStrategy-element]_ Element - {html}An eviction strategy which evicts the oldest message within messages with the same property value{html} -h4. Properties - || Property Name || Type || Description || - | evictExpiredMessagesHighWatermark | _int_ | {html}Sets the high water mark on which we will eagerly evict expired messages from RAM{html} | - | propertyName | _java.lang.String_ | {html}{html} | - -{anchor:usageCapacity-element} -h3. The _[|#usageCapacity-element]_ Element - {html}Identify if a limit has been reached{html} -h4. Properties - || Property Name || Type || Description || - | limit | _long_ | {html}{html} | - -{anchor:virtualDestinationInterceptor-element} -h3. The _[|#virtualDestinationInterceptor-element]_ Element - {html}Implements Virtual Topics.{html} -h4. Properties - || Property Name || Type || Description || - | virtualDestinations | (_[org.apache.activemq.broker.region.virtual.VirtualDestination|#org.apache.activemq.broker.region.virtual.VirtualDestination-types]_)\* | {html}{html} | - -{anchor:virtualSelectorCacheBrokerPlugin-element} -h3. The _[|#virtualSelectorCacheBrokerPlugin-element]_ Element - {html}A plugin which allows the caching of the selector from a subscription queue. -

    -This stops the build-up of unwanted messages, especially when consumers may -disconnect from time to time when using virtual destinations. -

    -This is influenced by code snippets developed by Maciej Rakowicz{html} -h4. Properties - || Property Name || Type || Description || - | persistFile | _java.io.File_ | {html}Sets the location of the persistent cache{html} | - -{anchor:virtualTopic-element} -h3. The _[|#virtualTopic-element]_ Element - {html}Creates Virtual -Topics using a prefix and postfix. The virtual destination creates a -wildcard that is then used to look up all active queue subscriptions which -match.{html} -h4. Properties - || Property Name || Type || Description || - | local | _boolean_ | {html}{html} | - | name | _java.lang.String_ | {html}{html} | - | postfix | _java.lang.String_ | {html}Sets any postix used to identify the queue consumers{html} | - | prefix | _java.lang.String_ | {html}Sets the prefix wildcard used to identify the queue consumers for a given -topic{html} | - | selectorAware | _boolean_ | {html}Indicates whether the selectors of consumers are used to determine dispatch -to a virtual destination, when true only messages matching an existing -consumer will be dispatched.{html} | - -{anchor:vmCursor-element} -h3. The _[|#vmCursor-element]_ Element - {html}Pending messages held{html} - -{anchor:vmDurableCursor-element} -h3. The _[|#vmDurableCursor-element]_ Element - {html}Pending{html} - -{anchor:vmQueueCursor-element} -h3. The _[|#vmQueueCursor-element]_ Element - {html}Pending messages{html} - -{anchor:xaConnectionFactory-element} -h3. The _[|#xaConnectionFactory-element]_ Element - {html}A Spring enhanced XA connection -factory which will automatically use the Spring bean name as the clientIDPrefix property -so that connections created have client IDs related to your Spring.xml file for -easier comprehension from JMX.{html} -h4. Properties - || Property Name || Type || Description || - | alwaysSessionAsync | _boolean_ | {html}If this flag is not set then a separate thread is not used for dispatching messages for each Session in -the Connection. However, a separate thread is always used if there is more than one session, or the session -isn't in auto acknowledge or duplicates ok mode. By default this value is set to true and session dispatch -happens asynchronously.{html} | - | alwaysSyncSend | _boolean_ | {html}Set true if always require messages to be sync sent{html} | - | auditDepth | _int_ | {html}{html} | - | auditMaximumProducerNumber | _int_ | {html}{html} | - | beanName | _java.lang.String_ | {html}{html} | - | blobTransferPolicy | _org.apache.activemq.blob.BlobTransferPolicy_ | {html}Sets the policy used to describe how out-of-band BLOBs (Binary Large -OBjects) are transferred from producers to brokers to consumers{html} | - | brokerURL | _java.lang.String_ | {html}Sets the connection -URL used to connect to the ActiveMQ broker.{html} | - | checkForDuplicates | _boolean_ | {html}{html} | - | clientID | _java.lang.String_ | {html}Sets the JMS clientID to use for the created connection. Note that this -can only be used by one connection at once so generally its a better idea -to set the clientID on a Connection{html} | - | clientIDPrefix | _java.lang.String_ | {html}Sets the prefix used by autogenerated JMS Client ID values which are used -if the JMS client does not explicitly specify on.{html} | - | clientIdGenerator | _org.apache.activemq.util.IdGenerator_ | {html}{html} | - | clientInternalExceptionListener | _org.apache.activemq.ClientInternalExceptionListener_ | {html}Allows an {@link ClientInternalExceptionListener} to be configured on the ConnectionFactory so that when this factory -is used by frameworks which don't expose the Connection such as Spring JmsTemplate, you can register -an exception listener. -

    Note: access to this clientInternalExceptionListener will not be serialized if it is associated with more than -on connection (as it will be if more than one connection is subsequently created by this connection factory){html} | - | closeTimeout | _int_ | {html}Sets the timeout before a close is considered complete. Normally a -close() on a connection waits for confirmation from the broker; this -allows that operation to timeout to save the client hanging if there is -no broker{html} | - | connectionIDPrefix | _java.lang.String_ | {html}Sets the prefix used by connection id generator{html} | - | connectionIdGenerator | _org.apache.activemq.util.IdGenerator_ | {html}{html} | - | consumerFailoverRedeliveryWaitPeriod | _long_ | {html}{html} | - | copyMessageOnSend | _boolean_ | {html}Should a JMS message be copied to a new JMS Message object as part of the -send() method in JMS. This is enabled by default to be compliant with the -JMS specification. You can disable it if you do not mutate JMS messages -after they are sent for a performance boost{html} | - | disableTimeStampsByDefault | _boolean_ | {html}Sets whether or not timestamps on messages should be disabled or not. If -you disable them it adds a small performance boost.{html} | - | dispatchAsync | _boolean_ | {html}Enables or disables the default setting of whether or not consumers have -their messages dispatched -synchronously or asynchronously by the broker. For non-durable -topics for example we typically dispatch synchronously by default to -minimize context switches which boost performance. However sometimes its -better to go slower to ensure that a single blocked consumer socket does -not block delivery to other consumers.{html} | - | exceptionListener | _javax.jms.ExceptionListener_ | {html}Allows an {@link ExceptionListener} to be configured on the ConnectionFactory so that when this factory -is used by frameworks which don't expose the Connection such as Spring JmsTemplate, you can register -an exception listener. -

    Note: access to this exceptionLinstener will not be serialized if it is associated with more than -on connection (as it will be if more than one connection is subsequently created by this connection factory){html} | - | exclusiveConsumer | _boolean_ | {html}Enables or disables whether or not queue consumers should be exclusive or -not for example to preserve ordering when not using Message Groups{html} | - | maxThreadPoolSize | _int_ | {html}{html} | - | messagePrioritySupported | _boolean_ | {html}{html} | - | nestedMapAndListEnabled | _boolean_ | {html}Enables/disables whether or not Message properties and MapMessage entries -support Nested -Structures of Map and List objects{html} | - | nonBlockingRedelivery | _boolean_ | {html}When true a MessageConsumer will not stop Message delivery before re-delivering Messages -from a rolled back transaction. This implies that message order will not be preserved and -also will result in the TransactedIndividualAck option to be enabled.{html} | - | objectMessageSerializationDefered | _boolean_ | {html}When an object is set on an ObjectMessage, the JMS spec requires the -object to be serialized by that set method. Enabling this flag causes the -object to not get serialized. The object may subsequently get serialized -if the message needs to be sent over a socket or stored to disk.{html} | - | optimizeAcknowledge | _boolean_ | {html}{html} | - | optimizeAcknowledgeTimeOut | _long_ | {html}The max time in milliseconds between optimized ack batches{html} | - | optimizedAckScheduledAckInterval | _long_ | {html}Gets the configured time interval that is used to force all MessageConsumers that have optimizedAcknowledge enabled -to send an ack for any outstanding Message Acks. By default this value is set to zero meaning that the consumers -will not do any background Message acknowledgment.{html} | - | optimizedMessageDispatch | _boolean_ | {html}If this flag is set then an larger prefetch limit is used - only -applicable for durable topic subscribers.{html} | - | password | _java.lang.String_ | {html}Sets the JMS password used for connections created from this factory{html} | - | prefetchPolicy | _[org.apache.activemq.ActiveMQPrefetchPolicy|#org.apache.activemq.ActiveMQPrefetchPolicy-types]_ | {html}Sets the prefetch -policy for consumers created by this connection.{html} | - | producerWindowSize | _int_ | {html}{html} | - | properties | _java.util.Properties_ | {html}Get the properties from this instance for storing in JNDI{html} | - | redeliveryPolicy | _[org.apache.activemq.RedeliveryPolicy|#org.apache.activemq.RedeliveryPolicy-types]_ | {html}Sets the global default redelivery policy to be used when a message is delivered -but the session is rolled back{html} | - | redeliveryPolicyMap | _[org.apache.activemq.broker.region.policy.RedeliveryPolicyMap|#org.apache.activemq.broker.region.policy.RedeliveryPolicyMap-types]_ | {html}Sets the global redelivery policy mapping to be used when a message is delivered -but the session is rolled back{html} | - | rejectedTaskHandler | _java.util.concurrent.RejectedExecutionHandler_ | {html}{html} | - | sendAcksAsync | _boolean_ | {html}{html} | - | sendTimeout | _int_ | {html}{html} | - | sessionTaskRunner | _[org.apache.activemq.thread.TaskRunnerFactory|#org.apache.activemq.thread.TaskRunnerFactory-types]_ | {html}{html} | - | statsEnabled | _boolean_ | {html}{html} | - | transactedIndividualAck | _boolean_ | {html}when true, submit individual transacted acks immediately rather than with transaction completion. -This allows the acks to represent delivery status which can be persisted on rollback -Used in conjunction with org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter#setRewriteOnRedelivery(boolean) true{html} | - | transformer | _org.apache.activemq.MessageTransformer_ | {html}Sets the transformer used to transform messages before they are sent on -to the JMS bus or when they are received from the bus but before they are -delivered to the JMS client{html} | - | transportListener | _org.apache.activemq.transport.TransportListener_ | {html}Allows a listener to be configured on the ConnectionFactory so that when this factory is used -with frameworks which don't expose the Connection such as Spring JmsTemplate, you can still register -a transport listener.{html} | - | useAsyncSend | _boolean_ | {html}Forces the use of Async Sends which -adds a massive performance boost; but means that the send() method will -return immediately whether the message has been sent or not which could -lead to message loss.{html} | - | useBeanNameAsClientIdPrefix | _boolean_ | {html}{html} | - | useCompression | _boolean_ | {html}Enables the use of compression of the message bodies{html} | - | useDedicatedTaskRunner | _boolean_ | {html}{html} | - | useRetroactiveConsumer | _boolean_ | {html}Sets whether or not retroactive consumers are enabled. Retroactive -consumers allow non-durable topic subscribers to receive old messages -that were published before the non-durable subscriber started.{html} | - | userName | _java.lang.String_ | {html}Sets the JMS userName used by connections created by this factory{html} | - | warnAboutUnstartedConnectionTimeout | _long_ | {html}Enables the timeout from a connection creation to when a warning is -generated if the connection is not properly started via -{@link Connection#start()} and a message is received by a consumer. It is -a very common gotcha to forget to start -the connection so this option makes the default case to create a -warning if the user forgets. To disable the warning just set the value to < -0 (say -1).{html} | - | watchTopicAdvisories | _boolean_ | {html}{html} | - | xaAckMode | _int_ | {html}{html} | - -h3. Element Index - | _[|#abortSlowAckConsumerStrategy-element]_ | {html}Abort slow consumers when they reach the configured threshold of slowness, - -default is that a consumer that has not Ack'd a message for 30 seconds is slow.{html} | - | _[|#abortSlowConsumerStrategy-element]_ | {html}Abort slow consumers when they reach the configured threshold of slowness, default is slow for 30 seconds{html} | - | _[|#authenticationUser-element]_ | {html}A helper object used to configure simple authentiaction plugin{html} | - | _[|#authorizationEntry-element]_ | {html}Represents an entry in a {@link DefaultAuthorizationMap} for assigning -different operations (read, write, admin) of user roles to a specific -destination or a hierarchical wildcard area of destinations.{html} | - | _[|#authorizationMap-element]_ | {html}{html} | - | _[|#authorizationPlugin-element]_ | {html}An authorization plugin where each operation on a destination is checked -against an authorizationMap{html} | - | _[|#axionJDBCAdapter-element]_ | {html}Axion specific Adapter. - -Axion does not seem to support ALTER statements or sub-selects. This means: -- We cannot auto upgrade the schema was we roll out new versions of ActiveMQ -- We cannot delete durable sub messages that have be acknowledged by all consumers.{html} | - | _[|#blobJDBCAdapter-element]_ | {html}This JDBCAdapter inserts and extracts BLOB data using the getBlob()/setBlob() -operations. This is a little more involved since to insert a blob you have -to: - -1: insert empty blob. 2: select the blob 3: finally update the blob with data -value. - -The databases/JDBC drivers that use this adapter are: -

      -
    • -
    {html} | - | _[|#broker-element]_ | {html}An ActiveMQ Message Broker. It consists of a number of transport -connectors, network connectors and a bunch of properties which can be used to -configure the broker as its lazily created.{html} | - | _[|#brokerService-element]_ | {html}Manages the life-cycle of an ActiveMQ Broker. A BrokerService consists of a -number of transport connectors, network connectors and a bunch of properties -which can be used to configure the broker as its lazily created.{html} | - | _[|#bytesJDBCAdapter-element]_ | {html}This JDBCAdapter inserts and extracts BLOB data using the -setBytes()/getBytes() operations. The databases/JDBC drivers that use this -adapter are:{html} | - | _[|#cachedLDAPAuthorizationMap-element]_ | {html}A {@link DefaultAuthorizationMap} implementation which uses LDAP to initialize and update authorization -policy.{html} | - | _[|#cachedMessageGroupMapFactory-element]_ | {html}A factory to create instances of {@link org.apache.activemq.broker.region.group.CachedMessageGroupMap} when implementing the -Message Groups functionality.{html} | - | _[|#compositeDemandForwardingBridge-element]_ | {html}A demand forwarding bridge which works with multicast style transports where -a single Transport could be communicating with multiple remote brokers{html} | - | _[|#compositeQueue-element]_ | {html}Represents a virtual queue which forwards to a number of other destinations.{html} | - | _[|#compositeTopic-element]_ | {html}Represents a virtual topic which forwards to a number of other destinations.{html} | - | _[|#conditionalNetworkBridgeFilterFactory-element]_ | {html}implement conditional behavior for queue consumers, allows replaying back to -origin if no consumers are present on the local broker after a configurable -delay, irrespective of the TTL. Also allows rate limiting of messages -through the network, useful for static includes{html} | - | _[|#connectionDotFilePlugin-element]_ | {html}A DOT file creator plugin which -creates a DOT file showing the current connections{html} | - | _[|#connectionFactory-element]_ | {html}A Spring enhanced connection -factory which will automatically use the Spring bean name as the clientIDPrefix property -so that connections created have client IDs related to your Spring.xml file for -easier comprehension from JMX.{html} | - | _[|#constantPendingMessageLimitStrategy-element]_ | {html}This PendingMessageLimitStrategy is configured to a constant value for all subscriptions.{html} | - | _[|#database-locker-element]_ | {html}Represents an exclusive lock on a database to avoid multiple brokers running -against the same logical database.{html} | - | _[|#db2JDBCAdapter-element]_ | {html}{html} | - | _[|#defaultIOExceptionHandler-element]_ | {html}{html} | - | _[|#defaultJDBCAdapter-element]_ | {html}Implements all the default JDBC operations that are used by the JDBCPersistenceAdapter.

    sub-classing is -encouraged to override the default implementation of methods to account for differences in JDBC Driver -implementations.

    The JDBCAdapter inserts and extracts BLOB data using the getBytes()/setBytes() operations.

    -The databases/JDBC drivers that use this adapter are: -

      -
    • -
    {html} | - | _[|#defaultNetworkBridgeFilterFactory-element]_ | {html}implement default behavior, filter that will not allow re-send to origin -based on brokerPath and which respects networkTTL{html} | - | _[|#defaultUsageCapacity-element]_ | {html}Identify if a limit has been reached{html} | - | _[|#demandForwardingBridge-element]_ | {html}Forwards messages from the local broker to the remote broker based on demand.{html} | - | _[|#destinationDotFilePlugin-element]_ | {html}A DOT -file creator plugin which creates a DOT file showing the current topic & queue hierarchies.{html} | - | _[|#destinationEntry-element]_ | {html}A default entry in a DestinationMap which holds a single value.{html} | - | _[|#destinationPathSeparatorPlugin-element]_ | {html}{html} | - | _[|#discarding-element]_ | {html}Dead Letter Strategy that discards all messages{html} | - | _[|#discardingDLQBrokerPlugin-element]_ | {html}{html} | - | _[|#fileCursor-element]_ | {html}Pending messages{html} | - | _[|#fileDurableSubscriberCursor-element]_ | {html}Pending messages for durable subscribers{html} | - | _[|#fileQueueCursor-element]_ | {html}Pending{html} | - | _[|#filteredDestination-element]_ | {html}Represents a destination which is filtered using some predicate such as a selector -so that messages are only dispatched to the destination if they match the filter.{html} | - | _[|#filteredKahaDB-element]_ | {html}{html} | - | _[|#fixedCountSubscriptionRecoveryPolicy-element]_ | {html}This implementation of {@link SubscriptionRecoveryPolicy} will keep a fixed -count of last messages.{html} | - | _[|#fixedSizedSubscriptionRecoveryPolicy-element]_ | {html}This implementation of {@link SubscriptionRecoveryPolicy} will keep a fixed -amount of memory available in RAM for message history which is evicted in -time order.{html} | - | _[|#forcePersistencyModeBroker-element]_ | {html}A Plugin which allows to force every incoming message to be PERSISTENT or NON-PERSISTENT. - -Useful, if you have set the broker usage policy to process ONLY persistent or ONLY non-persistent -messages.{html} | - | _[|#forcePersistencyModeBrokerPlugin-element]_ | {html}A Plugin which allows to force every incoming message to be PERSISTENT or NON-PERSISTENT. - -Useful, if you have set the broker usage policy to process ONLY persistent or ONLY non-persistent -messages.{html} | - | _[|#forwardingBridge-element]_ | {html}Forwards all messages from the local broker to the remote broker.{html} | - | _[|#hsqldb-jdbc-adapter-element]_ | {html}{html} | - | _[|#imageBasedJDBCAdaptor-element]_ | {html}Provides JDBCAdapter since that uses -IMAGE datatype to hold binary data. - -The databases/JDBC drivers that use this adapter are: -
      -
    • Sybase
    • -
    • MS SQL
    • -
    {html} | - | _[|#inboundQueueBridge-element]_ | {html}Create an Inbound Queue Bridge. By default this class uses the sname name for -both the inbound and outbound queue. This behavior can be overridden however -by using the setter methods to configure both the inbound and outboud queue names -separately.{html} | - | _[|#inboundTopicBridge-element]_ | {html}Create an Inbound Topic Bridge. By default this class uses the topic name for -both the inbound and outbound topic. This behavior can be overridden however -by using the setter methods to configure both the inbound and outboud topic names -separately.{html} | - | _[|#individualDeadLetterStrategy-element]_ | {html}A {@link DeadLetterStrategy} where each destination has its own individual -DLQ using the subject naming hierarchy.{html} | - | _[|#informixJDBCAdapter-element]_ | {html}JDBC Adapter for Informix database. -Because Informix database restricts length of composite primary keys, length of -container name field and subscription id field must be reduced to 150 characters. -Therefore be sure not to use longer names for container name and subscription id than 150 characters.{html} | - | _[|#jDBCIOExceptionHandler-element]_ | {html}{html} | - | _[|#jaasAuthenticationPlugin-element]_ | {html}Provides a JAAS based authentication plugin{html} | - | _[|#jaasCertificateAuthenticationPlugin-element]_ | {html}Provides a JAAS based SSL certificate authentication plugin{html} | - | _[|#jaasDualAuthenticationPlugin-element]_ | {html}Provides a JAAS based authentication plugin{html} | - | _[|#jdbcPersistenceAdapter-element]_ | {html}A {@link PersistenceAdapter} implementation using JDBC for persistence -storage. - -This persistence adapter will correctly remember prepared XA transactions, -but it will not keep track of local transaction commits so that operations -performed against the Message store are done as a single uow.{html} | - | _[|#jmsQueueConnector-element]_ | {html}A Bridge to other JMS Queue providers{html} | - | _[|#jmsTopicConnector-element]_ | {html}A Bridge to other JMS Topic providers{html} | - | _[|#jobSchedulerUsage-element]_ | {html}Used to keep track of how much of something is being used so that a -productive working set usage can be controlled. Main use case is manage -memory usage.{html} | - | _[|#journalPersistenceAdapter-element]_ | {html}An implementation of {@link PersistenceAdapter} designed for use with a -{@link Journal} and then check pointing asynchronously on a timeout with some -other long term persistent storage.{html} | - | _[|#journalPersistenceAdapterFactory-element]_ | {html}Factory class that can create PersistenceAdapter objects.{html} | - | _[|#journaledJDBC-element]_ | {html}Creates a default persistence model using the Journal and JDBC{html} | - | _[|#kahaDB-element]_ | {html}An implementation of {@link PersistenceAdapter} designed for use with -KahaDB - Embedded Lightweight Non-Relational Database{html} | - | _[|#lDAPAuthorizationMap-element]_ | {html}An {@link AuthorizationMap} which uses LDAP{html} | - | _[|#lastImageSubscriptionRecoveryPolicy-element]_ | {html}This implementation of {@link SubscriptionRecoveryPolicy} will only keep the -last message.{html} | - | _[|#ldapNetworkConnector-element]_ | {html}class to create dynamic network connectors listed in an directory server -using the LDAP v3 protocol as defined in RFC 2251, the entries listed in the -directory server must implement the ipHost and ipService objectClasses as -defined in RFC 2307.{html} | - | _[|#lease-database-locker-element]_ | {html}Represents an exclusive lease on a database to avoid multiple brokers running -against the same logical database.{html} | - | _[|#levelDB-element]_ | {html}An implementation of {@link org.apache.activemq.store.PersistenceAdapter} designed for use with -LevelDB - Embedded Lightweight Non-Relational Database{html} | - | _[|#loggingBrokerPlugin-element]_ | {html}A simple Broker intercepter which allows you to enable/disable logging.{html} | - | _[|#mKahaDB-element]_ | {html}An implementation of {@link org.apache.activemq.store.PersistenceAdapter} that supports -distribution of destinations across multiple kahaDB persistence adapters{html} | - | _[|#managementContext-element]_ | {html}An abstraction over JMX mbean registration{html} | - | _[|#maxdb-jdbc-adapter-element]_ | {html}JDBC Adapter for the MaxDB database.{html} | - | _[|#memoryPersistenceAdapter-element]_ | {html}{html} | - | _[|#memoryUsage-element]_ | {html}Used to keep track of how much of something is being used so that a -productive working set usage can be controlled. Main use case is manage -memory usage.{html} | - | _[|#messageGroupHashBucketFactory-element]_ | {html}A factory to create instances of {@link SimpleMessageGroupMap} when -implementing the Message -Groups functionality.{html} | - | _[|#mirroredQueue-element]_ | {html}Creates Mirrored -Queue using a prefix and postfix to define the topic name on which to mirror the queue to.{html} | - | _[|#multicastNetworkConnector-element]_ | {html}A network connector which uses some kind of multicast-like transport that -communicates with potentially many remote brokers over a single logical -{@link Transport} instance such as when using multicast. - -This implementation does not depend on multicast at all; any other group -based transport could be used.{html} | - | _[|#multicastTraceBrokerPlugin-element]_ | {html}A Broker interceptor which allows you to trace all operations to a Multicast -socket.{html} | - | _[|#mysql-jdbc-adapter-element]_ | {html}{html} | - | _[|#networkConnector-element]_ | {html}A network connector which uses a discovery agent to detect the remote brokers -available and setup a connection to each available remote broker{html} | - | _[|#noSubscriptionRecoveryPolicy-element]_ | {html}This SubscriptionRecoveryPolicy disable recovery of messages.{html} | - | _[|#oldestMessageEvictionStrategy-element]_ | {html}An eviction strategy which evicts the oldest message first (which is the -default).{html} | - | _[|#oldestMessageWithLowestPriorityEvictionStrategy-element]_ | {html}An eviction strategy which evicts the oldest message with the lowest priority first.{html} | - | _[|#oracleBlobJDBCAdapter-element]_ | {html}Implements all the default JDBC operations that are used -by the JDBCPersistenceAdapter. -

    -Subclassing is encouraged to override the default -implementation of methods to account for differences -in JDBC Driver implementations. -

    -The JDBCAdapter inserts and extracts BLOB data using the -getBytes()/setBytes() operations. -

    -The databases/JDBC drivers that use this adapter are: -

      -
    • -
    {html} | - | _[|#oracleJDBCAdapter-element]_ | {html}Implements all the default JDBC operations that are used -by the JDBCPersistenceAdapter. -

    -Subclassing is encouraged to override the default -implementation of methods to account for differences -in JDBC Driver implementations. -

    {html} | - | _[|#outboundQueueBridge-element]_ | {html}Create an Outbound Queue Bridge. By default the bridge uses the same -name for both the inbound and outbound queues, however this can be altered -by using the public setter methods to configure both inbound and outbound -queue names.{html} | - | _[|#outboundTopicBridge-element]_ | {html}Create an Outbound Topic Bridge. By default the bridge uses the same -name for both the inbound and outbound topics, however this can be altered -by using the public setter methods to configure both inbound and outbound -topic names.{html} | - | _[|#pListStoreImpl-element]_ | {html}{html} | - | _[|#partitionBrokerPlugin-element]_ | {html}A BrokerPlugin which partitions client connections over a cluster of brokers.{html} | - | _[|#policyEntry-element]_ | {html}Represents an entry in a {@link PolicyMap} for assigning policies to a -specific destination or a hierarchical wildcard area of destinations.{html} | - | _[|#policyMap-element]_ | {html}Represents a destination based configuration of policies so that individual -destinations or wildcard hierarchies of destinations can be configured using -different policies.{html} | - | _[|#pooledConnectionFactory-element]_ | {html}Simple factory bean used to create a jencks connection pool. -Depending on the properties set, it will create a simple pool, -a transaction aware connection pool, or a jca aware connection pool. - -

    -
    -  
    -  
    -  
    -
    -
    - -The resourceName property should be used along with the {@link org.apache.activemq.jms.pool.GenericResourceManager} and have -the same value than its resourceName property. This will make sure the transaction manager -maps correctly the connection factory to the recovery process.{html} | - | _[|#postgresql-jdbc-adapter-element]_ | {html}Implements all the default JDBC operations that are used -by the JDBCPersistenceAdapter. -

    -Subclassing is encouraged to override the default -implementation of methods to account for differences -in JDBC Driver implementations. -

    -The JDBCAdapter inserts and extracts BLOB data using the -getBytes()/setBytes() operations. -

    -The databases/JDBC drivers that use this adapter are: -

      -
    • -
    {html} | - | _[|#prefetchPolicy-element]_ | {html}Defines the prefetch message policies for different types of consumers{html} | - | _[|#prefetchRatePendingMessageLimitStrategy-element]_ | {html}This PendingMessageLimitStrategy sets the maximum pending message limit value to be -a multiplier of the prefetch limit of the subscription.{html} | - | _[|#priorityDispatchPolicy-element]_ | {html}Priority dispatch policy that sends a message to every subscription that -matches the message in consumer priority order.{html} | - | _[|#priorityNetworkDispatchPolicy-element]_ | {html}dispatch policy that ignores lower priority duplicate network consumers, -used in conjunction with network bridge suppresDuplicateTopicSubscriptions{html} | - | _[|#proxyConnector-element]_ | {html}{html} | - | _[|#publishedAddressPolicy-element]_ | {html}Policy object that controls how a TransportConnector publishes the connector's -address to the outside world. By default the connector will publish itself -using the resolved host name of the bound server socket.{html} | - | _[|#queryBasedSubscriptionRecoveryPolicy-element]_ | {html}This implementation of {@link SubscriptionRecoveryPolicy} will perform a user -specific query mechanism to load any messages they may have missed.{html} | - | _[|#queue-element]_ | {html}An ActiveMQ Queue{html} | - | _[|#queueDispatchSelector-element]_ | {html}Queue dispatch policy that determines if a message can be sent to a subscription{html} | - | _[|#reconnectionPolicy-element]_ | {html}A policy object that defines how a {@link JmsConnector} deals with -reconnection of the local and foreign connections.{html} | - | _[|#redeliveryPlugin-element]_ | {html}Replace regular DLQ handling with redelivery via a resend to the original destination -after a delay -A destination matching RedeliveryPolicy controls the quantity and delay for re-sends -If there is no matching policy or an existing policy limit is exceeded by default -regular DLQ processing resumes. This is controlled via sendToDlqIfMaxRetriesExceeded -and fallbackToDeadLetter{html} | - | _[|#redeliveryPolicy-element]_ | {html}Configuration options for a messageConsumer used to control how messages are re-delivered when they -are rolled back. -May be used server side on a per destination basis via the Broker RedeliveryPlugin{html} | - | _[|#redeliveryPolicyMap-element]_ | {html}Represents a destination based configuration of policies so that individual -destinations or wildcard hierarchies of destinations can be configured using -different policies.{html} | - | _[|#replicatedLevelDB-element]_ | {html}An implementation of {@link org.apache.activemq.store.PersistenceAdapter} designed for use with -LevelDB - Embedded Lightweight Non-Relational Database{html} | - | _[|#roundRobinDispatchPolicy-element]_ | {html}Simple dispatch policy that sends a message to every subscription that -matches the message.{html} | - | _[|#runtimeConfigurationPlugin-element]_ | {html}Broker plugin that will monitor the broker xml configuration for -changes and selectively apply those changes to the running broker.{html} | - | _[|#shared-file-locker-element]_ | {html}Represents an exclusive lock on a database to avoid multiple brokers running -against the same logical database.{html} | - | _[|#sharedDeadLetterStrategy-element]_ | {html}A default implementation of {@link DeadLetterStrategy} which uses -a constant destination.{html} | - | _[|#simpleAuthenticationPlugin-element]_ | {html}Provides a simple authentication plugin{html} | - | _[|#simpleAuthorizationMap-element]_ | {html}An AuthorizationMap which is configured with individual DestinationMaps for -each operation.{html} | - | _[|#simpleDispatchPolicy-element]_ | {html}Simple dispatch policy that sends a message to every subscription that -matches the message.{html} | - | _[|#simpleDispatchSelector-element]_ | {html}Simple dispatch policy that determines if a message can be sent to a subscription{html} | - | _[|#simpleJmsMessageConvertor-element]_ | {html}Converts Message from one JMS to another{html} | - | _[|#simpleMessageGroupMapFactory-element]_ | {html}A factory to create instances of {@link SimpleMessageGroupMap} when implementing the -Message Groups functionality.{html} | - | _[|#sslContext-element]_ | {html}Extends the SslContext so that it's easier to configure from spring.{html} | - | _[|#statements-element]_ | {html}{html} | - | _[|#statisticsBrokerPlugin-element]_ | {html}A StatisticsBrokerPlugin -You can retrieve a Map Message for a Destination - or -Broker containing statistics as key-value pairs The message must contain a -replyTo Destination - else its ignored -To retrieve stats on the broker send a empty message to ActiveMQ.Statistics.Broker (Queue or Topic) -With a replyTo set to the destination you want the stats returned to. -To retrieve stats for a destination - e.g. foo - send an empty message to ActiveMQ.Statistics.Destination.foo -- this works with wildcards to - you get a message for each wildcard match on the replyTo destination. -The stats message is a MapMessage populated with statistics for the target{html} | - | _[|#storeCursor-element]_ | {html}Pending messages{html} | - | _[|#storeDurableSubscriberCursor-element]_ | {html}Pending messages for a durable{html} | - | _[|#storeUsage-element]_ | {html}Used to keep track of how much of something is being used so that a -productive working set usage can be controlled. Main use case is manage -memory usage.{html} | - | _[|#streamJDBCAdapter-element]_ | {html}This JDBCAdapter inserts and extracts BLOB data using the -setBinaryStream()/getBinaryStream() operations. - -The databases/JDBC drivers that use this adapter are: -
      -
    • Axion
    • -
    {html} | - | _[|#strictOrderDispatchPolicy-element]_ | {html}Dispatch policy that causes every subscription to see messages in the same -order.{html} | - | _[|#sybase-jdbc-adapter-element]_ | {html}A JDBC Adapter for Sybase databases{html} | - | _[|#systemUsage-element]_ | {html}Holder for Usage instances for memory, store and temp files Main use case is -manage memory usage.{html} | - | _[|#taskRunnerFactory-element]_ | {html}Manages the thread pool for long running tasks. Long running tasks are not -always active but when they are active, they may need a few iterations of -processing for them to become idle. The manager ensures that each task is -processes but that no one task overtakes the system. This is kinda like -cooperative multitasking.{html} | - | _[|#tempDestinationAuthorizationEntry-element]_ | {html}Represents an entry in a {@link DefaultAuthorizationMap} for assigning -different operations (read, write, admin) of user roles to a temporary -destination{html} | - | _[|#tempQueue-element]_ | {html}An ActiveMQ Temporary Queue Destination{html} | - | _[|#tempTopic-element]_ | {html}An ActiveMQ Temporary Topic Destination{html} | - | _[|#tempUsage-element]_ | {html}Used to keep track of how much of something is being used so that a -productive working set usage can be controlled. Main use case is manage -memory usage.{html} | - | _[|#timeStampingBrokerPlugin-element]_ | {html}A Broker interceptor which updates a JMS Client's timestamp on the message -with a broker timestamp. Useful when the clocks on client machines are known -to not be correct and you can only trust the time set on the broker machines. - -Enabling this plugin will break JMS compliance since the timestamp that the -producer sees on the messages after as send() will be different from the -timestamp the consumer will observe when he receives the message. This plugin -is not enabled in the default ActiveMQ configuration. - -2 new attributes have been added which will allow the administrator some override control -over the expiration time for incoming messages: - -Attribute 'zeroExpirationOverride' can be used to apply an expiration -time to incoming messages with no expiration defined (messages that would never expire) - -Attribute 'ttlCeiling' can be used to apply a limit to the expiration time{html} | - | _[|#timedSubscriptionRecoveryPolicy-element]_ | {html}This implementation of {@link SubscriptionRecoveryPolicy} will keep a timed -buffer of messages around in memory and use that to recover new -subscriptions.{html} | - | _[|#topic-element]_ | {html}An ActiveMQ Topic{html} | - | _[|#traceBrokerPathPlugin-element]_ | {html}The TraceBrokerPathPlugin can be used in a network of Brokers. Each Broker -that has the plugin configured, will add it's brokerName to the content -of a JMS Property. If all Brokers have this property enabled, the path the -message actually took through the network can be seen in the defined property.{html} | - | _[|#transact-database-locker-element]_ | {html}Represents an exclusive lock on a database to avoid multiple brokers running -against the same logical database.{html} | - | _[|#transact-jdbc-adapter-element]_ | {html}A JDBC Adapter for Transact-SQL based databases such as SQL Server or Sybase{html} | - | _[|#transportConnector-element]_ | {html}{html} | - | _[|#udpTraceBrokerPlugin-element]_ | {html}A Broker interceptor which allows you to trace all operations to a UDP -socket.{html} | - | _[|#uniquePropertyMessageEvictionStrategy-element]_ | {html}An eviction strategy which evicts the oldest message within messages with the same property value{html} | - | _[|#usageCapacity-element]_ | {html}Identify if a limit has been reached{html} | - | _[|#virtualDestinationInterceptor-element]_ | {html}Implements Virtual Topics.{html} | - | _[|#virtualSelectorCacheBrokerPlugin-element]_ | {html}A plugin which allows the caching of the selector from a subscription queue. -

    -This stops the build-up of unwanted messages, especially when consumers may -disconnect from time to time when using virtual destinations. -

    -This is influenced by code snippets developed by Maciej Rakowicz{html} | - | _[|#virtualTopic-element]_ | {html}Creates Virtual -Topics using a prefix and postfix. The virtual destination creates a -wildcard that is then used to look up all active queue subscriptions which -match.{html} | - | _[|#vmCursor-element]_ | {html}Pending messages held{html} | - | _[|#vmDurableCursor-element]_ | {html}Pending{html} | - | _[|#vmQueueCursor-element]_ | {html}Pending messages{html} | - | _[|#xaConnectionFactory-element]_ | {html}A Spring enhanced XA connection -factory which will automatically use the Spring bean name as the clientIDPrefix property -so that connections created have client IDs related to your Spring.xml file for -easier comprehension from JMX.{html} | - diff --git a/uk.ac.diamond.org.apache.activemq/build.properties b/uk.ac.diamond.org.apache.activemq/build.properties index cbbd085f9..16906d88f 100644 --- a/uk.ac.diamond.org.apache.activemq/build.properties +++ b/uk.ac.diamond.org.apache.activemq/build.properties @@ -1,7 +1,22 @@ output.. = . bin.includes = META-INF/,\ - activemq.xsd,\ - activemq.xsd.html,\ - activemq.xsd.wiki,\ - javax/,\ - org/ + jars/activemq-amqp-5.9.0.jar,\ + jars/activemq-broker-5.9.0.jar,\ + jars/activemq-camel-5.9.0.jar,\ + jars/activemq-client-5.9.0.jar,\ + jars/activemq-console-5.9.0.jar,\ + jars/activemq-http-5.9.0.jar,\ + jars/activemq-jdbc-store-5.9.0.jar,\ + jars/activemq-kahadb-store-5.9.0.jar,\ + jars/activemq-leveldb-store-5.9.0.jar,\ + jars/activemq-mqtt-5.9.0.jar,\ + jars/activemq-openwire-legacy-5.9.0.jar,\ + jars/activemq-protobuf-1.1.jar,\ + jars/activemq-spring-5.9.0.jar,\ + jars/activemq-stomp-5.9.0.jar,\ + jars/geronimo-j2ee-management_1.1_spec-1.0.1.jar,\ + jars/geronimo-jms_1.1_spec-1.1.1.jar,\ + jars/geronimo-jta_1.0.1B_spec-1.0.1.jar,\ + jars/hawtbuf-1.9.jar,\ + jars/jasypt-1.9.1.jar,\ + jars/log4j-1.2.17.jar diff --git a/uk.ac.diamond.org.apache.activemq/jars/activemq-amqp-5.9.0.jar b/uk.ac.diamond.org.apache.activemq/jars/activemq-amqp-5.9.0.jar new file mode 100644 index 000000000..92dae9a2f Binary files /dev/null and b/uk.ac.diamond.org.apache.activemq/jars/activemq-amqp-5.9.0.jar differ diff --git a/uk.ac.diamond.org.apache.activemq/jars/activemq-broker-5.9.0.jar b/uk.ac.diamond.org.apache.activemq/jars/activemq-broker-5.9.0.jar new file mode 100644 index 000000000..276ce9123 Binary files /dev/null and b/uk.ac.diamond.org.apache.activemq/jars/activemq-broker-5.9.0.jar differ diff --git a/uk.ac.diamond.org.apache.activemq/jars/activemq-camel-5.9.0.jar b/uk.ac.diamond.org.apache.activemq/jars/activemq-camel-5.9.0.jar new file mode 100644 index 000000000..714fa159b Binary files /dev/null and b/uk.ac.diamond.org.apache.activemq/jars/activemq-camel-5.9.0.jar differ diff --git a/uk.ac.diamond.org.apache.activemq/jars/activemq-client-5.9.0.jar b/uk.ac.diamond.org.apache.activemq/jars/activemq-client-5.9.0.jar new file mode 100644 index 000000000..d8d9c8ccc Binary files /dev/null and b/uk.ac.diamond.org.apache.activemq/jars/activemq-client-5.9.0.jar differ diff --git a/uk.ac.diamond.org.apache.activemq/jars/activemq-console-5.9.0.jar b/uk.ac.diamond.org.apache.activemq/jars/activemq-console-5.9.0.jar new file mode 100644 index 000000000..6be9a1357 Binary files /dev/null and b/uk.ac.diamond.org.apache.activemq/jars/activemq-console-5.9.0.jar differ diff --git a/uk.ac.diamond.org.apache.activemq/jars/activemq-http-5.9.0.jar b/uk.ac.diamond.org.apache.activemq/jars/activemq-http-5.9.0.jar new file mode 100644 index 000000000..2a7e6224b Binary files /dev/null and b/uk.ac.diamond.org.apache.activemq/jars/activemq-http-5.9.0.jar differ diff --git a/uk.ac.diamond.org.apache.activemq/jars/activemq-jdbc-store-5.9.0.jar b/uk.ac.diamond.org.apache.activemq/jars/activemq-jdbc-store-5.9.0.jar new file mode 100644 index 000000000..3d51c35a8 Binary files /dev/null and b/uk.ac.diamond.org.apache.activemq/jars/activemq-jdbc-store-5.9.0.jar differ diff --git a/uk.ac.diamond.org.apache.activemq/jars/activemq-kahadb-store-5.9.0.jar b/uk.ac.diamond.org.apache.activemq/jars/activemq-kahadb-store-5.9.0.jar new file mode 100644 index 000000000..63906671f Binary files /dev/null and b/uk.ac.diamond.org.apache.activemq/jars/activemq-kahadb-store-5.9.0.jar differ diff --git a/uk.ac.diamond.org.apache.activemq/jars/activemq-leveldb-store-5.9.0.jar b/uk.ac.diamond.org.apache.activemq/jars/activemq-leveldb-store-5.9.0.jar new file mode 100644 index 000000000..6fb28ff11 Binary files /dev/null and b/uk.ac.diamond.org.apache.activemq/jars/activemq-leveldb-store-5.9.0.jar differ diff --git a/uk.ac.diamond.org.apache.activemq/jars/activemq-mqtt-5.9.0.jar b/uk.ac.diamond.org.apache.activemq/jars/activemq-mqtt-5.9.0.jar new file mode 100644 index 000000000..df96177cf Binary files /dev/null and b/uk.ac.diamond.org.apache.activemq/jars/activemq-mqtt-5.9.0.jar differ diff --git a/uk.ac.diamond.org.apache.activemq/jars/activemq-openwire-legacy-5.9.0.jar b/uk.ac.diamond.org.apache.activemq/jars/activemq-openwire-legacy-5.9.0.jar new file mode 100644 index 000000000..db9724fbb Binary files /dev/null and b/uk.ac.diamond.org.apache.activemq/jars/activemq-openwire-legacy-5.9.0.jar differ diff --git a/uk.ac.diamond.org.apache.activemq/jars/activemq-protobuf-1.1.jar b/uk.ac.diamond.org.apache.activemq/jars/activemq-protobuf-1.1.jar new file mode 100644 index 000000000..f533201fd Binary files /dev/null and b/uk.ac.diamond.org.apache.activemq/jars/activemq-protobuf-1.1.jar differ diff --git a/uk.ac.diamond.org.apache.activemq/jars/activemq-spring-5.9.0.jar b/uk.ac.diamond.org.apache.activemq/jars/activemq-spring-5.9.0.jar new file mode 100644 index 000000000..5e8c0dac7 Binary files /dev/null and b/uk.ac.diamond.org.apache.activemq/jars/activemq-spring-5.9.0.jar differ diff --git a/uk.ac.diamond.org.apache.activemq/jars/activemq-stomp-5.9.0.jar b/uk.ac.diamond.org.apache.activemq/jars/activemq-stomp-5.9.0.jar new file mode 100644 index 000000000..49547bbdd Binary files /dev/null and b/uk.ac.diamond.org.apache.activemq/jars/activemq-stomp-5.9.0.jar differ diff --git a/uk.ac.diamond.org.apache.activemq/jars/geronimo-j2ee-management_1.1_spec-1.0.1.jar b/uk.ac.diamond.org.apache.activemq/jars/geronimo-j2ee-management_1.1_spec-1.0.1.jar new file mode 100644 index 000000000..0701ae034 Binary files /dev/null and b/uk.ac.diamond.org.apache.activemq/jars/geronimo-j2ee-management_1.1_spec-1.0.1.jar differ diff --git a/uk.ac.diamond.org.apache.activemq/jars/geronimo-jms_1.1_spec-1.1.1.jar b/uk.ac.diamond.org.apache.activemq/jars/geronimo-jms_1.1_spec-1.1.1.jar new file mode 100644 index 000000000..4f5e64643 Binary files /dev/null and b/uk.ac.diamond.org.apache.activemq/jars/geronimo-jms_1.1_spec-1.1.1.jar differ diff --git a/uk.ac.diamond.org.apache.activemq/jars/geronimo-jta_1.0.1B_spec-1.0.1.jar b/uk.ac.diamond.org.apache.activemq/jars/geronimo-jta_1.0.1B_spec-1.0.1.jar new file mode 100644 index 000000000..73354bef6 Binary files /dev/null and b/uk.ac.diamond.org.apache.activemq/jars/geronimo-jta_1.0.1B_spec-1.0.1.jar differ diff --git a/uk.ac.diamond.org.apache.activemq/jars/hawtbuf-1.9.jar b/uk.ac.diamond.org.apache.activemq/jars/hawtbuf-1.9.jar new file mode 100644 index 000000000..806ee5f89 Binary files /dev/null and b/uk.ac.diamond.org.apache.activemq/jars/hawtbuf-1.9.jar differ diff --git a/uk.ac.diamond.org.apache.activemq/jars/jasypt-1.9.1.jar b/uk.ac.diamond.org.apache.activemq/jars/jasypt-1.9.1.jar new file mode 100644 index 000000000..a72721cdb Binary files /dev/null and b/uk.ac.diamond.org.apache.activemq/jars/jasypt-1.9.1.jar differ diff --git a/uk.ac.diamond.org.apache.activemq/jars/log4j-1.2.17.jar b/uk.ac.diamond.org.apache.activemq/jars/log4j-1.2.17.jar new file mode 100644 index 000000000..1d425cf7d Binary files /dev/null and b/uk.ac.diamond.org.apache.activemq/jars/log4j-1.2.17.jar differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/annotation/Generated.class b/uk.ac.diamond.org.apache.activemq/javax/annotation/Generated.class deleted file mode 100644 index 7fd3dedb1..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/annotation/Generated.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/annotation/Generated.java b/uk.ac.diamond.org.apache.activemq/javax/annotation/Generated.java deleted file mode 100644 index 2462feb13..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/annotation/Generated.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// -package javax.annotation; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * @version $Rev: 489255 $ $Date: 2006-12-21 04:20:05 +0100 (Thu, 21 Dec 2006) $ - */ -@Target({ - ElementType.PACKAGE, - ElementType.TYPE, - ElementType.ANNOTATION_TYPE, - ElementType.METHOD, - ElementType.CONSTRUCTOR, - ElementType.FIELD, - ElementType.LOCAL_VARIABLE, - ElementType.PARAMETER - }) - -@Retention(RetentionPolicy.SOURCE) -@Documented -public @interface Generated { - String[] value(); - - String date() default ""; - - String comments() default ""; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/annotation/PostConstruct.class b/uk.ac.diamond.org.apache.activemq/javax/annotation/PostConstruct.class deleted file mode 100644 index 8a09cf283..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/annotation/PostConstruct.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/annotation/PostConstruct.java b/uk.ac.diamond.org.apache.activemq/javax/annotation/PostConstruct.java deleted file mode 100644 index 07bbe0103..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/annotation/PostConstruct.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// -package javax.annotation; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import java.lang.annotation.ElementType; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Documented; - -/** - * @version $Rev: 489255 $ $Date: 2006-12-21 04:20:05 +0100 (Thu, 21 Dec 2006) $ - */ -@Documented -@Target({ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface PostConstruct { -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/annotation/PreDestroy.class b/uk.ac.diamond.org.apache.activemq/javax/annotation/PreDestroy.class deleted file mode 100644 index 5242ef520..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/annotation/PreDestroy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/annotation/PreDestroy.java b/uk.ac.diamond.org.apache.activemq/javax/annotation/PreDestroy.java deleted file mode 100644 index a2f7bb3c2..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/annotation/PreDestroy.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// -package javax.annotation; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import java.lang.annotation.ElementType; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Documented; - -/** - * @version $Rev: 489255 $ $Date: 2006-12-21 04:20:05 +0100 (Thu, 21 Dec 2006) $ - */ -@Documented -@Target({ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface PreDestroy { -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/annotation/Resource$AuthenticationType.class b/uk.ac.diamond.org.apache.activemq/javax/annotation/Resource$AuthenticationType.class deleted file mode 100644 index baaf97850..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/annotation/Resource$AuthenticationType.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/annotation/Resource.class b/uk.ac.diamond.org.apache.activemq/javax/annotation/Resource.class deleted file mode 100644 index 48c5c6d2d..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/annotation/Resource.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/annotation/Resource.java b/uk.ac.diamond.org.apache.activemq/javax/annotation/Resource.java deleted file mode 100644 index e230bf666..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/annotation/Resource.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// -package javax.annotation; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import java.lang.annotation.ElementType; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Documented; - -/** - * @version $Rev: 489255 $ $Date: 2006-12-21 04:20:05 +0100 (Thu, 21 Dec 2006) $ - */ -@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface Resource { - public enum AuthenticationType { - CONTAINER, - APPLICATION - } - - String name() default ""; - - Class type() default Object.class; - - AuthenticationType authenticationType() - default AuthenticationType.CONTAINER; - - boolean shareable() default true; - - String mappedName() default ""; - - String description() default ""; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/annotation/Resources.class b/uk.ac.diamond.org.apache.activemq/javax/annotation/Resources.class deleted file mode 100644 index d75151ee7..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/annotation/Resources.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/annotation/Resources.java b/uk.ac.diamond.org.apache.activemq/javax/annotation/Resources.java deleted file mode 100644 index c2eb413d9..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/annotation/Resources.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// -package javax.annotation; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import java.lang.annotation.ElementType; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Documented; - -/** - * @version $Rev: 489255 $ $Date: 2006-12-21 04:20:05 +0100 (Thu, 21 Dec 2006) $ - */ -@Documented -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -public @interface Resources { - Resource[] value(); -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/annotation/security/DeclareRoles.class b/uk.ac.diamond.org.apache.activemq/javax/annotation/security/DeclareRoles.class deleted file mode 100644 index 669272e1d..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/annotation/security/DeclareRoles.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/annotation/security/DeclareRoles.java b/uk.ac.diamond.org.apache.activemq/javax/annotation/security/DeclareRoles.java deleted file mode 100644 index 8c190ffc9..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/annotation/security/DeclareRoles.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// -package javax.annotation.security; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import java.lang.annotation.ElementType; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Documented; - -/** - * @version $Rev: 513246 $ $Date: 2007-03-01 10:48:51 +0100 (Thu, 01 Mar 2007) $ - */ - -@Documented -@Target({ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) -public @interface DeclareRoles { - String[] value(); -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/annotation/security/DenyAll.class b/uk.ac.diamond.org.apache.activemq/javax/annotation/security/DenyAll.class deleted file mode 100644 index 8e49f0319..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/annotation/security/DenyAll.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/annotation/security/DenyAll.java b/uk.ac.diamond.org.apache.activemq/javax/annotation/security/DenyAll.java deleted file mode 100644 index c65d4093d..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/annotation/security/DenyAll.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// -package javax.annotation.security; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import java.lang.annotation.ElementType; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Documented; - -/** - * @version $Rev: 513246 $ $Date: 2007-03-01 10:48:51 +0100 (Thu, 01 Mar 2007) $ - */ - -@Documented -@Target(ElementType.METHOD) -@Retention(RetentionPolicy.RUNTIME) -public @interface DenyAll { -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/annotation/security/PermitAll.class b/uk.ac.diamond.org.apache.activemq/javax/annotation/security/PermitAll.class deleted file mode 100644 index 6cacab9b1..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/annotation/security/PermitAll.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/annotation/security/PermitAll.java b/uk.ac.diamond.org.apache.activemq/javax/annotation/security/PermitAll.java deleted file mode 100644 index 7480d1fa1..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/annotation/security/PermitAll.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// -package javax.annotation.security; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import java.lang.annotation.ElementType; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Documented; - -/** - * @version $Rev: 513246 $ $Date: 2007-03-01 10:48:51 +0100 (Thu, 01 Mar 2007) $ - */ - -@Documented -@Target({ElementType.TYPE, ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface PermitAll { -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/annotation/security/RolesAllowed.class b/uk.ac.diamond.org.apache.activemq/javax/annotation/security/RolesAllowed.class deleted file mode 100644 index f9dd33723..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/annotation/security/RolesAllowed.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/annotation/security/RolesAllowed.java b/uk.ac.diamond.org.apache.activemq/javax/annotation/security/RolesAllowed.java deleted file mode 100644 index e5d05af6e..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/annotation/security/RolesAllowed.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// -package javax.annotation.security; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import java.lang.annotation.ElementType; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Documented; - -/** - * @version $Rev: 513246 $ $Date: 2007-03-01 10:48:51 +0100 (Thu, 01 Mar 2007) $ - */ - -@Documented -@Target({ElementType.TYPE, ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface RolesAllowed { - String[] value(); -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/annotation/security/RunAs.class b/uk.ac.diamond.org.apache.activemq/javax/annotation/security/RunAs.class deleted file mode 100644 index 3a9288726..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/annotation/security/RunAs.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/annotation/security/RunAs.java b/uk.ac.diamond.org.apache.activemq/javax/annotation/security/RunAs.java deleted file mode 100644 index 9b96415ae..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/annotation/security/RunAs.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// -package javax.annotation.security; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import java.lang.annotation.ElementType; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Documented; - -/** - * @version $Rev: 513246 $ $Date: 2007-03-01 10:48:51 +0100 (Thu, 01 Mar 2007) $ - */ - -@Documented -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -public @interface RunAs { - String value(); -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/BytesMessage.class b/uk.ac.diamond.org.apache.activemq/javax/jms/BytesMessage.class deleted file mode 100644 index 75ce04396..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/BytesMessage.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/BytesMessage.java b/uk.ac.diamond.org.apache.activemq/javax/jms/BytesMessage.java deleted file mode 100644 index aa6dfe906..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/BytesMessage.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface BytesMessage extends Message { - long getBodyLength() throws JMSException; - - boolean readBoolean() throws JMSException; - - byte readByte() throws JMSException; - - int readUnsignedByte() throws JMSException; - - short readShort() throws JMSException; - - int readUnsignedShort() throws JMSException; - - char readChar() throws JMSException; - - int readInt() throws JMSException; - - long readLong() throws JMSException; - - float readFloat() throws JMSException; - - double readDouble() throws JMSException; - - String readUTF() throws JMSException; - - int readBytes(byte[] value) throws JMSException; - - int readBytes(byte[] value, int length) throws JMSException; - - void writeBoolean(boolean value) throws JMSException; - - void writeByte(byte value) throws JMSException; - - void writeShort(short value) throws JMSException; - - void writeChar(char value) throws JMSException; - - void writeInt(int value) throws JMSException; - - void writeLong(long value) throws JMSException; - - void writeFloat(float value) throws JMSException; - - void writeDouble(double value) throws JMSException; - - void writeUTF(String value) throws JMSException; - - void writeBytes(byte[] value) throws JMSException; - - void writeBytes(byte[] value, int offset, int length) throws JMSException; - - void writeObject(Object value) throws JMSException; - - void reset() throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/Connection.class b/uk.ac.diamond.org.apache.activemq/javax/jms/Connection.class deleted file mode 100644 index 038fca33a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/Connection.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/Connection.java b/uk.ac.diamond.org.apache.activemq/javax/jms/Connection.java deleted file mode 100644 index 64c6b9ad5..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/Connection.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface Connection { - Session createSession(boolean transacted, int acknowledgeMode) - throws JMSException; - - String getClientID() throws JMSException; - - void setClientID(String clientID) throws JMSException; - - ConnectionMetaData getMetaData() throws JMSException; - - ExceptionListener getExceptionListener() throws JMSException; - - void setExceptionListener(ExceptionListener listener) throws JMSException; - - void start() throws JMSException; - - void stop() throws JMSException; - - void close() throws JMSException; - - ConnectionConsumer createConnectionConsumer( - Destination destination, - String messageSelector, - ServerSessionPool sessionPool, - int maxMessages) - throws JMSException; - - ConnectionConsumer createDurableConnectionConsumer( - Topic topic, - String subscriptionName, - String messageSelector, - ServerSessionPool sessionPool, - int maxMessages) - throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/ConnectionConsumer.class b/uk.ac.diamond.org.apache.activemq/javax/jms/ConnectionConsumer.class deleted file mode 100644 index 67d4a6a03..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/ConnectionConsumer.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/ConnectionConsumer.java b/uk.ac.diamond.org.apache.activemq/javax/jms/ConnectionConsumer.java deleted file mode 100644 index 25333dfe8..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/ConnectionConsumer.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface ConnectionConsumer { - ServerSessionPool getServerSessionPool() throws JMSException; - - void close() throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/ConnectionFactory.class b/uk.ac.diamond.org.apache.activemq/javax/jms/ConnectionFactory.class deleted file mode 100644 index 9fbebd705..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/ConnectionFactory.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/ConnectionFactory.java b/uk.ac.diamond.org.apache.activemq/javax/jms/ConnectionFactory.java deleted file mode 100644 index f1b9b343e..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/ConnectionFactory.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface ConnectionFactory { - Connection createConnection() throws JMSException; - - Connection createConnection(String userName, String password) - throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/ConnectionMetaData.class b/uk.ac.diamond.org.apache.activemq/javax/jms/ConnectionMetaData.class deleted file mode 100644 index bd9cd4bed..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/ConnectionMetaData.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/ConnectionMetaData.java b/uk.ac.diamond.org.apache.activemq/javax/jms/ConnectionMetaData.java deleted file mode 100644 index d5932a4c0..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/ConnectionMetaData.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -import java.util.Enumeration; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface ConnectionMetaData { - - String getJMSVersion() throws JMSException; - - int getJMSMajorVersion() throws JMSException; - - int getJMSMinorVersion() throws JMSException; - - String getJMSProviderName() throws JMSException; - - String getProviderVersion() throws JMSException; - - int getProviderMajorVersion() throws JMSException; - - int getProviderMinorVersion() throws JMSException; - - Enumeration getJMSXPropertyNames() throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/DeliveryMode.class b/uk.ac.diamond.org.apache.activemq/javax/jms/DeliveryMode.class deleted file mode 100644 index d2e04d887..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/DeliveryMode.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/DeliveryMode.java b/uk.ac.diamond.org.apache.activemq/javax/jms/DeliveryMode.java deleted file mode 100644 index 490dff922..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/DeliveryMode.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface DeliveryMode { - static final int NON_PERSISTENT = 1; - - static final int PERSISTENT = 2; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/Destination.class b/uk.ac.diamond.org.apache.activemq/javax/jms/Destination.class deleted file mode 100644 index 38dc7d6c9..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/Destination.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/Destination.java b/uk.ac.diamond.org.apache.activemq/javax/jms/Destination.java deleted file mode 100644 index ce88359da..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/Destination.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface Destination { -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/ExceptionListener.class b/uk.ac.diamond.org.apache.activemq/javax/jms/ExceptionListener.class deleted file mode 100644 index 6fd0cc50d..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/ExceptionListener.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/ExceptionListener.java b/uk.ac.diamond.org.apache.activemq/javax/jms/ExceptionListener.java deleted file mode 100644 index fdc40d4f6..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/ExceptionListener.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface ExceptionListener { - void onException(JMSException exception); -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/IllegalStateException.class b/uk.ac.diamond.org.apache.activemq/javax/jms/IllegalStateException.class deleted file mode 100644 index e97f36498..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/IllegalStateException.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/IllegalStateException.java b/uk.ac.diamond.org.apache.activemq/javax/jms/IllegalStateException.java deleted file mode 100644 index 702e2e612..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/IllegalStateException.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public class IllegalStateException extends JMSException { - public IllegalStateException(String reason, String errorCode) { - super(reason, errorCode); - } - - public IllegalStateException(String reason) { - this(reason, null); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/InvalidClientIDException.class b/uk.ac.diamond.org.apache.activemq/javax/jms/InvalidClientIDException.class deleted file mode 100644 index 8d4130486..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/InvalidClientIDException.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/InvalidClientIDException.java b/uk.ac.diamond.org.apache.activemq/javax/jms/InvalidClientIDException.java deleted file mode 100644 index ca479b89f..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/InvalidClientIDException.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public class InvalidClientIDException extends JMSException { - public InvalidClientIDException(String reason, String errorCode) { - super(reason, errorCode); - } - - public InvalidClientIDException(String reason) { - this(reason, null); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/InvalidDestinationException.class b/uk.ac.diamond.org.apache.activemq/javax/jms/InvalidDestinationException.class deleted file mode 100644 index f03da34a8..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/InvalidDestinationException.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/InvalidDestinationException.java b/uk.ac.diamond.org.apache.activemq/javax/jms/InvalidDestinationException.java deleted file mode 100644 index fdd555e21..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/InvalidDestinationException.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public class InvalidDestinationException extends JMSException { - public InvalidDestinationException(String reason, String errorCode) { - super(reason, errorCode); - } - - public InvalidDestinationException(String reason) { - this(reason, null); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/InvalidSelectorException.class b/uk.ac.diamond.org.apache.activemq/javax/jms/InvalidSelectorException.class deleted file mode 100644 index 11543fc85..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/InvalidSelectorException.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/InvalidSelectorException.java b/uk.ac.diamond.org.apache.activemq/javax/jms/InvalidSelectorException.java deleted file mode 100644 index 33a83e47d..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/InvalidSelectorException.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public class InvalidSelectorException extends JMSException { - public InvalidSelectorException(String reason, String errorCode) { - super(reason, errorCode); - } - - public InvalidSelectorException(String reason) { - this(reason, null); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/JMSException.class b/uk.ac.diamond.org.apache.activemq/javax/jms/JMSException.class deleted file mode 100644 index d5094de70..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/JMSException.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/JMSException.java b/uk.ac.diamond.org.apache.activemq/javax/jms/JMSException.java deleted file mode 100644 index 31d13099a..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/JMSException.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public class JMSException extends Exception { - private String errorCode; - - private Exception linkedException; - - public JMSException(String reason, String errorCode) { - super(reason); - this.errorCode = errorCode; - linkedException = null; - } - - public JMSException(String reason) { - this(reason, null); - linkedException = null; - } - - public String getErrorCode() { - return errorCode; - } - - public Exception getLinkedException() { - return linkedException; - } - - /* - * Although not specified in the JavaDoc, this method need to be - * declared synchronized to make the serialUID the same as for - * the RI. However, given that the setter is not synchronized - * this may be problematic on some platforms. - */ - public synchronized void setLinkedException(Exception ex) { - linkedException = ex; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/JMSSecurityException.class b/uk.ac.diamond.org.apache.activemq/javax/jms/JMSSecurityException.class deleted file mode 100644 index 9e1969b75..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/JMSSecurityException.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/JMSSecurityException.java b/uk.ac.diamond.org.apache.activemq/javax/jms/JMSSecurityException.java deleted file mode 100644 index 6d02defde..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/JMSSecurityException.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public class JMSSecurityException extends JMSException { - public JMSSecurityException(String reason, String errorCode) { - super(reason, errorCode); - } - - public JMSSecurityException(String reason) { - this(reason, null); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/MapMessage.class b/uk.ac.diamond.org.apache.activemq/javax/jms/MapMessage.class deleted file mode 100644 index 4ce394787..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/MapMessage.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/MapMessage.java b/uk.ac.diamond.org.apache.activemq/javax/jms/MapMessage.java deleted file mode 100644 index ed4719ca9..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/MapMessage.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -import java.util.Enumeration; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface MapMessage extends Message { - boolean getBoolean(String name) throws JMSException; - - byte getByte(String name) throws JMSException; - - short getShort(String name) throws JMSException; - - char getChar(String name) throws JMSException; - - int getInt(String name) throws JMSException; - - long getLong(String name) throws JMSException; - - float getFloat(String name) throws JMSException; - - double getDouble(String name) throws JMSException; - - String getString(String name) throws JMSException; - - byte[] getBytes(String name) throws JMSException; - - Object getObject(String name) throws JMSException; - - Enumeration getMapNames() throws JMSException; - - void setBoolean(String name, boolean value) throws JMSException; - - void setByte(String name, byte value) throws JMSException; - - void setShort(String name, short value) throws JMSException; - - void setChar(String name, char value) throws JMSException; - - void setInt(String name, int value) throws JMSException; - - void setLong(String name, long value) throws JMSException; - - void setFloat(String name, float value) throws JMSException; - - void setDouble(String name, double value) throws JMSException; - - void setString(String name, String value) throws JMSException; - - void setBytes(String name, byte[] value) throws JMSException; - - void setBytes(String name, byte[] value, int offset, int length) - throws JMSException; - - void setObject(String name, Object value) throws JMSException; - - boolean itemExists(String name) throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/Message.class b/uk.ac.diamond.org.apache.activemq/javax/jms/Message.class deleted file mode 100644 index 4ffb9c596..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/Message.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/Message.java b/uk.ac.diamond.org.apache.activemq/javax/jms/Message.java deleted file mode 100644 index 9c773d9b0..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/Message.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -import java.util.Enumeration; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface Message { - - static final int DEFAULT_DELIVERY_MODE = DeliveryMode.PERSISTENT; - - static final int DEFAULT_PRIORITY = 4; - - static final long DEFAULT_TIME_TO_LIVE = 0; - - String getJMSMessageID() throws JMSException; - - void setJMSMessageID(String id) throws JMSException; - - long getJMSTimestamp() throws JMSException; - - void setJMSTimestamp(long timestamp) throws JMSException; - - byte[] getJMSCorrelationIDAsBytes() throws JMSException; - - void setJMSCorrelationIDAsBytes(byte[] correlationID) throws JMSException; - - void setJMSCorrelationID(String correlationID) throws JMSException; - - String getJMSCorrelationID() throws JMSException; - - Destination getJMSReplyTo() throws JMSException; - - void setJMSReplyTo(Destination replyTo) throws JMSException; - - Destination getJMSDestination() throws JMSException; - - void setJMSDestination(Destination destination) throws JMSException; - - int getJMSDeliveryMode() throws JMSException; - - void setJMSDeliveryMode(int deliveryMode) throws JMSException; - - boolean getJMSRedelivered() throws JMSException; - - void setJMSRedelivered(boolean redelivered) throws JMSException; - - String getJMSType() throws JMSException; - - void setJMSType(String type) throws JMSException; - - long getJMSExpiration() throws JMSException; - - void setJMSExpiration(long expiration) throws JMSException; - - int getJMSPriority() throws JMSException; - - void setJMSPriority(int priority) throws JMSException; - - void clearProperties() throws JMSException; - - boolean propertyExists(String name) throws JMSException; - - boolean getBooleanProperty(String name) throws JMSException; - - byte getByteProperty(String name) throws JMSException; - - short getShortProperty(String name) throws JMSException; - - int getIntProperty(String name) throws JMSException; - - long getLongProperty(String name) throws JMSException; - - float getFloatProperty(String name) throws JMSException; - - double getDoubleProperty(String name) throws JMSException; - - String getStringProperty(String name) throws JMSException; - - Object getObjectProperty(String name) throws JMSException; - - Enumeration getPropertyNames() throws JMSException; - - void setBooleanProperty(String name, boolean value) throws JMSException; - - void setByteProperty(String name, byte value) throws JMSException; - - void setShortProperty(String name, short value) throws JMSException; - - void setIntProperty(String name, int value) throws JMSException; - - void setLongProperty(String name, long value) throws JMSException; - - void setFloatProperty(String name, float value) throws JMSException; - - void setDoubleProperty(String name, double value) throws JMSException; - - void setStringProperty(String name, String value) throws JMSException; - - void setObjectProperty(String name, Object value) throws JMSException; - - void acknowledge() throws JMSException; - - void clearBody() throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/MessageConsumer.class b/uk.ac.diamond.org.apache.activemq/javax/jms/MessageConsumer.class deleted file mode 100644 index be39e1268..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/MessageConsumer.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/MessageConsumer.java b/uk.ac.diamond.org.apache.activemq/javax/jms/MessageConsumer.java deleted file mode 100644 index bde6730ee..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/MessageConsumer.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface MessageConsumer { - String getMessageSelector() throws JMSException; - - MessageListener getMessageListener() throws JMSException; - - void setMessageListener(MessageListener listener) throws JMSException; - - Message receive() throws JMSException; - - Message receive(long timeout) throws JMSException; - - Message receiveNoWait() throws JMSException; - - void close() throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/MessageEOFException.class b/uk.ac.diamond.org.apache.activemq/javax/jms/MessageEOFException.class deleted file mode 100644 index a92bda957..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/MessageEOFException.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/MessageEOFException.java b/uk.ac.diamond.org.apache.activemq/javax/jms/MessageEOFException.java deleted file mode 100644 index 07000353c..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/MessageEOFException.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public class MessageEOFException extends JMSException { - public MessageEOFException(String reason, String errorCode) { - super(reason, errorCode); - } - - public MessageEOFException(String reason) { - this(reason, null); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/MessageFormatException.class b/uk.ac.diamond.org.apache.activemq/javax/jms/MessageFormatException.class deleted file mode 100644 index a59c74913..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/MessageFormatException.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/MessageFormatException.java b/uk.ac.diamond.org.apache.activemq/javax/jms/MessageFormatException.java deleted file mode 100644 index 9b8d8472e..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/MessageFormatException.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public class MessageFormatException extends JMSException { - public MessageFormatException(String reason, String errorCode) { - super(reason, errorCode); - } - - public MessageFormatException(String reason) { - this(reason, null); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/MessageListener.class b/uk.ac.diamond.org.apache.activemq/javax/jms/MessageListener.class deleted file mode 100644 index 0fce3acee..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/MessageListener.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/MessageListener.java b/uk.ac.diamond.org.apache.activemq/javax/jms/MessageListener.java deleted file mode 100644 index 27a3258b3..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/MessageListener.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface MessageListener { - void onMessage(Message message); -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/MessageNotReadableException.class b/uk.ac.diamond.org.apache.activemq/javax/jms/MessageNotReadableException.class deleted file mode 100644 index 22c543781..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/MessageNotReadableException.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/MessageNotReadableException.java b/uk.ac.diamond.org.apache.activemq/javax/jms/MessageNotReadableException.java deleted file mode 100644 index bbd344e68..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/MessageNotReadableException.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public class MessageNotReadableException extends JMSException { - public MessageNotReadableException(String reason, String errorCode) { - super(reason, errorCode); - } - - public MessageNotReadableException(String reason) { - this(reason, null); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/MessageNotWriteableException.class b/uk.ac.diamond.org.apache.activemq/javax/jms/MessageNotWriteableException.class deleted file mode 100644 index bdd35d4bc..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/MessageNotWriteableException.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/MessageNotWriteableException.java b/uk.ac.diamond.org.apache.activemq/javax/jms/MessageNotWriteableException.java deleted file mode 100644 index fd2fc5b36..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/MessageNotWriteableException.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public class MessageNotWriteableException extends JMSException { - public MessageNotWriteableException(String reason, String errorCode) { - super(reason, errorCode); - } - - public MessageNotWriteableException(String reason) { - this(reason, null); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/MessageProducer.class b/uk.ac.diamond.org.apache.activemq/javax/jms/MessageProducer.class deleted file mode 100644 index d86f1e723..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/MessageProducer.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/MessageProducer.java b/uk.ac.diamond.org.apache.activemq/javax/jms/MessageProducer.java deleted file mode 100644 index c044c2651..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/MessageProducer.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface MessageProducer { - void setDisableMessageID(boolean value) throws JMSException; - - boolean getDisableMessageID() throws JMSException; - - void setDisableMessageTimestamp(boolean value) throws JMSException; - - boolean getDisableMessageTimestamp() throws JMSException; - - void setDeliveryMode(int deliveryMode) throws JMSException; - - int getDeliveryMode() throws JMSException; - - void setPriority(int defaultPriority) throws JMSException; - - int getPriority() throws JMSException; - - void setTimeToLive(long timeToLive) throws JMSException; - - long getTimeToLive() throws JMSException; - - Destination getDestination() throws JMSException; - - void close() throws JMSException; - - void send(Message message) throws JMSException; - - void send(Message message, int deliveryMode, int priority, long timeToLive) - throws JMSException; - - void send(Destination destination, Message message) throws JMSException; - - void send( - Destination destination, - Message message, - int deliveryMode, - int priority, - long timeToLive) - throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/ObjectMessage.class b/uk.ac.diamond.org.apache.activemq/javax/jms/ObjectMessage.class deleted file mode 100644 index 2a660f9eb..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/ObjectMessage.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/ObjectMessage.java b/uk.ac.diamond.org.apache.activemq/javax/jms/ObjectMessage.java deleted file mode 100644 index aab018501..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/ObjectMessage.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -import java.io.Serializable; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface ObjectMessage extends Message { - void setObject(Serializable object) throws JMSException; - - Serializable getObject() throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/Queue.class b/uk.ac.diamond.org.apache.activemq/javax/jms/Queue.class deleted file mode 100644 index 8932991b0..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/Queue.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/Queue.java b/uk.ac.diamond.org.apache.activemq/javax/jms/Queue.java deleted file mode 100644 index 6356635e0..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/Queue.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface Queue extends Destination { - String getQueueName() throws JMSException; - - String toString(); -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/QueueBrowser.class b/uk.ac.diamond.org.apache.activemq/javax/jms/QueueBrowser.class deleted file mode 100644 index d220be48a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/QueueBrowser.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/QueueBrowser.java b/uk.ac.diamond.org.apache.activemq/javax/jms/QueueBrowser.java deleted file mode 100644 index 81eeff56f..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/QueueBrowser.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -import java.util.Enumeration; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface QueueBrowser { - Queue getQueue() throws JMSException; - - String getMessageSelector() throws JMSException; - - Enumeration getEnumeration() throws JMSException; - - void close() throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/QueueConnection.class b/uk.ac.diamond.org.apache.activemq/javax/jms/QueueConnection.class deleted file mode 100644 index 37e173a7d..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/QueueConnection.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/QueueConnection.java b/uk.ac.diamond.org.apache.activemq/javax/jms/QueueConnection.java deleted file mode 100644 index a64edd42f..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/QueueConnection.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface QueueConnection extends Connection { - QueueSession createQueueSession(boolean transacted, int acknowledgeMode) - throws JMSException; - - ConnectionConsumer createConnectionConsumer( - Queue queue, - String messageSelector, - ServerSessionPool sessionPool, - int maxMessages) - throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/QueueConnectionFactory.class b/uk.ac.diamond.org.apache.activemq/javax/jms/QueueConnectionFactory.class deleted file mode 100644 index 9f6f05f7f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/QueueConnectionFactory.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/QueueConnectionFactory.java b/uk.ac.diamond.org.apache.activemq/javax/jms/QueueConnectionFactory.java deleted file mode 100644 index 354c9a1b7..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/QueueConnectionFactory.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface QueueConnectionFactory extends ConnectionFactory { - QueueConnection createQueueConnection() throws JMSException; - - QueueConnection createQueueConnection(String userName, String password) - throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/QueueReceiver.class b/uk.ac.diamond.org.apache.activemq/javax/jms/QueueReceiver.class deleted file mode 100644 index 67b7cefc4..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/QueueReceiver.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/QueueReceiver.java b/uk.ac.diamond.org.apache.activemq/javax/jms/QueueReceiver.java deleted file mode 100644 index 5fb12bf10..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/QueueReceiver.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface QueueReceiver extends MessageConsumer { - Queue getQueue() throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/QueueRequestor.class b/uk.ac.diamond.org.apache.activemq/javax/jms/QueueRequestor.class deleted file mode 100644 index 8ec2c3c48..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/QueueRequestor.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/QueueRequestor.java b/uk.ac.diamond.org.apache.activemq/javax/jms/QueueRequestor.java deleted file mode 100644 index cdfae80d2..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/QueueRequestor.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public class QueueRequestor { - private QueueSession session; - private TemporaryQueue temporaryQueue; - private QueueSender sender; - private QueueReceiver receiver; - - public QueueRequestor(QueueSession session, Queue queue) - throws JMSException - { - super(); - - if(queue == null) { - throw new InvalidDestinationException("Invalid queue"); - } - - setSession(session); - setTemporaryQueue(session.createTemporaryQueue()); - setSender(session.createSender(queue)); - setReceiver(session.createReceiver(getTemporaryQueue())); - } - - public Message request(Message message) throws JMSException { - message.setJMSReplyTo(getTemporaryQueue()); - getSender().send(message); - return getReceiver().receive(); - } - - public void close() throws JMSException { - getSession().close(); - getTemporaryQueue().delete(); - } - - private void setReceiver(QueueReceiver receiver) { - this.receiver = receiver; - } - - private QueueReceiver getReceiver() { - return receiver; - } - - private void setSender(QueueSender sender) { - this.sender = sender; - } - - private QueueSender getSender() { - return sender; - } - - private void setSession(QueueSession session) { - this.session = session; - } - - private QueueSession getSession() { - return session; - } - - private void setTemporaryQueue(TemporaryQueue temporaryQueue) { - this.temporaryQueue = temporaryQueue; - } - - private TemporaryQueue getTemporaryQueue() { - return temporaryQueue; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/QueueSender.class b/uk.ac.diamond.org.apache.activemq/javax/jms/QueueSender.class deleted file mode 100644 index aba58f109..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/QueueSender.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/QueueSender.java b/uk.ac.diamond.org.apache.activemq/javax/jms/QueueSender.java deleted file mode 100644 index 1a55fe0e3..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/QueueSender.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface QueueSender extends MessageProducer { - Queue getQueue() throws JMSException; - - void send(Message message) throws JMSException; - - void send(Message message, int deliveryMode, int priority, long timeToLive) - throws JMSException; - - void send(Queue queue, Message message) throws JMSException; - - void send( - Queue queue, - Message message, - int deliveryMode, - int priority, - long timeToLive) - throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/QueueSession.class b/uk.ac.diamond.org.apache.activemq/javax/jms/QueueSession.class deleted file mode 100644 index 3c2f9ea60..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/QueueSession.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/QueueSession.java b/uk.ac.diamond.org.apache.activemq/javax/jms/QueueSession.java deleted file mode 100644 index 2430b010e..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/QueueSession.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface QueueSession extends Session { - Queue createQueue(String queueName) throws JMSException; - - QueueReceiver createReceiver(Queue queue) throws JMSException; - - QueueReceiver createReceiver(Queue queue, String messageSelector) - throws JMSException; - - QueueSender createSender(Queue queue) throws JMSException; - - QueueBrowser createBrowser(Queue queue) throws JMSException; - - QueueBrowser createBrowser(Queue queue, String messageSelector) - throws JMSException; - - TemporaryQueue createTemporaryQueue() throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/ResourceAllocationException.class b/uk.ac.diamond.org.apache.activemq/javax/jms/ResourceAllocationException.class deleted file mode 100644 index 138e36e47..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/ResourceAllocationException.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/ResourceAllocationException.java b/uk.ac.diamond.org.apache.activemq/javax/jms/ResourceAllocationException.java deleted file mode 100644 index 22f620a6e..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/ResourceAllocationException.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public class ResourceAllocationException extends JMSException { - public ResourceAllocationException(String reason, String errorCode) { - super(reason, errorCode); - } - - public ResourceAllocationException(String reason) { - this(reason, null); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/ServerSession.class b/uk.ac.diamond.org.apache.activemq/javax/jms/ServerSession.class deleted file mode 100644 index 31951c650..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/ServerSession.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/ServerSession.java b/uk.ac.diamond.org.apache.activemq/javax/jms/ServerSession.java deleted file mode 100644 index 4b2b82301..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/ServerSession.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface ServerSession { - Session getSession() throws JMSException; - - void start() throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/ServerSessionPool.class b/uk.ac.diamond.org.apache.activemq/javax/jms/ServerSessionPool.class deleted file mode 100644 index 72eff0f3f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/ServerSessionPool.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/ServerSessionPool.java b/uk.ac.diamond.org.apache.activemq/javax/jms/ServerSessionPool.java deleted file mode 100644 index 970e1308b..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/ServerSessionPool.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface ServerSessionPool { - ServerSession getServerSession() throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/Session.class b/uk.ac.diamond.org.apache.activemq/javax/jms/Session.class deleted file mode 100644 index 1667487d6..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/Session.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/Session.java b/uk.ac.diamond.org.apache.activemq/javax/jms/Session.java deleted file mode 100644 index d3078a9c6..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/Session.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -import java.io.Serializable; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface Session extends Runnable { - static final int AUTO_ACKNOWLEDGE = 1; - - static final int CLIENT_ACKNOWLEDGE = 2; - - static final int DUPS_OK_ACKNOWLEDGE = 3; - - static final int SESSION_TRANSACTED = 0; - - BytesMessage createBytesMessage() throws JMSException; - - MapMessage createMapMessage() throws JMSException; - - Message createMessage() throws JMSException; - - ObjectMessage createObjectMessage() throws JMSException; - - ObjectMessage createObjectMessage(Serializable object) throws JMSException; - - StreamMessage createStreamMessage() throws JMSException; - - TextMessage createTextMessage() throws JMSException; - - TextMessage createTextMessage(String text) throws JMSException; - - boolean getTransacted() throws JMSException; - - int getAcknowledgeMode() throws JMSException; - - void commit() throws JMSException; - - void rollback() throws JMSException; - - void close() throws JMSException; - - void recover() throws JMSException; - - MessageListener getMessageListener() throws JMSException; - - void setMessageListener(MessageListener listener) throws JMSException; - - public void run(); - - MessageProducer createProducer(Destination destination) - throws JMSException; - - MessageConsumer createConsumer(Destination destination) - throws JMSException; - - MessageConsumer createConsumer( - Destination destination, - java.lang.String messageSelector) - throws JMSException; - - MessageConsumer createConsumer( - Destination destination, - java.lang.String messageSelector, - boolean NoLocal) - throws JMSException; - - Queue createQueue(String queueName) throws JMSException; - - Topic createTopic(String topicName) throws JMSException; - - TopicSubscriber createDurableSubscriber(Topic topic, String name) - throws JMSException; - - TopicSubscriber createDurableSubscriber( - Topic topic, - String name, - String messageSelector, - boolean noLocal) - throws JMSException; - - QueueBrowser createBrowser(Queue queue) throws JMSException; - - QueueBrowser createBrowser(Queue queue, String messageSelector) - throws JMSException; - - TemporaryQueue createTemporaryQueue() throws JMSException; - - TemporaryTopic createTemporaryTopic() throws JMSException; - - void unsubscribe(String name) throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/StreamMessage.class b/uk.ac.diamond.org.apache.activemq/javax/jms/StreamMessage.class deleted file mode 100644 index a3f770e23..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/StreamMessage.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/StreamMessage.java b/uk.ac.diamond.org.apache.activemq/javax/jms/StreamMessage.java deleted file mode 100644 index a58d0aa57..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/StreamMessage.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface StreamMessage extends Message { - boolean readBoolean() throws JMSException; - - byte readByte() throws JMSException; - - short readShort() throws JMSException; - - char readChar() throws JMSException; - - int readInt() throws JMSException; - - long readLong() throws JMSException; - - float readFloat() throws JMSException; - - double readDouble() throws JMSException; - - String readString() throws JMSException; - - int readBytes(byte[] value) throws JMSException; - - Object readObject() throws JMSException; - - void writeBoolean(boolean value) throws JMSException; - - void writeByte(byte value) throws JMSException; - - void writeShort(short value) throws JMSException; - - void writeChar(char value) throws JMSException; - - void writeInt(int value) throws JMSException; - - void writeLong(long value) throws JMSException; - - void writeFloat(float value) throws JMSException; - - void writeDouble(double value) throws JMSException; - - void writeString(String value) throws JMSException; - - void writeBytes(byte[] value) throws JMSException; - - void writeBytes(byte[] value, int offset, int length) throws JMSException; - - void writeObject(Object value) throws JMSException; - - void reset() throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/TemporaryQueue.class b/uk.ac.diamond.org.apache.activemq/javax/jms/TemporaryQueue.class deleted file mode 100644 index 95ac3d3cc..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/TemporaryQueue.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/TemporaryQueue.java b/uk.ac.diamond.org.apache.activemq/javax/jms/TemporaryQueue.java deleted file mode 100644 index c4479509a..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/TemporaryQueue.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface TemporaryQueue extends Queue { - void delete() throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/TemporaryTopic.class b/uk.ac.diamond.org.apache.activemq/javax/jms/TemporaryTopic.class deleted file mode 100644 index d5e69b8ea..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/TemporaryTopic.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/TemporaryTopic.java b/uk.ac.diamond.org.apache.activemq/javax/jms/TemporaryTopic.java deleted file mode 100644 index 152f8d283..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/TemporaryTopic.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface TemporaryTopic extends Topic { - void delete() throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/TextMessage.class b/uk.ac.diamond.org.apache.activemq/javax/jms/TextMessage.class deleted file mode 100644 index 46bef01df..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/TextMessage.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/TextMessage.java b/uk.ac.diamond.org.apache.activemq/javax/jms/TextMessage.java deleted file mode 100644 index a4e69d04e..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/TextMessage.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface TextMessage extends Message { - void setText(String string) throws JMSException; - - String getText() throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/Topic.class b/uk.ac.diamond.org.apache.activemq/javax/jms/Topic.class deleted file mode 100644 index de17dd458..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/Topic.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/Topic.java b/uk.ac.diamond.org.apache.activemq/javax/jms/Topic.java deleted file mode 100644 index fb24b4908..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/Topic.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface Topic extends Destination { - String getTopicName() throws JMSException; - - String toString(); -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/TopicConnection.class b/uk.ac.diamond.org.apache.activemq/javax/jms/TopicConnection.class deleted file mode 100644 index 49de67242..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/TopicConnection.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/TopicConnection.java b/uk.ac.diamond.org.apache.activemq/javax/jms/TopicConnection.java deleted file mode 100644 index fcfcceb69..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/TopicConnection.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface TopicConnection extends Connection { - TopicSession createTopicSession(boolean transacted, int acknowledgeMode) - throws JMSException; - - ConnectionConsumer createConnectionConsumer( - Topic topic, - String messageSelector, - ServerSessionPool sessionPool, - int maxMessages) - throws JMSException; - - ConnectionConsumer createDurableConnectionConsumer( - Topic topic, - String subscriptionName, - String messageSelector, - ServerSessionPool sessionPool, - int maxMessages) - throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/TopicConnectionFactory.class b/uk.ac.diamond.org.apache.activemq/javax/jms/TopicConnectionFactory.class deleted file mode 100644 index 6c0a8937d..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/TopicConnectionFactory.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/TopicConnectionFactory.java b/uk.ac.diamond.org.apache.activemq/javax/jms/TopicConnectionFactory.java deleted file mode 100644 index 98ffd531d..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/TopicConnectionFactory.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface TopicConnectionFactory extends ConnectionFactory { - TopicConnection createTopicConnection() throws JMSException; - - TopicConnection createTopicConnection(String userName, String password) - throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/TopicPublisher.class b/uk.ac.diamond.org.apache.activemq/javax/jms/TopicPublisher.class deleted file mode 100644 index 9dc245c87..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/TopicPublisher.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/TopicPublisher.java b/uk.ac.diamond.org.apache.activemq/javax/jms/TopicPublisher.java deleted file mode 100644 index a71536768..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/TopicPublisher.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -public interface TopicPublisher extends MessageProducer { - Topic getTopic() throws JMSException; - - void publish(Message message) throws JMSException; - - void publish( - Message message, - int deliveryMode, - int priority, - long timeToLive) - throws JMSException; - - void publish(Topic topic, Message message) throws JMSException; - - void publish( - Topic topic, - Message message, - int deliveryMode, - int priority, - long timeToLive) - throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/TopicRequestor.class b/uk.ac.diamond.org.apache.activemq/javax/jms/TopicRequestor.class deleted file mode 100644 index 90191c66c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/TopicRequestor.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/TopicRequestor.java b/uk.ac.diamond.org.apache.activemq/javax/jms/TopicRequestor.java deleted file mode 100644 index 86aa8606a..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/TopicRequestor.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public class TopicRequestor { - private TopicSession session; - private Topic topic; - private TemporaryTopic temporaryTopic; - private TopicPublisher publisher; - private TopicSubscriber subscriber; - - public TopicRequestor(TopicSession session, Topic topic) - throws JMSException { - super(); - setSession(session); - setTopic(topic); - setTemporaryTopic(session.createTemporaryTopic()); - setPublisher(session.createPublisher(topic)); - setSubscriber(session.createSubscriber(getTemporaryTopic())); - } - - public Message request(Message message) throws JMSException { - message.setJMSReplyTo(getTemporaryTopic()); - getPublisher().publish(message); - return (getSubscriber().receive()); - } - - public void close() throws JMSException { - getSession().close(); - getTemporaryTopic().delete(); - } - - private void setPublisher(TopicPublisher publisher) { - this.publisher = publisher; - } - - private TopicPublisher getPublisher() { - return publisher; - } - - private void setSession(TopicSession session) { - this.session = session; - } - - private TopicSession getSession() { - return session; - } - - private void setSubscriber(TopicSubscriber subscriber) { - this.subscriber = subscriber; - } - - private TopicSubscriber getSubscriber() { - return subscriber; - } - - private void setTemporaryTopic(TemporaryTopic temporaryTopic) { - this.temporaryTopic = temporaryTopic; - } - - private TemporaryTopic getTemporaryTopic() { - return temporaryTopic; - } - - private void setTopic(Topic topic) { - this.topic = topic; - } - - private Topic getTopic() { - return topic; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/TopicSession.class b/uk.ac.diamond.org.apache.activemq/javax/jms/TopicSession.class deleted file mode 100644 index fc846ca80..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/TopicSession.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/TopicSession.java b/uk.ac.diamond.org.apache.activemq/javax/jms/TopicSession.java deleted file mode 100644 index c8e07a3e1..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/TopicSession.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface TopicSession extends Session { - Topic createTopic(String topicName) throws JMSException; - - TopicSubscriber createSubscriber(Topic topic) throws JMSException; - - TopicSubscriber createSubscriber( - Topic topic, - String messageSelector, - boolean noLocal) - throws JMSException; - - TopicSubscriber createDurableSubscriber(Topic topic, String name) - throws JMSException; - - TopicSubscriber createDurableSubscriber( - Topic topic, - String name, - String messageSelector, - boolean noLocal) - throws JMSException; - - TopicPublisher createPublisher(Topic topic) throws JMSException; - - TemporaryTopic createTemporaryTopic() throws JMSException; - - void unsubscribe(String name) throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/TopicSubscriber.class b/uk.ac.diamond.org.apache.activemq/javax/jms/TopicSubscriber.class deleted file mode 100644 index 1a867bfd0..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/TopicSubscriber.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/TopicSubscriber.java b/uk.ac.diamond.org.apache.activemq/javax/jms/TopicSubscriber.java deleted file mode 100644 index 40db03a2e..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/TopicSubscriber.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface TopicSubscriber extends MessageConsumer { - Topic getTopic() throws JMSException; - - boolean getNoLocal() throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/TransactionInProgressException.class b/uk.ac.diamond.org.apache.activemq/javax/jms/TransactionInProgressException.class deleted file mode 100644 index f174306bd..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/TransactionInProgressException.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/TransactionInProgressException.java b/uk.ac.diamond.org.apache.activemq/javax/jms/TransactionInProgressException.java deleted file mode 100644 index 6ff3635ba..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/TransactionInProgressException.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public class TransactionInProgressException extends JMSException { - public TransactionInProgressException(String reason, String errorCode) { - super(reason, errorCode); - } - - public TransactionInProgressException(String reason) { - this(reason, null); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/TransactionRolledBackException.class b/uk.ac.diamond.org.apache.activemq/javax/jms/TransactionRolledBackException.class deleted file mode 100644 index 89a72a334..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/TransactionRolledBackException.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/TransactionRolledBackException.java b/uk.ac.diamond.org.apache.activemq/javax/jms/TransactionRolledBackException.java deleted file mode 100644 index 16e115de7..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/TransactionRolledBackException.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public class TransactionRolledBackException extends JMSException { - public TransactionRolledBackException(String reason, String errorCode) { - super(reason, errorCode); - } - - public TransactionRolledBackException(String reason) { - this(reason, null); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/XAConnection.class b/uk.ac.diamond.org.apache.activemq/javax/jms/XAConnection.class deleted file mode 100644 index f7fea6113..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/XAConnection.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/XAConnection.java b/uk.ac.diamond.org.apache.activemq/javax/jms/XAConnection.java deleted file mode 100644 index 945cf28ba..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/XAConnection.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface XAConnection extends Connection { - XASession createXASession() throws JMSException; - - Session createSession(boolean transacted, int acknowledgeMode) - throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/XAConnectionFactory.class b/uk.ac.diamond.org.apache.activemq/javax/jms/XAConnectionFactory.class deleted file mode 100644 index 329d1728f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/XAConnectionFactory.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/XAConnectionFactory.java b/uk.ac.diamond.org.apache.activemq/javax/jms/XAConnectionFactory.java deleted file mode 100644 index c3c5ef743..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/XAConnectionFactory.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface XAConnectionFactory { - XAConnection createXAConnection() throws JMSException; - - XAConnection createXAConnection(String userName, String password) - throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/XAQueueConnection.class b/uk.ac.diamond.org.apache.activemq/javax/jms/XAQueueConnection.class deleted file mode 100644 index fc9dc6424..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/XAQueueConnection.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/XAQueueConnection.java b/uk.ac.diamond.org.apache.activemq/javax/jms/XAQueueConnection.java deleted file mode 100644 index b4dd240a0..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/XAQueueConnection.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface XAQueueConnection extends XAConnection, QueueConnection { - XAQueueSession createXAQueueSession() throws JMSException; - - QueueSession createQueueSession(boolean transacted, int acknowledgeMode) - throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/XAQueueConnectionFactory.class b/uk.ac.diamond.org.apache.activemq/javax/jms/XAQueueConnectionFactory.class deleted file mode 100644 index 82fb1c14e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/XAQueueConnectionFactory.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/XAQueueConnectionFactory.java b/uk.ac.diamond.org.apache.activemq/javax/jms/XAQueueConnectionFactory.java deleted file mode 100644 index 4c03e16ef..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/XAQueueConnectionFactory.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface XAQueueConnectionFactory - extends XAConnectionFactory, QueueConnectionFactory { - XAQueueConnection createXAQueueConnection() throws JMSException; - - XAQueueConnection createXAQueueConnection(String userName, String password) - throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/XAQueueSession.class b/uk.ac.diamond.org.apache.activemq/javax/jms/XAQueueSession.class deleted file mode 100644 index bca9c347d..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/XAQueueSession.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/XAQueueSession.java b/uk.ac.diamond.org.apache.activemq/javax/jms/XAQueueSession.java deleted file mode 100644 index 1c7b852cb..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/XAQueueSession.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface XAQueueSession extends XASession { - QueueSession getQueueSession() throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/XASession.class b/uk.ac.diamond.org.apache.activemq/javax/jms/XASession.class deleted file mode 100644 index a3fe835f1..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/XASession.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/XASession.java b/uk.ac.diamond.org.apache.activemq/javax/jms/XASession.java deleted file mode 100644 index 39cb1e394..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/XASession.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -import javax.transaction.xa.XAResource; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface XASession extends Session { - Session getSession() throws JMSException; - - XAResource getXAResource(); - - boolean getTransacted() throws JMSException; - - void commit() throws JMSException; - - void rollback() throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/XATopicConnection.class b/uk.ac.diamond.org.apache.activemq/javax/jms/XATopicConnection.class deleted file mode 100644 index fd93624ed..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/XATopicConnection.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/XATopicConnection.java b/uk.ac.diamond.org.apache.activemq/javax/jms/XATopicConnection.java deleted file mode 100644 index ef413232c..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/XATopicConnection.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface XATopicConnection extends XAConnection, TopicConnection { - XATopicSession createXATopicSession() throws JMSException; - - TopicSession createTopicSession(boolean transacted, int acknowledgeMode) - throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/XATopicConnectionFactory.class b/uk.ac.diamond.org.apache.activemq/javax/jms/XATopicConnectionFactory.class deleted file mode 100644 index 2af60f221..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/XATopicConnectionFactory.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/XATopicConnectionFactory.java b/uk.ac.diamond.org.apache.activemq/javax/jms/XATopicConnectionFactory.java deleted file mode 100644 index 80dc8b579..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/XATopicConnectionFactory.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface XATopicConnectionFactory - extends XAConnectionFactory, TopicConnectionFactory { - XATopicConnection createXATopicConnection() throws JMSException; - - XATopicConnection createXATopicConnection(String userName, String password) - throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/XATopicSession.class b/uk.ac.diamond.org.apache.activemq/javax/jms/XATopicSession.class deleted file mode 100644 index 9160dbaa8..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/jms/XATopicSession.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/jms/XATopicSession.java b/uk.ac.diamond.org.apache.activemq/javax/jms/XATopicSession.java deleted file mode 100644 index 68bed5442..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/jms/XATopicSession.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.jms; - -/** - * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $ - */ -public interface XATopicSession extends XASession { - TopicSession getTopicSession() throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/ListenerRegistration.class b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/ListenerRegistration.class deleted file mode 100644 index b0db0a547..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/ListenerRegistration.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/ListenerRegistration.java b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/ListenerRegistration.java deleted file mode 100644 index fe82902e1..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/ListenerRegistration.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.management.j2ee; - -import java.io.Serializable; -import java.rmi.RemoteException; -import javax.management.InstanceNotFoundException; -import javax.management.ListenerNotFoundException; -import javax.management.NotificationFilter; -import javax.management.NotificationListener; -import javax.management.ObjectName; - -/** - * @version $Rev: 467553 $ - */ -public interface ListenerRegistration extends Serializable { - public void addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException, RemoteException; - - public void removeNotificationListener(ObjectName name, NotificationListener listener) throws InstanceNotFoundException, ListenerNotFoundException, RemoteException; -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/Management.class b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/Management.class deleted file mode 100644 index a8de62c74..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/Management.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/Management.java b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/Management.java deleted file mode 100644 index bc41c92ef..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/Management.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.management.j2ee; - -import java.rmi.RemoteException; -import java.util.Set; -import javax.ejb.EJBObject; -import javax.management.Attribute; -import javax.management.AttributeList; -import javax.management.AttributeNotFoundException; -import javax.management.InstanceNotFoundException; -import javax.management.IntrospectionException; -import javax.management.InvalidAttributeValueException; -import javax.management.MBeanException; -import javax.management.MBeanInfo; -import javax.management.ObjectName; -import javax.management.QueryExp; -import javax.management.ReflectionException; - -/** - * @version $Rev: 467553 $ - */ -public interface Management extends EJBObject { - public Object getAttribute(ObjectName name, String attribute) throws MBeanException, AttributeNotFoundException, InstanceNotFoundException, ReflectionException, RemoteException; - - public AttributeList getAttributes(ObjectName name, String[] attributes) throws InstanceNotFoundException, ReflectionException, RemoteException; - - public String getDefaultDomain() throws RemoteException; - - public Integer getMBeanCount() throws RemoteException; - - public MBeanInfo getMBeanInfo(ObjectName name) throws IntrospectionException, InstanceNotFoundException, ReflectionException, RemoteException; - - public Object invoke(ObjectName name, String operationName, Object[] params, String[] signature) throws InstanceNotFoundException, MBeanException, ReflectionException, RemoteException; - - public boolean isRegistered(ObjectName name) throws RemoteException; - - public Set queryNames(ObjectName name, QueryExp query) throws RemoteException; - - public void setAttribute(ObjectName name, Attribute attribute) throws InstanceNotFoundException, AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException, RemoteException; - - public AttributeList setAttributes(ObjectName name, AttributeList attributes) throws InstanceNotFoundException, ReflectionException, RemoteException; - - public ListenerRegistration getListenerRegistry() throws RemoteException; -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/ManagementHome.class b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/ManagementHome.class deleted file mode 100644 index 37bc41672..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/ManagementHome.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/ManagementHome.java b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/ManagementHome.java deleted file mode 100644 index e69168c27..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/ManagementHome.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.management.j2ee; - -import java.rmi.RemoteException; -import javax.ejb.CreateException; -import javax.ejb.EJBHome; - -/** - * @version $Rev: 467553 $ - */ -public interface ManagementHome extends EJBHome { - public Management create() throws CreateException, RemoteException; -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/BoundaryStatistic.class b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/BoundaryStatistic.class deleted file mode 100644 index 052e3c9a6..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/BoundaryStatistic.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/BoundaryStatistic.java b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/BoundaryStatistic.java deleted file mode 100644 index 6824bbbcb..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/BoundaryStatistic.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.management.j2ee.statistics; - -/** - * @version $Rev: 467553 $ - */ -public interface BoundaryStatistic extends Statistic { - public long getUpperBound(); - - public long getLowerBound(); -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/BoundedRangeStatistic.class b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/BoundedRangeStatistic.class deleted file mode 100644 index f75f42add..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/BoundedRangeStatistic.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/BoundedRangeStatistic.java b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/BoundedRangeStatistic.java deleted file mode 100644 index 75cfe3872..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/BoundedRangeStatistic.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.management.j2ee.statistics; - -/** - * @version $Rev: 467553 $ - */ -public interface BoundedRangeStatistic extends BoundaryStatistic, RangeStatistic { -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/CountStatistic.class b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/CountStatistic.class deleted file mode 100644 index 861056d3c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/CountStatistic.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/CountStatistic.java b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/CountStatistic.java deleted file mode 100644 index 9af8b598d..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/CountStatistic.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.management.j2ee.statistics; - -/** - * @version $Rev: 467553 $ - */ -public interface CountStatistic extends Statistic { - public long getCount(); -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/EJBStats.class b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/EJBStats.class deleted file mode 100644 index e8607660b..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/EJBStats.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/EJBStats.java b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/EJBStats.java deleted file mode 100644 index 8bfdeaa59..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/EJBStats.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.management.j2ee.statistics; - -/** - * @version $Rev: 467553 $ - */ -public interface EJBStats extends Stats { - public CountStatistic getCreateCount(); - - public CountStatistic getRemoveCount(); -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/EntityBeanStats.class b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/EntityBeanStats.class deleted file mode 100644 index 5b1810114..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/EntityBeanStats.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/EntityBeanStats.java b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/EntityBeanStats.java deleted file mode 100644 index 96f761351..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/EntityBeanStats.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.management.j2ee.statistics; - -/** - * @version $Rev: 467553 $ - */ -public interface EntityBeanStats extends EJBStats { - public RangeStatistic getReadyCount(); - - public RangeStatistic getPooledCount(); -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JCAConnectionPoolStats.class b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JCAConnectionPoolStats.class deleted file mode 100644 index 3ca9735c8..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JCAConnectionPoolStats.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JCAConnectionPoolStats.java b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JCAConnectionPoolStats.java deleted file mode 100644 index a4bc0a1c7..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JCAConnectionPoolStats.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.management.j2ee.statistics; - -/** - * @version $Rev: 467553 $ - */ -public interface JCAConnectionPoolStats extends JCAConnectionStats { - public CountStatistic getCloseCount(); - - public CountStatistic getCreateCount(); - - public BoundedRangeStatistic getFreePoolSize(); - - public BoundedRangeStatistic getPoolSize(); - - public RangeStatistic getWaitingThreadCount(); -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JCAConnectionStats.class b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JCAConnectionStats.class deleted file mode 100644 index 5d60414b8..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JCAConnectionStats.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JCAConnectionStats.java b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JCAConnectionStats.java deleted file mode 100644 index 7753b9326..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JCAConnectionStats.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.management.j2ee.statistics; - -/** - * @version $Rev: 467553 $ - */ -public interface JCAConnectionStats extends Stats { - public String getConnectionFactory(); - - public String getManagedConnectionFactory(); - - public TimeStatistic getWaitTime(); - - public TimeStatistic getUseTime(); -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JCAStats.class b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JCAStats.class deleted file mode 100644 index 1684e87dd..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JCAStats.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JCAStats.java b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JCAStats.java deleted file mode 100644 index a942fb6dd..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JCAStats.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.management.j2ee.statistics; - -/** - * @version $Rev: 467553 $ - */ -public interface JCAStats extends Stats { - public JCAConnectionStats[] getConnections(); - - public JCAConnectionPoolStats[] getConnectionPools(); -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JDBCConnectionPoolStats.class b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JDBCConnectionPoolStats.class deleted file mode 100644 index 110bd4540..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JDBCConnectionPoolStats.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JDBCConnectionPoolStats.java b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JDBCConnectionPoolStats.java deleted file mode 100644 index 370106acc..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JDBCConnectionPoolStats.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.management.j2ee.statistics; - -/** - * @version $Rev: 467553 $ - */ -public interface JDBCConnectionPoolStats extends JDBCConnectionStats { - public CountStatistic getCreateCount(); - - public CountStatistic getCloseCount(); - - public BoundedRangeStatistic getPoolSize(); - - public BoundedRangeStatistic getFreePoolSize(); - - public RangeStatistic getWaitingThreadCount(); -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JDBCConnectionStats.class b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JDBCConnectionStats.class deleted file mode 100644 index 789af3cdf..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JDBCConnectionStats.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JDBCConnectionStats.java b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JDBCConnectionStats.java deleted file mode 100644 index a2f617885..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JDBCConnectionStats.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.management.j2ee.statistics; - -/** - * @version $Rev: 467553 $ - */ -public interface JDBCConnectionStats extends Stats { - public String getJdbcDataSource(); - - public TimeStatistic getWaitTime(); - - public TimeStatistic getUseTime(); -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JDBCStats.class b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JDBCStats.class deleted file mode 100644 index c9f703540..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JDBCStats.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JDBCStats.java b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JDBCStats.java deleted file mode 100644 index 42ea7563a..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JDBCStats.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.management.j2ee.statistics; - -/** - * @version $Rev: 467553 $ - */ -public interface JDBCStats extends Stats { - public JDBCConnectionStats[] getConnections(); - - public JDBCConnectionPoolStats[] getConnectionPools(); -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JMSConnectionStats.class b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JMSConnectionStats.class deleted file mode 100644 index 1b5945b99..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JMSConnectionStats.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JMSConnectionStats.java b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JMSConnectionStats.java deleted file mode 100644 index b094aa11c..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JMSConnectionStats.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.management.j2ee.statistics; - -/** - * @version $Rev: 467553 $ - */ -public interface JMSConnectionStats extends Stats { - public JMSSessionStats[] getSessions(); - - public boolean isTransactional(); -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JMSConsumerStats.class b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JMSConsumerStats.class deleted file mode 100644 index 47525b1bb..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JMSConsumerStats.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JMSConsumerStats.java b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JMSConsumerStats.java deleted file mode 100644 index bb7cd9aea..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JMSConsumerStats.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.management.j2ee.statistics; - -/** - * @version $Rev: 467553 $ - */ -public interface JMSConsumerStats extends JMSEndpointStats { - public String getOrigin(); -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JMSEndpointStats.class b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JMSEndpointStats.class deleted file mode 100644 index 496e9ae48..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JMSEndpointStats.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JMSEndpointStats.java b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JMSEndpointStats.java deleted file mode 100644 index 926744264..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JMSEndpointStats.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.management.j2ee.statistics; - -/** - * @version $Rev: 467553 $ - */ -public interface JMSEndpointStats extends Stats { - public CountStatistic getMessageCount(); - - public CountStatistic getPendingMessageCount(); - - public CountStatistic getExpiredMessageCount(); - - public TimeStatistic getMessageWaitTime(); -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JMSProducerStats.class b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JMSProducerStats.class deleted file mode 100644 index c94a8978c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JMSProducerStats.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JMSProducerStats.java b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JMSProducerStats.java deleted file mode 100644 index 56fb4a005..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JMSProducerStats.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.management.j2ee.statistics; - -/** - * @version $Rev: 467553 $ - */ -public interface JMSProducerStats extends JMSEndpointStats { - public String getDestination(); -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JMSSessionStats.class b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JMSSessionStats.class deleted file mode 100644 index 854b695cb..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JMSSessionStats.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JMSSessionStats.java b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JMSSessionStats.java deleted file mode 100644 index 76586cf7c..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JMSSessionStats.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.management.j2ee.statistics; - -/** - * @version $Rev: 467553 $ - */ -public interface JMSSessionStats extends Stats { - public JMSProducerStats[] getProducers(); - - public JMSConsumerStats[] getConsumers(); - - public CountStatistic getMessageCount(); - - public CountStatistic getPendingMessageCount(); - - public CountStatistic getExpiredMessageCount(); - - public TimeStatistic getMessageWaitTime(); - - public CountStatistic getDurableSubscriptionCount(); -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JMSStats.class b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JMSStats.class deleted file mode 100644 index 614aa314b..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JMSStats.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JMSStats.java b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JMSStats.java deleted file mode 100644 index 3bc2a9ae2..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JMSStats.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.management.j2ee.statistics; - -/** - * @version $Rev: 467553 $ - */ -public interface JMSStats extends Stats { - public JMSConnectionStats[] getConnections(); -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JTAStats.class b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JTAStats.class deleted file mode 100644 index 79b157d88..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JTAStats.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JTAStats.java b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JTAStats.java deleted file mode 100644 index a1153cf2b..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JTAStats.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.management.j2ee.statistics; - -/** - * @version $Rev: 467553 $ - */ -public interface JTAStats extends Stats { - public CountStatistic getActiveCount(); - - public CountStatistic getCommittedCount(); - - public CountStatistic getRolledbackCount(); -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JVMStats.class b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JVMStats.class deleted file mode 100644 index 9f4e630ab..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JVMStats.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JVMStats.java b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JVMStats.java deleted file mode 100644 index 0eb21bc60..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JVMStats.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.management.j2ee.statistics; - -/** - * @version $Rev: 467553 $ - */ -public interface JVMStats extends Stats { - public CountStatistic getUpTime(); - - public BoundedRangeStatistic getHeapSize(); -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JavaMailStats.class b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JavaMailStats.class deleted file mode 100644 index 6fdcd0add..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JavaMailStats.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JavaMailStats.java b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JavaMailStats.java deleted file mode 100644 index a2869d23a..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/JavaMailStats.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.management.j2ee.statistics; - -/** - * @version $Rev: 467553 $ - */ -public interface JavaMailStats { - /** - * The number of mail messages sent. - */ - public CountStatistic getSentMailCount(); -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/MessageDrivenBeanStats.class b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/MessageDrivenBeanStats.class deleted file mode 100644 index b75b9fb51..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/MessageDrivenBeanStats.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/MessageDrivenBeanStats.java b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/MessageDrivenBeanStats.java deleted file mode 100644 index e5cab38ff..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/MessageDrivenBeanStats.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.management.j2ee.statistics; - -/** - * @version $Rev: 467553 $ - */ -public interface MessageDrivenBeanStats extends EJBStats { - public CountStatistic getMessageCount(); -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/RangeStatistic.class b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/RangeStatistic.class deleted file mode 100644 index 345eedf8e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/RangeStatistic.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/RangeStatistic.java b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/RangeStatistic.java deleted file mode 100644 index a6e9f7494..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/RangeStatistic.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.management.j2ee.statistics; - -/** - * @version $Rev: 467553 $ - */ -public interface RangeStatistic extends Statistic { - public long getHighWaterMark(); - - public long getLowWaterMark(); - - public long getCurrent(); -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/ServletStats.class b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/ServletStats.class deleted file mode 100644 index 166834401..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/ServletStats.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/ServletStats.java b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/ServletStats.java deleted file mode 100644 index 6df54d7e1..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/ServletStats.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.management.j2ee.statistics; - -/** - * @version $Rev: 467553 $ - */ -public interface ServletStats extends Stats { - public TimeStatistic getServiceTime(); -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/SessionBeanStats.class b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/SessionBeanStats.class deleted file mode 100644 index f9c8f09ef..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/SessionBeanStats.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/SessionBeanStats.java b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/SessionBeanStats.java deleted file mode 100644 index edeba6ac5..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/SessionBeanStats.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.management.j2ee.statistics; - -/** - * @version $Rev: 467553 $ - */ -public interface SessionBeanStats extends EJBStats { - public RangeStatistic getMethodReadyCount(); -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/StatefulSessionBeanStats.class b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/StatefulSessionBeanStats.class deleted file mode 100644 index 4d9d40c6c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/StatefulSessionBeanStats.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/StatefulSessionBeanStats.java b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/StatefulSessionBeanStats.java deleted file mode 100644 index 14145ae86..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/StatefulSessionBeanStats.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.management.j2ee.statistics; - -/** - * @version $Rev: 467553 $ - */ -public interface StatefulSessionBeanStats extends SessionBeanStats { - public RangeStatistic getPassiveCount(); -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/StatelessSessionBeanStats.class b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/StatelessSessionBeanStats.class deleted file mode 100644 index 45d12f346..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/StatelessSessionBeanStats.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/StatelessSessionBeanStats.java b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/StatelessSessionBeanStats.java deleted file mode 100644 index 200e06eb3..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/StatelessSessionBeanStats.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.management.j2ee.statistics; - -/** - * @version $Rev: 467553 $ - */ -public interface StatelessSessionBeanStats extends SessionBeanStats { -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/Statistic.class b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/Statistic.class deleted file mode 100644 index 583170a97..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/Statistic.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/Statistic.java b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/Statistic.java deleted file mode 100644 index 75cd6e50b..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/Statistic.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.management.j2ee.statistics; - -/** - * @version $Rev: 467553 $ - */ -public interface Statistic { - public String getName(); - - public String getUnit(); - - public String getDescription(); - - public long getStartTime(); - - public long getLastSampleTime(); -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/Stats.class b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/Stats.class deleted file mode 100644 index eb7c01fac..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/Stats.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/Stats.java b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/Stats.java deleted file mode 100644 index 44b437d0f..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/Stats.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.management.j2ee.statistics; - -/** - * @version $Rev: 467553 $ - */ -public interface Stats { - public Statistic getStatistic(String statisticName); - - public String[] getStatisticNames(); - - public Statistic[] getStatistics(); -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/TimeStatistic.class b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/TimeStatistic.class deleted file mode 100644 index ce8ebf40a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/TimeStatistic.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/TimeStatistic.java b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/TimeStatistic.java deleted file mode 100644 index 2e1ed7832..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/TimeStatistic.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.management.j2ee.statistics; - -/** - * @version $Rev: 467553 $ - */ -public interface TimeStatistic extends Statistic { - public long getCount(); - - public long getMaxTime(); - - public long getMinTime(); - - public long getTotalTime(); -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/URLStats.class b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/URLStats.class deleted file mode 100644 index a6773038c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/URLStats.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/URLStats.java b/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/URLStats.java deleted file mode 100644 index a946629cb..000000000 --- a/uk.ac.diamond.org.apache.activemq/javax/management/j2ee/statistics/URLStats.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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. - */ - -// -// This source code implements specifications defined by the Java -// Community Process. In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package javax.management.j2ee.statistics; - -/** - * @version $Rev: 467553 $ - */ -public interface URLStats extends Stats { -} diff --git a/uk.ac.diamond.org.apache.activemq/javax/transaction/HeuristicCommitException.class b/uk.ac.diamond.org.apache.activemq/javax/transaction/HeuristicCommitException.class deleted file mode 100644 index 6281d363d..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/transaction/HeuristicCommitException.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/transaction/HeuristicMixedException.class b/uk.ac.diamond.org.apache.activemq/javax/transaction/HeuristicMixedException.class deleted file mode 100644 index 12da5ed01..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/transaction/HeuristicMixedException.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/transaction/HeuristicRollbackException.class b/uk.ac.diamond.org.apache.activemq/javax/transaction/HeuristicRollbackException.class deleted file mode 100644 index c0ae67e30..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/transaction/HeuristicRollbackException.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/transaction/InvalidTransactionException.class b/uk.ac.diamond.org.apache.activemq/javax/transaction/InvalidTransactionException.class deleted file mode 100644 index fa6dd257b..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/transaction/InvalidTransactionException.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/transaction/NotSupportedException.class b/uk.ac.diamond.org.apache.activemq/javax/transaction/NotSupportedException.class deleted file mode 100644 index d3b3c5da1..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/transaction/NotSupportedException.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/transaction/RollbackException.class b/uk.ac.diamond.org.apache.activemq/javax/transaction/RollbackException.class deleted file mode 100644 index 37dcf95c9..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/transaction/RollbackException.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/transaction/Status.class b/uk.ac.diamond.org.apache.activemq/javax/transaction/Status.class deleted file mode 100644 index 78fc89f9e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/transaction/Status.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/transaction/Synchronization.class b/uk.ac.diamond.org.apache.activemq/javax/transaction/Synchronization.class deleted file mode 100644 index e08618dfc..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/transaction/Synchronization.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/transaction/SystemException.class b/uk.ac.diamond.org.apache.activemq/javax/transaction/SystemException.class deleted file mode 100644 index 8d7892ba5..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/transaction/SystemException.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/transaction/Transaction.class b/uk.ac.diamond.org.apache.activemq/javax/transaction/Transaction.class deleted file mode 100644 index d89d7385e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/transaction/Transaction.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/transaction/TransactionManager.class b/uk.ac.diamond.org.apache.activemq/javax/transaction/TransactionManager.class deleted file mode 100644 index 2ee262c91..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/transaction/TransactionManager.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/transaction/TransactionRequiredException.class b/uk.ac.diamond.org.apache.activemq/javax/transaction/TransactionRequiredException.class deleted file mode 100644 index 1047c9c0d..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/transaction/TransactionRequiredException.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/transaction/TransactionRolledbackException.class b/uk.ac.diamond.org.apache.activemq/javax/transaction/TransactionRolledbackException.class deleted file mode 100644 index 267a620ce..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/transaction/TransactionRolledbackException.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/transaction/UserTransaction.class b/uk.ac.diamond.org.apache.activemq/javax/transaction/UserTransaction.class deleted file mode 100644 index 77b496b03..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/transaction/UserTransaction.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/transaction/xa/XAException.class b/uk.ac.diamond.org.apache.activemq/javax/transaction/xa/XAException.class deleted file mode 100644 index f558bbf3c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/transaction/xa/XAException.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/transaction/xa/XAResource.class b/uk.ac.diamond.org.apache.activemq/javax/transaction/xa/XAResource.class deleted file mode 100644 index f51ca599c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/transaction/xa/XAResource.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/javax/transaction/xa/Xid.class b/uk.ac.diamond.org.apache.activemq/javax/transaction/xa/Xid.class deleted file mode 100644 index 12c42df4e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/javax/transaction/xa/Xid.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnection$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnection$1.class deleted file mode 100644 index 49e8dd324..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnection$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnection$2.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnection$2.class deleted file mode 100644 index 1e7c0cbad..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnection$2.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnection$3$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnection$3$1.class deleted file mode 100644 index 150924355..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnection$3$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnection$3.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnection$3.class deleted file mode 100644 index 8664d1823..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnection$3.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnection$4.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnection$4.class deleted file mode 100644 index 824bb422e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnection$4.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnection$5.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnection$5.class deleted file mode 100644 index af5fa7ea8..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnection$5.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnection$6.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnection$6.class deleted file mode 100644 index 555e36b41..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnection$6.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnection.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnection.class deleted file mode 100644 index e8ad5b599..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnection.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnection.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnection.java deleted file mode 100644 index 50573234d..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnection.java +++ /dev/null @@ -1,2668 +0,0 @@ -/** - * 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; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.CopyOnWriteArrayList; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.RejectedExecutionHandler; -import java.util.concurrent.ThreadFactory; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicInteger; - -import javax.jms.Connection; -import javax.jms.ConnectionConsumer; -import javax.jms.ConnectionMetaData; -import javax.jms.DeliveryMode; -import javax.jms.Destination; -import javax.jms.ExceptionListener; -import javax.jms.IllegalStateException; -import javax.jms.InvalidDestinationException; -import javax.jms.JMSException; -import javax.jms.Queue; -import javax.jms.QueueConnection; -import javax.jms.QueueSession; -import javax.jms.ServerSessionPool; -import javax.jms.Session; -import javax.jms.Topic; -import javax.jms.TopicConnection; -import javax.jms.TopicSession; -import javax.jms.XAConnection; - -import org.apache.activemq.advisory.DestinationSource; -import org.apache.activemq.blob.BlobTransferPolicy; -import org.apache.activemq.broker.region.policy.RedeliveryPolicyMap; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ActiveMQMessage; -import org.apache.activemq.command.ActiveMQTempDestination; -import org.apache.activemq.command.ActiveMQTempQueue; -import org.apache.activemq.command.ActiveMQTempTopic; -import org.apache.activemq.command.BrokerInfo; -import org.apache.activemq.command.Command; -import org.apache.activemq.command.CommandTypes; -import org.apache.activemq.command.ConnectionControl; -import org.apache.activemq.command.ConnectionError; -import org.apache.activemq.command.ConnectionId; -import org.apache.activemq.command.ConnectionInfo; -import org.apache.activemq.command.ConsumerControl; -import org.apache.activemq.command.ConsumerId; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.command.ControlCommand; -import org.apache.activemq.command.DestinationInfo; -import org.apache.activemq.command.ExceptionResponse; -import org.apache.activemq.command.Message; -import org.apache.activemq.command.MessageDispatch; -import org.apache.activemq.command.MessageId; -import org.apache.activemq.command.ProducerAck; -import org.apache.activemq.command.ProducerId; -import org.apache.activemq.command.RemoveInfo; -import org.apache.activemq.command.RemoveSubscriptionInfo; -import org.apache.activemq.command.Response; -import org.apache.activemq.command.SessionId; -import org.apache.activemq.command.ShutdownInfo; -import org.apache.activemq.command.WireFormatInfo; -import org.apache.activemq.management.JMSConnectionStatsImpl; -import org.apache.activemq.management.JMSStatsImpl; -import org.apache.activemq.management.StatsCapable; -import org.apache.activemq.management.StatsImpl; -import org.apache.activemq.state.CommandVisitorAdapter; -import org.apache.activemq.thread.Scheduler; -import org.apache.activemq.thread.TaskRunnerFactory; -import org.apache.activemq.transport.FutureResponse; -import org.apache.activemq.transport.ResponseCallback; -import org.apache.activemq.transport.Transport; -import org.apache.activemq.transport.TransportListener; -import org.apache.activemq.transport.failover.FailoverTransport; -import org.apache.activemq.util.IdGenerator; -import org.apache.activemq.util.IntrospectionSupport; -import org.apache.activemq.util.JMSExceptionSupport; -import org.apache.activemq.util.LongSequenceGenerator; -import org.apache.activemq.util.ServiceSupport; -import org.apache.activemq.util.ThreadPoolUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ActiveMQConnection implements Connection, TopicConnection, QueueConnection, StatsCapable, Closeable, StreamConnection, TransportListener, EnhancedConnection { - - public static final String DEFAULT_USER = ActiveMQConnectionFactory.DEFAULT_USER; - public static final String DEFAULT_PASSWORD = ActiveMQConnectionFactory.DEFAULT_PASSWORD; - public static final String DEFAULT_BROKER_URL = ActiveMQConnectionFactory.DEFAULT_BROKER_URL; - public static int DEFAULT_THREAD_POOL_SIZE = 1000; - - private static final Logger LOG = LoggerFactory.getLogger(ActiveMQConnection.class); - - public final ConcurrentHashMap activeTempDestinations = new ConcurrentHashMap(); - - protected boolean dispatchAsync=true; - protected boolean alwaysSessionAsync = true; - - private TaskRunnerFactory sessionTaskRunner; - private final ThreadPoolExecutor executor; - - // Connection state variables - private final ConnectionInfo info; - private ExceptionListener exceptionListener; - private ClientInternalExceptionListener clientInternalExceptionListener; - private boolean clientIDSet; - private boolean isConnectionInfoSentToBroker; - private boolean userSpecifiedClientID; - - // Configuration options variables - private ActiveMQPrefetchPolicy prefetchPolicy = new ActiveMQPrefetchPolicy(); - private BlobTransferPolicy blobTransferPolicy; - private RedeliveryPolicyMap redeliveryPolicyMap; - private MessageTransformer transformer; - - private boolean disableTimeStampsByDefault; - private boolean optimizedMessageDispatch = true; - private boolean copyMessageOnSend = true; - private boolean useCompression; - private boolean objectMessageSerializationDefered; - private boolean useAsyncSend; - private boolean optimizeAcknowledge; - private long optimizeAcknowledgeTimeOut = 0; - private long optimizedAckScheduledAckInterval = 0; - private boolean nestedMapAndListEnabled = true; - private boolean useRetroactiveConsumer; - private boolean exclusiveConsumer; - private boolean alwaysSyncSend; - private int closeTimeout = 15000; - private boolean watchTopicAdvisories = true; - private long warnAboutUnstartedConnectionTimeout = 500L; - private int sendTimeout =0; - private boolean sendAcksAsync=true; - private boolean checkForDuplicates = true; - private boolean queueOnlyConnection = false; - - private final Transport transport; - private final IdGenerator clientIdGenerator; - private final JMSStatsImpl factoryStats; - private final JMSConnectionStatsImpl stats; - - private final AtomicBoolean started = new AtomicBoolean(false); - private final AtomicBoolean closing = new AtomicBoolean(false); - private final AtomicBoolean closed = new AtomicBoolean(false); - private final AtomicBoolean transportFailed = new AtomicBoolean(false); - private final CopyOnWriteArrayList sessions = new CopyOnWriteArrayList(); - private final CopyOnWriteArrayList connectionConsumers = new CopyOnWriteArrayList(); - private final CopyOnWriteArrayList inputStreams = new CopyOnWriteArrayList(); - private final CopyOnWriteArrayList outputStreams = new CopyOnWriteArrayList(); - private final CopyOnWriteArrayList transportListeners = new CopyOnWriteArrayList(); - - // Maps ConsumerIds to ActiveMQConsumer objects - private final ConcurrentHashMap dispatchers = new ConcurrentHashMap(); - private final ConcurrentHashMap producers = new ConcurrentHashMap(); - private final LongSequenceGenerator sessionIdGenerator = new LongSequenceGenerator(); - private final SessionId connectionSessionId; - private final LongSequenceGenerator consumerIdGenerator = new LongSequenceGenerator(); - private final LongSequenceGenerator producerIdGenerator = new LongSequenceGenerator(); - private final LongSequenceGenerator tempDestinationIdGenerator = new LongSequenceGenerator(); - private final LongSequenceGenerator localTransactionIdGenerator = new LongSequenceGenerator(); - - private AdvisoryConsumer advisoryConsumer; - private final CountDownLatch brokerInfoReceived = new CountDownLatch(1); - private BrokerInfo brokerInfo; - private IOException firstFailureError; - private int producerWindowSize = ActiveMQConnectionFactory.DEFAULT_PRODUCER_WINDOW_SIZE; - - // Assume that protocol is the latest. Change to the actual protocol - // version when a WireFormatInfo is received. - private final AtomicInteger protocolVersion = new AtomicInteger(CommandTypes.PROTOCOL_VERSION); - private final long timeCreated; - private final ConnectionAudit connectionAudit = new ConnectionAudit(); - private DestinationSource destinationSource; - private final Object ensureConnectionInfoSentMutex = new Object(); - private boolean useDedicatedTaskRunner; - protected AtomicInteger transportInterruptionProcessingComplete = new AtomicInteger(0); - private long consumerFailoverRedeliveryWaitPeriod; - private Scheduler scheduler; - private boolean messagePrioritySupported = true; - private boolean transactedIndividualAck = false; - private boolean nonBlockingRedelivery = false; - - private int maxThreadPoolSize = DEFAULT_THREAD_POOL_SIZE; - private RejectedExecutionHandler rejectedTaskHandler = null; - - /** - * Construct an ActiveMQConnection - * - * @param transport - * @param factoryStats - * @throws Exception - */ - protected ActiveMQConnection(final Transport transport, IdGenerator clientIdGenerator, IdGenerator connectionIdGenerator, JMSStatsImpl factoryStats) throws Exception { - - this.transport = transport; - this.clientIdGenerator = clientIdGenerator; - this.factoryStats = factoryStats; - - // Configure a single threaded executor who's core thread can timeout if - // idle - executor = new ThreadPoolExecutor(1, 1, 5, TimeUnit.SECONDS, new LinkedBlockingQueue(), new ThreadFactory() { - @Override - public Thread newThread(Runnable r) { - Thread thread = new Thread(r, "ActiveMQ Connection Executor: " + transport); - //Don't make these daemon threads - see https://issues.apache.org/jira/browse/AMQ-796 - //thread.setDaemon(true); - return thread; - } - }); - // asyncConnectionThread.allowCoreThreadTimeOut(true); - String uniqueId = connectionIdGenerator.generateId(); - this.info = new ConnectionInfo(new ConnectionId(uniqueId)); - this.info.setManageable(true); - this.info.setFaultTolerant(transport.isFaultTolerant()); - this.connectionSessionId = new SessionId(info.getConnectionId(), -1); - - this.transport.setTransportListener(this); - - this.stats = new JMSConnectionStatsImpl(sessions, this instanceof XAConnection); - this.factoryStats.addConnection(this); - this.timeCreated = System.currentTimeMillis(); - this.connectionAudit.setCheckForDuplicates(transport.isFaultTolerant()); - } - - protected void setUserName(String userName) { - this.info.setUserName(userName); - } - - protected void setPassword(String password) { - this.info.setPassword(password); - } - - /** - * A static helper method to create a new connection - * - * @return an ActiveMQConnection - * @throws JMSException - */ - public static ActiveMQConnection makeConnection() throws JMSException { - ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(); - return (ActiveMQConnection)factory.createConnection(); - } - - /** - * A static helper method to create a new connection - * - * @param uri - * @return and ActiveMQConnection - * @throws JMSException - */ - public static ActiveMQConnection makeConnection(String uri) throws JMSException, URISyntaxException { - ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(uri); - return (ActiveMQConnection)factory.createConnection(); - } - - /** - * A static helper method to create a new connection - * - * @param user - * @param password - * @param uri - * @return an ActiveMQConnection - * @throws JMSException - */ - public static ActiveMQConnection makeConnection(String user, String password, String uri) throws JMSException, URISyntaxException { - ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(user, password, new URI(uri)); - return (ActiveMQConnection)factory.createConnection(); - } - - /** - * @return a number unique for this connection - */ - public JMSConnectionStatsImpl getConnectionStats() { - return stats; - } - - /** - * Creates a Session object. - * - * @param transacted indicates whether the session is transacted - * @param acknowledgeMode indicates whether the consumer or the client will - * acknowledge any messages it receives; ignored if the - * session is transacted. Legal values are - * Session.AUTO_ACKNOWLEDGE, - * Session.CLIENT_ACKNOWLEDGE, and - * Session.DUPS_OK_ACKNOWLEDGE. - * @return a newly created session - * @throws JMSException if the Connection object fails to - * create a session due to some internal error or lack of - * support for the specific transaction and acknowledgement - * mode. - * @see Session#AUTO_ACKNOWLEDGE - * @see Session#CLIENT_ACKNOWLEDGE - * @see Session#DUPS_OK_ACKNOWLEDGE - * @since 1.1 - */ - @Override - public Session createSession(boolean transacted, int acknowledgeMode) throws JMSException { - checkClosedOrFailed(); - ensureConnectionInfoSent(); - if(!transacted) { - if (acknowledgeMode==Session.SESSION_TRANSACTED) { - throw new JMSException("acknowledgeMode SESSION_TRANSACTED cannot be used for an non-transacted Session"); - } else if (acknowledgeMode < Session.SESSION_TRANSACTED || acknowledgeMode > ActiveMQSession.MAX_ACK_CONSTANT) { - throw new JMSException("invalid acknowledgeMode: " + acknowledgeMode + ". Valid values are Session.AUTO_ACKNOWLEDGE (1), " + - "Session.CLIENT_ACKNOWLEDGE (2), Session.DUPS_OK_ACKNOWLEDGE (3), ActiveMQSession.INDIVIDUAL_ACKNOWLEDGE (4) or for transacted sessions Session.SESSION_TRANSACTED (0)"); - } - } - return new ActiveMQSession(this, getNextSessionId(), transacted ? Session.SESSION_TRANSACTED : (acknowledgeMode == Session.SESSION_TRANSACTED - ? Session.AUTO_ACKNOWLEDGE : acknowledgeMode), isDispatchAsync(), isAlwaysSessionAsync()); - } - - /** - * @return sessionId - */ - protected SessionId getNextSessionId() { - return new SessionId(info.getConnectionId(), sessionIdGenerator.getNextSequenceId()); - } - - /** - * Gets the client identifier for this connection. - *

    - * This value is specific to the JMS provider. It is either preconfigured by - * an administrator in a ConnectionFactory object or assigned - * dynamically by the application by calling the setClientID - * method. - * - * @return the unique client identifier - * @throws JMSException if the JMS provider fails to return the client ID - * for this connection due to some internal error. - */ - @Override - public String getClientID() throws JMSException { - checkClosedOrFailed(); - return this.info.getClientId(); - } - - /** - * Sets the client identifier for this connection. - *

    - * The preferred way to assign a JMS client's client identifier is for it to - * be configured in a client-specific ConnectionFactory - * object and transparently assigned to the Connection object - * it creates. - *

    - * Alternatively, a client can set a connection's client identifier using a - * provider-specific value. The facility to set a connection's client - * identifier explicitly is not a mechanism for overriding the identifier - * that has been administratively configured. It is provided for the case - * where no administratively specified identifier exists. If one does exist, - * an attempt to change it by setting it must throw an - * IllegalStateException. If a client sets the client - * identifier explicitly, it must do so immediately after it creates the - * connection and before any other action on the connection is taken. After - * this point, setting the client identifier is a programming error that - * should throw an IllegalStateException. - *

    - * The purpose of the client identifier is to associate a connection and its - * objects with a state maintained on behalf of the client by a provider. - * The only such state identified by the JMS API is that required to support - * durable subscriptions. - *

    - * If another connection with the same clientID is already - * running when this method is called, the JMS provider should detect the - * duplicate ID and throw an InvalidClientIDException. - * - * @param newClientID the unique client identifier - * @throws JMSException if the JMS provider fails to set the client ID for - * this connection due to some internal error. - * @throws javax.jms.InvalidClientIDException if the JMS client specifies an - * invalid or duplicate client ID. - * @throws javax.jms.IllegalStateException if the JMS client attempts to set - * a connection's client ID at the wrong time or when it has - * been administratively configured. - */ - @Override - public void setClientID(String newClientID) throws JMSException { - checkClosedOrFailed(); - - if (this.clientIDSet) { - throw new IllegalStateException("The clientID has already been set"); - } - - if (this.isConnectionInfoSentToBroker) { - throw new IllegalStateException("Setting clientID on a used Connection is not allowed"); - } - - this.info.setClientId(newClientID); - this.userSpecifiedClientID = true; - ensureConnectionInfoSent(); - } - - /** - * Sets the default client id that the connection will use if explicitly not - * set with the setClientId() call. - */ - public void setDefaultClientID(String clientID) throws JMSException { - this.info.setClientId(clientID); - this.userSpecifiedClientID = true; - } - - /** - * Gets the metadata for this connection. - * - * @return the connection metadata - * @throws JMSException if the JMS provider fails to get the connection - * metadata for this connection. - * @see javax.jms.ConnectionMetaData - */ - @Override - public ConnectionMetaData getMetaData() throws JMSException { - checkClosedOrFailed(); - return ActiveMQConnectionMetaData.INSTANCE; - } - - /** - * Gets the ExceptionListener object for this connection. Not - * every Connection has an ExceptionListener - * associated with it. - * - * @return the ExceptionListener for this connection, or - * null, if no ExceptionListener is associated with - * this connection. - * @throws JMSException if the JMS provider fails to get the - * ExceptionListener for this connection. - * @see javax.jms.Connection#setExceptionListener(ExceptionListener) - */ - @Override - public ExceptionListener getExceptionListener() throws JMSException { - checkClosedOrFailed(); - return this.exceptionListener; - } - - /** - * Sets an exception listener for this connection. - *

    - * If a JMS provider detects a serious problem with a connection, it informs - * the connection's ExceptionListener, if one has been - * registered. It does this by calling the listener's onException - * - * method, passing it a JMSException object describing the - * problem. - *

    - * An exception listener allows a client to be notified of a problem - * asynchronously. Some connections only consume messages, so they would - * have no other way to learn their connection has failed. - *

    - * A connection serializes execution of its ExceptionListener. - *

    - * A JMS provider should attempt to resolve connection problems itself - * before it notifies the client of them. - * - * @param listener the exception listener - * @throws JMSException if the JMS provider fails to set the exception - * listener for this connection. - */ - @Override - public void setExceptionListener(ExceptionListener listener) throws JMSException { - checkClosedOrFailed(); - this.exceptionListener = listener; - } - - /** - * Gets the ClientInternalExceptionListener object for this connection. - * Not every ActiveMQConnectionn has a ClientInternalExceptionListener - * associated with it. - * - * @return the listener or null if no listener is registered with the connection. - */ - public ClientInternalExceptionListener getClientInternalExceptionListener() { - return clientInternalExceptionListener; - } - - /** - * Sets a client internal exception listener for this connection. - * The connection will notify the listener, if one has been registered, of exceptions thrown by container components - * (e.g. an EJB container in case of Message Driven Beans) during asynchronous processing of a message. - * It does this by calling the listener's onException() method passing it a Throwable - * describing the problem. - * - * @param listener the exception listener - */ - public void setClientInternalExceptionListener(ClientInternalExceptionListener listener) { - this.clientInternalExceptionListener = listener; - } - - /** - * Starts (or restarts) a connection's delivery of incoming messages. A call - * to start on a connection that has already been started is - * ignored. - * - * @throws JMSException if the JMS provider fails to start message delivery - * due to some internal error. - * @see javax.jms.Connection#stop() - */ - @Override - public void start() throws JMSException { - checkClosedOrFailed(); - ensureConnectionInfoSent(); - if (started.compareAndSet(false, true)) { - for (Iterator i = sessions.iterator(); i.hasNext();) { - ActiveMQSession session = i.next(); - session.start(); - } - } - } - - /** - * Temporarily stops a connection's delivery of incoming messages. Delivery - * can be restarted using the connection's start method. When - * the connection is stopped, delivery to all the connection's message - * consumers is inhibited: synchronous receives block, and messages are not - * delivered to message listeners. - *

    - * This call blocks until receives and/or message listeners in progress have - * completed. - *

    - * Stopping a connection has no effect on its ability to send messages. A - * call to stop on a connection that has already been stopped - * is ignored. - *

    - * A call to stop must not return until delivery of messages - * has paused. This means that a client can rely on the fact that none of - * its message listeners will be called and that all threads of control - * waiting for receive calls to return will not return with a - * message until the connection is restarted. The receive timers for a - * stopped connection continue to advance, so receives may time out while - * the connection is stopped. - *

    - * If message listeners are running when stop is invoked, the - * stop call must wait until all of them have returned before - * it may return. While these message listeners are completing, they must - * have the full services of the connection available to them. - * - * @throws JMSException if the JMS provider fails to stop message delivery - * due to some internal error. - * @see javax.jms.Connection#start() - */ - @Override - public void stop() throws JMSException { - doStop(true); - } - - /** - * @see #stop() - * @param checkClosed true to check for already closed and throw {@link java.lang.IllegalStateException} if already closed, - * false to skip this check - * @throws JMSException if the JMS provider fails to stop message delivery due to some internal error. - */ - void doStop(boolean checkClosed) throws JMSException { - if (checkClosed) { - checkClosedOrFailed(); - } - if (started.compareAndSet(true, false)) { - synchronized(sessions) { - for (Iterator i = sessions.iterator(); i.hasNext();) { - ActiveMQSession s = i.next(); - s.stop(); - } - } - } - } - - /** - * Closes the connection. - *

    - * Since a provider typically allocates significant resources outside the - * JVM on behalf of a connection, clients should close these resources when - * they are not needed. Relying on garbage collection to eventually reclaim - * these resources may not be timely enough. - *

    - * There is no need to close the sessions, producers, and consumers of a - * closed connection. - *

    - * Closing a connection causes all temporary destinations to be deleted. - *

    - * When this method is invoked, it should not return until message - * processing has been shut down in an orderly fashion. This means that all - * message listeners that may have been running have returned, and that all - * pending receives have returned. A close terminates all pending message - * receives on the connection's sessions' consumers. The receives may return - * with a message or with null, depending on whether there was a message - * available at the time of the close. If one or more of the connection's - * sessions' message listeners is processing a message at the time when - * connection close is invoked, all the facilities of the - * connection and its sessions must remain available to those listeners - * until they return control to the JMS provider. - *

    - * Closing a connection causes any of its sessions' transactions in progress - * to be rolled back. In the case where a session's work is coordinated by - * an external transaction manager, a session's commit and - * rollback methods are not used and the result of a closed - * session's work is determined later by the transaction manager. Closing a - * connection does NOT force an acknowledgment of client-acknowledged - * sessions. - *

    - * Invoking the acknowledge method of a received message from - * a closed connection's session must throw an - * IllegalStateException. Closing a closed connection must - * NOT throw an exception. - * - * @throws JMSException if the JMS provider fails to close the connection - * due to some internal error. For example, a failure to - * release resources or to close a socket connection can - * cause this exception to be thrown. - */ - @Override - public void close() throws JMSException { - // Store the interrupted state and clear so that cleanup happens without - // leaking connection resources. Reset in finally to preserve state. - boolean interrupted = Thread.interrupted(); - - try { - - // If we were running, lets stop first. - if (!closed.get() && !transportFailed.get()) { - // do not fail if already closed as according to JMS spec we must not - // throw exception if already closed - doStop(false); - } - - synchronized (this) { - if (!closed.get()) { - closing.set(true); - - if (destinationSource != null) { - destinationSource.stop(); - destinationSource = null; - } - if (advisoryConsumer != null) { - advisoryConsumer.dispose(); - advisoryConsumer = null; - } - - Scheduler scheduler = this.scheduler; - if (scheduler != null) { - try { - scheduler.stop(); - } catch (Exception e) { - JMSException ex = JMSExceptionSupport.create(e); - throw ex; - } - } - - long lastDeliveredSequenceId = 0; - for (Iterator i = this.sessions.iterator(); i.hasNext();) { - ActiveMQSession s = i.next(); - s.dispose(); - lastDeliveredSequenceId = Math.max(lastDeliveredSequenceId, s.getLastDeliveredSequenceId()); - } - for (Iterator i = this.connectionConsumers.iterator(); i.hasNext();) { - ActiveMQConnectionConsumer c = i.next(); - c.dispose(); - } - for (Iterator i = this.inputStreams.iterator(); i.hasNext();) { - ActiveMQInputStream c = i.next(); - c.dispose(); - } - for (Iterator i = this.outputStreams.iterator(); i.hasNext();) { - ActiveMQOutputStream c = i.next(); - c.dispose(); - } - - this.activeTempDestinations.clear(); - - if (isConnectionInfoSentToBroker) { - // If we announced ourselves to the broker.. Try to let the broker - // know that the connection is being shutdown. - RemoveInfo removeCommand = info.createRemoveCommand(); - removeCommand.setLastDeliveredSequenceId(lastDeliveredSequenceId); - doSyncSendPacket(info.createRemoveCommand(), closeTimeout); - doAsyncSendPacket(new ShutdownInfo()); - } - - started.set(false); - - // TODO if we move the TaskRunnerFactory to the connection - // factory - // then we may need to call - // factory.onConnectionClose(this); - if (sessionTaskRunner != null) { - sessionTaskRunner.shutdown(); - } - closed.set(true); - closing.set(false); - } - } - } finally { - try { - if (executor != null) { - ThreadPoolUtils.shutdown(executor); - } - } catch (Throwable e) { - LOG.warn("Error shutting down thread pool: " + executor + ". This exception will be ignored.", e); - } - - ServiceSupport.dispose(this.transport); - - factoryStats.removeConnection(this); - if (interrupted) { - Thread.currentThread().interrupt(); - } - } - } - - /** - * Tells the broker to terminate its VM. This can be used to cleanly - * terminate a broker running in a standalone java process. Server must have - * property enable.vm.shutdown=true defined to allow this to work. - */ - // TODO : org.apache.activemq.message.BrokerAdminCommand not yet - // implemented. - /* - * public void terminateBrokerVM() throws JMSException { BrokerAdminCommand - * command = new BrokerAdminCommand(); - * command.setCommand(BrokerAdminCommand.SHUTDOWN_SERVER_VM); - * asyncSendPacket(command); } - */ - - /** - * Create a durable connection consumer for this connection (optional - * operation). This is an expert facility not used by regular JMS clients. - * - * @param topic topic to access - * @param subscriptionName durable subscription name - * @param messageSelector only messages with properties matching the message - * selector expression are delivered. A value of null or an - * empty string indicates that there is no message selector - * for the message consumer. - * @param sessionPool the server session pool to associate with this durable - * connection consumer - * @param maxMessages the maximum number of messages that can be assigned to - * a server session at one time - * @return the durable connection consumer - * @throws JMSException if the Connection object fails to - * create a connection consumer due to some internal error - * or invalid arguments for sessionPool and - * messageSelector. - * @throws javax.jms.InvalidDestinationException if an invalid destination - * is specified. - * @throws javax.jms.InvalidSelectorException if the message selector is - * invalid. - * @see javax.jms.ConnectionConsumer - * @since 1.1 - */ - @Override - public ConnectionConsumer createDurableConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool sessionPool, int maxMessages) - throws JMSException { - return this.createDurableConnectionConsumer(topic, subscriptionName, messageSelector, sessionPool, maxMessages, false); - } - - /** - * Create a durable connection consumer for this connection (optional - * operation). This is an expert facility not used by regular JMS clients. - * - * @param topic topic to access - * @param subscriptionName durable subscription name - * @param messageSelector only messages with properties matching the message - * selector expression are delivered. A value of null or an - * empty string indicates that there is no message selector - * for the message consumer. - * @param sessionPool the server session pool to associate with this durable - * connection consumer - * @param maxMessages the maximum number of messages that can be assigned to - * a server session at one time - * @param noLocal set true if you want to filter out messages published - * locally - * @return the durable connection consumer - * @throws JMSException if the Connection object fails to - * create a connection consumer due to some internal error - * or invalid arguments for sessionPool and - * messageSelector. - * @throws javax.jms.InvalidDestinationException if an invalid destination - * is specified. - * @throws javax.jms.InvalidSelectorException if the message selector is - * invalid. - * @see javax.jms.ConnectionConsumer - * @since 1.1 - */ - public ConnectionConsumer createDurableConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool sessionPool, int maxMessages, - boolean noLocal) throws JMSException { - checkClosedOrFailed(); - - if (queueOnlyConnection) { - throw new IllegalStateException("QueueConnection cannot be used to create Pub/Sub based resources."); - } - - ensureConnectionInfoSent(); - SessionId sessionId = new SessionId(info.getConnectionId(), -1); - ConsumerInfo info = new ConsumerInfo(new ConsumerId(sessionId, consumerIdGenerator.getNextSequenceId())); - info.setDestination(ActiveMQMessageTransformation.transformDestination(topic)); - info.setSubscriptionName(subscriptionName); - info.setSelector(messageSelector); - info.setPrefetchSize(maxMessages); - info.setDispatchAsync(isDispatchAsync()); - - // Allows the options on the destination to configure the consumerInfo - if (info.getDestination().getOptions() != null) { - Map options = new HashMap(info.getDestination().getOptions()); - IntrospectionSupport.setProperties(this.info, options, "consumer."); - } - - return new ActiveMQConnectionConsumer(this, sessionPool, info); - } - - // Properties - // ------------------------------------------------------------------------- - - /** - * Returns true if this connection has been started - * - * @return true if this Connection is started - */ - public boolean isStarted() { - return started.get(); - } - - /** - * Returns true if the connection is closed - */ - public boolean isClosed() { - return closed.get(); - } - - /** - * Returns true if the connection is in the process of being closed - */ - public boolean isClosing() { - return closing.get(); - } - - /** - * Returns true if the underlying transport has failed - */ - public boolean isTransportFailed() { - return transportFailed.get(); - } - - /** - * @return Returns the prefetchPolicy. - */ - public ActiveMQPrefetchPolicy getPrefetchPolicy() { - return prefetchPolicy; - } - - /** - * Sets the prefetch - * policy for consumers created by this connection. - */ - public void setPrefetchPolicy(ActiveMQPrefetchPolicy prefetchPolicy) { - this.prefetchPolicy = prefetchPolicy; - } - - /** - */ - public Transport getTransportChannel() { - return transport; - } - - /** - * @return Returns the clientID of the connection, forcing one to be - * generated if one has not yet been configured. - */ - public String getInitializedClientID() throws JMSException { - ensureConnectionInfoSent(); - return info.getClientId(); - } - - /** - * @return Returns the timeStampsDisableByDefault. - */ - public boolean isDisableTimeStampsByDefault() { - return disableTimeStampsByDefault; - } - - /** - * Sets whether or not timestamps on messages should be disabled or not. If - * you disable them it adds a small performance boost. - */ - public void setDisableTimeStampsByDefault(boolean timeStampsDisableByDefault) { - this.disableTimeStampsByDefault = timeStampsDisableByDefault; - } - - /** - * @return Returns the dispatchOptimizedMessage. - */ - public boolean isOptimizedMessageDispatch() { - return optimizedMessageDispatch; - } - - /** - * If this flag is set then an larger prefetch limit is used - only - * applicable for durable topic subscribers. - */ - public void setOptimizedMessageDispatch(boolean dispatchOptimizedMessage) { - this.optimizedMessageDispatch = dispatchOptimizedMessage; - } - - /** - * @return Returns the closeTimeout. - */ - public int getCloseTimeout() { - return closeTimeout; - } - - /** - * Sets the timeout before a close is considered complete. Normally a - * close() on a connection waits for confirmation from the broker; this - * allows that operation to timeout to save the client hanging if there is - * no broker - */ - public void setCloseTimeout(int closeTimeout) { - this.closeTimeout = closeTimeout; - } - - /** - * @return ConnectionInfo - */ - public ConnectionInfo getConnectionInfo() { - return this.info; - } - - public boolean isUseRetroactiveConsumer() { - return useRetroactiveConsumer; - } - - /** - * Sets whether or not retroactive consumers are enabled. Retroactive - * consumers allow non-durable topic subscribers to receive old messages - * that were published before the non-durable subscriber started. - */ - public void setUseRetroactiveConsumer(boolean useRetroactiveConsumer) { - this.useRetroactiveConsumer = useRetroactiveConsumer; - } - - public boolean isNestedMapAndListEnabled() { - return nestedMapAndListEnabled; - } - - /** - * Enables/disables whether or not Message properties and MapMessage entries - * support Nested - * Structures of Map and List objects - */ - public void setNestedMapAndListEnabled(boolean structuredMapsEnabled) { - this.nestedMapAndListEnabled = structuredMapsEnabled; - } - - public boolean isExclusiveConsumer() { - return exclusiveConsumer; - } - - /** - * Enables or disables whether or not queue consumers should be exclusive or - * not for example to preserve ordering when not using Message Groups - * - * @param exclusiveConsumer - */ - public void setExclusiveConsumer(boolean exclusiveConsumer) { - this.exclusiveConsumer = exclusiveConsumer; - } - - /** - * Adds a transport listener so that a client can be notified of events in - * the underlying transport - */ - public void addTransportListener(TransportListener transportListener) { - transportListeners.add(transportListener); - } - - public void removeTransportListener(TransportListener transportListener) { - transportListeners.remove(transportListener); - } - - public boolean isUseDedicatedTaskRunner() { - return useDedicatedTaskRunner; - } - - public void setUseDedicatedTaskRunner(boolean useDedicatedTaskRunner) { - this.useDedicatedTaskRunner = useDedicatedTaskRunner; - } - - public TaskRunnerFactory getSessionTaskRunner() { - synchronized (this) { - if (sessionTaskRunner == null) { - sessionTaskRunner = new TaskRunnerFactory("ActiveMQ Session Task", ThreadPriorities.INBOUND_CLIENT_SESSION, false, 1000, isUseDedicatedTaskRunner(), maxThreadPoolSize); - sessionTaskRunner.setRejectedTaskHandler(rejectedTaskHandler); - } - } - return sessionTaskRunner; - } - - public void setSessionTaskRunner(TaskRunnerFactory sessionTaskRunner) { - this.sessionTaskRunner = sessionTaskRunner; - } - - public MessageTransformer getTransformer() { - return transformer; - } - - /** - * Sets the transformer used to transform messages before they are sent on - * to the JMS bus or when they are received from the bus but before they are - * delivered to the JMS client - */ - public void setTransformer(MessageTransformer transformer) { - this.transformer = transformer; - } - - /** - * @return the statsEnabled - */ - public boolean isStatsEnabled() { - return this.stats.isEnabled(); - } - - /** - * @param statsEnabled the statsEnabled to set - */ - public void setStatsEnabled(boolean statsEnabled) { - this.stats.setEnabled(statsEnabled); - } - - /** - * Returns the {@link DestinationSource} object which can be used to listen to destinations - * being created or destroyed or to enquire about the current destinations available on the broker - * - * @return a lazily created destination source - * @throws JMSException - */ - @Override - public DestinationSource getDestinationSource() throws JMSException { - if (destinationSource == null) { - destinationSource = new DestinationSource(this); - destinationSource.start(); - } - return destinationSource; - } - - // Implementation methods - // ------------------------------------------------------------------------- - - /** - * Used internally for adding Sessions to the Connection - * - * @param session - * @throws JMSException - * @throws JMSException - */ - protected void addSession(ActiveMQSession session) throws JMSException { - this.sessions.add(session); - if (sessions.size() > 1 || session.isTransacted()) { - optimizedMessageDispatch = false; - } - } - - /** - * Used interanlly for removing Sessions from a Connection - * - * @param session - */ - protected void removeSession(ActiveMQSession session) { - this.sessions.remove(session); - this.removeDispatcher(session); - } - - /** - * Add a ConnectionConsumer - * - * @param connectionConsumer - * @throws JMSException - */ - protected void addConnectionConsumer(ActiveMQConnectionConsumer connectionConsumer) throws JMSException { - this.connectionConsumers.add(connectionConsumer); - } - - /** - * Remove a ConnectionConsumer - * - * @param connectionConsumer - */ - protected void removeConnectionConsumer(ActiveMQConnectionConsumer connectionConsumer) { - this.connectionConsumers.remove(connectionConsumer); - this.removeDispatcher(connectionConsumer); - } - - /** - * Creates a TopicSession object. - * - * @param transacted indicates whether the session is transacted - * @param acknowledgeMode indicates whether the consumer or the client will - * acknowledge any messages it receives; ignored if the - * session is transacted. Legal values are - * Session.AUTO_ACKNOWLEDGE, - * Session.CLIENT_ACKNOWLEDGE, and - * Session.DUPS_OK_ACKNOWLEDGE. - * @return a newly created topic session - * @throws JMSException if the TopicConnection object fails - * to create a session due to some internal error or lack of - * support for the specific transaction and acknowledgement - * mode. - * @see Session#AUTO_ACKNOWLEDGE - * @see Session#CLIENT_ACKNOWLEDGE - * @see Session#DUPS_OK_ACKNOWLEDGE - */ - @Override - public TopicSession createTopicSession(boolean transacted, int acknowledgeMode) throws JMSException { - return new ActiveMQTopicSession((ActiveMQSession)createSession(transacted, acknowledgeMode)); - } - - /** - * Creates a connection consumer for this connection (optional operation). - * This is an expert facility not used by regular JMS clients. - * - * @param topic the topic to access - * @param messageSelector only messages with properties matching the message - * selector expression are delivered. A value of null or an - * empty string indicates that there is no message selector - * for the message consumer. - * @param sessionPool the server session pool to associate with this - * connection consumer - * @param maxMessages the maximum number of messages that can be assigned to - * a server session at one time - * @return the connection consumer - * @throws JMSException if the TopicConnection object fails - * to create a connection consumer due to some internal - * error or invalid arguments for sessionPool - * and messageSelector. - * @throws javax.jms.InvalidDestinationException if an invalid topic is - * specified. - * @throws javax.jms.InvalidSelectorException if the message selector is - * invalid. - * @see javax.jms.ConnectionConsumer - */ - @Override - public ConnectionConsumer createConnectionConsumer(Topic topic, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException { - return createConnectionConsumer(topic, messageSelector, sessionPool, maxMessages, false); - } - - /** - * Creates a connection consumer for this connection (optional operation). - * This is an expert facility not used by regular JMS clients. - * - * @param queue the queue to access - * @param messageSelector only messages with properties matching the message - * selector expression are delivered. A value of null or an - * empty string indicates that there is no message selector - * for the message consumer. - * @param sessionPool the server session pool to associate with this - * connection consumer - * @param maxMessages the maximum number of messages that can be assigned to - * a server session at one time - * @return the connection consumer - * @throws JMSException if the QueueConnection object fails - * to create a connection consumer due to some internal - * error or invalid arguments for sessionPool - * and messageSelector. - * @throws javax.jms.InvalidDestinationException if an invalid queue is - * specified. - * @throws javax.jms.InvalidSelectorException if the message selector is - * invalid. - * @see javax.jms.ConnectionConsumer - */ - @Override - public ConnectionConsumer createConnectionConsumer(Queue queue, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException { - return createConnectionConsumer(queue, messageSelector, sessionPool, maxMessages, false); - } - - /** - * Creates a connection consumer for this connection (optional operation). - * This is an expert facility not used by regular JMS clients. - * - * @param destination the destination to access - * @param messageSelector only messages with properties matching the message - * selector expression are delivered. A value of null or an - * empty string indicates that there is no message selector - * for the message consumer. - * @param sessionPool the server session pool to associate with this - * connection consumer - * @param maxMessages the maximum number of messages that can be assigned to - * a server session at one time - * @return the connection consumer - * @throws JMSException if the Connection object fails to - * create a connection consumer due to some internal error - * or invalid arguments for sessionPool and - * messageSelector. - * @throws javax.jms.InvalidDestinationException if an invalid destination - * is specified. - * @throws javax.jms.InvalidSelectorException if the message selector is - * invalid. - * @see javax.jms.ConnectionConsumer - * @since 1.1 - */ - @Override - public ConnectionConsumer createConnectionConsumer(Destination destination, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException { - return createConnectionConsumer(destination, messageSelector, sessionPool, maxMessages, false); - } - - public ConnectionConsumer createConnectionConsumer(Destination destination, String messageSelector, ServerSessionPool sessionPool, int maxMessages, boolean noLocal) - throws JMSException { - - checkClosedOrFailed(); - ensureConnectionInfoSent(); - - ConsumerId consumerId = createConsumerId(); - ConsumerInfo consumerInfo = new ConsumerInfo(consumerId); - consumerInfo.setDestination(ActiveMQMessageTransformation.transformDestination(destination)); - consumerInfo.setSelector(messageSelector); - consumerInfo.setPrefetchSize(maxMessages); - consumerInfo.setNoLocal(noLocal); - consumerInfo.setDispatchAsync(isDispatchAsync()); - - // Allows the options on the destination to configure the consumerInfo - if (consumerInfo.getDestination().getOptions() != null) { - Map options = new HashMap(consumerInfo.getDestination().getOptions()); - IntrospectionSupport.setProperties(consumerInfo, options, "consumer."); - } - - return new ActiveMQConnectionConsumer(this, sessionPool, consumerInfo); - } - - /** - * @return - */ - private ConsumerId createConsumerId() { - return new ConsumerId(connectionSessionId, consumerIdGenerator.getNextSequenceId()); - } - - /** - * @return - */ - private ProducerId createProducerId() { - return new ProducerId(connectionSessionId, producerIdGenerator.getNextSequenceId()); - } - - /** - * Creates a QueueSession object. - * - * @param transacted indicates whether the session is transacted - * @param acknowledgeMode indicates whether the consumer or the client will - * acknowledge any messages it receives; ignored if the - * session is transacted. Legal values are - * Session.AUTO_ACKNOWLEDGE, - * Session.CLIENT_ACKNOWLEDGE, and - * Session.DUPS_OK_ACKNOWLEDGE. - * @return a newly created queue session - * @throws JMSException if the QueueConnection object fails - * to create a session due to some internal error or lack of - * support for the specific transaction and acknowledgement - * mode. - * @see Session#AUTO_ACKNOWLEDGE - * @see Session#CLIENT_ACKNOWLEDGE - * @see Session#DUPS_OK_ACKNOWLEDGE - */ - @Override - public QueueSession createQueueSession(boolean transacted, int acknowledgeMode) throws JMSException { - return new ActiveMQQueueSession((ActiveMQSession)createSession(transacted, acknowledgeMode)); - } - - /** - * Ensures that the clientID was manually specified and not auto-generated. - * If the clientID was not specified this method will throw an exception. - * This method is used to ensure that the clientID + durableSubscriber name - * are used correctly. - * - * @throws JMSException - */ - public void checkClientIDWasManuallySpecified() throws JMSException { - if (!userSpecifiedClientID) { - throw new JMSException("You cannot create a durable subscriber without specifying a unique clientID on a Connection"); - } - } - - /** - * send a Packet through the Connection - for internal use only - * - * @param command - * @throws JMSException - */ - public void asyncSendPacket(Command command) throws JMSException { - if (isClosed()) { - throw new ConnectionClosedException(); - } else { - doAsyncSendPacket(command); - } - } - - private void doAsyncSendPacket(Command command) throws JMSException { - try { - this.transport.oneway(command); - } catch (IOException e) { - throw JMSExceptionSupport.create(e); - } - } - - /** - * Send a packet through a Connection - for internal use only - * - * @param command - * @return - * @throws JMSException - */ - public void syncSendPacket(final Command command, final AsyncCallback onComplete) throws JMSException { - if(onComplete==null) { - syncSendPacket(command); - } else { - if (isClosed()) { - throw new ConnectionClosedException(); - } - try { - this.transport.asyncRequest(command, new ResponseCallback() { - @Override - public void onCompletion(FutureResponse resp) { - Response response; - Throwable exception = null; - try { - response = resp.getResult(); - if (response.isException()) { - ExceptionResponse er = (ExceptionResponse)response; - exception = er.getException(); - } - } catch (Exception e) { - exception = e; - } - if(exception!=null) { - if ( exception instanceof JMSException) { - onComplete.onException((JMSException) exception); - } else { - if (isClosed()||closing.get()) { - LOG.debug("Received an exception but connection is closing"); - } - JMSException jmsEx = null; - try { - jmsEx = JMSExceptionSupport.create(exception); - } catch(Throwable e) { - LOG.error("Caught an exception trying to create a JMSException for " +exception,e); - } - // dispose of transport for security exceptions on connection initiation - if (exception instanceof SecurityException && command instanceof ConnectionInfo){ - Transport t = transport; - if (null != t){ - ServiceSupport.dispose(t); - } - } - if (jmsEx !=null) { - onComplete.onException(jmsEx); - } - } - } else { - onComplete.onSuccess(); - } - } - }); - } catch (IOException e) { - throw JMSExceptionSupport.create(e); - } - } - } - - public Response syncSendPacket(Command command) throws JMSException { - if (isClosed()) { - throw new ConnectionClosedException(); - } else { - - try { - Response response = (Response)this.transport.request(command); - if (response.isException()) { - ExceptionResponse er = (ExceptionResponse)response; - if (er.getException() instanceof JMSException) { - throw (JMSException)er.getException(); - } else { - if (isClosed()||closing.get()) { - LOG.debug("Received an exception but connection is closing"); - } - JMSException jmsEx = null; - try { - jmsEx = JMSExceptionSupport.create(er.getException()); - } catch(Throwable e) { - LOG.error("Caught an exception trying to create a JMSException for " +er.getException(),e); - } - //dispose of transport for security exceptions - if (er.getException() instanceof SecurityException && command instanceof ConnectionInfo){ - Transport t = this.transport; - if (null != t){ - ServiceSupport.dispose(t); - } - } - if (jmsEx !=null) { - throw jmsEx; - } - } - } - return response; - } catch (IOException e) { - throw JMSExceptionSupport.create(e); - } - } - } - - /** - * Send a packet through a Connection - for internal use only - * - * @param command - * @return - * @throws JMSException - */ - public Response syncSendPacket(Command command, int timeout) throws JMSException { - if (isClosed() || closing.get()) { - throw new ConnectionClosedException(); - } else { - return doSyncSendPacket(command, timeout); - } - } - - private Response doSyncSendPacket(Command command, int timeout) - throws JMSException { - try { - Response response = (Response) (timeout > 0 - ? this.transport.request(command, timeout) - : this.transport.request(command)); - if (response != null && response.isException()) { - ExceptionResponse er = (ExceptionResponse)response; - if (er.getException() instanceof JMSException) { - throw (JMSException)er.getException(); - } else { - throw JMSExceptionSupport.create(er.getException()); - } - } - return response; - } catch (IOException e) { - throw JMSExceptionSupport.create(e); - } - } - - /** - * @return statistics for this Connection - */ - @Override - public StatsImpl getStats() { - return stats; - } - - /** - * simply throws an exception if the Connection is already closed or the - * Transport has failed - * - * @throws JMSException - */ - protected synchronized void checkClosedOrFailed() throws JMSException { - checkClosed(); - if (transportFailed.get()) { - throw new ConnectionFailedException(firstFailureError); - } - } - - /** - * simply throws an exception if the Connection is already closed - * - * @throws JMSException - */ - protected synchronized void checkClosed() throws JMSException { - if (closed.get()) { - throw new ConnectionClosedException(); - } - } - - /** - * Send the ConnectionInfo to the Broker - * - * @throws JMSException - */ - protected void ensureConnectionInfoSent() throws JMSException { - synchronized(this.ensureConnectionInfoSentMutex) { - // Can we skip sending the ConnectionInfo packet?? - if (isConnectionInfoSentToBroker || closed.get()) { - return; - } - //TODO shouldn't this check be on userSpecifiedClientID rather than the value of clientID? - if (info.getClientId() == null || info.getClientId().trim().length() == 0) { - info.setClientId(clientIdGenerator.generateId()); - } - syncSendPacket(info.copy()); - - this.isConnectionInfoSentToBroker = true; - // Add a temp destination advisory consumer so that - // We know what the valid temporary destinations are on the - // broker without having to do an RPC to the broker. - - ConsumerId consumerId = new ConsumerId(new SessionId(info.getConnectionId(), -1), consumerIdGenerator.getNextSequenceId()); - if (watchTopicAdvisories) { - advisoryConsumer = new AdvisoryConsumer(this, consumerId); - } - } - } - - public synchronized boolean isWatchTopicAdvisories() { - return watchTopicAdvisories; - } - - public synchronized void setWatchTopicAdvisories(boolean watchTopicAdvisories) { - this.watchTopicAdvisories = watchTopicAdvisories; - } - - /** - * @return Returns the useAsyncSend. - */ - public boolean isUseAsyncSend() { - return useAsyncSend; - } - - /** - * Forces the use of Async Sends which - * adds a massive performance boost; but means that the send() method will - * return immediately whether the message has been sent or not which could - * lead to message loss. - */ - public void setUseAsyncSend(boolean useAsyncSend) { - this.useAsyncSend = useAsyncSend; - } - - /** - * @return true if always sync send messages - */ - public boolean isAlwaysSyncSend() { - return this.alwaysSyncSend; - } - - /** - * Set true if always require messages to be sync sent - * - * @param alwaysSyncSend - */ - public void setAlwaysSyncSend(boolean alwaysSyncSend) { - this.alwaysSyncSend = alwaysSyncSend; - } - - /** - * @return the messagePrioritySupported - */ - public boolean isMessagePrioritySupported() { - return this.messagePrioritySupported; - } - - /** - * @param messagePrioritySupported the messagePrioritySupported to set - */ - public void setMessagePrioritySupported(boolean messagePrioritySupported) { - this.messagePrioritySupported = messagePrioritySupported; - } - - /** - * Cleans up this connection so that it's state is as if the connection was - * just created. This allows the Resource Adapter to clean up a connection - * so that it can be reused without having to close and recreate the - * connection. - */ - public void cleanup() throws JMSException { - - if (advisoryConsumer != null && !isTransportFailed()) { - advisoryConsumer.dispose(); - advisoryConsumer = null; - } - - for (Iterator i = this.sessions.iterator(); i.hasNext();) { - ActiveMQSession s = i.next(); - s.dispose(); - } - for (Iterator i = this.connectionConsumers.iterator(); i.hasNext();) { - ActiveMQConnectionConsumer c = i.next(); - c.dispose(); - } - for (Iterator i = this.inputStreams.iterator(); i.hasNext();) { - ActiveMQInputStream c = i.next(); - c.dispose(); - } - for (Iterator i = this.outputStreams.iterator(); i.hasNext();) { - ActiveMQOutputStream c = i.next(); - c.dispose(); - } - - if (isConnectionInfoSentToBroker) { - if (!transportFailed.get() && !closing.get()) { - syncSendPacket(info.createRemoveCommand()); - } - isConnectionInfoSentToBroker = false; - } - if (userSpecifiedClientID) { - info.setClientId(null); - userSpecifiedClientID = false; - } - clientIDSet = false; - - started.set(false); - } - - @Override - public void finalize() throws Throwable{ - Scheduler s = this.scheduler; - if (s != null){ - s.stop(); - } - } - - /** - * Changes the associated username/password that is associated with this - * connection. If the connection has been used, you must called cleanup() - * before calling this method. - * - * @throws IllegalStateException if the connection is in used. - */ - public void changeUserInfo(String userName, String password) throws JMSException { - if (isConnectionInfoSentToBroker) { - throw new IllegalStateException("changeUserInfo used Connection is not allowed"); - } - this.info.setUserName(userName); - this.info.setPassword(password); - } - - /** - * @return Returns the resourceManagerId. - * @throws JMSException - */ - public String getResourceManagerId() throws JMSException { - waitForBrokerInfo(); - if (brokerInfo == null) { - throw new JMSException("Connection failed before Broker info was received."); - } - return brokerInfo.getBrokerId().getValue(); - } - - /** - * Returns the broker name if one is available or null if one is not - * available yet. - */ - public String getBrokerName() { - try { - brokerInfoReceived.await(5, TimeUnit.SECONDS); - if (brokerInfo == null) { - return null; - } - return brokerInfo.getBrokerName(); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - return null; - } - } - - /** - * Returns the broker information if it is available or null if it is not - * available yet. - */ - public BrokerInfo getBrokerInfo() { - return brokerInfo; - } - - /** - * @return Returns the RedeliveryPolicy. - * @throws JMSException - */ - public RedeliveryPolicy getRedeliveryPolicy() throws JMSException { - return redeliveryPolicyMap.getDefaultEntry(); - } - - /** - * Sets the redelivery policy to be used when messages are rolled back - */ - public void setRedeliveryPolicy(RedeliveryPolicy redeliveryPolicy) { - this.redeliveryPolicyMap.setDefaultEntry(redeliveryPolicy); - } - - public BlobTransferPolicy getBlobTransferPolicy() { - if (blobTransferPolicy == null) { - blobTransferPolicy = createBlobTransferPolicy(); - } - return blobTransferPolicy; - } - - /** - * Sets the policy used to describe how out-of-band BLOBs (Binary Large - * OBjects) are transferred from producers to brokers to consumers - */ - public void setBlobTransferPolicy(BlobTransferPolicy blobTransferPolicy) { - this.blobTransferPolicy = blobTransferPolicy; - } - - /** - * @return Returns the alwaysSessionAsync. - */ - public boolean isAlwaysSessionAsync() { - return alwaysSessionAsync; - } - - /** - * If this flag is not set then a separate thread is not used for dispatching messages for each Session in - * the Connection. However, a separate thread is always used if there is more than one session, or the session - * isn't in auto acknowledge or duplicates ok mode. By default this value is set to true and session dispatch - * happens asynchronously. - */ - public void setAlwaysSessionAsync(boolean alwaysSessionAsync) { - this.alwaysSessionAsync = alwaysSessionAsync; - } - - /** - * @return Returns the optimizeAcknowledge. - */ - public boolean isOptimizeAcknowledge() { - return optimizeAcknowledge; - } - - /** - * Enables an optimised acknowledgement mode where messages are acknowledged - * in batches rather than individually - * - * @param optimizeAcknowledge The optimizeAcknowledge to set. - */ - public void setOptimizeAcknowledge(boolean optimizeAcknowledge) { - this.optimizeAcknowledge = optimizeAcknowledge; - } - - /** - * The max time in milliseconds between optimized ack batches - * @param optimizeAcknowledgeTimeOut - */ - public void setOptimizeAcknowledgeTimeOut(long optimizeAcknowledgeTimeOut) { - this.optimizeAcknowledgeTimeOut = optimizeAcknowledgeTimeOut; - } - - public long getOptimizeAcknowledgeTimeOut() { - return optimizeAcknowledgeTimeOut; - } - - public long getWarnAboutUnstartedConnectionTimeout() { - return warnAboutUnstartedConnectionTimeout; - } - - /** - * Enables the timeout from a connection creation to when a warning is - * generated if the connection is not properly started via {@link #start()} - * and a message is received by a consumer. It is a very common gotcha to - * forget to start - * the connection so this option makes the default case to create a - * warning if the user forgets. To disable the warning just set the value to < - * 0 (say -1). - */ - public void setWarnAboutUnstartedConnectionTimeout(long warnAboutUnstartedConnectionTimeout) { - this.warnAboutUnstartedConnectionTimeout = warnAboutUnstartedConnectionTimeout; - } - - /** - * @return the sendTimeout - */ - public int getSendTimeout() { - return sendTimeout; - } - - /** - * @param sendTimeout the sendTimeout to set - */ - public void setSendTimeout(int sendTimeout) { - this.sendTimeout = sendTimeout; - } - - /** - * @return the sendAcksAsync - */ - public boolean isSendAcksAsync() { - return sendAcksAsync; - } - - /** - * @param sendAcksAsync the sendAcksAsync to set - */ - public void setSendAcksAsync(boolean sendAcksAsync) { - this.sendAcksAsync = sendAcksAsync; - } - - /** - * Returns the time this connection was created - */ - public long getTimeCreated() { - return timeCreated; - } - - private void waitForBrokerInfo() throws JMSException { - try { - brokerInfoReceived.await(); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw JMSExceptionSupport.create(e); - } - } - - // Package protected so that it can be used in unit tests - public Transport getTransport() { - return transport; - } - - public void addProducer(ProducerId producerId, ActiveMQMessageProducer producer) { - producers.put(producerId, producer); - } - - public void removeProducer(ProducerId producerId) { - producers.remove(producerId); - } - - public void addDispatcher(ConsumerId consumerId, ActiveMQDispatcher dispatcher) { - dispatchers.put(consumerId, dispatcher); - } - - public void removeDispatcher(ConsumerId consumerId) { - dispatchers.remove(consumerId); - } - - /** - * @param o - the command to consume - */ - @Override - public void onCommand(final Object o) { - final Command command = (Command)o; - if (!closed.get() && command != null) { - try { - command.visit(new CommandVisitorAdapter() { - @Override - public Response processMessageDispatch(MessageDispatch md) throws Exception { - waitForTransportInterruptionProcessingToComplete(); - ActiveMQDispatcher dispatcher = dispatchers.get(md.getConsumerId()); - if (dispatcher != null) { - // Copy in case a embedded broker is dispatching via - // vm:// - // md.getMessage() == null to signal end of queue - // browse. - Message msg = md.getMessage(); - if (msg != null) { - msg = msg.copy(); - msg.setReadOnlyBody(true); - msg.setReadOnlyProperties(true); - msg.setRedeliveryCounter(md.getRedeliveryCounter()); - msg.setConnection(ActiveMQConnection.this); - msg.setMemoryUsage(null); - md.setMessage(msg); - } - dispatcher.dispatch(md); - } - return null; - } - - @Override - public Response processProducerAck(ProducerAck pa) throws Exception { - if (pa != null && pa.getProducerId() != null) { - ActiveMQMessageProducer producer = producers.get(pa.getProducerId()); - if (producer != null) { - producer.onProducerAck(pa); - } - } - return null; - } - - @Override - public Response processBrokerInfo(BrokerInfo info) throws Exception { - brokerInfo = info; - brokerInfoReceived.countDown(); - optimizeAcknowledge &= !brokerInfo.isFaultTolerantConfiguration(); - getBlobTransferPolicy().setBrokerUploadUrl(info.getBrokerUploadUrl()); - return null; - } - - @Override - public Response processConnectionError(final ConnectionError error) throws Exception { - executor.execute(new Runnable() { - @Override - public void run() { - onAsyncException(error.getException()); - } - }); - return null; - } - - @Override - public Response processControlCommand(ControlCommand command) throws Exception { - onControlCommand(command); - return null; - } - - @Override - public Response processConnectionControl(ConnectionControl control) throws Exception { - onConnectionControl((ConnectionControl)command); - return null; - } - - @Override - public Response processConsumerControl(ConsumerControl control) throws Exception { - onConsumerControl((ConsumerControl)command); - return null; - } - - @Override - public Response processWireFormat(WireFormatInfo info) throws Exception { - onWireFormatInfo((WireFormatInfo)command); - return null; - } - }); - } catch (Exception e) { - onClientInternalException(e); - } - } - - for (Iterator iter = transportListeners.iterator(); iter.hasNext();) { - TransportListener listener = iter.next(); - listener.onCommand(command); - } - } - - protected void onWireFormatInfo(WireFormatInfo info) { - protocolVersion.set(info.getVersion()); - } - - /** - * Handles async client internal exceptions. - * A client internal exception is usually one that has been thrown - * by a container runtime component during asynchronous processing of a - * message that does not affect the connection itself. - * This method notifies the ClientInternalExceptionListener by invoking - * its onException method, if one has been registered with this connection. - * - * @param error the exception that the problem - */ - public void onClientInternalException(final Throwable error) { - if ( !closed.get() && !closing.get() ) { - if ( this.clientInternalExceptionListener != null ) { - executor.execute(new Runnable() { - @Override - public void run() { - ActiveMQConnection.this.clientInternalExceptionListener.onException(error); - } - }); - } else { - LOG.debug("Async client internal exception occurred with no exception listener registered: " - + error, error); - } - } - } - - /** - * Used for handling async exceptions - * - * @param error - */ - public void onAsyncException(Throwable error) { - if (!closed.get() && !closing.get()) { - if (this.exceptionListener != null) { - - if (!(error instanceof JMSException)) { - error = JMSExceptionSupport.create(error); - } - final JMSException e = (JMSException)error; - - executor.execute(new Runnable() { - @Override - public void run() { - ActiveMQConnection.this.exceptionListener.onException(e); - } - }); - - } else { - LOG.debug("Async exception with no exception listener: " + error, error); - } - } - } - - @Override - public void onException(final IOException error) { - onAsyncException(error); - if (!closing.get() && !closed.get()) { - executor.execute(new Runnable() { - @Override - public void run() { - transportFailed(error); - ServiceSupport.dispose(ActiveMQConnection.this.transport); - brokerInfoReceived.countDown(); - try { - cleanup(); - } catch (JMSException e) { - LOG.warn("Exception during connection cleanup, " + e, e); - } - for (Iterator iter = transportListeners.iterator(); iter.hasNext();) { - TransportListener listener = iter.next(); - listener.onException(error); - } - } - }); - } - } - - @Override - public void transportInterupted() { - transportInterruptionProcessingComplete.set(1); - for (Iterator i = this.sessions.iterator(); i.hasNext();) { - ActiveMQSession s = i.next(); - s.clearMessagesInProgress(transportInterruptionProcessingComplete); - } - - for (ActiveMQConnectionConsumer connectionConsumer : this.connectionConsumers) { - connectionConsumer.clearMessagesInProgress(transportInterruptionProcessingComplete); - } - - if (transportInterruptionProcessingComplete.decrementAndGet() > 0) { - if (LOG.isDebugEnabled()) { - LOG.debug("transport interrupted - processing required, dispatchers: " + transportInterruptionProcessingComplete.get()); - } - signalInterruptionProcessingNeeded(); - } - - for (Iterator iter = transportListeners.iterator(); iter.hasNext();) { - TransportListener listener = iter.next(); - listener.transportInterupted(); - } - } - - @Override - public void transportResumed() { - for (Iterator iter = transportListeners.iterator(); iter.hasNext();) { - TransportListener listener = iter.next(); - listener.transportResumed(); - } - } - - /** - * Create the DestinationInfo object for the temporary destination. - * - * @param topic - if its true topic, else queue. - * @return DestinationInfo - * @throws JMSException - */ - protected ActiveMQTempDestination createTempDestination(boolean topic) throws JMSException { - - // Check if Destination info is of temporary type. - ActiveMQTempDestination dest; - if (topic) { - dest = new ActiveMQTempTopic(info.getConnectionId(), tempDestinationIdGenerator.getNextSequenceId()); - } else { - dest = new ActiveMQTempQueue(info.getConnectionId(), tempDestinationIdGenerator.getNextSequenceId()); - } - - DestinationInfo info = new DestinationInfo(); - info.setConnectionId(this.info.getConnectionId()); - info.setOperationType(DestinationInfo.ADD_OPERATION_TYPE); - info.setDestination(dest); - syncSendPacket(info); - - dest.setConnection(this); - activeTempDestinations.put(dest, dest); - return dest; - } - - /** - * @param destination - * @throws JMSException - */ - public void deleteTempDestination(ActiveMQTempDestination destination) throws JMSException { - - checkClosedOrFailed(); - - for (ActiveMQSession session : this.sessions) { - if (session.isInUse(destination)) { - throw new JMSException("A consumer is consuming from the temporary destination"); - } - } - - activeTempDestinations.remove(destination); - - DestinationInfo destInfo = new DestinationInfo(); - destInfo.setConnectionId(this.info.getConnectionId()); - destInfo.setOperationType(DestinationInfo.REMOVE_OPERATION_TYPE); - destInfo.setDestination(destination); - destInfo.setTimeout(0); - syncSendPacket(destInfo); - } - - public boolean isDeleted(ActiveMQDestination dest) { - - // If we are not watching the advisories.. then - // we will assume that the temp destination does exist. - if (advisoryConsumer == null) { - return false; - } - - return !activeTempDestinations.contains(dest); - } - - public boolean isCopyMessageOnSend() { - return copyMessageOnSend; - } - - public LongSequenceGenerator getLocalTransactionIdGenerator() { - return localTransactionIdGenerator; - } - - public boolean isUseCompression() { - return useCompression; - } - - /** - * Enables the use of compression of the message bodies - */ - public void setUseCompression(boolean useCompression) { - this.useCompression = useCompression; - } - - public void destroyDestination(ActiveMQDestination destination) throws JMSException { - - checkClosedOrFailed(); - ensureConnectionInfoSent(); - - DestinationInfo info = new DestinationInfo(); - info.setConnectionId(this.info.getConnectionId()); - info.setOperationType(DestinationInfo.REMOVE_OPERATION_TYPE); - info.setDestination(destination); - info.setTimeout(0); - syncSendPacket(info); - } - - public boolean isDispatchAsync() { - return dispatchAsync; - } - - /** - * Enables or disables the default setting of whether or not consumers have - * their messages dispatched - * synchronously or asynchronously by the broker. For non-durable - * topics for example we typically dispatch synchronously by default to - * minimize context switches which boost performance. However sometimes its - * better to go slower to ensure that a single blocked consumer socket does - * not block delivery to other consumers. - * - * @param asyncDispatch If true then consumers created on this connection - * will default to having their messages dispatched - * asynchronously. The default value is true. - */ - public void setDispatchAsync(boolean asyncDispatch) { - this.dispatchAsync = asyncDispatch; - } - - public boolean isObjectMessageSerializationDefered() { - return objectMessageSerializationDefered; - } - - /** - * When an object is set on an ObjectMessage, the JMS spec requires the - * object to be serialized by that set method. Enabling this flag causes the - * object to not get serialized. The object may subsequently get serialized - * if the message needs to be sent over a socket or stored to disk. - */ - public void setObjectMessageSerializationDefered(boolean objectMessageSerializationDefered) { - this.objectMessageSerializationDefered = objectMessageSerializationDefered; - } - - @Override - public InputStream createInputStream(Destination dest) throws JMSException { - return createInputStream(dest, null); - } - - @Override - public InputStream createInputStream(Destination dest, String messageSelector) throws JMSException { - return createInputStream(dest, messageSelector, false); - } - - @Override - public InputStream createInputStream(Destination dest, String messageSelector, boolean noLocal) throws JMSException { - return createInputStream(dest, messageSelector, noLocal, -1); - } - - @Override - public InputStream createInputStream(Destination dest, String messageSelector, boolean noLocal, long timeout) throws JMSException { - return doCreateInputStream(dest, messageSelector, noLocal, null, timeout); - } - - @Override - public InputStream createDurableInputStream(Topic dest, String name) throws JMSException { - return createInputStream(dest, null, false); - } - - @Override - public InputStream createDurableInputStream(Topic dest, String name, String messageSelector) throws JMSException { - return createDurableInputStream(dest, name, messageSelector, false); - } - - @Override - public InputStream createDurableInputStream(Topic dest, String name, String messageSelector, boolean noLocal) throws JMSException { - return createDurableInputStream(dest, name, messageSelector, noLocal, -1); - } - - @Override - public InputStream createDurableInputStream(Topic dest, String name, String messageSelector, boolean noLocal, long timeout) throws JMSException { - return doCreateInputStream(dest, messageSelector, noLocal, name, timeout); - } - - private InputStream doCreateInputStream(Destination dest, String messageSelector, boolean noLocal, String subName, long timeout) throws JMSException { - checkClosedOrFailed(); - ensureConnectionInfoSent(); - return new ActiveMQInputStream(this, createConsumerId(), ActiveMQDestination.transform(dest), messageSelector, noLocal, subName, prefetchPolicy.getInputStreamPrefetch(), timeout); - } - - /** - * Creates a persistent output stream; individual messages will be written - * to disk/database by the broker - */ - @Override - public OutputStream createOutputStream(Destination dest) throws JMSException { - return createOutputStream(dest, null, ActiveMQMessage.DEFAULT_DELIVERY_MODE, ActiveMQMessage.DEFAULT_PRIORITY, ActiveMQMessage.DEFAULT_TIME_TO_LIVE); - } - - /** - * Creates a non persistent output stream; messages will not be written to - * disk - */ - public OutputStream createNonPersistentOutputStream(Destination dest) throws JMSException { - return createOutputStream(dest, null, DeliveryMode.NON_PERSISTENT, ActiveMQMessage.DEFAULT_PRIORITY, ActiveMQMessage.DEFAULT_TIME_TO_LIVE); - } - - /** - * Creates an output stream allowing full control over the delivery mode, - * the priority and time to live of the messages and the properties added to - * messages on the stream. - * - * @param streamProperties defines a map of key-value pairs where the keys - * are strings and the values are primitive values (numbers - * and strings) which are appended to the messages similarly - * to using the - * {@link javax.jms.Message#setObjectProperty(String, Object)} - * method - */ - @Override - public OutputStream createOutputStream(Destination dest, Map streamProperties, int deliveryMode, int priority, long timeToLive) throws JMSException { - checkClosedOrFailed(); - ensureConnectionInfoSent(); - return new ActiveMQOutputStream(this, createProducerId(), ActiveMQDestination.transform(dest), streamProperties, deliveryMode, priority, timeToLive); - } - - /** - * Unsubscribes a durable subscription that has been created by a client. - *

    - * This method deletes the state being maintained on behalf of the - * subscriber by its provider. - *

    - * It is erroneous for a client to delete a durable subscription while there - * is an active MessageConsumer or - * TopicSubscriber for the subscription, or while a consumed - * message is part of a pending transaction or has not been acknowledged in - * the session. - * - * @param name the name used to identify this subscription - * @throws JMSException if the session fails to unsubscribe to the durable - * subscription due to some internal error. - * @throws InvalidDestinationException if an invalid subscription name is - * specified. - * @since 1.1 - */ - @Override - public void unsubscribe(String name) throws InvalidDestinationException, JMSException { - checkClosedOrFailed(); - RemoveSubscriptionInfo rsi = new RemoveSubscriptionInfo(); - rsi.setConnectionId(getConnectionInfo().getConnectionId()); - rsi.setSubscriptionName(name); - rsi.setClientId(getConnectionInfo().getClientId()); - syncSendPacket(rsi); - } - - /** - * Internal send method optimized: - It does not copy the message - It can - * only handle ActiveMQ messages. - You can specify if the send is async or - * sync - Does not allow you to send /w a transaction. - */ - void send(ActiveMQDestination destination, ActiveMQMessage msg, MessageId messageId, int deliveryMode, int priority, long timeToLive, boolean async) throws JMSException { - checkClosedOrFailed(); - - if (destination.isTemporary() && isDeleted(destination)) { - throw new JMSException("Cannot publish to a deleted Destination: " + destination); - } - - msg.setJMSDestination(destination); - msg.setJMSDeliveryMode(deliveryMode); - long expiration = 0L; - - if (!isDisableTimeStampsByDefault()) { - long timeStamp = System.currentTimeMillis(); - msg.setJMSTimestamp(timeStamp); - if (timeToLive > 0) { - expiration = timeToLive + timeStamp; - } - } - - msg.setJMSExpiration(expiration); - msg.setJMSPriority(priority); - msg.setJMSRedelivered(false); - msg.setMessageId(messageId); - msg.onSend(); - msg.setProducerId(msg.getMessageId().getProducerId()); - - if (LOG.isDebugEnabled()) { - LOG.debug("Sending message: " + msg); - } - - if (async) { - asyncSendPacket(msg); - } else { - syncSendPacket(msg); - } - } - - public void addOutputStream(ActiveMQOutputStream stream) { - outputStreams.add(stream); - } - - public void removeOutputStream(ActiveMQOutputStream stream) { - outputStreams.remove(stream); - } - - public void addInputStream(ActiveMQInputStream stream) { - inputStreams.add(stream); - } - - public void removeInputStream(ActiveMQInputStream stream) { - inputStreams.remove(stream); - } - - protected void onControlCommand(ControlCommand command) { - String text = command.getCommand(); - if (text != null) { - if ("shutdown".equals(text)) { - LOG.info("JVM told to shutdown"); - System.exit(0); - } - - // TODO Should we handle the "close" case? - // if (false && "close".equals(text)){ - // LOG.error("Broker " + getBrokerInfo() + "shutdown connection"); - // try { - // close(); - // } catch (JMSException e) { - // } - // } - } - } - - protected void onConnectionControl(ConnectionControl command) { - if (command.isFaultTolerant()) { - this.optimizeAcknowledge = false; - for (Iterator i = this.sessions.iterator(); i.hasNext();) { - ActiveMQSession s = i.next(); - s.setOptimizeAcknowledge(false); - } - } - } - - protected void onConsumerControl(ConsumerControl command) { - if (command.isClose()) { - for (ActiveMQSession session : this.sessions) { - session.close(command.getConsumerId()); - } - } else { - for (ActiveMQSession session : this.sessions) { - session.setPrefetchSize(command.getConsumerId(), command.getPrefetch()); - } - for (ActiveMQConnectionConsumer connectionConsumer: connectionConsumers) { - ConsumerInfo consumerInfo = connectionConsumer.getConsumerInfo(); - if (consumerInfo.getConsumerId().equals(command.getConsumerId())) { - consumerInfo.setPrefetchSize(command.getPrefetch()); - } - } - } - } - - protected void transportFailed(IOException error) { - transportFailed.set(true); - if (firstFailureError == null) { - firstFailureError = error; - } - } - - /** - * Should a JMS message be copied to a new JMS Message object as part of the - * send() method in JMS. This is enabled by default to be compliant with the - * JMS specification. You can disable it if you do not mutate JMS messages - * after they are sent for a performance boost - */ - public void setCopyMessageOnSend(boolean copyMessageOnSend) { - this.copyMessageOnSend = copyMessageOnSend; - } - - @Override - public String toString() { - return "ActiveMQConnection {id=" + info.getConnectionId() + ",clientId=" + info.getClientId() + ",started=" + started.get() + "}"; - } - - protected BlobTransferPolicy createBlobTransferPolicy() { - return new BlobTransferPolicy(); - } - - public int getProtocolVersion() { - return protocolVersion.get(); - } - - public int getProducerWindowSize() { - return producerWindowSize; - } - - public void setProducerWindowSize(int producerWindowSize) { - this.producerWindowSize = producerWindowSize; - } - - public void setAuditDepth(int auditDepth) { - connectionAudit.setAuditDepth(auditDepth); - } - - public void setAuditMaximumProducerNumber(int auditMaximumProducerNumber) { - connectionAudit.setAuditMaximumProducerNumber(auditMaximumProducerNumber); - } - - protected void removeDispatcher(ActiveMQDispatcher dispatcher) { - connectionAudit.removeDispatcher(dispatcher); - } - - protected boolean isDuplicate(ActiveMQDispatcher dispatcher, Message message) { - return checkForDuplicates && connectionAudit.isDuplicate(dispatcher, message); - } - - protected void rollbackDuplicate(ActiveMQDispatcher dispatcher, Message message) { - connectionAudit.rollbackDuplicate(dispatcher, message); - } - - public IOException getFirstFailureError() { - return firstFailureError; - } - - protected void waitForTransportInterruptionProcessingToComplete() throws InterruptedException { - if (!closed.get() && !transportFailed.get() && transportInterruptionProcessingComplete.get()>0) { - LOG.warn("dispatch with outstanding dispatch interruption processing count " + transportInterruptionProcessingComplete.get()); - signalInterruptionProcessingComplete(); - } - } - - protected void transportInterruptionProcessingComplete() { - if (transportInterruptionProcessingComplete.decrementAndGet() == 0) { - signalInterruptionProcessingComplete(); - } - } - - private void signalInterruptionProcessingComplete() { - if (LOG.isDebugEnabled()) { - LOG.debug("transportInterruptionProcessingComplete: " + transportInterruptionProcessingComplete.get() - + " for:" + this.getConnectionInfo().getConnectionId()); - } - - FailoverTransport failoverTransport = transport.narrow(FailoverTransport.class); - if (failoverTransport != null) { - failoverTransport.connectionInterruptProcessingComplete(this.getConnectionInfo().getConnectionId()); - if (LOG.isDebugEnabled()) { - LOG.debug("notified failover transport (" + failoverTransport - + ") of interruption completion for: " + this.getConnectionInfo().getConnectionId()); - } - } - transportInterruptionProcessingComplete.set(0); - } - - private void signalInterruptionProcessingNeeded() { - FailoverTransport failoverTransport = transport.narrow(FailoverTransport.class); - if (failoverTransport != null) { - failoverTransport.getStateTracker().transportInterrupted(this.getConnectionInfo().getConnectionId()); - if (LOG.isDebugEnabled()) { - LOG.debug("notified failover transport (" + failoverTransport - + ") of pending interruption processing for: " + this.getConnectionInfo().getConnectionId()); - } - } - } - - /* - * specify the amount of time in milliseconds that a consumer with a transaction pending recovery - * will wait to receive re dispatched messages. - * default value is 0 so there is no wait by default. - */ - public void setConsumerFailoverRedeliveryWaitPeriod(long consumerFailoverRedeliveryWaitPeriod) { - this.consumerFailoverRedeliveryWaitPeriod = consumerFailoverRedeliveryWaitPeriod; - } - - public long getConsumerFailoverRedeliveryWaitPeriod() { - return consumerFailoverRedeliveryWaitPeriod; - } - - protected Scheduler getScheduler() throws JMSException { - Scheduler result = scheduler; - if (result == null) { - synchronized (this) { - result = scheduler; - if (result == null) { - checkClosed(); - try { - result = scheduler = new Scheduler("ActiveMQConnection["+info.getConnectionId().getValue()+"] Scheduler"); - scheduler.start(); - } catch(Exception e) { - throw JMSExceptionSupport.create(e); - } - } - } - } - return result; - } - - protected ThreadPoolExecutor getExecutor() { - return this.executor; - } - - /** - * @return the checkForDuplicates - */ - public boolean isCheckForDuplicates() { - return this.checkForDuplicates; - } - - /** - * @param checkForDuplicates the checkForDuplicates to set - */ - public void setCheckForDuplicates(boolean checkForDuplicates) { - this.checkForDuplicates = checkForDuplicates; - } - - public boolean isTransactedIndividualAck() { - return transactedIndividualAck; - } - - public void setTransactedIndividualAck(boolean transactedIndividualAck) { - this.transactedIndividualAck = transactedIndividualAck; - } - - public boolean isNonBlockingRedelivery() { - return nonBlockingRedelivery; - } - - public void setNonBlockingRedelivery(boolean nonBlockingRedelivery) { - this.nonBlockingRedelivery = nonBlockingRedelivery; - } - - /** - * Removes any TempDestinations that this connection has cached, ignoring - * any exceptions generated because the destination is in use as they should - * not be removed. - * Used from a pooled connection, b/c it will not be explicitly closed. - */ - public void cleanUpTempDestinations() { - - if (this.activeTempDestinations == null || this.activeTempDestinations.isEmpty()) { - return; - } - - Iterator> entries - = this.activeTempDestinations.entrySet().iterator(); - while(entries.hasNext()) { - ConcurrentHashMap.Entry entry = entries.next(); - try { - // Only delete this temp destination if it was created from this connection. The connection used - // for the advisory consumer may also have a reference to this temp destination. - ActiveMQTempDestination dest = entry.getValue(); - String thisConnectionId = (info.getConnectionId() == null) ? "" : info.getConnectionId().toString(); - if (dest.getConnectionId() != null && dest.getConnectionId().equals(thisConnectionId)) { - this.deleteTempDestination(entry.getValue()); - } - } catch (Exception ex) { - // the temp dest is in use so it can not be deleted. - // it is ok to leave it to connection tear down phase - } - } - } - - /** - * Sets the Connection wide RedeliveryPolicyMap for handling messages that are being rolled back. - * @param redeliveryPolicyMap the redeliveryPolicyMap to set - */ - public void setRedeliveryPolicyMap(RedeliveryPolicyMap redeliveryPolicyMap) { - this.redeliveryPolicyMap = redeliveryPolicyMap; - } - - /** - * Gets the Connection's configured RedeliveryPolicyMap which will be used by all the - * Consumers when dealing with transaction messages that have been rolled back. - * - * @return the redeliveryPolicyMap - */ - public RedeliveryPolicyMap getRedeliveryPolicyMap() { - return redeliveryPolicyMap; - } - - public int getMaxThreadPoolSize() { - return maxThreadPoolSize; - } - - public void setMaxThreadPoolSize(int maxThreadPoolSize) { - this.maxThreadPoolSize = maxThreadPoolSize; - } - - /** - * Enable enforcement of QueueConnection semantics. - * - * @return this object, useful for chaining - */ - ActiveMQConnection enforceQueueOnlyConnection() { - this.queueOnlyConnection = true; - return this; - } - - public RejectedExecutionHandler getRejectedTaskHandler() { - return rejectedTaskHandler; - } - - public void setRejectedTaskHandler(RejectedExecutionHandler rejectedTaskHandler) { - this.rejectedTaskHandler = rejectedTaskHandler; - } - - /** - * Gets the configured time interval that is used to force all MessageConsumers that have optimizedAcknowledge enabled - * to send an ack for any outstanding Message Acks. By default this value is set to zero meaning that the consumers - * will not do any background Message acknowledgment. - * - * @return the scheduledOptimizedAckInterval - */ - public long getOptimizedAckScheduledAckInterval() { - return optimizedAckScheduledAckInterval; - } - - /** - * Sets the amount of time between scheduled sends of any outstanding Message Acks for consumers that - * have been configured with optimizeAcknowledge enabled. - * - * @param optimizedAckScheduledAckInterval the scheduledOptimizedAckInterval to set - */ - public void setOptimizedAckScheduledAckInterval(long optimizedAckScheduledAckInterval) { - this.optimizedAckScheduledAckInterval = optimizedAckScheduledAckInterval; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnectionConsumer.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnectionConsumer.class deleted file mode 100644 index 51a7313d7..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnectionConsumer.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnectionConsumer.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnectionConsumer.java deleted file mode 100644 index ba4b9ddb8..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnectionConsumer.java +++ /dev/null @@ -1,168 +0,0 @@ -/** - * 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; - -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.atomic.AtomicInteger; - -import javax.jms.ConnectionConsumer; -import javax.jms.IllegalStateException; -import javax.jms.JMSException; -import javax.jms.ServerSession; -import javax.jms.ServerSessionPool; -import javax.jms.Session; - -import org.apache.activemq.command.ConsumerId; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.command.MessageDispatch; - -/** - * For application servers, Connection objects provide a special - * facility for creating a ConnectionConsumer (optional). The - * messages it is to consume are specified by a Destination and a - * message selector. In addition, a ConnectionConsumer must be - * given a ServerSessionPool to use for processing its messages. - *

    - *

    - * Normally, when traffic is light, a ConnectionConsumer gets a - * ServerSession from its pool, loads it with a single message, - * and starts it. As traffic picks up, messages can back up. If this happens, a - * ConnectionConsumer can load each ServerSession - * with more than one message. This reduces the thread context switches and - * minimizes resource use at the expense of some serialization of message - * processing. - * - * @see javax.jms.Connection#createConnectionConsumer - * @see javax.jms.Connection#createDurableConnectionConsumer - * @see javax.jms.QueueConnection#createConnectionConsumer - * @see javax.jms.TopicConnection#createConnectionConsumer - * @see javax.jms.TopicConnection#createDurableConnectionConsumer - */ - -public class ActiveMQConnectionConsumer implements ConnectionConsumer, ActiveMQDispatcher { - - private ActiveMQConnection connection; - private ServerSessionPool sessionPool; - private ConsumerInfo consumerInfo; - private boolean closed; - - /** - * Create a ConnectionConsumer - * - * @param theConnection - * @param theSessionPool - * @param theConsumerInfo - * @throws JMSException - */ - protected ActiveMQConnectionConsumer(ActiveMQConnection theConnection, ServerSessionPool theSessionPool, ConsumerInfo theConsumerInfo) throws JMSException { - this.connection = theConnection; - this.sessionPool = theSessionPool; - this.consumerInfo = theConsumerInfo; - - this.connection.addConnectionConsumer(this); - this.connection.addDispatcher(consumerInfo.getConsumerId(), this); - this.connection.syncSendPacket(this.consumerInfo); - } - - /** - * Gets the server session pool associated with this connection consumer. - * - * @return the server session pool used by this connection consumer - * @throws JMSException if the JMS provider fails to get the server session - * pool associated with this consumer due to some internal - * error. - */ - - public ServerSessionPool getServerSessionPool() throws JMSException { - if (closed) { - throw new IllegalStateException("The Connection Consumer is closed"); - } - return this.sessionPool; - } - - /** - * Closes the connection consumer.

    - *

    - * Since a provider may allocate some resources on behalf of a connection - * consumer outside the Java virtual machine, clients should close these - * resources when they are not needed. Relying on garbage collection to - * eventually reclaim these resources may not be timely enough. - * - * @throws JMSException - */ - - public void close() throws JMSException { - if (!closed) { - dispose(); - this.connection.asyncSendPacket(this.consumerInfo.createRemoveCommand()); - } - - } - - public void dispose() { - if (!closed) { - this.connection.removeDispatcher(consumerInfo.getConsumerId()); - this.connection.removeConnectionConsumer(this); - closed = true; - } - } - - public void dispatch(MessageDispatch messageDispatch) { - try { - messageDispatch.setConsumer(this); - - ServerSession serverSession = sessionPool.getServerSession(); - Session s = serverSession.getSession(); - ActiveMQSession session = null; - - if (s instanceof ActiveMQSession) { - session = (ActiveMQSession)s; - } else if (s instanceof ActiveMQTopicSession) { - ActiveMQTopicSession topicSession = (ActiveMQTopicSession)s; - session = (ActiveMQSession)topicSession.getNext(); - } else if (s instanceof ActiveMQQueueSession) { - ActiveMQQueueSession queueSession = (ActiveMQQueueSession)s; - session = (ActiveMQSession)queueSession.getNext(); - } else { - connection.onClientInternalException(new JMSException("Session pool provided an invalid session type: " + s.getClass())); - return; - } - - session.dispatch(messageDispatch); - serverSession.start(); - } catch (JMSException e) { - connection.onAsyncException(e); - } - } - - public String toString() { - return "ActiveMQConnectionConsumer { value=" + consumerInfo.getConsumerId() + " }"; - } - - public void clearMessagesInProgress(AtomicInteger transportInterruptionProcessingComplete) { - // future: may want to deal with rollback of in progress messages to track re deliveries - // before indicating that all is complete. - } - - public ConsumerInfo getConsumerInfo() { - return consumerInfo; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnectionFactory.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnectionFactory.class deleted file mode 100644 index c4edf2e55..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnectionFactory.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnectionFactory.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnectionFactory.java deleted file mode 100644 index fbbfc2b6c..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnectionFactory.java +++ /dev/null @@ -1,1152 +0,0 @@ -/** - * 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; - -import java.net.URI; -import java.net.URISyntaxException; -import java.util.HashMap; -import java.util.Map; -import java.util.Properties; -import java.util.concurrent.RejectedExecutionHandler; - -import javax.jms.Connection; -import javax.jms.ConnectionFactory; -import javax.jms.ExceptionListener; -import javax.jms.JMSException; -import javax.jms.QueueConnection; -import javax.jms.QueueConnectionFactory; -import javax.jms.TopicConnection; -import javax.jms.TopicConnectionFactory; -import javax.naming.Context; - -import org.apache.activemq.blob.BlobTransferPolicy; -import org.apache.activemq.broker.region.policy.RedeliveryPolicyMap; -import org.apache.activemq.jndi.JNDIBaseStorable; -import org.apache.activemq.management.JMSStatsImpl; -import org.apache.activemq.management.StatsCapable; -import org.apache.activemq.management.StatsImpl; -import org.apache.activemq.thread.TaskRunnerFactory; -import org.apache.activemq.transport.Transport; -import org.apache.activemq.transport.TransportFactory; -import org.apache.activemq.transport.TransportListener; -import org.apache.activemq.util.IdGenerator; -import org.apache.activemq.util.IntrospectionSupport; -import org.apache.activemq.util.JMSExceptionSupport; -import org.apache.activemq.util.URISupport; -import org.apache.activemq.util.URISupport.CompositeData; - -/** - * A ConnectionFactory is an an Administered object, and is used for creating - * Connections.

    This class also implements QueueConnectionFactory and - * TopicConnectionFactory. You can use this connection to create both - * QueueConnections and TopicConnections. - * - * - * @see javax.jms.ConnectionFactory - */ -public class ActiveMQConnectionFactory extends JNDIBaseStorable implements ConnectionFactory, QueueConnectionFactory, TopicConnectionFactory, StatsCapable, Cloneable { - - public static final String DEFAULT_BROKER_BIND_URL = "tcp://localhost:61616"; - public static final String DEFAULT_BROKER_URL = "failover://"+DEFAULT_BROKER_BIND_URL; - public static final String DEFAULT_USER = null; - public static final String DEFAULT_PASSWORD = null; - public static final int DEFAULT_PRODUCER_WINDOW_SIZE = 0; - - protected URI brokerURL; - protected String userName; - protected String password; - protected String clientID; - protected boolean dispatchAsync=true; - protected boolean alwaysSessionAsync=true; - - JMSStatsImpl factoryStats = new JMSStatsImpl(); - - private IdGenerator clientIdGenerator; - private String clientIDPrefix; - private IdGenerator connectionIdGenerator; - private String connectionIDPrefix; - - // client policies - private ActiveMQPrefetchPolicy prefetchPolicy = new ActiveMQPrefetchPolicy(); - private RedeliveryPolicyMap redeliveryPolicyMap = new RedeliveryPolicyMap(); - { - redeliveryPolicyMap.setDefaultEntry(new RedeliveryPolicy()); - } - private BlobTransferPolicy blobTransferPolicy = new BlobTransferPolicy(); - private MessageTransformer transformer; - - private boolean disableTimeStampsByDefault; - private boolean optimizedMessageDispatch = true; - private long optimizeAcknowledgeTimeOut = 300; - private long optimizedAckScheduledAckInterval = 0; - private boolean copyMessageOnSend = true; - private boolean useCompression; - private boolean objectMessageSerializationDefered; - private boolean useAsyncSend; - private boolean optimizeAcknowledge; - private int closeTimeout = 15000; - private boolean useRetroactiveConsumer; - private boolean exclusiveConsumer; - private boolean nestedMapAndListEnabled = true; - private boolean alwaysSyncSend; - private boolean watchTopicAdvisories = true; - private int producerWindowSize = DEFAULT_PRODUCER_WINDOW_SIZE; - private long warnAboutUnstartedConnectionTimeout = 500L; - private int sendTimeout = 0; - private boolean sendAcksAsync=true; - private TransportListener transportListener; - private ExceptionListener exceptionListener; - private int auditDepth = ActiveMQMessageAudit.DEFAULT_WINDOW_SIZE; - private int auditMaximumProducerNumber = ActiveMQMessageAudit.MAXIMUM_PRODUCER_COUNT; - private boolean useDedicatedTaskRunner; - private long consumerFailoverRedeliveryWaitPeriod = 0; - private boolean checkForDuplicates = true; - private ClientInternalExceptionListener clientInternalExceptionListener; - private boolean messagePrioritySupported = true; - private boolean transactedIndividualAck = false; - private boolean nonBlockingRedelivery = false; - private int maxThreadPoolSize = ActiveMQConnection.DEFAULT_THREAD_POOL_SIZE; - private TaskRunnerFactory sessionTaskRunner; - private RejectedExecutionHandler rejectedTaskHandler = null; - protected int xaAckMode = -1; // ensure default init before setting via brokerUrl introspection in sub class - - // ///////////////////////////////////////////// - // - // ConnectionFactory, QueueConnectionFactory, TopicConnectionFactory Methods - // - // ///////////////////////////////////////////// - - public ActiveMQConnectionFactory() { - this(DEFAULT_BROKER_URL); - } - - public ActiveMQConnectionFactory(String brokerURL) { - this(createURI(brokerURL)); - } - - public ActiveMQConnectionFactory(URI brokerURL) { - setBrokerURL(brokerURL.toString()); - } - - public ActiveMQConnectionFactory(String userName, String password, URI brokerURL) { - setUserName(userName); - setPassword(password); - setBrokerURL(brokerURL.toString()); - } - - public ActiveMQConnectionFactory(String userName, String password, String brokerURL) { - setUserName(userName); - setPassword(password); - setBrokerURL(brokerURL); - } - - /** - * Returns a copy of the given connection factory - */ - public ActiveMQConnectionFactory copy() { - try { - return (ActiveMQConnectionFactory)super.clone(); - } catch (CloneNotSupportedException e) { - throw new RuntimeException("This should never happen: " + e, e); - } - } - - /** - * @param brokerURL - * @return - * @throws URISyntaxException - */ - private static URI createURI(String brokerURL) { - try { - return new URI(brokerURL); - } catch (URISyntaxException e) { - throw (IllegalArgumentException)new IllegalArgumentException("Invalid broker URI: " + brokerURL).initCause(e); - } - } - - /** - * @return Returns the Connection. - */ - @Override - public Connection createConnection() throws JMSException { - return createActiveMQConnection(); - } - - /** - * @return Returns the Connection. - */ - @Override - public Connection createConnection(String userName, String password) throws JMSException { - return createActiveMQConnection(userName, password); - } - - /** - * @return Returns the QueueConnection. - * @throws JMSException - */ - @Override - public QueueConnection createQueueConnection() throws JMSException { - return createActiveMQConnection().enforceQueueOnlyConnection(); - } - - /** - * @return Returns the QueueConnection. - */ - @Override - public QueueConnection createQueueConnection(String userName, String password) throws JMSException { - return createActiveMQConnection(userName, password).enforceQueueOnlyConnection(); - } - - /** - * @return Returns the TopicConnection. - * @throws JMSException - */ - @Override - public TopicConnection createTopicConnection() throws JMSException { - return createActiveMQConnection(); - } - - /** - * @return Returns the TopicConnection. - */ - @Override - public TopicConnection createTopicConnection(String userName, String password) throws JMSException { - return createActiveMQConnection(userName, password); - } - - /** - * @returns the StatsImpl associated with this ConnectionFactory. - */ - @Override - public StatsImpl getStats() { - return this.factoryStats; - } - - // ///////////////////////////////////////////// - // - // Implementation methods. - // - // ///////////////////////////////////////////// - - protected ActiveMQConnection createActiveMQConnection() throws JMSException { - return createActiveMQConnection(userName, password); - } - - /** - * Creates a Transport based on this object's connection settings. Separated - * from createActiveMQConnection to allow for subclasses to override. - * - * @return The newly created Transport. - * @throws JMSException If unable to create trasnport. - */ - protected Transport createTransport() throws JMSException { - try { - return TransportFactory.connect(brokerURL); - } catch (Exception e) { - throw JMSExceptionSupport.create("Could not create Transport. Reason: " + e, e); - } - } - - /** - * @return Returns the Connection. - */ - protected ActiveMQConnection createActiveMQConnection(String userName, String password) throws JMSException { - if (brokerURL == null) { - throw new ConfigurationException("brokerURL not set."); - } - ActiveMQConnection connection = null; - try { - Transport transport = createTransport(); - connection = createActiveMQConnection(transport, factoryStats); - - connection.setUserName(userName); - connection.setPassword(password); - - configureConnection(connection); - - transport.start(); - - if (clientID != null) { - connection.setDefaultClientID(clientID); - } - - return connection; - } catch (JMSException e) { - // Clean up! - try { - connection.close(); - } catch (Throwable ignore) { - } - throw e; - } catch (Exception e) { - // Clean up! - try { - connection.close(); - } catch (Throwable ignore) { - } - throw JMSExceptionSupport.create("Could not connect to broker URL: " + brokerURL + ". Reason: " + e, e); - } - } - - protected ActiveMQConnection createActiveMQConnection(Transport transport, JMSStatsImpl stats) throws Exception { - ActiveMQConnection connection = new ActiveMQConnection(transport, getClientIdGenerator(), - getConnectionIdGenerator(), stats); - return connection; - } - - protected void configureConnection(ActiveMQConnection connection) throws JMSException { - connection.setPrefetchPolicy(getPrefetchPolicy()); - connection.setDisableTimeStampsByDefault(isDisableTimeStampsByDefault()); - connection.setOptimizedMessageDispatch(isOptimizedMessageDispatch()); - connection.setCopyMessageOnSend(isCopyMessageOnSend()); - connection.setUseCompression(isUseCompression()); - connection.setObjectMessageSerializationDefered(isObjectMessageSerializationDefered()); - connection.setDispatchAsync(isDispatchAsync()); - connection.setUseAsyncSend(isUseAsyncSend()); - connection.setAlwaysSyncSend(isAlwaysSyncSend()); - connection.setAlwaysSessionAsync(isAlwaysSessionAsync()); - connection.setOptimizeAcknowledge(isOptimizeAcknowledge()); - connection.setOptimizeAcknowledgeTimeOut(getOptimizeAcknowledgeTimeOut()); - connection.setOptimizedAckScheduledAckInterval(getOptimizedAckScheduledAckInterval()); - connection.setUseRetroactiveConsumer(isUseRetroactiveConsumer()); - connection.setExclusiveConsumer(isExclusiveConsumer()); - connection.setRedeliveryPolicyMap(getRedeliveryPolicyMap()); - connection.setTransformer(getTransformer()); - connection.setBlobTransferPolicy(getBlobTransferPolicy().copy()); - connection.setWatchTopicAdvisories(isWatchTopicAdvisories()); - connection.setProducerWindowSize(getProducerWindowSize()); - connection.setWarnAboutUnstartedConnectionTimeout(getWarnAboutUnstartedConnectionTimeout()); - connection.setSendTimeout(getSendTimeout()); - connection.setCloseTimeout(getCloseTimeout()); - connection.setSendAcksAsync(isSendAcksAsync()); - connection.setAuditDepth(getAuditDepth()); - connection.setAuditMaximumProducerNumber(getAuditMaximumProducerNumber()); - connection.setUseDedicatedTaskRunner(isUseDedicatedTaskRunner()); - connection.setConsumerFailoverRedeliveryWaitPeriod(getConsumerFailoverRedeliveryWaitPeriod()); - connection.setCheckForDuplicates(isCheckForDuplicates()); - connection.setMessagePrioritySupported(isMessagePrioritySupported()); - connection.setTransactedIndividualAck(isTransactedIndividualAck()); - connection.setNonBlockingRedelivery(isNonBlockingRedelivery()); - connection.setMaxThreadPoolSize(getMaxThreadPoolSize()); - connection.setSessionTaskRunner(getSessionTaskRunner()); - connection.setRejectedTaskHandler(getRejectedTaskHandler()); - connection.setNestedMapAndListEnabled(isNestedMapAndListEnabled()); - if (transportListener != null) { - connection.addTransportListener(transportListener); - } - if (exceptionListener != null) { - connection.setExceptionListener(exceptionListener); - } - if (clientInternalExceptionListener != null) { - connection.setClientInternalExceptionListener(clientInternalExceptionListener); - } - } - - // ///////////////////////////////////////////// - // - // Property Accessors - // - // ///////////////////////////////////////////// - - public String getBrokerURL() { - return brokerURL == null ? null : brokerURL.toString(); - } - - /** - * Sets the connection - * URL used to connect to the ActiveMQ broker. - */ - public void setBrokerURL(String brokerURL) { - this.brokerURL = createURI(brokerURL); - - // Use all the properties prefixed with 'jms.' to set the connection - // factory - // options. - if (this.brokerURL.getQuery() != null) { - // It might be a standard URI or... - try { - - Map map = URISupport.parseQuery(this.brokerURL.getQuery()); - Map jmsOptionsMap = IntrospectionSupport.extractProperties(map, "jms."); - if (buildFromMap(jmsOptionsMap)) { - if (!jmsOptionsMap.isEmpty()) { - String msg = "There are " + jmsOptionsMap.size() - + " jms options that couldn't be set on the ConnectionFactory." - + " Check the options are spelled correctly." - + " Unknown parameters=[" + jmsOptionsMap + "]." - + " This connection factory cannot be started."; - throw new IllegalArgumentException(msg); - } - - this.brokerURL = URISupport.createRemainingURI(this.brokerURL, map); - } - - } catch (URISyntaxException e) { - } - - } else { - - // It might be a composite URI. - try { - CompositeData data = URISupport.parseComposite(this.brokerURL); - Map jmsOptionsMap = IntrospectionSupport.extractProperties(data.getParameters(), "jms."); - if (buildFromMap(jmsOptionsMap)) { - if (!jmsOptionsMap.isEmpty()) { - String msg = "There are " + jmsOptionsMap.size() - + " jms options that couldn't be set on the ConnectionFactory." - + " Check the options are spelled correctly." - + " Unknown parameters=[" + jmsOptionsMap + "]." - + " This connection factory cannot be started."; - throw new IllegalArgumentException(msg); - } - - this.brokerURL = data.toURI(); - } - } catch (URISyntaxException e) { - } - } - } - - public String getClientID() { - return clientID; - } - - /** - * Sets the JMS clientID to use for the created connection. Note that this - * can only be used by one connection at once so generally its a better idea - * to set the clientID on a Connection - */ - public void setClientID(String clientID) { - this.clientID = clientID; - } - - public boolean isCopyMessageOnSend() { - return copyMessageOnSend; - } - - /** - * Should a JMS message be copied to a new JMS Message object as part of the - * send() method in JMS. This is enabled by default to be compliant with the - * JMS specification. You can disable it if you do not mutate JMS messages - * after they are sent for a performance boost - */ - public void setCopyMessageOnSend(boolean copyMessageOnSend) { - this.copyMessageOnSend = copyMessageOnSend; - } - - public boolean isDisableTimeStampsByDefault() { - return disableTimeStampsByDefault; - } - - /** - * Sets whether or not timestamps on messages should be disabled or not. If - * you disable them it adds a small performance boost. - */ - public void setDisableTimeStampsByDefault(boolean disableTimeStampsByDefault) { - this.disableTimeStampsByDefault = disableTimeStampsByDefault; - } - - public boolean isOptimizedMessageDispatch() { - return optimizedMessageDispatch; - } - - /** - * If this flag is set then an larger prefetch limit is used - only - * applicable for durable topic subscribers. - */ - public void setOptimizedMessageDispatch(boolean optimizedMessageDispatch) { - this.optimizedMessageDispatch = optimizedMessageDispatch; - } - - public String getPassword() { - return password; - } - - /** - * Sets the JMS password used for connections created from this factory - */ - public void setPassword(String password) { - this.password = password; - } - - public ActiveMQPrefetchPolicy getPrefetchPolicy() { - return prefetchPolicy; - } - - /** - * Sets the prefetch - * policy for consumers created by this connection. - */ - public void setPrefetchPolicy(ActiveMQPrefetchPolicy prefetchPolicy) { - this.prefetchPolicy = prefetchPolicy; - } - - public boolean isUseAsyncSend() { - return useAsyncSend; - } - - public BlobTransferPolicy getBlobTransferPolicy() { - return blobTransferPolicy; - } - - /** - * Sets the policy used to describe how out-of-band BLOBs (Binary Large - * OBjects) are transferred from producers to brokers to consumers - */ - public void setBlobTransferPolicy(BlobTransferPolicy blobTransferPolicy) { - this.blobTransferPolicy = blobTransferPolicy; - } - - /** - * Forces the use of Async Sends which - * adds a massive performance boost; but means that the send() method will - * return immediately whether the message has been sent or not which could - * lead to message loss. - */ - public void setUseAsyncSend(boolean useAsyncSend) { - this.useAsyncSend = useAsyncSend; - } - - public synchronized boolean isWatchTopicAdvisories() { - return watchTopicAdvisories; - } - - public synchronized void setWatchTopicAdvisories(boolean watchTopicAdvisories) { - this.watchTopicAdvisories = watchTopicAdvisories; - } - - /** - * @return true if always sync send messages - */ - public boolean isAlwaysSyncSend() { - return this.alwaysSyncSend; - } - - /** - * Set true if always require messages to be sync sent - * - * @param alwaysSyncSend - */ - public void setAlwaysSyncSend(boolean alwaysSyncSend) { - this.alwaysSyncSend = alwaysSyncSend; - } - - public String getUserName() { - return userName; - } - - /** - * Sets the JMS userName used by connections created by this factory - */ - public void setUserName(String userName) { - this.userName = userName; - } - - public boolean isUseRetroactiveConsumer() { - return useRetroactiveConsumer; - } - - /** - * Sets whether or not retroactive consumers are enabled. Retroactive - * consumers allow non-durable topic subscribers to receive old messages - * that were published before the non-durable subscriber started. - */ - public void setUseRetroactiveConsumer(boolean useRetroactiveConsumer) { - this.useRetroactiveConsumer = useRetroactiveConsumer; - } - - public boolean isExclusiveConsumer() { - return exclusiveConsumer; - } - - /** - * Enables or disables whether or not queue consumers should be exclusive or - * not for example to preserve ordering when not using Message Groups - * - * @param exclusiveConsumer - */ - public void setExclusiveConsumer(boolean exclusiveConsumer) { - this.exclusiveConsumer = exclusiveConsumer; - } - - public RedeliveryPolicy getRedeliveryPolicy() { - return redeliveryPolicyMap.getDefaultEntry(); - } - - /** - * Sets the global default redelivery policy to be used when a message is delivered - * but the session is rolled back - */ - public void setRedeliveryPolicy(RedeliveryPolicy redeliveryPolicy) { - this.redeliveryPolicyMap.setDefaultEntry(redeliveryPolicy); - } - - public RedeliveryPolicyMap getRedeliveryPolicyMap() { - return this.redeliveryPolicyMap; - } - - /** - * Sets the global redelivery policy mapping to be used when a message is delivered - * but the session is rolled back - */ - public void setRedeliveryPolicyMap(RedeliveryPolicyMap redeliveryPolicyMap) { - this.redeliveryPolicyMap = redeliveryPolicyMap; - } - - public MessageTransformer getTransformer() { - return transformer; - } - - /** - * @return the sendTimeout - */ - public int getSendTimeout() { - return sendTimeout; - } - - /** - * @param sendTimeout the sendTimeout to set - */ - public void setSendTimeout(int sendTimeout) { - this.sendTimeout = sendTimeout; - } - - /** - * @return the sendAcksAsync - */ - public boolean isSendAcksAsync() { - return sendAcksAsync; - } - - /** - * @param sendAcksAsync the sendAcksAsync to set - */ - public void setSendAcksAsync(boolean sendAcksAsync) { - this.sendAcksAsync = sendAcksAsync; - } - - /** - * @return the messagePrioritySupported - */ - public boolean isMessagePrioritySupported() { - return this.messagePrioritySupported; - } - - /** - * @param messagePrioritySupported the messagePrioritySupported to set - */ - public void setMessagePrioritySupported(boolean messagePrioritySupported) { - this.messagePrioritySupported = messagePrioritySupported; - } - - - /** - * Sets the transformer used to transform messages before they are sent on - * to the JMS bus or when they are received from the bus but before they are - * delivered to the JMS client - */ - public void setTransformer(MessageTransformer transformer) { - this.transformer = transformer; - } - - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public void buildFromProperties(Properties properties) { - - if (properties == null) { - properties = new Properties(); - } - - String temp = properties.getProperty(Context.PROVIDER_URL); - if (temp == null || temp.length() == 0) { - temp = properties.getProperty("brokerURL"); - } - if (temp != null && temp.length() > 0) { - setBrokerURL(temp); - } - - Map p = new HashMap(properties); - buildFromMap(p); - } - - public boolean buildFromMap(Map properties) { - boolean rc = false; - - ActiveMQPrefetchPolicy p = new ActiveMQPrefetchPolicy(); - if (IntrospectionSupport.setProperties(p, properties, "prefetchPolicy.")) { - setPrefetchPolicy(p); - rc = true; - } - - RedeliveryPolicy rp = new RedeliveryPolicy(); - if (IntrospectionSupport.setProperties(rp, properties, "redeliveryPolicy.")) { - setRedeliveryPolicy(rp); - rc = true; - } - - BlobTransferPolicy blobTransferPolicy = new BlobTransferPolicy(); - if (IntrospectionSupport.setProperties(blobTransferPolicy, properties, "blobTransferPolicy.")) { - setBlobTransferPolicy(blobTransferPolicy); - rc = true; - } - - rc |= IntrospectionSupport.setProperties(this, properties); - - return rc; - } - - @Override - public void populateProperties(Properties props) { - props.setProperty("dispatchAsync", Boolean.toString(isDispatchAsync())); - - if (getBrokerURL() != null) { - props.setProperty(Context.PROVIDER_URL, getBrokerURL()); - props.setProperty("brokerURL", getBrokerURL()); - } - - if (getClientID() != null) { - props.setProperty("clientID", getClientID()); - } - - IntrospectionSupport.getProperties(getPrefetchPolicy(), props, "prefetchPolicy."); - IntrospectionSupport.getProperties(getRedeliveryPolicy(), props, "redeliveryPolicy."); - IntrospectionSupport.getProperties(getBlobTransferPolicy(), props, "blobTransferPolicy."); - - props.setProperty("copyMessageOnSend", Boolean.toString(isCopyMessageOnSend())); - props.setProperty("disableTimeStampsByDefault", Boolean.toString(isDisableTimeStampsByDefault())); - props.setProperty("objectMessageSerializationDefered", Boolean.toString(isObjectMessageSerializationDefered())); - props.setProperty("optimizedMessageDispatch", Boolean.toString(isOptimizedMessageDispatch())); - - if (getPassword() != null) { - props.setProperty("password", getPassword()); - } - - props.setProperty("useAsyncSend", Boolean.toString(isUseAsyncSend())); - props.setProperty("useCompression", Boolean.toString(isUseCompression())); - props.setProperty("useRetroactiveConsumer", Boolean.toString(isUseRetroactiveConsumer())); - props.setProperty("watchTopicAdvisories", Boolean.toString(isWatchTopicAdvisories())); - - if (getUserName() != null) { - props.setProperty("userName", getUserName()); - } - - props.setProperty("closeTimeout", Integer.toString(getCloseTimeout())); - props.setProperty("alwaysSessionAsync", Boolean.toString(isAlwaysSessionAsync())); - props.setProperty("optimizeAcknowledge", Boolean.toString(isOptimizeAcknowledge())); - props.setProperty("statsEnabled", Boolean.toString(isStatsEnabled())); - props.setProperty("alwaysSyncSend", Boolean.toString(isAlwaysSyncSend())); - props.setProperty("producerWindowSize", Integer.toString(getProducerWindowSize())); - props.setProperty("sendTimeout", Integer.toString(getSendTimeout())); - props.setProperty("sendAcksAsync",Boolean.toString(isSendAcksAsync())); - props.setProperty("auditDepth", Integer.toString(getAuditDepth())); - props.setProperty("auditMaximumProducerNumber", Integer.toString(getAuditMaximumProducerNumber())); - props.setProperty("checkForDuplicates", Boolean.toString(isCheckForDuplicates())); - props.setProperty("messagePrioritySupported", Boolean.toString(isMessagePrioritySupported())); - props.setProperty("transactedIndividualAck", Boolean.toString(isTransactedIndividualAck())); - props.setProperty("nonBlockingRedelivery", Boolean.toString(isNonBlockingRedelivery())); - props.setProperty("maxThreadPoolSize", Integer.toString(getMaxThreadPoolSize())); - props.setProperty("nestedMapAndListEnabled", Boolean.toString(isNestedMapAndListEnabled())); - props.setProperty("consumerFailoverRedeliveryWaitPeriod", Long.toString(getConsumerFailoverRedeliveryWaitPeriod())); - } - - public boolean isUseCompression() { - return useCompression; - } - - /** - * Enables the use of compression of the message bodies - */ - public void setUseCompression(boolean useCompression) { - this.useCompression = useCompression; - } - - public boolean isObjectMessageSerializationDefered() { - return objectMessageSerializationDefered; - } - - /** - * When an object is set on an ObjectMessage, the JMS spec requires the - * object to be serialized by that set method. Enabling this flag causes the - * object to not get serialized. The object may subsequently get serialized - * if the message needs to be sent over a socket or stored to disk. - */ - public void setObjectMessageSerializationDefered(boolean objectMessageSerializationDefered) { - this.objectMessageSerializationDefered = objectMessageSerializationDefered; - } - - public boolean isDispatchAsync() { - return dispatchAsync; - } - - /** - * Enables or disables the default setting of whether or not consumers have - * their messages dispatched - * synchronously or asynchronously by the broker. For non-durable - * topics for example we typically dispatch synchronously by default to - * minimize context switches which boost performance. However sometimes its - * better to go slower to ensure that a single blocked consumer socket does - * not block delivery to other consumers. - * - * @param asyncDispatch If true then consumers created on this connection - * will default to having their messages dispatched - * asynchronously. The default value is true. - */ - public void setDispatchAsync(boolean asyncDispatch) { - this.dispatchAsync = asyncDispatch; - } - - /** - * @return Returns the closeTimeout. - */ - public int getCloseTimeout() { - return closeTimeout; - } - - /** - * Sets the timeout before a close is considered complete. Normally a - * close() on a connection waits for confirmation from the broker; this - * allows that operation to timeout to save the client hanging if there is - * no broker - */ - public void setCloseTimeout(int closeTimeout) { - this.closeTimeout = closeTimeout; - } - - /** - * @return Returns the alwaysSessionAsync. - */ - public boolean isAlwaysSessionAsync() { - return alwaysSessionAsync; - } - - /** - * If this flag is not set then a separate thread is not used for dispatching messages for each Session in - * the Connection. However, a separate thread is always used if there is more than one session, or the session - * isn't in auto acknowledge or duplicates ok mode. By default this value is set to true and session dispatch - * happens asynchronously. - */ - public void setAlwaysSessionAsync(boolean alwaysSessionAsync) { - this.alwaysSessionAsync = alwaysSessionAsync; - } - - /** - * @return Returns the optimizeAcknowledge. - */ - public boolean isOptimizeAcknowledge() { - return optimizeAcknowledge; - } - - /** - * @param optimizeAcknowledge The optimizeAcknowledge to set. - */ - public void setOptimizeAcknowledge(boolean optimizeAcknowledge) { - this.optimizeAcknowledge = optimizeAcknowledge; - } - - /** - * The max time in milliseconds between optimized ack batches - * @param optimizeAcknowledgeTimeOut - */ - public void setOptimizeAcknowledgeTimeOut(long optimizeAcknowledgeTimeOut) { - this.optimizeAcknowledgeTimeOut = optimizeAcknowledgeTimeOut; - } - - public long getOptimizeAcknowledgeTimeOut() { - return optimizeAcknowledgeTimeOut; - } - - public boolean isNestedMapAndListEnabled() { - return nestedMapAndListEnabled; - } - - /** - * Enables/disables whether or not Message properties and MapMessage entries - * support Nested - * Structures of Map and List objects - */ - public void setNestedMapAndListEnabled(boolean structuredMapsEnabled) { - this.nestedMapAndListEnabled = structuredMapsEnabled; - } - - public String getClientIDPrefix() { - return clientIDPrefix; - } - - /** - * Sets the prefix used by autogenerated JMS Client ID values which are used - * if the JMS client does not explicitly specify on. - * - * @param clientIDPrefix - */ - public void setClientIDPrefix(String clientIDPrefix) { - this.clientIDPrefix = clientIDPrefix; - } - - protected synchronized IdGenerator getClientIdGenerator() { - if (clientIdGenerator == null) { - if (clientIDPrefix != null) { - clientIdGenerator = new IdGenerator(clientIDPrefix); - } else { - clientIdGenerator = new IdGenerator(); - } - } - return clientIdGenerator; - } - - protected void setClientIdGenerator(IdGenerator clientIdGenerator) { - this.clientIdGenerator = clientIdGenerator; - } - - /** - * Sets the prefix used by connection id generator - * @param connectionIDPrefix - */ - public void setConnectionIDPrefix(String connectionIDPrefix) { - this.connectionIDPrefix = connectionIDPrefix; - } - - protected synchronized IdGenerator getConnectionIdGenerator() { - if (connectionIdGenerator == null) { - if (connectionIDPrefix != null) { - connectionIdGenerator = new IdGenerator(connectionIDPrefix); - } else { - connectionIdGenerator = new IdGenerator(); - } - } - return connectionIdGenerator; - } - - protected void setConnectionIdGenerator(IdGenerator connectionIdGenerator) { - this.connectionIdGenerator = connectionIdGenerator; - } - - /** - * @return the statsEnabled - */ - public boolean isStatsEnabled() { - return this.factoryStats.isEnabled(); - } - - /** - * @param statsEnabled the statsEnabled to set - */ - public void setStatsEnabled(boolean statsEnabled) { - this.factoryStats.setEnabled(statsEnabled); - } - - public synchronized int getProducerWindowSize() { - return producerWindowSize; - } - - public synchronized void setProducerWindowSize(int producerWindowSize) { - this.producerWindowSize = producerWindowSize; - } - - public long getWarnAboutUnstartedConnectionTimeout() { - return warnAboutUnstartedConnectionTimeout; - } - - /** - * Enables the timeout from a connection creation to when a warning is - * generated if the connection is not properly started via - * {@link Connection#start()} and a message is received by a consumer. It is - * a very common gotcha to forget to start - * the connection so this option makes the default case to create a - * warning if the user forgets. To disable the warning just set the value to < - * 0 (say -1). - */ - public void setWarnAboutUnstartedConnectionTimeout(long warnAboutUnstartedConnectionTimeout) { - this.warnAboutUnstartedConnectionTimeout = warnAboutUnstartedConnectionTimeout; - } - - public TransportListener getTransportListener() { - return transportListener; - } - - /** - * Allows a listener to be configured on the ConnectionFactory so that when this factory is used - * with frameworks which don't expose the Connection such as Spring JmsTemplate, you can still register - * a transport listener. - * - * @param transportListener sets the listener to be registered on all connections - * created by this factory - */ - public void setTransportListener(TransportListener transportListener) { - this.transportListener = transportListener; - } - - - public ExceptionListener getExceptionListener() { - return exceptionListener; - } - - /** - * Allows an {@link ExceptionListener} to be configured on the ConnectionFactory so that when this factory - * is used by frameworks which don't expose the Connection such as Spring JmsTemplate, you can register - * an exception listener. - *

    Note: access to this exceptionLinstener will not be serialized if it is associated with more than - * on connection (as it will be if more than one connection is subsequently created by this connection factory) - * @param exceptionListener sets the exception listener to be registered on all connections - * created by this factory - */ - public void setExceptionListener(ExceptionListener exceptionListener) { - this.exceptionListener = exceptionListener; - } - - public int getAuditDepth() { - return auditDepth; - } - - public void setAuditDepth(int auditDepth) { - this.auditDepth = auditDepth; - } - - public int getAuditMaximumProducerNumber() { - return auditMaximumProducerNumber; - } - - public void setAuditMaximumProducerNumber(int auditMaximumProducerNumber) { - this.auditMaximumProducerNumber = auditMaximumProducerNumber; - } - - public void setUseDedicatedTaskRunner(boolean useDedicatedTaskRunner) { - this.useDedicatedTaskRunner = useDedicatedTaskRunner; - } - - public boolean isUseDedicatedTaskRunner() { - return useDedicatedTaskRunner; - } - - public void setConsumerFailoverRedeliveryWaitPeriod(long consumerFailoverRedeliveryWaitPeriod) { - this.consumerFailoverRedeliveryWaitPeriod = consumerFailoverRedeliveryWaitPeriod; - } - - public long getConsumerFailoverRedeliveryWaitPeriod() { - return consumerFailoverRedeliveryWaitPeriod; - } - - public ClientInternalExceptionListener getClientInternalExceptionListener() { - return clientInternalExceptionListener; - } - - /** - * Allows an {@link ClientInternalExceptionListener} to be configured on the ConnectionFactory so that when this factory - * is used by frameworks which don't expose the Connection such as Spring JmsTemplate, you can register - * an exception listener. - *

    Note: access to this clientInternalExceptionListener will not be serialized if it is associated with more than - * on connection (as it will be if more than one connection is subsequently created by this connection factory) - * @param clientInternalExceptionListener sets the exception listener to be registered on all connections - * created by this factory - */ - public void setClientInternalExceptionListener( - ClientInternalExceptionListener clientInternalExceptionListener) { - this.clientInternalExceptionListener = clientInternalExceptionListener; - } - - /** - * @return the checkForDuplicates - */ - public boolean isCheckForDuplicates() { - return this.checkForDuplicates; - } - - /** - * @param checkForDuplicates the checkForDuplicates to set - */ - public void setCheckForDuplicates(boolean checkForDuplicates) { - this.checkForDuplicates = checkForDuplicates; - } - - public boolean isTransactedIndividualAck() { - return transactedIndividualAck; - } - - /** - * when true, submit individual transacted acks immediately rather than with transaction completion. - * This allows the acks to represent delivery status which can be persisted on rollback - * Used in conjunction with org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter#setRewriteOnRedelivery(boolean) true - */ - public void setTransactedIndividualAck(boolean transactedIndividualAck) { - this.transactedIndividualAck = transactedIndividualAck; - } - - - public boolean isNonBlockingRedelivery() { - return nonBlockingRedelivery; - } - - /** - * When true a MessageConsumer will not stop Message delivery before re-delivering Messages - * from a rolled back transaction. This implies that message order will not be preserved and - * also will result in the TransactedIndividualAck option to be enabled. - */ - public void setNonBlockingRedelivery(boolean nonBlockingRedelivery) { - this.nonBlockingRedelivery = nonBlockingRedelivery; - } - - public int getMaxThreadPoolSize() { - return maxThreadPoolSize; - } - - public void setMaxThreadPoolSize(int maxThreadPoolSize) { - this.maxThreadPoolSize = maxThreadPoolSize; - } - - public TaskRunnerFactory getSessionTaskRunner() { - return sessionTaskRunner; - } - - public void setSessionTaskRunner(TaskRunnerFactory sessionTaskRunner) { - this.sessionTaskRunner = sessionTaskRunner; - } - - public RejectedExecutionHandler getRejectedTaskHandler() { - return rejectedTaskHandler; - } - - public void setRejectedTaskHandler(RejectedExecutionHandler rejectedTaskHandler) { - this.rejectedTaskHandler = rejectedTaskHandler; - } - - /** - * Gets the configured time interval that is used to force all MessageConsumers that have optimizedAcknowledge enabled - * to send an ack for any outstanding Message Acks. By default this value is set to zero meaning that the consumers - * will not do any background Message acknowledgment. - * - * @return the scheduledOptimizedAckInterval - */ - public long getOptimizedAckScheduledAckInterval() { - return optimizedAckScheduledAckInterval; - } - - /** - * Sets the amount of time between scheduled sends of any outstanding Message Acks for consumers that - * have been configured with optimizeAcknowledge enabled. - * - * @param optimizedAckScheduledAckInterval the scheduledOptimizedAckInterval to set - */ - public void setOptimizedAckScheduledAckInterval(long optimizedAckScheduledAckInterval) { - this.optimizedAckScheduledAckInterval = optimizedAckScheduledAckInterval; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnectionMetaData.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnectionMetaData.class deleted file mode 100644 index 8ea5ff28b..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnectionMetaData.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnectionMetaData.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnectionMetaData.java deleted file mode 100644 index b6d6c8724..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQConnectionMetaData.java +++ /dev/null @@ -1,148 +0,0 @@ -/** - * 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; - -import java.util.Enumeration; -import java.util.Vector; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import javax.jms.ConnectionMetaData; - -/** - * A ConnectionMetaData object provides information describing - * the Connection object. - */ -public final class ActiveMQConnectionMetaData implements ConnectionMetaData { - - public static final String PROVIDER_VERSION; - public static final int PROVIDER_MAJOR_VERSION; - public static final int PROVIDER_MINOR_VERSION; - - public static final ActiveMQConnectionMetaData INSTANCE = new ActiveMQConnectionMetaData(); - - static { - String version = null; - int major = 0; - int minor = 0; - try { - Package p = Package.getPackage("org.apache.activemq"); - if (p != null) { - version = p.getImplementationVersion(); - Pattern pattern = Pattern.compile("(\\d+)\\.(\\d+).*"); - Matcher m = pattern.matcher(version); - if (m.matches()) { - major = Integer.parseInt(m.group(1)); - minor = Integer.parseInt(m.group(2)); - } - } - } catch (Throwable e) { - } - PROVIDER_VERSION = version; - PROVIDER_MAJOR_VERSION = major; - PROVIDER_MINOR_VERSION = minor; - } - - private ActiveMQConnectionMetaData() { - } - - /** - * Gets the JMS API version. - * - * @return the JMS API version - */ - @Override - public String getJMSVersion() { - return "1.1"; - } - - /** - * Gets the JMS major version number. - * - * @return the JMS API major version number - */ - @Override - public int getJMSMajorVersion() { - return 1; - } - - /** - * Gets the JMS minor version number. - * - * @return the JMS API minor version number - */ - @Override - public int getJMSMinorVersion() { - return 1; - } - - /** - * Gets the JMS provider name. - * - * @return the JMS provider name - */ - @Override - public String getJMSProviderName() { - return "ActiveMQ"; - } - - /** - * Gets the JMS provider version. - * - * @return the JMS provider version - */ - @Override - public String getProviderVersion() { - return PROVIDER_VERSION; - } - - /** - * Gets the JMS provider major version number. - * - * @return the JMS provider major version number - */ - @Override - public int getProviderMajorVersion() { - return PROVIDER_MAJOR_VERSION; - } - - /** - * Gets the JMS provider minor version number. - * - * @return the JMS provider minor version number - */ - @Override - public int getProviderMinorVersion() { - return PROVIDER_MINOR_VERSION; - } - - /** - * Gets an enumeration of the JMSX property names. - * - * @return an Enumeration of JMSX property names - */ - @Override - public Enumeration getJMSXPropertyNames() { - Vector jmxProperties = new Vector(); - jmxProperties.add("JMSXUserID"); - jmxProperties.add("JMSXGroupID"); - jmxProperties.add("JMSXGroupSeq"); - jmxProperties.add("JMSXDeliveryCount"); - jmxProperties.add("JMSXProducerTXID"); - return jmxProperties.elements(); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQDispatcher.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQDispatcher.class deleted file mode 100644 index bb324be9b..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQDispatcher.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQDispatcher.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQDispatcher.java deleted file mode 100644 index 69bdf1c9c..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQDispatcher.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * 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; - -import org.apache.activemq.command.MessageDispatch; - -public interface ActiveMQDispatcher { - void dispatch(MessageDispatch messageDispatch); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQInputStream$ReadTimeoutException.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQInputStream$ReadTimeoutException.class deleted file mode 100644 index 28560c02e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQInputStream$ReadTimeoutException.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQInputStream.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQInputStream.class deleted file mode 100644 index 271b1440e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQInputStream.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQInputStream.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQInputStream.java deleted file mode 100644 index 493743124..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQInputStream.java +++ /dev/null @@ -1,325 +0,0 @@ -/** - * 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; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -import javax.jms.IllegalStateException; -import javax.jms.InvalidDestinationException; -import javax.jms.JMSException; - -import org.apache.activemq.command.ActiveMQBytesMessage; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ActiveMQMessage; -import org.apache.activemq.command.CommandTypes; -import org.apache.activemq.command.ConsumerId; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.command.MessageAck; -import org.apache.activemq.command.MessageDispatch; -import org.apache.activemq.command.ProducerId; -import org.apache.activemq.selector.SelectorParser; -import org.apache.activemq.util.IOExceptionSupport; -import org.apache.activemq.util.IntrospectionSupport; -import org.apache.activemq.util.JMSExceptionSupport; - -/** - * - */ -public class ActiveMQInputStream extends InputStream implements ActiveMQDispatcher { - - private final ActiveMQConnection connection; - private final ConsumerInfo info; - // These are the messages waiting to be delivered to the client - private final MessageDispatchChannel unconsumedMessages = new FifoMessageDispatchChannel(); - - private int deliveredCounter; - private MessageDispatch lastDelivered; - private boolean eosReached; - private byte buffer[]; - private int pos; - private Map jmsProperties; - - private ProducerId producerId; - private long nextSequenceId; - private final long timeout; - private boolean firstReceived; - - public ActiveMQInputStream(ActiveMQConnection connection, ConsumerId consumerId, ActiveMQDestination dest, String selector, boolean noLocal, String name, int prefetch, long timeout) - throws JMSException { - this.connection = connection; - - if (dest == null) { - throw new InvalidDestinationException("Don't understand null destinations"); - } else if (dest.isTemporary()) { - String physicalName = dest.getPhysicalName(); - - if (physicalName == null) { - throw new IllegalArgumentException("Physical name of Destination should be valid: " + dest); - } - - String connectionID = connection.getConnectionInfo().getConnectionId().getValue(); - - if (physicalName.indexOf(connectionID) < 0) { - throw new InvalidDestinationException("Cannot use a Temporary destination from another Connection"); - } - - if (connection.isDeleted(dest)) { - throw new InvalidDestinationException("Cannot use a Temporary destination that has been deleted"); - } - } - - if (timeout < -1) throw new IllegalArgumentException("Timeout must be >= -1"); - this.timeout = timeout; - - this.info = new ConsumerInfo(consumerId); - this.info.setSubscriptionName(name); - - if (selector != null && selector.trim().length() != 0) { - selector = "JMSType='org.apache.activemq.Stream' AND ( " + selector + " ) "; - } else { - selector = "JMSType='org.apache.activemq.Stream'"; - } - - SelectorParser.parse(selector); - this.info.setSelector(selector); - - this.info.setPrefetchSize(prefetch); - this.info.setNoLocal(noLocal); - this.info.setBrowser(false); - this.info.setDispatchAsync(false); - - // Allows the options on the destination to configure the consumerInfo - if (dest.getOptions() != null) { - Map options = new HashMap(dest.getOptions()); - IntrospectionSupport.setProperties(this.info, options, "consumer."); - } - - this.info.setDestination(dest); - - this.connection.addInputStream(this); - this.connection.addDispatcher(info.getConsumerId(), this); - this.connection.syncSendPacket(info); - unconsumedMessages.start(); - } - - @Override - public void close() throws IOException { - if (!unconsumedMessages.isClosed()) { - try { - if (lastDelivered != null) { - MessageAck ack = new MessageAck(lastDelivered, MessageAck.STANDARD_ACK_TYPE, deliveredCounter); - connection.asyncSendPacket(ack); - } - dispose(); - this.connection.syncSendPacket(info.createRemoveCommand()); - } catch (JMSException e) { - throw IOExceptionSupport.create(e); - } - } - } - - public void dispose() { - if (!unconsumedMessages.isClosed()) { - unconsumedMessages.close(); - this.connection.removeDispatcher(info.getConsumerId()); - this.connection.removeInputStream(this); - } - } - - /** - * Return the JMS Properties which where used to send the InputStream - * - * @return jmsProperties - * @throws IOException - */ - public Map getJMSProperties() throws IOException { - if (jmsProperties == null) { - fillBuffer(); - } - return jmsProperties; - } - - /** - * This method allows the client to receive the Stream data as unaltered ActiveMQMessage - * object which is how the split stream data is sent. Each message will contains one - * chunk of the written bytes as well as a valid message group sequence id. The EOS - * message will have a message group sequence id of -1. - * - * This method is useful for testing, but should never be mixed with calls to the - * normal stream receive methods as it will break the normal stream processing flow - * and can lead to loss of data. - * - * @return an ActiveMQMessage object that either contains byte data or an end of strem - * marker. - * @throws JMSException - * @throws ReadTimeoutException - */ - public ActiveMQMessage receive() throws JMSException, ReadTimeoutException { - checkClosed(); - MessageDispatch md; - try { - if (firstReceived || timeout == -1) { - md = unconsumedMessages.dequeue(-1); - firstReceived = true; - } else { - md = unconsumedMessages.dequeue(timeout); - if (md == null) throw new ReadTimeoutException(); - } - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw JMSExceptionSupport.create(e); - } - - if (md == null || unconsumedMessages.isClosed() || md.getMessage().isExpired()) { - return null; - } - - deliveredCounter++; - if ((0.75 * info.getPrefetchSize()) <= deliveredCounter) { - MessageAck ack = new MessageAck(md, MessageAck.STANDARD_ACK_TYPE, deliveredCounter); - connection.asyncSendPacket(ack); - deliveredCounter = 0; - lastDelivered = null; - } else { - lastDelivered = md; - } - - return (ActiveMQMessage)md.getMessage(); - } - - /** - * @throws IllegalStateException - */ - protected void checkClosed() throws IllegalStateException { - if (unconsumedMessages.isClosed()) { - throw new IllegalStateException("The Consumer is closed"); - } - } - - /** - * - * @see InputStream#read() - * @throws ReadTimeoutException if a timeout was given and the first chunk of the message could not read within the timeout - */ - @Override - public int read() throws IOException { - fillBuffer(); - if (eosReached || buffer.length == 0) { - return -1; - } - - return buffer[pos++] & 0xff; - } - - /** - * - * @see InputStream#read(byte[], int, int) - * @throws ReadTimeoutException if a timeout was given and the first chunk of the message could not read within the timeout - */ - @Override - public int read(byte[] b, int off, int len) throws IOException { - fillBuffer(); - if (eosReached || buffer.length == 0) { - return -1; - } - - int max = Math.min(len, buffer.length - pos); - System.arraycopy(buffer, pos, b, off, max); - - pos += max; - return max; - } - - private void fillBuffer() throws IOException { - if (eosReached || (buffer != null && buffer.length > pos)) { - return; - } - try { - while (true) { - ActiveMQMessage m = receive(); - if (m != null && m.getDataStructureType() == CommandTypes.ACTIVEMQ_BYTES_MESSAGE) { - // First message. - long producerSequenceId = m.getMessageId().getProducerSequenceId(); - if (producerId == null) { - // We have to start a stream at sequence id = 0 - if (producerSequenceId != 0) { - continue; - } - nextSequenceId++; - producerId = m.getMessageId().getProducerId(); - } else { - // Verify it's the next message of the sequence. - if (!m.getMessageId().getProducerId().equals(producerId)) { - throw new IOException("Received an unexpected message: invalid producer: " + m); - } - if (producerSequenceId != nextSequenceId++) { - throw new IOException("Received an unexpected message: expected ID: " + (nextSequenceId - 1) + " but was: " + producerSequenceId + " for message: " + m); - } - } - - // Read the buffer in. - ActiveMQBytesMessage bm = (ActiveMQBytesMessage)m; - buffer = new byte[(int)bm.getBodyLength()]; - bm.readBytes(buffer); - pos = 0; - if (jmsProperties == null) { - jmsProperties = Collections.unmodifiableMap(new HashMap(bm.getProperties())); - } - } else { - eosReached = true; - if (jmsProperties == null) { - // no properties found - jmsProperties = Collections.emptyMap(); - } - } - return; - } - } catch (JMSException e) { - eosReached = true; - if (jmsProperties == null) { - // no properties found - jmsProperties = Collections.emptyMap(); - } - throw IOExceptionSupport.create(e); - } - } - - @Override - public void dispatch(MessageDispatch md) { - unconsumedMessages.enqueue(md); - } - - @Override - public String toString() { - return "ActiveMQInputStream { value=" + info.getConsumerId() + ", producerId=" + producerId + " }"; - } - - /** - * Exception which should get thrown if the first chunk of the stream could not read within the configured timeout - */ - public class ReadTimeoutException extends IOException { - private static final long serialVersionUID = -3217758894326719909L; - - public ReadTimeoutException() { - super(); - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageAudit.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageAudit.class deleted file mode 100644 index 8b3ace2df..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageAudit.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageAudit.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageAudit.java deleted file mode 100644 index 585e54f24..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageAudit.java +++ /dev/null @@ -1,89 +0,0 @@ -/** - * 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; - -import org.apache.activemq.command.MessageId; - -/** - * Provides basic audit functions for Messages - * - * - */ -public class ActiveMQMessageAudit extends ActiveMQMessageAuditNoSync { - - private static final long serialVersionUID = 1L; - - /** - * Default Constructor windowSize = 2048, maximumNumberOfProducersToTrack = - * 64 - */ - public ActiveMQMessageAudit() { - super(); - } - - /** - * Construct a MessageAudit - * - * @param auditDepth range of ids to track - * @param maximumNumberOfProducersToTrack number of producers expected in - * the system - */ - public ActiveMQMessageAudit(int auditDepth, final int maximumNumberOfProducersToTrack) { - super(auditDepth, maximumNumberOfProducersToTrack); - } - - @Override - public boolean isDuplicate(String id) { - synchronized (this) { - return super.isDuplicate(id); - } - } - - @Override - public boolean isDuplicate(final MessageId id) { - synchronized (this) { - return super.isDuplicate(id); - } - } - - @Override - public void rollback(final MessageId id) { - synchronized (this) { - super.rollback(id); - } - } - - @Override - public boolean isInOrder(final String id) { - synchronized (this) { - return super.isInOrder(id); - } - } - - @Override - public boolean isInOrder(final MessageId id) { - synchronized (this) { - return super.isInOrder(id); - } - } - - public void setMaximumNumberOfProducersToTrack(int maximumNumberOfProducersToTrack) { - synchronized (this) { - super.setMaximumNumberOfProducersToTrack(maximumNumberOfProducersToTrack); - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageAuditNoSync.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageAuditNoSync.class deleted file mode 100644 index 53ca456b9..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageAuditNoSync.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageAuditNoSync.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageAuditNoSync.java deleted file mode 100644 index de30592e6..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageAuditNoSync.java +++ /dev/null @@ -1,329 +0,0 @@ -/** - * 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; - -import java.io.Serializable; - -import javax.jms.JMSException; -import javax.jms.Message; - -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.command.MessageId; -import org.apache.activemq.command.ProducerId; -import org.apache.activemq.util.BitArrayBin; -import org.apache.activemq.util.IdGenerator; -import org.apache.activemq.util.LRUCache; - -/** - * Provides basic audit functions for Messages without sync - * - * - */ -public class ActiveMQMessageAuditNoSync implements Serializable { - - private static final long serialVersionUID = 1L; - - public static final int DEFAULT_WINDOW_SIZE = 2048; - public static final int MAXIMUM_PRODUCER_COUNT = 64; - private int auditDepth; - private int maximumNumberOfProducersToTrack; - private final LRUCache map; - private transient boolean modified = true; - - /** - * Default Constructor windowSize = 2048, maximumNumberOfProducersToTrack = 64 - */ - public ActiveMQMessageAuditNoSync() { - this(DEFAULT_WINDOW_SIZE, MAXIMUM_PRODUCER_COUNT); - } - - /** - * Construct a MessageAudit - * - * @param auditDepth range of ids to track - * @param maximumNumberOfProducersToTrack number of producers expected in the system - */ - public ActiveMQMessageAuditNoSync(int auditDepth, final int maximumNumberOfProducersToTrack) { - this.auditDepth = auditDepth; - this.maximumNumberOfProducersToTrack=maximumNumberOfProducersToTrack; - this.map = new LRUCache(0, maximumNumberOfProducersToTrack, 0.75f, true); - } - - /** - * @return the auditDepth - */ - public int getAuditDepth() { - return auditDepth; - } - - /** - * @param auditDepth the auditDepth to set - */ - public void setAuditDepth(int auditDepth) { - this.auditDepth = auditDepth; - this.modified = true; - } - - /** - * @return the maximumNumberOfProducersToTrack - */ - public int getMaximumNumberOfProducersToTrack() { - return maximumNumberOfProducersToTrack; - } - - /** - * @param maximumNumberOfProducersToTrack the maximumNumberOfProducersToTrack to set - */ - public void setMaximumNumberOfProducersToTrack(int maximumNumberOfProducersToTrack) { - - if (maximumNumberOfProducersToTrack < this.maximumNumberOfProducersToTrack){ - LRUCache newMap = new LRUCache(0,maximumNumberOfProducersToTrack,0.75f,true); - /** - * As putAll will access the entries in the right order, - * this shouldn't result in wrong cache entries being removed - */ - newMap.putAll(this.map); - this.map.clear(); - this.map.putAll(newMap); - } - this.map.setMaxCacheSize(maximumNumberOfProducersToTrack); - this.maximumNumberOfProducersToTrack = maximumNumberOfProducersToTrack; - this.modified = true; - } - - /** - * Checks if this message has been seen before - * - * @param message - * @return true if the message is a duplicate - * @throws JMSException - */ - public boolean isDuplicate(Message message) throws JMSException { - return isDuplicate(message.getJMSMessageID()); - } - - /** - * checks whether this messageId has been seen before and adds this - * messageId to the list - * - * @param id - * @return true if the message is a duplicate - */ - public boolean isDuplicate(String id) { - boolean answer = false; - String seed = IdGenerator.getSeedFromId(id); - if (seed != null) { - BitArrayBin bab = map.get(seed); - if (bab == null) { - bab = new BitArrayBin(auditDepth); - map.put(seed, bab); - modified = true; - } - long index = IdGenerator.getSequenceFromId(id); - if (index >= 0) { - answer = bab.setBit(index, true); - modified = true; - } - } - return answer; - } - - /** - * Checks if this message has been seen before - * - * @param message - * @return true if the message is a duplicate - */ - public boolean isDuplicate(final MessageReference message) { - MessageId id = message.getMessageId(); - return isDuplicate(id); - } - - /** - * Checks if this messageId has been seen before - * - * @param id - * @return true if the message is a duplicate - */ - public boolean isDuplicate(final MessageId id) { - boolean answer = false; - - if (id != null) { - ProducerId pid = id.getProducerId(); - if (pid != null) { - BitArrayBin bab = map.get(pid.toString()); - if (bab == null) { - bab = new BitArrayBin(auditDepth); - map.put(pid.toString(), bab); - modified = true; - } - answer = bab.setBit(id.getProducerSequenceId(), true); - } - } - return answer; - } - - /** - * mark this message as being received - * - * @param message - */ - public void rollback(final MessageReference message) { - MessageId id = message.getMessageId(); - rollback(id); - } - - /** - * mark this message as being received - * - * @param id - */ - public void rollback(final MessageId id) { - if (id != null) { - ProducerId pid = id.getProducerId(); - if (pid != null) { - BitArrayBin bab = map.get(pid.toString()); - if (bab != null) { - bab.setBit(id.getProducerSequenceId(), false); - modified = true; - } - } - } - } - - public void rollback(final String id) { - String seed = IdGenerator.getSeedFromId(id); - if (seed != null) { - BitArrayBin bab = map.get(seed); - if (bab != null) { - long index = IdGenerator.getSequenceFromId(id); - bab.setBit(index, false); - modified = true; - } - } - } - - /** - * Check the message is in order - * @param msg - * @return - * @throws JMSException - */ - public boolean isInOrder(Message msg) throws JMSException { - return isInOrder(msg.getJMSMessageID()); - } - - /** - * Check the message id is in order - * @param id - * @return - */ - public boolean isInOrder(final String id) { - boolean answer = true; - - if (id != null) { - String seed = IdGenerator.getSeedFromId(id); - if (seed != null) { - BitArrayBin bab = map.get(seed); - if (bab != null) { - long index = IdGenerator.getSequenceFromId(id); - answer = bab.isInOrder(index); - modified = true; - } - } - } - return answer; - } - - /** - * Check the MessageId is in order - * @param message - * @return - */ - public boolean isInOrder(final MessageReference message) { - return isInOrder(message.getMessageId()); - } - - /** - * Check the MessageId is in order - * @param id - * @return - */ - public boolean isInOrder(final MessageId id) { - boolean answer = false; - - if (id != null) { - ProducerId pid = id.getProducerId(); - if (pid != null) { - BitArrayBin bab = map.get(pid.toString()); - if (bab == null) { - bab = new BitArrayBin(auditDepth); - map.put(pid.toString(), bab); - modified = true; - } - answer = bab.isInOrder(id.getProducerSequenceId()); - - } - } - return answer; - } - - public long getLastSeqId(ProducerId id) { - long result = -1; - BitArrayBin bab = map.get(id.toString()); - if (bab != null) { - result = bab.getLastSetIndex(); - } - return result; - } - - public void clear() { - map.clear(); - } - - /** - * Returns if the Audit has been modified since last check, this method does not - * reset the modified flag. If the caller needs to reset the flag in order to avoid - * serializing an unchanged Audit then its up the them to reset it themselves. - * - * @return true if the Audit has been modified. - */ - public boolean isModified() { - return this.modified; - } - - public void setModified(boolean modified) { - this.modified = modified; - } - - /** - * Reads and returns the current modified state of the Audit, once called the state is - * reset to false. This method is useful for code the needs to know if it should write - * out the Audit or otherwise execute some logic based on the Audit having changed since - * last check. - * - * @return true if the Audit has been modified since last check. - */ - public boolean modified() { - if (this.modified) { - this.modified = false; - return true; - } - - return false; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageConsumer$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageConsumer$1.class deleted file mode 100644 index 9e83f1710..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageConsumer$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageConsumer$2.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageConsumer$2.class deleted file mode 100644 index 423e21b53..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageConsumer$2.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageConsumer$3.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageConsumer$3.class deleted file mode 100644 index 2584dce6c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageConsumer$3.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageConsumer$4.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageConsumer$4.class deleted file mode 100644 index 27014d834..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageConsumer$4.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageConsumer$5.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageConsumer$5.class deleted file mode 100644 index ab230a1ca..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageConsumer$5.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageConsumer$6.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageConsumer$6.class deleted file mode 100644 index f687d42a0..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageConsumer$6.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageConsumer$7.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageConsumer$7.class deleted file mode 100644 index 0c4f48f71..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageConsumer$7.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageConsumer$8.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageConsumer$8.class deleted file mode 100644 index 7ae443f7a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageConsumer$8.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageConsumer$PreviouslyDeliveredMap.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageConsumer$PreviouslyDeliveredMap.class deleted file mode 100644 index 86bf37977..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageConsumer$PreviouslyDeliveredMap.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageConsumer.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageConsumer.class deleted file mode 100644 index 9755f8587..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageConsumer.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageConsumer.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageConsumer.java deleted file mode 100644 index 39f55bf8f..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageConsumer.java +++ /dev/null @@ -1,1591 +0,0 @@ -/** - * 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; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicReference; - -import javax.jms.IllegalStateException; -import javax.jms.InvalidDestinationException; -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.MessageConsumer; -import javax.jms.MessageListener; -import javax.jms.TransactionRolledBackException; - -import org.apache.activemq.blob.BlobDownloader; -import org.apache.activemq.command.ActiveMQBlobMessage; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ActiveMQMessage; -import org.apache.activemq.command.ActiveMQTempDestination; -import org.apache.activemq.command.CommandTypes; -import org.apache.activemq.command.ConsumerId; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.command.MessageAck; -import org.apache.activemq.command.MessageDispatch; -import org.apache.activemq.command.MessageId; -import org.apache.activemq.command.MessagePull; -import org.apache.activemq.command.RemoveInfo; -import org.apache.activemq.command.TransactionId; -import org.apache.activemq.management.JMSConsumerStatsImpl; -import org.apache.activemq.management.StatsCapable; -import org.apache.activemq.management.StatsImpl; -import org.apache.activemq.selector.SelectorParser; -import org.apache.activemq.transaction.Synchronization; -import org.apache.activemq.util.Callback; -import org.apache.activemq.util.IntrospectionSupport; -import org.apache.activemq.util.JMSExceptionSupport; -import org.apache.activemq.util.ThreadPoolUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * A client uses a MessageConsumer object to receive messages - * from a destination. A MessageConsumer object is created by - * passing a Destination object to a message-consumer creation - * method supplied by a session. - *

    - * MessageConsumer is the parent interface for all message - * consumers. - *

    - * A message consumer can be created with a message selector. A message selector - * allows the client to restrict the messages delivered to the message consumer - * to those that match the selector. - *

    - * A client may either synchronously receive a message consumer's messages or - * have the consumer asynchronously deliver them as they arrive. - *

    - * For synchronous receipt, a client can request the next message from a message - * consumer using one of its receive methods. There are several - * variations of receive that allow a client to poll or wait for - * the next message. - *

    - * For asynchronous delivery, a client can register a - * MessageListener object with a message consumer. As messages - * arrive at the message consumer, it delivers them by calling the - * MessageListener's - * onMessage method. - *

    - * It is a client programming error for a MessageListener to - * throw an exception. - * - * - * @see javax.jms.MessageConsumer - * @see javax.jms.QueueReceiver - * @see javax.jms.TopicSubscriber - * @see javax.jms.Session - */ -public class ActiveMQMessageConsumer implements MessageAvailableConsumer, StatsCapable, ActiveMQDispatcher { - - @SuppressWarnings("serial") - class PreviouslyDeliveredMap extends HashMap { - final TransactionId transactionId; - public PreviouslyDeliveredMap(TransactionId transactionId) { - this.transactionId = transactionId; - } - } - - private static final Logger LOG = LoggerFactory.getLogger(ActiveMQMessageConsumer.class); - protected final ActiveMQSession session; - protected final ConsumerInfo info; - - // These are the messages waiting to be delivered to the client - protected final MessageDispatchChannel unconsumedMessages; - - // The are the messages that were delivered to the consumer but that have - // not been acknowledged. It's kept in reverse order since we - // Always walk list in reverse order. - protected final LinkedList deliveredMessages = new LinkedList(); - // track duplicate deliveries in a transaction such that the tx integrity can be validated - private PreviouslyDeliveredMap previouslyDeliveredMessages; - private int deliveredCounter; - private int additionalWindowSize; - private long redeliveryDelay; - private int ackCounter; - private int dispatchedCount; - private final AtomicReference messageListener = new AtomicReference(); - private final JMSConsumerStatsImpl stats; - - private final String selector; - private boolean synchronizationRegistered; - private final AtomicBoolean started = new AtomicBoolean(false); - - private MessageAvailableListener availableListener; - - private RedeliveryPolicy redeliveryPolicy; - private boolean optimizeAcknowledge; - private final AtomicBoolean deliveryingAcknowledgements = new AtomicBoolean(); - private ExecutorService executorService; - private MessageTransformer transformer; - private boolean clearDeliveredList; - AtomicInteger inProgressClearRequiredFlag = new AtomicInteger(0); - - private MessageAck pendingAck; - private long lastDeliveredSequenceId; - - private IOException failureError; - - private long optimizeAckTimestamp = System.currentTimeMillis(); - private long optimizeAcknowledgeTimeOut = 0; - private long optimizedAckScheduledAckInterval = 0; - private Runnable optimizedAckTask; - private long failoverRedeliveryWaitPeriod = 0; - private boolean transactedIndividualAck = false; - private boolean nonBlockingRedelivery = false; - - /** - * Create a MessageConsumer - * - * @param session - * @param dest - * @param name - * @param selector - * @param prefetch - * @param maximumPendingMessageCount - * @param noLocal - * @param browser - * @param dispatchAsync - * @param messageListener - * @throws JMSException - */ - public ActiveMQMessageConsumer(ActiveMQSession session, ConsumerId consumerId, ActiveMQDestination dest, - String name, String selector, int prefetch, - int maximumPendingMessageCount, boolean noLocal, boolean browser, - boolean dispatchAsync, MessageListener messageListener) throws JMSException { - if (dest == null) { - throw new InvalidDestinationException("Don't understand null destinations"); - } else if (dest.getPhysicalName() == null) { - throw new InvalidDestinationException("The destination object was not given a physical name."); - } else if (dest.isTemporary()) { - String physicalName = dest.getPhysicalName(); - - if (physicalName == null) { - throw new IllegalArgumentException("Physical name of Destination should be valid: " + dest); - } - - String connectionID = session.connection.getConnectionInfo().getConnectionId().getValue(); - - if (physicalName.indexOf(connectionID) < 0) { - throw new InvalidDestinationException("Cannot use a Temporary destination from another Connection"); - } - - if (session.connection.isDeleted(dest)) { - throw new InvalidDestinationException("Cannot use a Temporary destination that has been deleted"); - } - if (prefetch < 0) { - throw new JMSException("Cannot have a prefetch size less than zero"); - } - } - if (session.connection.isMessagePrioritySupported()) { - this.unconsumedMessages = new SimplePriorityMessageDispatchChannel(); - }else { - this.unconsumedMessages = new FifoMessageDispatchChannel(); - } - - this.session = session; - this.redeliveryPolicy = session.connection.getRedeliveryPolicyMap().getEntryFor(dest); - setTransformer(session.getTransformer()); - - this.info = new ConsumerInfo(consumerId); - this.info.setExclusive(this.session.connection.isExclusiveConsumer()); - this.info.setClientId(this.session.connection.getClientID()); - this.info.setSubscriptionName(name); - this.info.setPrefetchSize(prefetch); - this.info.setCurrentPrefetchSize(prefetch); - this.info.setMaximumPendingMessageLimit(maximumPendingMessageCount); - this.info.setNoLocal(noLocal); - this.info.setDispatchAsync(dispatchAsync); - this.info.setRetroactive(this.session.connection.isUseRetroactiveConsumer()); - this.info.setSelector(null); - - // Allows the options on the destination to configure the consumerInfo - if (dest.getOptions() != null) { - Map options = IntrospectionSupport.extractProperties( - new HashMap(dest.getOptions()), "consumer."); - IntrospectionSupport.setProperties(this.info, options); - if (options.size() > 0) { - String msg = "There are " + options.size() - + " consumer options that couldn't be set on the consumer." - + " Check the options are spelled correctly." - + " Unknown parameters=[" + options + "]." - + " This consumer cannot be started."; - LOG.warn(msg); - throw new ConfigurationException(msg); - } - } - - this.info.setDestination(dest); - this.info.setBrowser(browser); - if (selector != null && selector.trim().length() != 0) { - // Validate the selector - SelectorParser.parse(selector); - this.info.setSelector(selector); - this.selector = selector; - } else if (info.getSelector() != null) { - // Validate the selector - SelectorParser.parse(this.info.getSelector()); - this.selector = this.info.getSelector(); - } else { - this.selector = null; - } - - this.stats = new JMSConsumerStatsImpl(session.getSessionStats(), dest); - this.optimizeAcknowledge = session.connection.isOptimizeAcknowledge() && session.isAutoAcknowledge() - && !info.isBrowser(); - if (this.optimizeAcknowledge) { - this.optimizeAcknowledgeTimeOut = session.connection.getOptimizeAcknowledgeTimeOut(); - setOptimizedAckScheduledAckInterval(session.connection.getOptimizedAckScheduledAckInterval()); - } - - this.info.setOptimizedAcknowledge(this.optimizeAcknowledge); - this.failoverRedeliveryWaitPeriod = session.connection.getConsumerFailoverRedeliveryWaitPeriod(); - this.nonBlockingRedelivery = session.connection.isNonBlockingRedelivery(); - this.transactedIndividualAck = session.connection.isTransactedIndividualAck() || this.nonBlockingRedelivery; - if (messageListener != null) { - setMessageListener(messageListener); - } - try { - this.session.addConsumer(this); - this.session.syncSendPacket(info); - } catch (JMSException e) { - this.session.removeConsumer(this); - throw e; - } - - if (session.connection.isStarted()) { - start(); - } - } - - private boolean isAutoAcknowledgeEach() { - return session.isAutoAcknowledge() || ( session.isDupsOkAcknowledge() && getDestination().isQueue() ); - } - - private boolean isAutoAcknowledgeBatch() { - return session.isDupsOkAcknowledge() && !getDestination().isQueue() ; - } - - @Override - public StatsImpl getStats() { - return stats; - } - - public JMSConsumerStatsImpl getConsumerStats() { - return stats; - } - - public RedeliveryPolicy getRedeliveryPolicy() { - return redeliveryPolicy; - } - - /** - * Sets the redelivery policy used when messages are redelivered - */ - public void setRedeliveryPolicy(RedeliveryPolicy redeliveryPolicy) { - this.redeliveryPolicy = redeliveryPolicy; - } - - public MessageTransformer getTransformer() { - return transformer; - } - - /** - * Sets the transformer used to transform messages before they are sent on - * to the JMS bus - */ - public void setTransformer(MessageTransformer transformer) { - this.transformer = transformer; - } - - /** - * @return Returns the value. - */ - public ConsumerId getConsumerId() { - return info.getConsumerId(); - } - - /** - * @return the consumer name - used for durable consumers - */ - public String getConsumerName() { - return this.info.getSubscriptionName(); - } - - /** - * @return true if this consumer does not accept locally produced messages - */ - protected boolean isNoLocal() { - return info.isNoLocal(); - } - - /** - * Retrieve is a browser - * - * @return true if a browser - */ - protected boolean isBrowser() { - return info.isBrowser(); - } - - /** - * @return ActiveMQDestination - */ - protected ActiveMQDestination getDestination() { - return info.getDestination(); - } - - /** - * @return Returns the prefetchNumber. - */ - public int getPrefetchNumber() { - return info.getPrefetchSize(); - } - - /** - * @return true if this is a durable topic subscriber - */ - public boolean isDurableSubscriber() { - return info.getSubscriptionName() != null && info.getDestination().isTopic(); - } - - /** - * Gets this message consumer's message selector expression. - * - * @return this message consumer's message selector, or null if no message - * selector exists for the message consumer (that is, if the message - * selector was not set or was set to null or the empty string) - * @throws JMSException if the JMS provider fails to receive the next - * message due to some internal error. - */ - @Override - public String getMessageSelector() throws JMSException { - checkClosed(); - return selector; - } - - /** - * Gets the message consumer's MessageListener. - * - * @return the listener for the message consumer, or null if no listener is - * set - * @throws JMSException if the JMS provider fails to get the message - * listener due to some internal error. - * @see javax.jms.MessageConsumer#setMessageListener(javax.jms.MessageListener) - */ - @Override - public MessageListener getMessageListener() throws JMSException { - checkClosed(); - return this.messageListener.get(); - } - - /** - * Sets the message consumer's MessageListener. - *

    - * Setting the message listener to null is the equivalent of unsetting the - * message listener for the message consumer. - *

    - * The effect of calling MessageConsumer.setMessageListener - * while messages are being consumed by an existing listener or the consumer - * is being used to consume messages synchronously is undefined. - * - * @param listener the listener to which the messages are to be delivered - * @throws JMSException if the JMS provider fails to receive the next - * message due to some internal error. - * @see javax.jms.MessageConsumer#getMessageListener - */ - @Override - public void setMessageListener(MessageListener listener) throws JMSException { - checkClosed(); - if (info.getPrefetchSize() == 0) { - throw new JMSException("Illegal prefetch size of zero. This setting is not supported for asynchronous consumers please set a value of at least 1"); - } - if (listener != null) { - boolean wasRunning = session.isRunning(); - if (wasRunning) { - session.stop(); - } - - this.messageListener.set(listener); - session.redispatch(this, unconsumedMessages); - - if (wasRunning) { - session.start(); - } - } else { - this.messageListener.set(null); - } - } - - @Override - public MessageAvailableListener getAvailableListener() { - return availableListener; - } - - /** - * Sets the listener used to notify synchronous consumers that there is a - * message available so that the {@link MessageConsumer#receiveNoWait()} can - * be called. - */ - @Override - public void setAvailableListener(MessageAvailableListener availableListener) { - this.availableListener = availableListener; - } - - /** - * Used to get an enqueued message from the unconsumedMessages list. The - * amount of time this method blocks is based on the timeout value. - if - * timeout==-1 then it blocks until a message is received. - if timeout==0 - * then it it tries to not block at all, it returns a message if it is - * available - if timeout>0 then it blocks up to timeout amount of time. - * Expired messages will consumed by this method. - * - * @throws JMSException - * @return null if we timeout or if the consumer is closed. - */ - private MessageDispatch dequeue(long timeout) throws JMSException { - try { - long deadline = 0; - if (timeout > 0) { - deadline = System.currentTimeMillis() + timeout; - } - while (true) { - MessageDispatch md = unconsumedMessages.dequeue(timeout); - if (md == null) { - if (timeout > 0 && !unconsumedMessages.isClosed()) { - timeout = Math.max(deadline - System.currentTimeMillis(), 0); - } else { - if (failureError != null) { - throw JMSExceptionSupport.create(failureError); - } else { - return null; - } - } - } else if (md.getMessage() == null) { - return null; - } else if (md.getMessage().isExpired()) { - if (LOG.isDebugEnabled()) { - LOG.debug(getConsumerId() + " received expired message: " + md); - } - beforeMessageIsConsumed(md); - afterMessageIsConsumed(md, true); - if (timeout > 0) { - timeout = Math.max(deadline - System.currentTimeMillis(), 0); - } - } else { - if (LOG.isTraceEnabled()) { - LOG.trace(getConsumerId() + " received message: " + md); - } - return md; - } - } - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw JMSExceptionSupport.create(e); - } - } - - /** - * Receives the next message produced for this message consumer. - *

    - * This call blocks indefinitely until a message is produced or until this - * message consumer is closed. - *

    - * If this receive is done within a transaction, the consumer - * retains the message until the transaction commits. - * - * @return the next message produced for this message consumer, or null if - * this message consumer is concurrently closed - */ - @Override - public Message receive() throws JMSException { - checkClosed(); - checkMessageListener(); - - sendPullCommand(0); - MessageDispatch md = dequeue(-1); - if (md == null) { - return null; - } - - beforeMessageIsConsumed(md); - afterMessageIsConsumed(md, false); - - return createActiveMQMessage(md); - } - - /** - * @param md - * @return - */ - private ActiveMQMessage createActiveMQMessage(final MessageDispatch md) throws JMSException { - ActiveMQMessage m = (ActiveMQMessage)md.getMessage().copy(); - if (m.getDataStructureType()==CommandTypes.ACTIVEMQ_BLOB_MESSAGE) { - ((ActiveMQBlobMessage)m).setBlobDownloader(new BlobDownloader(session.getBlobTransferPolicy())); - } - if (transformer != null) { - Message transformedMessage = transformer.consumerTransform(session, this, m); - if (transformedMessage != null) { - m = ActiveMQMessageTransformation.transformMessage(transformedMessage, session.connection); - } - } - if (session.isClientAcknowledge()) { - m.setAcknowledgeCallback(new Callback() { - @Override - public void execute() throws Exception { - session.checkClosed(); - session.acknowledge(); - } - }); - } else if (session.isIndividualAcknowledge()) { - m.setAcknowledgeCallback(new Callback() { - @Override - public void execute() throws Exception { - session.checkClosed(); - acknowledge(md); - } - }); - } - return m; - } - - /** - * Receives the next message that arrives within the specified timeout - * interval. - *

    - * This call blocks until a message arrives, the timeout expires, or this - * message consumer is closed. A timeout of zero never - * expires, and the call blocks indefinitely. - * - * @param timeout the timeout value (in milliseconds), a time out of zero - * never expires. - * @return the next message produced for this message consumer, or null if - * the timeout expires or this message consumer is concurrently - * closed - */ - @Override - public Message receive(long timeout) throws JMSException { - checkClosed(); - checkMessageListener(); - if (timeout == 0) { - return this.receive(); - } - - sendPullCommand(timeout); - while (timeout > 0) { - - MessageDispatch md; - if (info.getPrefetchSize() == 0) { - md = dequeue(-1); // We let the broker let us know when we timeout. - } else { - md = dequeue(timeout); - } - - if (md == null) { - return null; - } - - beforeMessageIsConsumed(md); - afterMessageIsConsumed(md, false); - return createActiveMQMessage(md); - } - return null; - } - - /** - * Receives the next message if one is immediately available. - * - * @return the next message produced for this message consumer, or null if - * one is not available - * @throws JMSException if the JMS provider fails to receive the next - * message due to some internal error. - */ - @Override - public Message receiveNoWait() throws JMSException { - checkClosed(); - checkMessageListener(); - sendPullCommand(-1); - - MessageDispatch md; - if (info.getPrefetchSize() == 0) { - md = dequeue(-1); // We let the broker let us know when we - // timeout. - } else { - md = dequeue(0); - } - - if (md == null) { - return null; - } - - beforeMessageIsConsumed(md); - afterMessageIsConsumed(md, false); - return createActiveMQMessage(md); - } - - /** - * Closes the message consumer. - *

    - * Since a provider may allocate some resources on behalf of a - * MessageConsumer - * outside the Java virtual machine, clients should close them when they are - * not needed. Relying on garbage collection to eventually reclaim these - * resources may not be timely enough. - *

    - * This call blocks until a receive or message listener in - * progress has completed. A blocked message consumer receive - * call returns null when this message consumer is closed. - * - * @throws JMSException if the JMS provider fails to close the consumer due - * to some internal error. - */ - @Override - public void close() throws JMSException { - if (!unconsumedMessages.isClosed()) { - if (!deliveredMessages.isEmpty() && session.getTransactionContext().isInTransaction()) { - session.getTransactionContext().addSynchronization(new Synchronization() { - @Override - public void afterCommit() throws Exception { - doClose(); - } - - @Override - public void afterRollback() throws Exception { - doClose(); - } - }); - } else { - doClose(); - } - } - } - - void doClose() throws JMSException { - // Store interrupted state and clear so that Transport operations don't - // throw InterruptedException and we ensure that resources are cleaned up. - boolean interrupted = Thread.interrupted(); - dispose(); - RemoveInfo removeCommand = info.createRemoveCommand(); - if (LOG.isDebugEnabled()) { - LOG.debug("remove: " + this.getConsumerId() + ", lastDeliveredSequenceId:" + lastDeliveredSequenceId); - } - removeCommand.setLastDeliveredSequenceId(lastDeliveredSequenceId); - this.session.asyncSendPacket(removeCommand); - if (interrupted) { - Thread.currentThread().interrupt(); - } - } - - void inProgressClearRequired() { - inProgressClearRequiredFlag.incrementAndGet(); - // deal with delivered messages async to avoid lock contention with in progress acks - clearDeliveredList = true; - } - - void clearMessagesInProgress() { - if (inProgressClearRequiredFlag.get() > 0) { - synchronized (unconsumedMessages.getMutex()) { - if (inProgressClearRequiredFlag.get() > 0) { - if (LOG.isDebugEnabled()) { - LOG.debug(getConsumerId() + " clearing unconsumed list (" + unconsumedMessages.size() + ") on transport interrupt"); - } - // ensure unconsumed are rolledback up front as they may get redelivered to another consumer - List list = unconsumedMessages.removeAll(); - if (!this.info.isBrowser()) { - for (MessageDispatch old : list) { - session.connection.rollbackDuplicate(this, old.getMessage()); - } - } - // allow dispatch on this connection to resume - session.connection.transportInterruptionProcessingComplete(); - inProgressClearRequiredFlag.decrementAndGet(); - - // Wake up any blockers and allow them to recheck state. - unconsumedMessages.getMutex().notifyAll(); - } - } - } - clearDeliveredList(); - } - - void deliverAcks() { - MessageAck ack = null; - if (deliveryingAcknowledgements.compareAndSet(false, true)) { - if (isAutoAcknowledgeEach()) { - synchronized(deliveredMessages) { - ack = makeAckForAllDeliveredMessages(MessageAck.STANDARD_ACK_TYPE); - if (ack != null) { - deliveredMessages.clear(); - ackCounter = 0; - } else { - ack = pendingAck; - pendingAck = null; - } - } - } else if (pendingAck != null && pendingAck.isStandardAck()) { - ack = pendingAck; - pendingAck = null; - } - if (ack != null) { - final MessageAck ackToSend = ack; - - if (executorService == null) { - executorService = Executors.newSingleThreadExecutor(); - } - executorService.submit(new Runnable() { - @Override - public void run() { - try { - session.sendAck(ackToSend,true); - } catch (JMSException e) { - LOG.error(getConsumerId() + " failed to delivered acknowledgements", e); - } finally { - deliveryingAcknowledgements.set(false); - } - } - }); - } else { - deliveryingAcknowledgements.set(false); - } - } - } - - public void dispose() throws JMSException { - if (!unconsumedMessages.isClosed()) { - - // Do we have any acks we need to send out before closing? - // Ack any delivered messages now. - if (!session.getTransacted()) { - deliverAcks(); - if (isAutoAcknowledgeBatch()) { - acknowledge(); - } - } - if (executorService != null) { - ThreadPoolUtils.shutdownGraceful(executorService, 60000L); - executorService = null; - } - if (optimizedAckTask != null) { - this.session.connection.getScheduler().cancel(optimizedAckTask); - optimizedAckTask = null; - } - - if (session.isClientAcknowledge()) { - if (!this.info.isBrowser()) { - // rollback duplicates that aren't acknowledged - List tmp = null; - synchronized (this.deliveredMessages) { - tmp = new ArrayList(this.deliveredMessages); - } - for (MessageDispatch old : tmp) { - this.session.connection.rollbackDuplicate(this, old.getMessage()); - } - tmp.clear(); - } - } - if (!session.isTransacted()) { - synchronized(deliveredMessages) { - deliveredMessages.clear(); - } - } - unconsumedMessages.close(); - this.session.removeConsumer(this); - List list = unconsumedMessages.removeAll(); - if (!this.info.isBrowser()) { - for (MessageDispatch old : list) { - // ensure we don't filter this as a duplicate - if (LOG.isDebugEnabled()) { - LOG.debug("on close, rollback duplicate: " + old.getMessage().getMessageId()); - } - session.connection.rollbackDuplicate(this, old.getMessage()); - } - } - } - } - - /** - * @throws IllegalStateException - */ - protected void checkClosed() throws IllegalStateException { - if (unconsumedMessages.isClosed()) { - throw new IllegalStateException("The Consumer is closed"); - } - } - - /** - * If we have a zero prefetch specified then send a pull command to the - * broker to pull a message we are about to receive - */ - protected void sendPullCommand(long timeout) throws JMSException { - clearDeliveredList(); - if (info.getCurrentPrefetchSize() == 0 && unconsumedMessages.isEmpty()) { - MessagePull messagePull = new MessagePull(); - messagePull.configure(info); - messagePull.setTimeout(timeout); - session.asyncSendPacket(messagePull); - } - } - - protected void checkMessageListener() throws JMSException { - session.checkMessageListener(); - } - - protected void setOptimizeAcknowledge(boolean value) { - if (optimizeAcknowledge && !value) { - deliverAcks(); - } - optimizeAcknowledge = value; - } - - protected void setPrefetchSize(int prefetch) { - deliverAcks(); - this.info.setCurrentPrefetchSize(prefetch); - } - - private void beforeMessageIsConsumed(MessageDispatch md) throws JMSException { - md.setDeliverySequenceId(session.getNextDeliveryId()); - lastDeliveredSequenceId = md.getMessage().getMessageId().getBrokerSequenceId(); - if (!isAutoAcknowledgeBatch()) { - synchronized(deliveredMessages) { - deliveredMessages.addFirst(md); - } - if (session.getTransacted()) { - if (transactedIndividualAck) { - immediateIndividualTransactedAck(md); - } else { - ackLater(md, MessageAck.DELIVERED_ACK_TYPE); - } - } - } - } - - private void immediateIndividualTransactedAck(MessageDispatch md) throws JMSException { - // acks accumulate on the broker pending transaction completion to indicate - // delivery status - registerSync(); - MessageAck ack = new MessageAck(md, MessageAck.INDIVIDUAL_ACK_TYPE, 1); - ack.setTransactionId(session.getTransactionContext().getTransactionId()); - session.syncSendPacket(ack); - } - - private void afterMessageIsConsumed(MessageDispatch md, boolean messageExpired) throws JMSException { - if (unconsumedMessages.isClosed()) { - return; - } - if (messageExpired) { - acknowledge(md, MessageAck.DELIVERED_ACK_TYPE); - stats.getExpiredMessageCount().increment(); - } else { - stats.onMessage(); - if (session.getTransacted()) { - // Do nothing. - } else if (isAutoAcknowledgeEach()) { - if (deliveryingAcknowledgements.compareAndSet(false, true)) { - synchronized (deliveredMessages) { - if (!deliveredMessages.isEmpty()) { - if (optimizeAcknowledge) { - ackCounter++; - - // AMQ-3956 evaluate both expired and normal msgs as - // otherwise consumer may get stalled - if (ackCounter + deliveredCounter >= (info.getPrefetchSize() * .65) || (optimizeAcknowledgeTimeOut > 0 && System.currentTimeMillis() >= (optimizeAckTimestamp + optimizeAcknowledgeTimeOut))) { - MessageAck ack = makeAckForAllDeliveredMessages(MessageAck.STANDARD_ACK_TYPE); - if (ack != null) { - deliveredMessages.clear(); - ackCounter = 0; - session.sendAck(ack); - optimizeAckTimestamp = System.currentTimeMillis(); - } - // AMQ-3956 - as further optimization send - // ack for expired msgs when there are any. - // This resets the deliveredCounter to 0 so that - // we won't sent standard acks with every msg just - // because the deliveredCounter just below - // 0.5 * prefetch as used in ackLater() - if (pendingAck != null && deliveredCounter > 0) { - session.sendAck(pendingAck); - pendingAck = null; - deliveredCounter = 0; - } - } - } else { - MessageAck ack = makeAckForAllDeliveredMessages(MessageAck.STANDARD_ACK_TYPE); - if (ack!=null) { - deliveredMessages.clear(); - session.sendAck(ack); - } - } - } - } - deliveryingAcknowledgements.set(false); - } - } else if (isAutoAcknowledgeBatch()) { - ackLater(md, MessageAck.STANDARD_ACK_TYPE); - } else if (session.isClientAcknowledge()||session.isIndividualAcknowledge()) { - boolean messageUnackedByConsumer = false; - synchronized (deliveredMessages) { - messageUnackedByConsumer = deliveredMessages.contains(md); - } - if (messageUnackedByConsumer) { - ackLater(md, MessageAck.DELIVERED_ACK_TYPE); - } - } - else { - throw new IllegalStateException("Invalid session state."); - } - } - } - - /** - * Creates a MessageAck for all messages contained in deliveredMessages. - * Caller should hold the lock for deliveredMessages. - * - * @param type Ack-Type (i.e. MessageAck.STANDARD_ACK_TYPE) - * @return null if nothing to ack. - */ - private MessageAck makeAckForAllDeliveredMessages(byte type) { - synchronized (deliveredMessages) { - if (deliveredMessages.isEmpty()) - return null; - - MessageDispatch md = deliveredMessages.getFirst(); - MessageAck ack = new MessageAck(md, type, deliveredMessages.size()); - ack.setFirstMessageId(deliveredMessages.getLast().getMessage().getMessageId()); - return ack; - } - } - - private void ackLater(MessageDispatch md, byte ackType) throws JMSException { - - // Don't acknowledge now, but we may need to let the broker know the - // consumer got the message to expand the pre-fetch window - if (session.getTransacted()) { - registerSync(); - } - - deliveredCounter++; - - MessageAck oldPendingAck = pendingAck; - pendingAck = new MessageAck(md, ackType, deliveredCounter); - pendingAck.setTransactionId(session.getTransactionContext().getTransactionId()); - if( oldPendingAck==null ) { - pendingAck.setFirstMessageId(pendingAck.getLastMessageId()); - } else if ( oldPendingAck.getAckType() == pendingAck.getAckType() ) { - pendingAck.setFirstMessageId(oldPendingAck.getFirstMessageId()); - } else { - // old pending ack being superseded by ack of another type, if is is not a delivered - // ack and hence important, send it now so it is not lost. - if ( !oldPendingAck.isDeliveredAck()) { - if (LOG.isDebugEnabled()) { - LOG.debug("Sending old pending ack " + oldPendingAck + ", new pending: " + pendingAck); - } - session.sendAck(oldPendingAck); - } else { - if (LOG.isDebugEnabled()) { - LOG.debug("dropping old pending ack " + oldPendingAck + ", new pending: " + pendingAck); - } - } - } - // AMQ-3956 evaluate both expired and normal msgs as - // otherwise consumer may get stalled - if ((0.5 * info.getPrefetchSize()) <= (deliveredCounter + ackCounter - additionalWindowSize)) { - if (LOG.isDebugEnabled()) { - LOG.debug("ackLater: sending: " + pendingAck); - } - session.sendAck(pendingAck); - pendingAck=null; - deliveredCounter = 0; - additionalWindowSize = 0; - } - } - - private void registerSync() throws JMSException { - session.doStartTransaction(); - if (!synchronizationRegistered) { - synchronizationRegistered = true; - session.getTransactionContext().addSynchronization(new Synchronization() { - @Override - public void beforeEnd() throws Exception { - if (transactedIndividualAck) { - clearDeliveredList(); - waitForRedeliveries(); - synchronized(deliveredMessages) { - rollbackOnFailedRecoveryRedelivery(); - } - } else { - acknowledge(); - } - synchronizationRegistered = false; - } - - @Override - public void afterCommit() throws Exception { - commit(); - synchronizationRegistered = false; - } - - @Override - public void afterRollback() throws Exception { - rollback(); - synchronizationRegistered = false; - } - }); - } - } - - /** - * Acknowledge all the messages that have been delivered to the client up to - * this point. - * - * @throws JMSException - */ - public void acknowledge() throws JMSException { - clearDeliveredList(); - waitForRedeliveries(); - synchronized(deliveredMessages) { - // Acknowledge all messages so far. - MessageAck ack = makeAckForAllDeliveredMessages(MessageAck.STANDARD_ACK_TYPE); - if (ack == null) - return; // no msgs - - if (session.getTransacted()) { - rollbackOnFailedRecoveryRedelivery(); - session.doStartTransaction(); - ack.setTransactionId(session.getTransactionContext().getTransactionId()); - } - - pendingAck = null; - session.sendAck(ack); - - // Adjust the counters - deliveredCounter = Math.max(0, deliveredCounter - deliveredMessages.size()); - additionalWindowSize = Math.max(0, additionalWindowSize - deliveredMessages.size()); - - if (!session.getTransacted()) { - deliveredMessages.clear(); - } - } - } - - private void waitForRedeliveries() { - if (failoverRedeliveryWaitPeriod > 0 && previouslyDeliveredMessages != null) { - long expiry = System.currentTimeMillis() + failoverRedeliveryWaitPeriod; - int numberNotReplayed; - do { - numberNotReplayed = 0; - synchronized(deliveredMessages) { - if (previouslyDeliveredMessages != null) { - for (Entry entry: previouslyDeliveredMessages.entrySet()) { - if (!entry.getValue()) { - numberNotReplayed++; - } - } - } - } - if (numberNotReplayed > 0) { - LOG.info("waiting for redelivery of " + numberNotReplayed + " in transaction: " - + previouslyDeliveredMessages.transactionId + ", to consumer :" + this.getConsumerId()); - try { - Thread.sleep(Math.max(500, failoverRedeliveryWaitPeriod/4)); - } catch (InterruptedException outOfhere) { - break; - } - } - } while (numberNotReplayed > 0 && expiry < System.currentTimeMillis()); - } - } - - /* - * called with deliveredMessages locked - */ - private void rollbackOnFailedRecoveryRedelivery() throws JMSException { - if (previouslyDeliveredMessages != null) { - // if any previously delivered messages was not re-delivered, transaction is invalid and must rollback - // as messages have been dispatched else where. - int numberNotReplayed = 0; - for (Entry entry: previouslyDeliveredMessages.entrySet()) { - if (!entry.getValue()) { - numberNotReplayed++; - if (LOG.isDebugEnabled()) { - LOG.debug("previously delivered message has not been replayed in transaction: " - + previouslyDeliveredMessages.transactionId - + " , messageId: " + entry.getKey()); - } - } - } - if (numberNotReplayed > 0) { - String message = "rolling back transaction (" - + previouslyDeliveredMessages.transactionId + ") post failover recovery. " + numberNotReplayed - + " previously delivered message(s) not replayed to consumer: " + this.getConsumerId(); - LOG.warn(message); - throw new TransactionRolledBackException(message); - } - } - } - - void acknowledge(MessageDispatch md) throws JMSException { - acknowledge(md, MessageAck.INDIVIDUAL_ACK_TYPE); - } - - void acknowledge(MessageDispatch md, byte ackType) throws JMSException { - MessageAck ack = new MessageAck(md, ackType, 1); - session.sendAck(ack); - synchronized(deliveredMessages){ - deliveredMessages.remove(md); - } - } - - public void commit() throws JMSException { - synchronized (deliveredMessages) { - deliveredMessages.clear(); - clearPreviouslyDelivered(); - } - redeliveryDelay = 0; - } - - public void rollback() throws JMSException { - clearDeliveredList(); - synchronized (unconsumedMessages.getMutex()) { - if (optimizeAcknowledge) { - // remove messages read but not acked at the broker yet through - // optimizeAcknowledge - if (!this.info.isBrowser()) { - synchronized(deliveredMessages) { - for (int i = 0; (i < deliveredMessages.size()) && (i < ackCounter); i++) { - // ensure we don't filter this as a duplicate - MessageDispatch md = deliveredMessages.removeLast(); - session.connection.rollbackDuplicate(this, md.getMessage()); - } - } - } - } - synchronized(deliveredMessages) { - rollbackPreviouslyDeliveredAndNotRedelivered(); - if (deliveredMessages.isEmpty()) { - return; - } - - // use initial delay for first redelivery - MessageDispatch lastMd = deliveredMessages.getFirst(); - final int currentRedeliveryCount = lastMd.getMessage().getRedeliveryCounter(); - if (currentRedeliveryCount > 0) { - redeliveryDelay = redeliveryPolicy.getNextRedeliveryDelay(redeliveryDelay); - } else { - redeliveryDelay = redeliveryPolicy.getInitialRedeliveryDelay(); - } - MessageId firstMsgId = deliveredMessages.getLast().getMessage().getMessageId(); - - for (Iterator iter = deliveredMessages.iterator(); iter.hasNext();) { - MessageDispatch md = iter.next(); - md.getMessage().onMessageRolledBack(); - // ensure we don't filter this as a duplicate - session.connection.rollbackDuplicate(this, md.getMessage()); - } - - if (redeliveryPolicy.getMaximumRedeliveries() != RedeliveryPolicy.NO_MAXIMUM_REDELIVERIES - && lastMd.getMessage().getRedeliveryCounter() > redeliveryPolicy.getMaximumRedeliveries()) { - // We need to NACK the messages so that they get sent to the - // DLQ. - // Acknowledge the last message. - - MessageAck ack = new MessageAck(lastMd, MessageAck.POSION_ACK_TYPE, deliveredMessages.size()); - ack.setFirstMessageId(firstMsgId); - ack.setPoisonCause(new Throwable("Exceeded redelivery policy limit:" + redeliveryPolicy - + ", cause:" + lastMd.getRollbackCause(), lastMd.getRollbackCause())); - session.sendAck(ack,true); - // Adjust the window size. - additionalWindowSize = Math.max(0, additionalWindowSize - deliveredMessages.size()); - redeliveryDelay = 0; - - deliveredCounter -= deliveredMessages.size(); - deliveredMessages.clear(); - - } else { - - // only redelivery_ack after first delivery - if (currentRedeliveryCount > 0) { - MessageAck ack = new MessageAck(lastMd, MessageAck.REDELIVERED_ACK_TYPE, deliveredMessages.size()); - ack.setFirstMessageId(firstMsgId); - session.sendAck(ack,true); - } - - // stop the delivery of messages. - if (nonBlockingRedelivery) { - if (!unconsumedMessages.isClosed()) { - - final LinkedList pendingRedeliveries = - new LinkedList(deliveredMessages); - - Collections.reverse(pendingRedeliveries); - - deliveredCounter -= deliveredMessages.size(); - deliveredMessages.clear(); - - // Start up the delivery again a little later. - session.getScheduler().executeAfterDelay(new Runnable() { - @Override - public void run() { - try { - if (!unconsumedMessages.isClosed()) { - for(MessageDispatch dispatch : pendingRedeliveries) { - session.dispatch(dispatch); - } - } - } catch (Exception e) { - session.connection.onAsyncException(e); - } - } - }, redeliveryDelay); - } - - } else { - unconsumedMessages.stop(); - - for (MessageDispatch md : deliveredMessages) { - unconsumedMessages.enqueueFirst(md); - } - - deliveredCounter -= deliveredMessages.size(); - deliveredMessages.clear(); - - if (redeliveryDelay > 0 && !unconsumedMessages.isClosed()) { - // Start up the delivery again a little later. - session.getScheduler().executeAfterDelay(new Runnable() { - @Override - public void run() { - try { - if (started.get()) { - start(); - } - } catch (JMSException e) { - session.connection.onAsyncException(e); - } - } - }, redeliveryDelay); - } else { - start(); - } - } - } - } - } - if (messageListener.get() != null) { - session.redispatch(this, unconsumedMessages); - } - } - - /* - * called with unconsumedMessages && deliveredMessages locked - * remove any message not re-delivered as they can't be replayed to this - * consumer on rollback - */ - private void rollbackPreviouslyDeliveredAndNotRedelivered() { - if (previouslyDeliveredMessages != null) { - for (Entry entry: previouslyDeliveredMessages.entrySet()) { - if (!entry.getValue()) { - if (LOG.isTraceEnabled()) { - LOG.trace("rollback non redelivered: " + entry.getKey()); - } - removeFromDeliveredMessages(entry.getKey()); - } - } - clearPreviouslyDelivered(); - } - } - - /* - * called with deliveredMessages locked - */ - private void removeFromDeliveredMessages(MessageId key) { - Iterator iterator = deliveredMessages.iterator(); - while (iterator.hasNext()) { - MessageDispatch candidate = iterator.next(); - if (key.equals(candidate.getMessage().getMessageId())) { - session.connection.rollbackDuplicate(this, candidate.getMessage()); - iterator.remove(); - break; - } - } - } - - /* - * called with deliveredMessages locked - */ - private void clearPreviouslyDelivered() { - if (previouslyDeliveredMessages != null) { - previouslyDeliveredMessages.clear(); - previouslyDeliveredMessages = null; - } - } - - @Override - public void dispatch(MessageDispatch md) { - MessageListener listener = this.messageListener.get(); - try { - clearMessagesInProgress(); - clearDeliveredList(); - synchronized (unconsumedMessages.getMutex()) { - if (!unconsumedMessages.isClosed()) { - if (this.info.isBrowser() || !session.connection.isDuplicate(this, md.getMessage())) { - if (listener != null && unconsumedMessages.isRunning()) { - ActiveMQMessage message = createActiveMQMessage(md); - beforeMessageIsConsumed(md); - try { - boolean expired = message.isExpired(); - if (!expired) { - listener.onMessage(message); - } - afterMessageIsConsumed(md, expired); - } catch (RuntimeException e) { - LOG.error(getConsumerId() + " Exception while processing message: " + md.getMessage().getMessageId(), e); - if (isAutoAcknowledgeBatch() || isAutoAcknowledgeEach() || session.isIndividualAcknowledge()) { - // schedual redelivery and possible dlq processing - md.setRollbackCause(e); - rollback(); - } else { - // Transacted or Client ack: Deliver the - // next message. - afterMessageIsConsumed(md, false); - } - } - } else { - if (!unconsumedMessages.isRunning()) { - // delayed redelivery, ensure it can be re delivered - session.connection.rollbackDuplicate(this, md.getMessage()); - } - unconsumedMessages.enqueue(md); - if (availableListener != null) { - availableListener.onMessageAvailable(this); - } - } - } else { - if (!session.isTransacted()) { - LOG.warn("Duplicate non transacted dispatch to consumer: " + getConsumerId() + ", poison acking: " + md); - MessageAck poisonAck = new MessageAck(md, MessageAck.POSION_ACK_TYPE, 1); - poisonAck.setFirstMessageId(md.getMessage().getMessageId()); - poisonAck.setPoisonCause(new Throwable("Duplicate non transacted delivery to " + getConsumerId())); - session.sendAck(poisonAck); - } else { - if (LOG.isDebugEnabled()) { - LOG.debug(getConsumerId() + " tracking transacted redelivery of duplicate: " + md.getMessage()); - } - boolean needsPoisonAck = false; - synchronized (deliveredMessages) { - if (previouslyDeliveredMessages != null) { - previouslyDeliveredMessages.put(md.getMessage().getMessageId(), true); - } else { - // delivery while pending redelivery to another consumer on the same connection - // not waiting for redelivery will help here - needsPoisonAck = true; - } - } - if (needsPoisonAck) { - MessageAck poisonAck = new MessageAck(md, MessageAck.POSION_ACK_TYPE, 1); - poisonAck.setFirstMessageId(md.getMessage().getMessageId()); - poisonAck.setPoisonCause(new JMSException("Duplicate dispatch with transacted redeliver pending on another consumer, connection: " - + session.getConnection().getConnectionInfo().getConnectionId())); - LOG.warn("acking duplicate delivery as poison, redelivery must be pending to another" - + " consumer on this connection, failoverRedeliveryWaitPeriod=" - + failoverRedeliveryWaitPeriod + ". Message: " + md + ", poisonAck: " + poisonAck); - session.sendAck(poisonAck); - } else { - if (transactedIndividualAck) { - immediateIndividualTransactedAck(md); - } else { - session.sendAck(new MessageAck(md, MessageAck.DELIVERED_ACK_TYPE, 1)); - } - } - } - } - } - } - if (++dispatchedCount % 1000 == 0) { - dispatchedCount = 0; - Thread.yield(); - } - } catch (Exception e) { - session.connection.onClientInternalException(e); - } - } - - // async (on next call) clear or track delivered as they may be flagged as duplicates if they arrive again - private void clearDeliveredList() { - if (clearDeliveredList) { - synchronized (deliveredMessages) { - if (clearDeliveredList) { - if (!deliveredMessages.isEmpty()) { - if (session.isTransacted()) { - - if (previouslyDeliveredMessages == null) { - previouslyDeliveredMessages = new PreviouslyDeliveredMap(session.getTransactionContext().getTransactionId()); - } - for (MessageDispatch delivered : deliveredMessages) { - previouslyDeliveredMessages.put(delivered.getMessage().getMessageId(), false); - } - if (LOG.isDebugEnabled()) { - LOG.debug(getConsumerId() + " tracking existing transacted " + previouslyDeliveredMessages.transactionId + - " delivered list (" + deliveredMessages.size() + ") on transport interrupt"); - } - } else { - if (session.isClientAcknowledge()) { - if (LOG.isDebugEnabled()) { - LOG.debug(getConsumerId() + " rolling back delivered list (" + deliveredMessages.size() + ") on transport interrupt"); - } - // allow redelivery - if (!this.info.isBrowser()) { - for (MessageDispatch md: deliveredMessages) { - this.session.connection.rollbackDuplicate(this, md.getMessage()); - } - } - } - if (LOG.isDebugEnabled()) { - LOG.debug(getConsumerId() + " clearing delivered list (" + deliveredMessages.size() + ") on transport interrupt"); - } - deliveredMessages.clear(); - pendingAck = null; - } - } - clearDeliveredList = false; - } - } - } - } - - public int getMessageSize() { - return unconsumedMessages.size(); - } - - public void start() throws JMSException { - if (unconsumedMessages.isClosed()) { - return; - } - started.set(true); - unconsumedMessages.start(); - session.executor.wakeup(); - } - - public void stop() { - started.set(false); - unconsumedMessages.stop(); - } - - @Override - public String toString() { - return "ActiveMQMessageConsumer { value=" + info.getConsumerId() + ", started=" + started.get() - + " }"; - } - - /** - * Delivers a message to the message listener. - * - * @return - * @throws JMSException - */ - public boolean iterate() { - MessageListener listener = this.messageListener.get(); - if (listener != null) { - MessageDispatch md = unconsumedMessages.dequeueNoWait(); - if (md != null) { - dispatch(md); - return true; - } - } - return false; - } - - public boolean isInUse(ActiveMQTempDestination destination) { - return info.getDestination().equals(destination); - } - - public long getLastDeliveredSequenceId() { - return lastDeliveredSequenceId; - } - - public IOException getFailureError() { - return failureError; - } - - public void setFailureError(IOException failureError) { - this.failureError = failureError; - } - - /** - * @return the optimizedAckScheduledAckInterval - */ - public long getOptimizedAckScheduledAckInterval() { - return optimizedAckScheduledAckInterval; - } - - /** - * @param optimizedAckScheduledAckInterval the optimizedAckScheduledAckInterval to set - */ - public void setOptimizedAckScheduledAckInterval(long optimizedAckScheduledAckInterval) throws JMSException { - this.optimizedAckScheduledAckInterval = optimizedAckScheduledAckInterval; - - if (this.optimizedAckTask != null) { - try { - this.session.connection.getScheduler().cancel(optimizedAckTask); - } catch (JMSException e) { - LOG.debug("Caught exception while cancelling old optimized ack task", e); - throw e; - } - this.optimizedAckTask = null; - } - - // Should we periodically send out all outstanding acks. - if (this.optimizeAcknowledge && this.optimizedAckScheduledAckInterval > 0) { - this.optimizedAckTask = new Runnable() { - - @Override - public void run() { - try { - if (optimizeAcknowledge && !unconsumedMessages.isClosed()) { - if (LOG.isInfoEnabled()) { - LOG.info("Consumer:{} is performing scheduled delivery of outstanding optimized Acks", info.getConsumerId()); - } - deliverAcks(); - } - } catch (Exception e) { - LOG.debug("Optimized Ack Task caught exception during ack", e); - } - } - }; - - try { - this.session.connection.getScheduler().executePeriodically(optimizedAckTask, optimizedAckScheduledAckInterval); - } catch (JMSException e) { - LOG.debug("Caught exception while scheduling new optimized ack task", e); - throw e; - } - } - } - - public boolean hasMessageListener() { - return messageListener.get() != null; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageProducer.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageProducer.class deleted file mode 100644 index 3ac67dae7..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageProducer.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageProducer.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageProducer.java deleted file mode 100644 index e45809abd..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageProducer.java +++ /dev/null @@ -1,352 +0,0 @@ -/** - * 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; - -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.atomic.AtomicLong; - -import javax.jms.Destination; -import javax.jms.IllegalStateException; -import javax.jms.InvalidDestinationException; -import javax.jms.JMSException; -import javax.jms.Message; - -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ProducerAck; -import org.apache.activemq.command.ProducerId; -import org.apache.activemq.command.ProducerInfo; -import org.apache.activemq.management.JMSProducerStatsImpl; -import org.apache.activemq.management.StatsCapable; -import org.apache.activemq.management.StatsImpl; -import org.apache.activemq.usage.MemoryUsage; -import org.apache.activemq.util.IntrospectionSupport; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * A client uses a MessageProducer object to send messages to a - * destination. A MessageProducer object is created by passing a - * Destination object to a message-producer creation method - * supplied by a session. - *

    - * MessageProducer is the parent interface for all message - * producers. - *

    - * A client also has the option of creating a message producer without supplying - * a destination. In this case, a destination must be provided with every send - * operation. A typical use for this kind of message producer is to send replies - * to requests using the request's JMSReplyTo destination. - *

    - * A client can specify a default delivery mode, priority, and time to live for - * messages sent by a message producer. It can also specify the delivery mode, - * priority, and time to live for an individual message. - *

    - * A client can specify a time-to-live value in milliseconds for each message it - * sends. This value defines a message expiration time that is the sum of the - * message's time-to-live and the GMT when it is sent (for transacted sends, - * this is the time the client sends the message, not the time the transaction - * is committed). - *

    - * A JMS provider should do its best to expire messages accurately; however, the - * JMS API does not define the accuracy provided. - * - * - * @see javax.jms.TopicPublisher - * @see javax.jms.QueueSender - * @see javax.jms.Session#createProducer - */ -public class ActiveMQMessageProducer extends ActiveMQMessageProducerSupport implements StatsCapable, Disposable { - - private static final Logger LOG = LoggerFactory.getLogger(ActiveMQMessageProducer.class); - - protected ProducerInfo info; - protected boolean closed; - - private final JMSProducerStatsImpl stats; - private AtomicLong messageSequence; - private final long startTime; - private MessageTransformer transformer; - private MemoryUsage producerWindow; - - protected ActiveMQMessageProducer(ActiveMQSession session, ProducerId producerId, ActiveMQDestination destination, int sendTimeout) throws JMSException { - super(session); - this.info = new ProducerInfo(producerId); - this.info.setWindowSize(session.connection.getProducerWindowSize()); - // Allows the options on the destination to configure the producerInfo - if (destination != null && destination.getOptions() != null) { - Map options = IntrospectionSupport.extractProperties( - new HashMap(destination.getOptions()), "producer."); - IntrospectionSupport.setProperties(this.info, options); - if (options.size() > 0) { - String msg = "There are " + options.size() - + " producer options that couldn't be set on the producer." - + " Check the options are spelled correctly." - + " Unknown parameters=[" + options + "]." - + " This producer cannot be started."; - LOG.warn(msg); - throw new ConfigurationException(msg); - } - } - - this.info.setDestination(destination); - - // Enable producer window flow control if protocol > 3 and the window - // size > 0 - if (session.connection.getProtocolVersion() >= 3 && this.info.getWindowSize() > 0) { - producerWindow = new MemoryUsage("Producer Window: " + producerId); - producerWindow.setExecutor(session.getConnectionExecutor()); - producerWindow.setLimit(this.info.getWindowSize()); - producerWindow.start(); - } - - this.defaultDeliveryMode = Message.DEFAULT_DELIVERY_MODE; - this.defaultPriority = Message.DEFAULT_PRIORITY; - this.defaultTimeToLive = Message.DEFAULT_TIME_TO_LIVE; - this.startTime = System.currentTimeMillis(); - this.messageSequence = new AtomicLong(0); - this.stats = new JMSProducerStatsImpl(session.getSessionStats(), destination); - try { - this.session.addProducer(this); - this.session.syncSendPacket(info); - } catch (JMSException e) { - this.session.removeProducer(this); - throw e; - } - this.setSendTimeout(sendTimeout); - setTransformer(session.getTransformer()); - } - - @Override - public StatsImpl getStats() { - return stats; - } - - public JMSProducerStatsImpl getProducerStats() { - return stats; - } - - /** - * Gets the destination associated with this MessageProducer. - * - * @return this producer's Destination/ - * @throws JMSException if the JMS provider fails to close the producer due to - * some internal error. - * @since 1.1 - */ - @Override - public Destination getDestination() throws JMSException { - checkClosed(); - return this.info.getDestination(); - } - - /** - * Closes the message producer. - *

    - * Since a provider may allocate some resources on behalf of a - * MessageProducer - * outside the Java virtual machine, clients should close them when they are - * not needed. Relying on garbage collection to eventually reclaim these - * resources may not be timely enough. - * - * @throws JMSException if the JMS provider fails to close the producer due - * to some internal error. - */ - @Override - public void close() throws JMSException { - if (!closed) { - dispose(); - this.session.asyncSendPacket(info.createRemoveCommand()); - } - } - - @Override - public void dispose() { - if (!closed) { - this.session.removeProducer(this); - if (producerWindow != null) { - producerWindow.stop(); - } - closed = true; - } - } - - /** - * Check if the instance of this producer has been closed. - * - * @throws IllegalStateException - */ - @Override - protected void checkClosed() throws IllegalStateException { - if (closed) { - throw new IllegalStateException("The producer is closed"); - } - } - - /** - * Sends a message to a destination for an unidentified message producer, - * specifying delivery mode, priority and time to live. - *

    - * Typically, a message producer is assigned a destination at creation time; - * however, the JMS API also supports unidentified message producers, which - * require that the destination be supplied every time a message is sent. - * - * @param destination the destination to send this message to - * @param message the message to send - * @param deliveryMode the delivery mode to use - * @param priority the priority for this message - * @param timeToLive the message's lifetime (in milliseconds) - * @throws JMSException if the JMS provider fails to send the message due to - * some internal error. - * @throws UnsupportedOperationException if an invalid destination is - * specified. - * @throws InvalidDestinationException if a client uses this method with an - * invalid destination. - * @see javax.jms.Session#createProducer - * @since 1.1 - */ - @Override - public void send(Destination destination, Message message, int deliveryMode, int priority, long timeToLive) throws JMSException { - this.send(destination, message, deliveryMode, priority, timeToLive, null); - } - - public void send(Message message, AsyncCallback onComplete) throws JMSException { - this.send(this.getDestination(), - message, - this.defaultDeliveryMode, - this.defaultPriority, - this.defaultTimeToLive, onComplete); - } - - public void send(Destination destination, Message message, AsyncCallback onComplete) throws JMSException { - this.send(destination, - message, - this.defaultDeliveryMode, - this.defaultPriority, - this.defaultTimeToLive, - onComplete); - } - - public void send(Message message, int deliveryMode, int priority, long timeToLive, AsyncCallback onComplete) throws JMSException { - this.send(this.getDestination(), - message, - deliveryMode, - priority, - timeToLive, - onComplete); - } - - public void send(Destination destination, Message message, int deliveryMode, int priority, long timeToLive, AsyncCallback onComplete) throws JMSException { - checkClosed(); - if (destination == null) { - if (info.getDestination() == null) { - throw new UnsupportedOperationException("A destination must be specified."); - } - throw new InvalidDestinationException("Don't understand null destinations"); - } - - ActiveMQDestination dest; - if (destination.equals(info.getDestination())) { - dest = (ActiveMQDestination)destination; - } else if (info.getDestination() == null) { - dest = ActiveMQDestination.transform(destination); - } else { - throw new UnsupportedOperationException("This producer can only send messages to: " + this.info.getDestination().getPhysicalName()); - } - if (dest == null) { - throw new JMSException("No destination specified"); - } - - if (transformer != null) { - Message transformedMessage = transformer.producerTransform(session, this, message); - if (transformedMessage != null) { - message = transformedMessage; - } - } - - if (producerWindow != null) { - try { - producerWindow.waitForSpace(); - } catch (InterruptedException e) { - throw new JMSException("Send aborted due to thread interrupt."); - } - } - - this.session.send(this, dest, message, deliveryMode, priority, timeToLive, producerWindow, sendTimeout, onComplete); - - stats.onMessage(); - } - - public MessageTransformer getTransformer() { - return transformer; - } - - /** - * Sets the transformer used to transform messages before they are sent on - * to the JMS bus - */ - public void setTransformer(MessageTransformer transformer) { - this.transformer = transformer; - } - - /** - * @return the time in milli second when this object was created. - */ - protected long getStartTime() { - return this.startTime; - } - - /** - * @return Returns the messageSequence. - */ - protected long getMessageSequence() { - return messageSequence.incrementAndGet(); - } - - /** - * @param messageSequence The messageSequence to set. - */ - protected void setMessageSequence(AtomicLong messageSequence) { - this.messageSequence = messageSequence; - } - - /** - * @return Returns the info. - */ - protected ProducerInfo getProducerInfo() { - return this.info != null ? this.info : null; - } - - /** - * @param info The info to set - */ - protected void setProducerInfo(ProducerInfo info) { - this.info = info; - } - - @Override - public String toString() { - return "ActiveMQMessageProducer { value=" + info.getProducerId() + " }"; - } - - public void onProducerAck(ProducerAck pa) { - if (this.producerWindow != null) { - this.producerWindow.decreaseUsage(pa.getSize()); - } - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageProducerSupport.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageProducerSupport.class deleted file mode 100644 index b1ad798fa..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageProducerSupport.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageProducerSupport.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageProducerSupport.java deleted file mode 100644 index 1f8ce41d6..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageProducerSupport.java +++ /dev/null @@ -1,323 +0,0 @@ -/** - * 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; - -import javax.jms.DeliveryMode; -import javax.jms.Destination; -import javax.jms.IllegalStateException; -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.MessageProducer; - -/** - * A useful base class for implementing a {@link MessageProducer} - * - * - */ -public abstract class ActiveMQMessageProducerSupport implements MessageProducer, Closeable { - protected ActiveMQSession session; - protected boolean disableMessageID; - protected boolean disableMessageTimestamp; - protected int defaultDeliveryMode; - protected int defaultPriority; - protected long defaultTimeToLive; - protected int sendTimeout=0; - - public ActiveMQMessageProducerSupport(ActiveMQSession session) { - this.session = session; - disableMessageTimestamp = session.connection.isDisableTimeStampsByDefault(); - } - - /** - * Sets whether message IDs are disabled. - *

    - * Since message IDs take some effort to create and increase a message's - * size, some JMS providers may be able to optimize message overhead if - * they are given a hint that the message ID is not used by an application. - * By calling the setDisableMessageID method on this message - * producer, a JMS client enables this potential optimization for all - * messages sent by this message producer. If the JMS provider accepts this - * hint, these messages must have the message ID set to null; if the - * provider ignores the hint, the message ID must be set to its normal - * unique value. - *

    - * Message IDs are enabled by default. - * - * @param value indicates if message IDs are disabled - * @throws javax.jms.JMSException if the JMS provider fails to close the producer due to - * some internal error. - */ - public void setDisableMessageID(boolean value) throws JMSException { - checkClosed(); - this.disableMessageID = value; - } - - /** - * Gets an indication of whether message IDs are disabled. - * - * @return an indication of whether message IDs are disabled - * @throws javax.jms.JMSException if the JMS provider fails to determine if message IDs are - * disabled due to some internal error. - */ - public boolean getDisableMessageID() throws JMSException { - checkClosed(); - return this.disableMessageID; - } - - /** - * Sets whether message timestamps are disabled. - *

    - * Since timestamps take some effort to create and increase a message's - * size, some JMS providers may be able to optimize message overhead if - * they are given a hint that the timestamp is not used by an application. - * By calling the setDisableMessageTimestamp method on this - * message producer, a JMS client enables this potential optimization for - * all messages sent by this message producer. If the JMS provider accepts - * this hint, these messages must have the timestamp set to zero; if the - * provider ignores the hint, the timestamp must be set to its normal - * value. - *

    - * Message timestamps are enabled by default. - * - * @param value indicates if message timestamps are disabled - * @throws javax.jms.JMSException if the JMS provider fails to close the producer due to - * some internal error. - */ - public void setDisableMessageTimestamp(boolean value) throws JMSException { - checkClosed(); - this.disableMessageTimestamp = value; - } - - /** - * Gets an indication of whether message timestamps are disabled. - * - * @return an indication of whether message timestamps are disabled - * @throws javax.jms.JMSException if the JMS provider fails to close the producer due to - * some internal error. - */ - public boolean getDisableMessageTimestamp() throws JMSException { - checkClosed(); - return this.disableMessageTimestamp; - } - - /** - * Sets the producer's default delivery mode. - *

    - * Delivery mode is set to PERSISTENT by default. - * - * @param newDeliveryMode the message delivery mode for this message producer; legal - * values are DeliveryMode.NON_PERSISTENT and - * DeliveryMode.PERSISTENT - * @throws javax.jms.JMSException if the JMS provider fails to set the delivery mode due to - * some internal error. - * @see javax.jms.MessageProducer#getDeliveryMode - * @see javax.jms.DeliveryMode#NON_PERSISTENT - * @see javax.jms.DeliveryMode#PERSISTENT - * @see javax.jms.Message#DEFAULT_DELIVERY_MODE - */ - public void setDeliveryMode(int newDeliveryMode) throws JMSException { - if (newDeliveryMode != DeliveryMode.PERSISTENT && newDeliveryMode != DeliveryMode.NON_PERSISTENT) { - throw new javax.jms.IllegalStateException("unknown delivery mode: " + newDeliveryMode); - } - checkClosed(); - this.defaultDeliveryMode = newDeliveryMode; - } - - /** - * Gets the producer's default delivery mode. - * - * @return the message delivery mode for this message producer - * @throws javax.jms.JMSException if the JMS provider fails to close the producer due to - * some internal error. - */ - public int getDeliveryMode() throws JMSException { - checkClosed(); - return this.defaultDeliveryMode; - } - - /** - * Sets the producer's default priority. - *

    - * The JMS API defines ten levels of priority value, with 0 as the lowest - * priority and 9 as the highest. Clients should consider priorities 0-4 as - * gradations of normal priority and priorities 5-9 as gradations of - * expedited priority. Priority is set to 4 by default. - * - * @param newDefaultPriority the message priority for this message producer; must be a - * value between 0 and 9 - * @throws javax.jms.JMSException if the JMS provider fails to set the delivery mode due to - * some internal error. - * @see javax.jms.MessageProducer#getPriority - * @see javax.jms.Message#DEFAULT_PRIORITY - */ - public void setPriority(int newDefaultPriority) throws JMSException { - if (newDefaultPriority < 0 || newDefaultPriority > 9) { - throw new IllegalStateException("default priority must be a value between 0 and 9"); - } - checkClosed(); - this.defaultPriority = newDefaultPriority; - } - - /** - * Gets the producer's default priority. - * - * @return the message priority for this message producer - * @throws javax.jms.JMSException if the JMS provider fails to close the producer due to - * some internal error. - * @see javax.jms.MessageProducer#setPriority - */ - public int getPriority() throws JMSException { - checkClosed(); - return this.defaultPriority; - } - - /** - * Sets the default length of time in milliseconds from its dispatch time - * that a produced message should be retained by the message system. - *

    - * Time to live is set to zero by default. - * - * @param timeToLive the message time to live in milliseconds; zero is unlimited - * @throws javax.jms.JMSException if the JMS provider fails to set the time to live due to - * some internal error. - * @see javax.jms.MessageProducer#getTimeToLive - * @see javax.jms.Message#DEFAULT_TIME_TO_LIVE - */ - public void setTimeToLive(long timeToLive) throws JMSException { - if (timeToLive < 0L) { - throw new IllegalStateException("cannot set a negative timeToLive"); - } - checkClosed(); - this.defaultTimeToLive = timeToLive; - } - - /** - * Gets the default length of time in milliseconds from its dispatch time - * that a produced message should be retained by the message system. - * - * @return the message time to live in milliseconds; zero is unlimited - * @throws javax.jms.JMSException if the JMS provider fails to get the time to live due to - * some internal error. - * @see javax.jms.MessageProducer#setTimeToLive - */ - public long getTimeToLive() throws JMSException { - checkClosed(); - return this.defaultTimeToLive; - } - - /** - * Sends a message using the MessageProducer's default - * delivery mode, priority, and time to live. - * - * @param message the message to send - * @throws javax.jms.JMSException if the JMS provider fails to send the message due to some - * internal error. - * @throws javax.jms.MessageFormatException if an invalid message is specified. - * @throws javax.jms.InvalidDestinationException if a client uses this method with a - * MessageProducer with an invalid destination. - * @throws UnsupportedOperationException - * if a client uses this method with a - * MessageProducer that did not specify a - * destination at creation time. - * @see javax.jms.Session#createProducer - * @see javax.jms.MessageProducer - * @since 1.1 - */ - public void send(Message message) throws JMSException { - this.send(this.getDestination(), - message, - this.defaultDeliveryMode, - this.defaultPriority, - this.defaultTimeToLive); - } - - /** - * Sends a message to the destination, specifying delivery mode, priority, - * and time to live. - * - * @param message the message to send - * @param deliveryMode the delivery mode to use - * @param priority the priority for this message - * @param timeToLive the message's lifetime (in milliseconds) - * @throws javax.jms.JMSException if the JMS provider fails to send the message due to some - * internal error. - * @throws javax.jms.MessageFormatException if an invalid message is specified. - * @throws javax.jms.InvalidDestinationException if a client uses this method with a - * MessageProducer with an invalid destination. - * @throws UnsupportedOperationException - * if a client uses this method with a - * MessageProducer that did not specify a - * destination at creation time. - * @see javax.jms.Session#createProducer - * @since 1.1 - */ - public void send(Message message, int deliveryMode, int priority, long timeToLive) throws JMSException { - this.send(this.getDestination(), - message, - deliveryMode, - priority, - timeToLive); - } - - /** - * Sends a message to a destination for an unidentified message producer. - * Uses the MessageProducer's default delivery mode, - * priority, and time to live. - *

    - * Typically, a message producer is assigned a destination at creation - * time; however, the JMS API also supports unidentified message producers, - * which require that the destination be supplied every time a message is - * sent. - * - * @param destination the destination to send this message to - * @param message the message to send - * @throws javax.jms.JMSException if the JMS provider fails to send the message due to some - * internal error. - * @throws javax.jms.MessageFormatException if an invalid message is specified. - * @throws javax.jms.InvalidDestinationException if a client uses this method with an invalid destination. - * @throws UnsupportedOperationException - * if a client uses this method with a - * MessageProducer that specified a destination at - * creation time. - * @see javax.jms.Session#createProducer - * @see javax.jms.MessageProducer - */ - public void send(Destination destination, Message message) throws JMSException { - this.send(destination, - message, - this.defaultDeliveryMode, - this.defaultPriority, - this.defaultTimeToLive); - } - - - protected abstract void checkClosed() throws IllegalStateException; - - /** - * @return the sendTimeout - */ - public int getSendTimeout() { - return sendTimeout; - } - - /** - * @param sendTimeout the sendTimeout to set - */ - public void setSendTimeout(int sendTimeout) { - this.sendTimeout = sendTimeout; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageTransformation.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageTransformation.class deleted file mode 100644 index 353213bec..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageTransformation.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageTransformation.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageTransformation.java deleted file mode 100644 index 5b74689b6..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQMessageTransformation.java +++ /dev/null @@ -1,200 +0,0 @@ -/** - * 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; - -import java.net.MalformedURLException; -import java.util.Enumeration; - -import javax.jms.*; -import javax.jms.Message; -import org.apache.activemq.blob.BlobDownloader; -import org.apache.activemq.command.*; - -/** - * A helper class for converting normal JMS interfaces into ActiveMQ specific - * ones. - * - * - */ -public final class ActiveMQMessageTransformation { - - private ActiveMQMessageTransformation() { - } - - /** - * Creates a an available JMS message from another provider. - * - * @param destination - Destination to be converted into ActiveMQ's - * implementation. - * @return ActiveMQDestination - ActiveMQ's implementation of the - * destination. - * @throws JMSException if an error occurs - */ - public static ActiveMQDestination transformDestination(Destination destination) throws JMSException { - ActiveMQDestination activeMQDestination = null; - - if (destination != null) { - if (destination instanceof ActiveMQDestination) { - return (ActiveMQDestination)destination; - - } else { - if (destination instanceof TemporaryQueue) { - activeMQDestination = new ActiveMQTempQueue(((Queue)destination).getQueueName()); - } else if (destination instanceof TemporaryTopic) { - activeMQDestination = new ActiveMQTempTopic(((Topic)destination).getTopicName()); - } else if (destination instanceof Queue) { - activeMQDestination = new ActiveMQQueue(((Queue)destination).getQueueName()); - } else if (destination instanceof Topic) { - activeMQDestination = new ActiveMQTopic(((Topic)destination).getTopicName()); - } - } - } - - return activeMQDestination; - } - - /** - * Creates a fast shallow copy of the current ActiveMQMessage or creates a - * whole new message instance from an available JMS message from another - * provider. - * - * @param message - Message to be converted into ActiveMQ's implementation. - * @param connection - * @return ActiveMQMessage - ActiveMQ's implementation object of the - * message. - * @throws JMSException if an error occurs - */ - public static ActiveMQMessage transformMessage(Message message, ActiveMQConnection connection) - throws JMSException { - if (message instanceof ActiveMQMessage) { - return (ActiveMQMessage)message; - - } else { - ActiveMQMessage activeMessage = null; - - if (message instanceof BytesMessage) { - BytesMessage bytesMsg = (BytesMessage)message; - bytesMsg.reset(); - ActiveMQBytesMessage msg = new ActiveMQBytesMessage(); - msg.setConnection(connection); - try { - for (;;) { - // Reads a byte from the message stream until the stream - // is empty - msg.writeByte(bytesMsg.readByte()); - } - } catch (MessageEOFException e) { - // if an end of message stream as expected - } catch (JMSException e) { - } - - activeMessage = msg; - } else if (message instanceof MapMessage) { - MapMessage mapMsg = (MapMessage)message; - ActiveMQMapMessage msg = new ActiveMQMapMessage(); - msg.setConnection(connection); - Enumeration iter = mapMsg.getMapNames(); - - while (iter.hasMoreElements()) { - String name = iter.nextElement().toString(); - msg.setObject(name, mapMsg.getObject(name)); - } - - activeMessage = msg; - } else if (message instanceof ObjectMessage) { - ObjectMessage objMsg = (ObjectMessage)message; - ActiveMQObjectMessage msg = new ActiveMQObjectMessage(); - msg.setConnection(connection); - msg.setObject(objMsg.getObject()); - msg.storeContent(); - activeMessage = msg; - } else if (message instanceof StreamMessage) { - StreamMessage streamMessage = (StreamMessage)message; - streamMessage.reset(); - ActiveMQStreamMessage msg = new ActiveMQStreamMessage(); - msg.setConnection(connection); - Object obj = null; - - try { - while ((obj = streamMessage.readObject()) != null) { - msg.writeObject(obj); - } - } catch (MessageEOFException e) { - // if an end of message stream as expected - } catch (JMSException e) { - } - - activeMessage = msg; - } else if (message instanceof TextMessage) { - TextMessage textMsg = (TextMessage)message; - ActiveMQTextMessage msg = new ActiveMQTextMessage(); - msg.setConnection(connection); - msg.setText(textMsg.getText()); - activeMessage = msg; - } else if (message instanceof BlobMessage) { - BlobMessage blobMessage = (BlobMessage)message; - ActiveMQBlobMessage msg = new ActiveMQBlobMessage(); - msg.setConnection(connection); - if (connection != null){ - msg.setBlobDownloader(new BlobDownloader(connection.getBlobTransferPolicy())); - } - try { - msg.setURL(blobMessage.getURL()); - } catch (MalformedURLException e) { - - } - activeMessage = msg; - } else { - activeMessage = new ActiveMQMessage(); - activeMessage.setConnection(connection); - } - - copyProperties(message, activeMessage); - - return activeMessage; - } - } - - /** - * Copies the standard JMS and user defined properties from the givem - * message to the specified message - * - * @param fromMessage the message to take the properties from - * @param toMessage the message to add the properties to - * @throws JMSException - */ - public static void copyProperties(Message fromMessage, Message toMessage) throws JMSException { - toMessage.setJMSMessageID(fromMessage.getJMSMessageID()); - toMessage.setJMSCorrelationID(fromMessage.getJMSCorrelationID()); - toMessage.setJMSReplyTo(transformDestination(fromMessage.getJMSReplyTo())); - toMessage.setJMSDestination(transformDestination(fromMessage.getJMSDestination())); - toMessage.setJMSDeliveryMode(fromMessage.getJMSDeliveryMode()); - toMessage.setJMSRedelivered(fromMessage.getJMSRedelivered()); - toMessage.setJMSType(fromMessage.getJMSType()); - toMessage.setJMSExpiration(fromMessage.getJMSExpiration()); - toMessage.setJMSPriority(fromMessage.getJMSPriority()); - toMessage.setJMSTimestamp(fromMessage.getJMSTimestamp()); - - Enumeration propertyNames = fromMessage.getPropertyNames(); - - while (propertyNames.hasMoreElements()) { - String name = propertyNames.nextElement().toString(); - Object obj = fromMessage.getObjectProperty(name); - toMessage.setObjectProperty(name, obj); - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQOutputStream.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQOutputStream.class deleted file mode 100644 index 1090e9bef..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQOutputStream.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQOutputStream.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQOutputStream.java deleted file mode 100644 index 0427c9dfb..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQOutputStream.java +++ /dev/null @@ -1,221 +0,0 @@ -/** - * 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; - -import java.io.IOException; -import java.io.OutputStream; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import javax.jms.InvalidDestinationException; -import javax.jms.JMSException; - -import org.apache.activemq.command.ActiveMQBytesMessage; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ActiveMQMessage; -import org.apache.activemq.command.MessageId; -import org.apache.activemq.command.ProducerId; -import org.apache.activemq.command.ProducerInfo; -import org.apache.activemq.util.IOExceptionSupport; -import org.apache.activemq.util.IntrospectionSupport; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ActiveMQOutputStream extends OutputStream implements Disposable { - - private static final Logger LOG = LoggerFactory.getLogger(ActiveMQOutputStream.class); - - protected int count; - - final byte buffer[]; - - private final ActiveMQConnection connection; - private final Map properties; - private final ProducerInfo info; - - private long messageSequence; - private boolean closed; - private final int deliveryMode; - private final int priority; - private final long timeToLive; - private boolean alwaysSyncSend = false; - private boolean addPropertiesOnFirstMsgOnly = false; - - /** - * JMS Property which is used to specify the size (in kb) which is used as chunk size when splitting the stream. Default is 64kb - */ - public final static String AMQ_STREAM_CHUNK_SIZE = "AMQ_STREAM_CHUNK_SIZE"; - - public ActiveMQOutputStream(ActiveMQConnection connection, ProducerId producerId, ActiveMQDestination destination, Map properties, int deliveryMode, int priority, - long timeToLive) throws JMSException { - this.connection = connection; - this.deliveryMode = deliveryMode; - this.priority = priority; - this.timeToLive = timeToLive; - this.properties = properties == null ? null : new HashMap(properties); - - Integer chunkSize = this.properties == null ? null : (Integer) this.properties.get(AMQ_STREAM_CHUNK_SIZE); - if (chunkSize == null) { - chunkSize = 64 * 1024; - } else { - if (chunkSize < 1) { - throw new IllegalArgumentException("Chunk size must be greater then 0"); - } else { - chunkSize *= 1024; - } - } - - buffer = new byte[chunkSize]; - - if (destination == null) { - throw new InvalidDestinationException("Don't understand null destinations"); - } - - this.info = new ProducerInfo(producerId); - - // Allows the options on the destination to configure the stream - if (destination.getOptions() != null) { - Map options = new HashMap(destination.getOptions()); - IntrospectionSupport.setProperties(this, options, "producer."); - IntrospectionSupport.setProperties(this.info, options, "producer."); - if (options.size() > 0) { - String msg = "There are " + options.size() - + " producer options that couldn't be set on the producer." - + " Check the options are spelled correctly." - + " Unknown parameters=[" + options + "]." - + " This producer cannot be started."; - LOG.warn(msg); - throw new ConfigurationException(msg); - } - } - - this.info.setDestination(destination); - - this.connection.addOutputStream(this); - this.connection.asyncSendPacket(info); - } - - @Override - public void close() throws IOException { - if (!closed) { - flushBuffer(); - try { - // Send an EOS style empty message to signal EOS. - send(new ActiveMQMessage(), true); - dispose(); - this.connection.asyncSendPacket(info.createRemoveCommand()); - } catch (JMSException e) { - IOExceptionSupport.create(e); - } - } - } - - @Override - public void dispose() { - if (!closed) { - this.connection.removeOutputStream(this); - closed = true; - } - } - - @Override - public synchronized void write(int b) throws IOException { - buffer[count++] = (byte) b; - if (count == buffer.length) { - flushBuffer(); - } - } - - @Override - public synchronized void write(byte b[], int off, int len) throws IOException { - while (len > 0) { - int max = Math.min(len, buffer.length - count); - System.arraycopy(b, off, buffer, count, max); - - len -= max; - count += max; - off += max; - - if (count == buffer.length) { - flushBuffer(); - } - } - } - - @Override - public synchronized void flush() throws IOException { - flushBuffer(); - } - - private void flushBuffer() throws IOException { - if (count != 0) { - try { - ActiveMQBytesMessage msg = new ActiveMQBytesMessage(); - msg.writeBytes(buffer, 0, count); - send(msg, false); - } catch (JMSException e) { - throw IOExceptionSupport.create(e); - } - count = 0; - } - } - - /** - * @param msg - * @throws JMSException - */ - private void send(ActiveMQMessage msg, boolean eosMessage) throws JMSException { - if (properties != null && (messageSequence == 0 || !addPropertiesOnFirstMsgOnly)) { - for (Iterator iter = properties.keySet().iterator(); iter.hasNext();) { - String key = iter.next(); - Object value = properties.get(key); - msg.setObjectProperty(key, value); - } - } - msg.setType("org.apache.activemq.Stream"); - msg.setGroupID(info.getProducerId().toString()); - if (eosMessage) { - msg.setGroupSequence(-1); - } else { - msg.setGroupSequence((int) messageSequence); - } - MessageId id = new MessageId(info.getProducerId(), messageSequence++); - connection.send(info.getDestination(), msg, id, deliveryMode, priority, timeToLive, !eosMessage && !isAlwaysSyncSend()); - } - - @Override - public String toString() { - return "ActiveMQOutputStream { producerId=" + info.getProducerId() + " }"; - } - - public boolean isAlwaysSyncSend() { - return alwaysSyncSend; - } - - public void setAlwaysSyncSend(boolean alwaysSyncSend) { - this.alwaysSyncSend = alwaysSyncSend; - } - - public boolean isAddPropertiesOnFirstMsgOnly() { - return addPropertiesOnFirstMsgOnly; - } - - public void setAddPropertiesOnFirstMsgOnly(boolean propertiesOnFirstMsgOnly) { - this.addPropertiesOnFirstMsgOnly = propertiesOnFirstMsgOnly; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQPrefetchPolicy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQPrefetchPolicy.class deleted file mode 100644 index 11f5a4c92..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQPrefetchPolicy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQPrefetchPolicy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQPrefetchPolicy.java deleted file mode 100644 index 629941b37..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQPrefetchPolicy.java +++ /dev/null @@ -1,182 +0,0 @@ -/** - * 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; - -import java.io.Serializable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Defines the prefetch message policies for different types of consumers - * - * @org.apache.xbean.XBean element="prefetchPolicy" - * - */ -@SuppressWarnings("serial") -public class ActiveMQPrefetchPolicy extends Object implements Serializable { - public static final int MAX_PREFETCH_SIZE = Short.MAX_VALUE; - public static final int DEFAULT_QUEUE_PREFETCH = 1000; - public static final int DEFAULT_QUEUE_BROWSER_PREFETCH = 500; - public static final int DEFAULT_DURABLE_TOPIC_PREFETCH = 100; - public static final int DEFAULT_OPTIMIZE_DURABLE_TOPIC_PREFETCH=1000; - public static final int DEFAULT_INPUT_STREAM_PREFETCH=100; - public static final int DEFAULT_TOPIC_PREFETCH = MAX_PREFETCH_SIZE; - - private static final Logger LOG = LoggerFactory.getLogger(ActiveMQPrefetchPolicy.class); - - private int queuePrefetch; - private int queueBrowserPrefetch; - private int topicPrefetch; - private int durableTopicPrefetch; - private int optimizeDurableTopicPrefetch; - private int inputStreamPrefetch; - private int maximumPendingMessageLimit; - - /** - * Initialize default prefetch policies - */ - public ActiveMQPrefetchPolicy() { - this.queuePrefetch = DEFAULT_QUEUE_PREFETCH; - this.queueBrowserPrefetch = DEFAULT_QUEUE_BROWSER_PREFETCH; - this.topicPrefetch = DEFAULT_TOPIC_PREFETCH; - this.durableTopicPrefetch = DEFAULT_DURABLE_TOPIC_PREFETCH; - this.optimizeDurableTopicPrefetch = DEFAULT_OPTIMIZE_DURABLE_TOPIC_PREFETCH; - this.inputStreamPrefetch = DEFAULT_INPUT_STREAM_PREFETCH; - } - - /** - * @return Returns the durableTopicPrefetch. - */ - public int getDurableTopicPrefetch() { - return durableTopicPrefetch; - } - - /** - * @param durableTopicPrefetch The durableTopicPrefetch to set. - */ - public void setDurableTopicPrefetch(int durableTopicPrefetch) { - this.durableTopicPrefetch = getMaxPrefetchLimit(durableTopicPrefetch); - } - - /** - * @return Returns the queuePrefetch. - */ - public int getQueuePrefetch() { - return queuePrefetch; - } - - /** - * @param queuePrefetch The queuePrefetch to set. - */ - public void setQueuePrefetch(int queuePrefetch) { - this.queuePrefetch = getMaxPrefetchLimit(queuePrefetch); - } - - /** - * @return Returns the queueBrowserPrefetch. - */ - public int getQueueBrowserPrefetch() { - return queueBrowserPrefetch; - } - - /** - * @param queueBrowserPrefetch The queueBrowserPrefetch to set. - */ - public void setQueueBrowserPrefetch(int queueBrowserPrefetch) { - this.queueBrowserPrefetch = getMaxPrefetchLimit(queueBrowserPrefetch); - } - - /** - * @return Returns the topicPrefetch. - */ - public int getTopicPrefetch() { - return topicPrefetch; - } - - /** - * @param topicPrefetch The topicPrefetch to set. - */ - public void setTopicPrefetch(int topicPrefetch) { - this.topicPrefetch = getMaxPrefetchLimit(topicPrefetch); - } - - /** - * @return Returns the optimizeDurableTopicPrefetch. - */ - public int getOptimizeDurableTopicPrefetch() { - return optimizeDurableTopicPrefetch; - } - - /** - * @param optimizeAcknowledgePrefetch The optimizeDurableTopicPrefetch to - * set. - */ - public void setOptimizeDurableTopicPrefetch(int optimizeAcknowledgePrefetch) { - this.optimizeDurableTopicPrefetch = optimizeAcknowledgePrefetch; - } - - public int getMaximumPendingMessageLimit() { - return maximumPendingMessageLimit; - } - - /** - * Sets how many messages a broker will keep around, above the prefetch - * limit, for non-durable topics before starting to discard older messages. - */ - public void setMaximumPendingMessageLimit(int maximumPendingMessageLimit) { - this.maximumPendingMessageLimit = maximumPendingMessageLimit; - } - - private int getMaxPrefetchLimit(int value) { - int result = Math.min(value, MAX_PREFETCH_SIZE); - if (result < value) { - LOG.warn("maximum prefetch limit has been reset from " + value + " to " + MAX_PREFETCH_SIZE); - } - return result; - } - - public void setAll(int i) { - this.durableTopicPrefetch = i; - this.queueBrowserPrefetch = i; - this.queuePrefetch = i; - this.topicPrefetch = i; - this.inputStreamPrefetch = 1; - this.optimizeDurableTopicPrefetch = i; - } - - public int getInputStreamPrefetch() { - return inputStreamPrefetch; - } - - public void setInputStreamPrefetch(int inputStreamPrefetch) { - this.inputStreamPrefetch = getMaxPrefetchLimit(inputStreamPrefetch); - } - - public boolean equals(Object object){ - if (object instanceof ActiveMQPrefetchPolicy){ - ActiveMQPrefetchPolicy other = (ActiveMQPrefetchPolicy) object; - return this.queuePrefetch == other.queuePrefetch && - this.queueBrowserPrefetch == other.queueBrowserPrefetch && - this.topicPrefetch == other.topicPrefetch && - this.durableTopicPrefetch == other.durableTopicPrefetch && - this.optimizeDurableTopicPrefetch == other.optimizeDurableTopicPrefetch && - this.inputStreamPrefetch == other.inputStreamPrefetch; - } - return false; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQQueueBrowser$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQQueueBrowser$1.class deleted file mode 100644 index fd5f56e39..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQQueueBrowser$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQQueueBrowser.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQQueueBrowser.class deleted file mode 100644 index 4cde00cc0..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQQueueBrowser.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQQueueBrowser.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQQueueBrowser.java deleted file mode 100644 index f7c96a13f..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQQueueBrowser.java +++ /dev/null @@ -1,256 +0,0 @@ -/** - * 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; - -import java.util.Enumeration; -import java.util.concurrent.atomic.AtomicBoolean; - -import javax.jms.*; -import javax.jms.IllegalStateException; - -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ConsumerId; -import org.apache.activemq.command.MessageDispatch; -import org.apache.activemq.selector.SelectorParser; - -/** - * A client uses a QueueBrowser object to look at messages on a - * queue without removing them.

    - *

    - * The getEnumeration method returns a - * java.util.Enumeration - * that is used to scan the queue's messages. It may be an enumeration of the - * entire content of a queue, or it may contain only the messages matching a - * message selector.

    - *

    - * Messages may be arriving and expiring while the scan is done. The JMS API - * does not require the content of an enumeration to be a static snapshot of - * queue content. Whether these changes are visible or not depends on the JMS - * provider.

    - *

    - * A QueueBrowser can be created from either a Session - * - * or a QueueSession. - * - * @see javax.jms.Session#createBrowser - * @see javax.jms.QueueSession#createBrowser - * @see javax.jms.QueueBrowser - * @see javax.jms.QueueReceiver - */ - -public class ActiveMQQueueBrowser implements QueueBrowser, Enumeration { - - private final ActiveMQSession session; - private final ActiveMQDestination destination; - private final String selector; - - private ActiveMQMessageConsumer consumer; - private boolean closed; - private final ConsumerId consumerId; - private final AtomicBoolean browseDone = new AtomicBoolean(true); - private final boolean dispatchAsync; - private Object semaphore = new Object(); - - /** - * Constructor for an ActiveMQQueueBrowser - used internally - * @throws JMSException - */ - protected ActiveMQQueueBrowser(ActiveMQSession session, ConsumerId consumerId, ActiveMQDestination destination, String selector, boolean dispatchAsync) throws JMSException { - if (destination == null) { - throw new InvalidDestinationException("Don't understand null destinations"); - } else if (destination.getPhysicalName() == null) { - throw new InvalidDestinationException("The destination object was not given a physical name."); - } - if (selector != null && selector.trim().length() != 0) { - // Validate the selector - SelectorParser.parse(selector); - } - - this.session = session; - this.consumerId = consumerId; - this.destination = destination; - this.selector = selector; - this.dispatchAsync = dispatchAsync; - } - - /** - * @throws JMSException - */ - private ActiveMQMessageConsumer createConsumer() throws JMSException { - browseDone.set(false); - ActiveMQPrefetchPolicy prefetchPolicy = session.connection.getPrefetchPolicy(); - - return new ActiveMQMessageConsumer(session, consumerId, destination, null, selector, prefetchPolicy.getQueueBrowserPrefetch(), prefetchPolicy - .getMaximumPendingMessageLimit(), false, true, dispatchAsync, null) { - public void dispatch(MessageDispatch md) { - if (md.getMessage() == null) { - browseDone.set(true); - } else { - super.dispatch(md); - } - notifyMessageAvailable(); - } - }; - } - - private void destroyConsumer() { - if (consumer == null) { - return; - } - try { - if (session.getTransacted() && session.getTransactionContext().isInLocalTransaction()) { - session.commit(); - } - consumer.close(); - consumer = null; - } catch (JMSException e) { - e.printStackTrace(); - } - } - - /** - * Gets an enumeration for browsing the current queue messages in the order - * they would be received. - * - * @return an enumeration for browsing the messages - * @throws JMSException if the JMS provider fails to get the enumeration for - * this browser due to some internal error. - */ - - public Enumeration getEnumeration() throws JMSException { - checkClosed(); - if (consumer == null) { - consumer = createConsumer(); - } - return this; - } - - private void checkClosed() throws IllegalStateException { - if (closed) { - throw new IllegalStateException("The Consumer is closed"); - } - } - - /** - * @return true if more messages to process - */ - public boolean hasMoreElements() { - while (true) { - - synchronized (this) { - if (consumer == null) { - return false; - } - } - - if (consumer.getMessageSize() > 0) { - return true; - } - - if (browseDone.get() || !session.isRunning()) { - destroyConsumer(); - return false; - } - - waitForMessage(); - } - } - - /** - * @return the next message - */ - public Object nextElement() { - while (true) { - - synchronized (this) { - if (consumer == null) { - return null; - } - } - - try { - javax.jms.Message answer = consumer.receiveNoWait(); - if (answer != null) { - return answer; - } - } catch (JMSException e) { - this.session.connection.onClientInternalException(e); - return null; - } - - if (browseDone.get() || !session.isRunning()) { - destroyConsumer(); - return null; - } - - waitForMessage(); - } - } - - public synchronized void close() throws JMSException { - browseDone.set(true); - destroyConsumer(); - closed = true; - } - - /** - * Gets the queue associated with this queue browser. - * - * @return the queue - * @throws JMSException if the JMS provider fails to get the queue - * associated with this browser due to some internal error. - */ - - public Queue getQueue() throws JMSException { - return (Queue)destination; - } - - public String getMessageSelector() throws JMSException { - return selector; - } - - // Implementation methods - // ------------------------------------------------------------------------- - - /** - * Wait on a semaphore for a fixed amount of time for a message to come in. - * @throws JMSException - */ - protected void waitForMessage() { - try { - consumer.sendPullCommand(-1); - synchronized (semaphore) { - semaphore.wait(2000); - } - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } catch (JMSException e) { - } - - } - - protected void notifyMessageAvailable() { - synchronized (semaphore) { - semaphore.notifyAll(); - } - } - - public String toString() { - return "ActiveMQQueueBrowser { value=" + consumerId + " }"; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQQueueReceiver.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQQueueReceiver.class deleted file mode 100644 index 026e21497..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQQueueReceiver.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQQueueReceiver.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQQueueReceiver.java deleted file mode 100644 index bf6b950f3..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQQueueReceiver.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * 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; - -import javax.jms.JMSException; -import javax.jms.Queue; -import javax.jms.QueueReceiver; - -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ConsumerId; - -/** - * A client uses a QueueReceiver object to receive messages that - * have been delivered to a queue.

    - *

    - * Although it is possible to have multiple QueueReceiver s for - * the same queue, the JMS API does not define how messages are distributed - * between the QueueReceivers.

    - *

    - * If a QueueReceiver specifies a message selector, the messages - * that are not selected remain on the queue. By definition, a message selector - * allows a QueueReceiver to skip messages. This means that when - * the skipped messages are eventually read, the total ordering of the reads - * does not retain the partial order defined by each message producer. Only - * QueueReceiver s without a message selector will read messages - * in message producer order.

    - *

    - * Creating a MessageConsumer provides the same features as - * creating a QueueReceiver. A MessageConsumer - * object is recommended for creating new code. The QueueReceiver - * - * is provided to support existing code. - * - * @see javax.jms.Session#createConsumer(javax.jms.Destination, String) - * @see javax.jms.Session#createConsumer(javax.jms.Destination) - * @see javax.jms.QueueSession#createReceiver(Queue, String) - * @see javax.jms.QueueSession#createReceiver(Queue) - * @see javax.jms.MessageConsumer - */ - -public class ActiveMQQueueReceiver extends ActiveMQMessageConsumer implements QueueReceiver { - - /** - * @param theSession - * @param value - * @param destination - * @param messageSelector - * @param prefetch - * @param asyncDispatch - * @throws JMSException - */ - protected ActiveMQQueueReceiver(ActiveMQSession theSession, ConsumerId consumerId, - ActiveMQDestination destination, String selector, int prefetch, - int maximumPendingMessageCount, boolean asyncDispatch) - throws JMSException { - super(theSession, consumerId, destination, null, selector, prefetch, maximumPendingMessageCount, - false, false, asyncDispatch, null); - } - - /** - * Gets the Queue associated with this queue receiver. - * - * @return this receiver's Queue - * @throws JMSException if the JMS provider fails to get the queue for this - * queue receiver due to some internal error. - */ - - public Queue getQueue() throws JMSException { - checkClosed(); - return (Queue)super.getDestination(); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQQueueSender.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQQueueSender.class deleted file mode 100644 index 4f3835acc..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQQueueSender.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQQueueSender.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQQueueSender.java deleted file mode 100644 index 6451ab77c..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQQueueSender.java +++ /dev/null @@ -1,135 +0,0 @@ -/** - * 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; - -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.Queue; -import javax.jms.QueueSender; - -import org.apache.activemq.command.ActiveMQDestination; - -/** - * A client uses a QueueSender object to send messages to a - * queue.

    - *

    - * Normally, the Queue is specified when a QueueSender - * - * is created. In this case, an attempt to use the send methods - * for an unidentified QueueSender will throw a - * java.lang.UnsupportedOperationException. - *

    - *

    - * If the QueueSender is created with an unidentified - * Queue, - * an attempt to use the send methods that assume that the - * Queue has been identified will throw a - * java.lang.UnsupportedOperationException. - *

    - *

    - * During the execution of its send method, a message must not be - * changed by other threads within the client. If the message is modified, the - * result of the send is undefined.

    - *

    - * After sending a message, a client may retain and modify it without affecting - * the message that has been sent. The same message object may be sent multiple - * times.

    - *

    - * The following message headers are set as part of sending a message: - * JMSDestination, JMSDeliveryMode,JMSExpiration,JMSPriority, - * JMSMessageID and JMSTimeStamp. When the - * message is sent, the values of these headers are ignored. After the - * completion of the send, the headers hold the values specified - * by the method sending the message. It is possible for the send - * method not to set JMSMessageID and JMSTimeStamp - * if the setting of these headers is explicitly disabled by the - * MessageProducer.setDisableMessageID or - * MessageProducer.setDisableMessageTimestamp method.

    - *

    - * Creating a MessageProducer provides the same features as - * creating a QueueSender. A MessageProducer - * object is recommended when creating new code. The QueueSender - * is provided to support existing code. - * - * @see javax.jms.MessageProducer - * @see javax.jms.QueueSession#createSender(Queue) - */ - -public class ActiveMQQueueSender extends ActiveMQMessageProducer implements QueueSender { - - protected ActiveMQQueueSender(ActiveMQSession session, ActiveMQDestination destination,int sendTimeout) - throws JMSException { - super(session, session.getNextProducerId(), destination,sendTimeout); - } - - /** - * Gets the queue associated with this QueueSender. - * - * @return this sender's queue - * @throws JMSException if the JMS provider fails to get the queue for this - * QueueSender due to some internal error. - */ - - public Queue getQueue() throws JMSException { - return (Queue)super.getDestination(); - } - - /** - * Sends a message to a queue for an unidentified message producer. Uses the - * QueueSender's default delivery mode, priority, and time - * to live.

    - *

    - * Typically, a message producer is assigned a queue at creation time; - * however, the JMS API also supports unidentified message producers, which - * require that the queue be supplied every time a message is sent. - * - * @param queue the queue to send this message to - * @param message the message to send - * @throws JMSException if the JMS provider fails to send the message due to - * some internal error. - * @see javax.jms.MessageProducer#getDeliveryMode() - * @see javax.jms.MessageProducer#getTimeToLive() - * @see javax.jms.MessageProducer#getPriority() - */ - - public void send(Queue queue, Message message) throws JMSException { - super.send(queue, message); - } - - /** - * Sends a message to a queue for an unidentified message producer, - * specifying delivery mode, priority and time to live.

    - *

    - * Typically, a message producer is assigned a queue at creation time; - * however, the JMS API also supports unidentified message producers, which - * require that the queue be supplied every time a message is sent. - * - * @param queue the queue to send this message to - * @param message the message to send - * @param deliveryMode the delivery mode to use - * @param priority the priority for this message - * @param timeToLive the message's lifetime (in milliseconds) - * @throws JMSException if the JMS provider fails to send the message due to - * some internal error. - */ - - public void send(Queue queue, Message message, int deliveryMode, int priority, long timeToLive) - throws JMSException { - super.send(queue, message, deliveryMode, priority, timeToLive); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQQueueSession.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQQueueSession.class deleted file mode 100644 index dd7178003..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQQueueSession.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQQueueSession.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQQueueSession.java deleted file mode 100644 index 272d4cd48..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQQueueSession.java +++ /dev/null @@ -1,391 +0,0 @@ -/** - * 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; - -import java.io.Serializable; - -import javax.jms.BytesMessage; -import javax.jms.Destination; -import javax.jms.IllegalStateException; -import javax.jms.InvalidDestinationException; -import javax.jms.JMSException; -import javax.jms.MapMessage; -import javax.jms.Message; -import javax.jms.MessageConsumer; -import javax.jms.MessageListener; -import javax.jms.MessageProducer; -import javax.jms.ObjectMessage; -import javax.jms.Queue; -import javax.jms.QueueBrowser; -import javax.jms.QueueReceiver; -import javax.jms.QueueSender; -import javax.jms.QueueSession; -import javax.jms.StreamMessage; -import javax.jms.TemporaryQueue; -import javax.jms.TemporaryTopic; -import javax.jms.TextMessage; -import javax.jms.Topic; -import javax.jms.TopicSubscriber; - -/** - * A QueueSession implementation that throws IllegalStateExceptions when Topic - * operations are attempted but which delegates to another QueueSession for all - * other operations. The ActiveMQSessions implement both Topic and Queue - * Sessions methods but the spec states that Queue session should throw - * Exceptions if topic operations are attempted on it. - * - * - */ -public class ActiveMQQueueSession implements QueueSession { - - private final QueueSession next; - - public ActiveMQQueueSession(QueueSession next) { - this.next = next; - } - - /** - * @throws JMSException - */ - public void close() throws JMSException { - next.close(); - } - - /** - * @throws JMSException - */ - public void commit() throws JMSException { - next.commit(); - } - - /** - * @param queue - * @return - * @throws JMSException - */ - public QueueBrowser createBrowser(Queue queue) throws JMSException { - return next.createBrowser(queue); - } - - /** - * @param queue - * @param messageSelector - * @return - * @throws JMSException - */ - public QueueBrowser createBrowser(Queue queue, String messageSelector) throws JMSException { - return next.createBrowser(queue, messageSelector); - } - - /** - * @return - * @throws JMSException - */ - public BytesMessage createBytesMessage() throws JMSException { - return next.createBytesMessage(); - } - - /** - * @param destination - * @return - * @throws JMSException - */ - public MessageConsumer createConsumer(Destination destination) throws JMSException { - if (destination instanceof Topic) { - throw new InvalidDestinationException("Topics are not supported by a QueueSession"); - } - return next.createConsumer(destination); - } - - /** - * @param destination - * @param messageSelector - * @return - * @throws JMSException - */ - public MessageConsumer createConsumer(Destination destination, String messageSelector) throws JMSException { - if (destination instanceof Topic) { - throw new InvalidDestinationException("Topics are not supported by a QueueSession"); - } - return next.createConsumer(destination, messageSelector); - } - - /** - * @param destination - * @param messageSelector - * @param noLocal - * @return - * @throws JMSException - */ - public MessageConsumer createConsumer(Destination destination, String messageSelector, boolean noLocal) throws JMSException { - if (destination instanceof Topic) { - throw new InvalidDestinationException("Topics are not supported by a QueueSession"); - } - return next.createConsumer(destination, messageSelector, noLocal); - } - - /** - * @param topic - * @param name - * @return - * @throws JMSException - */ - public TopicSubscriber createDurableSubscriber(Topic topic, String name) throws JMSException { - throw new IllegalStateException("Operation not supported by a QueueSession"); - } - - /** - * @param topic - * @param name - * @param messageSelector - * @param noLocal - * @return - * @throws JMSException - */ - public TopicSubscriber createDurableSubscriber(Topic topic, String name, String messageSelector, boolean noLocal) throws JMSException { - throw new IllegalStateException("Operation not supported by a QueueSession"); - } - - /** - * @return - * @throws JMSException - */ - public MapMessage createMapMessage() throws JMSException { - return next.createMapMessage(); - } - - /** - * @return - * @throws JMSException - */ - public Message createMessage() throws JMSException { - return next.createMessage(); - } - - /** - * @return - * @throws JMSException - */ - public ObjectMessage createObjectMessage() throws JMSException { - return next.createObjectMessage(); - } - - /** - * @param object - * @return - * @throws JMSException - */ - public ObjectMessage createObjectMessage(Serializable object) throws JMSException { - return next.createObjectMessage(object); - } - - /** - * @param destination - * @return - * @throws JMSException - */ - public MessageProducer createProducer(Destination destination) throws JMSException { - if (destination instanceof Topic) { - throw new InvalidDestinationException("Topics are not supported by a QueueSession"); - } - return next.createProducer(destination); - } - - /** - * @param queueName - * @return - * @throws JMSException - */ - public Queue createQueue(String queueName) throws JMSException { - return next.createQueue(queueName); - } - - /** - * @param queue - * @return - * @throws JMSException - */ - public QueueReceiver createReceiver(Queue queue) throws JMSException { - return next.createReceiver(queue); - } - - /** - * @param queue - * @param messageSelector - * @return - * @throws JMSException - */ - public QueueReceiver createReceiver(Queue queue, String messageSelector) throws JMSException { - return next.createReceiver(queue, messageSelector); - } - - /** - * @param queue - * @return - * @throws JMSException - */ - public QueueSender createSender(Queue queue) throws JMSException { - return next.createSender(queue); - } - - /** - * @return - * @throws JMSException - */ - public StreamMessage createStreamMessage() throws JMSException { - return next.createStreamMessage(); - } - - /** - * @return - * @throws JMSException - */ - public TemporaryQueue createTemporaryQueue() throws JMSException { - return next.createTemporaryQueue(); - } - - /** - * @return - * @throws JMSException - */ - public TemporaryTopic createTemporaryTopic() throws JMSException { - throw new IllegalStateException("Operation not supported by a QueueSession"); - } - - /** - * @return - * @throws JMSException - */ - public TextMessage createTextMessage() throws JMSException { - return next.createTextMessage(); - } - - /** - * @param text - * @return - * @throws JMSException - */ - public TextMessage createTextMessage(String text) throws JMSException { - return next.createTextMessage(text); - } - - /** - * @param topicName - * @return - * @throws JMSException - */ - public Topic createTopic(String topicName) throws JMSException { - throw new IllegalStateException("Operation not supported by a QueueSession"); - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals(Object arg0) { - if(this != arg0) { - return next.equals(arg0); - } - - return true; - } - - /** - * @return - * @throws JMSException - */ - public int getAcknowledgeMode() throws JMSException { - return next.getAcknowledgeMode(); - } - - /** - * @return - * @throws JMSException - */ - public MessageListener getMessageListener() throws JMSException { - return next.getMessageListener(); - } - - /** - * @return - * @throws JMSException - */ - public boolean getTransacted() throws JMSException { - return next.getTransacted(); - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - return next.hashCode(); - } - - /** - * @throws JMSException - */ - public void recover() throws JMSException { - next.recover(); - } - - /** - * @throws JMSException - */ - public void rollback() throws JMSException { - next.rollback(); - } - - /** - * - */ - public void run() { - next.run(); - } - - /** - * @param listener - * @throws JMSException - */ - public void setMessageListener(MessageListener listener) throws JMSException { - next.setMessageListener(listener); - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ - public String toString() { - return next.toString(); - } - - /** - * @param name - * @throws JMSException - */ - public void unsubscribe(String name) throws JMSException { - throw new IllegalStateException("Operation not supported by a QueueSession"); - } - - public QueueSession getNext() { - return next; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQSession$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQSession$1.class deleted file mode 100644 index fbbe7bd0f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQSession$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQSession$2.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQSession$2.class deleted file mode 100644 index e524c9177..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQSession$2.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQSession$3.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQSession$3.class deleted file mode 100644 index ecf48600e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQSession$3.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQSession$4$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQSession$4$1.class deleted file mode 100644 index c1c96b521..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQSession$4$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQSession$4.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQSession$4.class deleted file mode 100644 index 96b942965..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQSession$4.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQSession$DeliveryListener.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQSession$DeliveryListener.class deleted file mode 100644 index 11140868a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQSession$DeliveryListener.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQSession.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQSession.class deleted file mode 100644 index ee18e646f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQSession.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQSession.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQSession.java deleted file mode 100644 index 0a9613458..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQSession.java +++ /dev/null @@ -1,2093 +0,0 @@ -/** - * 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; - -import java.io.File; -import java.io.InputStream; -import java.io.Serializable; -import java.net.URL; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.concurrent.CopyOnWriteArrayList; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicInteger; - -import javax.jms.BytesMessage; -import javax.jms.Destination; -import javax.jms.IllegalStateException; -import javax.jms.InvalidDestinationException; -import javax.jms.InvalidSelectorException; -import javax.jms.JMSException; -import javax.jms.MapMessage; -import javax.jms.Message; -import javax.jms.MessageConsumer; -import javax.jms.MessageListener; -import javax.jms.MessageProducer; -import javax.jms.ObjectMessage; -import javax.jms.Queue; -import javax.jms.QueueBrowser; -import javax.jms.QueueReceiver; -import javax.jms.QueueSender; -import javax.jms.QueueSession; -import javax.jms.Session; -import javax.jms.StreamMessage; -import javax.jms.TemporaryQueue; -import javax.jms.TemporaryTopic; -import javax.jms.TextMessage; -import javax.jms.Topic; -import javax.jms.TopicPublisher; -import javax.jms.TopicSession; -import javax.jms.TopicSubscriber; -import javax.jms.TransactionRolledBackException; - -import org.apache.activemq.blob.BlobDownloader; -import org.apache.activemq.blob.BlobTransferPolicy; -import org.apache.activemq.blob.BlobUploader; -import org.apache.activemq.command.ActiveMQBlobMessage; -import org.apache.activemq.command.ActiveMQBytesMessage; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ActiveMQMapMessage; -import org.apache.activemq.command.ActiveMQMessage; -import org.apache.activemq.command.ActiveMQObjectMessage; -import org.apache.activemq.command.ActiveMQQueue; -import org.apache.activemq.command.ActiveMQStreamMessage; -import org.apache.activemq.command.ActiveMQTempDestination; -import org.apache.activemq.command.ActiveMQTempQueue; -import org.apache.activemq.command.ActiveMQTempTopic; -import org.apache.activemq.command.ActiveMQTextMessage; -import org.apache.activemq.command.ActiveMQTopic; -import org.apache.activemq.command.Command; -import org.apache.activemq.command.ConsumerId; -import org.apache.activemq.command.MessageAck; -import org.apache.activemq.command.MessageDispatch; -import org.apache.activemq.command.MessageId; -import org.apache.activemq.command.ProducerId; -import org.apache.activemq.command.RemoveInfo; -import org.apache.activemq.command.Response; -import org.apache.activemq.command.SessionId; -import org.apache.activemq.command.SessionInfo; -import org.apache.activemq.command.TransactionId; -import org.apache.activemq.management.JMSSessionStatsImpl; -import org.apache.activemq.management.StatsCapable; -import org.apache.activemq.management.StatsImpl; -import org.apache.activemq.thread.Scheduler; -import org.apache.activemq.transaction.Synchronization; -import org.apache.activemq.usage.MemoryUsage; -import org.apache.activemq.util.Callback; -import org.apache.activemq.util.JMSExceptionSupport; -import org.apache.activemq.util.LongSequenceGenerator; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - *

    - * A Session object is a single-threaded context for producing - * and consuming messages. Although it may allocate provider resources outside - * the Java virtual machine (JVM), it is considered a lightweight JMS object. - *

    - * A session serves several purposes: - *

      - *
    • It is a factory for its message producers and consumers. - *
    • It supplies provider-optimized message factories. - *
    • It is a factory for TemporaryTopics and - * TemporaryQueues. - *
    • It provides a way to create Queue or Topic - * objects for those clients that need to dynamically manipulate - * provider-specific destination names. - *
    • It supports a single series of transactions that combine work spanning - * its producers and consumers into atomic units. - *
    • It defines a serial order for the messages it consumes and the messages - * it produces. - *
    • It retains messages it consumes until they have been acknowledged. - *
    • It serializes execution of message listeners registered with its message - * consumers. - *
    • It is a factory for QueueBrowsers. - *
    - *

    - * A session can create and service multiple message producers and consumers. - *

    - * One typical use is to have a thread block on a synchronous - * MessageConsumer until a message arrives. The thread may then - * use one or more of the Session'sMessageProducers. - *

    - * If a client desires to have one thread produce messages while others consume - * them, the client should use a separate session for its producing thread. - *

    - * Once a connection has been started, any session with one or more registered - * message listeners is dedicated to the thread of control that delivers - * messages to it. It is erroneous for client code to use this session or any of - * its constituent objects from another thread of control. The only exception to - * this rule is the use of the session or connection close - * method. - *

    - * It should be easy for most clients to partition their work naturally into - * sessions. This model allows clients to start simply and incrementally add - * message processing complexity as their need for concurrency grows. - *

    - * The close method is the only session method that can be called - * while some other session method is being executed in another thread. - *

    - * A session may be specified as transacted. Each transacted session supports a - * single series of transactions. Each transaction groups a set of message sends - * and a set of message receives into an atomic unit of work. In effect, - * transactions organize a session's input message stream and output message - * stream into series of atomic units. When a transaction commits, its atomic - * unit of input is acknowledged and its associated atomic unit of output is - * sent. If a transaction rollback is done, the transaction's sent messages are - * destroyed and the session's input is automatically recovered. - *

    - * The content of a transaction's input and output units is simply those - * messages that have been produced and consumed within the session's current - * transaction. - *

    - * A transaction is completed using either its session's commit - * method or its session's rollback method. The completion of a - * session's current transaction automatically begins the next. The result is - * that a transacted session always has a current transaction within which its - * work is done. - *

    - * The Java Transaction Service (JTS) or some other transaction monitor may be - * used to combine a session's transaction with transactions on other resources - * (databases, other JMS sessions, etc.). Since Java distributed transactions - * are controlled via the Java Transaction API (JTA), use of the session's - * commit and rollback methods in this context is - * prohibited. - *

    - * The JMS API does not require support for JTA; however, it does define how a - * provider supplies this support. - *

    - * Although it is also possible for a JMS client to handle distributed - * transactions directly, it is unlikely that many JMS clients will do this. - * Support for JTA in the JMS API is targeted at systems vendors who will be - * integrating the JMS API into their application server products. - * - * - * @see javax.jms.Session - * @see javax.jms.QueueSession - * @see javax.jms.TopicSession - * @see javax.jms.XASession - */ -public class ActiveMQSession implements Session, QueueSession, TopicSession, StatsCapable, ActiveMQDispatcher { - - /** - * Only acknowledge an individual message - using message.acknowledge() - * as opposed to CLIENT_ACKNOWLEDGE which - * acknowledges all messages consumed by a session at when acknowledge() - * is called - */ - public static final int INDIVIDUAL_ACKNOWLEDGE = 4; - public static final int MAX_ACK_CONSTANT = INDIVIDUAL_ACKNOWLEDGE; - - public static interface DeliveryListener { - void beforeDelivery(ActiveMQSession session, Message msg); - - void afterDelivery(ActiveMQSession session, Message msg); - } - - private static final Logger LOG = LoggerFactory.getLogger(ActiveMQSession.class); - private final ThreadPoolExecutor connectionExecutor; - - protected int acknowledgementMode; - protected final ActiveMQConnection connection; - protected final SessionInfo info; - protected final LongSequenceGenerator consumerIdGenerator = new LongSequenceGenerator(); - protected final LongSequenceGenerator producerIdGenerator = new LongSequenceGenerator(); - protected final LongSequenceGenerator deliveryIdGenerator = new LongSequenceGenerator(); - protected final ActiveMQSessionExecutor executor; - protected final AtomicBoolean started = new AtomicBoolean(false); - - protected final CopyOnWriteArrayList consumers = new CopyOnWriteArrayList(); - protected final CopyOnWriteArrayList producers = new CopyOnWriteArrayList(); - - protected boolean closed; - private volatile boolean synchronizationRegistered; - protected boolean asyncDispatch; - protected boolean sessionAsyncDispatch; - protected final boolean debug; - protected Object sendMutex = new Object(); - - private MessageListener messageListener; - private final JMSSessionStatsImpl stats; - private TransactionContext transactionContext; - private DeliveryListener deliveryListener; - private MessageTransformer transformer; - private BlobTransferPolicy blobTransferPolicy; - private long lastDeliveredSequenceId; - - /** - * Construct the Session - * - * @param connection - * @param sessionId - * @param acknowledgeMode n.b if transacted - the acknowledgeMode == - * Session.SESSION_TRANSACTED - * @param asyncDispatch - * @param sessionAsyncDispatch - * @throws JMSException on internal error - */ - protected ActiveMQSession(ActiveMQConnection connection, SessionId sessionId, int acknowledgeMode, boolean asyncDispatch, boolean sessionAsyncDispatch) throws JMSException { - this.debug = LOG.isDebugEnabled(); - this.connection = connection; - this.acknowledgementMode = acknowledgeMode; - this.asyncDispatch = asyncDispatch; - this.sessionAsyncDispatch = sessionAsyncDispatch; - this.info = new SessionInfo(connection.getConnectionInfo(), sessionId.getValue()); - setTransactionContext(new TransactionContext(connection)); - stats = new JMSSessionStatsImpl(producers, consumers); - this.connection.asyncSendPacket(info); - setTransformer(connection.getTransformer()); - setBlobTransferPolicy(connection.getBlobTransferPolicy()); - this.connectionExecutor=connection.getExecutor(); - this.executor = new ActiveMQSessionExecutor(this); - connection.addSession(this); - if (connection.isStarted()) { - start(); - } - - } - - protected ActiveMQSession(ActiveMQConnection connection, SessionId sessionId, int acknowledgeMode, boolean asyncDispatch) throws JMSException { - this(connection, sessionId, acknowledgeMode, asyncDispatch, true); - } - - /** - * Sets the transaction context of the session. - * - * @param transactionContext - provides the means to control a JMS - * transaction. - */ - public void setTransactionContext(TransactionContext transactionContext) { - this.transactionContext = transactionContext; - } - - /** - * Returns the transaction context of the session. - * - * @return transactionContext - session's transaction context. - */ - public TransactionContext getTransactionContext() { - return transactionContext; - } - - /* - * (non-Javadoc) - * - * @see org.apache.activemq.management.StatsCapable#getStats() - */ - public StatsImpl getStats() { - return stats; - } - - /** - * Returns the session's statistics. - * - * @return stats - session's statistics. - */ - public JMSSessionStatsImpl getSessionStats() { - return stats; - } - - /** - * Creates a BytesMessage object. A BytesMessage - * object is used to send a message containing a stream of uninterpreted - * bytes. - * - * @return the an ActiveMQBytesMessage - * @throws JMSException if the JMS provider fails to create this message due - * to some internal error. - */ - public BytesMessage createBytesMessage() throws JMSException { - ActiveMQBytesMessage message = new ActiveMQBytesMessage(); - configureMessage(message); - return message; - } - - /** - * Creates a MapMessage object. A MapMessage - * object is used to send a self-defining set of name-value pairs, where - * names are String objects and values are primitive values - * in the Java programming language. - * - * @return an ActiveMQMapMessage - * @throws JMSException if the JMS provider fails to create this message due - * to some internal error. - */ - public MapMessage createMapMessage() throws JMSException { - ActiveMQMapMessage message = new ActiveMQMapMessage(); - configureMessage(message); - return message; - } - - /** - * Creates a Message object. The Message - * interface is the root interface of all JMS messages. A - * Message object holds all the standard message header - * information. It can be sent when a message containing only header - * information is sufficient. - * - * @return an ActiveMQMessage - * @throws JMSException if the JMS provider fails to create this message due - * to some internal error. - */ - public Message createMessage() throws JMSException { - ActiveMQMessage message = new ActiveMQMessage(); - configureMessage(message); - return message; - } - - /** - * Creates an ObjectMessage object. An - * ObjectMessage object is used to send a message that - * contains a serializable Java object. - * - * @return an ActiveMQObjectMessage - * @throws JMSException if the JMS provider fails to create this message due - * to some internal error. - */ - public ObjectMessage createObjectMessage() throws JMSException { - ActiveMQObjectMessage message = new ActiveMQObjectMessage(); - configureMessage(message); - return message; - } - - /** - * Creates an initialized ObjectMessage object. An - * ObjectMessage object is used to send a message that - * contains a serializable Java object. - * - * @param object the object to use to initialize this message - * @return an ActiveMQObjectMessage - * @throws JMSException if the JMS provider fails to create this message due - * to some internal error. - */ - public ObjectMessage createObjectMessage(Serializable object) throws JMSException { - ActiveMQObjectMessage message = new ActiveMQObjectMessage(); - configureMessage(message); - message.setObject(object); - return message; - } - - /** - * Creates a StreamMessage object. A - * StreamMessage object is used to send a self-defining - * stream of primitive values in the Java programming language. - * - * @return an ActiveMQStreamMessage - * @throws JMSException if the JMS provider fails to create this message due - * to some internal error. - */ - public StreamMessage createStreamMessage() throws JMSException { - ActiveMQStreamMessage message = new ActiveMQStreamMessage(); - configureMessage(message); - return message; - } - - /** - * Creates a TextMessage object. A TextMessage - * object is used to send a message containing a String - * object. - * - * @return an ActiveMQTextMessage - * @throws JMSException if the JMS provider fails to create this message due - * to some internal error. - */ - public TextMessage createTextMessage() throws JMSException { - ActiveMQTextMessage message = new ActiveMQTextMessage(); - configureMessage(message); - return message; - } - - /** - * Creates an initialized TextMessage object. A - * TextMessage object is used to send a message containing a - * String. - * - * @param text the string used to initialize this message - * @return an ActiveMQTextMessage - * @throws JMSException if the JMS provider fails to create this message due - * to some internal error. - */ - public TextMessage createTextMessage(String text) throws JMSException { - ActiveMQTextMessage message = new ActiveMQTextMessage(); - message.setText(text); - configureMessage(message); - return message; - } - - /** - * Creates an initialized BlobMessage object. A - * BlobMessage object is used to send a message containing a - * URL which points to some network addressible BLOB. - * - * @param url the network addressable URL used to pass directly to the - * consumer - * @return a BlobMessage - * @throws JMSException if the JMS provider fails to create this message due - * to some internal error. - */ - public BlobMessage createBlobMessage(URL url) throws JMSException { - return createBlobMessage(url, false); - } - - /** - * Creates an initialized BlobMessage object. A - * BlobMessage object is used to send a message containing a - * URL which points to some network addressible BLOB. - * - * @param url the network addressable URL used to pass directly to the - * consumer - * @param deletedByBroker indicates whether or not the resource is deleted - * by the broker when the message is acknowledged - * @return a BlobMessage - * @throws JMSException if the JMS provider fails to create this message due - * to some internal error. - */ - public BlobMessage createBlobMessage(URL url, boolean deletedByBroker) throws JMSException { - ActiveMQBlobMessage message = new ActiveMQBlobMessage(); - configureMessage(message); - message.setURL(url); - message.setDeletedByBroker(deletedByBroker); - message.setBlobDownloader(new BlobDownloader(getBlobTransferPolicy())); - return message; - } - - /** - * Creates an initialized BlobMessage object. A - * BlobMessage object is used to send a message containing - * the File content. Before the message is sent the file - * conent will be uploaded to the broker or some other remote repository - * depending on the {@link #getBlobTransferPolicy()}. - * - * @param file the file to be uploaded to some remote repo (or the broker) - * depending on the strategy - * @return a BlobMessage - * @throws JMSException if the JMS provider fails to create this message due - * to some internal error. - */ - public BlobMessage createBlobMessage(File file) throws JMSException { - ActiveMQBlobMessage message = new ActiveMQBlobMessage(); - configureMessage(message); - message.setBlobUploader(new BlobUploader(getBlobTransferPolicy(), file)); - message.setBlobDownloader(new BlobDownloader((getBlobTransferPolicy()))); - message.setDeletedByBroker(true); - message.setName(file.getName()); - return message; - } - - /** - * Creates an initialized BlobMessage object. A - * BlobMessage object is used to send a message containing - * the File content. Before the message is sent the file - * conent will be uploaded to the broker or some other remote repository - * depending on the {@link #getBlobTransferPolicy()}. - * - * @param in the stream to be uploaded to some remote repo (or the broker) - * depending on the strategy - * @return a BlobMessage - * @throws JMSException if the JMS provider fails to create this message due - * to some internal error. - */ - public BlobMessage createBlobMessage(InputStream in) throws JMSException { - ActiveMQBlobMessage message = new ActiveMQBlobMessage(); - configureMessage(message); - message.setBlobUploader(new BlobUploader(getBlobTransferPolicy(), in)); - message.setBlobDownloader(new BlobDownloader(getBlobTransferPolicy())); - message.setDeletedByBroker(true); - return message; - } - - /** - * Indicates whether the session is in transacted mode. - * - * @return true if the session is in transacted mode - * @throws JMSException if there is some internal error. - */ - public boolean getTransacted() throws JMSException { - checkClosed(); - return isTransacted(); - } - - /** - * Returns the acknowledgement mode of the session. The acknowledgement mode - * is set at the time that the session is created. If the session is - * transacted, the acknowledgement mode is ignored. - * - * @return If the session is not transacted, returns the current - * acknowledgement mode for the session. If the session is - * transacted, returns SESSION_TRANSACTED. - * @throws JMSException - * @see javax.jms.Connection#createSession(boolean,int) - * @since 1.1 exception JMSException if there is some internal error. - */ - public int getAcknowledgeMode() throws JMSException { - checkClosed(); - return this.acknowledgementMode; - } - - /** - * Commits all messages done in this transaction and releases any locks - * currently held. - * - * @throws JMSException if the JMS provider fails to commit the transaction - * due to some internal error. - * @throws TransactionRolledBackException if the transaction is rolled back - * due to some internal error during commit. - * @throws javax.jms.IllegalStateException if the method is not called by a - * transacted session. - */ - public void commit() throws JMSException { - checkClosed(); - if (!getTransacted()) { - throw new javax.jms.IllegalStateException("Not a transacted session"); - } - if (LOG.isDebugEnabled()) { - LOG.debug(getSessionId() + " Transaction Commit :" + transactionContext.getTransactionId()); - } - transactionContext.commit(); - } - - /** - * Rolls back any messages done in this transaction and releases any locks - * currently held. - * - * @throws JMSException if the JMS provider fails to roll back the - * transaction due to some internal error. - * @throws javax.jms.IllegalStateException if the method is not called by a - * transacted session. - */ - public void rollback() throws JMSException { - checkClosed(); - if (!getTransacted()) { - throw new javax.jms.IllegalStateException("Not a transacted session"); - } - if (LOG.isDebugEnabled()) { - LOG.debug(getSessionId() + " Transaction Rollback, txid:" + transactionContext.getTransactionId()); - } - transactionContext.rollback(); - } - - /** - * Closes the session. - *

    - * Since a provider may allocate some resources on behalf of a session - * outside the JVM, clients should close the resources when they are not - * needed. Relying on garbage collection to eventually reclaim these - * resources may not be timely enough. - *

    - * There is no need to close the producers and consumers of a closed - * session. - *

    - * This call will block until a receive call or message - * listener in progress has completed. A blocked message consumer - * receive call returns null when this session - * is closed. - *

    - * Closing a transacted session must roll back the transaction in progress. - *

    - * This method is the only Session method that can be called - * concurrently. - *

    - * Invoking any other Session method on a closed session must - * throw a JMSException.IllegalStateException. Closing a - * closed session must not throw an exception. - * - * @throws JMSException if the JMS provider fails to close the session due - * to some internal error. - */ - public void close() throws JMSException { - if (!closed) { - if (getTransactionContext().isInXATransaction()) { - if (!synchronizationRegistered) { - synchronizationRegistered = true; - getTransactionContext().addSynchronization(new Synchronization() { - - @Override - public void afterCommit() throws Exception { - doClose(); - synchronizationRegistered = false; - } - - @Override - public void afterRollback() throws Exception { - doClose(); - synchronizationRegistered = false; - } - }); - } - - } else { - doClose(); - } - } - } - - private void doClose() throws JMSException { - boolean interrupted = Thread.interrupted(); - dispose(); - RemoveInfo removeCommand = info.createRemoveCommand(); - removeCommand.setLastDeliveredSequenceId(lastDeliveredSequenceId); - connection.asyncSendPacket(removeCommand); - if (interrupted) { - Thread.currentThread().interrupt(); - } - } - - void clearMessagesInProgress(AtomicInteger transportInterruptionProcessingComplete) { - executor.clearMessagesInProgress(); - // we are called from inside the transport reconnection logic - // which involves us clearing all the connections' consumers - // dispatch and delivered lists. So rather than trying to - // grab a mutex (which could be already owned by the message - // listener calling the send or an ack) we allow it to complete in - // a separate thread via the scheduler and notify us via - // connection.transportInterruptionProcessingComplete() - // - for (final ActiveMQMessageConsumer consumer : consumers) { - consumer.inProgressClearRequired(); - transportInterruptionProcessingComplete.incrementAndGet(); - try { - connection.getScheduler().executeAfterDelay(new Runnable() { - public void run() { - consumer.clearMessagesInProgress(); - }}, 0l); - } catch (JMSException e) { - connection.onClientInternalException(e); - } - } - } - - void deliverAcks() { - for (Iterator iter = consumers.iterator(); iter.hasNext();) { - ActiveMQMessageConsumer consumer = iter.next(); - consumer.deliverAcks(); - } - } - - public synchronized void dispose() throws JMSException { - if (!closed) { - - try { - executor.stop(); - - for (Iterator iter = consumers.iterator(); iter.hasNext();) { - ActiveMQMessageConsumer consumer = iter.next(); - consumer.setFailureError(connection.getFirstFailureError()); - consumer.dispose(); - lastDeliveredSequenceId = Math.max(lastDeliveredSequenceId, consumer.getLastDeliveredSequenceId()); - } - consumers.clear(); - - for (Iterator iter = producers.iterator(); iter.hasNext();) { - ActiveMQMessageProducer producer = iter.next(); - producer.dispose(); - } - producers.clear(); - - try { - if (getTransactionContext().isInLocalTransaction()) { - rollback(); - } - } catch (JMSException e) { - } - - } finally { - connection.removeSession(this); - this.transactionContext = null; - closed = true; - } - } - } - - /** - * Checks that the session is not closed then configures the message - */ - protected void configureMessage(ActiveMQMessage message) throws IllegalStateException { - checkClosed(); - message.setConnection(connection); - } - - /** - * Check if the session is closed. It is used for ensuring that the session - * is open before performing various operations. - * - * @throws IllegalStateException if the Session is closed - */ - protected void checkClosed() throws IllegalStateException { - if (closed) { - throw new IllegalStateException("The Session is closed"); - } - } - - /** - * Checks if the session is closed. - * - * @return true if the session is closed, false otherwise. - */ - public boolean isClosed() { - return closed; - } - - /** - * Stops message delivery in this session, and restarts message delivery - * with the oldest unacknowledged message. - *

    - * All consumers deliver messages in a serial order. Acknowledging a - * received message automatically acknowledges all messages that have been - * delivered to the client. - *

    - * Restarting a session causes it to take the following actions: - *

      - *
    • Stop message delivery - *
    • Mark all messages that might have been delivered but not - * acknowledged as "redelivered" - *
    • Restart the delivery sequence including all unacknowledged messages - * that had been previously delivered. Redelivered messages do not have to - * be delivered in exactly their original delivery order. - *
    - * - * @throws JMSException if the JMS provider fails to stop and restart - * message delivery due to some internal error. - * @throws IllegalStateException if the method is called by a transacted - * session. - */ - public void recover() throws JMSException { - - checkClosed(); - if (getTransacted()) { - throw new IllegalStateException("This session is transacted"); - } - - for (Iterator iter = consumers.iterator(); iter.hasNext();) { - ActiveMQMessageConsumer c = iter.next(); - c.rollback(); - } - - } - - /** - * Returns the session's distinguished message listener (optional). - * - * @return the message listener associated with this session - * @throws JMSException if the JMS provider fails to get the message - * listener due to an internal error. - * @see javax.jms.Session#setMessageListener(javax.jms.MessageListener) - * @see javax.jms.ServerSessionPool - * @see javax.jms.ServerSession - */ - public MessageListener getMessageListener() throws JMSException { - checkClosed(); - return this.messageListener; - } - - /** - * Sets the session's distinguished message listener (optional). - *

    - * When the distinguished message listener is set, no other form of message - * receipt in the session can be used; however, all forms of sending - * messages are still supported. - *

    - * If this session has been closed, then an {@link IllegalStateException} is - * thrown, if trying to set a new listener. However setting the listener - * to null is allowed, to clear the listener, even if this session - * has been closed prior. - *

    - * This is an expert facility not used by regular JMS clients. - * - * @param listener the message listener to associate with this session - * @throws JMSException if the JMS provider fails to set the message - * listener due to an internal error. - * @see javax.jms.Session#getMessageListener() - * @see javax.jms.ServerSessionPool - * @see javax.jms.ServerSession - */ - public void setMessageListener(MessageListener listener) throws JMSException { - // only check for closed if we set a new listener, as we allow to clear - // the listener, such as when an application is shutting down, and is - // no longer using a message listener on this session - if (listener != null) { - checkClosed(); - } - this.messageListener = listener; - - if (listener != null) { - executor.setDispatchedBySessionPool(true); - } - } - - /** - * Optional operation, intended to be used only by Application Servers, not - * by ordinary JMS clients. - * - * @see javax.jms.ServerSession - */ - public void run() { - MessageDispatch messageDispatch; - while ((messageDispatch = executor.dequeueNoWait()) != null) { - final MessageDispatch md = messageDispatch; - ActiveMQMessage message = (ActiveMQMessage)md.getMessage(); - if (message.isExpired() || connection.isDuplicate(ActiveMQSession.this, message)) { - // TODO: Ack it without delivery to client - continue; - } - - if (isClientAcknowledge()||isIndividualAcknowledge()) { - message.setAcknowledgeCallback(new Callback() { - public void execute() throws Exception { - } - }); - } - - if (deliveryListener != null) { - deliveryListener.beforeDelivery(this, message); - } - - md.setDeliverySequenceId(getNextDeliveryId()); - - final MessageAck ack = new MessageAck(md, MessageAck.STANDARD_ACK_TYPE, 1); - try { - ack.setFirstMessageId(md.getMessage().getMessageId()); - doStartTransaction(); - ack.setTransactionId(getTransactionContext().getTransactionId()); - if (ack.getTransactionId() != null) { - getTransactionContext().addSynchronization(new Synchronization() { - - @Override - public void beforeEnd() throws Exception { - asyncSendPacket(ack); - } - - @Override - public void afterRollback() throws Exception { - md.getMessage().onMessageRolledBack(); - // ensure we don't filter this as a duplicate - connection.rollbackDuplicate(ActiveMQSession.this, md.getMessage()); - RedeliveryPolicy redeliveryPolicy = connection.getRedeliveryPolicy(); - int redeliveryCounter = md.getMessage().getRedeliveryCounter(); - if (redeliveryPolicy.getMaximumRedeliveries() != RedeliveryPolicy.NO_MAXIMUM_REDELIVERIES - && redeliveryCounter > redeliveryPolicy.getMaximumRedeliveries()) { - // We need to NACK the messages so that they get - // sent to the - // DLQ. - // Acknowledge the last message. - MessageAck ack = new MessageAck(md, MessageAck.POSION_ACK_TYPE, 1); - ack.setFirstMessageId(md.getMessage().getMessageId()); - ack.setPoisonCause(new Throwable("Exceeded ra redelivery policy limit:" + redeliveryPolicy)); - asyncSendPacket(ack); - - } else { - - MessageAck ack = new MessageAck(md, MessageAck.REDELIVERED_ACK_TYPE, 1); - ack.setFirstMessageId(md.getMessage().getMessageId()); - asyncSendPacket(ack); - - // Figure out how long we should wait to resend - // this message. - long redeliveryDelay = redeliveryPolicy.getInitialRedeliveryDelay(); - for (int i = 0; i < redeliveryCounter; i++) { - redeliveryDelay = redeliveryPolicy.getNextRedeliveryDelay(redeliveryDelay); - } - connection.getScheduler().executeAfterDelay(new Runnable() { - - public void run() { - ((ActiveMQDispatcher)md.getConsumer()).dispatch(md); - } - }, redeliveryDelay); - } - } - }); - } - - messageListener.onMessage(message); - - } catch (Throwable e) { - LOG.error("error dispatching message: ", e); - // A problem while invoking the MessageListener does not - // in general indicate a problem with the connection to the broker, i.e. - // it will usually be sufficient to let the afterDelivery() method either - // commit or roll back in order to deal with the exception. - // However, we notify any registered client internal exception listener - // of the problem. - connection.onClientInternalException(e); - } finally { - if (ack.getTransactionId() == null) { - try { - asyncSendPacket(ack); - } catch (Throwable e) { - connection.onClientInternalException(e); - } - } - } - - if (deliveryListener != null) { - deliveryListener.afterDelivery(this, message); - } - } - } - - /** - * Creates a MessageProducer to send messages to the - * specified destination. - *

    - * A client uses a MessageProducer object to send messages to - * a destination. Since Queue and Topic both - * inherit from Destination, they can be used in the - * destination parameter to create a MessageProducer object. - * - * @param destination the Destination to send to, or null if - * this is a producer which does not have a specified - * destination. - * @return the MessageProducer - * @throws JMSException if the session fails to create a MessageProducer due - * to some internal error. - * @throws InvalidDestinationException if an invalid destination is - * specified. - * @since 1.1 - */ - public MessageProducer createProducer(Destination destination) throws JMSException { - checkClosed(); - if (destination instanceof CustomDestination) { - CustomDestination customDestination = (CustomDestination)destination; - return customDestination.createProducer(this); - } - int timeSendOut = connection.getSendTimeout(); - return new ActiveMQMessageProducer(this, getNextProducerId(), ActiveMQMessageTransformation.transformDestination(destination),timeSendOut); - } - - /** - * Creates a MessageConsumer for the specified destination. - * Since Queue and Topic both inherit from - * Destination, they can be used in the destination - * parameter to create a MessageConsumer. - * - * @param destination the Destination to access. - * @return the MessageConsumer - * @throws JMSException if the session fails to create a consumer due to - * some internal error. - * @throws InvalidDestinationException if an invalid destination is - * specified. - * @since 1.1 - */ - public MessageConsumer createConsumer(Destination destination) throws JMSException { - return createConsumer(destination, (String) null); - } - - /** - * Creates a MessageConsumer for the specified destination, - * using a message selector. Since Queue and - * Topic both inherit from Destination, they - * can be used in the destination parameter to create a - * MessageConsumer. - *

    - * A client uses a MessageConsumer object to receive messages - * that have been sent to a destination. - * - * @param destination the Destination to access - * @param messageSelector only messages with properties matching the message - * selector expression are delivered. A value of null or an - * empty string indicates that there is no message selector - * for the message consumer. - * @return the MessageConsumer - * @throws JMSException if the session fails to create a MessageConsumer due - * to some internal error. - * @throws InvalidDestinationException if an invalid destination is - * specified. - * @throws InvalidSelectorException if the message selector is invalid. - * @since 1.1 - */ - public MessageConsumer createConsumer(Destination destination, String messageSelector) throws JMSException { - return createConsumer(destination, messageSelector, false); - } - - /** - * Creates a MessageConsumer for the specified destination. - * Since Queue and Topic both inherit from - * Destination, they can be used in the destination - * parameter to create a MessageConsumer. - * - * @param destination the Destination to access. - * @param messageListener the listener to use for async consumption of messages - * @return the MessageConsumer - * @throws JMSException if the session fails to create a consumer due to - * some internal error. - * @throws InvalidDestinationException if an invalid destination is - * specified. - * @since 1.1 - */ - public MessageConsumer createConsumer(Destination destination, MessageListener messageListener) throws JMSException { - return createConsumer(destination, null, messageListener); - } - - /** - * Creates a MessageConsumer for the specified destination, - * using a message selector. Since Queue and - * Topic both inherit from Destination, they - * can be used in the destination parameter to create a - * MessageConsumer. - *

    - * A client uses a MessageConsumer object to receive messages - * that have been sent to a destination. - * - * @param destination the Destination to access - * @param messageSelector only messages with properties matching the message - * selector expression are delivered. A value of null or an - * empty string indicates that there is no message selector - * for the message consumer. - * @param messageListener the listener to use for async consumption of messages - * @return the MessageConsumer - * @throws JMSException if the session fails to create a MessageConsumer due - * to some internal error. - * @throws InvalidDestinationException if an invalid destination is - * specified. - * @throws InvalidSelectorException if the message selector is invalid. - * @since 1.1 - */ - public MessageConsumer createConsumer(Destination destination, String messageSelector, MessageListener messageListener) throws JMSException { - return createConsumer(destination, messageSelector, false, messageListener); - } - - /** - * Creates MessageConsumer for the specified destination, - * using a message selector. This method can specify whether messages - * published by its own connection should be delivered to it, if the - * destination is a topic. - *

    - * Since Queue and Topic both inherit from - * Destination, they can be used in the destination - * parameter to create a MessageConsumer. - *

    - * A client uses a MessageConsumer object to receive messages - * that have been published to a destination. - *

    - * In some cases, a connection may both publish and subscribe to a topic. - * The consumer NoLocal attribute allows a consumer to - * inhibit the delivery of messages published by its own connection. The - * default value for this attribute is False. The noLocal - * value must be supported by destinations that are topics. - * - * @param destination the Destination to access - * @param messageSelector only messages with properties matching the message - * selector expression are delivered. A value of null or an - * empty string indicates that there is no message selector - * for the message consumer. - * @param noLocal - if true, and the destination is a topic, inhibits the - * delivery of messages published by its own connection. The - * behavior for NoLocal is not specified if - * the destination is a queue. - * @return the MessageConsumer - * @throws JMSException if the session fails to create a MessageConsumer due - * to some internal error. - * @throws InvalidDestinationException if an invalid destination is - * specified. - * @throws InvalidSelectorException if the message selector is invalid. - * @since 1.1 - */ - public MessageConsumer createConsumer(Destination destination, String messageSelector, boolean noLocal) throws JMSException { - return createConsumer(destination, messageSelector, noLocal, null); - } - - /** - * Creates MessageConsumer for the specified destination, - * using a message selector. This method can specify whether messages - * published by its own connection should be delivered to it, if the - * destination is a topic. - *

    - * Since Queue and Topic both inherit from - * Destination, they can be used in the destination - * parameter to create a MessageConsumer. - *

    - * A client uses a MessageConsumer object to receive messages - * that have been published to a destination. - *

    - * In some cases, a connection may both publish and subscribe to a topic. - * The consumer NoLocal attribute allows a consumer to - * inhibit the delivery of messages published by its own connection. The - * default value for this attribute is False. The noLocal - * value must be supported by destinations that are topics. - * - * @param destination the Destination to access - * @param messageSelector only messages with properties matching the message - * selector expression are delivered. A value of null or an - * empty string indicates that there is no message selector - * for the message consumer. - * @param noLocal - if true, and the destination is a topic, inhibits the - * delivery of messages published by its own connection. The - * behavior for NoLocal is not specified if - * the destination is a queue. - * @param messageListener the listener to use for async consumption of messages - * @return the MessageConsumer - * @throws JMSException if the session fails to create a MessageConsumer due - * to some internal error. - * @throws InvalidDestinationException if an invalid destination is - * specified. - * @throws InvalidSelectorException if the message selector is invalid. - * @since 1.1 - */ - public MessageConsumer createConsumer(Destination destination, String messageSelector, boolean noLocal, MessageListener messageListener) throws JMSException { - checkClosed(); - - if (destination instanceof CustomDestination) { - CustomDestination customDestination = (CustomDestination)destination; - return customDestination.createConsumer(this, messageSelector, noLocal); - } - - ActiveMQPrefetchPolicy prefetchPolicy = connection.getPrefetchPolicy(); - int prefetch = 0; - if (destination instanceof Topic) { - prefetch = prefetchPolicy.getTopicPrefetch(); - } else { - prefetch = prefetchPolicy.getQueuePrefetch(); - } - ActiveMQDestination activemqDestination = ActiveMQMessageTransformation.transformDestination(destination); - return new ActiveMQMessageConsumer(this, getNextConsumerId(), activemqDestination, null, messageSelector, - prefetch, prefetchPolicy.getMaximumPendingMessageLimit(), noLocal, false, isAsyncDispatch(), messageListener); - } - - /** - * Creates a queue identity given a Queue name. - *

    - * This facility is provided for the rare cases where clients need to - * dynamically manipulate queue identity. It allows the creation of a queue - * identity with a provider-specific name. Clients that depend on this - * ability are not portable. - *

    - * Note that this method is not for creating the physical queue. The - * physical creation of queues is an administrative task and is not to be - * initiated by the JMS API. The one exception is the creation of temporary - * queues, which is accomplished with the createTemporaryQueue - * method. - * - * @param queueName the name of this Queue - * @return a Queue with the given name - * @throws JMSException if the session fails to create a queue due to some - * internal error. - * @since 1.1 - */ - public Queue createQueue(String queueName) throws JMSException { - checkClosed(); - if (queueName.startsWith(ActiveMQDestination.TEMP_DESTINATION_NAME_PREFIX)) { - return new ActiveMQTempQueue(queueName); - } - return new ActiveMQQueue(queueName); - } - - /** - * Creates a topic identity given a Topic name. - *

    - * This facility is provided for the rare cases where clients need to - * dynamically manipulate topic identity. This allows the creation of a - * topic identity with a provider-specific name. Clients that depend on this - * ability are not portable. - *

    - * Note that this method is not for creating the physical topic. The - * physical creation of topics is an administrative task and is not to be - * initiated by the JMS API. The one exception is the creation of temporary - * topics, which is accomplished with the createTemporaryTopic - * method. - * - * @param topicName the name of this Topic - * @return a Topic with the given name - * @throws JMSException if the session fails to create a topic due to some - * internal error. - * @since 1.1 - */ - public Topic createTopic(String topicName) throws JMSException { - checkClosed(); - if (topicName.startsWith(ActiveMQDestination.TEMP_DESTINATION_NAME_PREFIX)) { - return new ActiveMQTempTopic(topicName); - } - return new ActiveMQTopic(topicName); - } - - /** - * Creates a QueueBrowser object to peek at the messages on - * the specified queue. - * - * @param queue the queue to access - * @exception InvalidDestinationException if an invalid destination is - * specified - * @since 1.1 - */ - /** - * Creates a durable subscriber to the specified topic. - *

    - * If a client needs to receive all the messages published on a topic, - * including the ones published while the subscriber is inactive, it uses a - * durable TopicSubscriber. The JMS provider retains a - * record of this durable subscription and insures that all messages from - * the topic's publishers are retained until they are acknowledged by this - * durable subscriber or they have expired. - *

    - * Sessions with durable subscribers must always provide the same client - * identifier. In addition, each client must specify a name that uniquely - * identifies (within client identifier) each durable subscription it - * creates. Only one session at a time can have a - * TopicSubscriber for a particular durable subscription. - *

    - * A client can change an existing durable subscription by creating a - * durable TopicSubscriber with the same name and a new topic - * and/or message selector. Changing a durable subscriber is equivalent to - * unsubscribing (deleting) the old one and creating a new one. - *

    - * In some cases, a connection may both publish and subscribe to a topic. - * The subscriber NoLocal attribute allows a subscriber to - * inhibit the delivery of messages published by its own connection. The - * default value for this attribute is false. - * - * @param topic the non-temporary Topic to subscribe to - * @param name the name used to identify this subscription - * @return the TopicSubscriber - * @throws JMSException if the session fails to create a subscriber due to - * some internal error. - * @throws InvalidDestinationException if an invalid topic is specified. - * @since 1.1 - */ - public TopicSubscriber createDurableSubscriber(Topic topic, String name) throws JMSException { - checkClosed(); - return createDurableSubscriber(topic, name, null, false); - } - - /** - * Creates a durable subscriber to the specified topic, using a message - * selector and specifying whether messages published by its own connection - * should be delivered to it. - *

    - * If a client needs to receive all the messages published on a topic, - * including the ones published while the subscriber is inactive, it uses a - * durable TopicSubscriber. The JMS provider retains a - * record of this durable subscription and insures that all messages from - * the topic's publishers are retained until they are acknowledged by this - * durable subscriber or they have expired. - *

    - * Sessions with durable subscribers must always provide the same client - * identifier. In addition, each client must specify a name which uniquely - * identifies (within client identifier) each durable subscription it - * creates. Only one session at a time can have a - * TopicSubscriber for a particular durable subscription. An - * inactive durable subscriber is one that exists but does not currently - * have a message consumer associated with it. - *

    - * A client can change an existing durable subscription by creating a - * durable TopicSubscriber with the same name and a new topic - * and/or message selector. Changing a durable subscriber is equivalent to - * unsubscribing (deleting) the old one and creating a new one. - * - * @param topic the non-temporary Topic to subscribe to - * @param name the name used to identify this subscription - * @param messageSelector only messages with properties matching the message - * selector expression are delivered. A value of null or an - * empty string indicates that there is no message selector - * for the message consumer. - * @param noLocal if set, inhibits the delivery of messages published by its - * own connection - * @return the Queue Browser - * @throws JMSException if the session fails to create a subscriber due to - * some internal error. - * @throws InvalidDestinationException if an invalid topic is specified. - * @throws InvalidSelectorException if the message selector is invalid. - * @since 1.1 - */ - public TopicSubscriber createDurableSubscriber(Topic topic, String name, String messageSelector, boolean noLocal) throws JMSException { - checkClosed(); - - if (topic == null) { - throw new InvalidDestinationException("Topic cannot be null"); - } - - if (isIndividualAcknowledge()) { - throw JMSExceptionSupport.create("Cannot create a durable consumer for a Session in "+ - "INDIVIDUAL_ACKNOWLEDGE mode.", null); - } - - if (topic instanceof CustomDestination) { - CustomDestination customDestination = (CustomDestination)topic; - return customDestination.createDurableSubscriber(this, name, messageSelector, noLocal); - } - - connection.checkClientIDWasManuallySpecified(); - ActiveMQPrefetchPolicy prefetchPolicy = this.connection.getPrefetchPolicy(); - int prefetch = isAutoAcknowledge() && connection.isOptimizedMessageDispatch() ? prefetchPolicy.getOptimizeDurableTopicPrefetch() : prefetchPolicy.getDurableTopicPrefetch(); - int maxPrendingLimit = prefetchPolicy.getMaximumPendingMessageLimit(); - return new ActiveMQTopicSubscriber(this, getNextConsumerId(), ActiveMQMessageTransformation.transformDestination(topic), name, messageSelector, prefetch, maxPrendingLimit, - noLocal, false, asyncDispatch); - } - - /** - * Creates a QueueBrowser object to peek at the messages on - * the specified queue. - * - * @param queue the queue to access - * @return the Queue Browser - * @throws JMSException if the session fails to create a browser due to some - * internal error. - * @throws InvalidDestinationException if an invalid destination is - * specified - * @since 1.1 - */ - public QueueBrowser createBrowser(Queue queue) throws JMSException { - checkClosed(); - return createBrowser(queue, null); - } - - /** - * Creates a QueueBrowser object to peek at the messages on - * the specified queue using a message selector. - * - * @param queue the queue to access - * @param messageSelector only messages with properties matching the message - * selector expression are delivered. A value of null or an - * empty string indicates that there is no message selector - * for the message consumer. - * @return the Queue Browser - * @throws JMSException if the session fails to create a browser due to some - * internal error. - * @throws InvalidDestinationException if an invalid destination is - * specified - * @throws InvalidSelectorException if the message selector is invalid. - * @since 1.1 - */ - public QueueBrowser createBrowser(Queue queue, String messageSelector) throws JMSException { - checkClosed(); - return new ActiveMQQueueBrowser(this, getNextConsumerId(), ActiveMQMessageTransformation.transformDestination(queue), messageSelector, asyncDispatch); - } - - /** - * Creates a TemporaryQueue object. Its lifetime will be that - * of the Connection unless it is deleted earlier. - * - * @return a temporary queue identity - * @throws JMSException if the session fails to create a temporary queue due - * to some internal error. - * @since 1.1 - */ - public TemporaryQueue createTemporaryQueue() throws JMSException { - checkClosed(); - return (TemporaryQueue)connection.createTempDestination(false); - } - - /** - * Creates a TemporaryTopic object. Its lifetime will be that - * of the Connection unless it is deleted earlier. - * - * @return a temporary topic identity - * @throws JMSException if the session fails to create a temporary topic due - * to some internal error. - * @since 1.1 - */ - public TemporaryTopic createTemporaryTopic() throws JMSException { - checkClosed(); - return (TemporaryTopic)connection.createTempDestination(true); - } - - /** - * Creates a QueueReceiver object to receive messages from - * the specified queue. - * - * @param queue the Queue to access - * @return - * @throws JMSException if the session fails to create a receiver due to - * some internal error. - * @throws JMSException - * @throws InvalidDestinationException if an invalid queue is specified. - */ - public QueueReceiver createReceiver(Queue queue) throws JMSException { - checkClosed(); - return createReceiver(queue, null); - } - - /** - * Creates a QueueReceiver object to receive messages from - * the specified queue using a message selector. - * - * @param queue the Queue to access - * @param messageSelector only messages with properties matching the message - * selector expression are delivered. A value of null or an - * empty string indicates that there is no message selector - * for the message consumer. - * @return QueueReceiver - * @throws JMSException if the session fails to create a receiver due to - * some internal error. - * @throws InvalidDestinationException if an invalid queue is specified. - * @throws InvalidSelectorException if the message selector is invalid. - */ - public QueueReceiver createReceiver(Queue queue, String messageSelector) throws JMSException { - checkClosed(); - - if (queue instanceof CustomDestination) { - CustomDestination customDestination = (CustomDestination)queue; - return customDestination.createReceiver(this, messageSelector); - } - - ActiveMQPrefetchPolicy prefetchPolicy = this.connection.getPrefetchPolicy(); - return new ActiveMQQueueReceiver(this, getNextConsumerId(), ActiveMQMessageTransformation.transformDestination(queue), messageSelector, prefetchPolicy.getQueuePrefetch(), - prefetchPolicy.getMaximumPendingMessageLimit(), asyncDispatch); - } - - /** - * Creates a QueueSender object to send messages to the - * specified queue. - * - * @param queue the Queue to access, or null if this is an - * unidentified producer - * @return QueueSender - * @throws JMSException if the session fails to create a sender due to some - * internal error. - * @throws InvalidDestinationException if an invalid queue is specified. - */ - public QueueSender createSender(Queue queue) throws JMSException { - checkClosed(); - if (queue instanceof CustomDestination) { - CustomDestination customDestination = (CustomDestination)queue; - return customDestination.createSender(this); - } - int timeSendOut = connection.getSendTimeout(); - return new ActiveMQQueueSender(this, ActiveMQMessageTransformation.transformDestination(queue),timeSendOut); - } - - /** - * Creates a nondurable subscriber to the specified topic.

    - *

    - * A client uses a TopicSubscriber object to receive messages - * that have been published to a topic.

    - *

    - * Regular TopicSubscriber objects are not durable. They - * receive only messages that are published while they are active.

    - *

    - * In some cases, a connection may both publish and subscribe to a topic. - * The subscriber NoLocal attribute allows a subscriber to - * inhibit the delivery of messages published by its own connection. The - * default value for this attribute is false. - * - * @param topic the Topic to subscribe to - * @return TopicSubscriber - * @throws JMSException if the session fails to create a subscriber due to - * some internal error. - * @throws InvalidDestinationException if an invalid topic is specified. - */ - public TopicSubscriber createSubscriber(Topic topic) throws JMSException { - checkClosed(); - return createSubscriber(topic, null, false); - } - - /** - * Creates a nondurable subscriber to the specified topic, using a message - * selector or specifying whether messages published by its own connection - * should be delivered to it.

    - *

    - * A client uses a TopicSubscriber object to receive messages - * that have been published to a topic.

    - *

    - * Regular TopicSubscriber objects are not durable. They - * receive only messages that are published while they are active.

    - *

    - * Messages filtered out by a subscriber's message selector will never be - * delivered to the subscriber. From the subscriber's perspective, they do - * not exist.

    - *

    - * In some cases, a connection may both publish and subscribe to a topic. - * The subscriber NoLocal attribute allows a subscriber to - * inhibit the delivery of messages published by its own connection. The - * default value for this attribute is false. - * - * @param topic the Topic to subscribe to - * @param messageSelector only messages with properties matching the message - * selector expression are delivered. A value of null or an - * empty string indicates that there is no message selector - * for the message consumer. - * @param noLocal if set, inhibits the delivery of messages published by its - * own connection - * @return TopicSubscriber - * @throws JMSException if the session fails to create a subscriber due to - * some internal error. - * @throws InvalidDestinationException if an invalid topic is specified. - * @throws InvalidSelectorException if the message selector is invalid. - */ - public TopicSubscriber createSubscriber(Topic topic, String messageSelector, boolean noLocal) throws JMSException { - checkClosed(); - - if (topic instanceof CustomDestination) { - CustomDestination customDestination = (CustomDestination)topic; - return customDestination.createSubscriber(this, messageSelector, noLocal); - } - - ActiveMQPrefetchPolicy prefetchPolicy = this.connection.getPrefetchPolicy(); - return new ActiveMQTopicSubscriber(this, getNextConsumerId(), ActiveMQMessageTransformation.transformDestination(topic), null, messageSelector, prefetchPolicy - .getTopicPrefetch(), prefetchPolicy.getMaximumPendingMessageLimit(), noLocal, false, asyncDispatch); - } - - /** - * Creates a publisher for the specified topic.

    - *

    - * A client uses a TopicPublisher object to publish messages - * on a topic. Each time a client creates a TopicPublisher on - * a topic, it defines a new sequence of messages that have no ordering - * relationship with the messages it has previously sent. - * - * @param topic the Topic to publish to, or null if this is - * an unidentified producer - * @return TopicPublisher - * @throws JMSException if the session fails to create a publisher due to - * some internal error. - * @throws InvalidDestinationException if an invalid topic is specified. - */ - public TopicPublisher createPublisher(Topic topic) throws JMSException { - checkClosed(); - - if (topic instanceof CustomDestination) { - CustomDestination customDestination = (CustomDestination)topic; - return customDestination.createPublisher(this); - } - int timeSendOut = connection.getSendTimeout(); - return new ActiveMQTopicPublisher(this, ActiveMQMessageTransformation.transformDestination(topic),timeSendOut); - } - - /** - * Unsubscribes a durable subscription that has been created by a client. - *

    - * This method deletes the state being maintained on behalf of the - * subscriber by its provider. - *

    - * It is erroneous for a client to delete a durable subscription while there - * is an active MessageConsumer or - * TopicSubscriber for the subscription, or while a consumed - * message is part of a pending transaction or has not been acknowledged in - * the session. - * - * @param name the name used to identify this subscription - * @throws JMSException if the session fails to unsubscribe to the durable - * subscription due to some internal error. - * @throws InvalidDestinationException if an invalid subscription name is - * specified. - * @since 1.1 - */ - public void unsubscribe(String name) throws JMSException { - checkClosed(); - connection.unsubscribe(name); - } - - public void dispatch(MessageDispatch messageDispatch) { - try { - executor.execute(messageDispatch); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - connection.onClientInternalException(e); - } - } - - /** - * Acknowledges all consumed messages of the session of this consumed - * message. - *

    - * All consumed JMS messages support the acknowledge method - * for use when a client has specified that its JMS session's consumed - * messages are to be explicitly acknowledged. By invoking - * acknowledge on a consumed message, a client acknowledges - * all messages consumed by the session that the message was delivered to. - *

    - * Calls to acknowledge are ignored for both transacted - * sessions and sessions specified to use implicit acknowledgement modes. - *

    - * A client may individually acknowledge each message as it is consumed, or - * it may choose to acknowledge messages as an application-defined group - * (which is done by calling acknowledge on the last received message of the - * group, thereby acknowledging all messages consumed by the session.) - *

    - * Messages that have been received but not acknowledged may be redelivered. - * - * @throws JMSException if the JMS provider fails to acknowledge the - * messages due to some internal error. - * @throws javax.jms.IllegalStateException if this method is called on a - * closed session. - * @see javax.jms.Session#CLIENT_ACKNOWLEDGE - */ - public void acknowledge() throws JMSException { - for (Iterator iter = consumers.iterator(); iter.hasNext();) { - ActiveMQMessageConsumer c = iter.next(); - c.acknowledge(); - } - } - - /** - * Add a message consumer. - * - * @param consumer - message consumer. - * @throws JMSException - */ - protected void addConsumer(ActiveMQMessageConsumer consumer) throws JMSException { - this.consumers.add(consumer); - if (consumer.isDurableSubscriber()) { - stats.onCreateDurableSubscriber(); - } - this.connection.addDispatcher(consumer.getConsumerId(), this); - } - - /** - * Remove the message consumer. - * - * @param consumer - consumer to be removed. - * @throws JMSException - */ - protected void removeConsumer(ActiveMQMessageConsumer consumer) { - this.connection.removeDispatcher(consumer.getConsumerId()); - if (consumer.isDurableSubscriber()) { - stats.onRemoveDurableSubscriber(); - } - this.consumers.remove(consumer); - this.connection.removeDispatcher(consumer); - } - - /** - * Adds a message producer. - * - * @param producer - message producer to be added. - * @throws JMSException - */ - protected void addProducer(ActiveMQMessageProducer producer) throws JMSException { - this.producers.add(producer); - this.connection.addProducer(producer.getProducerInfo().getProducerId(), producer); - } - - /** - * Removes a message producer. - * - * @param producer - message producer to be removed. - * @throws JMSException - */ - protected void removeProducer(ActiveMQMessageProducer producer) { - this.connection.removeProducer(producer.getProducerInfo().getProducerId()); - this.producers.remove(producer); - } - - /** - * Start this Session. - * - * @throws JMSException - */ - protected void start() throws JMSException { - started.set(true); - for (Iterator iter = consumers.iterator(); iter.hasNext();) { - ActiveMQMessageConsumer c = iter.next(); - c.start(); - } - executor.start(); - } - - /** - * Stops this session. - * - * @throws JMSException - */ - protected void stop() throws JMSException { - - for (Iterator iter = consumers.iterator(); iter.hasNext();) { - ActiveMQMessageConsumer c = iter.next(); - c.stop(); - } - - started.set(false); - executor.stop(); - } - - /** - * Returns the session id. - * - * @return value - session id. - */ - protected SessionId getSessionId() { - return info.getSessionId(); - } - - /** - * @return - */ - protected ConsumerId getNextConsumerId() { - return new ConsumerId(info.getSessionId(), consumerIdGenerator.getNextSequenceId()); - } - - /** - * @return - */ - protected ProducerId getNextProducerId() { - return new ProducerId(info.getSessionId(), producerIdGenerator.getNextSequenceId()); - } - - /** - * Sends the message for dispatch by the broker. - * - * - * @param producer - message producer. - * @param destination - message destination. - * @param message - message to be sent. - * @param deliveryMode - JMS messsage delivery mode. - * @param priority - message priority. - * @param timeToLive - message expiration. - * @param producerWindow - * @param onComplete - * @throws JMSException - */ - protected void send(ActiveMQMessageProducer producer, ActiveMQDestination destination, Message message, int deliveryMode, int priority, long timeToLive, - MemoryUsage producerWindow, int sendTimeout, AsyncCallback onComplete) throws JMSException { - - checkClosed(); - if (destination.isTemporary() && connection.isDeleted(destination)) { - throw new InvalidDestinationException("Cannot publish to a deleted Destination: " + destination); - } - synchronized (sendMutex) { - // tell the Broker we are about to start a new transaction - doStartTransaction(); - TransactionId txid = transactionContext.getTransactionId(); - long sequenceNumber = producer.getMessageSequence(); - - //Set the "JMS" header fields on the original message, see 1.1 spec section 3.4.11 - message.setJMSDeliveryMode(deliveryMode); - long expiration = 0L; - if (!producer.getDisableMessageTimestamp()) { - long timeStamp = System.currentTimeMillis(); - message.setJMSTimestamp(timeStamp); - if (timeToLive > 0) { - expiration = timeToLive + timeStamp; - } - } - message.setJMSExpiration(expiration); - message.setJMSPriority(priority); - message.setJMSRedelivered(false); - - // transform to our own message format here - ActiveMQMessage msg = ActiveMQMessageTransformation.transformMessage(message, connection); - msg.setDestination(destination); - msg.setMessageId(new MessageId(producer.getProducerInfo().getProducerId(), sequenceNumber)); - - // Set the message id. - if (msg != message) { - message.setJMSMessageID(msg.getMessageId().toString()); - // Make sure the JMS destination is set on the foreign messages too. - message.setJMSDestination(destination); - } - //clear the brokerPath in case we are re-sending this message - msg.setBrokerPath(null); - - msg.setTransactionId(txid); - if (connection.isCopyMessageOnSend()) { - msg = (ActiveMQMessage)msg.copy(); - } - msg.setConnection(connection); - msg.onSend(); - msg.setProducerId(msg.getMessageId().getProducerId()); - if (LOG.isTraceEnabled()) { - LOG.trace(getSessionId() + " sending message: " + msg); - } - if (onComplete==null && sendTimeout <= 0 && !msg.isResponseRequired() && !connection.isAlwaysSyncSend() && (!msg.isPersistent() || connection.isUseAsyncSend() || txid != null)) { - this.connection.asyncSendPacket(msg); - if (producerWindow != null) { - // Since we defer lots of the marshaling till we hit the - // wire, this might not - // provide and accurate size. We may change over to doing - // more aggressive marshaling, - // to get more accurate sizes.. this is more important once - // users start using producer window - // flow control. - int size = msg.getSize(); - producerWindow.increaseUsage(size); - } - } else { - if (sendTimeout > 0 && onComplete==null) { - this.connection.syncSendPacket(msg,sendTimeout); - }else { - this.connection.syncSendPacket(msg, onComplete); - } - } - - } - } - - /** - * Send TransactionInfo to indicate transaction has started - * - * @throws JMSException if some internal error occurs - */ - protected void doStartTransaction() throws JMSException { - if (getTransacted() && !transactionContext.isInXATransaction()) { - transactionContext.begin(); - } - } - - /** - * Checks whether the session has unconsumed messages. - * - * @return true - if there are unconsumed messages. - */ - public boolean hasUncomsumedMessages() { - return executor.hasUncomsumedMessages(); - } - - /** - * Checks whether the session uses transactions. - * - * @return true - if the session uses transactions. - */ - public boolean isTransacted() { - return this.acknowledgementMode == Session.SESSION_TRANSACTED || (transactionContext.isInXATransaction()); - } - - /** - * Checks whether the session used client acknowledgment. - * - * @return true - if the session uses client acknowledgment. - */ - protected boolean isClientAcknowledge() { - return this.acknowledgementMode == Session.CLIENT_ACKNOWLEDGE; - } - - /** - * Checks whether the session used auto acknowledgment. - * - * @return true - if the session uses client acknowledgment. - */ - public boolean isAutoAcknowledge() { - return acknowledgementMode == Session.AUTO_ACKNOWLEDGE; - } - - /** - * Checks whether the session used dup ok acknowledgment. - * - * @return true - if the session uses client acknowledgment. - */ - public boolean isDupsOkAcknowledge() { - return acknowledgementMode == Session.DUPS_OK_ACKNOWLEDGE; - } - - public boolean isIndividualAcknowledge(){ - return acknowledgementMode == ActiveMQSession.INDIVIDUAL_ACKNOWLEDGE; - } - - /** - * Returns the message delivery listener. - * - * @return deliveryListener - message delivery listener. - */ - public DeliveryListener getDeliveryListener() { - return deliveryListener; - } - - /** - * Sets the message delivery listener. - * - * @param deliveryListener - message delivery listener. - */ - public void setDeliveryListener(DeliveryListener deliveryListener) { - this.deliveryListener = deliveryListener; - } - - /** - * Returns the SessionInfo bean. - * - * @return info - SessionInfo bean. - * @throws JMSException - */ - protected SessionInfo getSessionInfo() throws JMSException { - SessionInfo info = new SessionInfo(connection.getConnectionInfo(), getSessionId().getValue()); - return info; - } - - /** - * Send the asynchronus command. - * - * @param command - command to be executed. - * @throws JMSException - */ - public void asyncSendPacket(Command command) throws JMSException { - connection.asyncSendPacket(command); - } - - /** - * Send the synchronus command. - * - * @param command - command to be executed. - * @return Response - * @throws JMSException - */ - public Response syncSendPacket(Command command) throws JMSException { - return connection.syncSendPacket(command); - } - - public long getNextDeliveryId() { - return deliveryIdGenerator.getNextSequenceId(); - } - - public void redispatch(ActiveMQDispatcher dispatcher, MessageDispatchChannel unconsumedMessages) throws JMSException { - - List c = unconsumedMessages.removeAll(); - for (MessageDispatch md : c) { - this.connection.rollbackDuplicate(dispatcher, md.getMessage()); - } - Collections.reverse(c); - - for (Iterator iter = c.iterator(); iter.hasNext();) { - MessageDispatch md = iter.next(); - executor.executeFirst(md); - } - - } - - public boolean isRunning() { - return started.get(); - } - - public boolean isAsyncDispatch() { - return asyncDispatch; - } - - public void setAsyncDispatch(boolean asyncDispatch) { - this.asyncDispatch = asyncDispatch; - } - - /** - * @return Returns the sessionAsyncDispatch. - */ - public boolean isSessionAsyncDispatch() { - return sessionAsyncDispatch; - } - - /** - * @param sessionAsyncDispatch The sessionAsyncDispatch to set. - */ - public void setSessionAsyncDispatch(boolean sessionAsyncDispatch) { - this.sessionAsyncDispatch = sessionAsyncDispatch; - } - - public MessageTransformer getTransformer() { - return transformer; - } - - public ActiveMQConnection getConnection() { - return connection; - } - - /** - * Sets the transformer used to transform messages before they are sent on - * to the JMS bus or when they are received from the bus but before they are - * delivered to the JMS client - */ - public void setTransformer(MessageTransformer transformer) { - this.transformer = transformer; - } - - public BlobTransferPolicy getBlobTransferPolicy() { - return blobTransferPolicy; - } - - /** - * Sets the policy used to describe how out-of-band BLOBs (Binary Large - * OBjects) are transferred from producers to brokers to consumers - */ - public void setBlobTransferPolicy(BlobTransferPolicy blobTransferPolicy) { - this.blobTransferPolicy = blobTransferPolicy; - } - - public List getUnconsumedMessages() { - return executor.getUnconsumedMessages(); - } - - @Override - public String toString() { - return "ActiveMQSession {id=" + info.getSessionId() + ",started=" + started.get() + "}"; - } - - public void checkMessageListener() throws JMSException { - if (messageListener != null) { - throw new IllegalStateException("Cannot synchronously receive a message when a MessageListener is set"); - } - for (Iterator i = consumers.iterator(); i.hasNext();) { - ActiveMQMessageConsumer consumer = i.next(); - if (consumer.hasMessageListener()) { - throw new IllegalStateException("Cannot synchronously receive a message when a MessageListener is set"); - } - } - } - - protected void setOptimizeAcknowledge(boolean value) { - for (Iterator iter = consumers.iterator(); iter.hasNext();) { - ActiveMQMessageConsumer c = iter.next(); - c.setOptimizeAcknowledge(value); - } - } - - protected void setPrefetchSize(ConsumerId id, int prefetch) { - for (Iterator iter = consumers.iterator(); iter.hasNext();) { - ActiveMQMessageConsumer c = iter.next(); - if (c.getConsumerId().equals(id)) { - c.setPrefetchSize(prefetch); - break; - } - } - } - - protected void close(ConsumerId id) { - for (Iterator iter = consumers.iterator(); iter.hasNext();) { - ActiveMQMessageConsumer c = iter.next(); - if (c.getConsumerId().equals(id)) { - try { - c.close(); - } catch (JMSException e) { - LOG.warn("Exception closing consumer", e); - } - LOG.warn("Closed consumer on Command, " + id); - break; - } - } - } - - public boolean isInUse(ActiveMQTempDestination destination) { - for (Iterator iter = consumers.iterator(); iter.hasNext();) { - ActiveMQMessageConsumer c = iter.next(); - if (c.isInUse(destination)) { - return true; - } - } - return false; - } - - /** - * highest sequence id of the last message delivered by this session. - * Passed to the broker in the close command, maintained by dispose() - * @return lastDeliveredSequenceId - */ - public long getLastDeliveredSequenceId() { - return lastDeliveredSequenceId; - } - - protected void sendAck(MessageAck ack) throws JMSException { - sendAck(ack,false); - } - - protected void sendAck(MessageAck ack, boolean lazy) throws JMSException { - if (lazy || connection.isSendAcksAsync() || getTransacted()) { - asyncSendPacket(ack); - } else { - syncSendPacket(ack); - } - } - - protected Scheduler getScheduler() throws JMSException { - return this.connection.getScheduler(); - } - - protected ThreadPoolExecutor getConnectionExecutor() { - return this.connectionExecutor; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQSessionExecutor.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQSessionExecutor.class deleted file mode 100644 index c15de5998..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQSessionExecutor.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQSessionExecutor.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQSessionExecutor.java deleted file mode 100644 index caa1ca988..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQSessionExecutor.java +++ /dev/null @@ -1,210 +0,0 @@ -/** - * 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; - -import java.util.List; -import javax.jms.JMSException; -import org.apache.activemq.command.ConsumerId; -import org.apache.activemq.command.MessageDispatch; -import org.apache.activemq.thread.Task; -import org.apache.activemq.thread.TaskRunner; -import org.apache.activemq.util.JMSExceptionSupport; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * A utility class used by the Session for dispatching messages asynchronously - * to consumers - * - * @see javax.jms.Session - */ -public class ActiveMQSessionExecutor implements Task { - private static final Logger LOG = LoggerFactory.getLogger(ActiveMQSessionExecutor.class); - - private final ActiveMQSession session; - private final MessageDispatchChannel messageQueue; - private boolean dispatchedBySessionPool; - private volatile TaskRunner taskRunner; - private boolean startedOrWarnedThatNotStarted; - - ActiveMQSessionExecutor(ActiveMQSession session) { - this.session = session; - if (this.session.connection != null && this.session.connection.isMessagePrioritySupported()) { - this.messageQueue = new SimplePriorityMessageDispatchChannel(); - }else { - this.messageQueue = new FifoMessageDispatchChannel(); - } - } - - void setDispatchedBySessionPool(boolean value) { - dispatchedBySessionPool = value; - wakeup(); - } - - void execute(MessageDispatch message) throws InterruptedException { - - if (!startedOrWarnedThatNotStarted) { - - ActiveMQConnection connection = session.connection; - long aboutUnstartedConnectionTimeout = connection.getWarnAboutUnstartedConnectionTimeout(); - if (connection.isStarted() || aboutUnstartedConnectionTimeout < 0L) { - startedOrWarnedThatNotStarted = true; - } else { - long elapsedTime = System.currentTimeMillis() - connection.getTimeCreated(); - - // lets only warn when a significant amount of time has passed - // just in case its normal operation - if (elapsedTime > aboutUnstartedConnectionTimeout) { - LOG.warn("Received a message on a connection which is not yet started. Have you forgotten to call Connection.start()? Connection: " + connection - + " Received: " + message); - startedOrWarnedThatNotStarted = true; - } - } - } - - if (!session.isSessionAsyncDispatch() && !dispatchedBySessionPool) { - dispatch(message); - } else { - messageQueue.enqueue(message); - wakeup(); - } - } - - public void wakeup() { - if (!dispatchedBySessionPool) { - if (session.isSessionAsyncDispatch()) { - try { - TaskRunner taskRunner = this.taskRunner; - if (taskRunner == null) { - synchronized (this) { - if (this.taskRunner == null) { - if (!isRunning()) { - // stop has been called - return; - } - this.taskRunner = session.connection.getSessionTaskRunner().createTaskRunner(this, - "ActiveMQ Session: " + session.getSessionId()); - } - taskRunner = this.taskRunner; - } - } - taskRunner.wakeup(); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } - } else { - while (iterate()) { - } - } - } - } - - void executeFirst(MessageDispatch message) { - messageQueue.enqueueFirst(message); - wakeup(); - } - - public boolean hasUncomsumedMessages() { - return !messageQueue.isClosed() && messageQueue.isRunning() && !messageQueue.isEmpty(); - } - - void dispatch(MessageDispatch message) { - // TODO - we should use a Map for this indexed by consumerId - for (ActiveMQMessageConsumer consumer : this.session.consumers) { - ConsumerId consumerId = message.getConsumerId(); - if (consumerId.equals(consumer.getConsumerId())) { - consumer.dispatch(message); - break; - } - } - } - - synchronized void start() { - if (!messageQueue.isRunning()) { - messageQueue.start(); - if (hasUncomsumedMessages()) { - wakeup(); - } - } - } - - void stop() throws JMSException { - try { - if (messageQueue.isRunning()) { - synchronized(this) { - messageQueue.stop(); - if (this.taskRunner != null) { - this.taskRunner.shutdown(); - this.taskRunner = null; - } - } - } - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw JMSExceptionSupport.create(e); - } - } - - boolean isRunning() { - return messageQueue.isRunning(); - } - - void close() { - messageQueue.close(); - } - - void clear() { - messageQueue.clear(); - } - - MessageDispatch dequeueNoWait() { - return messageQueue.dequeueNoWait(); - } - - protected void clearMessagesInProgress() { - messageQueue.clear(); - } - - public boolean isEmpty() { - return messageQueue.isEmpty(); - } - - public boolean iterate() { - - // Deliver any messages queued on the consumer to their listeners. - for (ActiveMQMessageConsumer consumer : this.session.consumers) { - if (consumer.iterate()) { - return true; - } - } - - // No messages left queued on the listeners.. so now dispatch messages - // queued on the session - MessageDispatch message = messageQueue.dequeueNoWait(); - if (message == null) { - return false; - } else { - dispatch(message); - return !messageQueue.isEmpty(); - } - } - - List getUnconsumedMessages() { - return messageQueue.removeAll(); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQSslConnectionFactory.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQSslConnectionFactory.class deleted file mode 100644 index e18b79461..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQSslConnectionFactory.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQSslConnectionFactory.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQSslConnectionFactory.java deleted file mode 100644 index fe9d52fd0..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQSslConnectionFactory.java +++ /dev/null @@ -1,271 +0,0 @@ -/** - * 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; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URL; -import java.security.KeyStore; -import java.security.SecureRandom; - -import javax.jms.JMSException; -import javax.net.ssl.KeyManager; -import javax.net.ssl.KeyManagerFactory; -import javax.net.ssl.TrustManager; -import javax.net.ssl.TrustManagerFactory; - -import org.apache.activemq.broker.SslContext; -import org.apache.activemq.transport.Transport; -import org.apache.activemq.util.JMSExceptionSupport; - -/** - * An ActiveMQConnectionFactory that allows access to the key and trust managers - * used for SslConnections. There is no reason to use this class unless SSL is - * being used AND the key and trust managers need to be specified from within - * code. In fact, if the URI passed to this class does not have an "ssl" scheme, - * this class will pass all work on to its superclass. - * - * There are two alternative approaches you can use to provide X.509 - * certificates for the SSL connections: - * - * Call setTrustStore, setTrustStorePassword, - * setKeyStore, and setKeyStorePassword. - * - * Call setKeyAndTrustManagers. - * - * @author sepandm@gmail.com - */ -public class ActiveMQSslConnectionFactory extends ActiveMQConnectionFactory { - - // The key and trust managers used to initialize the used SSLContext. - protected KeyManager[] keyManager; - protected TrustManager[] trustManager; - protected SecureRandom secureRandom; - protected String trustStore; - protected String trustStorePassword; - protected String keyStore; - protected String keyStorePassword; - - public ActiveMQSslConnectionFactory() { - super(); - } - - public ActiveMQSslConnectionFactory(String brokerURL) { - super(brokerURL); - } - - public ActiveMQSslConnectionFactory(URI brokerURL) { - super(brokerURL); - } - - /** - * Sets the key and trust managers used when creating SSL connections. - * - * @param km - * The KeyManagers used. - * @param tm - * The TrustManagers used. - * @param random - * The SecureRandom number used. - */ - public void setKeyAndTrustManagers(final KeyManager[] km, final TrustManager[] tm, final SecureRandom random) { - keyManager = km; - trustManager = tm; - secureRandom = random; - } - - /** - * Overriding to make special considerations for SSL connections. If we are - * not using SSL, the superclass's method is called. If we are using SSL, an - * SslConnectionFactory is used and it is given the needed key and trust - * managers. - * - * @author sepandm@gmail.com - */ - @Override - protected Transport createTransport() throws JMSException { - SslContext existing = SslContext.getCurrentSslContext(); - try { - if (keyStore != null || trustStore != null) { - keyManager = createKeyManager(); - trustManager = createTrustManager(); - } - if (keyManager != null || trustManager != null) { - SslContext.setCurrentSslContext(new SslContext(keyManager, trustManager, secureRandom)); - } - return super.createTransport(); - } catch (Exception e) { - throw JMSExceptionSupport.create("Could not create Transport. Reason: " + e, e); - } finally { - SslContext.setCurrentSslContext(existing); - } - } - - protected TrustManager[] createTrustManager() throws Exception { - TrustManager[] trustStoreManagers = null; - KeyStore trustedCertStore = KeyStore.getInstance("jks"); - - if (trustStore != null) { - InputStream tsStream = getInputStream(trustStore); - - trustedCertStore.load(tsStream, trustStorePassword.toCharArray()); - TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); - - tmf.init(trustedCertStore); - trustStoreManagers = tmf.getTrustManagers(); - } - return trustStoreManagers; - } - - protected KeyManager[] createKeyManager() throws Exception { - KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); - KeyStore ks = KeyStore.getInstance("jks"); - KeyManager[] keystoreManagers = null; - if (keyStore != null) { - byte[] sslCert = loadClientCredential(keyStore); - - if (sslCert != null && sslCert.length > 0) { - ByteArrayInputStream bin = new ByteArrayInputStream(sslCert); - ks.load(bin, keyStorePassword.toCharArray()); - kmf.init(ks, keyStorePassword.toCharArray()); - keystoreManagers = kmf.getKeyManagers(); - } - } - return keystoreManagers; - } - - protected byte[] loadClientCredential(String fileName) throws IOException { - if (fileName == null) { - return null; - } - InputStream in = getInputStream(fileName); - ByteArrayOutputStream out = new ByteArrayOutputStream(); - byte[] buf = new byte[512]; - int i = in.read(buf); - while (i > 0) { - out.write(buf, 0, i); - i = in.read(buf); - } - in.close(); - return out.toByteArray(); - } - - protected InputStream getInputStream(String urlOrResource) throws IOException { - try { - File ifile = new File(urlOrResource); - // only open the file if and only if it exists - if (ifile.exists()) { - return new FileInputStream(ifile); - } - } catch (Exception e) { - } - - InputStream ins = null; - - try { - URL url = new URL(urlOrResource); - ins = url.openStream(); - if (ins != null) { - return ins; - } - } catch (MalformedURLException ignore) { - } - - // Alternatively, treat as classpath resource - if (ins == null) { - ins = Thread.currentThread().getContextClassLoader().getResourceAsStream(urlOrResource); - } - - if (ins == null) { - throw new IOException("Could not load resource: " + urlOrResource); - } - - return ins; - } - - public String getTrustStore() { - return trustStore; - } - - /** - * The location of a keystore file (in jks format) containing - * one or more trusted certificates. - * - * @param trustStore - * If specified with a scheme, treat as a URL, otherwise treat as - * a classpath resource. - */ - public void setTrustStore(String trustStore) throws Exception { - this.trustStore = trustStore; - trustManager = null; - } - - public String getTrustStorePassword() { - return trustStorePassword; - } - - /** - * The password to match the trust store specified by {@link setTrustStore}. - * - * @param trustStorePassword - * The password used to unlock the keystore file. - */ - public void setTrustStorePassword(String trustStorePassword) { - this.trustStorePassword = trustStorePassword; - } - - public String getKeyStore() { - return keyStore; - } - - /** - * The location of a keystore file (in jks format) containing a - * certificate and its private key. - * - * @param keyStore - * If specified with a scheme, treat as a URL, otherwise treat as - * a classpath resource. - */ - public void setKeyStore(String keyStore) throws Exception { - this.keyStore = keyStore; - keyManager = null; - } - - public String getKeyStorePassword() { - return keyStorePassword; - } - - /** - * The password to match the key store specified by {@link setKeyStore}. - * - * @param keyStorePassword - * The password, which is used both to unlock the keystore file - * and as the pass phrase for the private key stored in the - * keystore. - */ - public void setKeyStorePassword(String keyStorePassword) { - this.keyStorePassword = keyStorePassword; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQTopicPublisher.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQTopicPublisher.class deleted file mode 100644 index fdfa88d15..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQTopicPublisher.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQTopicPublisher.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQTopicPublisher.java deleted file mode 100644 index 393290963..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQTopicPublisher.java +++ /dev/null @@ -1,198 +0,0 @@ -/** - * 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; - -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.Topic; -import javax.jms.TopicPublisher; - -import org.apache.activemq.command.ActiveMQDestination; - -/** - * A client uses a TopicPublisher object to publish messages on - * a topic. A TopicPublisher object is the publish-subscribe - * form of a message producer. - *

    - *

    - * Normally, the Topic is specified when a TopicPublisher - * is created. In this case, an attempt to use the publish - * methods for an unidentified TopicPublisher will throw - * a java.lang.UnsupportedOperationException. - *

    - *

    - * If the TopicPublisher is created with an unidentified - * Topic, an attempt to use the publish methods that - * assume that the Topic has been identified will throw a - * java.lang.UnsupportedOperationException. - *

    - *

    - * During the execution of its publish method, a message must - * not be changed by other threads within the client. If the message is - * modified, the result of the publish is undefined. - *

    - *

    - * After publishing a message, a client may retain and modify it without - * affecting the message that has been published. The same message object may - * be published multiple times. - *

    - *

    - * The following message headers are set as part of publishing a message: - * JMSDestination,JMSDeliveryMode,JMSExpiration, - * JMSPriority,JMSMessageID and JMSTimeStamp. - * When the message is published, the values of these headers are ignored. - * After completion of the publish, the headers hold the values - * specified by the method publishing the message. It is possible for the - * publish method not to set JMSMessageID and - * JMSTimeStamp if the setting of these headers is explicitly - * disabled by the MessageProducer.setDisableMessageID or MessageProducer.setDisableMessageTimestamp - * method. - *

    - *

    - * Creating a MessageProducer provides the same features as - * creating a TopicPublisher. A MessageProducer - * object is recommended when creating new code. The TopicPublisher - * is provided to support existing code. - *

    - *

    - *

    - * Because TopicPublisher inherits from MessageProducer - * , it inherits the send methods that are a part of the - * MessageProducer interface. Using the send - * methods will have the same effect as using the publish - * methods: they are functionally the same. - * - * @see Session#createProducer(Destination) - * @see TopicSession#createPublisher(Topic) - */ - -public class ActiveMQTopicPublisher extends ActiveMQMessageProducer implements - TopicPublisher { - - protected ActiveMQTopicPublisher(ActiveMQSession session, - ActiveMQDestination destination, int sendTimeout) throws JMSException { - super(session, session.getNextProducerId(), destination,sendTimeout); - } - - /** - * Gets the topic associated with this TopicPublisher. - * - * @return this publisher's topic - * @throws JMSException if the JMS provider fails to get the topic for this - * TopicPublisher due to some internal error. - */ - - public Topic getTopic() throws JMSException { - return (Topic) super.getDestination(); - } - - /** - * Publishes a message to the topic. Uses the TopicPublisher's - * default delivery mode, priority, and time to live. - * - * @param message the message to publish - * @throws JMSException if the JMS provider fails to publish the message due to - * some internal error. - * @throws MessageFormatException if an invalid message is specified. - * @throws InvalidDestinationException if a client uses this method with a TopicPublisher - * with an invalid topic. - * @throws java.lang.UnsupportedOperationException - * if a client uses this method with a TopicPublisher - * that did not specify a topic at creation time. - * @see javax.jms.MessageProducer#getDeliveryMode() - * @see javax.jms.MessageProducer#getTimeToLive() - * @see javax.jms.MessageProducer#getPriority() - */ - - public void publish(Message message) throws JMSException { - super.send(message); - } - - /** - * Publishes a message to the topic, specifying delivery mode, priority, - * and time to live. - * - * @param message the message to publish - * @param deliveryMode the delivery mode to use - * @param priority the priority for this message - * @param timeToLive the message's lifetime (in milliseconds) - * @throws JMSException if the JMS provider fails to publish the message due to - * some internal error. - * @throws MessageFormatException if an invalid message is specified. - * @throws InvalidDestinationException if a client uses this method with a TopicPublisher - * with an invalid topic. - * @throws java.lang.UnsupportedOperationException - * if a client uses this method with a TopicPublisher - * that did not specify a topic at creation time. - */ - - public void publish(Message message, int deliveryMode, int priority, - long timeToLive) throws JMSException { - super.send(message, deliveryMode, priority, timeToLive); - } - - /** - * Publishes a message to a topic for an unidentified message producer. - * Uses the TopicPublisher's default delivery mode, - * priority, and time to live. - *

    - *

    - * Typically, a message producer is assigned a topic at creation time; - * however, the JMS API also supports unidentified message producers, which - * require that the topic be supplied every time a message is published. - * - * @param topic the topic to publish this message to - * @param message the message to publish - * @throws JMSException if the JMS provider fails to publish the message due to - * some internal error. - * @throws MessageFormatException if an invalid message is specified. - * @throws InvalidDestinationException if a client uses this method with an invalid topic. - * @see javax.jms.MessageProducer#getDeliveryMode() - * @see javax.jms.MessageProducer#getTimeToLive() - * @see javax.jms.MessageProducer#getPriority() - */ - - public void publish(Topic topic, Message message) throws JMSException { - super.send(topic, message); - } - - /** - * Publishes a message to a topic for an unidentified message producer, - * specifying delivery mode, priority and time to live. - *

    - *

    - * Typically, a message producer is assigned a topic at creation time; - * however, the JMS API also supports unidentified message producers, which - * require that the topic be supplied every time a message is published. - * - * @param topic the topic to publish this message to - * @param message the message to publish - * @param deliveryMode the delivery mode to use - * @param priority the priority for this message - * @param timeToLive the message's lifetime (in milliseconds) - * @throws JMSException if the JMS provider fails to publish the message due to - * some internal error. - * @throws MessageFormatException if an invalid message is specified. - * @throws InvalidDestinationException if a client uses this method with an invalid topic. - */ - - public void publish(Topic topic, Message message, int deliveryMode, - int priority, long timeToLive) throws JMSException { - super.send(topic, message, deliveryMode, priority, timeToLive); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQTopicSession.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQTopicSession.class deleted file mode 100644 index 8459c16c6..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQTopicSession.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQTopicSession.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQTopicSession.java deleted file mode 100644 index ea92a71a0..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQTopicSession.java +++ /dev/null @@ -1,390 +0,0 @@ -/** - * 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; - -import java.io.Serializable; - -import javax.jms.BytesMessage; -import javax.jms.Destination; -import javax.jms.IllegalStateException; -import javax.jms.InvalidDestinationException; -import javax.jms.JMSException; -import javax.jms.MapMessage; -import javax.jms.Message; -import javax.jms.MessageConsumer; -import javax.jms.MessageListener; -import javax.jms.MessageProducer; -import javax.jms.ObjectMessage; -import javax.jms.Queue; -import javax.jms.QueueBrowser; -import javax.jms.StreamMessage; -import javax.jms.TemporaryQueue; -import javax.jms.TemporaryTopic; -import javax.jms.TextMessage; -import javax.jms.Topic; -import javax.jms.TopicPublisher; -import javax.jms.TopicSession; -import javax.jms.TopicSubscriber; - -/** - * A TopicSession implementation that throws IllegalStateExceptions when Queue - * operations are attempted but which delegates to another TopicSession for all - * other operations. The ActiveMQSessions implement both Topic and Queue - * Sessions methods but the spec states that TopicSession should throw - * Exceptions if queue operations are attempted on it. - * - * - */ -public class ActiveMQTopicSession implements TopicSession { - - private final TopicSession next; - - public ActiveMQTopicSession(TopicSession next) { - this.next = next; - } - - /** - * @throws JMSException - */ - public void close() throws JMSException { - next.close(); - } - - /** - * @throws JMSException - */ - public void commit() throws JMSException { - next.commit(); - } - - /** - * @param queue - * @return - * @throws JMSException - */ - public QueueBrowser createBrowser(Queue queue) throws JMSException { - throw new IllegalStateException("Operation not supported by a TopicSession"); - } - - /** - * @param queue - * @param messageSelector - * @return - * @throws JMSException - */ - public QueueBrowser createBrowser(Queue queue, String messageSelector) throws JMSException { - throw new IllegalStateException("Operation not supported by a TopicSession"); - } - - /** - * @return - * @throws JMSException - */ - public BytesMessage createBytesMessage() throws JMSException { - return next.createBytesMessage(); - } - - /** - * @param destination - * @return - * @throws JMSException - */ - public MessageConsumer createConsumer(Destination destination) throws JMSException { - if (destination instanceof Queue) { - throw new InvalidDestinationException("Queues are not supported by a TopicSession"); - } - return next.createConsumer(destination); - } - - /** - * @param destination - * @param messageSelector - * @return - * @throws JMSException - */ - public MessageConsumer createConsumer(Destination destination, String messageSelector) throws JMSException { - if (destination instanceof Queue) { - throw new InvalidDestinationException("Queues are not supported by a TopicSession"); - } - return next.createConsumer(destination, messageSelector); - } - - /** - * @param destination - * @param messageSelector - * @param noLocal - * @return - * @throws JMSException - */ - public MessageConsumer createConsumer(Destination destination, String messageSelector, boolean noLocal) throws JMSException { - if (destination instanceof Queue) { - throw new InvalidDestinationException("Queues are not supported by a TopicSession"); - } - return next.createConsumer(destination, messageSelector, noLocal); - } - - /** - * @param topic - * @param name - * @return - * @throws JMSException - */ - public TopicSubscriber createDurableSubscriber(Topic topic, String name) throws JMSException { - return next.createDurableSubscriber(topic, name); - } - - /** - * @param topic - * @param name - * @param messageSelector - * @param noLocal - * @return - * @throws JMSException - */ - public TopicSubscriber createDurableSubscriber(Topic topic, String name, String messageSelector, boolean noLocal) throws JMSException { - return next.createDurableSubscriber(topic, name, messageSelector, noLocal); - } - - /** - * @return - * @throws JMSException - */ - public MapMessage createMapMessage() throws JMSException { - return next.createMapMessage(); - } - - /** - * @return - * @throws JMSException - */ - public Message createMessage() throws JMSException { - return next.createMessage(); - } - - /** - * @return - * @throws JMSException - */ - public ObjectMessage createObjectMessage() throws JMSException { - return next.createObjectMessage(); - } - - /** - * @param object - * @return - * @throws JMSException - */ - public ObjectMessage createObjectMessage(Serializable object) throws JMSException { - return next.createObjectMessage(object); - } - - /** - * @param destination - * @return - * @throws JMSException - */ - public MessageProducer createProducer(Destination destination) throws JMSException { - if (destination instanceof Queue) { - throw new InvalidDestinationException("Queues are not supported by a TopicSession"); - } - return next.createProducer(destination); - } - - /** - * @param topic - * @return - * @throws JMSException - */ - public TopicPublisher createPublisher(Topic topic) throws JMSException { - return next.createPublisher(topic); - } - - /** - * @param queueName - * @return - * @throws JMSException - */ - public Queue createQueue(String queueName) throws JMSException { - throw new IllegalStateException("Operation not supported by a TopicSession"); - } - - /** - * @return - * @throws JMSException - */ - public StreamMessage createStreamMessage() throws JMSException { - return next.createStreamMessage(); - } - - /** - * @param topic - * @return - * @throws JMSException - */ - public TopicSubscriber createSubscriber(Topic topic) throws JMSException { - return next.createSubscriber(topic); - } - - /** - * @param topic - * @param messageSelector - * @param noLocal - * @return - * @throws JMSException - */ - public TopicSubscriber createSubscriber(Topic topic, String messageSelector, boolean noLocal) throws JMSException { - return next.createSubscriber(topic, messageSelector, noLocal); - } - - /** - * @return - * @throws JMSException - */ - public TemporaryQueue createTemporaryQueue() throws JMSException { - throw new IllegalStateException("Operation not supported by a TopicSession"); - } - - /** - * @return - * @throws JMSException - */ - public TemporaryTopic createTemporaryTopic() throws JMSException { - return next.createTemporaryTopic(); - } - - /** - * @return - * @throws JMSException - */ - public TextMessage createTextMessage() throws JMSException { - return next.createTextMessage(); - } - - /** - * @param text - * @return - * @throws JMSException - */ - public TextMessage createTextMessage(String text) throws JMSException { - return next.createTextMessage(text); - } - - /** - * @param topicName - * @return - * @throws JMSException - */ - public Topic createTopic(String topicName) throws JMSException { - return next.createTopic(topicName); - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals(Object arg0) { - if(this != arg0) { - return next.equals(arg0); - } - - return true; - } - - /** - * @return - * @throws JMSException - */ - public int getAcknowledgeMode() throws JMSException { - return next.getAcknowledgeMode(); - } - - /** - * @return - * @throws JMSException - */ - public MessageListener getMessageListener() throws JMSException { - return next.getMessageListener(); - } - - /** - * @return - * @throws JMSException - */ - public boolean getTransacted() throws JMSException { - return next.getTransacted(); - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - return next.hashCode(); - } - - /** - * @throws JMSException - */ - public void recover() throws JMSException { - next.recover(); - } - - /** - * @throws JMSException - */ - public void rollback() throws JMSException { - next.rollback(); - } - - /** - * - */ - public void run() { - next.run(); - } - - /** - * @param listener - * @throws JMSException - */ - public void setMessageListener(MessageListener listener) throws JMSException { - next.setMessageListener(listener); - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ - public String toString() { - return next.toString(); - } - - /** - * @param name - * @throws JMSException - */ - public void unsubscribe(String name) throws JMSException { - next.unsubscribe(name); - } - - public TopicSession getNext() { - return next; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQTopicSubscriber.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQTopicSubscriber.class deleted file mode 100644 index c5f8bae98..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQTopicSubscriber.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQTopicSubscriber.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQTopicSubscriber.java deleted file mode 100644 index 79630712c..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQTopicSubscriber.java +++ /dev/null @@ -1,147 +0,0 @@ -/** - * 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; - -import javax.jms.JMSException; -import javax.jms.Topic; -import javax.jms.TopicSubscriber; - -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ConsumerId; - -/** - * A client uses a TopicSubscriber object to receive messages - * that have been published to a topic. A TopicSubscriber object - * is the publish/subscribe form of a message consumer. A - * MessageConsumer can be created by using - * Session.createConsumer. - *

    - *

    - * A TopicSession allows the creation of multiple - * TopicSubscriber objects per topic. It will deliver each message for - * a topic to each subscriber eligible to receive it. Each copy of the message - * is treated as a completely separate message. Work done on one copy has no - * effect on the others; acknowledging one does not acknowledge the others; one - * message may be delivered immediately, while another waits for its subscriber - * to process messages ahead of it. - *

    - *

    - * Regular TopicSubscriber objects are not durable. They receive - * only messages that are published while they are active. - *

    - *

    - * Messages filtered out by a subscriber's message selector will never be - * delivered to the subscriber. From the subscriber's perspective, they do not - * exist. - *

    - *

    - * In some cases, a connection may both publish and subscribe to a topic. The - * subscriber NoLocal attribute allows a subscriber to inhibit - * the delivery of messages published by its own connection. - *

    - *

    - * If a client needs to receive all the messages published on a topic, - * including the ones published while the subscriber is inactive, it uses a - * durable TopicSubscriber. The JMS provider retains a record - * of this durable subscription and insures that all messages from the topic's - * publishers are retained until they are acknowledged by this durable - * subscriber or they have expired. - *

    - *

    - * Sessions with durable subscribers must always provide the same client - * identifier. In addition, each client must specify a name that uniquely - * identifies (within client identifier) each durable subscription it creates. - * Only one session at a time can have a TopicSubscriber for a - * particular durable subscription. - *

    - *

    - * A client can change an existing durable subscription by creating a durable - * TopicSubscriber with the same name and a new topic and/or - * message selector. Changing a durable subscription is equivalent to - * unsubscribing (deleting) the old one and creating a new one. - *

    - *

    - * The unsubscribe method is used to delete a durable - * subscription. The unsubscribe method can be used at the - * Session or TopicSession level. This method - * deletes the state being maintained on behalf of the subscriber by its - * provider. - *

    - *

    - * Creating a MessageConsumer provides the same features as - * creating a TopicSubscriber. To create a durable subscriber, - * use of Session.CreateDurableSubscriber is recommended. The - * TopicSubscriber is provided to support existing code. - * - * @see javax.jms.Session#createConsumer - * @see javax.jms.Session#createDurableSubscriber - * @see javax.jms.TopicSession - * @see javax.jms.TopicSession#createSubscriber - * @see javax.jms.TopicSubscriber - * @see javax.jms.MessageConsumer - */ - -public class ActiveMQTopicSubscriber extends ActiveMQMessageConsumer implements - TopicSubscriber { - - /** - * @param theSession - * @param value - * @param dest - * @param name - * @param selector - * @param cnum - * @param noLocalValue - * @param browserValue - * @param asyncDispatch - * @throws JMSException - */ - protected ActiveMQTopicSubscriber(ActiveMQSession theSession, - ConsumerId consumerId, ActiveMQDestination dest, String name, String selector, int prefetch, int maximumPendingMessageCount, - boolean noLocalValue, boolean browserValue, boolean asyncDispatch) throws JMSException { - super(theSession, consumerId, dest, name, selector, prefetch, maximumPendingMessageCount, noLocalValue, browserValue, asyncDispatch, null); - } - - /** - * Gets the Topic associated with this subscriber. - * - * @return this subscriber's Topic - * @throws JMSException if the JMS provider fails to get the topic for this topic - * subscriber due to some internal error. - */ - - public Topic getTopic() throws JMSException { - checkClosed(); - return (Topic) super.getDestination(); - } - - /** - * Gets the NoLocal attribute for this subscriber. The - * default value for this attribute is false. - * - * @return true if locally published messages are being inhibited - * @throws JMSException if the JMS provider fails to get the NoLocal - * attribute for this topic subscriber due to some - * internal error. - */ - - public boolean getNoLocal() throws JMSException { - checkClosed(); - return super.isNoLocal(); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQXAConnection.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQXAConnection.class deleted file mode 100644 index ac0d130a1..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQXAConnection.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQXAConnection.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQXAConnection.java deleted file mode 100644 index 20b376d66..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQXAConnection.java +++ /dev/null @@ -1,89 +0,0 @@ -/** - * 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; - -import javax.jms.JMSException; -import javax.jms.Session; -import javax.jms.XAConnection; -import javax.jms.XAQueueConnection; -import javax.jms.XAQueueSession; -import javax.jms.XASession; -import javax.jms.XATopicConnection; -import javax.jms.XATopicSession; - -import org.apache.activemq.management.JMSStatsImpl; -import org.apache.activemq.transport.Transport; -import org.apache.activemq.util.IdGenerator; - -/** - * The XAConnection interface extends the capability of Connection by providing - * an XASession (optional). - *

    - * The XAConnection interface is optional. JMS providers are not required to - * support this interface. This interface is for use by JMS providers to - * support transactional environments. Client programs are strongly encouraged - * to use the transactional support available in their environment, rather - * than use these XA interfaces directly. - * - * - * @see javax.jms.Connection - * @see javax.jms.ConnectionFactory - * @see javax.jms.QueueConnection - * @see javax.jms.TopicConnection - * @see javax.jms.TopicConnectionFactory - * @see javax.jms.QueueConnection - * @see javax.jms.QueueConnectionFactory - */ -public class ActiveMQXAConnection extends ActiveMQConnection implements XATopicConnection, XAQueueConnection, XAConnection { - - private int xaAckMode; - - protected ActiveMQXAConnection(Transport transport, IdGenerator clientIdGenerator, - IdGenerator connectionIdGenerator, JMSStatsImpl factoryStats) throws Exception { - super(transport, clientIdGenerator, connectionIdGenerator, factoryStats); - } - - public XASession createXASession() throws JMSException { - return (XASession) createSession(true, Session.SESSION_TRANSACTED); - } - - public XATopicSession createXATopicSession() throws JMSException { - return (XATopicSession) createSession(true, Session.SESSION_TRANSACTED); - } - - public XAQueueSession createXAQueueSession() throws JMSException { - return (XAQueueSession) createSession(true, Session.SESSION_TRANSACTED); - } - - public Session createSession(boolean transacted, int acknowledgeMode) throws JMSException { - checkClosedOrFailed(); - ensureConnectionInfoSent(); - return new ActiveMQXASession(this, getNextSessionId(), getAckMode(), isDispatchAsync()); - } - - private int getAckMode() { - return xaAckMode > 0 ? xaAckMode : Session.SESSION_TRANSACTED; - } - - public void setXaAckMode(int xaAckMode) { - this.xaAckMode = xaAckMode; - } - - public int getXaAckMode() { - return xaAckMode; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQXAConnectionFactory.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQXAConnectionFactory.class deleted file mode 100644 index b9a34eece..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQXAConnectionFactory.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQXAConnectionFactory.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQXAConnectionFactory.java deleted file mode 100644 index c3836856a..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQXAConnectionFactory.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * 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; - -import java.net.URI; -import java.util.Properties; - -import javax.jms.JMSException; -import javax.jms.XAConnection; -import javax.jms.XAConnectionFactory; -import javax.jms.XAQueueConnection; -import javax.jms.XAQueueConnectionFactory; -import javax.jms.XATopicConnection; -import javax.jms.XATopicConnectionFactory; - -import org.apache.activemq.management.JMSStatsImpl; -import org.apache.activemq.transport.Transport; - -/** - * A factory of {@link XAConnection} instances - * - * - */ -public class ActiveMQXAConnectionFactory extends ActiveMQConnectionFactory implements XAConnectionFactory, XAQueueConnectionFactory, XATopicConnectionFactory { - - public ActiveMQXAConnectionFactory() { - } - - public ActiveMQXAConnectionFactory(String userName, String password, String brokerURL) { - super(userName, password, brokerURL); - } - - public ActiveMQXAConnectionFactory(String userName, String password, URI brokerURL) { - super(userName, password, brokerURL); - } - - public ActiveMQXAConnectionFactory(String brokerURL) { - super(brokerURL); - } - - public ActiveMQXAConnectionFactory(URI brokerURL) { - super(brokerURL); - } - - public XAConnection createXAConnection() throws JMSException { - return (XAConnection) createActiveMQConnection(); - } - - public XAConnection createXAConnection(String userName, String password) throws JMSException { - return (XAConnection) createActiveMQConnection(userName, password); - } - - public XAQueueConnection createXAQueueConnection() throws JMSException { - return (XAQueueConnection) createActiveMQConnection(); - } - - public XAQueueConnection createXAQueueConnection(String userName, String password) throws JMSException { - return (XAQueueConnection) createActiveMQConnection(userName, password); - } - - public XATopicConnection createXATopicConnection() throws JMSException { - return (XATopicConnection) createActiveMQConnection(); - } - - public XATopicConnection createXATopicConnection(String userName, String password) throws JMSException { - return (XATopicConnection) createActiveMQConnection(userName, password); - } - - protected ActiveMQConnection createActiveMQConnection(Transport transport, JMSStatsImpl stats) throws Exception { - ActiveMQXAConnection connection = new ActiveMQXAConnection(transport, getClientIdGenerator(), getConnectionIdGenerator(), stats); - configureXAConnection(connection); - return connection; - } - - private void configureXAConnection(ActiveMQXAConnection connection) { - connection.setXaAckMode(xaAckMode); - } - - public int getXaAckMode() { - return xaAckMode; - } - - public void setXaAckMode(int xaAckMode) { - this.xaAckMode = xaAckMode; - } - - @Override - public void populateProperties(Properties props) { - super.populateProperties(props); - props.put("xaAckMode", Integer.toString(xaAckMode)); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQXASession.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQXASession.class deleted file mode 100644 index fd6c78511..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQXASession.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQXASession.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQXASession.java deleted file mode 100644 index 6e92416c0..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ActiveMQXASession.java +++ /dev/null @@ -1,114 +0,0 @@ -/** - * 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; - -import javax.jms.JMSException; -import javax.jms.QueueSession; -import javax.jms.Session; -import javax.jms.TopicSession; -import javax.jms.TransactionInProgressException; -import javax.jms.XAQueueSession; -import javax.jms.XATopicSession; -import javax.transaction.xa.XAResource; - -import org.apache.activemq.command.SessionId; - -/** - * The XASession interface extends the capability of Session by adding access - * to a JMS provider's support for the Java Transaction API (JTA) (optional). - * This support takes the form of a javax.transaction.xa.XAResource object. - * The functionality of this object closely resembles that defined by the - * standard X/Open XA Resource interface. - *

    - * An application server controls the transactional assignment of an XASession - * by obtaining its XAResource. It uses the XAResource to assign the session - * to a transaction, prepare and commit work on the transaction, and so on. - *

    - * An XAResource provides some fairly sophisticated facilities for - * interleaving work on multiple transactions, recovering a list of - * transactions in progress, and so on. A JTA aware JMS provider must fully - * implement this functionality. This could be done by using the services of a - * database that supports XA, or a JMS provider may choose to implement this - * functionality from scratch. - *

    - * A client of the application server is given what it thinks is a regular - * JMS Session. Behind the scenes, the application server controls the - * transaction management of the underlying XASession. - *

    - * The XASession interface is optional. JMS providers are not required to - * support this interface. This interface is for use by JMS providers to - * support transactional environments. Client programs are strongly encouraged - * to use the transactional support available in their environment, rather - * than use these XA interfaces directly. - * - * - * @see javax.jms.Session - * @see javax.jms.QueueSession - * @see javax.jms.TopicSession - * @see javax.jms.XASession - */ -public class ActiveMQXASession extends ActiveMQSession implements QueueSession, TopicSession, XAQueueSession, XATopicSession { - - public ActiveMQXASession(ActiveMQXAConnection connection, SessionId sessionId, int theAcknowlegeMode, boolean dispatchAsync) throws JMSException { - super(connection, sessionId, theAcknowlegeMode, dispatchAsync); - } - - public boolean getTransacted() throws JMSException { - checkClosed(); - return getTransactionContext().isInXATransaction(); - } - - public void rollback() throws JMSException { - checkClosed(); - throw new TransactionInProgressException("Cannot rollback() inside an XASession"); - } - - public void commit() throws JMSException { - checkClosed(); - throw new TransactionInProgressException("Cannot commit() inside an XASession"); - } - - public Session getSession() throws JMSException { - return this; - } - - public XAResource getXAResource() { - return getTransactionContext(); - } - - public QueueSession getQueueSession() throws JMSException { - return new ActiveMQQueueSession(this); - } - - public TopicSession getTopicSession() throws JMSException { - return new ActiveMQTopicSession(this); - } - - /* - * when there is no XA transaction it is auto ack - */ - public boolean isAutoAcknowledge() { - return true; - } - - protected void doStartTransaction() throws JMSException { - // allow non transactional auto ack work on an XASession - // Seems ok by the spec that an XAConnection can be used without an XA tx - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/AdvisoryConsumer.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/AdvisoryConsumer.class deleted file mode 100644 index aa532cb3e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/AdvisoryConsumer.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/AdvisoryConsumer.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/AdvisoryConsumer.java deleted file mode 100644 index 1e65ffb06..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/AdvisoryConsumer.java +++ /dev/null @@ -1,109 +0,0 @@ -/** - * 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; - -import javax.jms.JMSException; - -import org.apache.activemq.advisory.AdvisorySupport; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ActiveMQTempDestination; -import org.apache.activemq.command.ConsumerId; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.command.DataStructure; -import org.apache.activemq.command.DestinationInfo; -import org.apache.activemq.command.MessageAck; -import org.apache.activemq.command.MessageDispatch; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class AdvisoryConsumer implements ActiveMQDispatcher { - private static final transient Logger LOG = LoggerFactory.getLogger(AdvisoryConsumer.class); - - int deliveredCounter; - - private final ActiveMQConnection connection; - private ConsumerInfo info; - private boolean closed; - - public AdvisoryConsumer(ActiveMQConnection connection, ConsumerId consumerId) throws JMSException { - this.connection = connection; - info = new ConsumerInfo(consumerId); - info.setDestination(AdvisorySupport.TEMP_DESTINATION_COMPOSITE_ADVISORY_TOPIC); - info.setPrefetchSize(1000); - info.setNoLocal(true); - info.setDispatchAsync(true); - - this.connection.addDispatcher(info.getConsumerId(), this); - this.connection.syncSendPacket(this.info); - } - - public synchronized void dispose() { - if (!closed) { - try { - this.connection.asyncSendPacket(info.createRemoveCommand()); - } catch (JMSException e) { - LOG.debug("Failed to send remove command: " + e, e); - } - this.connection.removeDispatcher(info.getConsumerId()); - closed = true; - } - } - - public void dispatch(MessageDispatch md) { - - // Auto ack messages when we reach 75% of the prefetch - deliveredCounter++; - if (deliveredCounter > (0.75 * info.getPrefetchSize())) { - try { - MessageAck ack = new MessageAck(md, MessageAck.STANDARD_ACK_TYPE, deliveredCounter); - connection.asyncSendPacket(ack); - deliveredCounter = 0; - } catch (JMSException e) { - connection.onClientInternalException(e); - } - } - - DataStructure o = md.getMessage().getDataStructure(); - if (o != null && o.getClass() == DestinationInfo.class) { - processDestinationInfo((DestinationInfo)o); - } else { - //This can happen across networks - if (LOG.isDebugEnabled()) { - LOG.debug("Unexpected message was dispatched to the AdvisoryConsumer: "+md); - } - } - - } - - private void processDestinationInfo(DestinationInfo dinfo) { - ActiveMQDestination dest = dinfo.getDestination(); - if (!dest.isTemporary()) { - return; - } - - ActiveMQTempDestination tempDest = (ActiveMQTempDestination)dest; - if (dinfo.getOperationType() == DestinationInfo.ADD_OPERATION_TYPE) { - if (tempDest.getConnection() != null) { - tempDest = (ActiveMQTempDestination) tempDest.createDestination(tempDest.getPhysicalName()); - } - connection.activeTempDestinations.put(tempDest, tempDest); - } else if (dinfo.getOperationType() == DestinationInfo.REMOVE_OPERATION_TYPE) { - connection.activeTempDestinations.remove(tempDest); - } - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/AlreadyClosedException.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/AlreadyClosedException.class deleted file mode 100644 index 398feaaaa..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/AlreadyClosedException.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/AlreadyClosedException.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/AlreadyClosedException.java deleted file mode 100644 index 98a960593..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/AlreadyClosedException.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * 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; - -import javax.jms.JMSException; - -/** - * An exception which is closed if you try to access a resource which has already - * been closed - * - * - */ -public class AlreadyClosedException extends JMSException { - - private static final long serialVersionUID = -3203104889571618702L; - - public AlreadyClosedException() { - super("this connection"); - } - - public AlreadyClosedException(String description) { - super("Cannot use " + description + " as it has already been closed", "AMQ-1001"); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/AsyncCallback.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/AsyncCallback.class deleted file mode 100644 index b42a2ebf2..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/AsyncCallback.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/AsyncCallback.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/AsyncCallback.java deleted file mode 100644 index 72242b259..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/AsyncCallback.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * 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; - -import javax.jms.ExceptionListener; - -/** - *

    - *

    - * - * @author Hiram Chirino - */ -public interface AsyncCallback extends ExceptionListener { - public void onSuccess(); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/BlobMessage.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/BlobMessage.class deleted file mode 100644 index 3e78e00d2..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/BlobMessage.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/BlobMessage.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/BlobMessage.java deleted file mode 100644 index 127453d6c..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/BlobMessage.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * 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; - -import java.io.IOException; -import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URL; - -import javax.jms.JMSException; - -/** - * Represents a message which has a typically out of band Binary Large Object - * (BLOB) - * - * - */ -public interface BlobMessage extends Message { - - /** - * Return the input stream to process the BLOB - */ - InputStream getInputStream() throws IOException, JMSException; - - /** - * Returns the URL for the blob if its available as an external URL (such as file, http, ftp etc) - * or null if there is no URL available - */ - URL getURL() throws MalformedURLException, JMSException; - - - /** - * The MIME type of the BLOB which can be used to apply different content types to messages. - */ - String getMimeType(); - - /** - * Sets the MIME type of the BLOB so that a consumer can process things nicely with a Java Activation Framework - * DataHandler - */ - void setMimeType(String mimeType); - - - String getName(); - - /** - * The name of the attachment which can be useful information if transmitting files over ActiveMQ - */ - void setName(String name); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ClientInternalExceptionListener.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ClientInternalExceptionListener.class deleted file mode 100644 index f6e04959b..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ClientInternalExceptionListener.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ClientInternalExceptionListener.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ClientInternalExceptionListener.java deleted file mode 100644 index 3acb0acbb..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ClientInternalExceptionListener.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * 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; - -/** - * An exception listener similar to the standard javax.jms.ExceptionListener - * which can be used by client code to be notified of exceptions thrown by container components - * (e.g. an EJB container in case of Message Driven Beans) during asynchronous processing of a message. - *

    - * The org.apache.activemq.ActiveMQConnection that the listener has been registered with does - * this by calling the listener's onException() method passing it a Throwable describing - * the problem. - *

    - * - * @author Kai Hudalla - * @see ActiveMQConnection#setClientInternalExceptionListener(org.apache.activemq.ClientInternalExceptionListener) - */ -public interface ClientInternalExceptionListener -{ - /** - * Notifies a client of an exception while asynchronously processing a message. - * - * @param exception the exception describing the problem - */ - void onException(Throwable exception); -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/Closeable.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/Closeable.class deleted file mode 100644 index 5f303a8e0..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/Closeable.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/Closeable.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/Closeable.java deleted file mode 100644 index 79215d024..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/Closeable.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * 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; - -import javax.jms.JMSException; - -/** - * Provides a uniform interface that can be used to close all the JMS obejcts - * that provide a close() method. Useful for when you want to collect a - * heterogeous set of JMS object in a collection to be closed at a later time. - * - * - */ -public interface Closeable { - - /** - * Closes a JMS object. - *

    - * Many JMS objects are closeable such as Connections, Sessions, Consumers - * and Producers. - * - * @throws JMSException if the JMS provider fails to close the object due to - * some internal error. - */ - void close() throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ConfigurationException.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ConfigurationException.class deleted file mode 100644 index 071cc30bc..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ConfigurationException.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ConfigurationException.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ConfigurationException.java deleted file mode 100644 index 194e8a424..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ConfigurationException.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * 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; - -import javax.jms.JMSException; - -/** - * An exception thrown when a service is not correctly configured - * - * - */ -public class ConfigurationException extends JMSException { - private static final long serialVersionUID = 5639082552451065258L; - - public ConfigurationException(String description) { - super(description, "AMQ-1002"); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ConnectionAudit.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ConnectionAudit.class deleted file mode 100644 index 7ae23febe..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ConnectionAudit.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ConnectionAudit.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ConnectionAudit.java deleted file mode 100644 index d07b92b14..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ConnectionAudit.java +++ /dev/null @@ -1,116 +0,0 @@ -/** - * 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; - -import java.util.LinkedHashMap; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.Message; -import org.apache.activemq.util.LRUCache; - -/** - * An auditor class for a Connection that looks for duplicates - */ -class ConnectionAudit { - - private boolean checkForDuplicates; - private LinkedHashMap destinations = new LRUCache(1000); - private LinkedHashMap dispatchers = new LRUCache(1000); - - - private int auditDepth = ActiveMQMessageAudit.DEFAULT_WINDOW_SIZE; - private int auditMaximumProducerNumber = ActiveMQMessageAudit.MAXIMUM_PRODUCER_COUNT; - - - synchronized void removeDispatcher(ActiveMQDispatcher dispatcher) { - dispatchers.remove(dispatcher); - } - - synchronized boolean isDuplicate(ActiveMQDispatcher dispatcher, Message message) { - if (checkForDuplicates && message != null) { - ActiveMQDestination destination = message.getDestination(); - if (destination != null) { - if (destination.isQueue()) { - ActiveMQMessageAudit audit = destinations.get(destination); - if (audit == null) { - audit = new ActiveMQMessageAudit(auditDepth, auditMaximumProducerNumber); - destinations.put(destination, audit); - } - boolean result = audit.isDuplicate(message); - return result; - } - ActiveMQMessageAudit audit = dispatchers.get(dispatcher); - if (audit == null) { - audit = new ActiveMQMessageAudit(auditDepth, auditMaximumProducerNumber); - dispatchers.put(dispatcher, audit); - } - boolean result = audit.isDuplicate(message); - return result; - } - } - return false; - } - - protected synchronized void rollbackDuplicate(ActiveMQDispatcher dispatcher, Message message) { - if (checkForDuplicates && message != null) { - ActiveMQDestination destination = message.getDestination(); - if (destination != null) { - if (destination.isQueue()) { - ActiveMQMessageAudit audit = destinations.get(destination); - if (audit != null) { - audit.rollback(message); - } - } else { - ActiveMQMessageAudit audit = dispatchers.get(dispatcher); - if (audit != null) { - audit.rollback(message); - } - } - } - } - } - - /** - * @return the checkForDuplicates - */ - boolean isCheckForDuplicates() { - return this.checkForDuplicates; - } - - /** - * @param checkForDuplicates the checkForDuplicates to set - */ - void setCheckForDuplicates(boolean checkForDuplicates) { - this.checkForDuplicates = checkForDuplicates; - } - - public int getAuditDepth() { - return auditDepth; - } - - public void setAuditDepth(int auditDepth) { - this.auditDepth = auditDepth; - } - - public int getAuditMaximumProducerNumber() { - return auditMaximumProducerNumber; - } - - public void setAuditMaximumProducerNumber(int auditMaximumProducerNumber) { - this.auditMaximumProducerNumber = auditMaximumProducerNumber; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ConnectionClosedException.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ConnectionClosedException.class deleted file mode 100644 index 303c4c3a2..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ConnectionClosedException.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ConnectionClosedException.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ConnectionClosedException.java deleted file mode 100644 index bfac15b94..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ConnectionClosedException.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * 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; - -import javax.jms.IllegalStateException; - -/** - * An exception thrown when attempt is made to use a connection when the connection has been closed. - * - * - */ -public class ConnectionClosedException extends IllegalStateException { - private static final long serialVersionUID = -7681404582227153308L; - - public ConnectionClosedException() { - super("The connection is already closed", "AlreadyClosed"); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ConnectionFailedException.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ConnectionFailedException.class deleted file mode 100644 index eb19b1c6a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ConnectionFailedException.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ConnectionFailedException.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ConnectionFailedException.java deleted file mode 100644 index 94e887395..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ConnectionFailedException.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * 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; - -import java.io.IOException; - -import javax.jms.JMSException; - -/** - * An exception thrown when the a connection failure is detected (peer might - * close the connection, or a keep alive times out, etc.) - * - * - */ -public class ConnectionFailedException extends JMSException { - - private static final long serialVersionUID = 2288453203492073973L; - - public ConnectionFailedException(IOException cause) { - super("The JMS connection has failed: " + extractMessage(cause)); - initCause(cause); - setLinkedException(cause); - } - - public ConnectionFailedException() { - super("The JMS connection has failed due to a Transport problem"); - } - - private static String extractMessage(IOException cause) { - String m = cause.getMessage(); - if (m == null || m.length() == 0) { - m = cause.toString(); - } - return m; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/CustomDestination.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/CustomDestination.class deleted file mode 100644 index ec1a18519..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/CustomDestination.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/CustomDestination.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/CustomDestination.java deleted file mode 100644 index 8a3b29132..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/CustomDestination.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * 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; - -import javax.jms.Destination; -import javax.jms.JMSException; -import javax.jms.MessageConsumer; -import javax.jms.MessageProducer; -import javax.jms.QueueReceiver; -import javax.jms.QueueSender; -import javax.jms.TopicPublisher; -import javax.jms.TopicSubscriber; - -/** - * Represents a hook to allow the support of custom destinations - * such as to support Apache Camel - * to create and manage endpoints - * - * - */ -public interface CustomDestination extends Destination { - - // Consumers - //----------------------------------------------------------------------- - MessageConsumer createConsumer(ActiveMQSession session, String messageSelector); - MessageConsumer createConsumer(ActiveMQSession session, String messageSelector, boolean noLocal); - - TopicSubscriber createSubscriber(ActiveMQSession session, String messageSelector, boolean noLocal); - TopicSubscriber createDurableSubscriber(ActiveMQSession session, String name, String messageSelector, boolean noLocal); - - QueueReceiver createReceiver(ActiveMQSession session, String messageSelector); - - // Producers - //----------------------------------------------------------------------- - MessageProducer createProducer(ActiveMQSession session) throws JMSException; - - TopicPublisher createPublisher(ActiveMQSession session) throws JMSException; - - QueueSender createSender(ActiveMQSession session) throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/DestinationDoesNotExistException.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/DestinationDoesNotExistException.class deleted file mode 100644 index 64ebf2bc7..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/DestinationDoesNotExistException.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/DestinationDoesNotExistException.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/DestinationDoesNotExistException.java deleted file mode 100644 index 180cf03f7..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/DestinationDoesNotExistException.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * 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; - -import javax.jms.JMSException; - -/** - * An exception thrown on a send if a destination does not exist. - * Allows a network bridge to easily cherry-pick and ignore - * - */ -public class DestinationDoesNotExistException extends JMSException { - - public DestinationDoesNotExistException(String destination) { - super(destination); - } - - public boolean isTemporary() { - return getMessage().startsWith("temp-"); - } - - @Override - public String getLocalizedMessage() { - return "The destination " + getMessage() + " does not exist."; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/Disposable.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/Disposable.class deleted file mode 100644 index e9df950b1..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/Disposable.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/Disposable.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/Disposable.java deleted file mode 100644 index 8dc7bb0fc..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/Disposable.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * 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; - - -/** - * - */ -public interface Disposable { - - /** - */ - void dispose(); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/EnhancedConnection.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/EnhancedConnection.class deleted file mode 100644 index c7537c070..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/EnhancedConnection.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/EnhancedConnection.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/EnhancedConnection.java deleted file mode 100644 index d7a8a348b..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/EnhancedConnection.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * - * 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; - -import javax.jms.TopicConnection; -import javax.jms.QueueConnection; -import javax.jms.JMSException; - -import org.apache.activemq.advisory.DestinationSource; - -/** - * A set of enhanced APIs for a JMS provider - * - * - */ -public interface EnhancedConnection extends TopicConnection, QueueConnection, Closeable { - - /** - * Returns the {@link DestinationSource} object which can be used to listen to destinations - * being created or destroyed or to enquire about the current destinations available on the broker - * - * @return a lazily created destination source - * @throws JMSException - */ - DestinationSource getDestinationSource() throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/FifoMessageDispatchChannel.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/FifoMessageDispatchChannel.class deleted file mode 100644 index 67f250be7..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/FifoMessageDispatchChannel.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/FifoMessageDispatchChannel.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/FifoMessageDispatchChannel.java deleted file mode 100644 index 40fc5ab3f..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/FifoMessageDispatchChannel.java +++ /dev/null @@ -1,198 +0,0 @@ -/** - * 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; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import org.apache.activemq.command.MessageDispatch; - -public class FifoMessageDispatchChannel implements MessageDispatchChannel { - - private final Object mutex = new Object(); - private final LinkedList list; - private boolean closed; - private boolean running; - - public FifoMessageDispatchChannel() { - this.list = new LinkedList(); - } - - /* (non-Javadoc) - * @see org.apache.activemq.MessageDispatchChannelI#enqueue(org.apache.activemq.command.MessageDispatch) - */ - public void enqueue(MessageDispatch message) { - synchronized (mutex) { - list.addLast(message); - mutex.notify(); - } - } - - /* (non-Javadoc) - * @see org.apache.activemq.MessageDispatchChannelI#enqueueFirst(org.apache.activemq.command.MessageDispatch) - */ - public void enqueueFirst(MessageDispatch message) { - synchronized (mutex) { - list.addFirst(message); - mutex.notify(); - } - } - - /* (non-Javadoc) - * @see org.apache.activemq.MessageDispatchChannelI#isEmpty() - */ - public boolean isEmpty() { - synchronized (mutex) { - return list.isEmpty(); - } - } - - /* (non-Javadoc) - * @see org.apache.activemq.MessageDispatchChannelI#dequeue(long) - */ - public MessageDispatch dequeue(long timeout) throws InterruptedException { - synchronized (mutex) { - // Wait until the consumer is ready to deliver messages. - while (timeout != 0 && !closed && (list.isEmpty() || !running)) { - if (timeout == -1) { - mutex.wait(); - } else { - mutex.wait(timeout); - break; - } - } - if (closed || !running || list.isEmpty()) { - return null; - } - return list.removeFirst(); - } - } - - /* (non-Javadoc) - * @see org.apache.activemq.MessageDispatchChannelI#dequeueNoWait() - */ - public MessageDispatch dequeueNoWait() { - synchronized (mutex) { - if (closed || !running || list.isEmpty()) { - return null; - } - return list.removeFirst(); - } - } - - /* (non-Javadoc) - * @see org.apache.activemq.MessageDispatchChannelI#peek() - */ - public MessageDispatch peek() { - synchronized (mutex) { - if (closed || !running || list.isEmpty()) { - return null; - } - return list.getFirst(); - } - } - - /* (non-Javadoc) - * @see org.apache.activemq.MessageDispatchChannelI#start() - */ - public void start() { - synchronized (mutex) { - running = true; - mutex.notifyAll(); - } - } - - /* (non-Javadoc) - * @see org.apache.activemq.MessageDispatchChannelI#stop() - */ - public void stop() { - synchronized (mutex) { - running = false; - mutex.notifyAll(); - } - } - - /* (non-Javadoc) - * @see org.apache.activemq.MessageDispatchChannelI#close() - */ - public void close() { - synchronized (mutex) { - if (!closed) { - running = false; - closed = true; - } - mutex.notifyAll(); - } - } - - /* (non-Javadoc) - * @see org.apache.activemq.MessageDispatchChannelI#clear() - */ - public void clear() { - synchronized (mutex) { - list.clear(); - } - } - - /* (non-Javadoc) - * @see org.apache.activemq.MessageDispatchChannelI#isClosed() - */ - public boolean isClosed() { - return closed; - } - - /* (non-Javadoc) - * @see org.apache.activemq.MessageDispatchChannelI#size() - */ - public int size() { - synchronized (mutex) { - return list.size(); - } - } - - /* (non-Javadoc) - * @see org.apache.activemq.MessageDispatchChannelI#getMutex() - */ - public Object getMutex() { - return mutex; - } - - /* (non-Javadoc) - * @see org.apache.activemq.MessageDispatchChannelI#isRunning() - */ - public boolean isRunning() { - return running; - } - - /* (non-Javadoc) - * @see org.apache.activemq.MessageDispatchChannelI#removeAll() - */ - public List removeAll() { - synchronized (mutex) { - ArrayList rc = new ArrayList(list); - list.clear(); - return rc; - } - } - - @Override - public String toString() { - synchronized (mutex) { - return list.toString(); - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/LocalTransactionEventListener.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/LocalTransactionEventListener.class deleted file mode 100644 index eb9710c72..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/LocalTransactionEventListener.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/LocalTransactionEventListener.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/LocalTransactionEventListener.java deleted file mode 100644 index c4c69f2be..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/LocalTransactionEventListener.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * 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; - - -/** - * - */ -public interface LocalTransactionEventListener { - void beginEvent(); - - void commitEvent(); - - void rollbackEvent(); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/Message.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/Message.class deleted file mode 100644 index 8afe6b12a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/Message.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/Message.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/Message.java deleted file mode 100644 index e9d2358ec..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/Message.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * 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; - -/** - * Represents the JMS extension methods in Apache ActiveMQ - * - * - */ -public interface Message extends javax.jms.Message { - - /** - * Returns the MIME type of this mesage. This can be used in selectors to filter on - * the MIME types of the different JMS messages, or in the case of {@link org.apache.activemq.BlobMessage} - * it allows you to create a selector on the MIME type of the BLOB body - */ - String getJMSXMimeType(); - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/MessageAvailableConsumer.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/MessageAvailableConsumer.class deleted file mode 100644 index b8f1c9f7f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/MessageAvailableConsumer.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/MessageAvailableConsumer.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/MessageAvailableConsumer.java deleted file mode 100644 index 4e76b7127..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/MessageAvailableConsumer.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * 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; - -import javax.jms.MessageConsumer; - -/** - * An extended JMS interface that adds the ability to be notified when a - * message is available for consumption using the receive*() methods - * which is useful in Ajax style subscription models. - * - * - */ -public interface MessageAvailableConsumer extends MessageConsumer { - - /** - * Sets the listener used to notify synchronous consumers that there is a message - * available so that the {@link MessageConsumer#receiveNoWait()} can be called. - */ - void setAvailableListener(MessageAvailableListener availableListener); - - /** - * Gets the listener used to notify synchronous consumers that there is a message - * available so that the {@link MessageConsumer#receiveNoWait()} can be called. - */ - MessageAvailableListener getAvailableListener(); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/MessageAvailableListener.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/MessageAvailableListener.class deleted file mode 100644 index 57302e972..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/MessageAvailableListener.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/MessageAvailableListener.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/MessageAvailableListener.java deleted file mode 100644 index 7bf9ee297..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/MessageAvailableListener.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * 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; - -import javax.jms.MessageConsumer; - -/** - * A listener which is notified if a message is available for processing via the - * receive methods. Typically on receiving this notification you can call - * {@link MessageConsumer#receiveNoWait()} to get the new message immediately. - * - * Note that this notification just indicates a message is available for synchronous consumption, - * it does not actually consume the message. - * - * - */ -public interface MessageAvailableListener { - - void onMessageAvailable(MessageConsumer consumer); - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/MessageDispatchChannel.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/MessageDispatchChannel.class deleted file mode 100644 index 008dfe205..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/MessageDispatchChannel.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/MessageDispatchChannel.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/MessageDispatchChannel.java deleted file mode 100644 index d0354f327..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/MessageDispatchChannel.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * 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; - -import java.util.List; -import javax.jms.JMSException; -import org.apache.activemq.command.MessageDispatch; - -public interface MessageDispatchChannel { - - public abstract void enqueue(MessageDispatch message); - - public abstract void enqueueFirst(MessageDispatch message); - - public abstract boolean isEmpty(); - - /** - * Used to get an enqueued message. The amount of time this method blocks is - * based on the timeout value. - if timeout==-1 then it blocks until a - * message is received. - if timeout==0 then it it tries to not block at - * all, it returns a message if it is available - if timeout>0 then it - * blocks up to timeout amount of time. Expired messages will consumed by - * this method. - * - * @throws JMSException - * @return null if we timeout or if the consumer is closed. - * @throws InterruptedException - */ - public abstract MessageDispatch dequeue(long timeout) throws InterruptedException; - - public abstract MessageDispatch dequeueNoWait(); - - public abstract MessageDispatch peek(); - - public abstract void start(); - - public abstract void stop(); - - public abstract void close(); - - public abstract void clear(); - - public abstract boolean isClosed(); - - public abstract int size(); - - public abstract Object getMutex(); - - public abstract boolean isRunning(); - - public abstract List removeAll(); - -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/MessageTransformer.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/MessageTransformer.class deleted file mode 100644 index 6b983348e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/MessageTransformer.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/MessageTransformer.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/MessageTransformer.java deleted file mode 100644 index cf7e024ed..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/MessageTransformer.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * 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; - -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.MessageConsumer; -import javax.jms.MessageProducer; -import javax.jms.Session; - -/** - * A plugin strategy for transforming a message before it is sent by the JMS client or before it is - * dispatched to the JMS consumer - * - * - */ -public interface MessageTransformer { - - /** - * Transforms the given message inside the producer before it is sent to the JMS bus. - */ - Message producerTransform(Session session, MessageProducer producer, Message message) throws JMSException; - - /** - * Transforms the given message inside the consumer before being dispatched to the client code - */ - Message consumerTransform(Session session, MessageConsumer consumer, Message message)throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/MessageTransformerSupport.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/MessageTransformerSupport.class deleted file mode 100644 index b88f0f32d..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/MessageTransformerSupport.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/MessageTransformerSupport.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/MessageTransformerSupport.java deleted file mode 100644 index f1f998dbe..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/MessageTransformerSupport.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * 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; - -import javax.jms.JMSException; -import javax.jms.Message; - -/** - * A useful base class for message transformers. - * - * - */ -public abstract class MessageTransformerSupport implements MessageTransformer { - - /** - * Copies the standard JMS and user defined properties from the givem message to the specified message - * - * @param fromMessage the message to take the properties from - * @param toMesage the message to add the properties to - * @throws JMSException - */ - protected void copyProperties(Message fromMessage, Message toMesage) throws JMSException { - ActiveMQMessageTransformation.copyProperties(fromMessage, toMesage); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/NotStartedException.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/NotStartedException.class deleted file mode 100644 index 0c8e0f232..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/NotStartedException.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/NotStartedException.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/NotStartedException.java deleted file mode 100644 index 0d0a493f7..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/NotStartedException.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * 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; - -import javax.jms.IllegalStateException; - -/** - * An exception thrown when an operation is invoked on a service - * which has not yet been started. - * - * - */ -public class NotStartedException extends IllegalStateException { - - private static final long serialVersionUID = -4907909323529887659L; - - public NotStartedException() { - super("IllegalState: This service has not yet been started", "AMQ-1003"); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/RedeliveryPolicy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/RedeliveryPolicy.class deleted file mode 100644 index 8175c57b9..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/RedeliveryPolicy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/RedeliveryPolicy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/RedeliveryPolicy.java deleted file mode 100644 index c6824f7ae..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/RedeliveryPolicy.java +++ /dev/null @@ -1,163 +0,0 @@ -/** - * 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; - -import java.io.Serializable; -import java.util.Random; -import org.apache.activemq.filter.DestinationMapEntry; -import org.apache.activemq.util.IntrospectionSupport; - -/** - * Configuration options for a messageConsumer used to control how messages are re-delivered when they - * are rolled back. - * May be used server side on a per destination basis via the Broker RedeliveryPlugin - * - * @org.apache.xbean.XBean element="redeliveryPolicy" - * - */ -public class RedeliveryPolicy extends DestinationMapEntry implements Cloneable, Serializable { - - public static final int NO_MAXIMUM_REDELIVERIES = -1; - public static final int DEFAULT_MAXIMUM_REDELIVERIES = 6; - - private static Random randomNumberGenerator; - - // +/-15% for a 30% spread -cgs - protected double collisionAvoidanceFactor = 0.15d; - protected int maximumRedeliveries = DEFAULT_MAXIMUM_REDELIVERIES; - protected long maximumRedeliveryDelay = -1; - protected long initialRedeliveryDelay = 1000L; - protected boolean useCollisionAvoidance; - protected boolean useExponentialBackOff; - protected double backOffMultiplier = 5.0; - protected long redeliveryDelay = initialRedeliveryDelay; - - public RedeliveryPolicy() { - } - - public RedeliveryPolicy copy() { - try { - return (RedeliveryPolicy)clone(); - } catch (CloneNotSupportedException e) { - throw new RuntimeException("Could not clone: " + e, e); - } - } - - public double getBackOffMultiplier() { - return backOffMultiplier; - } - - public void setBackOffMultiplier(double backOffMultiplier) { - this.backOffMultiplier = backOffMultiplier; - } - - public short getCollisionAvoidancePercent() { - return (short)Math.round(collisionAvoidanceFactor * 100); - } - - public void setCollisionAvoidancePercent(short collisionAvoidancePercent) { - this.collisionAvoidanceFactor = collisionAvoidancePercent * 0.01d; - } - - public long getInitialRedeliveryDelay() { - return initialRedeliveryDelay; - } - - public void setInitialRedeliveryDelay(long initialRedeliveryDelay) { - this.initialRedeliveryDelay = initialRedeliveryDelay; - } - - public long getMaximumRedeliveryDelay() { - return maximumRedeliveryDelay; - } - - public void setMaximumRedeliveryDelay(long maximumRedeliveryDelay) { - this.maximumRedeliveryDelay = maximumRedeliveryDelay; - } - - public int getMaximumRedeliveries() { - return maximumRedeliveries; - } - - public void setMaximumRedeliveries(int maximumRedeliveries) { - this.maximumRedeliveries = maximumRedeliveries; - } - - public long getNextRedeliveryDelay(long previousDelay) { - long nextDelay; - - if (previousDelay == 0) { - nextDelay = redeliveryDelay; - } else if (useExponentialBackOff && backOffMultiplier > 1) { - nextDelay = (long) (previousDelay * backOffMultiplier); - if(maximumRedeliveryDelay != -1 && nextDelay > maximumRedeliveryDelay) { - // in case the user made max redelivery delay less than redelivery delay for some reason. - nextDelay = Math.max(maximumRedeliveryDelay, redeliveryDelay); - } - } else { - nextDelay = previousDelay; - } - - if (useCollisionAvoidance) { - /* - * First random determines +/-, second random determines how far to - * go in that direction. -cgs - */ - Random random = getRandomNumberGenerator(); - double variance = (random.nextBoolean() ? collisionAvoidanceFactor : -collisionAvoidanceFactor) * random.nextDouble(); - nextDelay += nextDelay * variance; - } - - return nextDelay; - } - - public boolean isUseCollisionAvoidance() { - return useCollisionAvoidance; - } - - public void setUseCollisionAvoidance(boolean useCollisionAvoidance) { - this.useCollisionAvoidance = useCollisionAvoidance; - } - - public boolean isUseExponentialBackOff() { - return useExponentialBackOff; - } - - public void setUseExponentialBackOff(boolean useExponentialBackOff) { - this.useExponentialBackOff = useExponentialBackOff; - } - - protected static synchronized Random getRandomNumberGenerator() { - if (randomNumberGenerator == null) { - randomNumberGenerator = new Random(); - } - return randomNumberGenerator; - } - - public void setRedeliveryDelay(long redeliveryDelay) { - this.redeliveryDelay = redeliveryDelay; - } - - public long getRedeliveryDelay() { - return redeliveryDelay; - } - - @Override - public String toString() { - return IntrospectionSupport.toString(this, DestinationMapEntry.class, null); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ScheduledMessage.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ScheduledMessage.class deleted file mode 100644 index 97c1ebba1..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ScheduledMessage.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ScheduledMessage.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ScheduledMessage.java deleted file mode 100644 index fb63d871e..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ScheduledMessage.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * 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; - -public interface ScheduledMessage { - /** - * The time in milliseconds that a message will wait before being scheduled to be - * delivered by the broker - */ - public static final String AMQ_SCHEDULED_DELAY = "AMQ_SCHEDULED_DELAY"; - /** - * The time in milliseconds to wait after the start time to wait before scheduling the message again - */ - public static final String AMQ_SCHEDULED_PERIOD = "AMQ_SCHEDULED_PERIOD"; - /** - * The number of times to repeat scheduling a message for delivery - */ - public static final String AMQ_SCHEDULED_REPEAT = "AMQ_SCHEDULED_REPEAT"; - /** - * Use a Cron tab entry to set the schedule - */ - public static final String AMQ_SCHEDULED_CRON = "AMQ_SCHEDULED_CRON"; - /** - * An Id that is assigned to a Scheduled Message, this value is only available once the - * Message is scheduled, Messages sent to the Browse Destination or delivered to the - * assigned Destination will have this value set. - */ - public static final String AMQ_SCHEDULED_ID = "scheduledJobId"; - - /** - * Special destination to send Message's to with an assigned "action" that the Scheduler - * should perform such as removing a message. - */ - public static final String AMQ_SCHEDULER_MANAGEMENT_DESTINATION = "ActiveMQ.Scheduler.Management"; - /** - * Used to specify that a some operation should be performed on the Scheduled Message, - * the Message must have an assigned Id for this action to be taken. - */ - public static final String AMQ_SCHEDULER_ACTION = "AMQ_SCHEDULER_ACTION"; - - /** - * Indicates that a browse of the Scheduled Messages is being requested. - */ - public static final String AMQ_SCHEDULER_ACTION_BROWSE = "BROWSE"; - /** - * Indicates that a Scheduled Message is to be remove from the Scheduler, the Id of - * the scheduled message must be set as a property in order for this action to have - * any effect. - */ - public static final String AMQ_SCHEDULER_ACTION_REMOVE = "REMOVE"; - /** - * Indicates that all scheduled Messages should be removed. - */ - public static final String AMQ_SCHEDULER_ACTION_REMOVEALL = "REMOVEALL"; - - /** - * A property that holds the beginning of the time interval that the specified action should - * be applied within. Maps to a long value that specified time in milliseconds since UTC. - */ - public static final String AMQ_SCHEDULER_ACTION_START_TIME = "ACTION_START_TIME"; - /** - * A property that holds the end of the time interval that the specified action should be - * applied within. Maps to a long value that specified time in milliseconds since UTC. - */ - public static final String AMQ_SCHEDULER_ACTION_END_TIME = "ACTION_END_TIME"; - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/Service.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/Service.class deleted file mode 100644 index c2aa4874f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/Service.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/Service.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/Service.java deleted file mode 100644 index 0d76a2d20..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/Service.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * 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; - - -/** - * The core lifecyle interface for ActiveMQ components. - * - * If there was a standard way to do so, it'd be good to register this - * interface with Spring so it treats the start/stop methods as those of - * {@link org.springframework.beans.factory.InitializingBean} - * and {@link org.springframework.beans.factory.DisposableBean} - * - * - */ -public interface Service { - - void start() throws Exception; - - void stop() throws Exception; - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/SimplePriorityMessageDispatchChannel.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/SimplePriorityMessageDispatchChannel.class deleted file mode 100644 index f0fab789e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/SimplePriorityMessageDispatchChannel.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/SimplePriorityMessageDispatchChannel.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/SimplePriorityMessageDispatchChannel.java deleted file mode 100644 index e1bbe45a4..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/SimplePriorityMessageDispatchChannel.java +++ /dev/null @@ -1,297 +0,0 @@ -/** - * 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; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -import org.apache.activemq.command.MessageDispatch; - -public class SimplePriorityMessageDispatchChannel implements MessageDispatchChannel { - private static final Integer MAX_PRIORITY = 10; - private final Object mutex = new Object(); - private final LinkedList[] lists; - private boolean closed; - private boolean running; - private int size = 0; - - @SuppressWarnings("unchecked") - public SimplePriorityMessageDispatchChannel() { - this.lists = new LinkedList[MAX_PRIORITY]; - for (int i = 0; i < MAX_PRIORITY; i++) { - lists[i] = new LinkedList(); - } - } - - /* - * (non-Javadoc) - * - * @see org.apache.activemq.MessageDispatchChannelI#enqueue(org.apache.activemq.command.MessageDispatch) - */ - @Override - public void enqueue(MessageDispatch message) { - synchronized (mutex) { - getList(message).addLast(message); - this.size++; - mutex.notify(); - } - } - - /* - * (non-Javadoc) - * - * @see org.apache.activemq.MessageDispatchChannelI#enqueueFirst(org.apache.activemq.command.MessageDispatch) - */ - @Override - public void enqueueFirst(MessageDispatch message) { - synchronized (mutex) { - getList(message).addFirst(message); - this.size++; - mutex.notify(); - } - } - - /* - * (non-Javadoc) - * - * @see org.apache.activemq.MessageDispatchChannelI#isEmpty() - */ - @Override - public boolean isEmpty() { - return this.size == 0; - } - - /* - * (non-Javadoc) - * - * @see org.apache.activemq.MessageDispatchChannelI#dequeue(long) - */ - @Override - public MessageDispatch dequeue(long timeout) throws InterruptedException { - synchronized (mutex) { - // Wait until the consumer is ready to deliver messages. - while (timeout != 0 && !closed && (isEmpty() || !running)) { - if (timeout == -1) { - mutex.wait(); - } else { - mutex.wait(timeout); - break; - } - } - if (closed || !running || isEmpty()) { - return null; - } - return removeFirst(); - } - } - - /* - * (non-Javadoc) - * - * @see org.apache.activemq.MessageDispatchChannelI#dequeueNoWait() - */ - @Override - public MessageDispatch dequeueNoWait() { - synchronized (mutex) { - if (closed || !running || isEmpty()) { - return null; - } - return removeFirst(); - } - } - - /* - * (non-Javadoc) - * - * @see org.apache.activemq.MessageDispatchChannelI#peek() - */ - @Override - public MessageDispatch peek() { - synchronized (mutex) { - if (closed || !running || isEmpty()) { - return null; - } - return getFirst(); - } - } - - /* - * (non-Javadoc) - * - * @see org.apache.activemq.MessageDispatchChannelI#start() - */ - @Override - public void start() { - synchronized (mutex) { - running = true; - mutex.notifyAll(); - } - } - - /* - * (non-Javadoc) - * - * @see org.apache.activemq.MessageDispatchChannelI#stop() - */ - @Override - public void stop() { - synchronized (mutex) { - running = false; - mutex.notifyAll(); - } - } - - /* - * (non-Javadoc) - * - * @see org.apache.activemq.MessageDispatchChannelI#close() - */ - @Override - public void close() { - synchronized (mutex) { - if (!closed) { - running = false; - closed = true; - } - mutex.notifyAll(); - } - } - - /* - * (non-Javadoc) - * - * @see org.apache.activemq.MessageDispatchChannelI#clear() - */ - @Override - public void clear() { - synchronized (mutex) { - for (int i = 0; i < MAX_PRIORITY; i++) { - lists[i].clear(); - } - this.size = 0; - } - } - - /* - * (non-Javadoc) - * - * @see org.apache.activemq.MessageDispatchChannelI#isClosed() - */ - @Override - public boolean isClosed() { - return closed; - } - - /* - * (non-Javadoc) - * - * @see org.apache.activemq.MessageDispatchChannelI#size() - */ - @Override - public int size() { - synchronized (mutex) { - return this.size; - } - } - - /* - * (non-Javadoc) - * - * @see org.apache.activemq.MessageDispatchChannelI#getMutex() - */ - @Override - public Object getMutex() { - return mutex; - } - - /* - * (non-Javadoc) - * - * @see org.apache.activemq.MessageDispatchChannelI#isRunning() - */ - @Override - public boolean isRunning() { - return running; - } - - /* - * (non-Javadoc) - * - * @see org.apache.activemq.MessageDispatchChannelI#removeAll() - */ - @Override - public List removeAll() { - synchronized (mutex) { - ArrayList result = new ArrayList(size()); - for (int i = MAX_PRIORITY - 1; i >= 0; i--) { - List list = lists[i]; - result.addAll(list); - size -= list.size(); - list.clear(); - } - return result; - } - } - - @Override - public String toString() { - String result = ""; - for (int i = MAX_PRIORITY - 1; i >= 0; i--) { - result += i + ":{" + lists[i].toString() + "}"; - } - return result; - } - - protected int getPriority(MessageDispatch message) { - int priority = javax.jms.Message.DEFAULT_PRIORITY; - if (message.getMessage() != null) { - priority = Math.max(message.getMessage().getPriority(), 0); - priority = Math.min(priority, 9); - } - return priority; - } - - protected LinkedList getList(MessageDispatch md) { - return lists[getPriority(md)]; - } - - private final MessageDispatch removeFirst() { - if (this.size > 0) { - for (int i = MAX_PRIORITY - 1; i >= 0; i--) { - LinkedList list = lists[i]; - if (!list.isEmpty()) { - this.size--; - return list.removeFirst(); - } - } - } - return null; - } - - private final MessageDispatch getFirst() { - if (this.size > 0) { - for (int i = MAX_PRIORITY - 1; i >= 0; i--) { - LinkedList list = lists[i]; - if (!list.isEmpty()) { - return list.getFirst(); - } - } - } - return null; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/StreamConnection.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/StreamConnection.class deleted file mode 100644 index 8b7c9875e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/StreamConnection.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/StreamConnection.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/StreamConnection.java deleted file mode 100644 index 368471940..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/StreamConnection.java +++ /dev/null @@ -1,79 +0,0 @@ -/** - * 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; - -import java.io.InputStream; -import java.io.OutputStream; -import java.util.Map; - -import javax.jms.Connection; -import javax.jms.Destination; -import javax.jms.InvalidDestinationException; -import javax.jms.JMSException; -import javax.jms.Topic; - -/** - * The StreamConnection interface allows you to send and receive data from a - * Destination in using standard java InputStream and OutputStream objects. It's - * best use case is to send and receive large amounts of data that would be to - * large to hold in a single JMS message. - * - * - */ -public interface StreamConnection extends Connection { - - InputStream createInputStream(Destination dest) throws JMSException; - - InputStream createInputStream(Destination dest, String messageSelector) throws JMSException; - - InputStream createInputStream(Destination dest, String messageSelector, boolean noLocal) throws JMSException; - - InputStream createInputStream(Destination dest, String messageSelector, boolean noLocal, long timeout) throws JMSException; - - InputStream createDurableInputStream(Topic dest, String name) throws JMSException; - - InputStream createDurableInputStream(Topic dest, String name, String messageSelector) throws JMSException; - - InputStream createDurableInputStream(Topic dest, String name, String messageSelector, boolean noLocal) throws JMSException; - - InputStream createDurableInputStream(Topic dest, String name, String messageSelector, boolean noLocal, long timeout) throws JMSException; - - OutputStream createOutputStream(Destination dest) throws JMSException; - - OutputStream createOutputStream(Destination dest, Map streamProperties, int deliveryMode, int priority, long timeToLive) throws JMSException; - - /** - * Unsubscribes a durable subscription that has been created by a client. - *

    - * This method deletes the state being maintained on behalf of the - * subscriber by its provider. - *

    - * It is erroneous for a client to delete a durable subscription while there - * is an active MessageConsumer or - * TopicSubscriber for the subscription, or while a consumed - * message is part of a pending transaction or has not been acknowledged in - * the session. - * - * @param name the name used to identify this subscription - * @throws JMSException if the session fails to unsubscribe to the durable - * subscription due to some internal error. - * @throws InvalidDestinationException if an invalid subscription name is - * specified. - * @since 1.1 - */ - void unsubscribe(String name) throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ThreadPriorities.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ThreadPriorities.class deleted file mode 100644 index 132463fc2..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ThreadPriorities.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ThreadPriorities.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ThreadPriorities.java deleted file mode 100644 index d15fff5d8..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/ThreadPriorities.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * 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; - - -/** -* A holder for different thread priorites used in ActiveMQ -* -* -*/ - -public interface ThreadPriorities { - int INBOUND_BROKER_CONNECTION = 6; - int OUT_BOUND_BROKER_DISPATCH = 6; - int INBOUND_CLIENT_CONNECTION = 7; - int INBOUND_CLIENT_SESSION = 7; - int BROKER_MANAGEMENT = 9; -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/TransactionContext.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/TransactionContext.class deleted file mode 100644 index 65d9ce427..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/TransactionContext.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/TransactionContext.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/TransactionContext.java deleted file mode 100644 index 7ff87028f..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/TransactionContext.java +++ /dev/null @@ -1,814 +0,0 @@ -/** - * 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; - -import java.io.InterruptedIOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; - -import javax.jms.JMSException; -import javax.jms.TransactionInProgressException; -import javax.jms.TransactionRolledBackException; -import javax.transaction.xa.XAException; -import javax.transaction.xa.XAResource; -import javax.transaction.xa.Xid; - -import org.apache.activemq.command.Command; -import org.apache.activemq.command.ConnectionId; -import org.apache.activemq.command.DataArrayResponse; -import org.apache.activemq.command.DataStructure; -import org.apache.activemq.command.IntegerResponse; -import org.apache.activemq.command.LocalTransactionId; -import org.apache.activemq.command.Response; -import org.apache.activemq.command.TransactionId; -import org.apache.activemq.command.TransactionInfo; -import org.apache.activemq.command.XATransactionId; -import org.apache.activemq.transaction.Synchronization; -import org.apache.activemq.util.JMSExceptionSupport; -import org.apache.activemq.util.LongSequenceGenerator; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * A TransactionContext provides the means to control a JMS transaction. It - * provides a local transaction interface and also an XAResource interface.

    - * An application server controls the transactional assignment of an XASession - * by obtaining its XAResource. It uses the XAResource to assign the session to - * a transaction, prepare and commit work on the transaction, and so on.

    An - * XAResource provides some fairly sophisticated facilities for interleaving - * work on multiple transactions, recovering a list of transactions in progress, - * and so on. A JTA aware JMS provider must fully implement this functionality. - * This could be done by using the services of a database that supports XA, or a - * JMS provider may choose to implement this functionality from scratch.

    - * - * - * @see javax.jms.Session - * @see javax.jms.QueueSession - * @see javax.jms.TopicSession - * @see javax.jms.XASession - */ -public class TransactionContext implements XAResource { - - private static final Logger LOG = LoggerFactory.getLogger(TransactionContext.class); - - // XATransactionId -> ArrayList of TransactionContext objects - private final static HashMap> ENDED_XA_TRANSACTION_CONTEXTS = - new HashMap>(); - - private final ActiveMQConnection connection; - private final LongSequenceGenerator localTransactionIdGenerator; - private final ConnectionId connectionId; - private List synchronizations; - - // To track XA transactions. - private Xid associatedXid; - private TransactionId transactionId; - private LocalTransactionEventListener localTransactionEventListener; - private int beforeEndIndex; - - public TransactionContext(ActiveMQConnection connection) { - this.connection = connection; - this.localTransactionIdGenerator = connection.getLocalTransactionIdGenerator(); - this.connectionId = connection.getConnectionInfo().getConnectionId(); - } - - public boolean isInXATransaction() { - if (transactionId != null && transactionId.isXATransaction()) { - return true; - } else { - if (!ENDED_XA_TRANSACTION_CONTEXTS.isEmpty()) { - synchronized(ENDED_XA_TRANSACTION_CONTEXTS) { - for(List transactions : ENDED_XA_TRANSACTION_CONTEXTS.values()) { - if (transactions.contains(this)) { - return true; - } - } - } - } - } - - return false; - } - - public boolean isInLocalTransaction() { - return transactionId != null && transactionId.isLocalTransaction(); - } - - public boolean isInTransaction() { - return transactionId != null; - } - - /** - * @return Returns the localTransactionEventListener. - */ - public LocalTransactionEventListener getLocalTransactionEventListener() { - return localTransactionEventListener; - } - - /** - * Used by the resource adapter to listen to transaction events. - * - * @param localTransactionEventListener The localTransactionEventListener to - * set. - */ - public void setLocalTransactionEventListener(LocalTransactionEventListener localTransactionEventListener) { - this.localTransactionEventListener = localTransactionEventListener; - } - - // /////////////////////////////////////////////////////////// - // - // Methods that work with the Synchronization objects registered with - // the transaction. - // - // /////////////////////////////////////////////////////////// - - public void addSynchronization(Synchronization s) { - if (synchronizations == null) { - synchronizations = new ArrayList(10); - } - synchronizations.add(s); - } - - private void afterRollback() throws JMSException { - if (synchronizations == null) { - return; - } - - Throwable firstException = null; - int size = synchronizations.size(); - for (int i = 0; i < size; i++) { - try { - synchronizations.get(i).afterRollback(); - } catch (Throwable t) { - LOG.debug("Exception from afterRollback on " + synchronizations.get(i), t); - if (firstException == null) { - firstException = t; - } - } - } - synchronizations = null; - if (firstException != null) { - throw JMSExceptionSupport.create(firstException); - } - } - - private void afterCommit() throws JMSException { - if (synchronizations == null) { - return; - } - - Throwable firstException = null; - int size = synchronizations.size(); - for (int i = 0; i < size; i++) { - try { - synchronizations.get(i).afterCommit(); - } catch (Throwable t) { - LOG.debug("Exception from afterCommit on " + synchronizations.get(i), t); - if (firstException == null) { - firstException = t; - } - } - } - synchronizations = null; - if (firstException != null) { - throw JMSExceptionSupport.create(firstException); - } - } - - private void beforeEnd() throws JMSException { - if (synchronizations == null) { - return; - } - - int size = synchronizations.size(); - try { - for (;beforeEndIndex < size;) { - synchronizations.get(beforeEndIndex++).beforeEnd(); - } - } catch (JMSException e) { - throw e; - } catch (Throwable e) { - throw JMSExceptionSupport.create(e); - } - } - - public TransactionId getTransactionId() { - return transactionId; - } - - // /////////////////////////////////////////////////////////// - // - // Local transaction interface. - // - // /////////////////////////////////////////////////////////// - - /** - * Start a local transaction. - * @throws javax.jms.JMSException on internal error - */ - public void begin() throws JMSException { - - if (isInXATransaction()) { - throw new TransactionInProgressException("Cannot start local transaction. XA transaction is already in progress."); - } - - if (transactionId == null) { - synchronizations = null; - beforeEndIndex = 0; - this.transactionId = new LocalTransactionId(connectionId, localTransactionIdGenerator.getNextSequenceId()); - TransactionInfo info = new TransactionInfo(getConnectionId(), transactionId, TransactionInfo.BEGIN); - this.connection.ensureConnectionInfoSent(); - this.connection.asyncSendPacket(info); - - // Notify the listener that the tx was started. - if (localTransactionEventListener != null) { - localTransactionEventListener.beginEvent(); - } - if (LOG.isDebugEnabled()) { - LOG.debug("Begin:" + transactionId); - } - } - - } - - /** - * Rolls back any work done in this transaction and releases any locks - * currently held. - * - * @throws JMSException if the JMS provider fails to roll back the - * transaction due to some internal error. - * @throws javax.jms.IllegalStateException if the method is not called by a - * transacted session. - */ - public void rollback() throws JMSException { - if (isInXATransaction()) { - throw new TransactionInProgressException("Cannot rollback() if an XA transaction is already in progress "); - } - - try { - beforeEnd(); - } catch (TransactionRolledBackException canOcurrOnFailover) { - LOG.warn("rollback processing error", canOcurrOnFailover); - } - if (transactionId != null) { - if (LOG.isDebugEnabled()) { - LOG.debug("Rollback: " + transactionId - + " syncCount: " - + (synchronizations != null ? synchronizations.size() : 0)); - } - - TransactionInfo info = new TransactionInfo(getConnectionId(), transactionId, TransactionInfo.ROLLBACK); - this.transactionId = null; - //make this synchronous - see https://issues.apache.org/activemq/browse/AMQ-2364 - this.connection.syncSendPacket(info); - // Notify the listener that the tx was rolled back - if (localTransactionEventListener != null) { - localTransactionEventListener.rollbackEvent(); - } - } - - afterRollback(); - } - - /** - * Commits all work done in this transaction and releases any locks - * currently held. - * - * @throws JMSException if the JMS provider fails to commit the transaction - * due to some internal error. - * @throws javax.jms.IllegalStateException if the method is not called by a - * transacted session. - */ - public void commit() throws JMSException { - if (isInXATransaction()) { - throw new TransactionInProgressException("Cannot commit() if an XA transaction is already in progress "); - } - - try { - beforeEnd(); - } catch (JMSException e) { - rollback(); - throw e; - } - - // Only send commit if the transaction was started. - if (transactionId != null) { - if (LOG.isDebugEnabled()) { - LOG.debug("Commit: " + transactionId - + " syncCount: " - + (synchronizations != null ? synchronizations.size() : 0)); - } - - TransactionInfo info = new TransactionInfo(getConnectionId(), transactionId, TransactionInfo.COMMIT_ONE_PHASE); - this.transactionId = null; - // Notify the listener that the tx was committed back - try { - syncSendPacketWithInterruptionHandling(info); - if (localTransactionEventListener != null) { - localTransactionEventListener.commitEvent(); - } - afterCommit(); - } catch (JMSException cause) { - LOG.info("commit failed for transaction " + info.getTransactionId(), cause); - if (localTransactionEventListener != null) { - localTransactionEventListener.rollbackEvent(); - } - afterRollback(); - throw cause; - } - - } - } - - // /////////////////////////////////////////////////////////// - // - // XAResource Implementation - // - // /////////////////////////////////////////////////////////// - /** - * Associates a transaction with the resource. - */ - public void start(Xid xid, int flags) throws XAException { - - if (LOG.isDebugEnabled()) { - LOG.debug("Start: " + xid); - } - if (isInLocalTransaction()) { - throw new XAException(XAException.XAER_PROTO); - } - // Are we already associated? - if (associatedXid != null) { - throw new XAException(XAException.XAER_PROTO); - } - - // if ((flags & TMJOIN) == TMJOIN) { - // TODO: verify that the server has seen the xid - // // } - // if ((flags & TMJOIN) == TMRESUME) { - // // TODO: verify that the xid was suspended. - // } - - // associate - synchronizations = null; - beforeEndIndex = 0; - setXid(xid); - } - - /** - * @return connectionId for connection - */ - private ConnectionId getConnectionId() { - return connection.getConnectionInfo().getConnectionId(); - } - - public void end(Xid xid, int flags) throws XAException { - - if (LOG.isDebugEnabled()) { - LOG.debug("End: " + xid); - } - - if (isInLocalTransaction()) { - throw new XAException(XAException.XAER_PROTO); - } - - if ((flags & (TMSUSPEND | TMFAIL)) != 0) { - // You can only suspend the associated xid. - if (!equals(associatedXid, xid)) { - throw new XAException(XAException.XAER_PROTO); - } - - // TODO: we may want to put the xid in a suspended list. - try { - beforeEnd(); - } catch (JMSException e) { - throw toXAException(e); - } finally { - setXid(null); - } - } else if ((flags & TMSUCCESS) == TMSUCCESS) { - // set to null if this is the current xid. - // otherwise this could be an asynchronous success call - if (equals(associatedXid, xid)) { - try { - beforeEnd(); - } catch (JMSException e) { - throw toXAException(e); - } finally { - setXid(null); - } - } - } else { - throw new XAException(XAException.XAER_INVAL); - } - } - - private boolean equals(Xid xid1, Xid xid2) { - if (xid1 == xid2) { - return true; - } - if (xid1 == null ^ xid2 == null) { - return false; - } - return xid1.getFormatId() == xid2.getFormatId() && Arrays.equals(xid1.getBranchQualifier(), xid2.getBranchQualifier()) - && Arrays.equals(xid1.getGlobalTransactionId(), xid2.getGlobalTransactionId()); - } - - public int prepare(Xid xid) throws XAException { - if (LOG.isDebugEnabled()) { - LOG.debug("Prepare: " + xid); - } - - // We allow interleaving multiple transactions, so - // we don't limit prepare to the associated xid. - XATransactionId x; - // THIS SHOULD NEVER HAPPEN because end(xid, TMSUCCESS) should have been - // called first - if (xid == null || (equals(associatedXid, xid))) { - throw new XAException(XAException.XAER_PROTO); - } else { - // TODO: cache the known xids so we don't keep recreating this one?? - x = new XATransactionId(xid); - } - - try { - TransactionInfo info = new TransactionInfo(getConnectionId(), x, TransactionInfo.PREPARE); - - // Find out if the server wants to commit or rollback. - IntegerResponse response = (IntegerResponse)syncSendPacketWithInterruptionHandling(info); - if (XAResource.XA_RDONLY == response.getResult()) { - // transaction stops now, may be syncs that need a callback - synchronized(ENDED_XA_TRANSACTION_CONTEXTS) { - List l = ENDED_XA_TRANSACTION_CONTEXTS.remove(x); - if (l != null && !l.isEmpty()) { - if (LOG.isDebugEnabled()) { - LOG.debug("firing afterCommit callbacks on XA_RDONLY from prepare: " + xid); - } - for (TransactionContext ctx : l) { - ctx.afterCommit(); - } - } - } - } - return response.getResult(); - - } catch (JMSException e) { - LOG.warn("prepare of: " + x + " failed with: " + e, e); - synchronized(ENDED_XA_TRANSACTION_CONTEXTS) { - List l = ENDED_XA_TRANSACTION_CONTEXTS.remove(x); - if (l != null && !l.isEmpty()) { - for (TransactionContext ctx : l) { - try { - ctx.afterRollback(); - } catch (Throwable ignored) { - if (LOG.isDebugEnabled()) { - LOG.debug("failed to firing afterRollback callbacks on prepare failure, txid: " + - x + ", context: " + ctx, ignored); - } - } - } - } - } - throw toXAException(e); - } - } - - public void rollback(Xid xid) throws XAException { - - if (LOG.isDebugEnabled()) { - LOG.debug("Rollback: " + xid); - } - - // We allow interleaving multiple transactions, so - // we don't limit rollback to the associated xid. - XATransactionId x; - if (xid == null) { - throw new XAException(XAException.XAER_PROTO); - } - if (equals(associatedXid, xid)) { - // I think this can happen even without an end(xid) call. Need to - // check spec. - x = (XATransactionId)transactionId; - } else { - x = new XATransactionId(xid); - } - - try { - this.connection.checkClosedOrFailed(); - this.connection.ensureConnectionInfoSent(); - - // Let the server know that the tx is rollback. - TransactionInfo info = new TransactionInfo(getConnectionId(), x, TransactionInfo.ROLLBACK); - syncSendPacketWithInterruptionHandling(info); - - synchronized(ENDED_XA_TRANSACTION_CONTEXTS) { - List l = ENDED_XA_TRANSACTION_CONTEXTS.remove(x); - if (l != null && !l.isEmpty()) { - for (TransactionContext ctx : l) { - ctx.afterRollback(); - } - } - } - } catch (JMSException e) { - throw toXAException(e); - } - } - - // XAResource interface - public void commit(Xid xid, boolean onePhase) throws XAException { - - if (LOG.isDebugEnabled()) { - LOG.debug("Commit: " + xid + ", onePhase=" + onePhase); - } - - // We allow interleaving multiple transactions, so - // we don't limit commit to the associated xid. - XATransactionId x; - if (xid == null || (equals(associatedXid, xid))) { - // should never happen, end(xid,TMSUCCESS) must have been previously - // called - throw new XAException(XAException.XAER_PROTO); - } else { - x = new XATransactionId(xid); - } - - try { - this.connection.checkClosedOrFailed(); - this.connection.ensureConnectionInfoSent(); - - // Notify the server that the tx was committed back - TransactionInfo info = new TransactionInfo(getConnectionId(), x, onePhase ? TransactionInfo.COMMIT_ONE_PHASE : TransactionInfo.COMMIT_TWO_PHASE); - - syncSendPacketWithInterruptionHandling(info); - - synchronized(ENDED_XA_TRANSACTION_CONTEXTS) { - List l = ENDED_XA_TRANSACTION_CONTEXTS.remove(x); - if (l != null && !l.isEmpty()) { - for (TransactionContext ctx : l) { - try { - ctx.afterCommit(); - } catch (Exception ignored) { - LOG.debug("ignoring exception from after completion on ended transaction: " + ignored, ignored); - } - } - } - } - - } catch (JMSException e) { - LOG.warn("commit of: " + x + " failed with: " + e, e); - if (onePhase) { - synchronized(ENDED_XA_TRANSACTION_CONTEXTS) { - List l = ENDED_XA_TRANSACTION_CONTEXTS.remove(x); - if (l != null && !l.isEmpty()) { - for (TransactionContext ctx : l) { - try { - ctx.afterRollback(); - } catch (Throwable ignored) { - if (LOG.isDebugEnabled()) { - LOG.debug("failed to firing afterRollback callbacks commit failure, txid: " + x + ", context: " + ctx, ignored); - } - } - } - } - } - } - throw toXAException(e); - } - - } - - public void forget(Xid xid) throws XAException { - if (LOG.isDebugEnabled()) { - LOG.debug("Forget: " + xid); - } - - // We allow interleaving multiple transactions, so - // we don't limit forget to the associated xid. - XATransactionId x; - if (xid == null) { - throw new XAException(XAException.XAER_PROTO); - } - if (equals(associatedXid, xid)) { - // TODO determine if this can happen... I think not. - x = (XATransactionId)transactionId; - } else { - x = new XATransactionId(xid); - } - - TransactionInfo info = new TransactionInfo(getConnectionId(), x, TransactionInfo.FORGET); - - try { - // Tell the server to forget the transaction. - syncSendPacketWithInterruptionHandling(info); - } catch (JMSException e) { - throw toXAException(e); - } - synchronized(ENDED_XA_TRANSACTION_CONTEXTS) { - ENDED_XA_TRANSACTION_CONTEXTS.remove(x); - } - } - - public boolean isSameRM(XAResource xaResource) throws XAException { - if (xaResource == null) { - return false; - } - if (!(xaResource instanceof TransactionContext)) { - return false; - } - TransactionContext xar = (TransactionContext)xaResource; - try { - return getResourceManagerId().equals(xar.getResourceManagerId()); - } catch (Throwable e) { - throw (XAException)new XAException("Could not get resource manager id.").initCause(e); - } - } - - public Xid[] recover(int flag) throws XAException { - if (LOG.isDebugEnabled()) { - LOG.debug("Recover: " + flag); - } - - TransactionInfo info = new TransactionInfo(getConnectionId(), null, TransactionInfo.RECOVER); - try { - this.connection.checkClosedOrFailed(); - this.connection.ensureConnectionInfoSent(); - - DataArrayResponse receipt = (DataArrayResponse)this.connection.syncSendPacket(info); - DataStructure[] data = receipt.getData(); - XATransactionId[] answer; - if (data instanceof XATransactionId[]) { - answer = (XATransactionId[])data; - } else { - answer = new XATransactionId[data.length]; - System.arraycopy(data, 0, answer, 0, data.length); - } - return answer; - } catch (JMSException e) { - throw toXAException(e); - } - } - - public int getTransactionTimeout() throws XAException { - return 0; - } - - public boolean setTransactionTimeout(int seconds) throws XAException { - return false; - } - - // /////////////////////////////////////////////////////////// - // - // Helper methods. - // - // /////////////////////////////////////////////////////////// - private String getResourceManagerId() throws JMSException { - return this.connection.getResourceManagerId(); - } - - private void setXid(Xid xid) throws XAException { - - try { - this.connection.checkClosedOrFailed(); - this.connection.ensureConnectionInfoSent(); - } catch (JMSException e) { - disassociate(); - throw toXAException(e); - } - - if (xid != null) { - // associate - associatedXid = xid; - transactionId = new XATransactionId(xid); - - TransactionInfo info = new TransactionInfo(connectionId, transactionId, TransactionInfo.BEGIN); - try { - this.connection.asyncSendPacket(info); - if (LOG.isDebugEnabled()) { - LOG.debug("Started XA transaction: " + transactionId); - } - } catch (JMSException e) { - disassociate(); - throw toXAException(e); - } - - } else { - - if (transactionId != null) { - TransactionInfo info = new TransactionInfo(connectionId, transactionId, TransactionInfo.END); - try { - syncSendPacketWithInterruptionHandling(info); - if (LOG.isDebugEnabled()) { - LOG.debug("Ended XA transaction: " + transactionId); - } - } catch (JMSException e) { - disassociate(); - throw toXAException(e); - } - - // Add our self to the list of contexts that are interested in - // post commit/rollback events. - synchronized(ENDED_XA_TRANSACTION_CONTEXTS) { - List l = ENDED_XA_TRANSACTION_CONTEXTS.get(transactionId); - if (l == null) { - l = new ArrayList(3); - ENDED_XA_TRANSACTION_CONTEXTS.put(transactionId, l); - l.add(this); - } else if (!l.contains(this)) { - l.add(this); - } - } - } - - disassociate(); - } - } - - private void disassociate() { - // dis-associate - associatedXid = null; - transactionId = null; - } - - /** - * Sends the given command. Also sends the command in case of interruption, - * so that important commands like rollback and commit are never interrupted. - * If interruption occurred, set the interruption state of the current - * after performing the action again. - * - * @return the response - */ - private Response syncSendPacketWithInterruptionHandling(Command command) throws JMSException { - try { - return this.connection.syncSendPacket(command); - } catch (JMSException e) { - if (e.getLinkedException() instanceof InterruptedIOException) { - try { - Thread.interrupted(); - return this.connection.syncSendPacket(command); - } finally { - Thread.currentThread().interrupt(); - } - } - - throw e; - } - } - - /** - * Converts a JMSException from the server to an XAException. if the - * JMSException contained a linked XAException that is returned instead. - * - * @param e JMSException to convert - * @return XAException wrapping original exception or its message - */ - private XAException toXAException(JMSException e) { - if (e.getCause() != null && e.getCause() instanceof XAException) { - XAException original = (XAException)e.getCause(); - XAException xae = new XAException(original.getMessage()); - xae.errorCode = original.errorCode; - if (xae.errorCode == XA_OK) { - // detail not unmarshalled see: org.apache.activemq.openwire.v1.BaseDataStreamMarshaller.createThrowable - // so use a valid generic error code in place of ok - xae.errorCode = XAException.XAER_RMERR; - } - xae.initCause(original); - return xae; - } - - XAException xae = new XAException(e.getMessage()); - xae.errorCode = XAException.XAER_RMFAIL; - xae.initCause(e); - return xae; - } - - public ActiveMQConnection getConnection() { - return connection; - } - - public void cleanup() { - associatedXid = null; - transactionId = null; - } - - @Override - public String toString() { - return "TransactionContext{" + - "transactionId=" + transactionId + - '}'; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/TransportLoggerSupport$SPI.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/TransportLoggerSupport$SPI.class deleted file mode 100644 index f392d1370..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/TransportLoggerSupport$SPI.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/TransportLoggerSupport.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/TransportLoggerSupport.class deleted file mode 100644 index 78b6d8b96..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/TransportLoggerSupport.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/TransportLoggerSupport.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/TransportLoggerSupport.java deleted file mode 100644 index 2a4e60069..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/TransportLoggerSupport.java +++ /dev/null @@ -1,62 +0,0 @@ -/** - * 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; - -import org.apache.activemq.transport.Transport; - -import java.io.IOException; - -/** - * @author Hiram Chirino - */ -public class TransportLoggerSupport { - - public static String defaultLogWriterName = "default"; - - public static interface SPI { - public Transport createTransportLogger(Transport transport) throws IOException; - public Transport createTransportLogger(Transport transport, String logWriterName, boolean dynamicManagement, boolean startLogging, int jmxPort) throws IOException; - } - - final static public SPI spi; - static { - SPI temp; - try { - temp = (SPI) TransportLoggerSupport.class.getClassLoader().loadClass("org.apache.activemq.transport.TransportLoggerFactorySPI").newInstance(); - } catch (Throwable e) { - temp = null; - } - spi = temp; - } - - public static Transport createTransportLogger(Transport transport) throws IOException { - if( spi!=null ) { - return spi.createTransportLogger(transport); - } else { - return transport; - } - } - - public static Transport createTransportLogger(Transport transport, String logWriterName, boolean dynamicManagement, boolean startLogging, int jmxPort) throws IOException { - if( spi!=null ) { - return spi.createTransportLogger(transport, logWriterName, dynamicManagement, startLogging, jmxPort); - } else { - return transport; - } - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/AdvisoryBroker.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/AdvisoryBroker.class deleted file mode 100644 index 751749ce9..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/AdvisoryBroker.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/AdvisoryBroker.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/AdvisoryBroker.java deleted file mode 100644 index d68c5bd7a..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/AdvisoryBroker.java +++ /dev/null @@ -1,607 +0,0 @@ -/** - * 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.advisory; - -import java.util.Comparator; -import java.util.Iterator; -import java.util.Map; -import java.util.Queue; -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentLinkedQueue; -import java.util.concurrent.ConcurrentSkipListMap; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.BrokerFilter; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.ProducerBrokerExchange; -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.DurableTopicSubscription; -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.broker.region.RegionBroker; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.broker.region.TopicRegion; -import org.apache.activemq.broker.region.TopicSubscription; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ActiveMQMessage; -import org.apache.activemq.command.ActiveMQTopic; -import org.apache.activemq.command.BrokerInfo; -import org.apache.activemq.command.Command; -import org.apache.activemq.command.ConnectionId; -import org.apache.activemq.command.ConnectionInfo; -import org.apache.activemq.command.ConsumerId; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.command.DestinationInfo; -import org.apache.activemq.command.Message; -import org.apache.activemq.command.MessageId; -import org.apache.activemq.command.ProducerId; -import org.apache.activemq.command.ProducerInfo; -import org.apache.activemq.command.RemoveSubscriptionInfo; -import org.apache.activemq.security.SecurityContext; -import org.apache.activemq.state.ProducerState; -import org.apache.activemq.usage.Usage; -import org.apache.activemq.util.IdGenerator; -import org.apache.activemq.util.LongSequenceGenerator; -import org.apache.activemq.util.SubscriptionKey; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * This broker filter handles tracking the state of the broker for purposes of - * publishing advisory messages to advisory consumers. - */ -public class AdvisoryBroker extends BrokerFilter { - - private static final Logger LOG = LoggerFactory.getLogger(AdvisoryBroker.class); - private static final IdGenerator ID_GENERATOR = new IdGenerator(); - - protected final ConcurrentHashMap connections = new ConcurrentHashMap(); - - protected final Queue consumers = new ConcurrentLinkedQueue(); - - protected final ConcurrentHashMap producers = new ConcurrentHashMap(); - protected final ConcurrentHashMap destinations = new ConcurrentHashMap(); - protected final ConcurrentHashMap networkBridges = new ConcurrentHashMap(); - protected final ProducerId advisoryProducerId = new ProducerId(); - - private final LongSequenceGenerator messageIdGenerator = new LongSequenceGenerator(); - - public AdvisoryBroker(Broker next) { - super(next); - advisoryProducerId.setConnectionId(ID_GENERATOR.generateId()); - } - - @Override - public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception { - super.addConnection(context, info); - - ActiveMQTopic topic = AdvisorySupport.getConnectionAdvisoryTopic(); - // do not distribute passwords in advisory messages. usernames okay - ConnectionInfo copy = info.copy(); - copy.setPassword(""); - fireAdvisory(context, topic, copy); - connections.put(copy.getConnectionId(), copy); - } - - @Override - public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { - Subscription answer = super.addConsumer(context, info); - - // Don't advise advisory topics. - if (!AdvisorySupport.isAdvisoryTopic(info.getDestination())) { - ActiveMQTopic topic = AdvisorySupport.getConsumerAdvisoryTopic(info.getDestination()); - consumers.offer(info); - fireConsumerAdvisory(context, info.getDestination(), topic, info); - } else { - // We need to replay all the previously collected state objects - // for this newly added consumer. - if (AdvisorySupport.isConnectionAdvisoryTopic(info.getDestination())) { - // Replay the connections. - for (Iterator iter = connections.values().iterator(); iter.hasNext();) { - ConnectionInfo value = iter.next(); - ActiveMQTopic topic = AdvisorySupport.getConnectionAdvisoryTopic(); - fireAdvisory(context, topic, value, info.getConsumerId()); - } - } - - // We check here whether the Destination is Temporary Destination specific or not since we - // can avoid sending advisory messages to the consumer if it only wants Temporary Destination - // notifications. If its not just temporary destination related destinations then we have - // to send them all, a composite destination could want both. - if (AdvisorySupport.isTempDestinationAdvisoryTopic(info.getDestination())) { - // Replay the temporary destinations. - for (DestinationInfo destination : destinations.values()) { - if (destination.getDestination().isTemporary()) { - ActiveMQTopic topic = AdvisorySupport.getDestinationAdvisoryTopic(destination.getDestination()); - fireAdvisory(context, topic, destination, info.getConsumerId()); - } - } - } else if (AdvisorySupport.isDestinationAdvisoryTopic(info.getDestination())) { - // Replay all the destinations. - for (DestinationInfo destination : destinations.values()) { - ActiveMQTopic topic = AdvisorySupport.getDestinationAdvisoryTopic(destination.getDestination()); - fireAdvisory(context, topic, destination, info.getConsumerId()); - } - } - - // Replay the producers. - if (AdvisorySupport.isProducerAdvisoryTopic(info.getDestination())) { - for (Iterator iter = producers.values().iterator(); iter.hasNext();) { - ProducerInfo value = iter.next(); - ActiveMQTopic topic = AdvisorySupport.getProducerAdvisoryTopic(value.getDestination()); - fireProducerAdvisory(context, value.getDestination(),topic, value, info.getConsumerId()); - } - } - - // Replay the consumers. - if (AdvisorySupport.isConsumerAdvisoryTopic(info.getDestination())) { - for (Iterator iter = consumers.iterator(); iter.hasNext();) { - ConsumerInfo value = iter.next(); - ActiveMQTopic topic = AdvisorySupport.getConsumerAdvisoryTopic(value.getDestination()); - fireConsumerAdvisory(context,value.getDestination(), topic, value, info.getConsumerId()); - } - } - - // Replay network bridges - if (AdvisorySupport.isNetworkBridgeAdvisoryTopic(info.getDestination())) { - for (Iterator iter = networkBridges.keySet().iterator(); iter.hasNext();) { - BrokerInfo key = iter.next(); - ActiveMQTopic topic = AdvisorySupport.getNetworkBridgeAdvisoryTopic(); - fireAdvisory(context, topic, key, null, networkBridges.get(key)); - } - } - } - return answer; - } - - @Override - public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception { - super.addProducer(context, info); - - // Don't advise advisory topics. - if (info.getDestination() != null && !AdvisorySupport.isAdvisoryTopic(info.getDestination())) { - ActiveMQTopic topic = AdvisorySupport.getProducerAdvisoryTopic(info.getDestination()); - fireProducerAdvisory(context, info.getDestination(), topic, info); - producers.put(info.getProducerId(), info); - } - } - - @Override - public Destination addDestination(ConnectionContext context, ActiveMQDestination destination,boolean create) throws Exception { - Destination answer = super.addDestination(context, destination,create); - if (!AdvisorySupport.isAdvisoryTopic(destination)) { - DestinationInfo info = new DestinationInfo(context.getConnectionId(), DestinationInfo.ADD_OPERATION_TYPE, destination); - DestinationInfo previous = destinations.putIfAbsent(destination, info); - if( previous==null ) { - ActiveMQTopic topic = AdvisorySupport.getDestinationAdvisoryTopic(destination); - fireAdvisory(context, topic, info); - } - } - return answer; - } - - @Override - public void addDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception { - ActiveMQDestination destination = info.getDestination(); - next.addDestinationInfo(context, info); - - if (!AdvisorySupport.isAdvisoryTopic(destination)) { - DestinationInfo previous = destinations.putIfAbsent(destination, info); - if( previous==null ) { - ActiveMQTopic topic = AdvisorySupport.getDestinationAdvisoryTopic(destination); - fireAdvisory(context, topic, info); - } - } - } - - @Override - public void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout) throws Exception { - super.removeDestination(context, destination, timeout); - DestinationInfo info = destinations.remove(destination); - if (info != null) { - // ensure we don't modify (and loose/overwrite) an in-flight add advisory, so duplicate - info = info.copy(); - info.setDestination(destination); - info.setOperationType(DestinationInfo.REMOVE_OPERATION_TYPE); - ActiveMQTopic topic = AdvisorySupport.getDestinationAdvisoryTopic(destination); - fireAdvisory(context, topic, info); - ActiveMQTopic[] advisoryDestinations = AdvisorySupport.getAllDestinationAdvisoryTopics(destination); - for(ActiveMQTopic advisoryDestination : advisoryDestinations) { - try { - next.removeDestination(context, advisoryDestination, -1); - } catch (Exception expectedIfDestinationDidNotExistYet) { - } - } - } - } - - @Override - public void removeDestinationInfo(ConnectionContext context, DestinationInfo destInfo) throws Exception { - super.removeDestinationInfo(context, destInfo); - DestinationInfo info = destinations.remove(destInfo.getDestination()); - if (info != null) { - // ensure we don't modify (and loose/overwrite) an in-flight add advisory, so duplicate - info = info.copy(); - info.setDestination(destInfo.getDestination()); - info.setOperationType(DestinationInfo.REMOVE_OPERATION_TYPE); - ActiveMQTopic topic = AdvisorySupport.getDestinationAdvisoryTopic(destInfo.getDestination()); - fireAdvisory(context, topic, info); - ActiveMQTopic[] advisoryDestinations = AdvisorySupport.getAllDestinationAdvisoryTopics(destInfo.getDestination()); - for(ActiveMQTopic advisoryDestination : advisoryDestinations) { - try { - next.removeDestination(context, advisoryDestination, -1); - } catch (Exception expectedIfDestinationDidNotExistYet) { - } - } - } - } - - @Override - public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception { - super.removeConnection(context, info, error); - - ActiveMQTopic topic = AdvisorySupport.getConnectionAdvisoryTopic(); - fireAdvisory(context, topic, info.createRemoveCommand()); - connections.remove(info.getConnectionId()); - } - - @Override - public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { - super.removeConsumer(context, info); - - // Don't advise advisory topics. - ActiveMQDestination dest = info.getDestination(); - if (!AdvisorySupport.isAdvisoryTopic(dest)) { - ActiveMQTopic topic = AdvisorySupport.getConsumerAdvisoryTopic(dest); - consumers.remove(info); - if (!dest.isTemporary() || destinations.containsKey(dest)) { - fireConsumerAdvisory(context,dest, topic, info.createRemoveCommand()); - } - } - } - - @Override - public void removeSubscription(ConnectionContext context, RemoveSubscriptionInfo info) throws Exception { - SubscriptionKey key = new SubscriptionKey(context.getClientId(), info.getSubscriptionName()); - DurableTopicSubscription sub = ((TopicRegion)((RegionBroker)next).getTopicRegion()).getDurableSubscription(key); - - super.removeSubscription(context, info); - - if (sub == null) { - LOG.warn("We cannot send an advisory message for a durable sub removal when we don't know about the durable sub"); - return; - } - - ActiveMQDestination dest = sub.getConsumerInfo().getDestination(); - - // Don't advise advisory topics. - if (!AdvisorySupport.isAdvisoryTopic(dest)) { - ActiveMQTopic topic = AdvisorySupport.getConsumerAdvisoryTopic(dest); - fireConsumerAdvisory(context, dest, topic, info); - } - - } - - @Override - public void removeProducer(ConnectionContext context, ProducerInfo info) throws Exception { - super.removeProducer(context, info); - - // Don't advise advisory topics. - ActiveMQDestination dest = info.getDestination(); - if (info.getDestination() != null && !AdvisorySupport.isAdvisoryTopic(dest)) { - ActiveMQTopic topic = AdvisorySupport.getProducerAdvisoryTopic(dest); - producers.remove(info.getProducerId()); - if (!dest.isTemporary() || destinations.contains(dest)) { - fireProducerAdvisory(context, dest,topic, info.createRemoveCommand()); - } - } - } - - @Override - public void messageExpired(ConnectionContext context, MessageReference messageReference, Subscription subscription) { - super.messageExpired(context, messageReference, subscription); - try { - if(!messageReference.isAdvisory()) { - ActiveMQTopic topic = AdvisorySupport.getExpiredMessageTopic(messageReference.getMessage().getDestination()); - Message payload = messageReference.getMessage().copy(); - payload.clearBody(); - ActiveMQMessage advisoryMessage = new ActiveMQMessage(); - advisoryMessage.setStringProperty(AdvisorySupport.MSG_PROPERTY_MESSAGE_ID, payload.getMessageId().toString()); - fireAdvisory(context, topic, payload, null, advisoryMessage); - } - } catch (Exception e) { - handleFireFailure("expired", e); - } - } - - @Override - public void messageConsumed(ConnectionContext context, MessageReference messageReference) { - super.messageConsumed(context, messageReference); - try { - if(!messageReference.isAdvisory()) { - ActiveMQTopic topic = AdvisorySupport.getMessageConsumedAdvisoryTopic(messageReference.getMessage().getDestination()); - Message payload = messageReference.getMessage().copy(); - payload.clearBody(); - fireAdvisory(context, topic,payload); - } - } catch (Exception e) { - handleFireFailure("consumed", e); - } - } - - @Override - public void messageDelivered(ConnectionContext context, MessageReference messageReference) { - super.messageDelivered(context, messageReference); - try { - if (!messageReference.isAdvisory()) { - ActiveMQTopic topic = AdvisorySupport.getMessageDeliveredAdvisoryTopic(messageReference.getMessage().getDestination()); - Message payload = messageReference.getMessage().copy(); - payload.clearBody(); - fireAdvisory(context, topic,payload); - } - } catch (Exception e) { - handleFireFailure("delivered", e); - } - } - - @Override - public void messageDiscarded(ConnectionContext context, Subscription sub, MessageReference messageReference) { - super.messageDiscarded(context, sub, messageReference); - try { - if (!messageReference.isAdvisory()) { - ActiveMQTopic topic = AdvisorySupport.getMessageDiscardedAdvisoryTopic(messageReference.getMessage().getDestination()); - Message payload = messageReference.getMessage().copy(); - payload.clearBody(); - ActiveMQMessage advisoryMessage = new ActiveMQMessage(); - if (sub instanceof TopicSubscription) { - advisoryMessage.setIntProperty(AdvisorySupport.MSG_PROPERTY_DISCARDED_COUNT, ((TopicSubscription)sub).discarded()); - } - advisoryMessage.setStringProperty(AdvisorySupport.MSG_PROPERTY_CONSUMER_ID, sub.getConsumerInfo().getConsumerId().toString()); - fireAdvisory(context, topic, payload, null, advisoryMessage); - } - } catch (Exception e) { - handleFireFailure("discarded", e); - } - } - - @Override - public void slowConsumer(ConnectionContext context, Destination destination,Subscription subs) { - super.slowConsumer(context, destination,subs); - try { - if (!AdvisorySupport.isAdvisoryTopic(destination.getActiveMQDestination())) { - ActiveMQTopic topic = AdvisorySupport.getSlowConsumerAdvisoryTopic(destination.getActiveMQDestination()); - ActiveMQMessage advisoryMessage = new ActiveMQMessage(); - advisoryMessage.setStringProperty(AdvisorySupport.MSG_PROPERTY_CONSUMER_ID, subs.getConsumerInfo().getConsumerId().toString()); - fireAdvisory(context, topic, subs.getConsumerInfo(), null, advisoryMessage); - } - } catch (Exception e) { - handleFireFailure("slow consumer", e); - } - } - - @Override - public void fastProducer(ConnectionContext context,ProducerInfo producerInfo,ActiveMQDestination destination) { - super.fastProducer(context, producerInfo, destination); - try { - if (!AdvisorySupport.isAdvisoryTopic(destination)) { - ActiveMQTopic topic = AdvisorySupport.getFastProducerAdvisoryTopic(destination); - ActiveMQMessage advisoryMessage = new ActiveMQMessage(); - advisoryMessage.setStringProperty(AdvisorySupport.MSG_PROPERTY_PRODUCER_ID, producerInfo.getProducerId().toString()); - fireAdvisory(context, topic, producerInfo, null, advisoryMessage); - } - } catch (Exception e) { - handleFireFailure("fast producer", e); - } - } - - @Override - public void isFull(ConnectionContext context, Destination destination, Usage usage) { - super.isFull(context, destination, usage); - if (AdvisorySupport.isAdvisoryTopic(destination.getActiveMQDestination()) == false) { - try { - - ActiveMQTopic topic = AdvisorySupport.getFullAdvisoryTopic(destination.getActiveMQDestination()); - ActiveMQMessage advisoryMessage = new ActiveMQMessage(); - advisoryMessage.setStringProperty(AdvisorySupport.MSG_PROPERTY_USAGE_NAME, usage.getName()); - fireAdvisory(context, topic, null, null, advisoryMessage); - - } catch (Exception e) { - handleFireFailure("is full", e); - } - } - } - - @Override - public void nowMasterBroker() { - super.nowMasterBroker(); - try { - ActiveMQTopic topic = AdvisorySupport.getMasterBrokerAdvisoryTopic(); - ActiveMQMessage advisoryMessage = new ActiveMQMessage(); - ConnectionContext context = new ConnectionContext(); - context.setSecurityContext(SecurityContext.BROKER_SECURITY_CONTEXT); - context.setBroker(getBrokerService().getBroker()); - fireAdvisory(context, topic,null,null,advisoryMessage); - } catch (Exception e) { - handleFireFailure("now master broker", e); - } - } - - @Override - public boolean sendToDeadLetterQueue(ConnectionContext context, MessageReference messageReference, - Subscription subscription, Throwable poisonCause) { - boolean wasDLQd = super.sendToDeadLetterQueue(context, messageReference, subscription, poisonCause); - if (wasDLQd) { - try { - if(!messageReference.isAdvisory()) { - ActiveMQTopic topic = AdvisorySupport.getMessageDLQdAdvisoryTopic(messageReference.getMessage().getDestination()); - Message payload = messageReference.getMessage().copy(); - payload.clearBody(); - fireAdvisory(context, topic,payload); - } - } catch (Exception e) { - handleFireFailure("add to DLQ", e); - } - } - - return wasDLQd; - } - - @Override - public void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex, String remoteIp) { - try { - if (brokerInfo != null) { - ActiveMQMessage advisoryMessage = new ActiveMQMessage(); - advisoryMessage.setBooleanProperty("started", true); - advisoryMessage.setBooleanProperty("createdByDuplex", createdByDuplex); - advisoryMessage.setStringProperty("remoteIp", remoteIp); - networkBridges.putIfAbsent(brokerInfo, advisoryMessage); - - ActiveMQTopic topic = AdvisorySupport.getNetworkBridgeAdvisoryTopic(); - - ConnectionContext context = new ConnectionContext(); - context.setSecurityContext(SecurityContext.BROKER_SECURITY_CONTEXT); - context.setBroker(getBrokerService().getBroker()); - fireAdvisory(context, topic, brokerInfo, null, advisoryMessage); - } - } catch (Exception e) { - handleFireFailure("network bridge started", e); - } - } - - @Override - public void networkBridgeStopped(BrokerInfo brokerInfo) { - try { - if (brokerInfo != null) { - ActiveMQMessage advisoryMessage = new ActiveMQMessage(); - advisoryMessage.setBooleanProperty("started", false); - networkBridges.remove(brokerInfo); - - ActiveMQTopic topic = AdvisorySupport.getNetworkBridgeAdvisoryTopic(); - - ConnectionContext context = new ConnectionContext(); - context.setSecurityContext(SecurityContext.BROKER_SECURITY_CONTEXT); - context.setBroker(getBrokerService().getBroker()); - fireAdvisory(context, topic, brokerInfo, null, advisoryMessage); - } - } catch (Exception e) { - handleFireFailure("network bridge stopped", e); - } - } - - private void handleFireFailure(String message, Throwable cause) { - LOG.warn("Failed to fire {} advisory, reason: {}", message, cause); - LOG.debug("{} detail: {}", message, cause); - } - - protected void fireAdvisory(ConnectionContext context, ActiveMQTopic topic, Command command) throws Exception { - fireAdvisory(context, topic, command, null); - } - - protected void fireAdvisory(ConnectionContext context, ActiveMQTopic topic, Command command, ConsumerId targetConsumerId) throws Exception { - ActiveMQMessage advisoryMessage = new ActiveMQMessage(); - fireAdvisory(context, topic, command, targetConsumerId, advisoryMessage); - } - - protected void fireConsumerAdvisory(ConnectionContext context, ActiveMQDestination consumerDestination,ActiveMQTopic topic, Command command) throws Exception { - fireConsumerAdvisory(context, consumerDestination,topic, command, null); - } - - protected void fireConsumerAdvisory(ConnectionContext context, ActiveMQDestination consumerDestination,ActiveMQTopic topic, Command command, ConsumerId targetConsumerId) throws Exception { - ActiveMQMessage advisoryMessage = new ActiveMQMessage(); - int count = 0; - Setset = getDestinations(consumerDestination); - if (set != null) { - for (Destination dest:set) { - count += dest.getDestinationStatistics().getConsumers().getCount(); - } - } - advisoryMessage.setIntProperty(AdvisorySupport.MSG_PROPERTY_CONSUMER_COUNT, count); - - fireAdvisory(context, topic, command, targetConsumerId, advisoryMessage); - } - - protected void fireProducerAdvisory(ConnectionContext context,ActiveMQDestination producerDestination, ActiveMQTopic topic, Command command) throws Exception { - fireProducerAdvisory(context,producerDestination, topic, command, null); - } - - protected void fireProducerAdvisory(ConnectionContext context, ActiveMQDestination producerDestination,ActiveMQTopic topic, Command command, ConsumerId targetConsumerId) throws Exception { - ActiveMQMessage advisoryMessage = new ActiveMQMessage(); - int count = 0; - if (producerDestination != null) { - Set set = getDestinations(producerDestination); - if (set != null) { - for (Destination dest : set) { - count += dest.getDestinationStatistics().getProducers().getCount(); - } - } - } - advisoryMessage.setIntProperty("producerCount", count); - fireAdvisory(context, topic, command, targetConsumerId, advisoryMessage); - } - - public void fireAdvisory(ConnectionContext context, ActiveMQTopic topic, Command command, ConsumerId targetConsumerId, ActiveMQMessage advisoryMessage) throws Exception { - if (getBrokerService().isStarted()) { - //set properties - advisoryMessage.setStringProperty(AdvisorySupport.MSG_PROPERTY_ORIGIN_BROKER_NAME, getBrokerName()); - String id = getBrokerId() != null ? getBrokerId().getValue() : "NOT_SET"; - advisoryMessage.setStringProperty(AdvisorySupport.MSG_PROPERTY_ORIGIN_BROKER_ID, id); - - String url = getBrokerService().getVmConnectorURI().toString(); - if (getBrokerService().getDefaultSocketURIString() != null) { - url = getBrokerService().getDefaultSocketURIString(); - } - advisoryMessage.setStringProperty(AdvisorySupport.MSG_PROPERTY_ORIGIN_BROKER_URL, url); - - //set the data structure - advisoryMessage.setDataStructure(command); - advisoryMessage.setPersistent(false); - advisoryMessage.setType(AdvisorySupport.ADIVSORY_MESSAGE_TYPE); - advisoryMessage.setMessageId(new MessageId(advisoryProducerId, messageIdGenerator.getNextSequenceId())); - advisoryMessage.setTargetConsumerId(targetConsumerId); - advisoryMessage.setDestination(topic); - advisoryMessage.setResponseRequired(false); - advisoryMessage.setProducerId(advisoryProducerId); - boolean originalFlowControl = context.isProducerFlowControl(); - final ProducerBrokerExchange producerExchange = new ProducerBrokerExchange(); - producerExchange.setConnectionContext(context); - producerExchange.setMutable(true); - producerExchange.setProducerState(new ProducerState(new ProducerInfo())); - try { - context.setProducerFlowControl(false); - next.send(producerExchange, advisoryMessage); - } finally { - context.setProducerFlowControl(originalFlowControl); - } - } - } - - public Map getAdvisoryConnections() { - return connections; - } - - public Queue getAdvisoryConsumers() { - return consumers; - } - - public Map getAdvisoryProducers() { - return producers; - } - - public Map getAdvisoryDestinations() { - return destinations; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/AdvisorySupport.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/AdvisorySupport.class deleted file mode 100644 index d13f91030..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/AdvisorySupport.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/AdvisorySupport.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/AdvisorySupport.java deleted file mode 100644 index fb37f76af..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/AdvisorySupport.java +++ /dev/null @@ -1,536 +0,0 @@ -/** - * 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.advisory; - -import java.util.ArrayList; - -import javax.jms.Destination; -import javax.jms.JMSException; -import org.apache.activemq.ActiveMQMessageTransformation; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ActiveMQTopic; - -public final class AdvisorySupport { - public static final String ADVISORY_TOPIC_PREFIX = "ActiveMQ.Advisory."; - public static final ActiveMQTopic CONNECTION_ADVISORY_TOPIC = new ActiveMQTopic(ADVISORY_TOPIC_PREFIX - + "Connection"); - public static final ActiveMQTopic QUEUE_ADVISORY_TOPIC = new ActiveMQTopic(ADVISORY_TOPIC_PREFIX + "Queue"); - public static final ActiveMQTopic TOPIC_ADVISORY_TOPIC = new ActiveMQTopic(ADVISORY_TOPIC_PREFIX + "Topic"); - public static final ActiveMQTopic TEMP_QUEUE_ADVISORY_TOPIC = new ActiveMQTopic(ADVISORY_TOPIC_PREFIX + "TempQueue"); - public static final ActiveMQTopic TEMP_TOPIC_ADVISORY_TOPIC = new ActiveMQTopic(ADVISORY_TOPIC_PREFIX + "TempTopic"); - public static final String PRODUCER_ADVISORY_TOPIC_PREFIX = ADVISORY_TOPIC_PREFIX + "Producer."; - public static final String QUEUE_PRODUCER_ADVISORY_TOPIC_PREFIX = PRODUCER_ADVISORY_TOPIC_PREFIX + "Queue."; - public static final String TOPIC_PRODUCER_ADVISORY_TOPIC_PREFIX = PRODUCER_ADVISORY_TOPIC_PREFIX + "Topic."; - public static final String CONSUMER_ADVISORY_TOPIC_PREFIX = ADVISORY_TOPIC_PREFIX + "Consumer."; - public static final String QUEUE_CONSUMER_ADVISORY_TOPIC_PREFIX = CONSUMER_ADVISORY_TOPIC_PREFIX + "Queue."; - public static final String TOPIC_CONSUMER_ADVISORY_TOPIC_PREFIX = CONSUMER_ADVISORY_TOPIC_PREFIX + "Topic."; - public static final String EXPIRED_TOPIC_MESSAGES_TOPIC_PREFIX = ADVISORY_TOPIC_PREFIX + "Expired.Topic."; - public static final String EXPIRED_QUEUE_MESSAGES_TOPIC_PREFIX = ADVISORY_TOPIC_PREFIX + "Expired.Queue."; - public static final String NO_TOPIC_CONSUMERS_TOPIC_PREFIX = ADVISORY_TOPIC_PREFIX + "NoConsumer.Topic."; - public static final String NO_QUEUE_CONSUMERS_TOPIC_PREFIX = ADVISORY_TOPIC_PREFIX + "NoConsumer.Queue."; - public static final String SLOW_CONSUMER_TOPIC_PREFIX = ADVISORY_TOPIC_PREFIX + "SlowConsumer."; - public static final String FAST_PRODUCER_TOPIC_PREFIX = ADVISORY_TOPIC_PREFIX + "FastProducer."; - public static final String MESSAGE_DISCAREDED_TOPIC_PREFIX = ADVISORY_TOPIC_PREFIX + "MessageDiscarded."; - public static final String FULL_TOPIC_PREFIX = ADVISORY_TOPIC_PREFIX + "FULL."; - public static final String MESSAGE_DELIVERED_TOPIC_PREFIX = ADVISORY_TOPIC_PREFIX + "MessageDelivered."; - public static final String MESSAGE_CONSUMED_TOPIC_PREFIX = ADVISORY_TOPIC_PREFIX + "MessageConsumed."; - public static final String MESSAGE_DLQ_TOPIC_PREFIX = ADVISORY_TOPIC_PREFIX + "MessageDLQd."; - public static final String MASTER_BROKER_TOPIC_PREFIX = ADVISORY_TOPIC_PREFIX + "MasterBroker"; - public static final String NETWORK_BRIDGE_TOPIC_PREFIX = ADVISORY_TOPIC_PREFIX + "NetworkBridge"; - public static final String NETWORK_BRIDGE_FORWARD_FAILURE_TOPIC_PREFIX = NETWORK_BRIDGE_TOPIC_PREFIX + ".ForwardFailure"; - public static final String AGENT_TOPIC = "ActiveMQ.Agent"; - public static final String ADIVSORY_MESSAGE_TYPE = "Advisory"; - public static final String MSG_PROPERTY_ORIGIN_BROKER_ID = "originBrokerId"; - public static final String MSG_PROPERTY_ORIGIN_BROKER_NAME = "originBrokerName"; - public static final String MSG_PROPERTY_ORIGIN_BROKER_URL = "originBrokerURL"; - public static final String MSG_PROPERTY_USAGE_NAME = "usageName"; - public static final String MSG_PROPERTY_CONSUMER_ID = "consumerId"; - public static final String MSG_PROPERTY_PRODUCER_ID = "producerId"; - public static final String MSG_PROPERTY_MESSAGE_ID = "orignalMessageId"; - public static final String MSG_PROPERTY_CONSUMER_COUNT = "consumerCount"; - public static final String MSG_PROPERTY_DISCARDED_COUNT = "discardedCount"; - - public static final ActiveMQTopic ALL_DESTINATIONS_COMPOSITE_ADVISORY_TOPIC = new ActiveMQTopic( - TOPIC_ADVISORY_TOPIC.getPhysicalName() + "," + QUEUE_ADVISORY_TOPIC.getPhysicalName() + "," + - TEMP_QUEUE_ADVISORY_TOPIC.getPhysicalName() + "," + TEMP_TOPIC_ADVISORY_TOPIC.getPhysicalName()); - public static final ActiveMQTopic TEMP_DESTINATION_COMPOSITE_ADVISORY_TOPIC = new ActiveMQTopic( - TEMP_QUEUE_ADVISORY_TOPIC.getPhysicalName() + "," + TEMP_TOPIC_ADVISORY_TOPIC.getPhysicalName()); - private static final ActiveMQTopic AGENT_TOPIC_DESTINATION = new ActiveMQTopic(AGENT_TOPIC); - - private AdvisorySupport() { - } - - public static ActiveMQTopic getConnectionAdvisoryTopic() { - return CONNECTION_ADVISORY_TOPIC; - } - - public static ActiveMQTopic[] getAllDestinationAdvisoryTopics(Destination destination) throws JMSException { - return getAllDestinationAdvisoryTopics(ActiveMQMessageTransformation.transformDestination(destination)); - } - - public static ActiveMQTopic[] getAllDestinationAdvisoryTopics(ActiveMQDestination destination) throws JMSException { - ArrayList result = new ArrayList(); - - result.add(getConsumerAdvisoryTopic(destination)); - result.add(getProducerAdvisoryTopic(destination)); - result.add(getExpiredMessageTopic(destination)); - result.add(getNoConsumersAdvisoryTopic(destination)); - result.add(getSlowConsumerAdvisoryTopic(destination)); - result.add(getFastProducerAdvisoryTopic(destination)); - result.add(getMessageDiscardedAdvisoryTopic(destination)); - result.add(getMessageDeliveredAdvisoryTopic(destination)); - result.add(getMessageConsumedAdvisoryTopic(destination)); - result.add(getMessageDLQdAdvisoryTopic(destination)); - result.add(getFullAdvisoryTopic(destination)); - - return result.toArray(new ActiveMQTopic[0]); - } - - public static ActiveMQTopic getConsumerAdvisoryTopic(Destination destination) throws JMSException { - return getConsumerAdvisoryTopic(ActiveMQMessageTransformation.transformDestination(destination)); - } - - public static ActiveMQTopic getConsumerAdvisoryTopic(ActiveMQDestination destination) { - if (destination.isQueue()) { - return new ActiveMQTopic(QUEUE_CONSUMER_ADVISORY_TOPIC_PREFIX + destination.getPhysicalName()); - } else { - return new ActiveMQTopic(TOPIC_CONSUMER_ADVISORY_TOPIC_PREFIX + destination.getPhysicalName()); - } - } - - public static ActiveMQTopic getProducerAdvisoryTopic(Destination destination) throws JMSException { - return getProducerAdvisoryTopic(ActiveMQMessageTransformation.transformDestination(destination)); - } - - public static ActiveMQTopic getProducerAdvisoryTopic(ActiveMQDestination destination) { - if (destination.isQueue()) { - return new ActiveMQTopic(QUEUE_PRODUCER_ADVISORY_TOPIC_PREFIX + destination.getPhysicalName()); - } else { - return new ActiveMQTopic(TOPIC_PRODUCER_ADVISORY_TOPIC_PREFIX + destination.getPhysicalName()); - } - } - - public static ActiveMQTopic getExpiredMessageTopic(Destination destination) throws JMSException { - return getExpiredMessageTopic(ActiveMQMessageTransformation.transformDestination(destination)); - } - - public static ActiveMQTopic getExpiredMessageTopic(ActiveMQDestination destination) { - if (destination.isQueue()) { - return getExpiredQueueMessageAdvisoryTopic(destination); - } - return getExpiredTopicMessageAdvisoryTopic(destination); - } - - public static ActiveMQTopic getExpiredTopicMessageAdvisoryTopic(ActiveMQDestination destination) { - String name = EXPIRED_TOPIC_MESSAGES_TOPIC_PREFIX + destination.getPhysicalName(); - return new ActiveMQTopic(name); - } - - public static ActiveMQTopic getExpiredQueueMessageAdvisoryTopic(Destination destination) throws JMSException { - return getExpiredQueueMessageAdvisoryTopic(ActiveMQMessageTransformation.transformDestination(destination)); - } - - public static ActiveMQTopic getExpiredQueueMessageAdvisoryTopic(ActiveMQDestination destination) { - String name = EXPIRED_QUEUE_MESSAGES_TOPIC_PREFIX + destination.getPhysicalName(); - return new ActiveMQTopic(name); - } - - public static ActiveMQTopic getNoConsumersAdvisoryTopic(Destination destination) throws JMSException { - return getExpiredMessageTopic(ActiveMQMessageTransformation.transformDestination(destination)); - } - - public static ActiveMQTopic getNoConsumersAdvisoryTopic(ActiveMQDestination destination) { - if (destination.isQueue()) { - return getNoQueueConsumersAdvisoryTopic(destination); - } - return getNoTopicConsumersAdvisoryTopic(destination); - } - - public static ActiveMQTopic getNoTopicConsumersAdvisoryTopic(Destination destination) throws JMSException { - return getNoTopicConsumersAdvisoryTopic(ActiveMQMessageTransformation.transformDestination(destination)); - } - - public static ActiveMQTopic getNoTopicConsumersAdvisoryTopic(ActiveMQDestination destination) { - String name = NO_TOPIC_CONSUMERS_TOPIC_PREFIX + destination.getPhysicalName(); - return new ActiveMQTopic(name); - } - - public static ActiveMQTopic getNoQueueConsumersAdvisoryTopic(Destination destination) throws JMSException { - return getNoQueueConsumersAdvisoryTopic(ActiveMQMessageTransformation.transformDestination(destination)); - } - - public static ActiveMQTopic getNoQueueConsumersAdvisoryTopic(ActiveMQDestination destination) { - String name = NO_QUEUE_CONSUMERS_TOPIC_PREFIX + destination.getPhysicalName(); - return new ActiveMQTopic(name); - } - - public static ActiveMQTopic getSlowConsumerAdvisoryTopic(Destination destination) throws JMSException { - return getSlowConsumerAdvisoryTopic(ActiveMQMessageTransformation.transformDestination(destination)); - } - - public static ActiveMQTopic getSlowConsumerAdvisoryTopic(ActiveMQDestination destination) { - String name = SLOW_CONSUMER_TOPIC_PREFIX + destination.getDestinationTypeAsString() + "." - + destination.getPhysicalName(); - return new ActiveMQTopic(name); - } - - public static ActiveMQTopic getFastProducerAdvisoryTopic(Destination destination) throws JMSException { - return getFastProducerAdvisoryTopic(ActiveMQMessageTransformation.transformDestination(destination)); - } - - public static ActiveMQTopic getFastProducerAdvisoryTopic(ActiveMQDestination destination) { - String name = FAST_PRODUCER_TOPIC_PREFIX + destination.getDestinationTypeAsString() + "." - + destination.getPhysicalName(); - return new ActiveMQTopic(name); - } - - public static ActiveMQTopic getMessageDiscardedAdvisoryTopic(Destination destination) throws JMSException { - return getMessageDiscardedAdvisoryTopic(ActiveMQMessageTransformation.transformDestination(destination)); - } - - public static ActiveMQTopic getMessageDiscardedAdvisoryTopic(ActiveMQDestination destination) { - String name = MESSAGE_DISCAREDED_TOPIC_PREFIX + destination.getDestinationTypeAsString() + "." - + destination.getPhysicalName(); - return new ActiveMQTopic(name); - } - - public static ActiveMQTopic getMessageDeliveredAdvisoryTopic(Destination destination) throws JMSException { - return getMessageDeliveredAdvisoryTopic(ActiveMQMessageTransformation.transformDestination(destination)); - } - - public static ActiveMQTopic getMessageDeliveredAdvisoryTopic(ActiveMQDestination destination) { - String name = MESSAGE_DELIVERED_TOPIC_PREFIX + destination.getDestinationTypeAsString() + "." - + destination.getPhysicalName(); - return new ActiveMQTopic(name); - } - - public static ActiveMQTopic getMessageConsumedAdvisoryTopic(Destination destination) throws JMSException { - return getMessageConsumedAdvisoryTopic(ActiveMQMessageTransformation.transformDestination(destination)); - } - - public static ActiveMQTopic getMessageConsumedAdvisoryTopic(ActiveMQDestination destination) { - String name = MESSAGE_CONSUMED_TOPIC_PREFIX + destination.getDestinationTypeAsString() + "." - + destination.getPhysicalName(); - return new ActiveMQTopic(name); - } - - public static ActiveMQTopic getMessageDLQdAdvisoryTopic(ActiveMQDestination destination) { - String name = MESSAGE_DLQ_TOPIC_PREFIX + destination.getDestinationTypeAsString() + "." - + destination.getPhysicalName(); - return new ActiveMQTopic(name); - } - - public static ActiveMQTopic getMasterBrokerAdvisoryTopic() { - return new ActiveMQTopic(MASTER_BROKER_TOPIC_PREFIX); - } - - public static ActiveMQTopic getNetworkBridgeAdvisoryTopic() { - return new ActiveMQTopic(NETWORK_BRIDGE_TOPIC_PREFIX); - } - - public static ActiveMQTopic getFullAdvisoryTopic(Destination destination) throws JMSException { - return getFullAdvisoryTopic(ActiveMQMessageTransformation.transformDestination(destination)); - } - - public static ActiveMQTopic getFullAdvisoryTopic(ActiveMQDestination destination) { - String name = FULL_TOPIC_PREFIX + destination.getDestinationTypeAsString() + "." - + destination.getPhysicalName(); - return new ActiveMQTopic(name); - } - - public static ActiveMQTopic getDestinationAdvisoryTopic(Destination destination) throws JMSException { - return getDestinationAdvisoryTopic(ActiveMQMessageTransformation.transformDestination(destination)); - } - - public static ActiveMQTopic getDestinationAdvisoryTopic(ActiveMQDestination destination) { - switch (destination.getDestinationType()) { - case ActiveMQDestination.QUEUE_TYPE: - return QUEUE_ADVISORY_TOPIC; - case ActiveMQDestination.TOPIC_TYPE: - return TOPIC_ADVISORY_TOPIC; - case ActiveMQDestination.TEMP_QUEUE_TYPE: - return TEMP_QUEUE_ADVISORY_TOPIC; - case ActiveMQDestination.TEMP_TOPIC_TYPE: - return TEMP_TOPIC_ADVISORY_TOPIC; - default: - throw new RuntimeException("Unknown destination type: " + destination.getDestinationType()); - } - } - - public static boolean isDestinationAdvisoryTopic(Destination destination) throws JMSException { - return isDestinationAdvisoryTopic(ActiveMQMessageTransformation.transformDestination(destination)); - } - - public static boolean isTempDestinationAdvisoryTopic(ActiveMQDestination destination) { - if (destination.isComposite()) { - ActiveMQDestination[] compositeDestinations = destination.getCompositeDestinations(); - for (int i = 0; i < compositeDestinations.length; i++) { - if (!isTempDestinationAdvisoryTopic(compositeDestinations[i])) { - return false; - } - } - return true; - } else { - return destination.equals(TEMP_QUEUE_ADVISORY_TOPIC) || destination.equals(TEMP_TOPIC_ADVISORY_TOPIC); - } - } - - public static boolean isDestinationAdvisoryTopic(ActiveMQDestination destination) { - if (destination.isComposite()) { - ActiveMQDestination[] compositeDestinations = destination.getCompositeDestinations(); - for (int i = 0; i < compositeDestinations.length; i++) { - if (isDestinationAdvisoryTopic(compositeDestinations[i])) { - return true; - } - } - return false; - } else { - return destination.equals(TEMP_QUEUE_ADVISORY_TOPIC) || destination.equals(TEMP_TOPIC_ADVISORY_TOPIC) - || destination.equals(QUEUE_ADVISORY_TOPIC) || destination.equals(TOPIC_ADVISORY_TOPIC); - } - } - - public static boolean isAdvisoryTopic(Destination destination) throws JMSException { - return isAdvisoryTopic(ActiveMQMessageTransformation.transformDestination(destination)); - } - - public static boolean isAdvisoryTopic(ActiveMQDestination destination) { - if (destination != null) { - if (destination.isComposite()) { - ActiveMQDestination[] compositeDestinations = destination.getCompositeDestinations(); - for (int i = 0; i < compositeDestinations.length; i++) { - if (isAdvisoryTopic(compositeDestinations[i])) { - return true; - } - } - return false; - } else { - return destination.isTopic() && destination.getPhysicalName().startsWith(ADVISORY_TOPIC_PREFIX); - } - } - return false; - } - - public static boolean isConnectionAdvisoryTopic(Destination destination) throws JMSException { - return isConnectionAdvisoryTopic(ActiveMQMessageTransformation.transformDestination(destination)); - } - - public static boolean isConnectionAdvisoryTopic(ActiveMQDestination destination) { - if (destination.isComposite()) { - ActiveMQDestination[] compositeDestinations = destination.getCompositeDestinations(); - for (int i = 0; i < compositeDestinations.length; i++) { - if (isConnectionAdvisoryTopic(compositeDestinations[i])) { - return true; - } - } - return false; - } else { - return destination.equals(CONNECTION_ADVISORY_TOPIC); - } - } - - public static boolean isProducerAdvisoryTopic(Destination destination) throws JMSException { - return isProducerAdvisoryTopic(ActiveMQMessageTransformation.transformDestination(destination)); - } - - public static boolean isProducerAdvisoryTopic(ActiveMQDestination destination) { - if (destination.isComposite()) { - ActiveMQDestination[] compositeDestinations = destination.getCompositeDestinations(); - for (int i = 0; i < compositeDestinations.length; i++) { - if (isProducerAdvisoryTopic(compositeDestinations[i])) { - return true; - } - } - return false; - } else { - return destination.isTopic() && destination.getPhysicalName().startsWith(PRODUCER_ADVISORY_TOPIC_PREFIX); - } - } - - public static boolean isConsumerAdvisoryTopic(Destination destination) throws JMSException { - return isConsumerAdvisoryTopic(ActiveMQMessageTransformation.transformDestination(destination)); - } - - public static boolean isConsumerAdvisoryTopic(ActiveMQDestination destination) { - if (destination.isComposite()) { - ActiveMQDestination[] compositeDestinations = destination.getCompositeDestinations(); - for (int i = 0; i < compositeDestinations.length; i++) { - if (isConsumerAdvisoryTopic(compositeDestinations[i])) { - return true; - } - } - return false; - } else { - return destination.isTopic() && destination.getPhysicalName().startsWith(CONSUMER_ADVISORY_TOPIC_PREFIX); - } - } - - public static boolean isSlowConsumerAdvisoryTopic(Destination destination) throws JMSException { - return isSlowConsumerAdvisoryTopic(ActiveMQMessageTransformation.transformDestination(destination)); - } - - public static boolean isSlowConsumerAdvisoryTopic(ActiveMQDestination destination) { - if (destination.isComposite()) { - ActiveMQDestination[] compositeDestinations = destination.getCompositeDestinations(); - for (int i = 0; i < compositeDestinations.length; i++) { - if (isSlowConsumerAdvisoryTopic(compositeDestinations[i])) { - return true; - } - } - return false; - } else { - return destination.isTopic() && destination.getPhysicalName().startsWith(SLOW_CONSUMER_TOPIC_PREFIX); - } - } - - public static boolean isFastProducerAdvisoryTopic(Destination destination) throws JMSException { - return isFastProducerAdvisoryTopic(ActiveMQMessageTransformation.transformDestination(destination)); - } - - public static boolean isFastProducerAdvisoryTopic(ActiveMQDestination destination) { - if (destination.isComposite()) { - ActiveMQDestination[] compositeDestinations = destination.getCompositeDestinations(); - for (int i = 0; i < compositeDestinations.length; i++) { - if (isFastProducerAdvisoryTopic(compositeDestinations[i])) { - return true; - } - } - return false; - } else { - return destination.isTopic() && destination.getPhysicalName().startsWith(FAST_PRODUCER_TOPIC_PREFIX); - } - } - - public static boolean isMessageConsumedAdvisoryTopic(Destination destination) throws JMSException { - return isMessageConsumedAdvisoryTopic(ActiveMQMessageTransformation.transformDestination(destination)); - } - - public static boolean isMessageConsumedAdvisoryTopic(ActiveMQDestination destination) { - if (destination.isComposite()) { - ActiveMQDestination[] compositeDestinations = destination.getCompositeDestinations(); - for (int i = 0; i < compositeDestinations.length; i++) { - if (isMessageConsumedAdvisoryTopic(compositeDestinations[i])) { - return true; - } - } - return false; - } else { - return destination.isTopic() && destination.getPhysicalName().startsWith(MESSAGE_CONSUMED_TOPIC_PREFIX); - } - } - - public static boolean isMasterBrokerAdvisoryTopic(Destination destination) throws JMSException { - return isMasterBrokerAdvisoryTopic(ActiveMQMessageTransformation.transformDestination(destination)); - } - - public static boolean isMasterBrokerAdvisoryTopic(ActiveMQDestination destination) { - if (destination.isComposite()) { - ActiveMQDestination[] compositeDestinations = destination.getCompositeDestinations(); - for (int i = 0; i < compositeDestinations.length; i++) { - if (isMasterBrokerAdvisoryTopic(compositeDestinations[i])) { - return true; - } - } - return false; - } else { - return destination.isTopic() && destination.getPhysicalName().startsWith(MASTER_BROKER_TOPIC_PREFIX); - } - } - - public static boolean isMessageDeliveredAdvisoryTopic(Destination destination) throws JMSException { - return isMessageDeliveredAdvisoryTopic(ActiveMQMessageTransformation.transformDestination(destination)); - } - - public static boolean isMessageDeliveredAdvisoryTopic(ActiveMQDestination destination) { - if (destination.isComposite()) { - ActiveMQDestination[] compositeDestinations = destination.getCompositeDestinations(); - for (int i = 0; i < compositeDestinations.length; i++) { - if (isMessageDeliveredAdvisoryTopic(compositeDestinations[i])) { - return true; - } - } - return false; - } else { - return destination.isTopic() && destination.getPhysicalName().startsWith(MESSAGE_DELIVERED_TOPIC_PREFIX); - } - } - - public static boolean isMessageDiscardedAdvisoryTopic(Destination destination) throws JMSException { - return isMessageDiscardedAdvisoryTopic(ActiveMQMessageTransformation.transformDestination(destination)); - } - - public static boolean isMessageDiscardedAdvisoryTopic(ActiveMQDestination destination) { - if (destination.isComposite()) { - ActiveMQDestination[] compositeDestinations = destination.getCompositeDestinations(); - for (int i = 0; i < compositeDestinations.length; i++) { - if (isMessageDiscardedAdvisoryTopic(compositeDestinations[i])) { - return true; - } - } - return false; - } else { - return destination.isTopic() && destination.getPhysicalName().startsWith(MESSAGE_DISCAREDED_TOPIC_PREFIX); - } - } - - public static boolean isFullAdvisoryTopic(Destination destination) throws JMSException { - return isFullAdvisoryTopic(ActiveMQMessageTransformation.transformDestination(destination)); - } - - public static boolean isFullAdvisoryTopic(ActiveMQDestination destination) { - if (destination.isComposite()) { - ActiveMQDestination[] compositeDestinations = destination.getCompositeDestinations(); - for (int i = 0; i < compositeDestinations.length; i++) { - if (isFullAdvisoryTopic(compositeDestinations[i])) { - return true; - } - } - return false; - } else { - return destination.isTopic() && destination.getPhysicalName().startsWith(FULL_TOPIC_PREFIX); - } - } - - public static boolean isNetworkBridgeAdvisoryTopic(Destination destination) throws JMSException { - return isNetworkBridgeAdvisoryTopic(ActiveMQMessageTransformation.transformDestination(destination)); - } - - public static boolean isNetworkBridgeAdvisoryTopic(ActiveMQDestination destination) { - if (destination.isComposite()) { - ActiveMQDestination[] compositeDestinations = destination.getCompositeDestinations(); - for (int i = 0; i < compositeDestinations.length; i++) { - if (isNetworkBridgeAdvisoryTopic(compositeDestinations[i])) { - return true; - } - } - return false; - } else { - return destination.isTopic() && destination.getPhysicalName().startsWith(NETWORK_BRIDGE_TOPIC_PREFIX); - } - } - - /** - * Returns the agent topic which is used to send commands to the broker - */ - public static Destination getAgentDestination() { - return AGENT_TOPIC_DESTINATION; - } - - public static ActiveMQTopic getNetworkBridgeForwardFailureAdvisoryTopic() { - return new ActiveMQTopic(NETWORK_BRIDGE_FORWARD_FAILURE_TOPIC_PREFIX); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ConsumerEvent.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ConsumerEvent.class deleted file mode 100644 index 1a8e25155..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ConsumerEvent.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ConsumerEvent.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ConsumerEvent.java deleted file mode 100644 index dcf6ddfa8..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ConsumerEvent.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * 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.advisory; - -import java.util.EventObject; - -import javax.jms.Destination; - -import org.apache.activemq.command.ConsumerId; - -/** - * An event when the number of consumers on a given destination changes. - * - * - */ -public abstract class ConsumerEvent extends EventObject { - private static final long serialVersionUID = 2442156576867593780L; - private final Destination destination; - private final ConsumerId consumerId; - private final int consumerCount; - - public ConsumerEvent(ConsumerEventSource source, Destination destination, ConsumerId consumerId, int consumerCount) { - super(source); - this.destination = destination; - this.consumerId = consumerId; - this.consumerCount = consumerCount; - } - - public ConsumerEventSource getAdvisor() { - return (ConsumerEventSource) getSource(); - } - - public Destination getDestination() { - return destination; - } - - /** - * Returns the current number of consumers active at the time this advisory was sent. - * - * Note that this is not the number of consumers active when the consumer started consuming. - * It is usually more vital to know how many consumers there are now - rather than historically - * how many there were when a consumer started. So if you create a {@link ConsumerListener} - * after many consumers have started, you will receive a ConsumerEvent for each consumer. However the - * {@link #getConsumerCount()} method will always return the current active consumer count on each event. - */ - public int getConsumerCount() { - return consumerCount; - } - - public ConsumerId getConsumerId() { - return consumerId; - } - - public abstract boolean isStarted(); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ConsumerEventSource.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ConsumerEventSource.class deleted file mode 100644 index 008444abe..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ConsumerEventSource.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ConsumerEventSource.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ConsumerEventSource.java deleted file mode 100644 index 40831bc01..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ConsumerEventSource.java +++ /dev/null @@ -1,136 +0,0 @@ -/** - * 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.advisory; - -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicInteger; - -import javax.jms.Connection; -import javax.jms.Destination; -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.MessageListener; -import javax.jms.Session; - -import org.apache.activemq.ActiveMQMessageConsumer; -import org.apache.activemq.Service; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ActiveMQMessage; -import org.apache.activemq.command.ActiveMQTopic; -import org.apache.activemq.command.ConsumerId; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.command.RemoveInfo; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * An object which can be used to listen to the number of active consumers - * available on a given destination. - * - * - */ -public class ConsumerEventSource implements Service, MessageListener { - private static final Logger LOG = LoggerFactory.getLogger(ConsumerEventSource.class); - - private final Connection connection; - private final ActiveMQDestination destination; - private ConsumerListener listener; - private AtomicBoolean started = new AtomicBoolean(false); - private AtomicInteger consumerCount = new AtomicInteger(); - private Session session; - private ActiveMQMessageConsumer consumer; - - public ConsumerEventSource(Connection connection, Destination destination) throws JMSException { - this.connection = connection; - this.destination = ActiveMQDestination.transform(destination); - } - - public void setConsumerListener(ConsumerListener listener) { - this.listener = listener; - } - - public String getConsumerId() { - return consumer != null ? consumer.getConsumerId().toString() : "NOT_SET"; - } - - public void start() throws Exception { - if (started.compareAndSet(false, true)) { - session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - ActiveMQTopic advisoryTopic = AdvisorySupport.getConsumerAdvisoryTopic(destination); - consumer = (ActiveMQMessageConsumer) session.createConsumer(advisoryTopic); - consumer.setMessageListener(this); - } - } - - public void stop() throws Exception { - if (started.compareAndSet(true, false)) { - if (session != null) { - session.close(); - } - } - } - - public void onMessage(Message message) { - if (message instanceof ActiveMQMessage) { - ActiveMQMessage activeMessage = (ActiveMQMessage)message; - Object command = activeMessage.getDataStructure(); - int count = 0; - if (command instanceof ConsumerInfo) { - count = consumerCount.incrementAndGet(); - count = extractConsumerCountFromMessage(message, count); - fireConsumerEvent(new ConsumerStartedEvent(this, destination, (ConsumerInfo)command, count)); - } else if (command instanceof RemoveInfo) { - RemoveInfo removeInfo = (RemoveInfo)command; - if (removeInfo.isConsumerRemove()) { - count = consumerCount.decrementAndGet(); - count = extractConsumerCountFromMessage(message, count); - fireConsumerEvent(new ConsumerStoppedEvent(this, destination, (ConsumerId)removeInfo.getObjectId(), count)); - } - } else { - LOG.warn("Unknown command: " + command); - } - } else { - LOG.warn("Unknown message type: " + message + ". Message ignored"); - } - } - - /** - * Lets rely by default on the broker telling us what the consumer count is - * as it can ensure that we are up to date at all times and have not - * received messages out of order etc. - */ - protected int extractConsumerCountFromMessage(Message message, int count) { - try { - Object value = message.getObjectProperty("consumerCount"); - if (value instanceof Number) { - Number n = (Number)value; - return n.intValue(); - } - LOG.warn("No consumerCount header available on the message: " + message); - } catch (Exception e) { - LOG.warn("Failed to extract consumerCount from message: " + message + ".Reason: " + e, e); - } - return count; - } - - protected void fireConsumerEvent(ConsumerEvent event) { - if (listener != null) { - listener.onConsumerEvent(event); - } - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ConsumerListener.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ConsumerListener.class deleted file mode 100644 index 05af77b0f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ConsumerListener.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ConsumerListener.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ConsumerListener.java deleted file mode 100644 index d1f198917..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ConsumerListener.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * 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.advisory; - -/** - * Listen to the changes in the number of active consumers available for a given destination. - * - * - */ -public interface ConsumerListener { - - void onConsumerEvent(ConsumerEvent event); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ConsumerStartedEvent.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ConsumerStartedEvent.class deleted file mode 100644 index 370d66ebc..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ConsumerStartedEvent.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ConsumerStartedEvent.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ConsumerStartedEvent.java deleted file mode 100644 index d228564da..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ConsumerStartedEvent.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * 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.advisory; - -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ConsumerInfo; - -/** - * An event when a new consumer has started. - * - * - */ -public class ConsumerStartedEvent extends ConsumerEvent { - - private static final long serialVersionUID = 5088138839609391074L; - - private final transient ConsumerInfo consumerInfo; - - public ConsumerStartedEvent(ConsumerEventSource source, ActiveMQDestination destination, ConsumerInfo consumerInfo, int count) { - super(source, destination, consumerInfo.getConsumerId(), count); - this.consumerInfo = consumerInfo; - } - - public boolean isStarted() { - return true; - } - - /** - * @return details of the subscription - */ - public ConsumerInfo getConsumerInfo() { - return consumerInfo; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ConsumerStoppedEvent.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ConsumerStoppedEvent.class deleted file mode 100644 index 061c4008a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ConsumerStoppedEvent.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ConsumerStoppedEvent.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ConsumerStoppedEvent.java deleted file mode 100644 index 5e1983e3f..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ConsumerStoppedEvent.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * 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.advisory; - -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ConsumerId; - -/** - * An event generated when a consumer stops. - * - * - */ -public class ConsumerStoppedEvent extends ConsumerEvent { - - private static final long serialVersionUID = 5378835541037193206L; - - public ConsumerStoppedEvent(ConsumerEventSource source, ActiveMQDestination destination, ConsumerId consumerId, int count) { - super(source, destination, consumerId, count); - } - - public boolean isStarted() { - return false; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/DestinationEvent.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/DestinationEvent.class deleted file mode 100644 index c531e525d..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/DestinationEvent.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/DestinationEvent.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/DestinationEvent.java deleted file mode 100644 index df0dbc5df..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/DestinationEvent.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * 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.advisory; - -import java.util.EventObject; - -import org.apache.activemq.command.DestinationInfo; -import org.apache.activemq.command.ActiveMQDestination; - -/** - * An event caused when a destination is created or deleted - * - * - */ -public class DestinationEvent extends EventObject { - private static final long serialVersionUID = 2442156576867593780L; - private DestinationInfo destinationInfo; - - public DestinationEvent(DestinationSource source, DestinationInfo destinationInfo) { - super(source); - this.destinationInfo = destinationInfo; - } - - public ActiveMQDestination getDestination() { - return getDestinationInfo().getDestination(); - } - - public boolean isAddOperation() { - return getDestinationInfo().isAddOperation(); - } - - public long getTimeout() { - return getDestinationInfo().getTimeout(); - } - - public boolean isRemoveOperation() { - return getDestinationInfo().isRemoveOperation(); - } - - public DestinationInfo getDestinationInfo() { - return destinationInfo; - } -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/DestinationListener.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/DestinationListener.class deleted file mode 100644 index fc8e8df66..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/DestinationListener.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/DestinationListener.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/DestinationListener.java deleted file mode 100644 index 0ac88e370..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/DestinationListener.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * 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.advisory; - -/** - * Listen to the changes in destinations being created or destroyed - * - * - */ -public interface DestinationListener { - void onDestinationEvent(DestinationEvent event); -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/DestinationSource.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/DestinationSource.class deleted file mode 100644 index ed4611fda..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/DestinationSource.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/DestinationSource.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/DestinationSource.java deleted file mode 100644 index 3d11fcab9..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/DestinationSource.java +++ /dev/null @@ -1,191 +0,0 @@ -/** - * 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.advisory; - -import java.util.Set; -import java.util.concurrent.CopyOnWriteArraySet; -import java.util.concurrent.atomic.AtomicBoolean; - -import javax.jms.Connection; -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.MessageConsumer; -import javax.jms.MessageListener; -import javax.jms.Session; - -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ActiveMQMessage; -import org.apache.activemq.command.ActiveMQQueue; -import org.apache.activemq.command.ActiveMQTempQueue; -import org.apache.activemq.command.ActiveMQTempTopic; -import org.apache.activemq.command.ActiveMQTopic; -import org.apache.activemq.command.DestinationInfo; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * A helper class which keeps track of the Destinations available in a broker and allows you to listen to them - * being created or deleted. - * - * - */ -public class DestinationSource implements MessageListener { - private static final Logger LOG = LoggerFactory.getLogger(ConsumerEventSource.class); - private AtomicBoolean started = new AtomicBoolean(false); - private final Connection connection; - private Session session; - private MessageConsumer queueConsumer; - private MessageConsumer topicConsumer; - private MessageConsumer tempTopicConsumer; - private MessageConsumer tempQueueConsumer; - private Set queues = new CopyOnWriteArraySet(); - private Set topics = new CopyOnWriteArraySet(); - private Set temporaryQueues = new CopyOnWriteArraySet(); - private Set temporaryTopics = new CopyOnWriteArraySet(); - private DestinationListener listener; - - public DestinationSource(Connection connection) throws JMSException { - this.connection = connection; - } - - public DestinationListener getListener() { - return listener; - } - - public void setDestinationListener(DestinationListener listener) { - this.listener = listener; - } - - /** - * Returns the current queues available on the broker - */ - public Set getQueues() { - return queues; - } - - /** - * Returns the current topics on the broker - */ - public Set getTopics() { - return topics; - } - - /** - * Returns the current temporary topics available on the broker - */ - public Set getTemporaryQueues() { - return temporaryQueues; - } - - /** - * Returns the current temporary queues available on the broker - */ - public Set getTemporaryTopics() { - return temporaryTopics; - } - - public void start() throws JMSException { - if (started.compareAndSet(false, true)) { - session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - queueConsumer = session.createConsumer(AdvisorySupport.QUEUE_ADVISORY_TOPIC); - queueConsumer.setMessageListener(this); - - topicConsumer = session.createConsumer(AdvisorySupport.TOPIC_ADVISORY_TOPIC); - topicConsumer.setMessageListener(this); - - tempQueueConsumer = session.createConsumer(AdvisorySupport.TEMP_QUEUE_ADVISORY_TOPIC); - tempQueueConsumer.setMessageListener(this); - - tempTopicConsumer = session.createConsumer(AdvisorySupport.TEMP_TOPIC_ADVISORY_TOPIC); - tempTopicConsumer.setMessageListener(this); - } - } - - public void stop() throws JMSException { - if (started.compareAndSet(true, false)) { - if (session != null) { - session.close(); - } - } - } - - public void onMessage(Message message) { - if (message instanceof ActiveMQMessage) { - ActiveMQMessage activeMessage = (ActiveMQMessage) message; - Object command = activeMessage.getDataStructure(); - if (command instanceof DestinationInfo) { - DestinationInfo destinationInfo = (DestinationInfo) command; - DestinationEvent event = new DestinationEvent(this, destinationInfo); - fireDestinationEvent(event); - } - else { - LOG.warn("Unknown dataStructure: " + command); - } - } - else { - LOG.warn("Unknown message type: " + message + ". Message ignored"); - } - } - - protected void fireDestinationEvent(DestinationEvent event) { - // now lets update the data structures - ActiveMQDestination destination = event.getDestination(); - boolean add = event.isAddOperation(); - if (destination instanceof ActiveMQQueue) { - ActiveMQQueue queue = (ActiveMQQueue) destination; - if (add) { - queues.add(queue); - } - else { - queues.remove(queue); - } - } - else if (destination instanceof ActiveMQTopic) { - ActiveMQTopic topic = (ActiveMQTopic) destination; - if (add) { - topics.add(topic); - } - else { - topics.remove(topic); - } - } - else if (destination instanceof ActiveMQTempQueue) { - ActiveMQTempQueue queue = (ActiveMQTempQueue) destination; - if (add) { - temporaryQueues.add(queue); - } - else { - temporaryQueues.remove(queue); - } - } - else if (destination instanceof ActiveMQTempTopic) { - ActiveMQTempTopic topic = (ActiveMQTempTopic) destination; - if (add) { - temporaryTopics.add(topic); - } - else { - temporaryTopics.remove(topic); - } - } - else { - LOG.warn("Unknown destination type: " + destination); - } - if (listener != null) { - listener.onDestinationEvent(event); - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ProducerEvent.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ProducerEvent.class deleted file mode 100644 index d482ba100..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ProducerEvent.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ProducerEvent.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ProducerEvent.java deleted file mode 100644 index 29c41a7fb..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ProducerEvent.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * 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.advisory; - -import java.util.EventObject; - -import javax.jms.Destination; - -import org.apache.activemq.command.ProducerId; - -/** - * An event when the number of producers on a given destination changes. - * - * - */ -public abstract class ProducerEvent extends EventObject { - private static final long serialVersionUID = 2442156576867593780L; - private final Destination destination; - private final ProducerId producerId; - private final int producerCount; - - public ProducerEvent(ProducerEventSource source, Destination destination, ProducerId producerId, int producerCount) { - super(source); - this.destination = destination; - this.producerId = producerId; - this.producerCount = producerCount; - } - - public ProducerEventSource getAdvisor() { - return (ProducerEventSource) getSource(); - } - - public Destination getDestination() { - return destination; - } - - /** - * Returns the current number of producers active at the time this advisory was sent. - * - */ - public int getProducerCount() { - return producerCount; - } - - public ProducerId getProducerId() { - return producerId; - } - - public abstract boolean isStarted(); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ProducerEventSource.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ProducerEventSource.class deleted file mode 100644 index dd082774b..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ProducerEventSource.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ProducerEventSource.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ProducerEventSource.java deleted file mode 100644 index 0a9a2f0f1..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ProducerEventSource.java +++ /dev/null @@ -1,127 +0,0 @@ -/** - * 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.advisory; - -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicInteger; - -import javax.jms.Connection; -import javax.jms.Destination; -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.MessageConsumer; -import javax.jms.MessageListener; -import javax.jms.Session; - -import org.apache.activemq.Service; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ActiveMQMessage; -import org.apache.activemq.command.ActiveMQTopic; -import org.apache.activemq.command.ProducerId; -import org.apache.activemq.command.ProducerInfo; -import org.apache.activemq.command.RemoveInfo; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * An object which can be used to listen to the number of active consumers - * available on a given destination. - * - * - */ -public class ProducerEventSource implements Service, MessageListener { - private static final Logger LOG = LoggerFactory.getLogger(ProducerEventSource.class); - - private final Connection connection; - private final ActiveMQDestination destination; - private ProducerListener listener; - private AtomicBoolean started = new AtomicBoolean(false); - private AtomicInteger producerCount = new AtomicInteger(); - private Session session; - private MessageConsumer consumer; - - public ProducerEventSource(Connection connection, Destination destination) throws JMSException { - this.connection = connection; - this.destination = ActiveMQDestination.transform(destination); - } - - public void setProducerListener(ProducerListener listener) { - this.listener = listener; - } - - public void start() throws Exception { - if (started.compareAndSet(false, true)) { - session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - ActiveMQTopic advisoryTopic = AdvisorySupport.getProducerAdvisoryTopic(destination); - consumer = session.createConsumer(advisoryTopic); - consumer.setMessageListener(this); - } - } - - public void stop() throws Exception { - if (started.compareAndSet(true, false)) { - if (session != null) { - session.close(); - } - } - } - - public void onMessage(Message message) { - if (message instanceof ActiveMQMessage) { - ActiveMQMessage activeMessage = (ActiveMQMessage)message; - Object command = activeMessage.getDataStructure(); - int count = 0; - if (command instanceof ProducerInfo) { - count = producerCount.incrementAndGet(); - count = extractProducerCountFromMessage(message, count); - fireProducerEvent(new ProducerStartedEvent(this, destination, (ProducerInfo)command, count)); - } else if (command instanceof RemoveInfo) { - RemoveInfo removeInfo = (RemoveInfo)command; - if (removeInfo.isProducerRemove()) { - count = producerCount.decrementAndGet(); - count = extractProducerCountFromMessage(message, count); - fireProducerEvent(new ProducerStoppedEvent(this, destination, (ProducerId)removeInfo.getObjectId(), count)); - } - } else { - LOG.warn("Unknown command: " + command); - } - } else { - LOG.warn("Unknown message type: " + message + ". Message ignored"); - } - } - - protected int extractProducerCountFromMessage(Message message, int count) { - try { - Object value = message.getObjectProperty("producerCount"); - if (value instanceof Number) { - Number n = (Number)value; - return n.intValue(); - } - LOG.warn("No producerCount header available on the message: " + message); - } catch (Exception e) { - LOG.warn("Failed to extract producerCount from message: " + message + ".Reason: " + e, e); - } - return count; - } - - protected void fireProducerEvent(ProducerEvent event) { - if (listener != null) { - listener.onProducerEvent(event); - } - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ProducerListener.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ProducerListener.class deleted file mode 100644 index f962a1f56..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ProducerListener.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ProducerListener.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ProducerListener.java deleted file mode 100644 index d31c521b6..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ProducerListener.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * 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.advisory; - -/** - * Listen to the changes in the number of active consumers available for a given destination. - * - * - */ -public interface ProducerListener { - - void onProducerEvent(ProducerEvent event); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ProducerStartedEvent.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ProducerStartedEvent.class deleted file mode 100644 index 29cb03a3d..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ProducerStartedEvent.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ProducerStartedEvent.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ProducerStartedEvent.java deleted file mode 100644 index 7917c6043..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ProducerStartedEvent.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * 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.advisory; - -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ProducerInfo; - -/** - * An event when a new consumer has started. - * - * - */ -public class ProducerStartedEvent extends ProducerEvent { - - private static final long serialVersionUID = 5088138839609391074L; - - private final transient ProducerInfo consumerInfo; - - public ProducerStartedEvent(ProducerEventSource source, ActiveMQDestination destination, ProducerInfo consumerInfo, int count) { - super(source, destination, consumerInfo.getProducerId(), count); - this.consumerInfo = consumerInfo; - } - - public boolean isStarted() { - return true; - } - - /** - * @return details of the subscription - */ - public ProducerInfo getProducerInfo() { - return consumerInfo; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ProducerStoppedEvent.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ProducerStoppedEvent.class deleted file mode 100644 index 8dcfe3b58..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ProducerStoppedEvent.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ProducerStoppedEvent.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ProducerStoppedEvent.java deleted file mode 100644 index 5868a3aad..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/ProducerStoppedEvent.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * 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.advisory; - -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ProducerId; - -/** - * An event generated when a consumer stops. - * - * - */ -public class ProducerStoppedEvent extends ProducerEvent { - - private static final long serialVersionUID = 5378835541037193206L; - - public ProducerStoppedEvent(ProducerEventSource source, ActiveMQDestination destination, ProducerId consumerId, int count) { - super(source, destination, consumerId, count); - } - - public boolean isStarted() { - return false; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/package.html b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/package.html deleted file mode 100644 index 9573368f2..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/advisory/package.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - -Support for JMS Advisory messages as well as some helper listeners to listen to the clients, producers and consumers available. - - - diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/BlobDownloadStrategy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/BlobDownloadStrategy.class deleted file mode 100644 index 184ddf361..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/BlobDownloadStrategy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/BlobDownloadStrategy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/BlobDownloadStrategy.java deleted file mode 100644 index b33e9a8fd..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/BlobDownloadStrategy.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * 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.blob; - -import java.io.IOException; -import java.io.InputStream; -import javax.jms.JMSException; -import org.apache.activemq.command.ActiveMQBlobMessage; - -/** - * Represents a strategy of downloading a file/stream from some remote - */ -public interface BlobDownloadStrategy { - - InputStream getInputStream(ActiveMQBlobMessage message) throws IOException, JMSException; - - void deleteFile(ActiveMQBlobMessage message) throws IOException, JMSException; - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/BlobDownloader.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/BlobDownloader.class deleted file mode 100644 index 9b805b332..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/BlobDownloader.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/BlobDownloader.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/BlobDownloader.java deleted file mode 100644 index 5f638603d..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/BlobDownloader.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * 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.blob; - -import java.io.IOException; -import java.io.InputStream; -import javax.jms.JMSException; -import org.apache.activemq.command.ActiveMQBlobMessage; - - -/** - * Mediator for Blob Download - */ -public class BlobDownloader { - - private final BlobTransferPolicy blobTransferPolicy; - - public BlobDownloader(BlobTransferPolicy transferPolicy) { - // need to do a defensive copy - this.blobTransferPolicy = transferPolicy.copy(); - } - - public InputStream getInputStream(ActiveMQBlobMessage message) throws IOException, JMSException { - return getStrategy().getInputStream(message); - } - - public void deleteFile(ActiveMQBlobMessage message) throws IOException, JMSException { - getStrategy().deleteFile(message); - } - - public BlobTransferPolicy getBlobTransferPolicy() { - return blobTransferPolicy; - } - - public BlobDownloadStrategy getStrategy() { - return getBlobTransferPolicy().getDownloadStrategy(); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/BlobTransferPolicy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/BlobTransferPolicy.class deleted file mode 100644 index e4a7fe634..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/BlobTransferPolicy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/BlobTransferPolicy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/BlobTransferPolicy.java deleted file mode 100644 index de6ca6837..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/BlobTransferPolicy.java +++ /dev/null @@ -1,178 +0,0 @@ -/** - * 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.blob; - -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; - -/** - * The policy for configuring how BLOBs (Binary Large OBjects) are transferred - * out of band between producers, brokers and consumers. - * - * - */ -public class BlobTransferPolicy { - private String defaultUploadUrl = "http://localhost:8080/uploads/"; - private String brokerUploadUrl; - private String uploadUrl; - private int bufferSize = 128 * 1024; - private BlobUploadStrategy uploadStrategy; - private BlobDownloadStrategy downloadStrategy; - - /** - * Returns a copy of this policy object - */ - public BlobTransferPolicy copy() { - BlobTransferPolicy that = new BlobTransferPolicy(); - that.defaultUploadUrl = this.defaultUploadUrl; - that.brokerUploadUrl = this.brokerUploadUrl; - that.uploadUrl = this.uploadUrl; - that.bufferSize = this.bufferSize; - that.uploadStrategy = this.uploadStrategy; - that.downloadStrategy = this.downloadStrategy; - return that; - } - - public String getUploadUrl() { - if (uploadUrl == null) { - uploadUrl = getBrokerUploadUrl(); - if (uploadUrl == null) { - uploadUrl = getDefaultUploadUrl(); - } - } - return uploadUrl; - } - - /** - * Sets the upload URL to use explicitly on the client which will - * overload the default or the broker's URL. This allows the client to decide - * where to upload files to irrespective of the brokers configuration. - */ - public void setUploadUrl(String uploadUrl) { - this.uploadUrl = uploadUrl; - } - - public String getBrokerUploadUrl() { - return brokerUploadUrl; - } - - /** - * Called by the JMS client when a broker advertises its upload URL - */ - public void setBrokerUploadUrl(String brokerUploadUrl) { - this.brokerUploadUrl = brokerUploadUrl; - } - - public String getDefaultUploadUrl() { - return defaultUploadUrl; - } - - /** - * Sets the default upload URL to use if the broker does not - * have a configured upload URL - */ - public void setDefaultUploadUrl(String defaultUploadUrl) { - this.defaultUploadUrl = defaultUploadUrl; - } - - public BlobUploadStrategy getUploadStrategy() { - if (uploadStrategy == null) { - uploadStrategy = createUploadStrategy(); - } - return uploadStrategy; - } - - public BlobDownloadStrategy getDownloadStrategy() { - if(downloadStrategy == null) { - downloadStrategy = createDownloadStrategy(); - } - return downloadStrategy; - } - - /** - * Sets the upload strategy to use for uploading BLOBs to some URL - */ - public void setUploadStrategy(BlobUploadStrategy uploadStrategy) { - this.uploadStrategy = uploadStrategy; - } - - public int getBufferSize() { - return bufferSize; - } - - /** - * Sets the default buffer size used when uploading or downloading files - */ - public void setBufferSize(int bufferSize) { - this.bufferSize = bufferSize; - } - - /** - * Returns the upload strategy depending on the information from the - * uploadURL. Currently supportet HTTP and FTP - * - * @return - */ - protected BlobUploadStrategy createUploadStrategy() { - BlobUploadStrategy strategy; - try { - URL url = new URL(getUploadUrl()); - - if(url.getProtocol().equalsIgnoreCase("FTP")) { - strategy = new FTPBlobUploadStrategy(this); - } else if (url.getProtocol().equalsIgnoreCase("FILE")) { - strategy = new FileSystemBlobStrategy(this); - } else { - strategy = new DefaultBlobUploadStrategy(this); - } - } catch (MalformedURLException e) { - strategy = new DefaultBlobUploadStrategy(this); - } catch (URISyntaxException e) { - strategy = new DefaultBlobUploadStrategy(this); - } - return strategy; - } - - /** - * Returns the download strategy depending on the information from the - * uploadURL. Currently supportet HTTP and FTP - * - * @return - */ - protected BlobDownloadStrategy createDownloadStrategy() { - BlobDownloadStrategy strategy; - try { - URL url = new URL(getUploadUrl()); - - if(url.getProtocol().equalsIgnoreCase("FTP")) { - strategy = new FTPBlobDownloadStrategy(this); - } else if (url.getProtocol().equalsIgnoreCase("FILE")) { - strategy = new FileSystemBlobStrategy(this); - } else { - strategy = new DefaultBlobDownloadStrategy(this); - } - } catch (MalformedURLException e) { - strategy = new DefaultBlobDownloadStrategy(this); - } catch (URISyntaxException e) { - strategy = new DefaultBlobDownloadStrategy(this); - } - return strategy; - } - - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/BlobUploadStrategy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/BlobUploadStrategy.class deleted file mode 100644 index a125911ba..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/BlobUploadStrategy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/BlobUploadStrategy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/BlobUploadStrategy.java deleted file mode 100644 index dbf1ffc64..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/BlobUploadStrategy.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * 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.blob; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; - -import javax.jms.JMSException; - -import org.apache.activemq.command.ActiveMQBlobMessage; - -/** - * Represents a strategy of uploading a file/stream to some remote - * - * - */ -public interface BlobUploadStrategy { - - URL uploadFile(ActiveMQBlobMessage message, File file) throws JMSException, IOException; - - URL uploadStream(ActiveMQBlobMessage message, InputStream in) throws JMSException, IOException; -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/BlobUploader.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/BlobUploader.class deleted file mode 100644 index d33175773..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/BlobUploader.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/BlobUploader.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/BlobUploader.java deleted file mode 100644 index 244948a93..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/BlobUploader.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * 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.blob; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; - -import javax.jms.JMSException; - -import org.apache.activemq.command.ActiveMQBlobMessage; - -/** - * A helper class to represent a required upload of a BLOB to some remote URL - * - * - */ -public class BlobUploader { - - private final BlobTransferPolicy blobTransferPolicy; - private File file; - private InputStream in; - - public BlobUploader(BlobTransferPolicy blobTransferPolicy, InputStream in) { - // need to do a defensive copy - this.blobTransferPolicy = blobTransferPolicy.copy(); - this.in = in; - } - - public BlobUploader(BlobTransferPolicy blobTransferPolicy, File file) { - // need to do a defensive copy - this.blobTransferPolicy = blobTransferPolicy.copy(); - this.file = file; - } - - public URL upload(ActiveMQBlobMessage message) throws JMSException, IOException { - if (file != null) { - return getStrategy().uploadFile(message, file); - } else { - return getStrategy().uploadStream(message, in); - } - } - - public BlobTransferPolicy getBlobTransferPolicy() { - return blobTransferPolicy; - } - - public BlobUploadStrategy getStrategy() { - return getBlobTransferPolicy().getUploadStrategy(); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/DefaultBlobDownloadStrategy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/DefaultBlobDownloadStrategy.class deleted file mode 100644 index 6176eda7c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/DefaultBlobDownloadStrategy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/DefaultBlobDownloadStrategy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/DefaultBlobDownloadStrategy.java deleted file mode 100644 index 56695c78d..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/DefaultBlobDownloadStrategy.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * 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.blob; - -import java.io.IOException; -import java.io.InputStream; -import java.net.HttpURLConnection; -import java.net.URL; -import javax.jms.JMSException; -import org.apache.activemq.command.ActiveMQBlobMessage; - -/** - * A default implementation of {@link BlobDownloadStrategy} which uses the URL - * class to download files or streams from a remote URL - */ -public class DefaultBlobDownloadStrategy extends DefaultStrategy implements BlobDownloadStrategy { - - public DefaultBlobDownloadStrategy(BlobTransferPolicy transferPolicy) { - super(transferPolicy); - } - - public InputStream getInputStream(ActiveMQBlobMessage message) throws IOException, JMSException { - URL value = message.getURL(); - if (value == null) { - return null; - } - return value.openStream(); - } - - public void deleteFile(ActiveMQBlobMessage message) throws IOException, JMSException { - URL url = createMessageURL(message); - - HttpURLConnection connection = (HttpURLConnection)url.openConnection(); - connection.setRequestMethod("DELETE"); - connection.connect(); - connection.disconnect(); - - if (!isSuccessfulCode(connection.getResponseCode())) { - throw new IOException("DELETE was not successful: " + connection.getResponseCode() + " " - + connection.getResponseMessage()); - } - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/DefaultBlobUploadStrategy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/DefaultBlobUploadStrategy.class deleted file mode 100644 index c7af6b12b..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/DefaultBlobUploadStrategy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/DefaultBlobUploadStrategy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/DefaultBlobUploadStrategy.java deleted file mode 100644 index 12c98a391..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/DefaultBlobUploadStrategy.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - * 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.blob; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.HttpURLConnection; -import java.net.MalformedURLException; -import java.net.URL; - -import javax.jms.JMSException; - -import org.apache.activemq.command.ActiveMQBlobMessage; - -/** - * A default implementation of {@link BlobUploadStrategy} which uses the URL - * class to upload files or streams to a remote URL - */ -public class DefaultBlobUploadStrategy extends DefaultStrategy implements BlobUploadStrategy { - - public DefaultBlobUploadStrategy(BlobTransferPolicy transferPolicy) { - super(transferPolicy); - } - - public URL uploadFile(ActiveMQBlobMessage message, File file) throws JMSException, IOException { - return uploadStream(message, new FileInputStream(file)); - } - - public URL uploadStream(ActiveMQBlobMessage message, InputStream fis) throws JMSException, IOException { - URL url = createMessageURL(message); - - HttpURLConnection connection = (HttpURLConnection)url.openConnection(); - connection.setRequestMethod("PUT"); - connection.setDoOutput(true); - - // use chunked mode or otherwise URLConnection loads everything into - // memory - // (chunked mode not supported before JRE 1.5) - connection.setChunkedStreamingMode(transferPolicy.getBufferSize()); - - OutputStream os = connection.getOutputStream(); - - byte[] buf = new byte[transferPolicy.getBufferSize()]; - for (int c = fis.read(buf); c != -1; c = fis.read(buf)) { - os.write(buf, 0, c); - os.flush(); - } - os.close(); - fis.close(); - - if (!isSuccessfulCode(connection.getResponseCode())) { - throw new IOException("PUT was not successful: " + connection.getResponseCode() + " " - + connection.getResponseMessage()); - } - - return url; - } - - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/DefaultStrategy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/DefaultStrategy.class deleted file mode 100644 index 49cfae62f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/DefaultStrategy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/DefaultStrategy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/DefaultStrategy.java deleted file mode 100644 index bb8fb0e6b..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/DefaultStrategy.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * 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.blob; - -import java.net.MalformedURLException; -import java.net.URL; - -import javax.jms.JMSException; - -import org.apache.activemq.command.ActiveMQBlobMessage; - -public class DefaultStrategy { - - protected BlobTransferPolicy transferPolicy; - - public DefaultStrategy(BlobTransferPolicy transferPolicy) { - this.transferPolicy = transferPolicy; - } - - protected boolean isSuccessfulCode(int responseCode) { - return responseCode >= 200 && responseCode < 300; // 2xx => successful - } - - protected URL createMessageURL(ActiveMQBlobMessage message) throws JMSException, MalformedURLException { - return new URL(transferPolicy.getUploadUrl() + message.getMessageId().toString()); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/FTPBlobDownloadStrategy$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/FTPBlobDownloadStrategy$1.class deleted file mode 100644 index f3bd52ada..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/FTPBlobDownloadStrategy$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/FTPBlobDownloadStrategy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/FTPBlobDownloadStrategy.class deleted file mode 100644 index 509f25727..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/FTPBlobDownloadStrategy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/FTPBlobDownloadStrategy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/FTPBlobDownloadStrategy.java deleted file mode 100644 index 4962e4e92..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/FTPBlobDownloadStrategy.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * 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.blob; - -import java.io.FilterInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.net.MalformedURLException; - -import javax.jms.JMSException; - -import org.apache.activemq.command.ActiveMQBlobMessage; -import org.apache.commons.net.ftp.FTPClient; - -/** - * A FTP implementation for {@link BlobDownloadStrategy}. - */ -public class FTPBlobDownloadStrategy extends FTPStrategy implements BlobDownloadStrategy { - - public FTPBlobDownloadStrategy(BlobTransferPolicy transferPolicy) throws MalformedURLException { - super(transferPolicy); - } - - public InputStream getInputStream(ActiveMQBlobMessage message) throws IOException, JMSException { - url = message.getURL(); - final FTPClient ftp = createFTP(); - String path = url.getPath(); - String workingDir = path.substring(0, path.lastIndexOf("/")); - String file = path.substring(path.lastIndexOf("/") + 1); - ftp.changeWorkingDirectory(workingDir); - ftp.setFileType(FTPClient.BINARY_FILE_TYPE); - - InputStream input = new FilterInputStream(ftp.retrieveFileStream(file)) { - - public void close() throws IOException { - in.close(); - ftp.quit(); - ftp.disconnect(); - } - }; - - return input; - } - - public void deleteFile(ActiveMQBlobMessage message) throws IOException, JMSException { - url = message.getURL(); - final FTPClient ftp = createFTP(); - - String path = url.getPath(); - try { - if (!ftp.deleteFile(path)) { - throw new JMSException("Delete file failed: " + ftp.getReplyString()); - } - } finally { - ftp.quit(); - ftp.disconnect(); - } - - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/FTPBlobUploadStrategy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/FTPBlobUploadStrategy.class deleted file mode 100644 index d1b561d24..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/FTPBlobUploadStrategy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/FTPBlobUploadStrategy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/FTPBlobUploadStrategy.java deleted file mode 100644 index 6cb0e8ae7..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/FTPBlobUploadStrategy.java +++ /dev/null @@ -1,74 +0,0 @@ -/** - * 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.blob; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URL; - -import javax.jms.JMSException; - -import org.apache.activemq.command.ActiveMQBlobMessage; -import org.apache.commons.net.ftp.FTPClient; - -/** - * A FTP implementation of {@link BlobUploadStrategy}. - */ -public class FTPBlobUploadStrategy extends FTPStrategy implements BlobUploadStrategy { - - public FTPBlobUploadStrategy(BlobTransferPolicy transferPolicy) throws MalformedURLException { - super(transferPolicy); - } - - @Override - public URL uploadFile(ActiveMQBlobMessage message, File file) throws JMSException, IOException { - return uploadStream(message, new FileInputStream(file)); - } - - @Override - public URL uploadStream(ActiveMQBlobMessage message, InputStream in) - throws JMSException, IOException { - - FTPClient ftp = createFTP(); - try { - String path = url.getPath(); - String workingDir = path.substring(0, path.lastIndexOf("/")); - String filename = message.getMessageId().toString().replaceAll(":", "_"); - ftp.setFileType(FTPClient.BINARY_FILE_TYPE); - - String url; - if(!ftp.changeWorkingDirectory(workingDir)) { - url = this.url.toString().replaceFirst(this.url.getPath(), "")+"/"; - } else { - url = this.url.toString(); - } - - if (!ftp.storeFile(filename, in)) { - throw new JMSException("FTP store failed: " + ftp.getReplyString()); - } - return new URL(url + filename); - } finally { - ftp.quit(); - ftp.disconnect(); - } - - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/FTPStrategy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/FTPStrategy.class deleted file mode 100644 index 2ca08fdca..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/FTPStrategy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/FTPStrategy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/FTPStrategy.java deleted file mode 100644 index 5983c2871..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/FTPStrategy.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * 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.blob; - -import java.io.IOException; -import java.net.ConnectException; -import java.net.MalformedURLException; -import java.net.URL; - -import javax.jms.JMSException; - -import org.apache.activemq.command.ActiveMQBlobMessage; -import org.apache.commons.net.ftp.FTPClient; - -public class FTPStrategy { - - protected BlobTransferPolicy transferPolicy; - protected URL url; - protected String ftpUser = ""; - protected String ftpPass = ""; - - public FTPStrategy(BlobTransferPolicy transferPolicy) throws MalformedURLException { - this.transferPolicy = transferPolicy; - this.url = new URL(this.transferPolicy.getUploadUrl()); - } - - protected void setUserInformation(String userInfo) { - if(userInfo != null) { - String[] userPass = userInfo.split(":"); - if(userPass.length > 0) this.ftpUser = userPass[0]; - if(userPass.length > 1) this.ftpPass = userPass[1]; - } else { - this.ftpUser = "anonymous"; - this.ftpPass = "anonymous"; - } - } - - protected FTPClient createFTP() throws IOException, JMSException { - String connectUrl = url.getHost(); - setUserInformation(url.getUserInfo()); - int port = url.getPort() < 1 ? 21 : url.getPort(); - - FTPClient ftp = new FTPClient(); - try { - ftp.connect(connectUrl, port); - } catch(ConnectException e) { - throw new JMSException("Problem connecting the FTP-server"); - } - if(!ftp.login(ftpUser, ftpPass)) { - ftp.quit(); - ftp.disconnect(); - throw new JMSException("Cant Authentificate to FTP-Server"); - } - return ftp; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/FileSystemBlobStrategy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/FileSystemBlobStrategy.class deleted file mode 100644 index aa3b7c243..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/FileSystemBlobStrategy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/FileSystemBlobStrategy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/FileSystemBlobStrategy.java deleted file mode 100644 index 022aec1d9..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/FileSystemBlobStrategy.java +++ /dev/null @@ -1,130 +0,0 @@ -/** - * 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.blob; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; - -import javax.jms.JMSException; - -import org.apache.activemq.command.ActiveMQBlobMessage; - -/** - * {@link BlobUploadStrategy} and {@link BlobDownloadStrategy} implementation which use the local filesystem for storing - * the payload - * - */ -public class FileSystemBlobStrategy implements BlobUploadStrategy, BlobDownloadStrategy{ - - - private final BlobTransferPolicy policy; - private File rootFile; - - public FileSystemBlobStrategy(final BlobTransferPolicy policy) throws MalformedURLException, URISyntaxException { - this.policy = policy; - - createRootFolder(); - } - - /** - * Create the root folder if not exist - * - * @throws MalformedURLException - * @throws URISyntaxException - */ - protected void createRootFolder() throws MalformedURLException, URISyntaxException { - rootFile = new File(new URL(policy.getUploadUrl()).toURI()); - if (rootFile.exists() == false) { - rootFile.mkdirs(); - } else if (rootFile.isDirectory() == false) { - throw new IllegalArgumentException("Given url is not a directory " + rootFile ); - } - } - /* - * (non-Javadoc) - * @see org.apache.activemq.blob.BlobUploadStrategy#uploadFile(org.apache.activemq.command.ActiveMQBlobMessage, java.io.File) - */ - public URL uploadFile(ActiveMQBlobMessage message, File file) throws JMSException, IOException { - return uploadStream(message, new FileInputStream(file)); - } - - /* - * (non-Javadoc) - * @see org.apache.activemq.blob.BlobUploadStrategy#uploadStream(org.apache.activemq.command.ActiveMQBlobMessage, java.io.InputStream) - */ - public URL uploadStream(ActiveMQBlobMessage message, InputStream in) throws JMSException, IOException { - File f = getFile(message); - FileOutputStream out = new FileOutputStream(f); - byte[] buffer = new byte[policy.getBufferSize()]; - for (int c = in.read(buffer); c != -1; c = in.read(buffer)) { - out.write(buffer, 0, c); - out.flush(); - } - out.flush(); - out.close(); - // File.toURL() is deprecated - return f.toURI().toURL(); - } - - /* - * (non-Javadoc) - * @see org.apache.activemq.blob.BlobDownloadStrategy#deleteFile(org.apache.activemq.command.ActiveMQBlobMessage) - */ - public void deleteFile(ActiveMQBlobMessage message) throws IOException, JMSException { - File f = getFile(message); - if (f.exists()) { - if (f.delete() == false) throw new IOException("Unable to delete file " + f); - } - } - - /** - * Returns a {@link FileInputStream} for the give {@link ActiveMQBlobMessage} - */ - public InputStream getInputStream(ActiveMQBlobMessage message) throws IOException, JMSException { - return new FileInputStream(getFile(message)); - } - - - /** - * Return the {@link File} for the {@link ActiveMQBlobMessage}. - * - * @param message - * @return file - * @throws JMSException - * @throws IOException - */ - protected File getFile(ActiveMQBlobMessage message) throws JMSException, IOException { - if (message.getURL() != null) { - try { - return new File(message.getURL().toURI()); - } catch (URISyntaxException e) { - IOException ioe = new IOException("Unable to open file for message " + message); - ioe.initCause(e); - } - } - //replace all : with _ to make windows more happy - String fileName = message.getJMSMessageID().replaceAll(":", "_"); - return new File(rootFile, fileName); - - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/package.html b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/package.html deleted file mode 100644 index 2964e78d3..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/blob/package.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - -Helper classes for dealing with out-of-band BLOB objects - - - diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/AbstractLocker.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/AbstractLocker.class deleted file mode 100644 index 90ee6d983..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/AbstractLocker.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/AbstractLocker.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/AbstractLocker.java deleted file mode 100644 index 38aab9be4..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/AbstractLocker.java +++ /dev/null @@ -1,60 +0,0 @@ -/** - * 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.broker; - -import org.apache.activemq.util.ServiceSupport; - -import java.io.IOException; - -public abstract class AbstractLocker extends ServiceSupport implements Locker { - - public static final long DEFAULT_LOCK_ACQUIRE_SLEEP_INTERVAL = 10 * 1000; - - protected String name; - protected boolean failIfLocked = false; - protected long lockAcquireSleepInterval = DEFAULT_LOCK_ACQUIRE_SLEEP_INTERVAL; - protected LockableServiceSupport lockable; - - @Override - public boolean keepAlive() throws IOException { - return true; - } - - @Override - public void setLockAcquireSleepInterval(long lockAcquireSleepInterval) { - this.lockAcquireSleepInterval = lockAcquireSleepInterval; - } - - public long getLockAcquireSleepInterval() { - return lockAcquireSleepInterval; - } - - @Override - public void setName(String name) { - this.name = name; - } - - @Override - public void setFailIfLocked(boolean failIfLocked) { - this.failIfLocked = failIfLocked; - } - - @Override - public void setLockable(LockableServiceSupport lockableServiceSupport) { - this.lockable = lockableServiceSupport; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/Broker.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/Broker.class deleted file mode 100644 index 8b8b86b07..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/Broker.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/Broker.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/Broker.java deleted file mode 100644 index c2fd132dc..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/Broker.java +++ /dev/null @@ -1,395 +0,0 @@ -/** - * 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.broker; - -import java.net.URI; -import java.util.Set; -import java.util.concurrent.ThreadPoolExecutor; - -import org.apache.activemq.Service; -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.broker.region.Region; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.BrokerId; -import org.apache.activemq.command.BrokerInfo; -import org.apache.activemq.command.ConnectionInfo; -import org.apache.activemq.command.DestinationInfo; -import org.apache.activemq.command.MessageDispatch; -import org.apache.activemq.command.ProducerInfo; -import org.apache.activemq.command.SessionInfo; -import org.apache.activemq.command.TransactionId; -import org.apache.activemq.store.PListStore; -import org.apache.activemq.thread.Scheduler; -import org.apache.activemq.usage.Usage; - -/** - * The Message Broker which routes messages, maintains subscriptions and - * connections, acknowledges messages and handles transactions. - * - * - */ -public interface Broker extends Region, Service { - - /** - * Get a Broker from the Broker Stack that is a particular class - * - * @param type - * @return - */ - Broker getAdaptor(Class type); - - /** - * Get the id of the broker - */ - BrokerId getBrokerId(); - - /** - * Get the name of the broker - */ - String getBrokerName(); - - /** - * A remote Broker connects - */ - void addBroker(Connection connection, BrokerInfo info); - - /** - * Remove a BrokerInfo - * - * @param connection - * @param info - */ - void removeBroker(Connection connection, BrokerInfo info); - - /** - * A client is establishing a connection with the broker. - * - * @throws Exception TODO - */ - void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception; - - /** - * A client is disconnecting from the broker. - * - * @param context the environment the operation is being executed under. - * @param info - * @param error null if the client requested the disconnect or the error - * that caused the client to disconnect. - * @throws Exception TODO - */ - void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception; - - /** - * Adds a session. - * - * @param context - * @param info - * @throws Exception TODO - */ - void addSession(ConnectionContext context, SessionInfo info) throws Exception; - - /** - * Removes a session. - * - * @param context - * @param info - * @throws Exception TODO - */ - void removeSession(ConnectionContext context, SessionInfo info) throws Exception; - - /** - * Adds a producer. - * - * @param context the enviorment the operation is being executed under. - * @throws Exception TODO - */ - @Override - void addProducer(ConnectionContext context, ProducerInfo info) throws Exception; - - /** - * Removes a producer. - * - * @param context the enviorment the operation is being executed under. - * @throws Exception TODO - */ - @Override - void removeProducer(ConnectionContext context, ProducerInfo info) throws Exception; - - /** - * @return all clients added to the Broker. - * @throws Exception TODO - */ - Connection[] getClients() throws Exception; - - /** - * @return all destinations added to the Broker. - * @throws Exception TODO - */ - ActiveMQDestination[] getDestinations() throws Exception; - - /** - * Gets a list of all the prepared xa transactions. - * - * @param context transaction ids - * @return - * @throws Exception TODO - */ - TransactionId[] getPreparedTransactions(ConnectionContext context) throws Exception; - - /** - * Starts a transaction. - * - * @param context - * @param xid - * @throws Exception TODO - */ - void beginTransaction(ConnectionContext context, TransactionId xid) throws Exception; - - /** - * Prepares a transaction. Only valid for xa transactions. - * - * @param context - * @param xid - * @return id - * @throws Exception TODO - */ - int prepareTransaction(ConnectionContext context, TransactionId xid) throws Exception; - - /** - * Rollsback a transaction. - * - * @param context - * @param xid - * @throws Exception TODO - */ - - void rollbackTransaction(ConnectionContext context, TransactionId xid) throws Exception; - - /** - * Commits a transaction. - * - * @param context - * @param xid - * @param onePhase - * @throws Exception TODO - */ - void commitTransaction(ConnectionContext context, TransactionId xid, boolean onePhase) throws Exception; - - /** - * Forgets a transaction. - * - * @param context - * @param transactionId - * @throws Exception - */ - void forgetTransaction(ConnectionContext context, TransactionId transactionId) throws Exception; - - /** - * Get the BrokerInfo's of any connected Brokers - * - * @return array of peer BrokerInfos - */ - BrokerInfo[] getPeerBrokerInfos(); - - /** - * Notify the Broker that a dispatch is going to happen - * - * @param messageDispatch - */ - void preProcessDispatch(MessageDispatch messageDispatch); - - /** - * Notify the Broker that a dispatch has happened - * - * @param messageDispatch - */ - void postProcessDispatch(MessageDispatch messageDispatch); - - /** - * @return true if the broker has stopped - */ - boolean isStopped(); - - /** - * @return a Set of all durable destinations - */ - Set getDurableDestinations(); - - /** - * Add and process a DestinationInfo object - * - * @param context - * @param info - * @throws Exception - */ - void addDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception; - - /** - * Remove and process a DestinationInfo object - * - * @param context - * @param info - * @throws Exception - */ - void removeDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception; - - /** - * @return true if fault tolerant - */ - boolean isFaultTolerantConfiguration(); - - /** - * @return the connection context used to make administration operations on - * startup or via JMX MBeans - */ - ConnectionContext getAdminConnectionContext(); - - /** - * Sets the default administration connection context used when configuring - * the broker on startup or via JMX - * - * @param adminConnectionContext - */ - void setAdminConnectionContext(ConnectionContext adminConnectionContext); - - /** - * @return the temp data store - */ - PListStore getTempDataStore(); - - /** - * @return the URI that can be used to connect to the local Broker - */ - URI getVmConnectorURI(); - - /** - * called when the brokerService starts - */ - void brokerServiceStarted(); - - /** - * @return the BrokerService - */ - BrokerService getBrokerService(); - - /** - * Ensure we get the Broker at the top of the Stack - * - * @return the broker at the top of the Stack - */ - Broker getRoot(); - - /** - * Determine if a message has expired -allows default behaviour to be - * overriden - as the timestamp set by the producer can be out of sync with - * the broker - * - * @param messageReference - * @return true if the message is expired - */ - boolean isExpired(MessageReference messageReference); - - /** - * A Message has Expired - * - * @param context - * @param messageReference - * @param subscription, may be null - */ - void messageExpired(ConnectionContext context, MessageReference messageReference, Subscription subscription); - - /** - * A message needs to go the a DLQ - * - * - * @param context - * @param messageReference - * @param poisonCause reason for dlq submission, may be null - * @return true if Message was placed in a DLQ false if discarded. - */ - boolean sendToDeadLetterQueue(ConnectionContext context, MessageReference messageReference, Subscription subscription, Throwable poisonCause); - - /** - * @return the broker sequence id - */ - long getBrokerSequenceId(); - - /** - * called when message is consumed - * @param context - * @param messageReference - */ - void messageConsumed(ConnectionContext context, MessageReference messageReference); - - /** - * Called when message is delivered to the broker - * @param context - * @param messageReference - */ - void messageDelivered(ConnectionContext context, MessageReference messageReference); - - /** - * Called when a message is discarded - e.g. running low on memory - * This will happen only if the policy is enabled - e.g. non durable topics - * @param context - * @param sub - * @param messageReference - */ - void messageDiscarded(ConnectionContext context, Subscription sub, MessageReference messageReference); - - /** - * Called when there is a slow consumer - * @param context - * @param destination - * @param subs - */ - void slowConsumer(ConnectionContext context,Destination destination, Subscription subs); - - /** - * Called to notify a producer is too fast - * @param context - * @param producerInfo - * @param destination - */ - void fastProducer(ConnectionContext context,ProducerInfo producerInfo,ActiveMQDestination destination); - - /** - * Called when a Usage reaches a limit - * @param context - * @param destination - * @param usage - */ - void isFull(ConnectionContext context,Destination destination,Usage usage); - - /** - * called when the broker becomes the master in a master/slave - * configuration - */ - void nowMasterBroker(); - - Scheduler getScheduler(); - - ThreadPoolExecutor getExecutor(); - - void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex, String remoteIp); - - void networkBridgeStopped(BrokerInfo brokerInfo); - - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerBroadcaster.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerBroadcaster.class deleted file mode 100644 index 28e9f252f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerBroadcaster.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerBroadcaster.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerBroadcaster.java deleted file mode 100644 index 84fa23061..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerBroadcaster.java +++ /dev/null @@ -1,272 +0,0 @@ -/** - * 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.broker; - -import java.util.ArrayList; -import java.util.List; -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.BrokerInfo; -import org.apache.activemq.command.ConnectionInfo; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.command.Message; -import org.apache.activemq.command.MessageAck; -import org.apache.activemq.command.ProducerInfo; -import org.apache.activemq.command.RemoveSubscriptionInfo; -import org.apache.activemq.command.SessionInfo; -import org.apache.activemq.command.TransactionId; - -/** - * Used to add listeners for Broker actions - * - * - */ -public class BrokerBroadcaster extends BrokerFilter { - protected volatile Broker[] listeners = new Broker[0]; - - public BrokerBroadcaster(Broker next) { - super(next); - } - - @Override - public void acknowledge(ConsumerBrokerExchange consumerExchange, MessageAck ack) throws Exception { - next.acknowledge(consumerExchange, ack); - Broker brokers[] = getListeners(); - for (int i = 0; i < brokers.length; i++) { - brokers[i].acknowledge(consumerExchange, ack); - } - } - - @Override - public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception { - next.addConnection(context, info); - Broker brokers[] = getListeners(); - for (int i = 0; i < brokers.length; i++) { - brokers[i].addConnection(context, info); - } - } - - @Override - public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { - Subscription answer = next.addConsumer(context, info); - Broker brokers[] = getListeners(); - for (int i = 0; i < brokers.length; i++) { - brokers[i].addConsumer(context, info); - } - return answer; - } - - @Override - public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception { - next.addProducer(context, info); - Broker brokers[] = getListeners(); - for (int i = 0; i < brokers.length; i++) { - brokers[i].addProducer(context, info); - } - } - - @Override - public void commitTransaction(ConnectionContext context, TransactionId xid, boolean onePhase) throws Exception { - next.commitTransaction(context, xid, onePhase); - Broker brokers[] = getListeners(); - for (int i = 0; i < brokers.length; i++) { - brokers[i].commitTransaction(context, xid, onePhase); - } - } - - @Override - public void removeSubscription(ConnectionContext context, RemoveSubscriptionInfo info) throws Exception { - next.removeSubscription(context, info); - Broker brokers[] = getListeners(); - for (int i = 0; i < brokers.length; i++) { - brokers[i].removeSubscription(context, info); - } - } - - @Override - public int prepareTransaction(ConnectionContext context, TransactionId xid) throws Exception { - int result = next.prepareTransaction(context, xid); - Broker brokers[] = getListeners(); - for (int i = 0; i < brokers.length; i++) { - // TODO decide what to do with return values - brokers[i].prepareTransaction(context, xid); - } - return result; - } - - @Override - public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception { - next.removeConnection(context, info, error); - Broker brokers[] = getListeners(); - for (int i = 0; i < brokers.length; i++) { - brokers[i].removeConnection(context, info, error); - } - } - - @Override - public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { - next.removeConsumer(context, info); - Broker brokers[] = getListeners(); - for (int i = 0; i < brokers.length; i++) { - brokers[i].removeConsumer(context, info); - } - } - - @Override - public void removeProducer(ConnectionContext context, ProducerInfo info) throws Exception { - next.removeProducer(context, info); - Broker brokers[] = getListeners(); - for (int i = 0; i < brokers.length; i++) { - brokers[i].removeProducer(context, info); - } - } - - @Override - public void rollbackTransaction(ConnectionContext context, TransactionId xid) throws Exception { - next.rollbackTransaction(context, xid); - Broker brokers[] = getListeners(); - for (int i = 0; i < brokers.length; i++) { - brokers[i].rollbackTransaction(context, xid); - } - } - - @Override - public void send(ProducerBrokerExchange producerExchange, Message messageSend) throws Exception { - next.send(producerExchange, messageSend); - Broker brokers[] = getListeners(); - for (int i = 0; i < brokers.length; i++) { - brokers[i].send(producerExchange, messageSend); - } - } - - @Override - public void beginTransaction(ConnectionContext context, TransactionId xid) throws Exception { - next.beginTransaction(context, xid); - Broker brokers[] = getListeners(); - for (int i = 0; i < brokers.length; i++) { - brokers[i].beginTransaction(context, xid); - } - } - - @Override - public void forgetTransaction(ConnectionContext context, TransactionId transactionId) throws Exception { - next.forgetTransaction(context, transactionId); - Broker brokers[] = getListeners(); - for (int i = 0; i < brokers.length; i++) { - brokers[i].forgetTransaction(context, transactionId); - } - } - - @Override - public Destination addDestination(ConnectionContext context, ActiveMQDestination destination,boolean createIfTemporary) throws Exception { - Destination result = next.addDestination(context, destination,createIfTemporary); - Broker brokers[] = getListeners(); - for (int i = 0; i < brokers.length; i++) { - brokers[i].addDestination(context, destination,createIfTemporary); - } - return result; - } - - @Override - public void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout) throws Exception { - next.removeDestination(context, destination, timeout); - Broker brokers[] = getListeners(); - for (int i = 0; i < brokers.length; i++) { - brokers[i].removeDestination(context, destination, timeout); - } - } - - @Override - public void start() throws Exception { - next.start(); - Broker brokers[] = getListeners(); - for (int i = 0; i < brokers.length; i++) { - brokers[i].start(); - } - } - - @Override - public void stop() throws Exception { - next.stop(); - Broker brokers[] = getListeners(); - for (int i = 0; i < brokers.length; i++) { - brokers[i].stop(); - } - } - - @Override - public void addSession(ConnectionContext context, SessionInfo info) throws Exception { - next.addSession(context, info); - Broker brokers[] = getListeners(); - for (int i = 0; i < brokers.length; i++) { - brokers[i].addSession(context, info); - } - } - - @Override - public void removeSession(ConnectionContext context, SessionInfo info) throws Exception { - next.removeSession(context, info); - Broker brokers[] = getListeners(); - for (int i = 0; i < brokers.length; i++) { - brokers[i].removeSession(context, info); - } - } - - @Override - public void gc() { - next.gc(); - Broker brokers[] = getListeners(); - for (int i = 0; i < brokers.length; i++) { - brokers[i].gc(); - } - } - - @Override - public void addBroker(Connection connection, BrokerInfo info) { - next.addBroker(connection, info); - Broker brokers[] = getListeners(); - for (int i = 0; i < brokers.length; i++) { - brokers[i].addBroker(connection, info); - } - } - - protected Broker[] getListeners() { - return listeners; - } - - public synchronized void addListener(Broker broker) { - List tmp = getListenersAsList(); - tmp.add(broker); - listeners = tmp.toArray(new Broker[tmp.size()]); - } - - public synchronized void removeListener(Broker broker) { - List tmp = getListenersAsList(); - tmp.remove(broker); - listeners = tmp.toArray(new Broker[tmp.size()]); - } - - protected List getListenersAsList() { - List tmp = new ArrayList(); - Broker brokers[] = getListeners(); - for (int i = 0; i < brokers.length; i++) { - tmp.add(brokers[i]); - } - return tmp; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerContext.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerContext.class deleted file mode 100644 index e00ef413b..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerContext.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerContext.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerContext.java deleted file mode 100644 index 641632cf7..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerContext.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * 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.broker; - -import java.util.Map; - -/** - * - * Provide context object for broker classes - * - */ -public interface BrokerContext { - - Object getBean(String name); - - Map getBeansOfType(Class type); - - String getConfigurationUrl(); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerContextAware.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerContextAware.class deleted file mode 100644 index 8d80c6eb2..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerContextAware.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerContextAware.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerContextAware.java deleted file mode 100644 index 19035ccc7..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerContextAware.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * 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.broker; - -/** - * - * Interface to be implemented by any object that wishes to have instance of @see BrokerContext - * - */ -public interface BrokerContextAware { - - void setBrokerContext(BrokerContext brokerContext); - BrokerContext getBrokerContext(); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerFactory.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerFactory.class deleted file mode 100644 index 2269df6f3..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerFactory.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerFactory.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerFactory.java deleted file mode 100644 index cfc4bbe4b..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerFactory.java +++ /dev/null @@ -1,117 +0,0 @@ -/** - * 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.broker; - -import java.io.IOException; -import java.net.URI; - -import org.apache.activemq.util.FactoryFinder; -import org.apache.activemq.util.IOExceptionSupport; - -/** - * A helper class to create a fully configured broker service using a URI. The - * list of currently supported URI syntaxes is described here - * - * - */ -public final class BrokerFactory { - - private static final FactoryFinder BROKER_FACTORY_HANDLER_FINDER = new FactoryFinder("META-INF/services/org/apache/activemq/broker/"); - - private BrokerFactory() { - } - - public static BrokerFactoryHandler createBrokerFactoryHandler(String type) throws IOException { - try { - return (BrokerFactoryHandler)BROKER_FACTORY_HANDLER_FINDER.newInstance(type); - } catch (Throwable e) { - throw IOExceptionSupport.create("Could not load " + type + " factory:" + e, e); - } - } - - /** - * Creates a broker from a URI configuration - * - * @param brokerURI the URI scheme to configure the broker - * @throws Exception - */ - public static BrokerService createBroker(URI brokerURI) throws Exception { - return createBroker(brokerURI, false); - } - - /** - * Creates a broker from a URI configuration - * - * @param brokerURI the URI scheme to configure the broker - * @param startBroker whether or not the broker should have its - * {@link BrokerService#start()} method called after - * construction - * @throws Exception - */ - public static BrokerService createBroker(URI brokerURI, boolean startBroker) throws Exception { - if (brokerURI.getScheme() == null) { - throw new IllegalArgumentException("Invalid broker URI, no scheme specified: " + brokerURI); - } - BrokerFactoryHandler handler = createBrokerFactoryHandler(brokerURI.getScheme()); - BrokerService broker = handler.createBroker(brokerURI); - if (startBroker) { - broker.start(); - } - return broker; - } - - /** - * Creates a broker from a URI configuration - * - * @param brokerURI the URI scheme to configure the broker - * @throws Exception - */ - public static BrokerService createBroker(String brokerURI) throws Exception { - return createBroker(new URI(brokerURI)); - } - - /** - * Creates a broker from a URI configuration - * - * @param brokerURI the URI scheme to configure the broker - * @param startBroker whether or not the broker should have its - * {@link BrokerService#start()} method called after - * construction - * @throws Exception - */ - public static BrokerService createBroker(String brokerURI, boolean startBroker) throws Exception { - return createBroker(new URI(brokerURI), startBroker); - } - - private static final ThreadLocal START_DEFAULT = new ThreadLocal(); - - public static void setStartDefault(boolean startDefault) { - START_DEFAULT.set(startDefault); - } - public static void resetStartDefault() { - START_DEFAULT.remove(); - } - - public static boolean getStartDefault() { - Boolean value = START_DEFAULT.get(); - if( value==null ) { - return true; - } - return value.booleanValue(); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerFactoryHandler.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerFactoryHandler.class deleted file mode 100644 index 8fa97337d..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerFactoryHandler.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerFactoryHandler.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerFactoryHandler.java deleted file mode 100644 index c319b0aa3..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerFactoryHandler.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * 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.broker; - -import java.net.URI; - -/** - * Represents the interface used to create a broker from a URI scheme. - * - * -*/ -public interface BrokerFactoryHandler { - BrokerService createBroker(URI brokerURI) throws Exception; -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerFilter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerFilter.class deleted file mode 100644 index 4adc01855..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerFilter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerFilter.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerFilter.java deleted file mode 100644 index 7bc675ed7..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerFilter.java +++ /dev/null @@ -1,387 +0,0 @@ -/** - * 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.broker; - -import java.net.URI; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.ThreadPoolExecutor; - -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.BrokerId; -import org.apache.activemq.command.BrokerInfo; -import org.apache.activemq.command.ConnectionInfo; -import org.apache.activemq.command.ConsumerControl; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.command.DestinationInfo; -import org.apache.activemq.command.Message; -import org.apache.activemq.command.MessageAck; -import org.apache.activemq.command.MessageDispatch; -import org.apache.activemq.command.MessageDispatchNotification; -import org.apache.activemq.command.MessagePull; -import org.apache.activemq.command.ProducerInfo; -import org.apache.activemq.command.RemoveSubscriptionInfo; -import org.apache.activemq.command.Response; -import org.apache.activemq.command.SessionInfo; -import org.apache.activemq.command.TransactionId; -import org.apache.activemq.store.PListStore; -import org.apache.activemq.thread.Scheduler; -import org.apache.activemq.usage.Usage; - -/** - * Allows you to intercept broker operation so that features such as security - * can be implemented as a pluggable filter. - * - * - */ -public class BrokerFilter implements Broker { - - protected final Broker next; - - public BrokerFilter(Broker next) { - this.next = next; - } - - @Override - public Broker getAdaptor(Class type) { - if (type.isInstance(this)) { - return this; - } - return next.getAdaptor(type); - } - - @Override - public Map getDestinationMap() { - return next.getDestinationMap(); - } - - @Override - public Set getDestinations(ActiveMQDestination destination) { - return next.getDestinations(destination); - } - - @Override - public void acknowledge(ConsumerBrokerExchange consumerExchange, MessageAck ack) throws Exception { - next.acknowledge(consumerExchange, ack); - } - - @Override - public Response messagePull(ConnectionContext context, MessagePull pull) throws Exception { - return next.messagePull(context, pull); - } - - @Override - public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception { - next.addConnection(context, info); - } - - @Override - public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { - return next.addConsumer(context, info); - } - - @Override - public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception { - next.addProducer(context, info); - } - - @Override - public void commitTransaction(ConnectionContext context, TransactionId xid, boolean onePhase) throws Exception { - next.commitTransaction(context, xid, onePhase); - } - - @Override - public void removeSubscription(ConnectionContext context, RemoveSubscriptionInfo info) throws Exception { - next.removeSubscription(context, info); - } - - @Override - public TransactionId[] getPreparedTransactions(ConnectionContext context) throws Exception { - return next.getPreparedTransactions(context); - } - - @Override - public int prepareTransaction(ConnectionContext context, TransactionId xid) throws Exception { - return next.prepareTransaction(context, xid); - } - - @Override - public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception { - next.removeConnection(context, info, error); - } - - @Override - public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { - next.removeConsumer(context, info); - } - - @Override - public void removeProducer(ConnectionContext context, ProducerInfo info) throws Exception { - next.removeProducer(context, info); - } - - @Override - public void rollbackTransaction(ConnectionContext context, TransactionId xid) throws Exception { - next.rollbackTransaction(context, xid); - } - - @Override - public void send(ProducerBrokerExchange producerExchange, Message messageSend) throws Exception { - next.send(producerExchange, messageSend); - } - - @Override - public void beginTransaction(ConnectionContext context, TransactionId xid) throws Exception { - next.beginTransaction(context, xid); - } - - @Override - public void forgetTransaction(ConnectionContext context, TransactionId transactionId) throws Exception { - next.forgetTransaction(context, transactionId); - } - - @Override - public Connection[] getClients() throws Exception { - return next.getClients(); - } - - @Override - public Destination addDestination(ConnectionContext context, ActiveMQDestination destination,boolean createIfTemporary) throws Exception { - return next.addDestination(context, destination,createIfTemporary); - } - - @Override - public void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout) throws Exception { - next.removeDestination(context, destination, timeout); - } - - @Override - public ActiveMQDestination[] getDestinations() throws Exception { - return next.getDestinations(); - } - - @Override - public void start() throws Exception { - next.start(); - } - - @Override - public void stop() throws Exception { - next.stop(); - } - - @Override - public void addSession(ConnectionContext context, SessionInfo info) throws Exception { - next.addSession(context, info); - } - - @Override - public void removeSession(ConnectionContext context, SessionInfo info) throws Exception { - next.removeSession(context, info); - } - - @Override - public BrokerId getBrokerId() { - return next.getBrokerId(); - } - - @Override - public String getBrokerName() { - return next.getBrokerName(); - } - - @Override - public void gc() { - next.gc(); - } - - @Override - public void addBroker(Connection connection, BrokerInfo info) { - next.addBroker(connection, info); - } - - @Override - public void removeBroker(Connection connection, BrokerInfo info) { - next.removeBroker(connection, info); - } - - @Override - public BrokerInfo[] getPeerBrokerInfos() { - return next.getPeerBrokerInfos(); - } - - @Override - public void preProcessDispatch(MessageDispatch messageDispatch) { - next.preProcessDispatch(messageDispatch); - } - - @Override - public void postProcessDispatch(MessageDispatch messageDispatch) { - next.postProcessDispatch(messageDispatch); - } - - @Override - public void processDispatchNotification(MessageDispatchNotification messageDispatchNotification) throws Exception { - next.processDispatchNotification(messageDispatchNotification); - } - - @Override - public boolean isStopped() { - return next.isStopped(); - } - - @Override - public Set getDurableDestinations() { - return next.getDurableDestinations(); - } - - @Override - public void addDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception { - next.addDestinationInfo(context, info); - } - - @Override - public void removeDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception { - next.removeDestinationInfo(context, info); - } - - @Override - public boolean isFaultTolerantConfiguration() { - return next.isFaultTolerantConfiguration(); - } - - @Override - public ConnectionContext getAdminConnectionContext() { - return next.getAdminConnectionContext(); - } - - @Override - public void setAdminConnectionContext(ConnectionContext adminConnectionContext) { - next.setAdminConnectionContext(adminConnectionContext); - } - - @Override - public PListStore getTempDataStore() { - return next.getTempDataStore(); - } - - @Override - public URI getVmConnectorURI() { - return next.getVmConnectorURI(); - } - - @Override - public void brokerServiceStarted() { - next.brokerServiceStarted(); - } - - @Override - public BrokerService getBrokerService() { - return next.getBrokerService(); - } - - @Override - public boolean isExpired(MessageReference messageReference) { - return next.isExpired(messageReference); - } - - @Override - public void messageExpired(ConnectionContext context, MessageReference message, Subscription subscription) { - next.messageExpired(context, message, subscription); - } - - @Override - public boolean sendToDeadLetterQueue(ConnectionContext context, MessageReference messageReference, - Subscription subscription, Throwable poisonCause) { - return next.sendToDeadLetterQueue(context, messageReference, subscription, poisonCause); - } - - @Override - public Broker getRoot() { - return next.getRoot(); - } - - @Override - public long getBrokerSequenceId() { - return next.getBrokerSequenceId(); - } - - - @Override - public void fastProducer(ConnectionContext context,ProducerInfo producerInfo,ActiveMQDestination destination) { - next.fastProducer(context, producerInfo, destination); - } - - @Override - public void isFull(ConnectionContext context,Destination destination, Usage usage) { - next.isFull(context,destination, usage); - } - - @Override - public void messageConsumed(ConnectionContext context,MessageReference messageReference) { - next.messageConsumed(context, messageReference); - } - - @Override - public void messageDelivered(ConnectionContext context,MessageReference messageReference) { - next.messageDelivered(context, messageReference); - } - - @Override - public void messageDiscarded(ConnectionContext context,Subscription sub, MessageReference messageReference) { - next.messageDiscarded(context, sub, messageReference); - } - - @Override - public void slowConsumer(ConnectionContext context, Destination destination,Subscription subs) { - next.slowConsumer(context, destination,subs); - } - - @Override - public void nowMasterBroker() { - next.nowMasterBroker(); - } - - @Override - public void processConsumerControl(ConsumerBrokerExchange consumerExchange, - ConsumerControl control) { - next.processConsumerControl(consumerExchange, control); - } - - @Override - public Scheduler getScheduler() { - return next.getScheduler(); - } - - @Override - public ThreadPoolExecutor getExecutor() { - return next.getExecutor(); - } - - @Override - public void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex, String remoteIp) { - next.networkBridgeStarted(brokerInfo, createdByDuplex, remoteIp); - } - - @Override - public void networkBridgeStopped(BrokerInfo brokerInfo) { - next.networkBridgeStopped(brokerInfo); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerPlugin.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerPlugin.class deleted file mode 100644 index 0580d6fb0..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerPlugin.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerPlugin.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerPlugin.java deleted file mode 100644 index eb6e07392..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerPlugin.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * 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.broker; - -/** - * Represents a plugin into a Broker - * - * - */ -public interface BrokerPlugin { - - /** - * Installs the plugin into the interceptor chain of the broker, returning the new - * intercepted broker to use. - */ - Broker installPlugin(Broker broker) throws Exception; - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerPluginSupport.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerPluginSupport.class deleted file mode 100644 index ac8938410..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerPluginSupport.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerPluginSupport.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerPluginSupport.java deleted file mode 100644 index 59f7bcc55..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerPluginSupport.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * 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.broker; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * A useful base class for implementing broker plugins. - * - * - */ -public abstract class BrokerPluginSupport extends MutableBrokerFilter implements BrokerPlugin { - private static final Logger LOG = LoggerFactory.getLogger(BrokerPluginSupport.class); - public BrokerPluginSupport() { - super(null); - } - - public Broker installPlugin(Broker broker) throws Exception { - setNext(broker); - return this; - } - - @Override - public void start() throws Exception { - super.start(); - LOG.info("Broker Plugin {} started", getClass().getName()); - } - - @Override - public void stop() throws Exception { - super.stop(); - LOG.info("Broker Plugin {} stopped", getClass().getName()); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerRegistry.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerRegistry.class deleted file mode 100644 index 17bd1f70e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerRegistry.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerRegistry.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerRegistry.java deleted file mode 100644 index 67d8eac93..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerRegistry.java +++ /dev/null @@ -1,107 +0,0 @@ -/** - * 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.broker; - -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - */ -public class BrokerRegistry { - - private static final Logger LOG = LoggerFactory.getLogger(BrokerRegistry.class); - private static final BrokerRegistry INSTANCE = new BrokerRegistry(); - - private final Object mutex = new Object(); - private final Map brokers = new HashMap(); - - public static BrokerRegistry getInstance() { - return INSTANCE; - } - - /** - * @param brokerName - * @return the BrokerService - */ - public BrokerService lookup(String brokerName) { - BrokerService result = null; - synchronized (mutex) { - result = brokers.get(brokerName); - if (result == null && brokerName != null && brokerName.equals(BrokerService.DEFAULT_BROKER_NAME)) { - result = findFirst(); - if (result != null) { - LOG.warn("Broker localhost not started so using {} instead", result.getBrokerName()); - } - } - if (result == null && (brokerName==null || brokerName.isEmpty() || brokerName.equals("null"))){ - result = findFirst(); - } - } - return result; - } - - /** - * Returns the first registered broker found - * - * @return the first BrokerService - */ - public BrokerService findFirst() { - synchronized (mutex) { - Iterator iter = brokers.values().iterator(); - while (iter.hasNext()) { - return iter.next(); - } - return null; - } - } - - /** - * @param brokerName - * @param broker - */ - public void bind(String brokerName, BrokerService broker) { - synchronized (mutex) { - brokers.put(brokerName, broker); - mutex.notifyAll(); - } - } - - /** - * @param brokerName - */ - public void unbind(String brokerName) { - synchronized (mutex) { - brokers.remove(brokerName); - } - } - - /** - * @return the mutex used - */ - public Object getRegistryMutext() { - return mutex; - } - - public Map getBrokers() { - return Collections.unmodifiableMap(this.brokers); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService$1.class deleted file mode 100644 index 9c00f4e6d..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService$10.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService$10.class deleted file mode 100644 index 4d87b6da2..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService$10.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService$2.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService$2.class deleted file mode 100644 index e5fa1cf9f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService$2.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService$3.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService$3.class deleted file mode 100644 index 3df010e48..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService$3.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService$4.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService$4.class deleted file mode 100644 index 6d9bd0d53..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService$4.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService$5$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService$5$1.class deleted file mode 100644 index 1a1c00f8b..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService$5$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService$5.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService$5.class deleted file mode 100644 index 25c9d81ce..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService$5.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService$6.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService$6.class deleted file mode 100644 index a52bc7384..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService$6.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService$7.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService$7.class deleted file mode 100644 index 92372d64b..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService$7.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService$8.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService$8.class deleted file mode 100644 index 4ac5af74f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService$8.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService$9$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService$9$1.class deleted file mode 100644 index 22459fac8..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService$9$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService$9.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService$9.class deleted file mode 100644 index 0753c330c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService$9.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService.class deleted file mode 100644 index 1d11cd9ea..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService.java deleted file mode 100644 index 07295c4a8..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerService.java +++ /dev/null @@ -1,2938 +0,0 @@ -/** - * 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.broker; - -import java.io.BufferedReader; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.UnknownHostException; -import java.security.Provider; -import java.security.Security; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.CopyOnWriteArrayList; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.RejectedExecutionException; -import java.util.concurrent.RejectedExecutionHandler; -import java.util.concurrent.SynchronousQueue; -import java.util.concurrent.ThreadFactory; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicBoolean; - -import javax.annotation.PostConstruct; -import javax.annotation.PreDestroy; -import javax.management.MalformedObjectNameException; -import javax.management.ObjectName; - -import org.apache.activemq.ActiveMQConnectionMetaData; -import org.apache.activemq.ConfigurationException; -import org.apache.activemq.Service; -import org.apache.activemq.advisory.AdvisoryBroker; -import org.apache.activemq.broker.cluster.ConnectionSplitBroker; -import org.apache.activemq.broker.jmx.*; -import org.apache.activemq.broker.region.CompositeDestinationInterceptor; -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.DestinationFactory; -import org.apache.activemq.broker.region.DestinationFactoryImpl; -import org.apache.activemq.broker.region.DestinationInterceptor; -import org.apache.activemq.broker.region.RegionBroker; -import org.apache.activemq.broker.region.policy.PolicyMap; -import org.apache.activemq.broker.region.virtual.MirroredQueue; -import org.apache.activemq.broker.region.virtual.VirtualDestination; -import org.apache.activemq.broker.region.virtual.VirtualDestinationInterceptor; -import org.apache.activemq.broker.region.virtual.VirtualTopic; -import org.apache.activemq.broker.scheduler.JobSchedulerStore; -import org.apache.activemq.broker.scheduler.SchedulerBroker; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ActiveMQQueue; -import org.apache.activemq.command.BrokerId; -import org.apache.activemq.command.ProducerInfo; -import org.apache.activemq.filter.DestinationFilter; -import org.apache.activemq.network.ConnectionFilter; -import org.apache.activemq.network.DiscoveryNetworkConnector; -import org.apache.activemq.network.NetworkConnector; -import org.apache.activemq.network.jms.JmsConnector; -import org.apache.activemq.openwire.OpenWireFormat; -import org.apache.activemq.proxy.ProxyConnector; -import org.apache.activemq.security.MessageAuthorizationPolicy; -import org.apache.activemq.selector.SelectorParser; -import org.apache.activemq.store.JournaledStore; -import org.apache.activemq.store.PListStore; -import org.apache.activemq.store.PersistenceAdapter; -import org.apache.activemq.store.PersistenceAdapterFactory; -import org.apache.activemq.store.memory.MemoryPersistenceAdapter; -import org.apache.activemq.thread.Scheduler; -import org.apache.activemq.thread.TaskRunnerFactory; -import org.apache.activemq.transport.TransportFactorySupport; -import org.apache.activemq.transport.TransportServer; -import org.apache.activemq.transport.vm.VMTransportFactory; -import org.apache.activemq.usage.SystemUsage; -import org.apache.activemq.util.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.slf4j.MDC; - -/** - * Manages the life-cycle of an ActiveMQ Broker. A BrokerService consists of a - * number of transport connectors, network connectors and a bunch of properties - * which can be used to configure the broker as its lazily created. - * - * @org.apache.xbean.XBean - */ -public class BrokerService implements Service { - public static final String DEFAULT_PORT = "61616"; - public static final String LOCAL_HOST_NAME; - public static final String BROKER_VERSION; - public static final String DEFAULT_BROKER_NAME = "localhost"; - public static final int DEFAULT_MAX_FILE_LENGTH = 1024 * 1024 * 32; - - private static final Logger LOG = LoggerFactory.getLogger(BrokerService.class); - - @SuppressWarnings("unused") - private static final long serialVersionUID = 7353129142305630237L; - - private boolean useJmx = true; - private boolean enableStatistics = true; - private boolean persistent = true; - private boolean populateJMSXUserID; - private boolean useAuthenticatedPrincipalForJMSXUserID; - private boolean populateUserNameInMBeans; - private long mbeanInvocationTimeout = 0; - - private boolean useShutdownHook = true; - private boolean useLoggingForShutdownErrors; - private boolean shutdownOnMasterFailure; - private boolean shutdownOnSlaveFailure; - private boolean waitForSlave; - private long waitForSlaveTimeout = 600000L; - private boolean passiveSlave; - private String brokerName = DEFAULT_BROKER_NAME; - private File dataDirectoryFile; - private File tmpDataDirectory; - private Broker broker; - private BrokerView adminView; - private ManagementContext managementContext; - private ObjectName brokerObjectName; - private TaskRunnerFactory taskRunnerFactory; - private TaskRunnerFactory persistenceTaskRunnerFactory; - private SystemUsage systemUsage; - private SystemUsage producerSystemUsage; - private SystemUsage consumerSystemUsaage; - private PersistenceAdapter persistenceAdapter; - private PersistenceAdapterFactory persistenceFactory; - protected DestinationFactory destinationFactory; - private MessageAuthorizationPolicy messageAuthorizationPolicy; - private final List transportConnectors = new CopyOnWriteArrayList(); - private final List networkConnectors = new CopyOnWriteArrayList(); - private final List proxyConnectors = new CopyOnWriteArrayList(); - private final List jmsConnectors = new CopyOnWriteArrayList(); - private final List services = new ArrayList(); - private transient Thread shutdownHook; - private String[] transportConnectorURIs; - private String[] networkConnectorURIs; - private JmsConnector[] jmsBridgeConnectors; // these are Jms to Jms bridges - // to other jms messaging systems - private boolean deleteAllMessagesOnStartup; - private boolean advisorySupport = true; - private URI vmConnectorURI; - private String defaultSocketURIString; - private PolicyMap destinationPolicy; - private final AtomicBoolean started = new AtomicBoolean(false); - private final AtomicBoolean stopped = new AtomicBoolean(false); - private final AtomicBoolean stopping = new AtomicBoolean(false); - private BrokerPlugin[] plugins; - private boolean keepDurableSubsActive = true; - private boolean useVirtualTopics = true; - private boolean useMirroredQueues = false; - private boolean useTempMirroredQueues = true; - private BrokerId brokerId; - private volatile DestinationInterceptor[] destinationInterceptors; - private ActiveMQDestination[] destinations; - private PListStore tempDataStore; - private int persistenceThreadPriority = Thread.MAX_PRIORITY; - private boolean useLocalHostBrokerName; - private final CountDownLatch stoppedLatch = new CountDownLatch(1); - private final CountDownLatch startedLatch = new CountDownLatch(1); - private boolean supportFailOver; - private Broker regionBroker; - private int producerSystemUsagePortion = 60; - private int consumerSystemUsagePortion = 40; - private boolean splitSystemUsageForProducersConsumers; - private boolean monitorConnectionSplits = false; - private int taskRunnerPriority = Thread.NORM_PRIORITY; - private boolean dedicatedTaskRunner; - private boolean cacheTempDestinations = false;// useful for failover - private int timeBeforePurgeTempDestinations = 5000; - private final List shutdownHooks = new ArrayList(); - private boolean systemExitOnShutdown; - private int systemExitOnShutdownExitCode; - private SslContext sslContext; - private boolean forceStart = false; - private IOExceptionHandler ioExceptionHandler; - private boolean schedulerSupport = false; - private File schedulerDirectoryFile; - private Scheduler scheduler; - private ThreadPoolExecutor executor; - private int schedulePeriodForDestinationPurge= 0; - private int maxPurgedDestinationsPerSweep = 0; - private BrokerContext brokerContext; - private boolean networkConnectorStartAsync = false; - private boolean allowTempAutoCreationOnSend; - private JobSchedulerStore jobSchedulerStore; - - private long offlineDurableSubscriberTimeout = -1; - private long offlineDurableSubscriberTaskSchedule = 300000; - private DestinationFilter virtualConsumerDestinationFilter; - - private final Object persistenceAdapterLock = new Object(); - private Throwable startException = null; - private boolean startAsync = false; - private Date startDate; - private boolean slave = true; - - private boolean restartAllowed = true; - private boolean restartRequested = false; - - private int storeOpenWireVersion = OpenWireFormat.DEFAULT_VERSION; - private String configurationUrl; - - static { - - try { - ClassLoader loader = BrokerService.class.getClassLoader(); - Class clazz = loader.loadClass("org.bouncycastle.jce.provider.BouncyCastleProvider"); - Provider bouncycastle = (Provider) clazz.newInstance(); - Security.insertProviderAt(bouncycastle, 2); - LOG.info("Loaded the Bouncy Castle security provider."); - } catch(Throwable e) { - // No BouncyCastle found so we use the default Java Security Provider - } - - String localHostName = "localhost"; - try { - localHostName = InetAddressUtil.getLocalHostName(); - } catch (UnknownHostException e) { - LOG.error("Failed to resolve localhost"); - } - LOCAL_HOST_NAME = localHostName; - - InputStream in = null; - String version = null; - if ((in = BrokerService.class.getResourceAsStream("/org/apache/activemq/version.txt")) != null) { - BufferedReader reader = new BufferedReader(new InputStreamReader(in)); - try { - version = reader.readLine(); - } catch(Exception e) { - } - } - BROKER_VERSION = version; - } - - @Override - public String toString() { - return "BrokerService[" + getBrokerName() + "]"; - } - - private String getBrokerVersion() { - String version = ActiveMQConnectionMetaData.PROVIDER_VERSION; - if (version == null) { - version = BROKER_VERSION; - } - - return version; - } - - /** - * Adds a new transport connector for the given bind address - * - * @return the newly created and added transport connector - * @throws Exception - */ - public TransportConnector addConnector(String bindAddress) throws Exception { - return addConnector(new URI(bindAddress)); - } - - /** - * Adds a new transport connector for the given bind address - * - * @return the newly created and added transport connector - * @throws Exception - */ - public TransportConnector addConnector(URI bindAddress) throws Exception { - return addConnector(createTransportConnector(bindAddress)); - } - - /** - * Adds a new transport connector for the given TransportServer transport - * - * @return the newly created and added transport connector - * @throws Exception - */ - public TransportConnector addConnector(TransportServer transport) throws Exception { - return addConnector(new TransportConnector(transport)); - } - - /** - * Adds a new transport connector - * - * @return the transport connector - * @throws Exception - */ - public TransportConnector addConnector(TransportConnector connector) throws Exception { - transportConnectors.add(connector); - return connector; - } - - /** - * Stops and removes a transport connector from the broker. - * - * @param connector - * @return true if the connector has been previously added to the broker - * @throws Exception - */ - public boolean removeConnector(TransportConnector connector) throws Exception { - boolean rc = transportConnectors.remove(connector); - if (rc) { - unregisterConnectorMBean(connector); - } - return rc; - } - - /** - * Adds a new network connector using the given discovery address - * - * @return the newly created and added network connector - * @throws Exception - */ - public NetworkConnector addNetworkConnector(String discoveryAddress) throws Exception { - return addNetworkConnector(new URI(discoveryAddress)); - } - - /** - * Adds a new proxy connector using the given bind address - * - * @return the newly created and added network connector - * @throws Exception - */ - public ProxyConnector addProxyConnector(String bindAddress) throws Exception { - return addProxyConnector(new URI(bindAddress)); - } - - /** - * Adds a new network connector using the given discovery address - * - * @return the newly created and added network connector - * @throws Exception - */ - public NetworkConnector addNetworkConnector(URI discoveryAddress) throws Exception { - NetworkConnector connector = new DiscoveryNetworkConnector(discoveryAddress); - return addNetworkConnector(connector); - } - - /** - * Adds a new proxy connector using the given bind address - * - * @return the newly created and added network connector - * @throws Exception - */ - public ProxyConnector addProxyConnector(URI bindAddress) throws Exception { - ProxyConnector connector = new ProxyConnector(); - connector.setBind(bindAddress); - connector.setRemote(new URI("fanout:multicast://default")); - return addProxyConnector(connector); - } - - /** - * Adds a new network connector to connect this broker to a federated - * network - */ - public NetworkConnector addNetworkConnector(NetworkConnector connector) throws Exception { - connector.setBrokerService(this); - URI uri = getVmConnectorURI(); - Map map = new HashMap(URISupport.parseParameters(uri)); - map.put("network", "true"); - uri = URISupport.createURIWithQuery(uri, URISupport.createQueryString(map)); - connector.setLocalUri(uri); - // Set a connection filter so that the connector does not establish loop - // back connections. - connector.setConnectionFilter(new ConnectionFilter() { - @Override - public boolean connectTo(URI location) { - List transportConnectors = getTransportConnectors(); - for (Iterator iter = transportConnectors.iterator(); iter.hasNext();) { - try { - TransportConnector tc = iter.next(); - if (location.equals(tc.getConnectUri())) { - return false; - } - } catch (Throwable e) { - } - } - return true; - } - }); - networkConnectors.add(connector); - return connector; - } - - /** - * Removes the given network connector without stopping it. The caller - * should call {@link NetworkConnector#stop()} to close the connector - */ - public boolean removeNetworkConnector(NetworkConnector connector) { - boolean answer = networkConnectors.remove(connector); - if (answer) { - unregisterNetworkConnectorMBean(connector); - } - return answer; - } - - public ProxyConnector addProxyConnector(ProxyConnector connector) throws Exception { - URI uri = getVmConnectorURI(); - connector.setLocalUri(uri); - proxyConnectors.add(connector); - if (isUseJmx()) { - registerProxyConnectorMBean(connector); - } - return connector; - } - - public JmsConnector addJmsConnector(JmsConnector connector) throws Exception { - connector.setBrokerService(this); - jmsConnectors.add(connector); - if (isUseJmx()) { - registerJmsConnectorMBean(connector); - } - return connector; - } - - public JmsConnector removeJmsConnector(JmsConnector connector) { - if (jmsConnectors.remove(connector)) { - return connector; - } - return null; - } - - public void masterFailed() { - if (shutdownOnMasterFailure) { - LOG.error("The Master has failed ... shutting down"); - try { - stop(); - } catch (Exception e) { - LOG.error("Failed to stop for master failure", e); - } - } else { - LOG.warn("Master Failed - starting all connectors"); - try { - startAllConnectors(); - broker.nowMasterBroker(); - } catch (Exception e) { - LOG.error("Failed to startAllConnectors", e); - } - } - } - - public String getUptime() { - // compute and log uptime - if (startDate == null) { - return "not started"; - } - long delta = new Date().getTime() - startDate.getTime(); - return TimeUtils.printDuration(delta); - } - - public boolean isStarted() { - return started.get() && startedLatch.getCount() == 0; - } - - /** - * Forces a start of the broker. - * By default a BrokerService instance that was - * previously stopped using BrokerService.stop() cannot be restarted - * using BrokerService.start(). - * This method enforces a restart. - * It is not recommended to force a restart of the broker and will not work - * for most but some very trivial broker configurations. - * For restarting a broker instance we recommend to first call stop() on - * the old instance and then recreate a new BrokerService instance. - * - * @param force - if true enforces a restart. - * @throws Exception - */ - public void start(boolean force) throws Exception { - forceStart = force; - stopped.set(false); - started.set(false); - start(); - } - - // Service interface - // ------------------------------------------------------------------------- - - protected boolean shouldAutostart() { - return true; - } - - /** - * JSR-250 callback wrapper; converts checked exceptions to runtime exceptions - * - * delegates to autoStart, done to prevent backwards incompatible signature change - */ - @PostConstruct - private void postConstruct() { - try { - autoStart(); - } catch (Exception ex) { - throw new RuntimeException(ex); - } - } - - /** - * - * @throws Exception - * @org. apache.xbean.InitMethod - */ - public void autoStart() throws Exception { - if(shouldAutostart()) { - start(); - } - } - - @Override - public void start() throws Exception { - if (stopped.get() || !started.compareAndSet(false, true)) { - // lets just ignore redundant start() calls - // as its way too easy to not be completely sure if start() has been - // called or not with the gazillion of different configuration - // mechanisms - // throw new IllegalStateException("Already started."); - return; - } - - stopping.set(false); - startDate = new Date(); - MDC.put("activemq.broker", brokerName); - - try { - if (systemExitOnShutdown && useShutdownHook) { - throw new ConfigurationException("'useShutdownHook' property cannot be be used with 'systemExitOnShutdown', please turn it off (useShutdownHook=false)"); - } - processHelperProperties(); - if (isUseJmx()) { - // need to remove MDC during starting JMX, as that would otherwise causes leaks, as spawned threads inheirt the MDC and - // we cannot cleanup clear that during shutdown of the broker. - MDC.remove("activemq.broker"); - try { - startManagementContext(); - for (NetworkConnector connector : getNetworkConnectors()) { - registerNetworkConnectorMBean(connector); - } - } finally { - MDC.put("activemq.broker", brokerName); - } - } - - // in jvm master slave, lets not publish over existing broker till we get the lock - final BrokerRegistry brokerRegistry = BrokerRegistry.getInstance(); - if (brokerRegistry.lookup(getBrokerName()) == null) { - brokerRegistry.bind(getBrokerName(), BrokerService.this); - } - startPersistenceAdapter(startAsync); - startBroker(startAsync); - brokerRegistry.bind(getBrokerName(), BrokerService.this); - } catch (Exception e) { - LOG.error("Failed to start Apache ActiveMQ ({}, {})", new Object[]{ getBrokerName(), brokerId }, e); - try { - if (!stopped.get()) { - stop(); - } - } catch (Exception ex) { - LOG.warn("Failed to stop broker after failure in start. This exception will be ignored.", ex); - } - throw e; - } finally { - MDC.remove("activemq.broker"); - } - } - - private void startPersistenceAdapter(boolean async) throws Exception { - if (async) { - new Thread("Persistence Adapter Starting Thread") { - @Override - public void run() { - try { - doStartPersistenceAdapter(); - } catch (Throwable e) { - startException = e; - } finally { - synchronized (persistenceAdapterLock) { - persistenceAdapterLock.notifyAll(); - } - } - } - }.start(); - } else { - doStartPersistenceAdapter(); - } - } - - private void doStartPersistenceAdapter() throws Exception { - getPersistenceAdapter().setUsageManager(getProducerSystemUsage()); - getPersistenceAdapter().setBrokerName(getBrokerName()); - LOG.info("Using Persistence Adapter: {}", getPersistenceAdapter()); - if (deleteAllMessagesOnStartup) { - deleteAllMessages(); - } - getPersistenceAdapter().start(); - } - - private void startBroker(boolean async) throws Exception { - if (async) { - new Thread("Broker Starting Thread") { - @Override - public void run() { - try { - synchronized (persistenceAdapterLock) { - persistenceAdapterLock.wait(); - } - doStartBroker(); - } catch (Throwable t) { - startException = t; - } - } - }.start(); - } else { - doStartBroker(); - } - } - - private void doStartBroker() throws Exception { - if (startException != null) { - return; - } - startDestinations(); - addShutdownHook(); - - broker = getBroker(); - brokerId = broker.getBrokerId(); - - // need to log this after creating the broker so we have its id and name - LOG.info("Apache ActiveMQ {} ({}, {}) is starting", new Object[]{ getBrokerVersion(), getBrokerName(), brokerId }); - broker.start(); - - if (isUseJmx()) { - if (getManagementContext().isCreateConnector() && !getManagementContext().isConnectorStarted()) { - // try to restart management context - // typical for slaves that use the same ports as master - managementContext.stop(); - startManagementContext(); - } - ManagedRegionBroker managedBroker = (ManagedRegionBroker) regionBroker; - managedBroker.setContextBroker(broker); - adminView.setBroker(managedBroker); - } - - if (ioExceptionHandler == null) { - setIoExceptionHandler(new DefaultIOExceptionHandler()); - } - - startAllConnectors(); - - LOG.info("Apache ActiveMQ {} ({}, {}) started", new Object[]{ getBrokerVersion(), getBrokerName(), brokerId}); - LOG.info("For help or more information please see: http://activemq.apache.org"); - - getBroker().brokerServiceStarted(); - checkSystemUsageLimits(); - startedLatch.countDown(); - getBroker().nowMasterBroker(); - } - - /** - * JSR-250 callback wrapper; converts checked exceptions to runtime exceptions - * - * delegates to stop, done to prevent backwards incompatible signature change - */ - @PreDestroy - private void preDestroy () { - try { - stop(); - } catch (Exception ex) { - throw new RuntimeException(); - } - } - - /** - * - * @throws Exception - * @org.apache .xbean.DestroyMethod - */ - @Override - public void stop() throws Exception { - if (!stopping.compareAndSet(false, true)) { - LOG.trace("Broker already stopping/stopped"); - return; - } - - MDC.put("activemq.broker", brokerName); - - if (systemExitOnShutdown) { - new Thread() { - @Override - public void run() { - System.exit(systemExitOnShutdownExitCode); - } - }.start(); - } - - LOG.info("Apache ActiveMQ {} ({}, {}) is shutting down", new Object[]{ getBrokerVersion(), getBrokerName(), brokerId} ); - - removeShutdownHook(); - if (this.scheduler != null) { - this.scheduler.stop(); - this.scheduler = null; - } - ServiceStopper stopper = new ServiceStopper(); - if (services != null) { - for (Service service : services) { - stopper.stop(service); - } - } - stopAllConnectors(stopper); - this.slave = true; - // remove any VMTransports connected - // this has to be done after services are stopped, - // to avoid timing issue with discovery (spinning up a new instance) - BrokerRegistry.getInstance().unbind(getBrokerName()); - VMTransportFactory.stopped(getBrokerName()); - if (broker != null) { - stopper.stop(broker); - broker = null; - } - - if (jobSchedulerStore != null) { - jobSchedulerStore.stop(); - jobSchedulerStore = null; - } - if (tempDataStore != null) { - tempDataStore.stop(); - tempDataStore = null; - } - try { - stopper.stop(persistenceAdapter); - persistenceAdapter = null; - if (isUseJmx()) { - stopper.stop(getManagementContext()); - managementContext = null; - } - // Clear SelectorParser cache to free memory - SelectorParser.clearCache(); - } finally { - started.set(false); - stopped.set(true); - stoppedLatch.countDown(); - } - - if (this.taskRunnerFactory != null) { - this.taskRunnerFactory.shutdown(); - this.taskRunnerFactory = null; - } - if (this.executor != null) { - ThreadPoolUtils.shutdownNow(executor); - this.executor = null; - } - - this.destinationInterceptors = null; - this.destinationFactory = null; - - if (startDate != null) { - LOG.info("Apache ActiveMQ {} ({}, {}) uptime {}", new Object[]{ getBrokerVersion(), getBrokerName(), brokerId, getUptime()}); - } - LOG.info("Apache ActiveMQ {} ({}, {}) is shutdown", new Object[]{ getBrokerVersion(), getBrokerName(), brokerId}); - - synchronized (shutdownHooks) { - for (Runnable hook : shutdownHooks) { - try { - hook.run(); - } catch (Throwable e) { - stopper.onException(hook, e); - } - } - } - - MDC.remove("activemq.broker"); - - // and clear start date - startDate = null; - - stopper.throwFirstException(); - } - - public boolean checkQueueSize(String queueName) { - long count = 0; - long queueSize = 0; - Map destinationMap = regionBroker.getDestinationMap(); - for (Map.Entry entry : destinationMap.entrySet()) { - if (entry.getKey().isQueue()) { - if (entry.getValue().getName().matches(queueName)) { - queueSize = entry.getValue().getDestinationStatistics().getMessages().getCount(); - count += queueSize; - if (queueSize > 0) { - LOG.info("Queue has pending message: {} queueSize is: {}", entry.getValue().getName(), queueSize); - } - } - } - } - return count == 0; - } - - /** - * This method (both connectorName and queueName are using regex to match) - * 1. stop the connector (supposed the user input the connector which the - * clients connect to) 2. to check whether there is any pending message on - * the queues defined by queueName 3. supposedly, after stop the connector, - * client should failover to other broker and pending messages should be - * forwarded. if no pending messages, the method finally call stop to stop - * the broker. - * - * @param connectorName - * @param queueName - * @param timeout - * @param pollInterval - * @throws Exception - */ - public void stopGracefully(String connectorName, String queueName, long timeout, long pollInterval) throws Exception { - if (isUseJmx()) { - if (connectorName == null || queueName == null || timeout <= 0) { - throw new Exception( - "connectorName and queueName cannot be null and timeout should be >0 for stopGracefully."); - } - if (pollInterval <= 0) { - pollInterval = 30; - } - LOG.info("Stop gracefully with connectorName: {} queueName: {} timeout: {} pollInterval: {}", new Object[]{ - connectorName, queueName, timeout, pollInterval - }); - TransportConnector connector; - for (int i = 0; i < transportConnectors.size(); i++) { - connector = transportConnectors.get(i); - if (connector != null && connector.getName() != null && connector.getName().matches(connectorName)) { - connector.stop(); - } - } - long start = System.currentTimeMillis(); - while (System.currentTimeMillis() - start < timeout * 1000) { - // check quesize until it gets zero - if (checkQueueSize(queueName)) { - stop(); - break; - } else { - Thread.sleep(pollInterval * 1000); - } - } - if (stopped.get()) { - LOG.info("Successfully stop the broker."); - } else { - LOG.info("There is still pending message on the queue. Please check and stop the broker manually."); - } - } - } - - /** - * A helper method to block the caller thread until the broker has been - * stopped - */ - public void waitUntilStopped() { - while (isStarted() && !stopped.get()) { - try { - stoppedLatch.await(); - } catch (InterruptedException e) { - // ignore - } - } - } - - /** - * A helper method to block the caller thread until the broker has fully started - * @return boolean true if wait succeeded false if broker was not started or was stopped - */ - public boolean waitUntilStarted() { - boolean waitSucceeded = isStarted(); - while (!isStarted() && !stopped.get() && !waitSucceeded) { - try { - if (startException != null) { - return waitSucceeded; - } - waitSucceeded = startedLatch.await(100L, TimeUnit.MILLISECONDS); - } catch (InterruptedException ignore) { - } - } - return waitSucceeded; - } - - // Properties - // ------------------------------------------------------------------------- - /** - * Returns the message broker - */ - public Broker getBroker() throws Exception { - if (broker == null) { - broker = createBroker(); - } - return broker; - } - - /** - * Returns the administration view of the broker; used to create and destroy - * resources such as queues and topics. Note this method returns null if JMX - * is disabled. - */ - public BrokerView getAdminView() throws Exception { - if (adminView == null) { - // force lazy creation - getBroker(); - } - return adminView; - } - - public void setAdminView(BrokerView adminView) { - this.adminView = adminView; - } - - public String getBrokerName() { - return brokerName; - } - - /** - * Sets the name of this broker; which must be unique in the network - * - * @param brokerName - */ - public void setBrokerName(String brokerName) { - if (brokerName == null) { - throw new NullPointerException("The broker name cannot be null"); - } - String str = brokerName.replaceAll("[^a-zA-Z0-9\\.\\_\\-\\:]", "_"); - if (!str.equals(brokerName)) { - LOG.error("Broker Name: {} contained illegal characters - replaced with {}", brokerName, str); - } - this.brokerName = str.trim(); - } - - public PersistenceAdapterFactory getPersistenceFactory() { - return persistenceFactory; - } - - public File getDataDirectoryFile() { - if (dataDirectoryFile == null) { - dataDirectoryFile = new File(IOHelper.getDefaultDataDirectory()); - } - return dataDirectoryFile; - } - - public File getBrokerDataDirectory() { - String brokerDir = getBrokerName(); - return new File(getDataDirectoryFile(), brokerDir); - } - - /** - * Sets the directory in which the data files will be stored by default for - * the JDBC and Journal persistence adaptors. - * - * @param dataDirectory - * the directory to store data files - */ - public void setDataDirectory(String dataDirectory) { - setDataDirectoryFile(new File(dataDirectory)); - } - - /** - * Sets the directory in which the data files will be stored by default for - * the JDBC and Journal persistence adaptors. - * - * @param dataDirectoryFile - * the directory to store data files - */ - public void setDataDirectoryFile(File dataDirectoryFile) { - this.dataDirectoryFile = dataDirectoryFile; - } - - /** - * @return the tmpDataDirectory - */ - public File getTmpDataDirectory() { - if (tmpDataDirectory == null) { - tmpDataDirectory = new File(getBrokerDataDirectory(), "tmp_storage"); - } - return tmpDataDirectory; - } - - /** - * @param tmpDataDirectory - * the tmpDataDirectory to set - */ - public void setTmpDataDirectory(File tmpDataDirectory) { - this.tmpDataDirectory = tmpDataDirectory; - } - - public void setPersistenceFactory(PersistenceAdapterFactory persistenceFactory) { - this.persistenceFactory = persistenceFactory; - } - - public void setDestinationFactory(DestinationFactory destinationFactory) { - this.destinationFactory = destinationFactory; - } - - public boolean isPersistent() { - return persistent; - } - - /** - * Sets whether or not persistence is enabled or disabled. - * @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.BooleanEditor" - */ - public void setPersistent(boolean persistent) { - this.persistent = persistent; - } - - public boolean isPopulateJMSXUserID() { - return populateJMSXUserID; - } - - /** - * Sets whether or not the broker should populate the JMSXUserID header. - */ - public void setPopulateJMSXUserID(boolean populateJMSXUserID) { - this.populateJMSXUserID = populateJMSXUserID; - } - - public SystemUsage getSystemUsage() { - try { - if (systemUsage == null) { - - systemUsage = new SystemUsage("Main", getPersistenceAdapter(), getTempDataStore(), getJobSchedulerStore()); - systemUsage.setExecutor(getExecutor()); - systemUsage.getMemoryUsage().setLimit(1024L * 1024 * 1024 * 1); // 1 GB - systemUsage.getTempUsage().setLimit(1024L * 1024 * 1024 * 50); // 50 GB - systemUsage.getStoreUsage().setLimit(1024L * 1024 * 1024 * 100); // 100 GB - systemUsage.getJobSchedulerUsage().setLimit(1024L * 1024 * 1024 * 50); // 50 GB - addService(this.systemUsage); - } - return systemUsage; - } catch (IOException e) { - LOG.error("Cannot create SystemUsage", e); - throw new RuntimeException("Fatally failed to create SystemUsage" + e.getMessage(), e); - } - } - - public void setSystemUsage(SystemUsage memoryManager) { - if (this.systemUsage != null) { - removeService(this.systemUsage); - } - this.systemUsage = memoryManager; - if (this.systemUsage.getExecutor()==null) { - this.systemUsage.setExecutor(getExecutor()); - } - addService(this.systemUsage); - } - - /** - * @return the consumerUsageManager - * @throws IOException - */ - public SystemUsage getConsumerSystemUsage() throws IOException { - if (this.consumerSystemUsaage == null) { - if (splitSystemUsageForProducersConsumers) { - this.consumerSystemUsaage = new SystemUsage(getSystemUsage(), "Consumer"); - float portion = consumerSystemUsagePortion / 100f; - this.consumerSystemUsaage.getMemoryUsage().setUsagePortion(portion); - addService(this.consumerSystemUsaage); - } else { - consumerSystemUsaage = getSystemUsage(); - } - } - return this.consumerSystemUsaage; - } - - /** - * @param consumerSystemUsaage - * the storeSystemUsage to set - */ - public void setConsumerSystemUsage(SystemUsage consumerSystemUsaage) { - if (this.consumerSystemUsaage != null) { - removeService(this.consumerSystemUsaage); - } - this.consumerSystemUsaage = consumerSystemUsaage; - addService(this.consumerSystemUsaage); - } - - /** - * @return the producerUsageManager - * @throws IOException - */ - public SystemUsage getProducerSystemUsage() throws IOException { - if (producerSystemUsage == null) { - if (splitSystemUsageForProducersConsumers) { - producerSystemUsage = new SystemUsage(getSystemUsage(), "Producer"); - float portion = producerSystemUsagePortion / 100f; - producerSystemUsage.getMemoryUsage().setUsagePortion(portion); - addService(producerSystemUsage); - } else { - producerSystemUsage = getSystemUsage(); - } - } - return producerSystemUsage; - } - - /** - * @param producerUsageManager - * the producerUsageManager to set - */ - public void setProducerSystemUsage(SystemUsage producerUsageManager) { - if (this.producerSystemUsage != null) { - removeService(this.producerSystemUsage); - } - this.producerSystemUsage = producerUsageManager; - addService(this.producerSystemUsage); - } - - public PersistenceAdapter getPersistenceAdapter() throws IOException { - if (persistenceAdapter == null) { - persistenceAdapter = createPersistenceAdapter(); - configureService(persistenceAdapter); - this.persistenceAdapter = registerPersistenceAdapterMBean(persistenceAdapter); - } - return persistenceAdapter; - } - - /** - * Sets the persistence adaptor implementation to use for this broker - * - * @throws IOException - */ - public void setPersistenceAdapter(PersistenceAdapter persistenceAdapter) throws IOException { - if (!isPersistent() && ! (persistenceAdapter instanceof MemoryPersistenceAdapter)) { - LOG.warn("persistent=\"false\", ignoring configured persistenceAdapter: {}", persistenceAdapter); - return; - } - this.persistenceAdapter = persistenceAdapter; - configureService(this.persistenceAdapter); - this.persistenceAdapter = registerPersistenceAdapterMBean(persistenceAdapter); - } - - public TaskRunnerFactory getTaskRunnerFactory() { - if (this.taskRunnerFactory == null) { - this.taskRunnerFactory = new TaskRunnerFactory("ActiveMQ BrokerService["+getBrokerName()+"] Task", getTaskRunnerPriority(), true, 1000, - isDedicatedTaskRunner()); - } - return this.taskRunnerFactory; - } - - public void setTaskRunnerFactory(TaskRunnerFactory taskRunnerFactory) { - this.taskRunnerFactory = taskRunnerFactory; - } - - public TaskRunnerFactory getPersistenceTaskRunnerFactory() { - if (taskRunnerFactory == null) { - persistenceTaskRunnerFactory = new TaskRunnerFactory("Persistence Adaptor Task", persistenceThreadPriority, - true, 1000, isDedicatedTaskRunner()); - } - return persistenceTaskRunnerFactory; - } - - public void setPersistenceTaskRunnerFactory(TaskRunnerFactory persistenceTaskRunnerFactory) { - this.persistenceTaskRunnerFactory = persistenceTaskRunnerFactory; - } - - public boolean isUseJmx() { - return useJmx; - } - - public boolean isEnableStatistics() { - return enableStatistics; - } - - /** - * Sets whether or not the Broker's services enable statistics or not. - */ - public void setEnableStatistics(boolean enableStatistics) { - this.enableStatistics = enableStatistics; - } - - /** - * Sets whether or not the Broker's services should be exposed into JMX or - * not. - * @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.BooleanEditor" - */ - public void setUseJmx(boolean useJmx) { - this.useJmx = useJmx; - } - - public ObjectName getBrokerObjectName() throws MalformedObjectNameException { - if (brokerObjectName == null) { - brokerObjectName = createBrokerObjectName(); - } - return brokerObjectName; - } - - /** - * Sets the JMX ObjectName for this broker - */ - public void setBrokerObjectName(ObjectName brokerObjectName) { - this.brokerObjectName = brokerObjectName; - } - - public ManagementContext getManagementContext() { - if (managementContext == null) { - managementContext = new ManagementContext(); - } - return managementContext; - } - - public void setManagementContext(ManagementContext managementContext) { - this.managementContext = managementContext; - } - - public NetworkConnector getNetworkConnectorByName(String connectorName) { - for (NetworkConnector connector : networkConnectors) { - if (connector.getName().equals(connectorName)) { - return connector; - } - } - return null; - } - - public String[] getNetworkConnectorURIs() { - return networkConnectorURIs; - } - - public void setNetworkConnectorURIs(String[] networkConnectorURIs) { - this.networkConnectorURIs = networkConnectorURIs; - } - - public TransportConnector getConnectorByName(String connectorName) { - for (TransportConnector connector : transportConnectors) { - if (connector.getName().equals(connectorName)) { - return connector; - } - } - return null; - } - - public Map getTransportConnectorURIsAsMap() { - Map answer = new HashMap(); - for (TransportConnector connector : transportConnectors) { - try { - URI uri = connector.getConnectUri(); - if (uri != null) { - String scheme = uri.getScheme(); - if (scheme != null) { - answer.put(scheme.toLowerCase(Locale.ENGLISH), uri.toString()); - } - } - } catch (Exception e) { - LOG.debug("Failed to read URI to build transportURIsAsMap", e); - } - } - return answer; - } - - public ProducerBrokerExchange getProducerBrokerExchange(ProducerInfo producerInfo){ - ProducerBrokerExchange result = null; - - for (TransportConnector connector : transportConnectors) { - for (TransportConnection tc: connector.getConnections()){ - result = tc.getProducerBrokerExchangeIfExists(producerInfo); - if (result !=null){ - return result; - } - } - } - return result; - } - - public String[] getTransportConnectorURIs() { - return transportConnectorURIs; - } - - public void setTransportConnectorURIs(String[] transportConnectorURIs) { - this.transportConnectorURIs = transportConnectorURIs; - } - - /** - * @return Returns the jmsBridgeConnectors. - */ - public JmsConnector[] getJmsBridgeConnectors() { - return jmsBridgeConnectors; - } - - /** - * @param jmsConnectors - * The jmsBridgeConnectors to set. - */ - public void setJmsBridgeConnectors(JmsConnector[] jmsConnectors) { - this.jmsBridgeConnectors = jmsConnectors; - } - - public Service[] getServices() { - return services.toArray(new Service[0]); - } - - /** - * Sets the services associated with this broker. - */ - public void setServices(Service[] services) { - this.services.clear(); - if (services != null) { - for (int i = 0; i < services.length; i++) { - this.services.add(services[i]); - } - } - } - - /** - * Adds a new service so that it will be started as part of the broker - * lifecycle - */ - public void addService(Service service) { - services.add(service); - } - - public void removeService(Service service) { - services.remove(service); - } - - public boolean isUseLoggingForShutdownErrors() { - return useLoggingForShutdownErrors; - } - - /** - * Sets whether or not we should use commons-logging when reporting errors - * when shutting down the broker - */ - public void setUseLoggingForShutdownErrors(boolean useLoggingForShutdownErrors) { - this.useLoggingForShutdownErrors = useLoggingForShutdownErrors; - } - - public boolean isUseShutdownHook() { - return useShutdownHook; - } - - /** - * Sets whether or not we should use a shutdown handler to close down the - * broker cleanly if the JVM is terminated. It is recommended you leave this - * enabled. - */ - public void setUseShutdownHook(boolean useShutdownHook) { - this.useShutdownHook = useShutdownHook; - } - - public boolean isAdvisorySupport() { - return advisorySupport; - } - - /** - * Allows the support of advisory messages to be disabled for performance - * reasons. - * @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.BooleanEditor" - */ - public void setAdvisorySupport(boolean advisorySupport) { - this.advisorySupport = advisorySupport; - } - - public List getTransportConnectors() { - return new ArrayList(transportConnectors); - } - - /** - * Sets the transport connectors which this broker will listen on for new - * clients - * - * @org.apache.xbean.Property - * nestedType="org.apache.activemq.broker.TransportConnector" - */ - public void setTransportConnectors(List transportConnectors) throws Exception { - for (TransportConnector connector : transportConnectors) { - addConnector(connector); - } - } - - public TransportConnector getTransportConnectorByName(String name){ - for (TransportConnector transportConnector : transportConnectors){ - if (name.equals(transportConnector.getName())){ - return transportConnector; - } - } - return null; - } - - public TransportConnector getTransportConnectorByScheme(String scheme){ - for (TransportConnector transportConnector : transportConnectors){ - if (scheme.equals(transportConnector.getUri().getScheme())){ - return transportConnector; - } - } - return null; - } - - public List getNetworkConnectors() { - return new ArrayList(networkConnectors); - } - - public List getProxyConnectors() { - return new ArrayList(proxyConnectors); - } - - /** - * Sets the network connectors which this broker will use to connect to - * other brokers in a federated network - * - * @org.apache.xbean.Property - * nestedType="org.apache.activemq.network.NetworkConnector" - */ - public void setNetworkConnectors(List networkConnectors) throws Exception { - for (Object connector : networkConnectors) { - addNetworkConnector((NetworkConnector) connector); - } - } - - /** - * Sets the network connectors which this broker will use to connect to - * other brokers in a federated network - */ - public void setProxyConnectors(List proxyConnectors) throws Exception { - for (Object connector : proxyConnectors) { - addProxyConnector((ProxyConnector) connector); - } - } - - public PolicyMap getDestinationPolicy() { - return destinationPolicy; - } - - /** - * Sets the destination specific policies available either for exact - * destinations or for wildcard areas of destinations. - */ - public void setDestinationPolicy(PolicyMap policyMap) { - this.destinationPolicy = policyMap; - } - - public BrokerPlugin[] getPlugins() { - return plugins; - } - - /** - * Sets a number of broker plugins to install such as for security - * authentication or authorization - */ - public void setPlugins(BrokerPlugin[] plugins) { - this.plugins = plugins; - } - - public MessageAuthorizationPolicy getMessageAuthorizationPolicy() { - return messageAuthorizationPolicy; - } - - /** - * Sets the policy used to decide if the current connection is authorized to - * consume a given message - */ - public void setMessageAuthorizationPolicy(MessageAuthorizationPolicy messageAuthorizationPolicy) { - this.messageAuthorizationPolicy = messageAuthorizationPolicy; - } - - /** - * Delete all messages from the persistent store - * - * @throws IOException - */ - public void deleteAllMessages() throws IOException { - getPersistenceAdapter().deleteAllMessages(); - } - - public boolean isDeleteAllMessagesOnStartup() { - return deleteAllMessagesOnStartup; - } - - /** - * Sets whether or not all messages are deleted on startup - mostly only - * useful for testing. - * @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.BooleanEditor" - */ - public void setDeleteAllMessagesOnStartup(boolean deletePersistentMessagesOnStartup) { - this.deleteAllMessagesOnStartup = deletePersistentMessagesOnStartup; - } - - public URI getVmConnectorURI() { - if (vmConnectorURI == null) { - try { - vmConnectorURI = new URI("vm://" + getBrokerName().replaceAll("[^a-zA-Z0-9\\.\\_\\-]", "_")); - } catch (URISyntaxException e) { - LOG.error("Badly formed URI from {}", getBrokerName(), e); - } - } - return vmConnectorURI; - } - - public void setVmConnectorURI(URI vmConnectorURI) { - this.vmConnectorURI = vmConnectorURI; - } - - public String getDefaultSocketURIString() { - if (started.get()) { - if (this.defaultSocketURIString == null) { - for (TransportConnector tc:this.transportConnectors) { - String result = null; - try { - result = tc.getPublishableConnectString(); - } catch (Exception e) { - LOG.warn("Failed to get the ConnectURI for {}", tc, e); - } - if (result != null) { - // find first publishable uri - if (tc.isUpdateClusterClients() || tc.isRebalanceClusterClients()) { - this.defaultSocketURIString = result; - break; - } else { - // or use the first defined - if (this.defaultSocketURIString == null) { - this.defaultSocketURIString = result; - } - } - } - } - - } - return this.defaultSocketURIString; - } - return null; - } - - /** - * @return Returns the shutdownOnMasterFailure. - */ - public boolean isShutdownOnMasterFailure() { - return shutdownOnMasterFailure; - } - - /** - * @param shutdownOnMasterFailure - * The shutdownOnMasterFailure to set. - */ - public void setShutdownOnMasterFailure(boolean shutdownOnMasterFailure) { - this.shutdownOnMasterFailure = shutdownOnMasterFailure; - } - - public boolean isKeepDurableSubsActive() { - return keepDurableSubsActive; - } - - public void setKeepDurableSubsActive(boolean keepDurableSubsActive) { - this.keepDurableSubsActive = keepDurableSubsActive; - } - - public boolean isUseVirtualTopics() { - return useVirtualTopics; - } - - /** - * Sets whether or not Virtual - * Topics should be supported by default if they have not been - * explicitly configured. - */ - public void setUseVirtualTopics(boolean useVirtualTopics) { - this.useVirtualTopics = useVirtualTopics; - } - - public DestinationInterceptor[] getDestinationInterceptors() { - return destinationInterceptors; - } - - public boolean isUseMirroredQueues() { - return useMirroredQueues; - } - - /** - * Sets whether or not Mirrored - * Queues should be supported by default if they have not been - * explicitly configured. - */ - public void setUseMirroredQueues(boolean useMirroredQueues) { - this.useMirroredQueues = useMirroredQueues; - } - - /** - * Sets the destination interceptors to use - */ - public void setDestinationInterceptors(DestinationInterceptor[] destinationInterceptors) { - this.destinationInterceptors = destinationInterceptors; - } - - public ActiveMQDestination[] getDestinations() { - return destinations; - } - - /** - * Sets the destinations which should be loaded/created on startup - */ - public void setDestinations(ActiveMQDestination[] destinations) { - this.destinations = destinations; - } - - /** - * @return the tempDataStore - */ - public synchronized PListStore getTempDataStore() { - if (tempDataStore == null) { - if (!isPersistent()) { - return null; - } - - try { - PersistenceAdapter pa = getPersistenceAdapter(); - if( pa!=null && pa instanceof PListStore) { - return (PListStore) pa; - } - } catch (IOException e) { - throw new RuntimeException(e); - } - - boolean result = true; - boolean empty = true; - try { - File directory = getTmpDataDirectory(); - if (directory.exists() && directory.isDirectory()) { - File[] files = directory.listFiles(); - if (files != null && files.length > 0) { - empty = false; - for (int i = 0; i < files.length; i++) { - File file = files[i]; - if (!file.isDirectory()) { - result &= file.delete(); - } - } - } - } - if (!empty) { - String str = result ? "Successfully deleted" : "Failed to delete"; - LOG.info("{} temporary storage", str); - } - - String clazz = "org.apache.activemq.store.kahadb.plist.PListStoreImpl"; - this.tempDataStore = (PListStore) getClass().getClassLoader().loadClass(clazz).newInstance(); - this.tempDataStore.setDirectory(getTmpDataDirectory()); - configureService(tempDataStore); - this.tempDataStore.start(); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - return tempDataStore; - } - - /** - * @param tempDataStore - * the tempDataStore to set - */ - public void setTempDataStore(PListStore tempDataStore) { - this.tempDataStore = tempDataStore; - configureService(tempDataStore); - try { - tempDataStore.start(); - } catch (Exception e) { - RuntimeException exception = new RuntimeException("Failed to start provided temp data store: " + tempDataStore, e); - LOG.error(exception.getLocalizedMessage(), e); - throw exception; - } - } - - public int getPersistenceThreadPriority() { - return persistenceThreadPriority; - } - - public void setPersistenceThreadPriority(int persistenceThreadPriority) { - this.persistenceThreadPriority = persistenceThreadPriority; - } - - /** - * @return the useLocalHostBrokerName - */ - public boolean isUseLocalHostBrokerName() { - return this.useLocalHostBrokerName; - } - - /** - * @param useLocalHostBrokerName - * the useLocalHostBrokerName to set - */ - public void setUseLocalHostBrokerName(boolean useLocalHostBrokerName) { - this.useLocalHostBrokerName = useLocalHostBrokerName; - if (useLocalHostBrokerName && !started.get() && brokerName == null || brokerName == DEFAULT_BROKER_NAME) { - brokerName = LOCAL_HOST_NAME; - } - } - - /** - * @return the supportFailOver - */ - public boolean isSupportFailOver() { - return this.supportFailOver; - } - - /** - * @param supportFailOver - * the supportFailOver to set - */ - public void setSupportFailOver(boolean supportFailOver) { - this.supportFailOver = supportFailOver; - } - - /** - * Looks up and lazily creates if necessary the destination for the given - * JMS name - */ - public Destination getDestination(ActiveMQDestination destination) throws Exception { - return getBroker().addDestination(getAdminConnectionContext(), destination,false); - } - - public void removeDestination(ActiveMQDestination destination) throws Exception { - getBroker().removeDestination(getAdminConnectionContext(), destination, 0); - } - - public int getProducerSystemUsagePortion() { - return producerSystemUsagePortion; - } - - public void setProducerSystemUsagePortion(int producerSystemUsagePortion) { - this.producerSystemUsagePortion = producerSystemUsagePortion; - } - - public int getConsumerSystemUsagePortion() { - return consumerSystemUsagePortion; - } - - public void setConsumerSystemUsagePortion(int consumerSystemUsagePortion) { - this.consumerSystemUsagePortion = consumerSystemUsagePortion; - } - - public boolean isSplitSystemUsageForProducersConsumers() { - return splitSystemUsageForProducersConsumers; - } - - public void setSplitSystemUsageForProducersConsumers(boolean splitSystemUsageForProducersConsumers) { - this.splitSystemUsageForProducersConsumers = splitSystemUsageForProducersConsumers; - } - - public boolean isMonitorConnectionSplits() { - return monitorConnectionSplits; - } - - public void setMonitorConnectionSplits(boolean monitorConnectionSplits) { - this.monitorConnectionSplits = monitorConnectionSplits; - } - - public int getTaskRunnerPriority() { - return taskRunnerPriority; - } - - public void setTaskRunnerPriority(int taskRunnerPriority) { - this.taskRunnerPriority = taskRunnerPriority; - } - - public boolean isDedicatedTaskRunner() { - return dedicatedTaskRunner; - } - - public void setDedicatedTaskRunner(boolean dedicatedTaskRunner) { - this.dedicatedTaskRunner = dedicatedTaskRunner; - } - - public boolean isCacheTempDestinations() { - return cacheTempDestinations; - } - - public void setCacheTempDestinations(boolean cacheTempDestinations) { - this.cacheTempDestinations = cacheTempDestinations; - } - - public int getTimeBeforePurgeTempDestinations() { - return timeBeforePurgeTempDestinations; - } - - public void setTimeBeforePurgeTempDestinations(int timeBeforePurgeTempDestinations) { - this.timeBeforePurgeTempDestinations = timeBeforePurgeTempDestinations; - } - - public boolean isUseTempMirroredQueues() { - return useTempMirroredQueues; - } - - public void setUseTempMirroredQueues(boolean useTempMirroredQueues) { - this.useTempMirroredQueues = useTempMirroredQueues; - } - - public synchronized JobSchedulerStore getJobSchedulerStore() { - - // If support is off don't allow any scheduler even is user configured their own. - if (!isSchedulerSupport()) { - return null; - } - - // If the user configured their own we use it even if persistence is disabled since - // we don't know anything about their implementation. - if (jobSchedulerStore == null) { - - if (!isPersistent()) { - return null; - } - - try { - PersistenceAdapter pa = getPersistenceAdapter(); - if (pa != null && pa instanceof JobSchedulerStore) { - this.jobSchedulerStore = (JobSchedulerStore) pa; - configureService(jobSchedulerStore); - return this.jobSchedulerStore; - } - } catch (IOException e) { - throw new RuntimeException(e); - } - - try { - String clazz = "org.apache.activemq.store.kahadb.scheduler.JobSchedulerStoreImpl"; - jobSchedulerStore = (JobSchedulerStore) getClass().getClassLoader().loadClass(clazz).newInstance(); - jobSchedulerStore.setDirectory(getSchedulerDirectoryFile()); - configureService(jobSchedulerStore); - jobSchedulerStore.start(); - LOG.info("JobScheduler using directory: {}", getSchedulerDirectoryFile()); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - return jobSchedulerStore; - } - - public void setJobSchedulerStore(JobSchedulerStore jobSchedulerStore) { - this.jobSchedulerStore = jobSchedulerStore; - configureService(jobSchedulerStore); - try { - jobSchedulerStore.start(); - } catch (Exception e) { - RuntimeException exception = new RuntimeException( - "Failed to start provided job scheduler store: " + jobSchedulerStore, e); - LOG.error(exception.getLocalizedMessage(), e); - throw exception; - } - } - - // - // Implementation methods - // ------------------------------------------------------------------------- - /** - * Handles any lazy-creation helper properties which are added to make - * things easier to configure inside environments such as Spring - * - * @throws Exception - */ - protected void processHelperProperties() throws Exception { - if (transportConnectorURIs != null) { - for (int i = 0; i < transportConnectorURIs.length; i++) { - String uri = transportConnectorURIs[i]; - addConnector(uri); - } - } - if (networkConnectorURIs != null) { - for (int i = 0; i < networkConnectorURIs.length; i++) { - String uri = networkConnectorURIs[i]; - addNetworkConnector(uri); - } - } - if (jmsBridgeConnectors != null) { - for (int i = 0; i < jmsBridgeConnectors.length; i++) { - addJmsConnector(jmsBridgeConnectors[i]); - } - } - } - - protected void checkSystemUsageLimits() throws IOException { - SystemUsage usage = getSystemUsage(); - long memLimit = usage.getMemoryUsage().getLimit(); - long jvmLimit = Runtime.getRuntime().maxMemory(); - - if (memLimit > jvmLimit) { - usage.getMemoryUsage().setPercentOfJvmHeap(70); - LOG.error("Memory Usage for the Broker (" + memLimit / (1024 * 1024) + - " mb) is more than the maximum available for the JVM: " + - jvmLimit / (1024 * 1024) + " mb - resetting to 70% of maximum available: " + (usage.getMemoryUsage().getLimit() / (1024 * 1024)) + " mb"); - } - - if (getPersistenceAdapter() != null) { - PersistenceAdapter adapter = getPersistenceAdapter(); - File dir = adapter.getDirectory(); - - if (dir != null) { - String dirPath = dir.getAbsolutePath(); - if (!dir.isAbsolute()) { - dir = new File(dirPath); - } - - while (dir != null && !dir.isDirectory()) { - dir = dir.getParentFile(); - } - long storeLimit = usage.getStoreUsage().getLimit(); - long dirFreeSpace = dir.getUsableSpace(); - if (storeLimit > dirFreeSpace) { - LOG.warn("Store limit is " + storeLimit / (1024 * 1024) + - " mb, whilst the data directory: " + dir.getAbsolutePath() + - " only has " + dirFreeSpace / (1024 * 1024) + - " mb of usable space - resetting to maximum available disk space: " + - dirFreeSpace / (1024 * 1024) + " mb"); - usage.getStoreUsage().setLimit(dirFreeSpace); - } - } - - long maxJournalFileSize = 0; - long storeLimit = usage.getStoreUsage().getLimit(); - - if (adapter instanceof JournaledStore) { - maxJournalFileSize = ((JournaledStore) adapter).getJournalMaxFileLength(); - } - - if (storeLimit < maxJournalFileSize) { - LOG.error("Store limit is " + storeLimit / (1024 * 1024) + - " mb, whilst the max journal file size for the store is: " + - maxJournalFileSize / (1024 * 1024) + " mb, " + - "the store will not accept any data when used."); - - } - } - - File tmpDir = getTmpDataDirectory(); - if (tmpDir != null) { - - String tmpDirPath = tmpDir.getAbsolutePath(); - if (!tmpDir.isAbsolute()) { - tmpDir = new File(tmpDirPath); - } - - long storeLimit = usage.getTempUsage().getLimit(); - while (tmpDir != null && !tmpDir.isDirectory()) { - tmpDir = tmpDir.getParentFile(); - } - long dirFreeSpace = tmpDir.getUsableSpace(); - if (storeLimit > dirFreeSpace) { - LOG.error("Temporary Store limit is " + storeLimit / (1024 * 1024) + - " mb, whilst the temporary data directory: " + tmpDirPath + - " only has " + dirFreeSpace / (1024 * 1024) + " mb of usable space - resetting to maximum available " + - dirFreeSpace / (1024 * 1024) + " mb."); - usage.getTempUsage().setLimit(dirFreeSpace); - } - - if (isPersistent()) { - long maxJournalFileSize; - - PListStore store = usage.getTempUsage().getStore(); - if (store != null && store instanceof JournaledStore) { - maxJournalFileSize = ((JournaledStore) store).getJournalMaxFileLength(); - } else { - maxJournalFileSize = DEFAULT_MAX_FILE_LENGTH; - } - - if (storeLimit < maxJournalFileSize) { - LOG.error("Temporary Store limit is " + storeLimit / (1024 * 1024) + - " mb, whilst the max journal file size for the temporary store is: " + - maxJournalFileSize / (1024 * 1024) + " mb, " + - "the temp store will not accept any data when used."); - } - } - } - - if (getJobSchedulerStore() != null) { - JobSchedulerStore scheduler = getJobSchedulerStore(); - File schedulerDir = scheduler.getDirectory(); - if (schedulerDir != null) { - - String schedulerDirPath = schedulerDir.getAbsolutePath(); - if (!schedulerDir.isAbsolute()) { - schedulerDir = new File(schedulerDirPath); - } - - while (schedulerDir != null && !schedulerDir.isDirectory()) { - schedulerDir = schedulerDir.getParentFile(); - } - long schedularLimit = usage.getJobSchedulerUsage().getLimit(); - long dirFreeSpace = schedulerDir.getUsableSpace(); - if (schedularLimit > dirFreeSpace) { - LOG.warn("Job Schedular Store limit is " + schedularLimit / (1024 * 1024) + - " mb, whilst the data directory: " + schedulerDir.getAbsolutePath() + - " only has " + dirFreeSpace / (1024 * 1024) + " mb of usable space - resetting to " + - dirFreeSpace / (1024 * 1024) + " mb."); - usage.getJobSchedulerUsage().setLimit(dirFreeSpace); - } - } - } - } - - public void stopAllConnectors(ServiceStopper stopper) { - for (Iterator iter = getNetworkConnectors().iterator(); iter.hasNext();) { - NetworkConnector connector = iter.next(); - unregisterNetworkConnectorMBean(connector); - stopper.stop(connector); - } - for (Iterator iter = getProxyConnectors().iterator(); iter.hasNext();) { - ProxyConnector connector = iter.next(); - stopper.stop(connector); - } - for (Iterator iter = jmsConnectors.iterator(); iter.hasNext();) { - JmsConnector connector = iter.next(); - stopper.stop(connector); - } - for (Iterator iter = getTransportConnectors().iterator(); iter.hasNext();) { - TransportConnector connector = iter.next(); - try { - unregisterConnectorMBean(connector); - } catch (IOException e) { - } - stopper.stop(connector); - } - } - - protected TransportConnector registerConnectorMBean(TransportConnector connector) throws IOException { - try { - ObjectName objectName = createConnectorObjectName(connector); - connector = connector.asManagedConnector(getManagementContext(), objectName); - ConnectorViewMBean view = new ConnectorView(connector); - AnnotatedMBean.registerMBean(getManagementContext(), view, objectName); - return connector; - } catch (Throwable e) { - throw IOExceptionSupport.create("Transport Connector could not be registered in JMX: " + e.getMessage(), e); - } - } - - protected void unregisterConnectorMBean(TransportConnector connector) throws IOException { - if (isUseJmx()) { - try { - ObjectName objectName = createConnectorObjectName(connector); - getManagementContext().unregisterMBean(objectName); - } catch (Throwable e) { - throw IOExceptionSupport.create( - "Transport Connector could not be unregistered in JMX: " + e.getMessage(), e); - } - } - } - - protected PersistenceAdapter registerPersistenceAdapterMBean(PersistenceAdapter adaptor) throws IOException { - return adaptor; - } - - protected void unregisterPersistenceAdapterMBean(PersistenceAdapter adaptor) throws IOException { - if (isUseJmx()) {} - } - - private ObjectName createConnectorObjectName(TransportConnector connector) throws MalformedObjectNameException { - return BrokerMBeanSupport.createConnectorName(getBrokerObjectName(), "clientConnectors", connector.getName()); - } - - protected void registerNetworkConnectorMBean(NetworkConnector connector) throws IOException { - NetworkConnectorViewMBean view = new NetworkConnectorView(connector); - try { - ObjectName objectName = createNetworkConnectorObjectName(connector); - connector.setObjectName(objectName); - AnnotatedMBean.registerMBean(getManagementContext(), view, objectName); - } catch (Throwable e) { - throw IOExceptionSupport.create("Network Connector could not be registered in JMX: " + e.getMessage(), e); - } - } - - protected ObjectName createNetworkConnectorObjectName(NetworkConnector connector) throws MalformedObjectNameException { - return BrokerMBeanSupport.createNetworkConnectorName(getBrokerObjectName(), "networkConnectors", connector.getName()); - } - - public ObjectName createDuplexNetworkConnectorObjectName(String transport) throws MalformedObjectNameException { - return BrokerMBeanSupport.createNetworkConnectorName(getBrokerObjectName(), "duplexNetworkConnectors", transport); - } - - protected void unregisterNetworkConnectorMBean(NetworkConnector connector) { - if (isUseJmx()) { - try { - ObjectName objectName = createNetworkConnectorObjectName(connector); - getManagementContext().unregisterMBean(objectName); - } catch (Exception e) { - LOG.warn("Network Connector could not be unregistered from JMX due " + e.getMessage() + ". This exception is ignored.", e); - } - } - } - - protected void registerProxyConnectorMBean(ProxyConnector connector) throws IOException { - ProxyConnectorView view = new ProxyConnectorView(connector); - try { - ObjectName objectName = BrokerMBeanSupport.createNetworkConnectorName(getBrokerObjectName(), "proxyConnectors", connector.getName()); - AnnotatedMBean.registerMBean(getManagementContext(), view, objectName); - } catch (Throwable e) { - throw IOExceptionSupport.create("Broker could not be registered in JMX: " + e.getMessage(), e); - } - } - - protected void registerJmsConnectorMBean(JmsConnector connector) throws IOException { - JmsConnectorView view = new JmsConnectorView(connector); - try { - ObjectName objectName = BrokerMBeanSupport.createNetworkConnectorName(getBrokerObjectName(), "jmsConnectors", connector.getName()); - AnnotatedMBean.registerMBean(getManagementContext(), view, objectName); - } catch (Throwable e) { - throw IOExceptionSupport.create("Broker could not be registered in JMX: " + e.getMessage(), e); - } - } - - /** - * Factory method to create a new broker - * - * @throws Exception - * @throws - * @throws - */ - protected Broker createBroker() throws Exception { - regionBroker = createRegionBroker(); - Broker broker = addInterceptors(regionBroker); - // Add a filter that will stop access to the broker once stopped - broker = new MutableBrokerFilter(broker) { - Broker old; - - @Override - public void stop() throws Exception { - old = this.next.getAndSet(new ErrorBroker("Broker has been stopped: " + this) { - // Just ignore additional stop actions. - @Override - public void stop() throws Exception { - } - }); - old.stop(); - } - - @Override - public void start() throws Exception { - if (forceStart && old != null) { - this.next.set(old); - } - getNext().start(); - } - }; - return broker; - } - - /** - * Factory method to create the core region broker onto which interceptors - * are added - * - * @throws Exception - */ - protected Broker createRegionBroker() throws Exception { - if (destinationInterceptors == null) { - destinationInterceptors = createDefaultDestinationInterceptor(); - } - configureServices(destinationInterceptors); - DestinationInterceptor destinationInterceptor = new CompositeDestinationInterceptor(destinationInterceptors); - if (destinationFactory == null) { - destinationFactory = new DestinationFactoryImpl(this, getTaskRunnerFactory(), getPersistenceAdapter()); - } - return createRegionBroker(destinationInterceptor); - } - - protected Broker createRegionBroker(DestinationInterceptor destinationInterceptor) throws IOException { - RegionBroker regionBroker; - if (isUseJmx()) { - try { - regionBroker = new ManagedRegionBroker(this, getManagementContext(), getBrokerObjectName(), - getTaskRunnerFactory(), getConsumerSystemUsage(), destinationFactory, destinationInterceptor,getScheduler(),getExecutor()); - } catch(MalformedObjectNameException me){ - LOG.warn("Cannot create ManagedRegionBroker due " + me.getMessage(), me); - throw new IOException(me); - } - } else { - regionBroker = new RegionBroker(this, getTaskRunnerFactory(), getConsumerSystemUsage(), destinationFactory, - destinationInterceptor,getScheduler(),getExecutor()); - } - destinationFactory.setRegionBroker(regionBroker); - regionBroker.setKeepDurableSubsActive(keepDurableSubsActive); - regionBroker.setBrokerName(getBrokerName()); - regionBroker.getDestinationStatistics().setEnabled(enableStatistics); - regionBroker.setAllowTempAutoCreationOnSend(isAllowTempAutoCreationOnSend()); - if (brokerId != null) { - regionBroker.setBrokerId(brokerId); - } - return regionBroker; - } - - /** - * Create the default destination interceptor - */ - protected DestinationInterceptor[] createDefaultDestinationInterceptor() { - List answer = new ArrayList(); - if (isUseVirtualTopics()) { - VirtualDestinationInterceptor interceptor = new VirtualDestinationInterceptor(); - VirtualTopic virtualTopic = new VirtualTopic(); - virtualTopic.setName("VirtualTopic.>"); - VirtualDestination[] virtualDestinations = { virtualTopic }; - interceptor.setVirtualDestinations(virtualDestinations); - answer.add(interceptor); - } - if (isUseMirroredQueues()) { - MirroredQueue interceptor = new MirroredQueue(); - answer.add(interceptor); - } - DestinationInterceptor[] array = new DestinationInterceptor[answer.size()]; - answer.toArray(array); - return array; - } - - /** - * Strategy method to add interceptors to the broker - * - * @throws IOException - */ - protected Broker addInterceptors(Broker broker) throws Exception { - if (isSchedulerSupport()) { - SchedulerBroker sb = new SchedulerBroker(this, broker, getJobSchedulerStore()); - if (isUseJmx()) { - JobSchedulerViewMBean view = new JobSchedulerView(sb.getJobScheduler()); - try { - ObjectName objectName = BrokerMBeanSupport.createJobSchedulerServiceName(getBrokerObjectName()); - AnnotatedMBean.registerMBean(getManagementContext(), view, objectName); - this.adminView.setJMSJobScheduler(objectName); - } catch (Throwable e) { - throw IOExceptionSupport.create("JobScheduler could not be registered in JMX: " - + e.getMessage(), e); - } - } - broker = sb; - } - if (isUseJmx()) { - HealthViewMBean statusView = new HealthView((ManagedRegionBroker)getRegionBroker()); - try { - ObjectName objectName = BrokerMBeanSupport.createHealthServiceName(getBrokerObjectName()); - AnnotatedMBean.registerMBean(getManagementContext(), statusView, objectName); - } catch (Throwable e) { - throw IOExceptionSupport.create("Status MBean could not be registered in JMX: " - + e.getMessage(), e); - } - } - if (isAdvisorySupport()) { - broker = new AdvisoryBroker(broker); - } - broker = new CompositeDestinationBroker(broker); - broker = new TransactionBroker(broker, getPersistenceAdapter().createTransactionStore()); - if (isPopulateJMSXUserID()) { - UserIDBroker userIDBroker = new UserIDBroker(broker); - userIDBroker.setUseAuthenticatePrincipal(isUseAuthenticatedPrincipalForJMSXUserID()); - broker = userIDBroker; - } - if (isMonitorConnectionSplits()) { - broker = new ConnectionSplitBroker(broker); - } - if (plugins != null) { - for (int i = 0; i < plugins.length; i++) { - BrokerPlugin plugin = plugins[i]; - broker = plugin.installPlugin(broker); - } - } - return broker; - } - - protected PersistenceAdapter createPersistenceAdapter() throws IOException { - if (isPersistent()) { - PersistenceAdapterFactory fac = getPersistenceFactory(); - if (fac != null) { - return fac.createPersistenceAdapter(); - } else { - try { - String clazz = "org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter"; - PersistenceAdapter adaptor = (PersistenceAdapter)getClass().getClassLoader().loadClass(clazz).newInstance(); - File dir = new File(getBrokerDataDirectory(),"KahaDB"); - adaptor.setDirectory(dir); - return adaptor; - } catch (Throwable e) { - throw IOExceptionSupport.create(e); - } - } - } else { - return new MemoryPersistenceAdapter(); - } - } - - protected ObjectName createBrokerObjectName() throws MalformedObjectNameException { - return BrokerMBeanSupport.createBrokerObjectName(getManagementContext().getJmxDomainName(), getBrokerName()); - } - - protected TransportConnector createTransportConnector(URI brokerURI) throws Exception { - TransportServer transport = TransportFactorySupport.bind(this, brokerURI); - return new TransportConnector(transport); - } - - /** - * Extracts the port from the options - */ - protected Object getPort(Map options) { - Object port = options.get("port"); - if (port == null) { - port = DEFAULT_PORT; - LOG.warn("No port specified so defaulting to: {}", port); - } - return port; - } - - protected void addShutdownHook() { - if (useShutdownHook) { - shutdownHook = new Thread("ActiveMQ ShutdownHook") { - @Override - public void run() { - containerShutdown(); - } - }; - Runtime.getRuntime().addShutdownHook(shutdownHook); - } - } - - protected void removeShutdownHook() { - if (shutdownHook != null) { - try { - Runtime.getRuntime().removeShutdownHook(shutdownHook); - } catch (Exception e) { - LOG.debug("Caught exception, must be shutting down. This exception is ignored.", e); - } - } - } - - /** - * Sets hooks to be executed when broker shut down - * - * @org.apache.xbean.Property - */ - public void setShutdownHooks(List hooks) throws Exception { - for (Runnable hook : hooks) { - addShutdownHook(hook); - } - } - - /** - * Causes a clean shutdown of the container when the VM is being shut down - */ - protected void containerShutdown() { - try { - stop(); - } catch (IOException e) { - Throwable linkedException = e.getCause(); - if (linkedException != null) { - logError("Failed to shut down: " + e + ". Reason: " + linkedException, linkedException); - } else { - logError("Failed to shut down: " + e, e); - } - if (!useLoggingForShutdownErrors) { - e.printStackTrace(System.err); - } - } catch (Exception e) { - logError("Failed to shut down: " + e, e); - } - } - - protected void logError(String message, Throwable e) { - if (useLoggingForShutdownErrors) { - LOG.error("Failed to shut down: " + e); - } else { - System.err.println("Failed to shut down: " + e); - } - } - - /** - * Starts any configured destinations on startup - */ - protected void startDestinations() throws Exception { - if (destinations != null) { - ConnectionContext adminConnectionContext = getAdminConnectionContext(); - for (int i = 0; i < destinations.length; i++) { - ActiveMQDestination destination = destinations[i]; - getBroker().addDestination(adminConnectionContext, destination,true); - } - } - if (isUseVirtualTopics()) { - startVirtualConsumerDestinations(); - } - } - - /** - * Returns the broker's administration connection context used for - * configuring the broker at startup - */ - public ConnectionContext getAdminConnectionContext() throws Exception { - return BrokerSupport.getConnectionContext(getBroker()); - } - - protected void startManagementContext() throws Exception { - getManagementContext().setBrokerName(brokerName); - getManagementContext().start(); - adminView = new BrokerView(this, null); - ObjectName objectName = getBrokerObjectName(); - AnnotatedMBean.registerMBean(getManagementContext(), adminView, objectName); - } - - /** - * Start all transport and network connections, proxies and bridges - * - * @throws Exception - */ - public void startAllConnectors() throws Exception { - Set durableDestinations = getBroker().getDurableDestinations(); - List al = new ArrayList(); - for (Iterator iter = getTransportConnectors().iterator(); iter.hasNext();) { - TransportConnector connector = iter.next(); - connector.setBrokerService(this); - al.add(startTransportConnector(connector)); - } - if (al.size() > 0) { - // let's clear the transportConnectors list and replace it with - // the started transportConnector instances - this.transportConnectors.clear(); - setTransportConnectors(al); - } - this.slave = false; - URI uri = getVmConnectorURI(); - Map map = new HashMap(URISupport.parseParameters(uri)); - map.put("network", "true"); - map.put("async", "false"); - uri = URISupport.createURIWithQuery(uri, URISupport.createQueryString(map)); - - if (!stopped.get()) { - ThreadPoolExecutor networkConnectorStartExecutor = null; - if (isNetworkConnectorStartAsync()) { - // spin up as many threads as needed - networkConnectorStartExecutor = new ThreadPoolExecutor(0, Integer.MAX_VALUE, - 10, TimeUnit.SECONDS, new SynchronousQueue(), - new ThreadFactory() { - int count=0; - @Override - public Thread newThread(Runnable runnable) { - Thread thread = new Thread(runnable, "NetworkConnector Start Thread-" +(count++)); - thread.setDaemon(true); - return thread; - } - }); - } - - for (Iterator iter = getNetworkConnectors().iterator(); iter.hasNext();) { - final NetworkConnector connector = iter.next(); - connector.setLocalUri(uri); - connector.setBrokerName(getBrokerName()); - connector.setDurableDestinations(durableDestinations); - if (getDefaultSocketURIString() != null) { - connector.setBrokerURL(getDefaultSocketURIString()); - } - if (networkConnectorStartExecutor != null) { - networkConnectorStartExecutor.execute(new Runnable() { - @Override - public void run() { - try { - LOG.info("Async start of {}", connector); - connector.start(); - } catch(Exception e) { - LOG.error("Async start of network connector: {} failed", connector, e); - } - } - }); - } else { - connector.start(); - } - } - if (networkConnectorStartExecutor != null) { - // executor done when enqueued tasks are complete - ThreadPoolUtils.shutdown(networkConnectorStartExecutor); - } - - for (Iterator iter = getProxyConnectors().iterator(); iter.hasNext();) { - ProxyConnector connector = iter.next(); - connector.start(); - } - for (Iterator iter = jmsConnectors.iterator(); iter.hasNext();) { - JmsConnector connector = iter.next(); - connector.start(); - } - for (Service service : services) { - configureService(service); - service.start(); - } - } - } - - protected TransportConnector startTransportConnector(TransportConnector connector) throws Exception { - connector.setTaskRunnerFactory(getTaskRunnerFactory()); - MessageAuthorizationPolicy policy = getMessageAuthorizationPolicy(); - if (policy != null) { - connector.setMessageAuthorizationPolicy(policy); - } - if (isUseJmx()) { - connector = registerConnectorMBean(connector); - } - connector.getStatistics().setEnabled(enableStatistics); - connector.start(); - return connector; - } - - /** - * Perform any custom dependency injection - */ - protected void configureServices(Object[] services) { - for (Object service : services) { - configureService(service); - } - } - - /** - * Perform any custom dependency injection - */ - protected void configureService(Object service) { - if (service instanceof BrokerServiceAware) { - BrokerServiceAware serviceAware = (BrokerServiceAware) service; - serviceAware.setBrokerService(this); - } - } - - public void handleIOException(IOException exception) { - if (ioExceptionHandler != null) { - ioExceptionHandler.handle(exception); - } else { - LOG.info("No IOExceptionHandler registered, ignoring IO exception", exception); - } - } - - protected void startVirtualConsumerDestinations() throws Exception { - ConnectionContext adminConnectionContext = getAdminConnectionContext(); - Set destinations = destinationFactory.getDestinations(); - DestinationFilter filter = getVirtualTopicConsumerDestinationFilter(); - if (!destinations.isEmpty()) { - for (ActiveMQDestination destination : destinations) { - if (filter.matches(destination) == true) { - broker.addDestination(adminConnectionContext, destination, false); - } - } - } - } - - private DestinationFilter getVirtualTopicConsumerDestinationFilter() { - // created at startup, so no sync needed - if (virtualConsumerDestinationFilter == null) { - Set consumerDestinations = new HashSet(); - if (destinationInterceptors != null) { - for (DestinationInterceptor interceptor : destinationInterceptors) { - if (interceptor instanceof VirtualDestinationInterceptor) { - VirtualDestinationInterceptor virtualDestinationInterceptor = (VirtualDestinationInterceptor) interceptor; - for (VirtualDestination virtualDestination: virtualDestinationInterceptor.getVirtualDestinations()) { - if (virtualDestination instanceof VirtualTopic) { - consumerDestinations.add(new ActiveMQQueue(((VirtualTopic) virtualDestination).getPrefix() + DestinationFilter.ANY_DESCENDENT)); - } - } - } - } - } - ActiveMQQueue filter = new ActiveMQQueue(); - filter.setCompositeDestinations(consumerDestinations.toArray(new ActiveMQDestination[]{})); - virtualConsumerDestinationFilter = DestinationFilter.parseFilter(filter); - } - return virtualConsumerDestinationFilter; - } - - protected synchronized ThreadPoolExecutor getExecutor() { - if (this.executor == null) { - this.executor = new ThreadPoolExecutor(1, 10, 60, TimeUnit.SECONDS, new LinkedBlockingQueue(), new ThreadFactory() { - - private long i = 0; - - @Override - public Thread newThread(Runnable runnable) { - this.i++; - Thread thread = new Thread(runnable, "ActiveMQ BrokerService.worker." + this.i); - thread.setDaemon(true); - thread.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { - @Override - public void uncaughtException(final Thread t, final Throwable e) { - LOG.error("Error in thread '{}'", t.getName(), e); - } - }); - return thread; - } - }, new RejectedExecutionHandler() { - @Override - public void rejectedExecution(final Runnable r, final ThreadPoolExecutor executor) { - try { - executor.getQueue().offer(r, 60, TimeUnit.SECONDS); - } catch (InterruptedException e) { - throw new RejectedExecutionException("Interrupted waiting for BrokerService.worker"); - } - - throw new RejectedExecutionException("Timed Out while attempting to enqueue Task."); - } - }); - } - return this.executor; - } - - public synchronized Scheduler getScheduler() { - if (this.scheduler==null) { - this.scheduler = new Scheduler("ActiveMQ Broker["+getBrokerName()+"] Scheduler"); - try { - this.scheduler.start(); - } catch (Exception e) { - LOG.error("Failed to start Scheduler", e); - } - } - return this.scheduler; - } - - public Broker getRegionBroker() { - return regionBroker; - } - - public void setRegionBroker(Broker regionBroker) { - this.regionBroker = regionBroker; - } - - public void addShutdownHook(Runnable hook) { - synchronized (shutdownHooks) { - shutdownHooks.add(hook); - } - } - - public void removeShutdownHook(Runnable hook) { - synchronized (shutdownHooks) { - shutdownHooks.remove(hook); - } - } - - public boolean isSystemExitOnShutdown() { - return systemExitOnShutdown; - } - - /** - * @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.BooleanEditor" - */ - public void setSystemExitOnShutdown(boolean systemExitOnShutdown) { - this.systemExitOnShutdown = systemExitOnShutdown; - } - - public int getSystemExitOnShutdownExitCode() { - return systemExitOnShutdownExitCode; - } - - public void setSystemExitOnShutdownExitCode(int systemExitOnShutdownExitCode) { - this.systemExitOnShutdownExitCode = systemExitOnShutdownExitCode; - } - - public SslContext getSslContext() { - return sslContext; - } - - public void setSslContext(SslContext sslContext) { - this.sslContext = sslContext; - } - - public boolean isShutdownOnSlaveFailure() { - return shutdownOnSlaveFailure; - } - - /** - * @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.BooleanEditor" - */ - public void setShutdownOnSlaveFailure(boolean shutdownOnSlaveFailure) { - this.shutdownOnSlaveFailure = shutdownOnSlaveFailure; - } - - public boolean isWaitForSlave() { - return waitForSlave; - } - - /** - * @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.BooleanEditor" - */ - public void setWaitForSlave(boolean waitForSlave) { - this.waitForSlave = waitForSlave; - } - - public long getWaitForSlaveTimeout() { - return this.waitForSlaveTimeout; - } - - public void setWaitForSlaveTimeout(long waitForSlaveTimeout) { - this.waitForSlaveTimeout = waitForSlaveTimeout; - } - - /** - * Get the passiveSlave - * @return the passiveSlave - */ - public boolean isPassiveSlave() { - return this.passiveSlave; - } - - /** - * Set the passiveSlave - * @param passiveSlave the passiveSlave to set - * @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.BooleanEditor" - */ - public void setPassiveSlave(boolean passiveSlave) { - this.passiveSlave = passiveSlave; - } - - /** - * override the Default IOException handler, called when persistence adapter - * has experiences File or JDBC I/O Exceptions - * - * @param ioExceptionHandler - */ - public void setIoExceptionHandler(IOExceptionHandler ioExceptionHandler) { - configureService(ioExceptionHandler); - this.ioExceptionHandler = ioExceptionHandler; - } - - public IOExceptionHandler getIoExceptionHandler() { - return ioExceptionHandler; - } - - /** - * @return the schedulerSupport - */ - public boolean isSchedulerSupport() { - return this.schedulerSupport && (isPersistent() || jobSchedulerStore != null); - } - - /** - * @param schedulerSupport the schedulerSupport to set - * @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.BooleanEditor" - */ - public void setSchedulerSupport(boolean schedulerSupport) { - this.schedulerSupport = schedulerSupport; - } - - /** - * @return the schedulerDirectory - */ - public File getSchedulerDirectoryFile() { - if (this.schedulerDirectoryFile == null) { - this.schedulerDirectoryFile = new File(getBrokerDataDirectory(), "scheduler"); - } - return schedulerDirectoryFile; - } - - /** - * @param schedulerDirectory the schedulerDirectory to set - */ - public void setSchedulerDirectoryFile(File schedulerDirectory) { - this.schedulerDirectoryFile = schedulerDirectory; - } - - public void setSchedulerDirectory(String schedulerDirectory) { - setSchedulerDirectoryFile(new File(schedulerDirectory)); - } - - public int getSchedulePeriodForDestinationPurge() { - return this.schedulePeriodForDestinationPurge; - } - - public void setSchedulePeriodForDestinationPurge(int schedulePeriodForDestinationPurge) { - this.schedulePeriodForDestinationPurge = schedulePeriodForDestinationPurge; - } - - public int getMaxPurgedDestinationsPerSweep() { - return this.maxPurgedDestinationsPerSweep; - } - - public void setMaxPurgedDestinationsPerSweep(int maxPurgedDestinationsPerSweep) { - this.maxPurgedDestinationsPerSweep = maxPurgedDestinationsPerSweep; - } - - public BrokerContext getBrokerContext() { - return brokerContext; - } - - public void setBrokerContext(BrokerContext brokerContext) { - this.brokerContext = brokerContext; - } - - public void setBrokerId(String brokerId) { - this.brokerId = new BrokerId(brokerId); - } - - public boolean isUseAuthenticatedPrincipalForJMSXUserID() { - return useAuthenticatedPrincipalForJMSXUserID; - } - - public void setUseAuthenticatedPrincipalForJMSXUserID(boolean useAuthenticatedPrincipalForJMSXUserID) { - this.useAuthenticatedPrincipalForJMSXUserID = useAuthenticatedPrincipalForJMSXUserID; - } - - /** - * Should MBeans that support showing the Authenticated User Name information have this - * value filled in or not. - * - * @return true if user names should be exposed in MBeans - */ - public boolean isPopulateUserNameInMBeans() { - return this.populateUserNameInMBeans; - } - - /** - * Sets whether Authenticated User Name information is shown in MBeans that support this field. - * @param value if MBeans should expose user name information. - */ - public void setPopulateUserNameInMBeans(boolean value) { - this.populateUserNameInMBeans = value; - } - - /** - * Gets the time in Milliseconds that an invocation of an MBean method will wait before - * failing. The default value is to wait forever (zero). - * - * @return timeout in milliseconds before MBean calls fail, (default is 0 or no timeout). - */ - public long getMbeanInvocationTimeout() { - return mbeanInvocationTimeout; - } - - /** - * Gets the time in Milliseconds that an invocation of an MBean method will wait before - * failing. The default value is to wait forever (zero). - * - * @param mbeanInvocationTimeout - * timeout in milliseconds before MBean calls fail, (default is 0 or no timeout). - */ - public void setMbeanInvocationTimeout(long mbeanInvocationTimeout) { - this.mbeanInvocationTimeout = mbeanInvocationTimeout; - } - - public boolean isNetworkConnectorStartAsync() { - return networkConnectorStartAsync; - } - - public void setNetworkConnectorStartAsync(boolean networkConnectorStartAsync) { - this.networkConnectorStartAsync = networkConnectorStartAsync; - } - - public boolean isAllowTempAutoCreationOnSend() { - return allowTempAutoCreationOnSend; - } - - /** - * enable if temp destinations need to be propagated through a network when - * advisorySupport==false. This is used in conjunction with the policy - * gcInactiveDestinations for matching temps so they can get removed - * when inactive - * - * @param allowTempAutoCreationOnSend - */ - public void setAllowTempAutoCreationOnSend(boolean allowTempAutoCreationOnSend) { - this.allowTempAutoCreationOnSend = allowTempAutoCreationOnSend; - } - - public long getOfflineDurableSubscriberTimeout() { - return offlineDurableSubscriberTimeout; - } - - public void setOfflineDurableSubscriberTimeout(long offlineDurableSubscriberTimeout) { - this.offlineDurableSubscriberTimeout = offlineDurableSubscriberTimeout; - } - - public long getOfflineDurableSubscriberTaskSchedule() { - return offlineDurableSubscriberTaskSchedule; - } - - public void setOfflineDurableSubscriberTaskSchedule(long offlineDurableSubscriberTaskSchedule) { - this.offlineDurableSubscriberTaskSchedule = offlineDurableSubscriberTaskSchedule; - } - - public boolean shouldRecordVirtualDestination(ActiveMQDestination destination) { - return isUseVirtualTopics() && destination.isQueue() && - getVirtualTopicConsumerDestinationFilter().matches(destination); - } - - public Throwable getStartException() { - return startException; - } - - public boolean isStartAsync() { - return startAsync; - } - - public void setStartAsync(boolean startAsync) { - this.startAsync = startAsync; - } - - public boolean isSlave() { - return this.slave; - } - - public boolean isStopping() { - return this.stopping.get(); - } - - /** - * @return true if the broker allowed to restart on shutdown. - */ - public boolean isRestartAllowed() { - return restartAllowed; - } - - /** - * Sets if the broker allowed to restart on shutdown. - * @return - */ - public void setRestartAllowed(boolean restartAllowed) { - this.restartAllowed = restartAllowed; - } - - /** - * A lifecycle manager of the BrokerService should - * inspect this property after a broker shutdown has occurred - * to find out if the broker needs to be re-created and started - * again. - * - * @return true if the broker wants to be restarted after it shuts down. - */ - public boolean isRestartRequested() { - return restartRequested; - } - - public void requestRestart() { - this.restartRequested = true; - } - - public int getStoreOpenWireVersion() { - return storeOpenWireVersion; - } - - public void setStoreOpenWireVersion(int storeOpenWireVersion) { - this.storeOpenWireVersion = storeOpenWireVersion; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerServiceAware.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerServiceAware.class deleted file mode 100644 index 713b10192..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerServiceAware.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerServiceAware.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerServiceAware.java deleted file mode 100644 index 375925aac..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerServiceAware.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * 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.broker; - -/** - * An interface used to represent a component that wants the {@link BrokerService} - * to be injected - * - * - */ -public interface BrokerServiceAware { - - void setBrokerService(BrokerService brokerService); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerStoppedException.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerStoppedException.class deleted file mode 100644 index d2bab65f7..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerStoppedException.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerStoppedException.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerStoppedException.java deleted file mode 100644 index d0a8c3db2..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/BrokerStoppedException.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * 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.broker; - -/** - * This exception is thrown by the broker when you try to use it after it has - * been stopped. - */ -public class BrokerStoppedException extends IllegalStateException { - - private static final long serialVersionUID = -3435230276850902220L; - - public BrokerStoppedException() { - super(); - } - - public BrokerStoppedException(String message, Throwable cause) { - super(message); - initCause(cause); - } - - public BrokerStoppedException(String s) { - super(s); - } - - public BrokerStoppedException(Throwable cause) { - initCause(cause); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/CompositeDestinationBroker.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/CompositeDestinationBroker.class deleted file mode 100644 index 7148b47aa..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/CompositeDestinationBroker.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/CompositeDestinationBroker.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/CompositeDestinationBroker.java deleted file mode 100644 index 3a1a66d48..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/CompositeDestinationBroker.java +++ /dev/null @@ -1,100 +0,0 @@ -/** - * 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.broker; - -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.Message; -import org.apache.activemq.command.ProducerInfo; - -/** - * This broker filter handles composite destinations. If a broker operation is - * invoked using a composite destination, this filter repeats the operation - * using each destination of the composite. HRC: I think this filter is - * dangerous to use to with the consumer operations. Multiple Subscription - * objects will be associated with a single JMS consumer each having a different - * idea of what the current pre-fetch dispatch size is. If this is used, then - * the client has to expect many more messages to be dispatched than the - * pre-fetch setting allows. - * - * - */ -public class CompositeDestinationBroker extends BrokerFilter { - - public CompositeDestinationBroker(Broker next) { - super(next); - } - - /** - * A producer may register to send to multiple destinations via a composite - * destination. - */ - public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception { - // The destination may be null. - ActiveMQDestination destination = info.getDestination(); - if (destination != null && destination.isComposite()) { - ActiveMQDestination[] destinations = destination.getCompositeDestinations(); - for (int i = 0; i < destinations.length; i++) { - ProducerInfo copy = info.copy(); - copy.setDestination(destinations[i]); - next.addProducer(context, copy); - } - } else { - next.addProducer(context, info); - } - } - - /** - * A producer may de-register from sending to multiple destinations via a - * composite destination. - */ - public void removeProducer(ConnectionContext context, ProducerInfo info) throws Exception { - // The destination may be null. - ActiveMQDestination destination = info.getDestination(); - if (destination != null && destination.isComposite()) { - ActiveMQDestination[] destinations = destination.getCompositeDestinations(); - for (int i = 0; i < destinations.length; i++) { - ProducerInfo copy = info.copy(); - copy.setDestination(destinations[i]); - next.removeProducer(context, copy); - } - } else { - next.removeProducer(context, info); - } - } - - /** - * - */ - public void send(ProducerBrokerExchange producerExchange, Message message) throws Exception { - ActiveMQDestination destination = message.getDestination(); - if (destination.isComposite()) { - ActiveMQDestination[] destinations = destination.getCompositeDestinations(); - for (int i = 0; i < destinations.length; i++) { - if (i != 0) { - message = message.copy(); - message.setMemoryUsage(null); - } - message.setOriginalDestination(destination); - message.setDestination(destinations[i]); - next.send(producerExchange, message); - } - } else { - next.send(producerExchange, message); - } - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/Connection.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/Connection.class deleted file mode 100644 index 7276d2a39..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/Connection.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/Connection.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/Connection.java deleted file mode 100644 index f13b28308..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/Connection.java +++ /dev/null @@ -1,122 +0,0 @@ -/** - * 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.broker; - -import java.io.IOException; -import org.apache.activemq.Service; -import org.apache.activemq.broker.region.ConnectionStatistics; -import org.apache.activemq.command.Command; -import org.apache.activemq.command.ConnectionControl; -import org.apache.activemq.command.Response; - -/** - * - */ -public interface Connection extends Service { - - /** - * @return the connector that created this connection. - */ - Connector getConnector(); - - /** - * Sends a message to the client. - * - * @param message the message to send to the client. - */ - void dispatchSync(Command message); - - /** - * Sends a message to the client. - * - * @param command - */ - void dispatchAsync(Command command); - - /** - * Services a client command and submits it to the broker. - * - * @param command - * @return Response - */ - Response service(Command command); - - /** - * Handles an unexpected error associated with a connection. - * - * @param error - */ - void serviceException(Throwable error); - - /** - * @return true if the Connection is slow - */ - boolean isSlow(); - - /** - * @return if after being marked, the Connection is still writing - */ - boolean isBlocked(); - - /** - * @return true if the Connection is connected - */ - boolean isConnected(); - - /** - * @return true if the Connection is active - */ - boolean isActive(); - - /** - * Returns the number of messages to be dispatched to this connection - */ - int getDispatchQueueSize(); - - /** - * Returns the statistics for this connection - */ - ConnectionStatistics getStatistics(); - - /** - * @return true if the Connection will process control commands - */ - boolean isManageable(); - - /** - * @return the source address for this connection - */ - String getRemoteAddress(); - - void serviceExceptionAsync(IOException e); - - String getConnectionId(); - - /** - * return true if a network connection - * @return - */ - boolean isNetworkConnection(); - - /** - * @return true if a fault tolerant connection - */ - boolean isFaultTolerantConnection(); - - void updateClient(ConnectionControl control); - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/ConnectionContext.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/ConnectionContext.class deleted file mode 100644 index 89763ccec..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/ConnectionContext.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/ConnectionContext.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/ConnectionContext.java deleted file mode 100644 index 8e1d36ee6..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/ConnectionContext.java +++ /dev/null @@ -1,339 +0,0 @@ -/** - * 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.broker; - -import java.io.IOException; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.atomic.AtomicBoolean; - -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.command.ConnectionId; -import org.apache.activemq.command.ConnectionInfo; -import org.apache.activemq.command.TransactionId; -import org.apache.activemq.command.WireFormatInfo; -import org.apache.activemq.command.XATransactionId; -import org.apache.activemq.filter.MessageEvaluationContext; -import org.apache.activemq.security.MessageAuthorizationPolicy; -import org.apache.activemq.security.SecurityContext; -import org.apache.activemq.state.ConnectionState; -import org.apache.activemq.transaction.Transaction; - -/** - * Used to hold context information needed to process requests sent to a broker. - * - * - */ -public class ConnectionContext { - - private Connection connection; - private Connector connector; - private Broker broker; - private boolean inRecoveryMode; - private Transaction transaction; - private ConcurrentHashMap transactions; - private SecurityContext securityContext; - private ConnectionId connectionId; - private String clientId; - private String userName; - private boolean reconnect; - private WireFormatInfo wireFormatInfo; - private Object longTermStoreContext; - private boolean producerFlowControl = true; - private MessageAuthorizationPolicy messageAuthorizationPolicy; - private boolean networkConnection; - private boolean faultTolerant; - private final AtomicBoolean stopping = new AtomicBoolean(); - private final MessageEvaluationContext messageEvaluationContext; - private boolean dontSendReponse; - private boolean clientMaster = true; - private ConnectionState connectionState; - private XATransactionId xid; - - public ConnectionContext() { - this.messageEvaluationContext = new MessageEvaluationContext(); - } - - public ConnectionContext(MessageEvaluationContext messageEvaluationContext) { - this.messageEvaluationContext=messageEvaluationContext; - } - - public ConnectionContext(ConnectionInfo info) { - this(); - setClientId(info.getClientId()); - setUserName(info.getUserName()); - setConnectionId(info.getConnectionId()); - } - - public ConnectionContext copy() { - ConnectionContext rc = new ConnectionContext(this.messageEvaluationContext); - rc.connection = this.connection; - rc.connector = this.connector; - rc.broker = this.broker; - rc.inRecoveryMode = this.inRecoveryMode; - rc.transaction = this.transaction; - rc.transactions = this.transactions; - rc.securityContext = this.securityContext; - rc.connectionId = this.connectionId; - rc.clientId = this.clientId; - rc.userName = this.userName; - rc.reconnect = this.reconnect; - rc.wireFormatInfo = this.wireFormatInfo; - rc.longTermStoreContext = this.longTermStoreContext; - rc.producerFlowControl = this.producerFlowControl; - rc.messageAuthorizationPolicy = this.messageAuthorizationPolicy; - rc.networkConnection = this.networkConnection; - rc.faultTolerant = this.faultTolerant; - rc.stopping.set(this.stopping.get()); - rc.dontSendReponse = this.dontSendReponse; - rc.clientMaster = this.clientMaster; - return rc; - } - - - public SecurityContext getSecurityContext() { - return securityContext; - } - - public void setSecurityContext(SecurityContext subject) { - this.securityContext = subject; - if (subject != null) { - setUserName(subject.getUserName()); - } else { - setUserName(null); - } - } - - /** - * @return the broker being used. - */ - public Broker getBroker() { - return broker; - } - - /** - * @param broker being used - */ - public void setBroker(Broker broker) { - this.broker = broker; - } - - /** - * @return the connection being used - */ - public Connection getConnection() { - return connection; - } - - /** - * @param connection being used - */ - public void setConnection(Connection connection) { - this.connection = connection; - } - - /** - * @return the transaction being used. - */ - public Transaction getTransaction() { - return transaction; - } - - /** - * @param transaction being used. - */ - public void setTransaction(Transaction transaction) { - this.transaction = transaction; - } - - /** - * @return the connector being used. - */ - public Connector getConnector() { - return connector; - } - - /** - * @param connector being used. - */ - public void setConnector(Connector connector) { - this.connector = connector; - } - - public MessageAuthorizationPolicy getMessageAuthorizationPolicy() { - return messageAuthorizationPolicy; - } - - /** - * Sets the policy used to decide if the current connection is authorized to - * consume a given message - */ - public void setMessageAuthorizationPolicy(MessageAuthorizationPolicy messageAuthorizationPolicy) { - this.messageAuthorizationPolicy = messageAuthorizationPolicy; - } - - /** - * @return - */ - public boolean isInRecoveryMode() { - return inRecoveryMode; - } - - public void setInRecoveryMode(boolean inRecoveryMode) { - this.inRecoveryMode = inRecoveryMode; - } - - public ConcurrentHashMap getTransactions() { - return transactions; - } - - public void setTransactions(ConcurrentHashMap transactions) { - this.transactions = transactions; - } - - public boolean isInTransaction() { - return transaction != null; - } - - public String getClientId() { - return clientId; - } - - public void setClientId(String clientId) { - this.clientId = clientId; - } - - public boolean isReconnect() { - return reconnect; - } - - public void setReconnect(boolean reconnect) { - this.reconnect = reconnect; - } - - public WireFormatInfo getWireFormatInfo() { - return wireFormatInfo; - } - - public void setWireFormatInfo(WireFormatInfo wireFormatInfo) { - this.wireFormatInfo = wireFormatInfo; - } - - public ConnectionId getConnectionId() { - return connectionId; - } - - public void setConnectionId(ConnectionId connectionId) { - this.connectionId = connectionId; - } - - public String getUserName() { - return userName; - } - - protected void setUserName(String userName) { - this.userName = userName; - } - - public MessageEvaluationContext getMessageEvaluationContext() { - return messageEvaluationContext; - } - - public Object getLongTermStoreContext() { - return longTermStoreContext; - } - - public void setLongTermStoreContext(Object longTermStoreContext) { - this.longTermStoreContext = longTermStoreContext; - } - - public boolean isProducerFlowControl() { - return producerFlowControl; - } - - public void setProducerFlowControl(boolean disableProducerFlowControl) { - this.producerFlowControl = disableProducerFlowControl; - } - - public boolean isAllowedToConsume(MessageReference n) throws IOException { - if (messageAuthorizationPolicy != null) { - return messageAuthorizationPolicy.isAllowedToConsume(this, n.getMessage()); - } - return true; - } - - public synchronized boolean isNetworkConnection() { - return networkConnection; - } - - public synchronized void setNetworkConnection(boolean networkConnection) { - this.networkConnection = networkConnection; - } - - public AtomicBoolean getStopping() { - return stopping; - } - - public void setDontSendReponse(boolean b) { - this.dontSendReponse = b; - } - - public boolean isDontSendReponse() { - return dontSendReponse; - } - - /** - * @return the clientMaster - */ - public boolean isClientMaster() { - return this.clientMaster; - } - - /** - * @param clientMaster the clientMaster to set - */ - public void setClientMaster(boolean clientMaster) { - this.clientMaster = clientMaster; - } - - public boolean isFaultTolerant() { - return faultTolerant; - } - - public void setFaultTolerant(boolean faultTolerant) { - this.faultTolerant = faultTolerant; - } - - public void setConnectionState(ConnectionState connectionState) { - this.connectionState = connectionState; - } - - public ConnectionState getConnectionState() { - return this.connectionState; - } - - public void setXid(XATransactionId id) { - this.xid = id; - } - - public XATransactionId getXid() { - return xid; - } - - public boolean isAllowLinkStealing(){ - return connector != null && connector.isAllowLinkStealing(); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/Connector.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/Connector.class deleted file mode 100644 index c642519e5..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/Connector.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/Connector.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/Connector.java deleted file mode 100644 index 1dd7f1766..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/Connector.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * 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.broker; - -import org.apache.activemq.Service; -import org.apache.activemq.broker.region.ConnectorStatistics; -import org.apache.activemq.command.BrokerInfo; - -/** - * A connector creates and manages client connections that talk to the Broker. - * - * - */ -public interface Connector extends Service { - - /** - * @return brokerInfo - */ - BrokerInfo getBrokerInfo(); - - /** - * @return the statistics for this connector - */ - ConnectorStatistics getStatistics(); - - /** - * @return true if update client connections when brokers leave/join a cluster - */ - public boolean isUpdateClusterClients(); - - /** - * @return true if clients should be re-balanced across the cluster - */ - public boolean isRebalanceClusterClients(); - - /** - * Update all the connections with information - * about the connected brokers in the cluster - */ - public void updateClientClusterInfo(); - - /** - * @return true if clients should be updated when - * a broker is removed from a broker - */ - public boolean isUpdateClusterClientsOnRemove(); - - int connectionCount(); - - /** - * If enabled, older connections with the same clientID are stopped - * @return true/false if link stealing is enabled - */ - boolean isAllowLinkStealing(); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/ConsumerBrokerExchange.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/ConsumerBrokerExchange.class deleted file mode 100644 index f45b5a96d..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/ConsumerBrokerExchange.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/ConsumerBrokerExchange.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/ConsumerBrokerExchange.java deleted file mode 100644 index c9251c7d5..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/ConsumerBrokerExchange.java +++ /dev/null @@ -1,105 +0,0 @@ -/** - * 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.broker; - -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.Region; -import org.apache.activemq.broker.region.Subscription; - -/** - * Holds internal state in the broker for a essageConsumer - * - * - */ -public class ConsumerBrokerExchange { - - private ConnectionContext connectionContext; - private Destination regionDestination; - private Region region; - private Subscription subscription; - private boolean wildcard; - - /** - * @return the connectionContext - */ - public ConnectionContext getConnectionContext() { - return this.connectionContext; - } - - /** - * @param connectionContext the connectionContext to set - */ - public void setConnectionContext(ConnectionContext connectionContext) { - this.connectionContext = connectionContext; - } - - /** - * @return the region - */ - public Region getRegion() { - return this.region; - } - - /** - * @param region the region to set - */ - public void setRegion(Region region) { - this.region = region; - } - - /** - * @return the regionDestination - */ - public Destination getRegionDestination() { - return this.regionDestination; - } - - /** - * @param regionDestination the regionDestination to set - */ - public void setRegionDestination(Destination regionDestination) { - this.regionDestination = regionDestination; - } - - /** - * @return the subscription - */ - public Subscription getSubscription() { - return this.subscription; - } - - /** - * @param subscription the subscription to set - */ - public void setSubscription(Subscription subscription) { - this.subscription = subscription; - } - - /** - * @return the wildcard - */ - public boolean isWildcard() { - return this.wildcard; - } - - /** - * @param wildcard the wildcard to set - */ - public void setWildcard(boolean wildcard) { - this.wildcard = wildcard; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/DefaultBrokerFactory.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/DefaultBrokerFactory.class deleted file mode 100644 index a1d4161c4..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/DefaultBrokerFactory.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/DefaultBrokerFactory.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/DefaultBrokerFactory.java deleted file mode 100644 index e31d0d193..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/DefaultBrokerFactory.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * 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.broker; - -import java.net.URI; -import java.util.HashMap; -import java.util.Map; - -import org.apache.activemq.util.IntrospectionSupport; -import org.apache.activemq.util.URISupport; -import org.apache.activemq.util.URISupport.CompositeData; - -/** - * Simple BrokerFactorySPI which using the brokerURI to extract the - * configuration parameters for the broker service. This directly configures the - * pojo model so there is no dependency on spring for configuration. - * - * - */ -public class DefaultBrokerFactory implements BrokerFactoryHandler { - - public BrokerService createBroker(URI brokerURI) throws Exception { - - CompositeData compositeData = URISupport.parseComposite(brokerURI); - Map params = new HashMap(compositeData.getParameters()); - - BrokerService brokerService = new BrokerService(); - IntrospectionSupport.setProperties(brokerService, params); - if (!params.isEmpty()) { - String msg = "There are " + params.size() - + " Broker options that couldn't be set on the BrokerService." - + " Check the options are spelled correctly." - + " Unknown parameters=[" + params + "]." - + " This BrokerService cannot be started."; - throw new IllegalArgumentException(msg); - } - - if (compositeData.getPath() != null) { - brokerService.setBrokerName(compositeData.getPath()); - } - - URI[] components = compositeData.getComponents(); - for (int i = 0; i < components.length; i++) { - if ("network".equals(components[i].getScheme())) { - brokerService.addNetworkConnector(components[i].getSchemeSpecificPart()); - } else if ("proxy".equals(components[i].getScheme())) { - brokerService.addProxyConnector(components[i].getSchemeSpecificPart()); - } else { - brokerService.addConnector(components[i]); - } - } - return brokerService; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/EmptyBroker.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/EmptyBroker.class deleted file mode 100644 index c1abc86ad..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/EmptyBroker.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/EmptyBroker.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/EmptyBroker.java deleted file mode 100644 index 9110059f0..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/EmptyBroker.java +++ /dev/null @@ -1,369 +0,0 @@ -/** - * 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.broker; - -import java.net.URI; -import java.util.Collections; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.ThreadPoolExecutor; - -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.BrokerId; -import org.apache.activemq.command.BrokerInfo; -import org.apache.activemq.command.ConnectionInfo; -import org.apache.activemq.command.ConsumerControl; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.command.DestinationInfo; -import org.apache.activemq.command.Message; -import org.apache.activemq.command.MessageAck; -import org.apache.activemq.command.MessageDispatch; -import org.apache.activemq.command.MessageDispatchNotification; -import org.apache.activemq.command.MessagePull; -import org.apache.activemq.command.ProducerInfo; -import org.apache.activemq.command.RemoveSubscriptionInfo; -import org.apache.activemq.command.Response; -import org.apache.activemq.command.SessionInfo; -import org.apache.activemq.command.TransactionId; -import org.apache.activemq.store.PListStore; -import org.apache.activemq.thread.Scheduler; -import org.apache.activemq.usage.Usage; - -/** - * Dumb implementation - used to be overriden by listeners - * - * - */ -public class EmptyBroker implements Broker { - - @Override - public BrokerId getBrokerId() { - return null; - } - - @Override - public String getBrokerName() { - return null; - } - - @Override - public Broker getAdaptor(Class type) { - if (type.isInstance(this)) { - return this; - } - return null; - } - - @Override - @SuppressWarnings("unchecked") - public Map getDestinationMap() { - return Collections.EMPTY_MAP; - } - - @Override - public Set getDestinations(ActiveMQDestination destination) { - return Collections.EMPTY_SET; - } - - @Override - public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception { - - } - - @Override - public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception { - - } - - @Override - public void addSession(ConnectionContext context, SessionInfo info) throws Exception { - - } - - @Override - public void removeSession(ConnectionContext context, SessionInfo info) throws Exception { - - } - - @Override - public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception { - - } - - @Override - public void removeProducer(ConnectionContext context, ProducerInfo info) throws Exception { - - } - - @Override - public Connection[] getClients() throws Exception { - - return null; - } - - @Override - public ActiveMQDestination[] getDestinations() throws Exception { - - return null; - } - - @Override - public TransactionId[] getPreparedTransactions(ConnectionContext context) throws Exception { - - return null; - } - - @Override - public void beginTransaction(ConnectionContext context, TransactionId xid) throws Exception { - - } - - @Override - public int prepareTransaction(ConnectionContext context, TransactionId xid) throws Exception { - - return 0; - } - - @Override - public void rollbackTransaction(ConnectionContext context, TransactionId xid) throws Exception { - - } - - @Override - public void commitTransaction(ConnectionContext context, TransactionId xid, boolean onePhase) throws Exception { - - } - - @Override - public void forgetTransaction(ConnectionContext context, TransactionId transactionId) throws Exception { - - } - - @Override - public Destination addDestination(ConnectionContext context, ActiveMQDestination destination,boolean flag) throws Exception { - - return null; - } - - @Override - public void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout) throws Exception { - - } - - @Override - public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { - return null; - } - - @Override - public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { - - } - - @Override - public void removeSubscription(ConnectionContext context, RemoveSubscriptionInfo info) throws Exception { - - } - - @Override - public void send(ProducerBrokerExchange producerExchange, Message message) throws Exception { - - } - - @Override - public void acknowledge(ConsumerBrokerExchange consumerExchange, MessageAck ack) throws Exception { - - } - - @Override - public void gc() { - - } - - @Override - public void start() throws Exception { - - } - - @Override - public void stop() throws Exception { - - } - - @Override - public void addBroker(Connection connection, BrokerInfo info) { - - } - - @Override - public void removeBroker(Connection connection, BrokerInfo info) { - - } - - @Override - public BrokerInfo[] getPeerBrokerInfos() { - return null; - } - - @Override - public void preProcessDispatch(MessageDispatch messageDispatch) { - } - - @Override - public void postProcessDispatch(MessageDispatch messageDispatch) { - } - - @Override - public void processDispatchNotification(MessageDispatchNotification messageDispatchNotification) throws Exception { - - } - - @Override - public boolean isStopped() { - return false; - } - - @Override - public Set getDurableDestinations() { - return null; - } - - @Override - public void addDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception { - } - - @Override - public void removeDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception { - } - - @Override - public boolean isFaultTolerantConfiguration() { - return false; - } - - @Override - public ConnectionContext getAdminConnectionContext() { - return null; - } - - @Override - public void setAdminConnectionContext(ConnectionContext adminConnectionContext) { - } - - @Override - public Response messagePull(ConnectionContext context, MessagePull pull) throws Exception { - return null; - } - - @Override - public PListStore getTempDataStore() { - return null; - } - - @Override - public URI getVmConnectorURI() { - return null; - } - - @Override - public void brokerServiceStarted() { - } - - @Override - public BrokerService getBrokerService() { - return null; - } - - @Override - public boolean isExpired(MessageReference messageReference) { - return false; - } - - @Override - public void messageExpired(ConnectionContext context, MessageReference message, Subscription subscription) { - } - - @Override - public boolean sendToDeadLetterQueue(ConnectionContext context, MessageReference messageReference, - Subscription subscription, Throwable poisonCause) { - return false; - } - - @Override - public Broker getRoot() { - return null; - } - - @Override - public long getBrokerSequenceId() { - return -1l; - } - - @Override - public void fastProducer(ConnectionContext context,ProducerInfo producerInfo,ActiveMQDestination destination) { - } - - @Override - public void isFull(ConnectionContext context, Destination destination,Usage usage) { - } - - @Override - public void messageConsumed(ConnectionContext context,MessageReference messageReference) { - } - - @Override - public void messageDelivered(ConnectionContext context,MessageReference messageReference) { - } - - @Override - public void messageDiscarded(ConnectionContext context, Subscription sub, MessageReference messageReference) { - } - - @Override - public void slowConsumer(ConnectionContext context,Destination destination, Subscription subs) { - } - - @Override - public void nowMasterBroker() { - } - - @Override - public void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex, String remoteIp) { - } - - @Override - public void networkBridgeStopped(BrokerInfo brokerInfo) { - } - - @Override - public void processConsumerControl(ConsumerBrokerExchange consumerExchange, - ConsumerControl control) { - } - - @Override - public Scheduler getScheduler() { - return null; - } - - @Override - public ThreadPoolExecutor getExecutor() { - return null; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/ErrorBroker.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/ErrorBroker.class deleted file mode 100644 index ca55ce04f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/ErrorBroker.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/ErrorBroker.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/ErrorBroker.java deleted file mode 100644 index db75d275d..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/ErrorBroker.java +++ /dev/null @@ -1,389 +0,0 @@ -/** - * 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.broker; - -import java.net.URI; -import java.util.Collections; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.ThreadPoolExecutor; - -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.BrokerId; -import org.apache.activemq.command.BrokerInfo; -import org.apache.activemq.command.ConnectionInfo; -import org.apache.activemq.command.ConsumerControl; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.command.DestinationInfo; -import org.apache.activemq.command.Message; -import org.apache.activemq.command.MessageAck; -import org.apache.activemq.command.MessageDispatch; -import org.apache.activemq.command.MessageDispatchNotification; -import org.apache.activemq.command.MessagePull; -import org.apache.activemq.command.ProducerInfo; -import org.apache.activemq.command.RemoveSubscriptionInfo; -import org.apache.activemq.command.Response; -import org.apache.activemq.command.SessionInfo; -import org.apache.activemq.command.TransactionId; -import org.apache.activemq.store.PListStore; -import org.apache.activemq.thread.Scheduler; -import org.apache.activemq.usage.Usage; - -/** - * Implementation of the broker where all it's methods throw an - * BrokerStoppedException. - * - * - */ -public class ErrorBroker implements Broker { - - private final String message; - - public ErrorBroker(String message) { - this.message = message; - } - - @Override - @SuppressWarnings("unchecked") - public Map getDestinationMap() { - return Collections.EMPTY_MAP; - } - - @Override - public Set getDestinations(ActiveMQDestination destination) { - return Collections.EMPTY_SET; - } - - @Override - public Broker getAdaptor(Class type) { - if (type.isInstance(this)) { - return this; - } - return null; - } - - @Override - public BrokerId getBrokerId() { - throw new BrokerStoppedException(this.message); - } - - @Override - public String getBrokerName() { - throw new BrokerStoppedException(this.message); - } - - @Override - public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception { - throw new BrokerStoppedException(this.message); - } - - @Override - public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception { - throw new BrokerStoppedException(this.message); - } - - @Override - public void addSession(ConnectionContext context, SessionInfo info) throws Exception { - throw new BrokerStoppedException(this.message); - } - - @Override - public void removeSession(ConnectionContext context, SessionInfo info) throws Exception { - throw new BrokerStoppedException(this.message); - } - - @Override - public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception { - throw new BrokerStoppedException(this.message); - } - - @Override - public void removeProducer(ConnectionContext context, ProducerInfo info) throws Exception { - throw new BrokerStoppedException(this.message); - } - - @Override - public Connection[] getClients() throws Exception { - throw new BrokerStoppedException(this.message); - } - - @Override - public ActiveMQDestination[] getDestinations() throws Exception { - throw new BrokerStoppedException(this.message); - } - - @Override - public TransactionId[] getPreparedTransactions(ConnectionContext context) throws Exception { - throw new BrokerStoppedException(this.message); - } - - @Override - public void beginTransaction(ConnectionContext context, TransactionId xid) throws Exception { - throw new BrokerStoppedException(this.message); - } - - @Override - public int prepareTransaction(ConnectionContext context, TransactionId xid) throws Exception { - throw new BrokerStoppedException(this.message); - } - - @Override - public void rollbackTransaction(ConnectionContext context, TransactionId xid) throws Exception { - throw new BrokerStoppedException(this.message); - } - - @Override - public void commitTransaction(ConnectionContext context, TransactionId xid, boolean onePhase) throws Exception { - throw new BrokerStoppedException(this.message); - } - - @Override - public void forgetTransaction(ConnectionContext context, TransactionId transactionId) throws Exception { - throw new BrokerStoppedException(this.message); - } - - @Override - public Destination addDestination(ConnectionContext context, ActiveMQDestination destination,boolean flag) throws Exception { - throw new BrokerStoppedException(this.message); - } - - @Override - public void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout) throws Exception { - throw new BrokerStoppedException(this.message); - } - - @Override - public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { - throw new BrokerStoppedException(this.message); - } - - @Override - public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { - throw new BrokerStoppedException(this.message); - } - - @Override - public void removeSubscription(ConnectionContext context, RemoveSubscriptionInfo info) throws Exception { - throw new BrokerStoppedException(this.message); - } - - @Override - public void send(ProducerBrokerExchange producerExchange, Message message) throws Exception { - throw new BrokerStoppedException(this.message); - } - - @Override - public void acknowledge(ConsumerBrokerExchange consumerExchange, MessageAck ack) throws Exception { - throw new BrokerStoppedException(this.message); - } - - @Override - public void gc() { - throw new BrokerStoppedException(this.message); - } - - @Override - public void start() throws Exception { - throw new BrokerStoppedException(this.message); - } - - @Override - public void stop() throws Exception { - throw new BrokerStoppedException(this.message); - } - - @Override - public void addBroker(Connection connection, BrokerInfo info) { - throw new BrokerStoppedException(this.message); - - } - - @Override - public void removeBroker(Connection connection, BrokerInfo info) { - throw new BrokerStoppedException(this.message); - } - - @Override - public BrokerInfo[] getPeerBrokerInfos() { - throw new BrokerStoppedException(this.message); - } - - @Override - public void preProcessDispatch(MessageDispatch messageDispatch) { - throw new BrokerStoppedException(this.message); - } - - @Override - public void postProcessDispatch(MessageDispatch messageDispatch) { - throw new BrokerStoppedException(this.message); - } - - @Override - public void processDispatchNotification(MessageDispatchNotification messageDispatchNotification) throws Exception { - throw new BrokerStoppedException(this.message); - } - - @Override - public boolean isStopped() { - return true; - } - - @Override - public Set getDurableDestinations() { - throw new BrokerStoppedException(this.message); - } - - @Override - public void addDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception { - throw new BrokerStoppedException(this.message); - } - - @Override - public void removeDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception { - throw new BrokerStoppedException(this.message); - } - - @Override - public boolean isFaultTolerantConfiguration() { - throw new BrokerStoppedException(this.message); - } - - @Override - public ConnectionContext getAdminConnectionContext() { - throw new BrokerStoppedException(this.message); - } - - @Override - public void setAdminConnectionContext(ConnectionContext adminConnectionContext) { - throw new BrokerStoppedException(this.message); - } - - @Override - public Response messagePull(ConnectionContext context, MessagePull pull) { - throw new BrokerStoppedException(this.message); - } - - @Override - public PListStore getTempDataStore() { - throw new BrokerStoppedException(this.message); - } - - @Override - public URI getVmConnectorURI() { - throw new BrokerStoppedException(this.message); - } - - @Override - public void brokerServiceStarted() { - throw new BrokerStoppedException(this.message); - } - - @Override - public BrokerService getBrokerService() { - throw new BrokerStoppedException(this.message); - } - - @Override - public boolean isExpired(MessageReference messageReference) { - throw new BrokerStoppedException(this.message); - } - - @Override - public void messageExpired(ConnectionContext context, MessageReference message, Subscription subscription) { - throw new BrokerStoppedException(this.message); - } - - @Override - public boolean sendToDeadLetterQueue(ConnectionContext context, MessageReference messageReference, - Subscription subscription, Throwable poisonCause) { - throw new BrokerStoppedException(this.message); - } - - @Override - public Broker getRoot() { - throw new BrokerStoppedException(this.message); - } - - @Override - public long getBrokerSequenceId() { - throw new BrokerStoppedException(this.message); - } - - @Override - public void fastProducer(ConnectionContext context,ProducerInfo producerInfo,ActiveMQDestination destination) { - throw new BrokerStoppedException(this.message); - } - - @Override - public void isFull(ConnectionContext context,Destination destination, Usage usage) { - throw new BrokerStoppedException(this.message); - } - - @Override - public void messageConsumed(ConnectionContext context,MessageReference messageReference) { - throw new BrokerStoppedException(this.message); - } - - @Override - public void messageDelivered(ConnectionContext context,MessageReference messageReference) { - throw new BrokerStoppedException(this.message); - } - - @Override - public void messageDiscarded(ConnectionContext context, Subscription sub, MessageReference messageReference) { - throw new BrokerStoppedException(this.message); - } - - @Override - public void slowConsumer(ConnectionContext context, Destination destination,Subscription subs) { - throw new BrokerStoppedException(this.message); - } - - @Override - public void nowMasterBroker() { - throw new BrokerStoppedException(this.message); - } - - @Override - public void processConsumerControl(ConsumerBrokerExchange consumerExchange, - ConsumerControl control) { - throw new BrokerStoppedException(this.message); - } - - @Override - public Scheduler getScheduler() { - throw new BrokerStoppedException(this.message); - } - - @Override - public ThreadPoolExecutor getExecutor() { - throw new BrokerStoppedException(this.message); - } - - @Override - public void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex, String remoteIp) { - throw new BrokerStoppedException(this.message); - } - - @Override - public void networkBridgeStopped(BrokerInfo brokerInfo) { - throw new BrokerStoppedException(this.message); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/InsertableMutableBrokerFilter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/InsertableMutableBrokerFilter.class deleted file mode 100644 index 5ad1b294a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/InsertableMutableBrokerFilter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/InsertableMutableBrokerFilter.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/InsertableMutableBrokerFilter.java deleted file mode 100644 index 9e1923cff..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/InsertableMutableBrokerFilter.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * 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.broker; - -/** - * Inserts itself into the BrokerStack - * - * - */ -public class InsertableMutableBrokerFilter extends MutableBrokerFilter { - - MutableBrokerFilter parent; - - public InsertableMutableBrokerFilter(MutableBrokerFilter parent) { - super(parent.getNext()); - this.parent = parent; - parent.setNext(this); - - } - - /** - * Remove 'self' from the BrokerStack - */ - public void remove() { - parent.setNext(getNext()); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/Lockable.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/Lockable.class deleted file mode 100644 index 9edfc476b..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/Lockable.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/Lockable.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/Lockable.java deleted file mode 100644 index 734db55e5..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/Lockable.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * 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.broker; - -import java.io.IOException; - -/** - * A lockable broker resource. Uses {@link Locker} to guarantee that only single instance is running - * - */ -public interface Lockable { - - /** - * Turn locking on/off on the resource - * - * @param useLock - */ - public void setUseLock(boolean useLock); - - /** - * Create a default locker - * - * @return default locker - * @throws IOException - */ - public Locker createDefaultLocker() throws IOException; - - /** - * Set locker to be used - * - * @param locker - * @throws IOException - */ - public void setLocker(Locker locker) throws IOException; - - /** - * Period (in milliseconds) on which {@link org.apache.activemq.broker.Locker#keepAlive()} should be checked - * - * @param lockKeepAlivePeriod - */ - public void setLockKeepAlivePeriod(long lockKeepAlivePeriod); - - long getLockKeepAlivePeriod(); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/LockableServiceSupport$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/LockableServiceSupport$1.class deleted file mode 100644 index 549a713fc..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/LockableServiceSupport$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/LockableServiceSupport$2.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/LockableServiceSupport$2.class deleted file mode 100644 index 67b043ab9..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/LockableServiceSupport$2.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/LockableServiceSupport.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/LockableServiceSupport.class deleted file mode 100644 index 7987a7e53..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/LockableServiceSupport.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/LockableServiceSupport.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/LockableServiceSupport.java deleted file mode 100644 index 4f83d30cf..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/LockableServiceSupport.java +++ /dev/null @@ -1,173 +0,0 @@ -/** - * 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.broker; - -import org.apache.activemq.store.PersistenceAdapter; -import org.apache.activemq.util.ServiceStopper; -import org.apache.activemq.util.ServiceSupport; -import org.apache.activemq.util.ThreadPoolUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; -import java.util.concurrent.ScheduledFuture; -import java.util.concurrent.ScheduledThreadPoolExecutor; -import java.util.concurrent.ThreadFactory; -import java.util.concurrent.TimeUnit; - -/** - * Helper class for working with services that requires locking - */ -public abstract class LockableServiceSupport extends ServiceSupport implements Lockable, BrokerServiceAware { - - private static final Logger LOG = LoggerFactory.getLogger(LockableServiceSupport.class); - boolean useLock = true; - Locker locker; - long lockKeepAlivePeriod = 0; - private ScheduledFuture keepAliveTicket; - private ScheduledThreadPoolExecutor clockDaemon; - protected BrokerService brokerService; - - /** - * Initialize resources before locking - * - * @throws Exception - */ - abstract public void init() throws Exception; - - @Override - public void setUseLock(boolean useLock) { - this.useLock = useLock; - } - - public boolean isUseLock() { - return this.useLock; - } - - @Override - public void setLocker(Locker locker) throws IOException { - this.locker = locker; - locker.setLockable(this); - if (this instanceof PersistenceAdapter) { - this.locker.configure((PersistenceAdapter)this); - } - } - - public Locker getLocker() throws IOException { - if (this.locker == null) { - setLocker(createDefaultLocker()); - } - return this.locker; - } - - @Override - public void setLockKeepAlivePeriod(long lockKeepAlivePeriod) { - this.lockKeepAlivePeriod = lockKeepAlivePeriod; - } - - @Override - public long getLockKeepAlivePeriod() { - return lockKeepAlivePeriod; - } - - @Override - public void preStart() throws Exception { - init(); - if (useLock) { - if (getLocker() == null) { - LOG.warn("No locker configured"); - } else { - getLocker().start(); - if (lockKeepAlivePeriod > 0) { - keepAliveTicket = getScheduledThreadPoolExecutor().scheduleAtFixedRate(new Runnable() { - public void run() { - keepLockAlive(); - } - }, lockKeepAlivePeriod, lockKeepAlivePeriod, TimeUnit.MILLISECONDS); - } - } - } - } - - @Override - public void postStop(ServiceStopper stopper) throws Exception { - if (useLock) { - if (keepAliveTicket != null) { - keepAliveTicket.cancel(false); - keepAliveTicket = null; - } - if (locker != null) { - getLocker().stop(); - } - ThreadPoolUtils.shutdown(clockDaemon); - } - } - - protected void keepLockAlive() { - boolean stop = false; - try { - Locker locker = getLocker(); - if (locker != null) { - if (!locker.keepAlive()) { - stop = true; - } - } - } catch (SuppressReplyException e) { - LOG.warn("locker keepAlive resulted in", e); - } catch (IOException e) { - LOG.warn("locker keepAlive resulted in", e); - } - if (stop) { - stopBroker(); - } - } - - protected void stopBroker() { - // we can no longer keep the lock so lets fail - LOG.error("{}, no longer able to keep the exclusive lock so giving up being a master", brokerService.getBrokerName()); - try { - if( brokerService.isRestartAllowed() ) { - brokerService.requestRestart(); - } - brokerService.stop(); - } catch (Exception e) { - LOG.warn("Failure occurred while stopping broker"); - } - } - - public ScheduledThreadPoolExecutor getScheduledThreadPoolExecutor() { - if (clockDaemon == null) { - clockDaemon = new ScheduledThreadPoolExecutor(5, new ThreadFactory() { - public Thread newThread(Runnable runnable) { - Thread thread = new Thread(runnable, "ActiveMQ Lock KeepAlive Timer"); - thread.setDaemon(true); - return thread; - } - }); - } - return clockDaemon; - } - - @Override - public void setBrokerService(BrokerService brokerService) { - this.brokerService = brokerService; - } - - public BrokerService getBrokerService() { - return this.brokerService; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/Locker.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/Locker.class deleted file mode 100644 index a3f1a2241..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/Locker.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/Locker.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/Locker.java deleted file mode 100644 index 11a263606..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/Locker.java +++ /dev/null @@ -1,72 +0,0 @@ -/** - * 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.broker; - -import org.apache.activemq.Service; -import org.apache.activemq.store.PersistenceAdapter; - -import java.io.IOException; - -/** - * Represents a lock service to ensure that a broker is the only master - */ -public interface Locker extends Service { - - /** - * Used by a timer to keep alive the lock. - * If the method returns false the broker should be terminated - * if an exception is thrown, the lock state cannot be determined - */ - boolean keepAlive() throws IOException; - - /** - * set the delay interval in milliseconds between lock acquire attempts - * - * @param lockAcquireSleepInterval the sleep interval in miliseconds - */ - void setLockAcquireSleepInterval(long lockAcquireSleepInterval); - - /** - * Set the name of the lock to use. - */ - public void setName(String name); - - /** - * Specify whether to fail immediately if the lock is already held. When set, the CustomLock must throw an - * IOException immediately upon detecting the lock is already held. - * - * @param failIfLocked: true => fail immediately if the lock is held; false => block until the lock can be obtained - * (default). - */ - public void setFailIfLocked(boolean failIfLocked); - - /** - * A reference to what is locked - */ - public void setLockable(LockableServiceSupport lockable); - - /** - * Optionally configure the locker with the persistence adapter currently used - * You can use persistence adapter configuration details like, data directory - * datasource, etc. to be used by the locker - * - * @param persistenceAdapter - * @throws IOException - */ - public void configure(PersistenceAdapter persistenceAdapter) throws IOException; - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/MapTransportConnectionStateRegister.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/MapTransportConnectionStateRegister.class deleted file mode 100644 index 085d70d6c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/MapTransportConnectionStateRegister.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/MapTransportConnectionStateRegister.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/MapTransportConnectionStateRegister.java deleted file mode 100644 index 566b62eb9..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/MapTransportConnectionStateRegister.java +++ /dev/null @@ -1,129 +0,0 @@ -/** - * 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.broker; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -import org.apache.activemq.command.ConnectionId; -import org.apache.activemq.command.ConsumerId; -import org.apache.activemq.command.ProducerId; -import org.apache.activemq.command.SessionId; - -/** - * - */ - -public class MapTransportConnectionStateRegister implements TransportConnectionStateRegister{ - - private Map connectionStates = new ConcurrentHashMap(); - - public TransportConnectionState registerConnectionState(ConnectionId connectionId, - TransportConnectionState state) { - TransportConnectionState rc = connectionStates.put(connectionId, state); - return rc; - } - - public TransportConnectionState unregisterConnectionState(ConnectionId connectionId) { - TransportConnectionState rc = connectionStates.remove(connectionId); - if (rc.getReferenceCounter().get() > 1) { - rc.decrementReference(); - connectionStates.put(connectionId, rc); - } - return rc; - } - - public List listConnectionStates() { - - List rc = new ArrayList(); - rc.addAll(connectionStates.values()); - return rc; - } - - public TransportConnectionState lookupConnectionState(String connectionId) { - return connectionStates.get(new ConnectionId(connectionId)); - } - - public TransportConnectionState lookupConnectionState(ConsumerId id) { - TransportConnectionState cs = lookupConnectionState(id.getConnectionId()); - if (cs == null) { - throw new IllegalStateException( - "Cannot lookup a consumer from a connection that had not been registered: " - + id.getParentId().getParentId()); - } - return cs; - } - - public TransportConnectionState lookupConnectionState(ProducerId id) { - TransportConnectionState cs = lookupConnectionState(id.getConnectionId()); - if (cs == null) { - throw new IllegalStateException( - "Cannot lookup a producer from a connection that had not been registered: " - + id.getParentId().getParentId()); - } - return cs; - } - - public TransportConnectionState lookupConnectionState(SessionId id) { - TransportConnectionState cs = lookupConnectionState(id.getConnectionId()); - if (cs == null) { - throw new IllegalStateException( - "Cannot lookup a session from a connection that had not been registered: " - + id.getParentId()); - } - return cs; - } - - public TransportConnectionState lookupConnectionState(ConnectionId connectionId) { - TransportConnectionState cs = connectionStates.get(connectionId); - if (cs == null) { - throw new IllegalStateException("Cannot lookup a connection that had not been registered: " - + connectionId); - } - return cs; - } - - - - public boolean doesHandleMultipleConnectionStates() { - return true; - } - - public boolean isEmpty() { - return connectionStates.isEmpty(); - } - - public void clear() { - connectionStates.clear(); - - } - - public void intialize(TransportConnectionStateRegister other) { - connectionStates.clear(); - connectionStates.putAll(other.mapStates()); - - } - - public Map mapStates() { - HashMap map = new HashMap(connectionStates); - return map; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/MutableBrokerFilter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/MutableBrokerFilter.class deleted file mode 100644 index 1ee1b1d6c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/MutableBrokerFilter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/MutableBrokerFilter.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/MutableBrokerFilter.java deleted file mode 100644 index 0e6b199ed..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/MutableBrokerFilter.java +++ /dev/null @@ -1,398 +0,0 @@ -/** - * 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.broker; - -import java.net.URI; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.atomic.AtomicReference; - -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.BrokerId; -import org.apache.activemq.command.BrokerInfo; -import org.apache.activemq.command.ConnectionInfo; -import org.apache.activemq.command.ConsumerControl; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.command.DestinationInfo; -import org.apache.activemq.command.Message; -import org.apache.activemq.command.MessageAck; -import org.apache.activemq.command.MessageDispatch; -import org.apache.activemq.command.MessageDispatchNotification; -import org.apache.activemq.command.MessagePull; -import org.apache.activemq.command.ProducerInfo; -import org.apache.activemq.command.RemoveSubscriptionInfo; -import org.apache.activemq.command.Response; -import org.apache.activemq.command.SessionInfo; -import org.apache.activemq.command.TransactionId; -import org.apache.activemq.store.PListStore; -import org.apache.activemq.thread.Scheduler; -import org.apache.activemq.usage.Usage; - -/** - * Like a BrokerFilter but it allows you to switch the getNext().broker. This - * has more overhead than a BrokerFilter since access to the getNext().broker - * has to synchronized since it is mutable - * - * - */ -public class MutableBrokerFilter implements Broker { - - protected AtomicReference next = new AtomicReference(); - - public MutableBrokerFilter(Broker next) { - this.next.set(next); - } - - @Override - public Broker getAdaptor(Class type) { - if (type.isInstance(this)) { - return this; - } - return next.get().getAdaptor(type); - } - - public Broker getNext() { - return next.get(); - } - - public void setNext(Broker next) { - this.next.set(next); - } - - @Override - public Map getDestinationMap() { - return getNext().getDestinationMap(); - } - - @Override - public Set getDestinations(ActiveMQDestination destination) { - return getNext().getDestinations(destination); - } - - @Override - public void acknowledge(ConsumerBrokerExchange consumerExchange, MessageAck ack) throws Exception { - getNext().acknowledge(consumerExchange, ack); - } - - @Override - public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception { - getNext().addConnection(context, info); - } - - @Override - public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { - return getNext().addConsumer(context, info); - } - - @Override - public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception { - getNext().addProducer(context, info); - } - - @Override - public void commitTransaction(ConnectionContext context, TransactionId xid, boolean onePhase) throws Exception { - getNext().commitTransaction(context, xid, onePhase); - } - - @Override - public void removeSubscription(ConnectionContext context, RemoveSubscriptionInfo info) throws Exception { - getNext().removeSubscription(context, info); - } - - @Override - public TransactionId[] getPreparedTransactions(ConnectionContext context) throws Exception { - return getNext().getPreparedTransactions(context); - } - - @Override - public int prepareTransaction(ConnectionContext context, TransactionId xid) throws Exception { - return getNext().prepareTransaction(context, xid); - } - - @Override - public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception { - getNext().removeConnection(context, info, error); - } - - @Override - public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { - getNext().removeConsumer(context, info); - } - - @Override - public void removeProducer(ConnectionContext context, ProducerInfo info) throws Exception { - getNext().removeProducer(context, info); - } - - @Override - public void rollbackTransaction(ConnectionContext context, TransactionId xid) throws Exception { - getNext().rollbackTransaction(context, xid); - } - - @Override - public void send(ProducerBrokerExchange producerExchange, Message messageSend) throws Exception { - getNext().send(producerExchange, messageSend); - } - - @Override - public void beginTransaction(ConnectionContext context, TransactionId xid) throws Exception { - getNext().beginTransaction(context, xid); - } - - @Override - public void forgetTransaction(ConnectionContext context, TransactionId transactionId) throws Exception { - getNext().forgetTransaction(context, transactionId); - } - - @Override - public Connection[] getClients() throws Exception { - return getNext().getClients(); - } - - @Override - public Destination addDestination(ConnectionContext context, ActiveMQDestination destination,boolean createIfTemporary) throws Exception { - return getNext().addDestination(context, destination,createIfTemporary); - } - - @Override - public void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout) throws Exception { - getNext().removeDestination(context, destination, timeout); - } - - @Override - public ActiveMQDestination[] getDestinations() throws Exception { - return getNext().getDestinations(); - } - - @Override - public void start() throws Exception { - getNext().start(); - } - - @Override - public void stop() throws Exception { - getNext().stop(); - } - - @Override - public void addSession(ConnectionContext context, SessionInfo info) throws Exception { - getNext().addSession(context, info); - } - - @Override - public void removeSession(ConnectionContext context, SessionInfo info) throws Exception { - getNext().removeSession(context, info); - } - - @Override - public BrokerId getBrokerId() { - return getNext().getBrokerId(); - } - - @Override - public String getBrokerName() { - return getNext().getBrokerName(); - } - - @Override - public void gc() { - getNext().gc(); - } - - @Override - public void addBroker(Connection connection, BrokerInfo info) { - getNext().addBroker(connection, info); - } - - @Override - public void removeBroker(Connection connection, BrokerInfo info) { - getNext().removeBroker(connection, info); - } - - @Override - public BrokerInfo[] getPeerBrokerInfos() { - return getNext().getPeerBrokerInfos(); - } - - @Override - public void preProcessDispatch(MessageDispatch messageDispatch) { - getNext().preProcessDispatch(messageDispatch); - } - - @Override - public void postProcessDispatch(MessageDispatch messageDispatch) { - getNext().postProcessDispatch(messageDispatch); - } - - @Override - public void processDispatchNotification(MessageDispatchNotification messageDispatchNotification) throws Exception { - getNext().processDispatchNotification(messageDispatchNotification); - } - - @Override - public boolean isStopped() { - return getNext().isStopped(); - } - - @Override - public Set getDurableDestinations() { - return getNext().getDurableDestinations(); - } - - @Override - public void addDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception { - getNext().addDestinationInfo(context, info); - - } - - @Override - public void removeDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception { - getNext().removeDestinationInfo(context, info); - - } - - @Override - public boolean isFaultTolerantConfiguration() { - return getNext().isFaultTolerantConfiguration(); - } - - @Override - public ConnectionContext getAdminConnectionContext() { - return getNext().getAdminConnectionContext(); - } - - @Override - public void setAdminConnectionContext(ConnectionContext adminConnectionContext) { - getNext().setAdminConnectionContext(adminConnectionContext); - } - - @Override - public Response messagePull(ConnectionContext context, MessagePull pull) throws Exception { - return getNext().messagePull(context, pull); - } - - @Override - public PListStore getTempDataStore() { - return getNext().getTempDataStore(); - } - - @Override - public URI getVmConnectorURI() { - return getNext().getVmConnectorURI(); - } - - @Override - public void brokerServiceStarted() { - getNext().brokerServiceStarted(); - } - - @Override - public BrokerService getBrokerService() { - return getNext().getBrokerService(); - } - - @Override - public boolean isExpired(MessageReference messageReference) { - return getNext().isExpired(messageReference); - } - - @Override - public void messageExpired(ConnectionContext context, MessageReference message, Subscription subscription) { - getNext().messageExpired(context, message, subscription); - } - - @Override - public boolean sendToDeadLetterQueue(ConnectionContext context, MessageReference messageReference, - Subscription subscription, Throwable poisonCause) { - return getNext().sendToDeadLetterQueue(context, messageReference, subscription, poisonCause); - } - - @Override - public Broker getRoot() { - return getNext().getRoot(); - } - - @Override - public long getBrokerSequenceId() { - return getNext().getBrokerSequenceId(); - } - - @Override - public void fastProducer(ConnectionContext context,ProducerInfo producerInfo,ActiveMQDestination destination) { - getNext().fastProducer(context, producerInfo, destination); - } - - @Override - public void isFull(ConnectionContext context,Destination destination, Usage usage) { - getNext().isFull(context,destination, usage); - } - - @Override - public void messageConsumed(ConnectionContext context,MessageReference messageReference) { - getNext().messageConsumed(context, messageReference); - } - - @Override - public void messageDelivered(ConnectionContext context,MessageReference messageReference) { - getNext().messageDelivered(context, messageReference); - } - - @Override - public void messageDiscarded(ConnectionContext context, Subscription sub, MessageReference messageReference) { - getNext().messageDiscarded(context, sub, messageReference); - } - - @Override - public void slowConsumer(ConnectionContext context, Destination dest, Subscription subs) { - getNext().slowConsumer(context, dest,subs); - } - - @Override - public void nowMasterBroker() { - getNext().nowMasterBroker(); - } - - @Override - public void processConsumerControl(ConsumerBrokerExchange consumerExchange, - ConsumerControl control) { - getNext().processConsumerControl(consumerExchange, control); - } - - @Override - public Scheduler getScheduler() { - return getNext().getScheduler(); - } - - @Override - public ThreadPoolExecutor getExecutor() { - return getNext().getExecutor(); - } - - @Override - public void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex, String remoteIp) { - getNext().networkBridgeStarted(brokerInfo, createdByDuplex, remoteIp); - } - - @Override - public void networkBridgeStopped(BrokerInfo brokerInfo) { - getNext().networkBridgeStopped(brokerInfo); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/ProducerBrokerExchange$FlowControlInfo.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/ProducerBrokerExchange$FlowControlInfo.class deleted file mode 100644 index c0c899a1c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/ProducerBrokerExchange$FlowControlInfo.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/ProducerBrokerExchange.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/ProducerBrokerExchange.class deleted file mode 100644 index 90b7ed897..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/ProducerBrokerExchange.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/ProducerBrokerExchange.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/ProducerBrokerExchange.java deleted file mode 100644 index b3b383ee4..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/ProducerBrokerExchange.java +++ /dev/null @@ -1,264 +0,0 @@ -/** - * 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.broker; - -import java.io.IOException; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicLong; - -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.Region; -import org.apache.activemq.command.Message; -import org.apache.activemq.command.MessageId; -import org.apache.activemq.state.ProducerState; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Holds internal state in the broker for a MessageProducer - */ -public class ProducerBrokerExchange { - - private static final Logger LOG = LoggerFactory.getLogger(ProducerBrokerExchange.class); - private ConnectionContext connectionContext; - private Destination regionDestination; - private Region region; - private ProducerState producerState; - private boolean mutable = true; - private AtomicLong lastSendSequenceNumber = new AtomicLong(-1); - private boolean auditProducerSequenceIds; - private boolean isNetworkProducer; - private BrokerService brokerService; - private final FlowControlInfo flowControlInfo = new FlowControlInfo(); - - public ProducerBrokerExchange() { - } - - public ProducerBrokerExchange copy() { - ProducerBrokerExchange rc = new ProducerBrokerExchange(); - rc.connectionContext = connectionContext.copy(); - rc.regionDestination = regionDestination; - rc.region = region; - rc.producerState = producerState; - rc.mutable = mutable; - return rc; - } - - - /** - * @return the connectionContext - */ - public ConnectionContext getConnectionContext() { - return this.connectionContext; - } - - /** - * @param connectionContext the connectionContext to set - */ - public void setConnectionContext(ConnectionContext connectionContext) { - this.connectionContext = connectionContext; - } - - /** - * @return the mutable - */ - public boolean isMutable() { - return this.mutable; - } - - /** - * @param mutable the mutable to set - */ - public void setMutable(boolean mutable) { - this.mutable = mutable; - } - - /** - * @return the regionDestination - */ - public Destination getRegionDestination() { - return this.regionDestination; - } - - /** - * @param regionDestination the regionDestination to set - */ - public void setRegionDestination(Destination regionDestination) { - this.regionDestination = regionDestination; - } - - /** - * @return the region - */ - public Region getRegion() { - return this.region; - } - - /** - * @param region the region to set - */ - public void setRegion(Region region) { - this.region = region; - } - - /** - * @return the producerState - */ - public ProducerState getProducerState() { - return this.producerState; - } - - /** - * @param producerState the producerState to set - */ - public void setProducerState(ProducerState producerState) { - this.producerState = producerState; - } - - /** - * Enforce duplicate suppression using info from persistence adapter - * - * @return false if message should be ignored as a duplicate - */ - public boolean canDispatch(Message messageSend) { - boolean canDispatch = true; - if (auditProducerSequenceIds && messageSend.isPersistent()) { - final long producerSequenceId = messageSend.getMessageId().getProducerSequenceId(); - if (isNetworkProducer) { - // messages are multiplexed on this producer so we need to query the persistenceAdapter - long lastStoredForMessageProducer = getStoredSequenceIdForMessage(messageSend.getMessageId()); - if (producerSequenceId <= lastStoredForMessageProducer) { - canDispatch = false; - LOG.debug("suppressing duplicate message send [{}] from network producer with producerSequence [{}] less than last stored: {}", new Object[]{ - (LOG.isTraceEnabled() ? messageSend : messageSend.getMessageId()), producerSequenceId, lastStoredForMessageProducer - }); - } - } else if (producerSequenceId <= lastSendSequenceNumber.get()) { - canDispatch = false; - LOG.debug("suppressing duplicated message send [{}] with producerSequenceId [{}] less than last stored: {}", new Object[]{ - (LOG.isTraceEnabled() ? messageSend : messageSend.getMessageId()), producerSequenceId, lastSendSequenceNumber - }); - } else { - // track current so we can suppress duplicates later in the stream - lastSendSequenceNumber.set(producerSequenceId); - } - } - return canDispatch; - } - - private long getStoredSequenceIdForMessage(MessageId messageId) { - try { - return brokerService.getPersistenceAdapter().getLastProducerSequenceId(messageId.getProducerId()); - } catch (IOException ignored) { - LOG.debug("Failed to determine last producer sequence id for: {}", messageId, ignored); - } - return -1; - } - - public void setLastStoredSequenceId(long l) { - auditProducerSequenceIds = true; - if (connectionContext.isNetworkConnection()) { - brokerService = connectionContext.getBroker().getBrokerService(); - isNetworkProducer = true; - } - lastSendSequenceNumber.set(l); - LOG.debug("last stored sequence id set: {}", l); - } - - public void incrementSend() { - flowControlInfo.incrementSend(); - } - - public void blockingOnFlowControl(boolean blockingOnFlowControl) { - flowControlInfo.setBlockingOnFlowControl(blockingOnFlowControl); - } - - public void incrementTimeBlocked(Destination destination, long timeBlocked) { - flowControlInfo.incrementTimeBlocked(timeBlocked); - } - - - public boolean isBlockedForFlowControl() { - return flowControlInfo.isBlockingOnFlowControl(); - } - - public void resetFlowControl() { - flowControlInfo.reset(); - } - - public long getTotalTimeBlocked() { - return flowControlInfo.getTotalTimeBlocked(); - } - - public int getPercentageBlocked() { - double value = flowControlInfo.getSendsBlocked() / flowControlInfo.getTotalSends(); - return (int) value * 100; - } - - - public static class FlowControlInfo { - private AtomicBoolean blockingOnFlowControl = new AtomicBoolean(); - private AtomicLong totalSends = new AtomicLong(); - private AtomicLong sendsBlocked = new AtomicLong(); - private AtomicLong totalTimeBlocked = new AtomicLong(); - - - public boolean isBlockingOnFlowControl() { - return blockingOnFlowControl.get(); - } - - public void setBlockingOnFlowControl(boolean blockingOnFlowControl) { - this.blockingOnFlowControl.set(blockingOnFlowControl); - if (blockingOnFlowControl) { - incrementSendBlocked(); - } - } - - - public long getTotalSends() { - return totalSends.get(); - } - - public void incrementSend() { - this.totalSends.incrementAndGet(); - } - - public long getSendsBlocked() { - return sendsBlocked.get(); - } - - public void incrementSendBlocked() { - this.sendsBlocked.incrementAndGet(); - } - - public long getTotalTimeBlocked() { - return totalTimeBlocked.get(); - } - - public void incrementTimeBlocked(long time) { - this.totalTimeBlocked.addAndGet(time); - } - - public void reset() { - blockingOnFlowControl.set(false); - totalSends.set(0); - sendsBlocked.set(0); - totalTimeBlocked.set(0); - - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/PropertiesBrokerFactory.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/PropertiesBrokerFactory.class deleted file mode 100644 index 312ccf399..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/PropertiesBrokerFactory.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/PropertiesBrokerFactory.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/PropertiesBrokerFactory.java deleted file mode 100644 index 698c326ed..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/PropertiesBrokerFactory.java +++ /dev/null @@ -1,101 +0,0 @@ -/** - * 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.broker; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URL; -import java.util.Map; -import java.util.Properties; - -import org.apache.activemq.util.IntrospectionSupport; - -/** - * A {@link BrokerFactoryHandler} which uses a properties file to configure the - * broker's various policies. - * - * - */ -public class PropertiesBrokerFactory implements BrokerFactoryHandler { - - public BrokerService createBroker(URI brokerURI) throws Exception { - - Map properties = loadProperties(brokerURI); - BrokerService brokerService = createBrokerService(brokerURI, properties); - - IntrospectionSupport.setProperties(brokerService, properties); - return brokerService; - } - - /** - * Lets load the properties from some external URL or a relative file - */ - protected Map loadProperties(URI brokerURI) throws IOException { - // lets load a URI - String remaining = brokerURI.getSchemeSpecificPart(); - Properties properties = new Properties(); - File file = new File(remaining); - - InputStream inputStream = null; - if (file.exists()) { - inputStream = new FileInputStream(file); - } else { - URL url = null; - try { - url = new URL(remaining); - } catch (MalformedURLException e) { - // lets now see if we can find the name on the classpath - inputStream = findResourceOnClassPath(remaining); - if (inputStream == null) { - throw new IOException("File does not exist: " + remaining + ", could not be found on the classpath and is not a valid URL: " + e); - } - } - if (inputStream == null && url != null) { - inputStream = url.openStream(); - } - } - if (inputStream != null) { - properties.load(inputStream); - inputStream.close(); - } - - // should we append any system properties? - try { - Properties systemProperties = System.getProperties(); - properties.putAll(systemProperties); - } catch (Exception e) { - // ignore security exception - } - return properties; - } - - protected InputStream findResourceOnClassPath(String remaining) { - InputStream answer = Thread.currentThread().getContextClassLoader().getResourceAsStream(remaining); - if (answer == null) { - answer = getClass().getClassLoader().getResourceAsStream(remaining); - } - return answer; - } - - protected BrokerService createBrokerService(URI brokerURI, Map properties) { - return new BrokerService(); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/PublishedAddressPolicy$PublishedHostStrategy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/PublishedAddressPolicy$PublishedHostStrategy.class deleted file mode 100644 index 4708f5f93..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/PublishedAddressPolicy$PublishedHostStrategy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/PublishedAddressPolicy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/PublishedAddressPolicy.class deleted file mode 100644 index 5ff965a01..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/PublishedAddressPolicy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/PublishedAddressPolicy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/PublishedAddressPolicy.java deleted file mode 100644 index 9898482a4..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/PublishedAddressPolicy.java +++ /dev/null @@ -1,215 +0,0 @@ -/** - * 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.broker; - -import java.net.InetAddress; -import java.net.URI; -import java.net.UnknownHostException; -import java.util.HashMap; -import java.util.Locale; - -import org.apache.activemq.util.InetAddressUtil; - -/** - * Policy object that controls how a TransportConnector publishes the connector's - * address to the outside world. By default the connector will publish itself - * using the resolved host name of the bound server socket. - * - * @org.apache.xbean.XBean - */ -public class PublishedAddressPolicy { - - private String clusterClientUriQuery; - private PublishedHostStrategy publishedHostStrategy = PublishedHostStrategy.DEFAULT; - private HashMap portMapping = new HashMap(); - - /** - * Defines the value of the published host value. - */ - public enum PublishedHostStrategy { - DEFAULT, - IPADDRESS, - HOSTNAME, - FQDN; - - public static PublishedHostStrategy getValue(String value) { - return valueOf(value.toUpperCase(Locale.ENGLISH)); - } - } - - /** - * Using the supplied TransportConnector this method returns the String that will - * be used to update clients with this connector's connect address. - * - * @param connector - * The TransportConnector whose address is to be published. - * @return a string URI address that a client can use to connect to this Transport. - * @throws Exception - */ - public URI getPublishableConnectURI(TransportConnector connector) throws Exception { - - URI connectorURI = connector.getConnectUri(); - - if (connectorURI == null) { - return null; - } - - String scheme = connectorURI.getScheme(); - String userInfo = getPublishedUserInfoValue(connectorURI.getUserInfo()); - String host = getPublishedHostValue(connectorURI.getHost()); - int port = connectorURI.getPort(); - if (portMapping.containsKey(port)) { - port = portMapping.get(port); - } - String path = getPublishedPathValue(connectorURI.getPath()); - String fragment = getPublishedFragmentValue(connectorURI.getFragment()); - - URI publishedURI = new URI(scheme, userInfo, host, port, path, getClusterClientUriQuery(), fragment); - return publishedURI; - } - - public String getPublishableConnectString(TransportConnector connector) throws Exception { - return getPublishableConnectURI(connector).toString(); - } - - /** - * Subclasses can override what host value is published by implementing alternate - * logic for this method. - * - * @param uriHostEntry - * @return - * @throws UnknownHostException - */ - protected String getPublishedHostValue(String uriHostEntry) throws UnknownHostException { - - // By default we just republish what was already present. - String result = uriHostEntry; - - if (this.publishedHostStrategy.equals(PublishedHostStrategy.IPADDRESS)) { - InetAddress address = InetAddress.getByName(uriHostEntry); - result = address.getHostAddress(); - } else if (this.publishedHostStrategy.equals(PublishedHostStrategy.HOSTNAME)) { - InetAddress address = InetAddress.getByName(uriHostEntry); - if (address.isAnyLocalAddress()) { - // make it more human readable and useful, an alternative to 0.0.0.0 - result = InetAddressUtil.getLocalHostName(); - } else { - result = address.getHostName(); - } - } else if (this.publishedHostStrategy.equals(PublishedHostStrategy.FQDN)) { - InetAddress address = InetAddress.getByName(uriHostEntry); - if (address.isAnyLocalAddress()) { - // make it more human readable and useful, an alternative to 0.0.0.0 - result = InetAddressUtil.getLocalHostName(); - } else { - result = address.getCanonicalHostName(); - } - } - - return result; - } - - /** - * Subclasses can override what path value is published by implementing alternate - * logic for this method. By default this method simply returns what was already - * set as the Path value in the original URI. - * - * @param uriPathEntry - * The original value of the URI path. - * - * @return the desired value for the published URI's path. - */ - protected String getPublishedPathValue(String uriPathEntry) { - return uriPathEntry; - } - - /** - * Subclasses can override what host value is published by implementing alternate - * logic for this method. By default this method simply returns what was already - * set as the Fragment value in the original URI. - * - * @param uriFragmentEntry - * The original value of the URI Fragment. - * - * @return the desired value for the published URI's Fragment. - */ - protected String getPublishedFragmentValue(String uriFragmentEntry) { - return uriFragmentEntry; - } - - /** - * Subclasses can override what user info value is published by implementing alternate - * logic for this method. By default this method simply returns what was already - * set as the UserInfo value in the original URI. - * - * @param uriUserInfoEntry - * The original value of the URI user info. - * - * @return the desired value for the published URI's user info. - */ - protected String getPublishedUserInfoValue(String uriUserInfoEntry) { - return uriUserInfoEntry; - } - - /** - * Gets the URI query that's configured on the published URI that's sent to client's - * when the cluster info is updated. - * - * @return the clusterClientUriQuery - */ - public String getClusterClientUriQuery() { - return clusterClientUriQuery; - } - - /** - * Sets the URI query that's configured on the published URI that's sent to client's - * when the cluster info is updated. - * - * @param clusterClientUriQuery the clusterClientUriQuery to set - */ - public void setClusterClientUriQuery(String clusterClientUriQuery) { - this.clusterClientUriQuery = clusterClientUriQuery; - } - - /** - * @return the publishedHostStrategy - */ - public PublishedHostStrategy getPublishedHostStrategy() { - return publishedHostStrategy; - } - - /** - * @param publishedHostStrategy the publishedHostStrategy to set - */ - public void setPublishedHostStrategy(PublishedHostStrategy strategy) { - this.publishedHostStrategy = strategy; - } - - /** - * @param publishedHostStrategy the publishedHostStrategy to set - */ - public void setPublishedHostStrategy(String strategy) { - this.publishedHostStrategy = PublishedHostStrategy.getValue(strategy); - } - - /** - * @param portMapping map the ports in restrictive environments - */ - public void setPortMapping(HashMap portMapping) { - this.portMapping = portMapping; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/SingleTransportConnectionStateRegister.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/SingleTransportConnectionStateRegister.class deleted file mode 100644 index c724c0ce6..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/SingleTransportConnectionStateRegister.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/SingleTransportConnectionStateRegister.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/SingleTransportConnectionStateRegister.java deleted file mode 100644 index 159c6e6d0..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/SingleTransportConnectionStateRegister.java +++ /dev/null @@ -1,151 +0,0 @@ -/** - * 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.broker; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; - -import org.apache.activemq.command.ConnectionId; -import org.apache.activemq.command.ConsumerId; -import org.apache.activemq.command.ProducerId; -import org.apache.activemq.command.SessionId; - -/** - * - */ - -public class SingleTransportConnectionStateRegister implements TransportConnectionStateRegister{ - - private TransportConnectionState connectionState; - private ConnectionId connectionId; - - public TransportConnectionState registerConnectionState(ConnectionId connectionId, - TransportConnectionState state) { - TransportConnectionState rc = connectionState; - connectionState = state; - this.connectionId = connectionId; - return rc; - } - - public synchronized TransportConnectionState unregisterConnectionState(ConnectionId connectionId) { - TransportConnectionState rc = null; - - - if (connectionId != null && connectionState != null && this.connectionId!=null){ - if (this.connectionId.equals(connectionId)){ - rc = connectionState; - connectionState = null; - connectionId = null; - } - } - return rc; - } - - public synchronized List listConnectionStates() { - List rc = new ArrayList(); - if (connectionState != null) { - rc.add(connectionState); - } - return rc; - } - - public synchronized TransportConnectionState lookupConnectionState(String connectionId) { - TransportConnectionState cs = connectionState; - if (cs == null) { - throw new IllegalStateException( - "Cannot lookup a connectionId for a connection that had not been registered: " - + connectionId); - } - return cs; - } - - public synchronized TransportConnectionState lookupConnectionState(ConsumerId id) { - TransportConnectionState cs = connectionState; - if (cs == null) { - throw new IllegalStateException( - "Cannot lookup a consumer from a connection that had not been registered: " - + id.getParentId().getParentId()); - } - return cs; - } - - public synchronized TransportConnectionState lookupConnectionState(ProducerId id) { - TransportConnectionState cs = connectionState; - if (cs == null) { - throw new IllegalStateException( - "Cannot lookup a producer from a connection that had not been registered: " - + id.getParentId().getParentId()); - } - return cs; - } - - public synchronized TransportConnectionState lookupConnectionState(SessionId id) { - TransportConnectionState cs = connectionState; - if (cs == null) { - throw new IllegalStateException( - "Cannot lookup a session from a connection that had not been registered: " - + id.getParentId()); - } - return cs; - } - - public synchronized TransportConnectionState lookupConnectionState(ConnectionId connectionId) { - TransportConnectionState cs = connectionState; - return cs; - } - - public synchronized boolean doesHandleMultipleConnectionStates() { - return false; - } - - public synchronized boolean isEmpty() { - return connectionState == null; - } - - public void intialize(TransportConnectionStateRegister other) { - - if (other.isEmpty()){ - clear(); - }else{ - Map map = other.mapStates(); - Iterator i = map.entrySet().iterator(); - Map.Entry entry = (Entry) i.next(); - connectionId = entry.getKey(); - connectionState =entry.getValue(); - } - - } - - public Map mapStates() { - Map map = new HashMap(); - if (!isEmpty()) { - map.put(connectionId, connectionState); - } - return map; - } - - public void clear() { - connectionState=null; - connectionId=null; - - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/SslBrokerService.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/SslBrokerService.class deleted file mode 100644 index a9732c7aa..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/SslBrokerService.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/SslBrokerService.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/SslBrokerService.java deleted file mode 100644 index 8cc944d9d..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/SslBrokerService.java +++ /dev/null @@ -1,107 +0,0 @@ -/** - * 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.broker; - -import java.io.IOException; -import java.net.URI; -import java.security.KeyManagementException; -import java.security.SecureRandom; - -import javax.net.ssl.KeyManager; -import javax.net.ssl.TrustManager; - -import org.apache.activemq.transport.TransportFactorySupport; -import org.apache.activemq.transport.TransportServer; -import org.apache.activemq.transport.tcp.SslTransportFactory; - -/** - * A BrokerService that allows access to the key and trust managers used by SSL - * connections. There is no reason to use this class unless SSL is being used - * AND the key and trust managers need to be specified from within code. In - * fact, if the URI passed to this class does not have an "ssl" scheme, this - * class will pass all work on to its superclass. - * - * @author sepandm@gmail.com (Sepand) - */ -public class SslBrokerService extends BrokerService { - /** - * Adds a new transport connector for the given bind address. If the - * transport created uses SSL, it will also use the key and trust managers - * provided. Otherwise, this is the same as calling addConnector. - * - * @param bindAddress The address to bind to. - * @param km The KeyManager to be used. - * @param tm The trustmanager to be used. - * @param random The source of randomness for the generator. - * @return the newly connected and added transport connector. - * @throws Exception - */ - - public TransportConnector addSslConnector(String bindAddress, KeyManager[] km, TrustManager[] tm, SecureRandom random) throws Exception { - return addSslConnector(new URI(bindAddress), km, tm, random); - } - - /** - * Adds a new transport connector for the given bind address. If the - * transport created uses SSL, it will also use the key and trust managers - * provided. Otherwise, this is the same as calling addConnector. - * - * @param bindAddress The URI to bind to. - * @param km The KeyManager to be used. - * @param tm The trustmanager to be used. - * @param random The source of randomness for the generator. - * @return the newly created and added transport connector. - * @throws Exception - */ - public TransportConnector addSslConnector(URI bindAddress, KeyManager[] km, TrustManager[] tm, SecureRandom random) throws Exception { - return addConnector(createSslTransportServer(bindAddress, km, tm, random)); - } - - /** - * Creates a TransportServer that uses the given key and trust managers. The - * last three parameters will be eventually passed to SSLContext.init. - * - * @param brokerURI The URI to bind to. - * @param km The KeyManager to be used. - * @param tm The trustmanager to be used. - * @param random The source of randomness for the generator. - * @return A new TransportServer that uses the given managers. - * @throws IOException If cannot handle URI. - * @throws KeyManagementException Passed on from SSL. - */ - protected TransportServer createSslTransportServer(URI brokerURI, KeyManager[] km, TrustManager[] tm, SecureRandom random) throws IOException, KeyManagementException { - - if (brokerURI.getScheme().equals("ssl")) { - // If given an SSL URI, use an SSL TransportFactory and configure - // it to use the given key and trust managers. - SslTransportFactory transportFactory = new SslTransportFactory(); - - SslContext ctx = new SslContext(km, tm, random); - SslContext.setCurrentSslContext(ctx); - try { - return transportFactory.doBind(brokerURI); - } finally { - SslContext.setCurrentSslContext(null); - } - - } else { - // Else, business as usual. - return TransportFactorySupport.bind(this, brokerURI); - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/SslContext.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/SslContext.class deleted file mode 100644 index dba162c5a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/SslContext.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/SslContext.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/SslContext.java deleted file mode 100644 index c3843ae98..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/SslContext.java +++ /dev/null @@ -1,135 +0,0 @@ -/** - * 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.broker; - -import java.security.KeyManagementException; -import java.security.NoSuchAlgorithmException; -import java.security.NoSuchProviderException; -import java.security.SecureRandom; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import javax.net.ssl.KeyManager; -import javax.net.ssl.SSLContext; -import javax.net.ssl.TrustManager; - -/** - * A holder of SSL configuration. - */ -public class SslContext { - - protected String protocol = "TLS"; - protected String provider = null; - protected List keyManagers = new ArrayList(); - protected List trustManagers = new ArrayList(); - protected SecureRandom secureRandom; - private SSLContext sslContext; - - private static final ThreadLocal current = new ThreadLocal(); - - public SslContext() { - } - - public SslContext(KeyManager[] km, TrustManager[] tm, SecureRandom random) { - if( km!=null ) { - setKeyManagers(Arrays.asList(km)); - } - if( tm!=null ) { - setTrustManagers(Arrays.asList(tm)); - } - setSecureRandom(random); - } - - static public void setCurrentSslContext(SslContext bs) { - current.set(bs); - } - static public SslContext getCurrentSslContext() { - return current.get(); - } - - public KeyManager[] getKeyManagersAsArray() { - KeyManager rc[] = new KeyManager[keyManagers.size()]; - return keyManagers.toArray(rc); - } - public TrustManager[] getTrustManagersAsArray() { - TrustManager rc[] = new TrustManager[trustManagers.size()]; - return trustManagers.toArray(rc); - } - - public void addKeyManager(KeyManager km) { - keyManagers.add(km); - } - public boolean removeKeyManager(KeyManager km) { - return keyManagers.remove(km); - } - public void addTrustManager(TrustManager tm) { - trustManagers.add(tm); - } - public boolean removeTrustManager(TrustManager tm) { - return trustManagers.remove(tm); - } - - public List getKeyManagers() { - return keyManagers; - } - public void setKeyManagers(List keyManagers) { - this.keyManagers = keyManagers; - } - public List getTrustManagers() { - return trustManagers; - } - public void setTrustManagers(List trustManagers) { - this.trustManagers = trustManagers; - } - public SecureRandom getSecureRandom() { - return secureRandom; - } - public void setSecureRandom(SecureRandom secureRandom) { - this.secureRandom = secureRandom; - } - - public String getProtocol() { - return protocol; - } - public void setProtocol(String protocol) { - this.protocol = protocol; - } - public String getProvider() { - return provider; - } - public void setProvider(String provider) { - this.provider = provider; - } - - public SSLContext getSSLContext() throws NoSuchProviderException, NoSuchAlgorithmException, KeyManagementException { - if( sslContext == null ) { - if( provider == null ) { - sslContext = SSLContext.getInstance(protocol); - } else { - sslContext = SSLContext.getInstance(protocol, provider); - } - sslContext.init(getKeyManagersAsArray(), getTrustManagersAsArray(), getSecureRandom()); - } - return sslContext; - } - public void setSSLContext(SSLContext sslContext) { - this.sslContext = sslContext; - } - - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/SuppressReplyException.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/SuppressReplyException.class deleted file mode 100644 index 20c1d5768..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/SuppressReplyException.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/SuppressReplyException.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/SuppressReplyException.java deleted file mode 100644 index eb54a12d2..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/SuppressReplyException.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * 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.broker; - -import java.io.IOException; - -/** - * An exception thrown when the broker or transport will be shutdown in response - * to an error, eg. from IOExceptionHandler. - * The transport will die (socket.close()) so we don't want to propagate exceptions - * to the client; failover transport will retry the operation. - * - */ -public class SuppressReplyException extends RuntimeException { - public SuppressReplyException(String reason, IOException cause) { - super(reason, cause); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransactionBroker$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransactionBroker$1.class deleted file mode 100644 index 5477f088d..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransactionBroker$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransactionBroker$2.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransactionBroker$2.class deleted file mode 100644 index b1e0a353a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransactionBroker$2.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransactionBroker$PreparedDestinationCompletion.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransactionBroker$PreparedDestinationCompletion.class deleted file mode 100644 index f18e2b200..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransactionBroker$PreparedDestinationCompletion.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransactionBroker.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransactionBroker.class deleted file mode 100644 index ea7a58b9a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransactionBroker.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransactionBroker.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransactionBroker.java deleted file mode 100644 index 26ddfab58..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransactionBroker.java +++ /dev/null @@ -1,389 +0,0 @@ -/** - * 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.broker; - - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -import javax.jms.JMSException; -import javax.transaction.xa.XAException; - -import org.apache.activemq.ActiveMQMessageAudit; -import org.apache.activemq.broker.jmx.ManagedRegionBroker; -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.BaseCommand; -import org.apache.activemq.command.ConnectionInfo; -import org.apache.activemq.command.LocalTransactionId; -import org.apache.activemq.command.Message; -import org.apache.activemq.command.MessageAck; -import org.apache.activemq.command.ProducerInfo; -import org.apache.activemq.command.TransactionId; -import org.apache.activemq.command.XATransactionId; -import org.apache.activemq.state.ProducerState; -import org.apache.activemq.store.TransactionRecoveryListener; -import org.apache.activemq.store.TransactionStore; -import org.apache.activemq.transaction.LocalTransaction; -import org.apache.activemq.transaction.Synchronization; -import org.apache.activemq.transaction.Transaction; -import org.apache.activemq.transaction.XATransaction; -import org.apache.activemq.util.IOExceptionSupport; -import org.apache.activemq.util.WrappedException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * This broker filter handles the transaction related operations in the Broker - * interface. - * - * - */ -public class TransactionBroker extends BrokerFilter { - - private static final Logger LOG = LoggerFactory.getLogger(TransactionBroker.class); - - // The prepared XA transactions. - private TransactionStore transactionStore; - private Map xaTransactions = new LinkedHashMap(); - private ActiveMQMessageAudit audit; - - public TransactionBroker(Broker next, TransactionStore transactionStore) { - super(next); - this.transactionStore = transactionStore; - } - - // //////////////////////////////////////////////////////////////////////////// - // - // Life cycle Methods - // - // //////////////////////////////////////////////////////////////////////////// - - /** - * Recovers any prepared transactions. - */ - public void start() throws Exception { - transactionStore.start(); - try { - final ConnectionContext context = new ConnectionContext(); - context.setBroker(this); - context.setInRecoveryMode(true); - context.setTransactions(new ConcurrentHashMap()); - context.setProducerFlowControl(false); - final ProducerBrokerExchange producerExchange = new ProducerBrokerExchange(); - producerExchange.setMutable(true); - producerExchange.setConnectionContext(context); - producerExchange.setProducerState(new ProducerState(new ProducerInfo())); - final ConsumerBrokerExchange consumerExchange = new ConsumerBrokerExchange(); - consumerExchange.setConnectionContext(context); - transactionStore.recover(new TransactionRecoveryListener() { - public void recover(XATransactionId xid, Message[] addedMessages, MessageAck[] aks) { - try { - beginTransaction(context, xid); - XATransaction transaction = (XATransaction) getTransaction(context, xid, false); - for (int i = 0; i < addedMessages.length; i++) { - forceDestinationWakeupOnCompletion(context, transaction, addedMessages[i].getDestination(), addedMessages[i]); - } - for (int i = 0; i < aks.length; i++) { - forceDestinationWakeupOnCompletion(context, transaction, aks[i].getDestination(), aks[i]); - } - transaction.setState(Transaction.PREPARED_STATE); - registerMBean(transaction); - LOG.debug("recovered prepared transaction: {}", transaction.getTransactionId()); - } catch (Throwable e) { - throw new WrappedException(e); - } - } - }); - } catch (WrappedException e) { - Throwable cause = e.getCause(); - throw IOExceptionSupport.create("Recovery Failed: " + cause.getMessage(), cause); - } - next.start(); - } - - private void registerMBean(XATransaction transaction) { - if (getBrokerService().getRegionBroker() instanceof ManagedRegionBroker ) { - ManagedRegionBroker managedRegionBroker = (ManagedRegionBroker) getBrokerService().getRegionBroker(); - managedRegionBroker.registerRecoveredTransactionMBean(transaction); - } - } - - private void forceDestinationWakeupOnCompletion(ConnectionContext context, Transaction transaction, - ActiveMQDestination amqDestination, BaseCommand ack) throws Exception { - Destination destination = addDestination(context, amqDestination, false); - registerSync(destination, transaction, ack); - } - - private void registerSync(Destination destination, Transaction transaction, BaseCommand command) { - Synchronization sync = new PreparedDestinationCompletion(destination, command.isMessage()); - // ensure one per destination in the list - Synchronization existing = transaction.findMatching(sync); - if (existing != null) { - ((PreparedDestinationCompletion)existing).incrementOpCount(); - } else { - transaction.addSynchronization(sync); - } - } - - static class PreparedDestinationCompletion extends Synchronization { - final Destination destination; - final boolean messageSend; - int opCount = 1; - public PreparedDestinationCompletion(final Destination destination, boolean messageSend) { - this.destination = destination; - // rollback relevant to acks, commit to sends - this.messageSend = messageSend; - } - - public void incrementOpCount() { - opCount++; - } - - @Override - public int hashCode() { - return System.identityHashCode(destination) + - System.identityHashCode(Boolean.valueOf(messageSend)); - } - - @Override - public boolean equals(Object other) { - return other instanceof PreparedDestinationCompletion && - destination.equals(((PreparedDestinationCompletion) other).destination) && - messageSend == ((PreparedDestinationCompletion) other).messageSend; - } - - @Override - public void afterRollback() throws Exception { - if (!messageSend) { - destination.clearPendingMessages(); - LOG.debug("cleared pending from afterRollback: {}", destination); - } - } - - @Override - public void afterCommit() throws Exception { - if (messageSend) { - destination.clearPendingMessages(); - destination.getDestinationStatistics().getEnqueues().add(opCount); - destination.getDestinationStatistics().getMessages().add(opCount); - LOG.debug("cleared pending from afterCommit: {}", destination); - } else { - destination.getDestinationStatistics().getDequeues().add(opCount); - destination.getDestinationStatistics().getMessages().subtract(opCount); - } - } - } - - public void stop() throws Exception { - transactionStore.stop(); - next.stop(); - } - - // //////////////////////////////////////////////////////////////////////////// - // - // BrokerFilter overrides - // - // //////////////////////////////////////////////////////////////////////////// - public TransactionId[] getPreparedTransactions(ConnectionContext context) throws Exception { - List txs = new ArrayList(); - synchronized (xaTransactions) { - for (Iterator iter = xaTransactions.values().iterator(); iter.hasNext();) { - Transaction tx = iter.next(); - if (tx.isPrepared()) { - LOG.debug("prepared transaction: {}", tx.getTransactionId()); - txs.add(tx.getTransactionId()); - } - } - } - XATransactionId rc[] = new XATransactionId[txs.size()]; - txs.toArray(rc); - LOG.debug("prepared transaction list size: {}", rc.length); - return rc; - } - - public void beginTransaction(ConnectionContext context, TransactionId xid) throws Exception { - // the transaction may have already been started. - if (xid.isXATransaction()) { - XATransaction transaction = null; - synchronized (xaTransactions) { - transaction = xaTransactions.get(xid); - if (transaction != null) { - return; - } - transaction = new XATransaction(transactionStore, (XATransactionId)xid, this, context.getConnectionId()); - xaTransactions.put(xid, transaction); - } - } else { - Map transactionMap = context.getTransactions(); - Transaction transaction = transactionMap.get(xid); - if (transaction != null) { - throw new JMSException("Transaction '" + xid + "' has already been started."); - } - transaction = new LocalTransaction(transactionStore, (LocalTransactionId)xid, context); - transactionMap.put(xid, transaction); - } - } - - public int prepareTransaction(ConnectionContext context, TransactionId xid) throws Exception { - Transaction transaction = getTransaction(context, xid, false); - return transaction.prepare(); - } - - public void commitTransaction(ConnectionContext context, TransactionId xid, boolean onePhase) throws Exception { - Transaction transaction = getTransaction(context, xid, true); - transaction.commit(onePhase); - } - - public void rollbackTransaction(ConnectionContext context, TransactionId xid) throws Exception { - Transaction transaction = getTransaction(context, xid, true); - transaction.rollback(); - } - - public void forgetTransaction(ConnectionContext context, TransactionId xid) throws Exception { - Transaction transaction = getTransaction(context, xid, true); - transaction.rollback(); - } - - public void acknowledge(ConsumerBrokerExchange consumerExchange, MessageAck ack) throws Exception { - // This method may be invoked recursively. - // Track original tx so that it can be restored. - final ConnectionContext context = consumerExchange.getConnectionContext(); - Transaction originalTx = context.getTransaction(); - Transaction transaction = null; - if (ack.isInTransaction()) { - transaction = getTransaction(context, ack.getTransactionId(), false); - } - context.setTransaction(transaction); - try { - next.acknowledge(consumerExchange, ack); - } finally { - context.setTransaction(originalTx); - } - } - - public void send(ProducerBrokerExchange producerExchange, final Message message) throws Exception { - // This method may be invoked recursively. - // Track original tx so that it can be restored. - final ConnectionContext context = producerExchange.getConnectionContext(); - Transaction originalTx = context.getTransaction(); - Transaction transaction = null; - Synchronization sync = null; - if (message.getTransactionId() != null) { - transaction = getTransaction(context, message.getTransactionId(), false); - if (transaction != null) { - sync = new Synchronization() { - - public void afterRollback() { - if (audit != null) { - audit.rollback(message); - } - } - }; - transaction.addSynchronization(sync); - } - } - if (audit == null || !audit.isDuplicate(message)) { - context.setTransaction(transaction); - try { - next.send(producerExchange, message); - } finally { - context.setTransaction(originalTx); - } - } else { - if (sync != null && transaction != null) { - transaction.removeSynchronization(sync); - } - LOG.debug("IGNORING duplicate message {}", message); - } - } - - public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception { - for (Iterator iter = context.getTransactions().values().iterator(); iter.hasNext();) { - try { - Transaction transaction = iter.next(); - transaction.rollback(); - } catch (Exception e) { - LOG.warn("ERROR Rolling back disconnected client's transactions: ", e); - } - iter.remove(); - } - - synchronized (xaTransactions) { - // first find all txs that belongs to the connection - ArrayList txs = new ArrayList(); - for (XATransaction tx : xaTransactions.values()) { - if (tx.getConnectionId() != null && tx.getConnectionId().equals(info.getConnectionId()) && !tx.isPrepared()) { - txs.add(tx); - } - } - - // then remove them - // two steps needed to avoid ConcurrentModificationException, from removeTransaction() - for (XATransaction tx : txs) { - try { - tx.rollback(); - } catch (Exception e) { - LOG.warn("ERROR Rolling back disconnected client's xa transactions: ", e); - } - } - - } - next.removeConnection(context, info, error); - } - - // //////////////////////////////////////////////////////////////////////////// - // - // Implementation help methods. - // - // //////////////////////////////////////////////////////////////////////////// - public Transaction getTransaction(ConnectionContext context, TransactionId xid, boolean mightBePrepared) throws JMSException, XAException { - Map transactionMap = null; - synchronized (xaTransactions) { - transactionMap = xid.isXATransaction() ? xaTransactions : context.getTransactions(); - } - Transaction transaction = (Transaction)transactionMap.get(xid); - if (transaction != null) { - return transaction; - } - if (xid.isXATransaction()) { - XAException e = new XAException("Transaction '" + xid + "' has not been started."); - e.errorCode = XAException.XAER_NOTA; - throw e; - } else { - throw new JMSException("Transaction '" + xid + "' has not been started."); - } - } - - public void removeTransaction(XATransactionId xid) { - synchronized (xaTransactions) { - xaTransactions.remove(xid); - } - } - - public synchronized void brokerServiceStarted() { - super.brokerServiceStarted(); - if (getBrokerService().isSupportFailOver() && audit == null) { - audit = new ActiveMQMessageAudit(); - } - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnection$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnection$1.class deleted file mode 100644 index 044e270b7..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnection$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnection$2.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnection$2.class deleted file mode 100644 index 79c4047c4..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnection$2.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnection$3.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnection$3.class deleted file mode 100644 index 1d07c5e84..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnection$3.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnection$4.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnection$4.class deleted file mode 100644 index 0d1df565b..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnection$4.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnection.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnection.class deleted file mode 100644 index 30b35cf43..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnection.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnection.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnection.java deleted file mode 100644 index 1ce75a5ac..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnection.java +++ /dev/null @@ -1,1578 +0,0 @@ -/** - * 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.broker; - -import java.io.EOFException; -import java.io.IOException; -import java.net.SocketException; -import java.net.URI; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.CopyOnWriteArrayList; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicReference; -import java.util.concurrent.locks.ReentrantReadWriteLock; - -import javax.transaction.xa.XAResource; -import org.apache.activemq.advisory.AdvisorySupport; -import org.apache.activemq.broker.region.ConnectionStatistics; -import org.apache.activemq.broker.region.RegionBroker; -import org.apache.activemq.command.*; -import org.apache.activemq.network.DemandForwardingBridge; -import org.apache.activemq.network.MBeanNetworkListener; -import org.apache.activemq.network.NetworkBridgeConfiguration; -import org.apache.activemq.network.NetworkBridgeFactory; -import org.apache.activemq.security.MessageAuthorizationPolicy; -import org.apache.activemq.state.CommandVisitor; -import org.apache.activemq.state.ConnectionState; -import org.apache.activemq.state.ConsumerState; -import org.apache.activemq.state.ProducerState; -import org.apache.activemq.state.SessionState; -import org.apache.activemq.state.TransactionState; -import org.apache.activemq.thread.Task; -import org.apache.activemq.thread.TaskRunner; -import org.apache.activemq.thread.TaskRunnerFactory; -import org.apache.activemq.transaction.Transaction; -import org.apache.activemq.transport.DefaultTransportListener; -import org.apache.activemq.transport.ResponseCorrelator; -import org.apache.activemq.transport.TransmitCallback; -import org.apache.activemq.transport.Transport; -import org.apache.activemq.transport.TransportDisposedIOException; -import org.apache.activemq.util.IntrospectionSupport; -import org.apache.activemq.util.MarshallingSupport; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.slf4j.MDC; - -public class TransportConnection implements Connection, Task, CommandVisitor { - private static final Logger LOG = LoggerFactory.getLogger(TransportConnection.class); - private static final Logger TRANSPORTLOG = LoggerFactory.getLogger(TransportConnection.class.getName() + ".Transport"); - private static final Logger SERVICELOG = LoggerFactory.getLogger(TransportConnection.class.getName() + ".Service"); - // Keeps track of the broker and connector that created this connection. - protected final Broker broker; - protected final TransportConnector connector; - // Keeps track of the state of the connections. - // protected final ConcurrentHashMap localConnectionStates=new - // ConcurrentHashMap(); - protected final Map brokerConnectionStates; - // The broker and wireformat info that was exchanged. - protected BrokerInfo brokerInfo; - protected final List dispatchQueue = new LinkedList(); - protected TaskRunner taskRunner; - protected final AtomicReference transportException = new AtomicReference(); - protected AtomicBoolean dispatchStopped = new AtomicBoolean(false); - private final Transport transport; - private MessageAuthorizationPolicy messageAuthorizationPolicy; - private WireFormatInfo wireFormatInfo; - // Used to do async dispatch.. this should perhaps be pushed down into the - // transport layer.. - private boolean inServiceException; - private final ConnectionStatistics statistics = new ConnectionStatistics(); - private boolean manageable; - private boolean slow; - private boolean markedCandidate; - private boolean blockedCandidate; - private boolean blocked; - private boolean connected; - private boolean active; - private boolean starting; - private boolean pendingStop; - private long timeStamp; - private final AtomicBoolean stopping = new AtomicBoolean(false); - private final CountDownLatch stopped = new CountDownLatch(1); - private final AtomicBoolean asyncException = new AtomicBoolean(false); - private final Map producerExchanges = new HashMap(); - private final Map consumerExchanges = new HashMap(); - private final CountDownLatch dispatchStoppedLatch = new CountDownLatch(1); - private ConnectionContext context; - private boolean networkConnection; - private boolean faultTolerantConnection; - private final AtomicInteger protocolVersion = new AtomicInteger(CommandTypes.PROTOCOL_VERSION); - private DemandForwardingBridge duplexBridge; - private final TaskRunnerFactory taskRunnerFactory; - private final TaskRunnerFactory stopTaskRunnerFactory; - private TransportConnectionStateRegister connectionStateRegister = new SingleTransportConnectionStateRegister(); - private final ReentrantReadWriteLock serviceLock = new ReentrantReadWriteLock(); - private String duplexNetworkConnectorId; - private Throwable stopError = null; - - /** - * @param taskRunnerFactory - can be null if you want direct dispatch to the transport - * else commands are sent async. - * @param stopTaskRunnerFactory - can not be null, used for stopping this connection. - */ - public TransportConnection(TransportConnector connector, final Transport transport, Broker broker, - TaskRunnerFactory taskRunnerFactory, TaskRunnerFactory stopTaskRunnerFactory) { - this.connector = connector; - this.broker = broker; - RegionBroker rb = (RegionBroker) broker.getAdaptor(RegionBroker.class); - brokerConnectionStates = rb.getConnectionStates(); - if (connector != null) { - this.statistics.setParent(connector.getStatistics()); - this.messageAuthorizationPolicy = connector.getMessageAuthorizationPolicy(); - } - this.taskRunnerFactory = taskRunnerFactory; - this.stopTaskRunnerFactory = stopTaskRunnerFactory; - this.transport = transport; - final BrokerService brokerService = this.broker.getBrokerService(); - this.transport.setTransportListener(new DefaultTransportListener() { - @Override - public void onCommand(Object o) { - serviceLock.readLock().lock(); - try { - if (!(o instanceof Command)) { - throw new RuntimeException("Protocol violation - Command corrupted: " + o.toString()); - } - Command command = (Command) o; - Response response = service(command); - if (response != null && !brokerService.isStopping() ) { - dispatchSync(response); - } - } finally { - serviceLock.readLock().unlock(); - } - } - - @Override - public void onException(IOException exception) { - serviceLock.readLock().lock(); - try { - serviceTransportException(exception); - } finally { - serviceLock.readLock().unlock(); - } - } - }); - connected = true; - } - - /** - * Returns the number of messages to be dispatched to this connection - * - * @return size of dispatch queue - */ - @Override - public int getDispatchQueueSize() { - synchronized (dispatchQueue) { - return dispatchQueue.size(); - } - } - - public void serviceTransportException(IOException e) { - BrokerService bService = connector.getBrokerService(); - if (bService.isShutdownOnSlaveFailure()) { - if (brokerInfo != null) { - if (brokerInfo.isSlaveBroker()) { - LOG.error("Slave has exception: {} shutting down master now.", e.getMessage(), e); - try { - doStop(); - bService.stop(); - } catch (Exception ex) { - LOG.warn("Failed to stop the master", ex); - } - } - } - } - if (!stopping.get() && !pendingStop) { - transportException.set(e); - if (TRANSPORTLOG.isDebugEnabled()) { - TRANSPORTLOG.debug(this + " failed: " + e, e); - } else if (TRANSPORTLOG.isWarnEnabled() && !expected(e)) { - TRANSPORTLOG.warn(this + " failed: " + e); - } - stopAsync(); - } - } - - private boolean expected(IOException e) { - return isStomp() && ((e instanceof SocketException && e.getMessage().indexOf("reset") != -1) || e instanceof EOFException); - } - - private boolean isStomp() { - URI uri = connector.getUri(); - return uri != null && uri.getScheme() != null && uri.getScheme().indexOf("stomp") != -1; - } - - /** - * Calls the serviceException method in an async thread. Since handling a - * service exception closes a socket, we should not tie up broker threads - * since client sockets may hang or cause deadlocks. - */ - @Override - public void serviceExceptionAsync(final IOException e) { - if (asyncException.compareAndSet(false, true)) { - new Thread("Async Exception Handler") { - @Override - public void run() { - serviceException(e); - } - }.start(); - } - } - - /** - * Closes a clients connection due to a detected error. Errors are ignored - * if: the client is closing or broker is closing. Otherwise, the connection - * error transmitted to the client before stopping it's transport. - */ - @Override - public void serviceException(Throwable e) { - // are we a transport exception such as not being able to dispatch - // synchronously to a transport - if (e instanceof IOException) { - serviceTransportException((IOException) e); - } else if (e.getClass() == BrokerStoppedException.class) { - // Handle the case where the broker is stopped - // But the client is still connected. - if (!stopping.get()) { - SERVICELOG.debug("Broker has been stopped. Notifying client and closing his connection."); - ConnectionError ce = new ConnectionError(); - ce.setException(e); - dispatchSync(ce); - // Record the error that caused the transport to stop - this.stopError = e; - // Wait a little bit to try to get the output buffer to flush - // the exception notification to the client. - try { - Thread.sleep(500); - } catch (InterruptedException ie) { - Thread.currentThread().interrupt(); - } - // Worst case is we just kill the connection before the - // notification gets to him. - stopAsync(); - } - } else if (!stopping.get() && !inServiceException) { - inServiceException = true; - try { - SERVICELOG.warn("Async error occurred: ", e); - ConnectionError ce = new ConnectionError(); - ce.setException(e); - if (pendingStop) { - dispatchSync(ce); - } else { - dispatchAsync(ce); - } - } finally { - inServiceException = false; - } - } - } - - @Override - public Response service(Command command) { - MDC.put("activemq.connector", connector.getUri().toString()); - Response response = null; - boolean responseRequired = command.isResponseRequired(); - int commandId = command.getCommandId(); - try { - if (!pendingStop) { - response = command.visit(this); - } else { - response = new ExceptionResponse(this.stopError); - } - } catch (Throwable e) { - if (SERVICELOG.isDebugEnabled() && e.getClass() != BrokerStoppedException.class) { - SERVICELOG.debug("Error occured while processing " + (responseRequired ? "sync" : "async") - + " command: " + command + ", exception: " + e, e); - } - - if (e instanceof SuppressReplyException || (e.getCause() instanceof SuppressReplyException)) { - LOG.info("Suppressing reply to: " + command + " on: " + e + ", cause: " + e.getCause()); - responseRequired = false; - } - - if (responseRequired) { - response = new ExceptionResponse(e); - } else { - serviceException(e); - } - } - if (responseRequired) { - if (response == null) { - response = new Response(); - } - response.setCorrelationId(commandId); - } - // The context may have been flagged so that the response is not - // sent. - if (context != null) { - if (context.isDontSendReponse()) { - context.setDontSendReponse(false); - response = null; - } - context = null; - } - MDC.remove("activemq.connector"); - return response; - } - - @Override - public Response processKeepAlive(KeepAliveInfo info) throws Exception { - return null; - } - - @Override - public Response processRemoveSubscription(RemoveSubscriptionInfo info) throws Exception { - broker.removeSubscription(lookupConnectionState(info.getConnectionId()).getContext(), info); - return null; - } - - @Override - public Response processWireFormat(WireFormatInfo info) throws Exception { - wireFormatInfo = info; - protocolVersion.set(info.getVersion()); - return null; - } - - @Override - public Response processShutdown(ShutdownInfo info) throws Exception { - stopAsync(); - return null; - } - - @Override - public Response processFlush(FlushCommand command) throws Exception { - return null; - } - - @Override - public Response processBeginTransaction(TransactionInfo info) throws Exception { - TransportConnectionState cs = lookupConnectionState(info.getConnectionId()); - context = null; - if (cs != null) { - context = cs.getContext(); - } - if (cs == null) { - throw new NullPointerException("Context is null"); - } - // Avoid replaying dup commands - if (cs.getTransactionState(info.getTransactionId()) == null) { - cs.addTransactionState(info.getTransactionId()); - broker.beginTransaction(context, info.getTransactionId()); - } - return null; - } - - @Override - public Response processEndTransaction(TransactionInfo info) throws Exception { - // No need to do anything. This packet is just sent by the client - // make sure he is synced with the server as commit command could - // come from a different connection. - return null; - } - - @Override - public Response processPrepareTransaction(TransactionInfo info) throws Exception { - TransportConnectionState cs = lookupConnectionState(info.getConnectionId()); - context = null; - if (cs != null) { - context = cs.getContext(); - } - if (cs == null) { - throw new NullPointerException("Context is null"); - } - TransactionState transactionState = cs.getTransactionState(info.getTransactionId()); - if (transactionState == null) { - throw new IllegalStateException("Cannot prepare a transaction that had not been started or previously returned XA_RDONLY: " - + info.getTransactionId()); - } - // Avoid dups. - if (!transactionState.isPrepared()) { - transactionState.setPrepared(true); - int result = broker.prepareTransaction(context, info.getTransactionId()); - transactionState.setPreparedResult(result); - if (result == XAResource.XA_RDONLY) { - // we are done, no further rollback or commit from TM - cs.removeTransactionState(info.getTransactionId()); - } - IntegerResponse response = new IntegerResponse(result); - return response; - } else { - IntegerResponse response = new IntegerResponse(transactionState.getPreparedResult()); - return response; - } - } - - @Override - public Response processCommitTransactionOnePhase(TransactionInfo info) throws Exception { - TransportConnectionState cs = lookupConnectionState(info.getConnectionId()); - context = cs.getContext(); - cs.removeTransactionState(info.getTransactionId()); - broker.commitTransaction(context, info.getTransactionId(), true); - return null; - } - - @Override - public Response processCommitTransactionTwoPhase(TransactionInfo info) throws Exception { - TransportConnectionState cs = lookupConnectionState(info.getConnectionId()); - context = cs.getContext(); - cs.removeTransactionState(info.getTransactionId()); - broker.commitTransaction(context, info.getTransactionId(), false); - return null; - } - - @Override - public Response processRollbackTransaction(TransactionInfo info) throws Exception { - TransportConnectionState cs = lookupConnectionState(info.getConnectionId()); - context = cs.getContext(); - cs.removeTransactionState(info.getTransactionId()); - broker.rollbackTransaction(context, info.getTransactionId()); - return null; - } - - @Override - public Response processForgetTransaction(TransactionInfo info) throws Exception { - TransportConnectionState cs = lookupConnectionState(info.getConnectionId()); - context = cs.getContext(); - broker.forgetTransaction(context, info.getTransactionId()); - return null; - } - - @Override - public Response processRecoverTransactions(TransactionInfo info) throws Exception { - TransportConnectionState cs = lookupConnectionState(info.getConnectionId()); - context = cs.getContext(); - TransactionId[] preparedTransactions = broker.getPreparedTransactions(context); - return new DataArrayResponse(preparedTransactions); - } - - @Override - public Response processMessage(Message messageSend) throws Exception { - ProducerId producerId = messageSend.getProducerId(); - ProducerBrokerExchange producerExchange = getProducerBrokerExchange(producerId); - if (producerExchange.canDispatch(messageSend)) { - broker.send(producerExchange, messageSend); - } - return null; - } - - @Override - public Response processMessageAck(MessageAck ack) throws Exception { - ConsumerBrokerExchange consumerExchange = getConsumerBrokerExchange(ack.getConsumerId()); - if (consumerExchange != null) { - broker.acknowledge(consumerExchange, ack); - } - return null; - } - - @Override - public Response processMessagePull(MessagePull pull) throws Exception { - return broker.messagePull(lookupConnectionState(pull.getConsumerId()).getContext(), pull); - } - - @Override - public Response processMessageDispatchNotification(MessageDispatchNotification notification) throws Exception { - broker.processDispatchNotification(notification); - return null; - } - - @Override - public Response processAddDestination(DestinationInfo info) throws Exception { - TransportConnectionState cs = lookupConnectionState(info.getConnectionId()); - broker.addDestinationInfo(cs.getContext(), info); - if (info.getDestination().isTemporary()) { - cs.addTempDestination(info); - } - return null; - } - - @Override - public Response processRemoveDestination(DestinationInfo info) throws Exception { - TransportConnectionState cs = lookupConnectionState(info.getConnectionId()); - broker.removeDestinationInfo(cs.getContext(), info); - if (info.getDestination().isTemporary()) { - cs.removeTempDestination(info.getDestination()); - } - return null; - } - - @Override - public Response processAddProducer(ProducerInfo info) throws Exception { - SessionId sessionId = info.getProducerId().getParentId(); - ConnectionId connectionId = sessionId.getParentId(); - TransportConnectionState cs = lookupConnectionState(connectionId); - if (cs == null) { - throw new IllegalStateException("Cannot add a producer to a connection that had not been registered: " - + connectionId); - } - SessionState ss = cs.getSessionState(sessionId); - if (ss == null) { - throw new IllegalStateException("Cannot add a producer to a session that had not been registered: " - + sessionId); - } - // Avoid replaying dup commands - if (!ss.getProducerIds().contains(info.getProducerId())) { - ActiveMQDestination destination = info.getDestination(); - if (destination != null && !AdvisorySupport.isAdvisoryTopic(destination)) { - if (getProducerCount(connectionId) >= connector.getMaximumProducersAllowedPerConnection()){ - throw new IllegalStateException("Can't add producer on connection " + connectionId + ": at maximum limit: " + connector.getMaximumProducersAllowedPerConnection()); - } - } - broker.addProducer(cs.getContext(), info); - try { - ss.addProducer(info); - } catch (IllegalStateException e) { - broker.removeProducer(cs.getContext(), info); - } - - } - return null; - } - - @Override - public Response processRemoveProducer(ProducerId id) throws Exception { - SessionId sessionId = id.getParentId(); - ConnectionId connectionId = sessionId.getParentId(); - TransportConnectionState cs = lookupConnectionState(connectionId); - SessionState ss = cs.getSessionState(sessionId); - if (ss == null) { - throw new IllegalStateException("Cannot remove a producer from a session that had not been registered: " - + sessionId); - } - ProducerState ps = ss.removeProducer(id); - if (ps == null) { - throw new IllegalStateException("Cannot remove a producer that had not been registered: " + id); - } - removeProducerBrokerExchange(id); - broker.removeProducer(cs.getContext(), ps.getInfo()); - return null; - } - - @Override - public Response processAddConsumer(ConsumerInfo info) throws Exception { - SessionId sessionId = info.getConsumerId().getParentId(); - ConnectionId connectionId = sessionId.getParentId(); - TransportConnectionState cs = lookupConnectionState(connectionId); - if (cs == null) { - throw new IllegalStateException("Cannot add a consumer to a connection that had not been registered: " - + connectionId); - } - SessionState ss = cs.getSessionState(sessionId); - if (ss == null) { - throw new IllegalStateException(broker.getBrokerName() - + " Cannot add a consumer to a session that had not been registered: " + sessionId); - } - // Avoid replaying dup commands - if (!ss.getConsumerIds().contains(info.getConsumerId())) { - ActiveMQDestination destination = info.getDestination(); - if (destination != null && !AdvisorySupport.isAdvisoryTopic(destination)) { - if (getConsumerCount(connectionId) >= connector.getMaximumConsumersAllowedPerConnection()){ - throw new IllegalStateException("Can't add consumer on connection " + connectionId + ": at maximum limit: " + connector.getMaximumConsumersAllowedPerConnection()); - } - } - - broker.addConsumer(cs.getContext(), info); - try { - ss.addConsumer(info); - addConsumerBrokerExchange(info.getConsumerId()); - } catch (IllegalStateException e) { - broker.removeConsumer(cs.getContext(), info); - } - - } - return null; - } - - @Override - public Response processRemoveConsumer(ConsumerId id, long lastDeliveredSequenceId) throws Exception { - SessionId sessionId = id.getParentId(); - ConnectionId connectionId = sessionId.getParentId(); - TransportConnectionState cs = lookupConnectionState(connectionId); - if (cs == null) { - throw new IllegalStateException("Cannot remove a consumer from a connection that had not been registered: " - + connectionId); - } - SessionState ss = cs.getSessionState(sessionId); - if (ss == null) { - throw new IllegalStateException("Cannot remove a consumer from a session that had not been registered: " - + sessionId); - } - ConsumerState consumerState = ss.removeConsumer(id); - if (consumerState == null) { - throw new IllegalStateException("Cannot remove a consumer that had not been registered: " + id); - } - ConsumerInfo info = consumerState.getInfo(); - info.setLastDeliveredSequenceId(lastDeliveredSequenceId); - broker.removeConsumer(cs.getContext(), consumerState.getInfo()); - removeConsumerBrokerExchange(id); - return null; - } - - @Override - public Response processAddSession(SessionInfo info) throws Exception { - ConnectionId connectionId = info.getSessionId().getParentId(); - TransportConnectionState cs = lookupConnectionState(connectionId); - // Avoid replaying dup commands - if (cs != null && !cs.getSessionIds().contains(info.getSessionId())) { - broker.addSession(cs.getContext(), info); - try { - cs.addSession(info); - } catch (IllegalStateException e) { - e.printStackTrace(); - broker.removeSession(cs.getContext(), info); - } - } - return null; - } - - @Override - public Response processRemoveSession(SessionId id, long lastDeliveredSequenceId) throws Exception { - ConnectionId connectionId = id.getParentId(); - TransportConnectionState cs = lookupConnectionState(connectionId); - if (cs == null) { - throw new IllegalStateException("Cannot remove session from connection that had not been registered: " + connectionId); - } - SessionState session = cs.getSessionState(id); - if (session == null) { - throw new IllegalStateException("Cannot remove session that had not been registered: " + id); - } - // Don't let new consumers or producers get added while we are closing - // this down. - session.shutdown(); - // Cascade the connection stop to the consumers and producers. - for (ConsumerId consumerId : session.getConsumerIds()) { - try { - processRemoveConsumer(consumerId, lastDeliveredSequenceId); - } catch (Throwable e) { - LOG.warn("Failed to remove consumer: {}", consumerId, e); - } - } - for (ProducerId producerId : session.getProducerIds()) { - try { - processRemoveProducer(producerId); - } catch (Throwable e) { - LOG.warn("Failed to remove producer: {}", producerId, e); - } - } - cs.removeSession(id); - broker.removeSession(cs.getContext(), session.getInfo()); - return null; - } - - @Override - public Response processAddConnection(ConnectionInfo info) throws Exception { - // Older clients should have been defaulting this field to true.. but - // they were not. - if (wireFormatInfo != null && wireFormatInfo.getVersion() <= 2) { - info.setClientMaster(true); - } - TransportConnectionState state; - // Make sure 2 concurrent connections by the same ID only generate 1 - // TransportConnectionState object. - synchronized (brokerConnectionStates) { - state = (TransportConnectionState) brokerConnectionStates.get(info.getConnectionId()); - if (state == null) { - state = new TransportConnectionState(info, this); - brokerConnectionStates.put(info.getConnectionId(), state); - } - state.incrementReference(); - } - // If there are 2 concurrent connections for the same connection id, - // then last one in wins, we need to sync here - // to figure out the winner. - synchronized (state.getConnectionMutex()) { - if (state.getConnection() != this) { - LOG.debug("Killing previous stale connection: {}", state.getConnection().getRemoteAddress()); - state.getConnection().stop(); - LOG.debug("Connection {} taking over previous connection: {}", getRemoteAddress(), state.getConnection().getRemoteAddress()); - state.setConnection(this); - state.reset(info); - } - } - registerConnectionState(info.getConnectionId(), state); - LOG.debug("Setting up new connection id: {}, address: {}, info: {}", new Object[]{ info.getConnectionId(), getRemoteAddress(), info }); - this.faultTolerantConnection = info.isFaultTolerant(); - // Setup the context. - String clientId = info.getClientId(); - context = new ConnectionContext(); - context.setBroker(broker); - context.setClientId(clientId); - context.setClientMaster(info.isClientMaster()); - context.setConnection(this); - context.setConnectionId(info.getConnectionId()); - context.setConnector(connector); - context.setMessageAuthorizationPolicy(getMessageAuthorizationPolicy()); - context.setNetworkConnection(networkConnection); - context.setFaultTolerant(faultTolerantConnection); - context.setTransactions(new ConcurrentHashMap()); - context.setUserName(info.getUserName()); - context.setWireFormatInfo(wireFormatInfo); - context.setReconnect(info.isFailoverReconnect()); - this.manageable = info.isManageable(); - context.setConnectionState(state); - state.setContext(context); - state.setConnection(this); - if (info.getClientIp() == null) { - info.setClientIp(getRemoteAddress()); - } - - try { - broker.addConnection(context, info); - } catch (Exception e) { - synchronized (brokerConnectionStates) { - brokerConnectionStates.remove(info.getConnectionId()); - } - unregisterConnectionState(info.getConnectionId()); - LOG.warn("Failed to add Connection {}", info.getConnectionId(), e); - if (e instanceof SecurityException) { - // close this down - in case the peer of this transport doesn't play nice - delayedStop(2000, "Failed with SecurityException: " + e.getLocalizedMessage(), e); - } - throw e; - } - if (info.isManageable()) { - // send ConnectionCommand - ConnectionControl command = this.connector.getConnectionControl(); - command.setFaultTolerant(broker.isFaultTolerantConfiguration()); - if (info.isFailoverReconnect()) { - command.setRebalanceConnection(false); - } - dispatchAsync(command); - } - return null; - } - - @Override - public synchronized Response processRemoveConnection(ConnectionId id, long lastDeliveredSequenceId) - throws InterruptedException { - LOG.debug("remove connection id: {}", id); - TransportConnectionState cs = lookupConnectionState(id); - if (cs != null) { - // Don't allow things to be added to the connection state while we - // are shutting down. - cs.shutdown(); - // Cascade the connection stop to the sessions. - for (SessionId sessionId : cs.getSessionIds()) { - try { - processRemoveSession(sessionId, lastDeliveredSequenceId); - } catch (Throwable e) { - SERVICELOG.warn("Failed to remove session {}", sessionId, e); - } - } - // Cascade the connection stop to temp destinations. - for (Iterator iter = cs.getTempDestinations().iterator(); iter.hasNext(); ) { - DestinationInfo di = iter.next(); - try { - broker.removeDestination(cs.getContext(), di.getDestination(), 0); - } catch (Throwable e) { - SERVICELOG.warn("Failed to remove tmp destination {}", di.getDestination(), e); - } - iter.remove(); - } - try { - broker.removeConnection(cs.getContext(), cs.getInfo(), null); - } catch (Throwable e) { - SERVICELOG.warn("Failed to remove connection {}", cs.getInfo(), e); - } - TransportConnectionState state = unregisterConnectionState(id); - if (state != null) { - synchronized (brokerConnectionStates) { - // If we are the last reference, we should remove the state - // from the broker. - if (state.decrementReference() == 0) { - brokerConnectionStates.remove(id); - } - } - } - } - return null; - } - - @Override - public Response processProducerAck(ProducerAck ack) throws Exception { - // A broker should not get ProducerAck messages. - return null; - } - - @Override - public Connector getConnector() { - return connector; - } - - @Override - public void dispatchSync(Command message) { - try { - processDispatch(message); - } catch (IOException e) { - serviceExceptionAsync(e); - } - } - - @Override - public void dispatchAsync(Command message) { - if (!stopping.get()) { - if (taskRunner == null) { - dispatchSync(message); - } else { - synchronized (dispatchQueue) { - dispatchQueue.add(message); - } - try { - taskRunner.wakeup(); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } - } - } else { - if (message.isMessageDispatch()) { - MessageDispatch md = (MessageDispatch) message; - TransmitCallback sub = md.getTransmitCallback(); - broker.postProcessDispatch(md); - if (sub != null) { - sub.onFailure(); - } - } - } - } - - protected void processDispatch(Command command) throws IOException { - MessageDispatch messageDispatch = (MessageDispatch) (command.isMessageDispatch() ? command : null); - try { - if (!stopping.get()) { - if (messageDispatch != null) { - broker.preProcessDispatch(messageDispatch); - } - dispatch(command); - } - } catch (IOException e) { - if (messageDispatch != null) { - TransmitCallback sub = messageDispatch.getTransmitCallback(); - broker.postProcessDispatch(messageDispatch); - if (sub != null) { - sub.onFailure(); - } - messageDispatch = null; - throw e; - } - } finally { - if (messageDispatch != null) { - TransmitCallback sub = messageDispatch.getTransmitCallback(); - broker.postProcessDispatch(messageDispatch); - if (sub != null) { - sub.onSuccess(); - } - } - } - } - - @Override - public boolean iterate() { - try { - if (pendingStop || stopping.get()) { - if (dispatchStopped.compareAndSet(false, true)) { - if (transportException.get() == null) { - try { - dispatch(new ShutdownInfo()); - } catch (Throwable ignore) { - } - } - dispatchStoppedLatch.countDown(); - } - return false; - } - if (!dispatchStopped.get()) { - Command command = null; - synchronized (dispatchQueue) { - if (dispatchQueue.isEmpty()) { - return false; - } - command = dispatchQueue.remove(0); - } - processDispatch(command); - return true; - } - return false; - } catch (IOException e) { - if (dispatchStopped.compareAndSet(false, true)) { - dispatchStoppedLatch.countDown(); - } - serviceExceptionAsync(e); - return false; - } - } - - /** - * Returns the statistics for this connection - */ - @Override - public ConnectionStatistics getStatistics() { - return statistics; - } - - public MessageAuthorizationPolicy getMessageAuthorizationPolicy() { - return messageAuthorizationPolicy; - } - - public void setMessageAuthorizationPolicy(MessageAuthorizationPolicy messageAuthorizationPolicy) { - this.messageAuthorizationPolicy = messageAuthorizationPolicy; - } - - @Override - public boolean isManageable() { - return manageable; - } - - @Override - public void start() throws Exception { - try { - synchronized (this) { - starting = true; - if (taskRunnerFactory != null) { - taskRunner = taskRunnerFactory.createTaskRunner(this, "ActiveMQ Connection Dispatcher: " - + getRemoteAddress()); - } else { - taskRunner = null; - } - transport.start(); - active = true; - BrokerInfo info = connector.getBrokerInfo().copy(); - if (connector.isUpdateClusterClients()) { - info.setPeerBrokerInfos(this.broker.getPeerBrokerInfos()); - } else { - info.setPeerBrokerInfos(null); - } - dispatchAsync(info); - - connector.onStarted(this); - } - } catch (Exception e) { - // Force clean up on an error starting up. - pendingStop = true; - throw e; - } finally { - // stop() can be called from within the above block, - // but we want to be sure start() completes before - // stop() runs, so queue the stop until right now: - setStarting(false); - if (isPendingStop()) { - LOG.debug("Calling the delayed stop() after start() {}", this); - stop(); - } - } - } - - @Override - public void stop() throws Exception { - // do not stop task the task runner factories (taskRunnerFactory, stopTaskRunnerFactory) - // as their lifecycle is handled elsewhere - - stopAsync(); - while (!stopped.await(5, TimeUnit.SECONDS)) { - LOG.info("The connection to '{}' is taking a long time to shutdown.", transport.getRemoteAddress()); - } - } - - public void delayedStop(final int waitTime, final String reason, Throwable cause) { - if (waitTime > 0) { - synchronized (this) { - pendingStop = true; - stopError = cause; - } - try { - stopTaskRunnerFactory.execute(new Runnable() { - @Override - public void run() { - try { - Thread.sleep(waitTime); - stopAsync(); - LOG.info("Stopping {} because {}", transport.getRemoteAddress(), reason); - } catch (InterruptedException e) { - } - } - }); - } catch (Throwable t) { - LOG.warn("Cannot create stopAsync. This exception will be ignored.", t); - } - } - } - - public void stopAsync() { - // If we're in the middle of starting then go no further... for now. - synchronized (this) { - pendingStop = true; - if (starting) { - LOG.debug("stopAsync() called in the middle of start(). Delaying till start completes.."); - return; - } - } - if (stopping.compareAndSet(false, true)) { - // Let all the connection contexts know we are shutting down - // so that in progress operations can notice and unblock. - List connectionStates = listConnectionStates(); - for (TransportConnectionState cs : connectionStates) { - ConnectionContext connectionContext = cs.getContext(); - if (connectionContext != null) { - connectionContext.getStopping().set(true); - } - } - try { - stopTaskRunnerFactory.execute(new Runnable() { - @Override - public void run() { - serviceLock.writeLock().lock(); - try { - doStop(); - } catch (Throwable e) { - LOG.debug("Error occurred while shutting down a connection {}", this, e); - } finally { - stopped.countDown(); - serviceLock.writeLock().unlock(); - } - } - }); - } catch (Throwable t) { - LOG.warn("Cannot create async transport stopper thread. This exception is ignored. Not waiting for stop to complete", t); - stopped.countDown(); - } - } - } - - @Override - public String toString() { - return "Transport Connection to: " + transport.getRemoteAddress(); - } - - protected void doStop() throws Exception { - LOG.debug("Stopping connection: {}", transport.getRemoteAddress()); - connector.onStopped(this); - try { - synchronized (this) { - if (duplexBridge != null) { - duplexBridge.stop(); - } - } - } catch (Exception ignore) { - LOG.trace("Exception caught stopping. This exception is ignored.", ignore); - } - try { - transport.stop(); - LOG.debug("Stopped transport: {}", transport.getRemoteAddress()); - } catch (Exception e) { - LOG.debug("Could not stop transport to {}. This exception is ignored.", transport.getRemoteAddress(), e); - } - if (taskRunner != null) { - taskRunner.shutdown(1); - taskRunner = null; - } - active = false; - // Run the MessageDispatch callbacks so that message references get - // cleaned up. - synchronized (dispatchQueue) { - for (Iterator iter = dispatchQueue.iterator(); iter.hasNext(); ) { - Command command = iter.next(); - if (command.isMessageDispatch()) { - MessageDispatch md = (MessageDispatch) command; - TransmitCallback sub = md.getTransmitCallback(); - broker.postProcessDispatch(md); - if (sub != null) { - sub.onFailure(); - } - } - } - dispatchQueue.clear(); - } - // - // Remove all logical connection associated with this connection - // from the broker. - if (!broker.isStopped()) { - List connectionStates = listConnectionStates(); - connectionStates = listConnectionStates(); - for (TransportConnectionState cs : connectionStates) { - cs.getContext().getStopping().set(true); - try { - LOG.debug("Cleaning up connection resources: {}", getRemoteAddress()); - processRemoveConnection(cs.getInfo().getConnectionId(), 0l); - } catch (Throwable ignore) { - ignore.printStackTrace(); - } - } - } - LOG.debug("Connection Stopped: {}", getRemoteAddress()); - } - - /** - * @return Returns the blockedCandidate. - */ - public boolean isBlockedCandidate() { - return blockedCandidate; - } - - /** - * @param blockedCandidate The blockedCandidate to set. - */ - public void setBlockedCandidate(boolean blockedCandidate) { - this.blockedCandidate = blockedCandidate; - } - - /** - * @return Returns the markedCandidate. - */ - public boolean isMarkedCandidate() { - return markedCandidate; - } - - /** - * @param markedCandidate The markedCandidate to set. - */ - public void setMarkedCandidate(boolean markedCandidate) { - this.markedCandidate = markedCandidate; - if (!markedCandidate) { - timeStamp = 0; - blockedCandidate = false; - } - } - - /** - * @param slow The slow to set. - */ - public void setSlow(boolean slow) { - this.slow = slow; - } - - /** - * @return true if the Connection is slow - */ - @Override - public boolean isSlow() { - return slow; - } - - /** - * @return true if the Connection is potentially blocked - */ - public boolean isMarkedBlockedCandidate() { - return markedCandidate; - } - - /** - * Mark the Connection, so we can deem if it's collectable on the next sweep - */ - public void doMark() { - if (timeStamp == 0) { - timeStamp = System.currentTimeMillis(); - } - } - - /** - * @return if after being marked, the Connection is still writing - */ - @Override - public boolean isBlocked() { - return blocked; - } - - /** - * @return true if the Connection is connected - */ - @Override - public boolean isConnected() { - return connected; - } - - /** - * @param blocked The blocked to set. - */ - public void setBlocked(boolean blocked) { - this.blocked = blocked; - } - - /** - * @param connected The connected to set. - */ - public void setConnected(boolean connected) { - this.connected = connected; - } - - /** - * @return true if the Connection is active - */ - @Override - public boolean isActive() { - return active; - } - - /** - * @param active The active to set. - */ - public void setActive(boolean active) { - this.active = active; - } - - /** - * @return true if the Connection is starting - */ - public synchronized boolean isStarting() { - return starting; - } - - @Override - public synchronized boolean isNetworkConnection() { - return networkConnection; - } - - @Override - public boolean isFaultTolerantConnection() { - return this.faultTolerantConnection; - } - - protected synchronized void setStarting(boolean starting) { - this.starting = starting; - } - - /** - * @return true if the Connection needs to stop - */ - public synchronized boolean isPendingStop() { - return pendingStop; - } - - protected synchronized void setPendingStop(boolean pendingStop) { - this.pendingStop = pendingStop; - } - - @Override - public Response processBrokerInfo(BrokerInfo info) { - if (info.isSlaveBroker()) { - LOG.error(" Slave Brokers are no longer supported - slave trying to attach is: {}", info.getBrokerName()); - } else if (info.isNetworkConnection() && info.isDuplexConnection()) { - // so this TransportConnection is the rear end of a network bridge - // We have been requested to create a two way pipe ... - try { - Properties properties = MarshallingSupport.stringToProperties(info.getNetworkProperties()); - Map props = createMap(properties); - NetworkBridgeConfiguration config = new NetworkBridgeConfiguration(); - IntrospectionSupport.setProperties(config, props, ""); - config.setBrokerName(broker.getBrokerName()); - - // check for existing duplex connection hanging about - - // We first look if existing network connection already exists for the same broker Id and network connector name - // It's possible in case of brief network fault to have this transport connector side of the connection always active - // and the duplex network connector side wanting to open a new one - // In this case, the old connection must be broken - String duplexNetworkConnectorId = config.getName() + "@" + info.getBrokerId(); - CopyOnWriteArrayList connections = this.connector.getConnections(); - synchronized (connections) { - for (Iterator iter = connections.iterator(); iter.hasNext(); ) { - TransportConnection c = iter.next(); - if ((c != this) && (duplexNetworkConnectorId.equals(c.getDuplexNetworkConnectorId()))) { - LOG.warn("Stopping an existing active duplex connection [{}] for network connector ({}).", c, duplexNetworkConnectorId); - c.stopAsync(); - // better to wait for a bit rather than get connection id already in use and failure to start new bridge - c.getStopped().await(1, TimeUnit.SECONDS); - } - } - setDuplexNetworkConnectorId(duplexNetworkConnectorId); - } - Transport localTransport = NetworkBridgeFactory.createLocalTransport(broker); - Transport remoteBridgeTransport = transport; - if (! (remoteBridgeTransport instanceof ResponseCorrelator)) { - // the vm transport case is already wrapped - remoteBridgeTransport = new ResponseCorrelator(remoteBridgeTransport); - } - String duplexName = localTransport.toString(); - if (duplexName.contains("#")) { - duplexName = duplexName.substring(duplexName.lastIndexOf("#")); - } - MBeanNetworkListener listener = new MBeanNetworkListener(broker.getBrokerService(), broker.getBrokerService().createDuplexNetworkConnectorObjectName(duplexName)); - listener.setCreatedByDuplex(true); - duplexBridge = NetworkBridgeFactory.createBridge(config, localTransport, remoteBridgeTransport, listener); - duplexBridge.setBrokerService(broker.getBrokerService()); - // now turn duplex off this side - info.setDuplexConnection(false); - duplexBridge.setCreatedByDuplex(true); - duplexBridge.duplexStart(this, brokerInfo, info); - LOG.info("Started responder end of duplex bridge {}", duplexNetworkConnectorId); - return null; - } catch (TransportDisposedIOException e) { - LOG.warn("Duplex bridge {} was stopped before it was correctly started.", duplexNetworkConnectorId); - return null; - } catch (Exception e) { - LOG.error("Failed to create responder end of duplex network bridge {}", duplexNetworkConnectorId, e); - return null; - } - } - // We only expect to get one broker info command per connection - if (this.brokerInfo != null) { - LOG.warn("Unexpected extra broker info command received: {}", info); - } - this.brokerInfo = info; - networkConnection = true; - List connectionStates = listConnectionStates(); - for (TransportConnectionState cs : connectionStates) { - cs.getContext().setNetworkConnection(true); - } - return null; - } - - @SuppressWarnings({"unchecked", "rawtypes"}) - private HashMap createMap(Properties properties) { - return new HashMap(properties); - } - - protected void dispatch(Command command) throws IOException { - try { - setMarkedCandidate(true); - transport.oneway(command); - } finally { - setMarkedCandidate(false); - } - } - - @Override - public String getRemoteAddress() { - return transport.getRemoteAddress(); - } - - public Transport getTransport() { - return transport; - } - - @Override - public String getConnectionId() { - List connectionStates = listConnectionStates(); - for (TransportConnectionState cs : connectionStates) { - if (cs.getInfo().getClientId() != null) { - return cs.getInfo().getClientId(); - } - return cs.getInfo().getConnectionId().toString(); - } - return null; - } - - @Override - public void updateClient(ConnectionControl control) { - if (isActive() && isBlocked() == false && isFaultTolerantConnection() && this.wireFormatInfo != null - && this.wireFormatInfo.getVersion() >= 6) { - dispatchAsync(control); - } - } - - public ProducerBrokerExchange getProducerBrokerExchangeIfExists(ProducerInfo producerInfo){ - ProducerBrokerExchange result = null; - if (producerInfo != null && producerInfo.getProducerId() != null){ - synchronized (producerExchanges){ - result = producerExchanges.get(producerInfo.getProducerId()); - } - } - return result; - } - - private ProducerBrokerExchange getProducerBrokerExchange(ProducerId id) throws IOException { - ProducerBrokerExchange result = producerExchanges.get(id); - if (result == null) { - synchronized (producerExchanges) { - result = new ProducerBrokerExchange(); - TransportConnectionState state = lookupConnectionState(id); - context = state.getContext(); - result.setConnectionContext(context); - if (context.isReconnect() || (context.isNetworkConnection() && connector.isAuditNetworkProducers())) { - result.setLastStoredSequenceId(broker.getBrokerService().getPersistenceAdapter().getLastProducerSequenceId(id)); - } - SessionState ss = state.getSessionState(id.getParentId()); - if (ss != null) { - result.setProducerState(ss.getProducerState(id)); - ProducerState producerState = ss.getProducerState(id); - if (producerState != null && producerState.getInfo() != null) { - ProducerInfo info = producerState.getInfo(); - result.setMutable(info.getDestination() == null || info.getDestination().isComposite()); - } - } - producerExchanges.put(id, result); - } - } else { - context = result.getConnectionContext(); - } - return result; - } - - private void removeProducerBrokerExchange(ProducerId id) { - synchronized (producerExchanges) { - producerExchanges.remove(id); - } - } - - private ConsumerBrokerExchange getConsumerBrokerExchange(ConsumerId id) { - ConsumerBrokerExchange result = consumerExchanges.get(id); - return result; - } - - private ConsumerBrokerExchange addConsumerBrokerExchange(ConsumerId id) { - ConsumerBrokerExchange result = consumerExchanges.get(id); - if (result == null) { - synchronized (consumerExchanges) { - result = new ConsumerBrokerExchange(); - TransportConnectionState state = lookupConnectionState(id); - context = state.getContext(); - result.setConnectionContext(context); - SessionState ss = state.getSessionState(id.getParentId()); - if (ss != null) { - ConsumerState cs = ss.getConsumerState(id); - if (cs != null) { - ConsumerInfo info = cs.getInfo(); - if (info != null) { - if (info.getDestination() != null && info.getDestination().isPattern()) { - result.setWildcard(true); - } - } - } - } - consumerExchanges.put(id, result); - } - } - return result; - } - - private void removeConsumerBrokerExchange(ConsumerId id) { - synchronized (consumerExchanges) { - consumerExchanges.remove(id); - } - } - - public int getProtocolVersion() { - return protocolVersion.get(); - } - - @Override - public Response processControlCommand(ControlCommand command) throws Exception { - String control = command.getCommand(); - if (control != null && control.equals("shutdown")) { - System.exit(0); - } - return null; - } - - @Override - public Response processMessageDispatch(MessageDispatch dispatch) throws Exception { - return null; - } - - @Override - public Response processConnectionControl(ConnectionControl control) throws Exception { - if (control != null) { - faultTolerantConnection = control.isFaultTolerant(); - } - return null; - } - - @Override - public Response processConnectionError(ConnectionError error) throws Exception { - return null; - } - - @Override - public Response processConsumerControl(ConsumerControl control) throws Exception { - ConsumerBrokerExchange consumerExchange = getConsumerBrokerExchange(control.getConsumerId()); - broker.processConsumerControl(consumerExchange, control); - return null; - } - - protected synchronized TransportConnectionState registerConnectionState(ConnectionId connectionId, - TransportConnectionState state) { - TransportConnectionState cs = null; - if (!connectionStateRegister.isEmpty() && !connectionStateRegister.doesHandleMultipleConnectionStates()) { - // swap implementations - TransportConnectionStateRegister newRegister = new MapTransportConnectionStateRegister(); - newRegister.intialize(connectionStateRegister); - connectionStateRegister = newRegister; - } - cs = connectionStateRegister.registerConnectionState(connectionId, state); - return cs; - } - - protected synchronized TransportConnectionState unregisterConnectionState(ConnectionId connectionId) { - return connectionStateRegister.unregisterConnectionState(connectionId); - } - - protected synchronized List listConnectionStates() { - return connectionStateRegister.listConnectionStates(); - } - - protected synchronized TransportConnectionState lookupConnectionState(String connectionId) { - return connectionStateRegister.lookupConnectionState(connectionId); - } - - protected synchronized TransportConnectionState lookupConnectionState(ConsumerId id) { - return connectionStateRegister.lookupConnectionState(id); - } - - protected synchronized TransportConnectionState lookupConnectionState(ProducerId id) { - return connectionStateRegister.lookupConnectionState(id); - } - - protected synchronized TransportConnectionState lookupConnectionState(SessionId id) { - return connectionStateRegister.lookupConnectionState(id); - } - - // public only for testing - public synchronized TransportConnectionState lookupConnectionState(ConnectionId connectionId) { - return connectionStateRegister.lookupConnectionState(connectionId); - } - - protected synchronized void setDuplexNetworkConnectorId(String duplexNetworkConnectorId) { - this.duplexNetworkConnectorId = duplexNetworkConnectorId; - } - - protected synchronized String getDuplexNetworkConnectorId() { - return this.duplexNetworkConnectorId; - } - - public boolean isStopping() { - return stopping.get(); - } - - protected CountDownLatch getStopped() { - return stopped; - } - - private int getProducerCount(ConnectionId connectionId) { - int result = 0; - TransportConnectionState cs = lookupConnectionState(connectionId); - if (cs != null) { - for (SessionId sessionId : cs.getSessionIds()) { - SessionState sessionState = cs.getSessionState(sessionId); - if (sessionState != null) { - result += sessionState.getProducerIds().size(); - } - } - } - return result; - } - - private int getConsumerCount(ConnectionId connectionId) { - int result = 0; - TransportConnectionState cs = lookupConnectionState(connectionId); - if (cs != null) { - for (SessionId sessionId : cs.getSessionIds()) { - SessionState sessionState = cs.getSessionState(sessionId); - if (sessionState != null) { - result += sessionState.getConsumerIds().size(); - } - } - } - return result; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnectionState.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnectionState.class deleted file mode 100644 index e874819e3..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnectionState.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnectionState.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnectionState.java deleted file mode 100644 index e71e2b2bd..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnectionState.java +++ /dev/null @@ -1,74 +0,0 @@ -/** - * 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.broker; - -import java.util.concurrent.atomic.AtomicInteger; - -import org.apache.activemq.command.ConnectionInfo; - -/** - * - */ - -public class TransportConnectionState extends org.apache.activemq.state.ConnectionState { - - private ConnectionContext context; - private TransportConnection connection; - private AtomicInteger referenceCounter = new AtomicInteger(); - private final Object connectionMutex = new Object(); - - public TransportConnectionState(ConnectionInfo info, TransportConnection transportConnection) { - super(info); - connection = transportConnection; - } - - public ConnectionContext getContext() { - return context; - } - - public TransportConnection getConnection() { - return connection; - } - - public void setContext(ConnectionContext context) { - this.context = context; - } - - public void setConnection(TransportConnection connection) { - this.connection = connection; - } - - public int incrementReference() { - return referenceCounter.incrementAndGet(); - } - - public int decrementReference() { - return referenceCounter.decrementAndGet(); - } - - public AtomicInteger getReferenceCounter() { - return referenceCounter; - } - - public void setReferenceCounter(AtomicInteger referenceCounter) { - this.referenceCounter = referenceCounter; - } - - public Object getConnectionMutex() { - return connectionMutex; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnectionStateRegister.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnectionStateRegister.class deleted file mode 100644 index d46f3e213..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnectionStateRegister.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnectionStateRegister.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnectionStateRegister.java deleted file mode 100644 index 3c8e6f887..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnectionStateRegister.java +++ /dev/null @@ -1,60 +0,0 @@ -/** - * 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.broker; - -import java.util.List; -import java.util.Map; - -import org.apache.activemq.command.ConnectionId; -import org.apache.activemq.command.ConsumerId; -import org.apache.activemq.command.ProducerId; -import org.apache.activemq.command.SessionId; - -/** - * - */ - -public interface TransportConnectionStateRegister{ - - TransportConnectionState registerConnectionState(ConnectionId connectionId, - TransportConnectionState state); - - TransportConnectionState unregisterConnectionState(ConnectionId connectionId); - - List listConnectionStates(); - - MapmapStates(); - - TransportConnectionState lookupConnectionState(String connectionId); - - TransportConnectionState lookupConnectionState(ConsumerId id); - - TransportConnectionState lookupConnectionState(ProducerId id); - - TransportConnectionState lookupConnectionState(SessionId id); - - TransportConnectionState lookupConnectionState(ConnectionId connectionId); - - boolean isEmpty(); - - boolean doesHandleMultipleConnectionStates(); - - void intialize(TransportConnectionStateRegister other); - - void clear(); - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnector$1$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnector$1$1.class deleted file mode 100644 index 26e649e42..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnector$1$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnector$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnector$1.class deleted file mode 100644 index a3682b794..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnector$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnector.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnector.class deleted file mode 100644 index 5e0adac80..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnector.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnector.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnector.java deleted file mode 100644 index 4e31ee04a..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportConnector.java +++ /dev/null @@ -1,632 +0,0 @@ -/** - * 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.broker; - -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.LinkedList; -import java.util.StringTokenizer; -import java.util.concurrent.CopyOnWriteArrayList; -import java.util.regex.Pattern; - -import javax.management.ObjectName; - -import org.apache.activemq.broker.jmx.ManagedTransportConnector; -import org.apache.activemq.broker.jmx.ManagementContext; -import org.apache.activemq.broker.region.ConnectorStatistics; -import org.apache.activemq.command.BrokerInfo; -import org.apache.activemq.command.ConnectionControl; -import org.apache.activemq.security.MessageAuthorizationPolicy; -import org.apache.activemq.thread.TaskRunnerFactory; -import org.apache.activemq.transport.Transport; -import org.apache.activemq.transport.TransportAcceptListener; -import org.apache.activemq.transport.TransportFactorySupport; -import org.apache.activemq.transport.TransportServer; -import org.apache.activemq.transport.discovery.DiscoveryAgent; -import org.apache.activemq.transport.discovery.DiscoveryAgentFactory; -import org.apache.activemq.util.ServiceStopper; -import org.apache.activemq.util.ServiceSupport; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @org.apache.xbean.XBean - */ -public class TransportConnector implements Connector, BrokerServiceAware { - - final Logger LOG = LoggerFactory.getLogger(TransportConnector.class); - - protected final CopyOnWriteArrayList connections = new CopyOnWriteArrayList(); - protected TransportStatusDetector statusDector; - private BrokerService brokerService; - private TransportServer server; - private URI uri; - private BrokerInfo brokerInfo = new BrokerInfo(); - private TaskRunnerFactory taskRunnerFactory; - private MessageAuthorizationPolicy messageAuthorizationPolicy; - private DiscoveryAgent discoveryAgent; - private final ConnectorStatistics statistics = new ConnectorStatistics(); - private URI discoveryUri; - private String name; - private boolean disableAsyncDispatch; - private boolean enableStatusMonitor = false; - private Broker broker; - private boolean updateClusterClients = false; - private boolean rebalanceClusterClients; - private boolean updateClusterClientsOnRemove = false; - private String updateClusterFilter; - private boolean auditNetworkProducers = false; - private int maximumProducersAllowedPerConnection = Integer.MAX_VALUE; - private int maximumConsumersAllowedPerConnection = Integer.MAX_VALUE; - private PublishedAddressPolicy publishedAddressPolicy = new PublishedAddressPolicy(); - private boolean allowLinkStealing; - - LinkedList peerBrokers = new LinkedList(); - - public TransportConnector() { - } - - public TransportConnector(TransportServer server) { - this(); - setServer(server); - if (server != null && server.getConnectURI() != null) { - URI uri = server.getConnectURI(); - if (uri != null && uri.getScheme().equals("vm")) { - setEnableStatusMonitor(false); - } - } - } - - /** - * @return Returns the connections. - */ - public CopyOnWriteArrayList getConnections() { - return connections; - } - - /** - * Factory method to create a JMX managed version of this transport - * connector - */ - public ManagedTransportConnector asManagedConnector(ManagementContext context, ObjectName connectorName) throws IOException, URISyntaxException { - ManagedTransportConnector rc = new ManagedTransportConnector(context, connectorName, getServer()); - rc.setBrokerInfo(getBrokerInfo()); - rc.setDisableAsyncDispatch(isDisableAsyncDispatch()); - rc.setDiscoveryAgent(getDiscoveryAgent()); - rc.setDiscoveryUri(getDiscoveryUri()); - rc.setEnableStatusMonitor(isEnableStatusMonitor()); - rc.setMessageAuthorizationPolicy(getMessageAuthorizationPolicy()); - rc.setName(getName()); - rc.setTaskRunnerFactory(getTaskRunnerFactory()); - rc.setUri(getUri()); - rc.setBrokerService(brokerService); - rc.setUpdateClusterClients(isUpdateClusterClients()); - rc.setRebalanceClusterClients(isRebalanceClusterClients()); - rc.setUpdateClusterFilter(getUpdateClusterFilter()); - rc.setUpdateClusterClientsOnRemove(isUpdateClusterClientsOnRemove()); - rc.setAuditNetworkProducers(isAuditNetworkProducers()); - rc.setMaximumConsumersAllowedPerConnection(getMaximumConsumersAllowedPerConnection()); - rc.setMaximumProducersAllowedPerConnection(getMaximumProducersAllowedPerConnection()); - rc.setPublishedAddressPolicy(getPublishedAddressPolicy()); - return rc; - } - - @Override - public BrokerInfo getBrokerInfo() { - return brokerInfo; - } - - public void setBrokerInfo(BrokerInfo brokerInfo) { - this.brokerInfo = brokerInfo; - } - - public TransportServer getServer() throws IOException, URISyntaxException { - if (server == null) { - setServer(createTransportServer()); - } - return server; - } - - public void setServer(TransportServer server) { - this.server = server; - } - - public URI getUri() { - if (uri == null) { - try { - uri = getConnectUri(); - } catch (Throwable e) { - } - } - return uri; - } - - /** - * Sets the server transport URI to use if there is not a - * {@link TransportServer} configured via the - * {@link #setServer(TransportServer)} method. This value is used to lazy - * create a {@link TransportServer} instance - * - * @param uri - */ - public void setUri(URI uri) { - this.uri = uri; - } - - public TaskRunnerFactory getTaskRunnerFactory() { - return taskRunnerFactory; - } - - public void setTaskRunnerFactory(TaskRunnerFactory taskRunnerFactory) { - this.taskRunnerFactory = taskRunnerFactory; - } - - /** - * @return the statistics for this connector - */ - @Override - public ConnectorStatistics getStatistics() { - return statistics; - } - - public MessageAuthorizationPolicy getMessageAuthorizationPolicy() { - return messageAuthorizationPolicy; - } - - /** - * Sets the policy used to decide if the current connection is authorized to - * consume a given message - */ - public void setMessageAuthorizationPolicy(MessageAuthorizationPolicy messageAuthorizationPolicy) { - this.messageAuthorizationPolicy = messageAuthorizationPolicy; - } - - @Override - public void start() throws Exception { - broker = brokerService.getBroker(); - brokerInfo.setBrokerName(broker.getBrokerName()); - brokerInfo.setBrokerId(broker.getBrokerId()); - brokerInfo.setPeerBrokerInfos(broker.getPeerBrokerInfos()); - brokerInfo.setFaultTolerantConfiguration(broker.isFaultTolerantConfiguration()); - brokerInfo.setBrokerURL(broker.getBrokerService().getDefaultSocketURIString()); - getServer().setAcceptListener(new TransportAcceptListener() { - @Override - public void onAccept(final Transport transport) { - try { - brokerService.getTaskRunnerFactory().execute(new Runnable() { - @Override - public void run() { - try { - Connection connection = createConnection(transport); - connection.start(); - } catch (Exception e) { - String remoteHost = transport.getRemoteAddress(); - ServiceSupport.dispose(transport); - onAcceptError(e, remoteHost); - } - } - }); - } catch (Exception e) { - String remoteHost = transport.getRemoteAddress(); - ServiceSupport.dispose(transport); - onAcceptError(e, remoteHost); - } - } - - @Override - public void onAcceptError(Exception error) { - onAcceptError(error, null); - } - - private void onAcceptError(Exception error, String remoteHost) { - LOG.error("Could not accept connection " + (remoteHost == null ? "" : "from " + remoteHost) + ": " - + error); - LOG.debug("Reason: " + error, error); - } - }); - getServer().setBrokerInfo(brokerInfo); - getServer().start(); - - DiscoveryAgent da = getDiscoveryAgent(); - if (da != null) { - da.registerService(getPublishableConnectString()); - da.start(); - } - if (enableStatusMonitor) { - this.statusDector = new TransportStatusDetector(this); - this.statusDector.start(); - } - - LOG.info("Connector {} started", getName()); - } - - public String getPublishableConnectString() throws Exception { - String publishableConnectString = publishedAddressPolicy.getPublishableConnectString(this); - LOG.debug("Publishing: {} for broker transport URI: {}", publishableConnectString, getConnectUri()); - return publishableConnectString; - } - - public URI getPublishableConnectURI() throws Exception { - return publishedAddressPolicy.getPublishableConnectURI(this); - } - - @Override - public void stop() throws Exception { - ServiceStopper ss = new ServiceStopper(); - if (discoveryAgent != null) { - ss.stop(discoveryAgent); - } - if (server != null) { - ss.stop(server); - } - if (this.statusDector != null) { - this.statusDector.stop(); - } - - for (TransportConnection connection : connections) { - ss.stop(connection); - } - server = null; - ss.throwFirstException(); - LOG.info("Connector {} stopped", getName()); - } - - // Implementation methods - // ------------------------------------------------------------------------- - protected Connection createConnection(Transport transport) throws IOException { - // prefer to use task runner from broker service as stop task runner, as we can then - // tie it to the lifecycle of the broker service - TransportConnection answer = new TransportConnection(this, transport, broker, disableAsyncDispatch ? null - : taskRunnerFactory, brokerService.getTaskRunnerFactory()); - boolean statEnabled = this.getStatistics().isEnabled(); - answer.getStatistics().setEnabled(statEnabled); - answer.setMessageAuthorizationPolicy(messageAuthorizationPolicy); - return answer; - } - - protected TransportServer createTransportServer() throws IOException, URISyntaxException { - if (uri == null) { - throw new IllegalArgumentException("You must specify either a server or uri property"); - } - if (brokerService == null) { - throw new IllegalArgumentException( - "You must specify the brokerService property. Maybe this connector should be added to a broker?"); - } - return TransportFactorySupport.bind(brokerService, uri); - } - - public DiscoveryAgent getDiscoveryAgent() throws IOException { - if (discoveryAgent == null) { - discoveryAgent = createDiscoveryAgent(); - } - return discoveryAgent; - } - - protected DiscoveryAgent createDiscoveryAgent() throws IOException { - if (discoveryUri != null) { - DiscoveryAgent agent = DiscoveryAgentFactory.createDiscoveryAgent(discoveryUri); - - if (agent != null && agent instanceof BrokerServiceAware) { - ((BrokerServiceAware) agent).setBrokerService(brokerService); - } - - return agent; - } - return null; - } - - public void setDiscoveryAgent(DiscoveryAgent discoveryAgent) { - this.discoveryAgent = discoveryAgent; - } - - public URI getDiscoveryUri() { - return discoveryUri; - } - - public void setDiscoveryUri(URI discoveryUri) { - this.discoveryUri = discoveryUri; - } - - public URI getConnectUri() throws IOException, URISyntaxException { - if (server != null) { - return server.getConnectURI(); - } else { - return uri; - } - } - - public void onStarted(TransportConnection connection) { - connections.add(connection); - } - - public void onStopped(TransportConnection connection) { - connections.remove(connection); - } - - public String getName() { - if (name == null) { - uri = getUri(); - if (uri != null) { - name = uri.toString(); - } - } - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public String toString() { - String rc = getName(); - if (rc == null) { - rc = super.toString(); - } - return rc; - } - - protected ConnectionControl getConnectionControl() { - boolean rebalance = isRebalanceClusterClients(); - String connectedBrokers = ""; - String separator = ""; - - if (isUpdateClusterClients()) { - synchronized (peerBrokers) { - for (String uri : getPeerBrokers()) { - connectedBrokers += separator + uri; - separator = ","; - } - - if (rebalance) { - String shuffle = peerBrokers.removeFirst(); - peerBrokers.addLast(shuffle); - } - } - } - ConnectionControl control = new ConnectionControl(); - control.setConnectedBrokers(connectedBrokers); - control.setRebalanceConnection(rebalance); - return control; - } - - public void addPeerBroker(BrokerInfo info) { - if (isMatchesClusterFilter(info.getBrokerName())) { - synchronized (peerBrokers) { - getPeerBrokers().addLast(info.getBrokerURL()); - } - } - } - - public void removePeerBroker(BrokerInfo info) { - synchronized (peerBrokers) { - getPeerBrokers().remove(info.getBrokerURL()); - } - } - - public LinkedList getPeerBrokers() { - synchronized (peerBrokers) { - if (peerBrokers.isEmpty()) { - peerBrokers.add(brokerService.getDefaultSocketURIString()); - } - return peerBrokers; - } - } - - @Override - public void updateClientClusterInfo() { - if (isRebalanceClusterClients() || isUpdateClusterClients()) { - ConnectionControl control = getConnectionControl(); - for (Connection c : this.connections) { - c.updateClient(control); - if (isRebalanceClusterClients()) { - control = getConnectionControl(); - } - } - } - } - - private boolean isMatchesClusterFilter(String brokerName) { - boolean result = true; - String filter = getUpdateClusterFilter(); - if (filter != null) { - filter = filter.trim(); - if (filter.length() > 0) { - StringTokenizer tokenizer = new StringTokenizer(filter, ","); - while (result && tokenizer.hasMoreTokens()) { - String token = tokenizer.nextToken(); - result = isMatchesClusterFilter(brokerName, token); - } - } - } - - return result; - } - - private boolean isMatchesClusterFilter(String brokerName, String match) { - boolean result = true; - if (brokerName != null && match != null && brokerName.length() > 0 && match.length() > 0) { - result = Pattern.matches(match, brokerName); - } - return result; - } - - public boolean isDisableAsyncDispatch() { - return disableAsyncDispatch; - } - - public void setDisableAsyncDispatch(boolean disableAsyncDispatch) { - this.disableAsyncDispatch = disableAsyncDispatch; - } - - /** - * @return the enableStatusMonitor - */ - public boolean isEnableStatusMonitor() { - return enableStatusMonitor; - } - - /** - * @param enableStatusMonitor - * the enableStatusMonitor to set - */ - public void setEnableStatusMonitor(boolean enableStatusMonitor) { - this.enableStatusMonitor = enableStatusMonitor; - } - - /** - * This is called by the BrokerService right before it starts the transport. - */ - @Override - public void setBrokerService(BrokerService brokerService) { - this.brokerService = brokerService; - } - - public Broker getBroker() { - return broker; - } - - public BrokerService getBrokerService() { - return brokerService; - } - - /** - * @return the updateClusterClients - */ - @Override - public boolean isUpdateClusterClients() { - return this.updateClusterClients; - } - - /** - * @param updateClusterClients - * the updateClusterClients to set - */ - public void setUpdateClusterClients(boolean updateClusterClients) { - this.updateClusterClients = updateClusterClients; - } - - /** - * @return the rebalanceClusterClients - */ - @Override - public boolean isRebalanceClusterClients() { - return this.rebalanceClusterClients; - } - - /** - * @param rebalanceClusterClients - * the rebalanceClusterClients to set - */ - public void setRebalanceClusterClients(boolean rebalanceClusterClients) { - this.rebalanceClusterClients = rebalanceClusterClients; - } - - /** - * @return the updateClusterClientsOnRemove - */ - @Override - public boolean isUpdateClusterClientsOnRemove() { - return this.updateClusterClientsOnRemove; - } - - /** - * @param updateClusterClientsOnRemove the updateClusterClientsOnRemove to set - */ - public void setUpdateClusterClientsOnRemove(boolean updateClusterClientsOnRemove) { - this.updateClusterClientsOnRemove = updateClusterClientsOnRemove; - } - - /** - * @return the updateClusterFilter - */ - public String getUpdateClusterFilter() { - return this.updateClusterFilter; - } - - /** - * @param updateClusterFilter - * the updateClusterFilter to set - */ - public void setUpdateClusterFilter(String updateClusterFilter) { - this.updateClusterFilter = updateClusterFilter; - } - - @Override - public int connectionCount() { - return connections.size(); - } - - @Override - public boolean isAllowLinkStealing() { - return allowLinkStealing; - } - - public void setAllowLinkStealing (boolean allowLinkStealing) { - this.allowLinkStealing=allowLinkStealing; - } - - public boolean isAuditNetworkProducers() { - return auditNetworkProducers; - } - - /** - * Enable a producer audit on network connections, Traps the case of a missing send reply and resend. - * Note: does not work with conduit=false, networked composite destinations or networked virtual topics - * @param auditNetworkProducers - */ - public void setAuditNetworkProducers(boolean auditNetworkProducers) { - this.auditNetworkProducers = auditNetworkProducers; - } - - public int getMaximumProducersAllowedPerConnection() { - return maximumProducersAllowedPerConnection; - } - - public void setMaximumProducersAllowedPerConnection(int maximumProducersAllowedPerConnection) { - this.maximumProducersAllowedPerConnection = maximumProducersAllowedPerConnection; - } - - public int getMaximumConsumersAllowedPerConnection() { - return maximumConsumersAllowedPerConnection; - } - - public void setMaximumConsumersAllowedPerConnection(int maximumConsumersAllowedPerConnection) { - this.maximumConsumersAllowedPerConnection = maximumConsumersAllowedPerConnection; - } - - /** - * Gets the currently configured policy for creating the published connection address of this - * TransportConnector. - * - * @return the publishedAddressPolicy - */ - public PublishedAddressPolicy getPublishedAddressPolicy() { - return publishedAddressPolicy; - } - - /** - * Sets the configured policy for creating the published connection address of this - * TransportConnector. - * - * @return the publishedAddressPolicy - */ - public void setPublishedAddressPolicy(PublishedAddressPolicy publishedAddressPolicy) { - this.publishedAddressPolicy = publishedAddressPolicy; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportStatusDetector.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportStatusDetector.class deleted file mode 100644 index cdf8e3b19..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportStatusDetector.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportStatusDetector.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportStatusDetector.java deleted file mode 100644 index 03eed944c..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/TransportStatusDetector.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * 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.broker; - -import java.util.Iterator; -import java.util.Set; -import java.util.concurrent.CopyOnWriteArraySet; -import java.util.concurrent.atomic.AtomicBoolean; - -import org.apache.activemq.Service; -import org.apache.activemq.ThreadPriorities; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Used to provide information on the status of the Connection - * - * - */ -public class TransportStatusDetector implements Service, Runnable { - private static final Logger LOG = LoggerFactory.getLogger(TransportStatusDetector.class); - private TransportConnector connector; - private Set collectionCandidates = new CopyOnWriteArraySet(); - private AtomicBoolean started = new AtomicBoolean(false); - private Thread runner; - private int sweepInterval = 5000; - - TransportStatusDetector(TransportConnector connector) { - this.connector = connector; - } - - /** - * @return Returns the sweepInterval. - */ - public int getSweepInterval() { - return sweepInterval; - } - - /** - * The sweepInterval to set. - * - * @param sweepInterval - */ - public void setSweepInterval(int sweepInterval) { - this.sweepInterval = sweepInterval; - } - - protected void doCollection() { - for (Iterator i = collectionCandidates.iterator(); i.hasNext();) { - TransportConnection tc = i.next(); - if (tc.isMarkedCandidate()) { - if (tc.isBlockedCandidate()) { - collectionCandidates.remove(tc); - doCollection(tc); - } else { - tc.doMark(); - } - } else { - collectionCandidates.remove(tc); - } - } - } - - protected void doSweep() { - for (Iterator i = connector.getConnections().iterator(); i.hasNext();) { - TransportConnection connection = (TransportConnection)i.next(); - if (connection.isMarkedCandidate()) { - connection.doMark(); - collectionCandidates.add(connection); - } - } - } - - protected void doCollection(TransportConnection tc) { - LOG.warn("found a blocked client - stopping: {}", tc); - try { - tc.stop(); - } catch (Exception e) { - LOG.error("Error stopping {}", tc, e); - } - } - - public void run() { - while (started.get()) { - try { - doCollection(); - doSweep(); - Thread.sleep(sweepInterval); - } catch (Throwable e) { - LOG.error("failed to complete a sweep for blocked clients", e); - } - } - } - - public void start() throws Exception { - if (started.compareAndSet(false, true)) { - runner = new Thread(this, "ActiveMQ Transport Status Monitor: " + connector); - runner.setDaemon(true); - runner.setPriority(ThreadPriorities.BROKER_MANAGEMENT); - runner.start(); - } - } - - public void stop() throws Exception { - started.set(false); - if (runner != null) { - runner.join(getSweepInterval() * 5); - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/UserIDBroker.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/UserIDBroker.class deleted file mode 100644 index 1200df8b0..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/UserIDBroker.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/UserIDBroker.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/UserIDBroker.java deleted file mode 100644 index 2d5dea5b1..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/UserIDBroker.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * 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.broker; - -import java.util.Set; -import org.apache.activemq.command.Message; -import org.apache.activemq.jaas.UserPrincipal; -import org.apache.activemq.security.SecurityContext; - -/** - * This broker filter will append the producer's user ID into the JMSXUserID header - * to allow folks to know reliably who the user was who produced a message. - * Note that you cannot trust the client, especially if working over the internet - * as they can spoof headers to be anything they like. - * - * - */ -public class UserIDBroker extends BrokerFilter { - boolean useAuthenticatePrincipal = false; - public UserIDBroker(Broker next) { - super(next); - } - - public void send(ProducerBrokerExchange producerExchange, Message messageSend) throws Exception { - final ConnectionContext context = producerExchange.getConnectionContext(); - String userID = context.getUserName(); - if (isUseAuthenticatePrincipal()) { - SecurityContext securityContext = context.getSecurityContext(); - if (securityContext != null) { - Set principals = securityContext.getPrincipals(); - if (principals != null) { - for (Object candidate : principals) { - if (candidate instanceof UserPrincipal) { - userID = ((UserPrincipal)candidate).getName(); - break; - } - } - } - } - } - messageSend.setUserID(userID); - super.send(producerExchange, messageSend); - } - - - public boolean isUseAuthenticatePrincipal() { - return useAuthenticatePrincipal; - } - - public void setUseAuthenticatePrincipal(boolean useAuthenticatePrincipal) { - this.useAuthenticatePrincipal = useAuthenticatePrincipal; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/cluster/ConnectionSplitBroker.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/cluster/ConnectionSplitBroker.class deleted file mode 100644 index c36fafa68..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/cluster/ConnectionSplitBroker.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/cluster/ConnectionSplitBroker.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/cluster/ConnectionSplitBroker.java deleted file mode 100644 index ff2fc76f7..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/cluster/ConnectionSplitBroker.java +++ /dev/null @@ -1,92 +0,0 @@ -/** - * 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.broker.cluster; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.BrokerFilter; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ConsumerId; -import org.apache.activemq.command.ConsumerInfo; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Monitors for client connections that may fail to another broker - but this - * broker isn't aware they've gone. Can occur with network glitches or client - * error - * - * - */ -public class ConnectionSplitBroker extends BrokerFilter{ - private static final Logger LOG = LoggerFactory.getLogger(ConnectionSplitBroker.class); - private ListnetworkConsumerList = new ArrayList(); - public ConnectionSplitBroker(Broker next) { - super(next); - } - - - public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) - throws Exception { - ActiveMQDestination dest = info.getDestination(); - - synchronized (networkConsumerList) { - if (info.isNetworkSubscription()) { - networkConsumerList.add(info); - } else { - if (!networkConsumerList.isEmpty()) { - List gcList = new ArrayList(); - for (ConsumerInfo nc : networkConsumerList) { - if (!nc.isNetworkConsumersEmpty()) { - - for (ConsumerId id : nc.getNetworkConsumerIds()) { - - if (id.equals(info.getConsumerId())) { - nc.removeNetworkConsumerId(id); - if (nc.isNetworkConsumersEmpty()) { - gcList.add(nc); - } - } - } - } - } - for (ConsumerInfo nc : gcList) { - networkConsumerList.remove(nc); - super.removeConsumer(context, nc); - LOG.warn("Removed stale network consumer {}", nc); - } - } - } - } - - return super.addConsumer(context, info); - } - - public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { - if (info.isNetworkSubscription()) { - - synchronized (networkConsumerList) { - networkConsumerList.remove(info); - } - } - super.removeConsumer(context, info); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/inteceptor/MessageInterceptor.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/inteceptor/MessageInterceptor.class deleted file mode 100644 index 790289de0..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/inteceptor/MessageInterceptor.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/inteceptor/MessageInterceptor.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/inteceptor/MessageInterceptor.java deleted file mode 100644 index db855b2e7..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/inteceptor/MessageInterceptor.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * 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.broker.inteceptor; - -import org.apache.activemq.broker.ProducerBrokerExchange; -import org.apache.activemq.command.Message; - -public interface MessageInterceptor { - - void intercept(ProducerBrokerExchange producerExchange, Message message); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/inteceptor/MessageInterceptorFilter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/inteceptor/MessageInterceptorFilter.class deleted file mode 100644 index ccd4069c8..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/inteceptor/MessageInterceptorFilter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/inteceptor/MessageInterceptorFilter.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/inteceptor/MessageInterceptorFilter.java deleted file mode 100644 index ae978027c..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/inteceptor/MessageInterceptorFilter.java +++ /dev/null @@ -1,119 +0,0 @@ -/** - * 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.broker.inteceptor; - -import java.util.Set; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.BrokerFilter; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.ProducerBrokerExchange; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.Message; -import org.apache.activemq.command.ProducerInfo; -import org.apache.activemq.filter.DestinationMap; -import org.apache.activemq.state.ProducerState; - -class MessageInterceptorFilter extends BrokerFilter { - private DestinationMap interceptorMap = new DestinationMap(); - - MessageInterceptorFilter(Broker next) { - super(next); - } - - - MessageInterceptor addMessageInterceptor(String destinationName, MessageInterceptor messageInterceptor) { - ActiveMQDestination activeMQDestination = ActiveMQDestination.createDestination(destinationName, ActiveMQDestination.QUEUE_TYPE); - interceptorMap.put(activeMQDestination, messageInterceptor); - return messageInterceptor; - } - - void removeMessageInterceptor(String destinationName, MessageInterceptor interceptor) { - ActiveMQDestination activeMQDestination = ActiveMQDestination.createDestination(destinationName, ActiveMQDestination.QUEUE_TYPE); - interceptorMap.remove(activeMQDestination, interceptor); - } - - - MessageInterceptor addMessageInterceptorForQueue(String destinationName, MessageInterceptor messageInterceptor) { - ActiveMQDestination activeMQDestination = ActiveMQDestination.createDestination(destinationName, ActiveMQDestination.QUEUE_TYPE); - interceptorMap.put(activeMQDestination, messageInterceptor); - return messageInterceptor; - } - - void removeMessageInterceptorForQueue(String destinationName, MessageInterceptor interceptor) { - ActiveMQDestination activeMQDestination = ActiveMQDestination.createDestination(destinationName, ActiveMQDestination.QUEUE_TYPE); - interceptorMap.remove(activeMQDestination, interceptor); - } - - - MessageInterceptor addMessageInterceptorForTopic(String destinationName, MessageInterceptor messageInterceptor) { - ActiveMQDestination activeMQDestination = ActiveMQDestination.createDestination(destinationName, ActiveMQDestination.TOPIC_TYPE); - interceptorMap.put(activeMQDestination, messageInterceptor); - return messageInterceptor; - } - - void removeMessageInterceptorForTopic(String destinationName, MessageInterceptor interceptor) { - ActiveMQDestination activeMQDestination = ActiveMQDestination.createDestination(destinationName, ActiveMQDestination.TOPIC_TYPE); - interceptorMap.remove(activeMQDestination, interceptor); - } - - MessageInterceptor addMessageInterceptor(ActiveMQDestination activeMQDestination, MessageInterceptor messageInterceptor) { - interceptorMap.put(activeMQDestination, messageInterceptor); - return messageInterceptor; - } - - void removeMessageInterceptor(ActiveMQDestination activeMQDestination, MessageInterceptor interceptor) { - interceptorMap.remove(activeMQDestination, interceptor); - } - - - /** - * Re-inject into the Broker chain - */ - - void injectMessage(ProducerBrokerExchange producerExchange, final Message messageSend) throws Exception { - ProducerBrokerExchange pe = producerExchange; - if (pe == null) { - pe = new ProducerBrokerExchange(); - ConnectionContext cc = new ConnectionContext(); - cc.setBroker(this.getRoot()); - pe.setConnectionContext(cc); - pe.setMutable(true); - pe.setProducerState(new ProducerState(new ProducerInfo())); - } - super.send(pe, messageSend); - } - - - @Override - public void send(ProducerBrokerExchange producerExchange, final Message messageSend) throws Exception { - ActiveMQDestination activeMQDestination = messageSend.getDestination(); - if (!interceptorMap.isEmpty() && activeMQDestination != null) { - Set set = interceptorMap.get(activeMQDestination); - if (set != null && !set.isEmpty()) { - for (MessageInterceptor mi : set) { - mi.intercept(producerExchange, messageSend); - } - } else { - super.send(producerExchange, messageSend); - } - - } else { - super.send(producerExchange, messageSend); - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/inteceptor/MessageInterceptorRegistry.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/inteceptor/MessageInterceptorRegistry.class deleted file mode 100644 index 46ad7d119..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/inteceptor/MessageInterceptorRegistry.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/inteceptor/MessageInterceptorRegistry.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/inteceptor/MessageInterceptorRegistry.java deleted file mode 100644 index f906394b4..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/inteceptor/MessageInterceptorRegistry.java +++ /dev/null @@ -1,123 +0,0 @@ -/** - * 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.broker.inteceptor; - -import java.util.HashMap; -import java.util.Map; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.BrokerRegistry; -import org.apache.activemq.broker.BrokerService; -import org.apache.activemq.broker.MutableBrokerFilter; -import org.apache.activemq.broker.ProducerBrokerExchange; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.Message; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class MessageInterceptorRegistry { - private static final Logger LOG = LoggerFactory.getLogger(MessageInterceptorRegistry.class); - private static final MessageInterceptorRegistry INSTANCE = new MessageInterceptorRegistry(); - private final BrokerService brokerService; - private MessageInterceptorFilter filter; - private final Map messageInterceptorRegistryMap = new HashMap(); - - - public static MessageInterceptorRegistry getInstance() { - return INSTANCE; - } - - public MessageInterceptorRegistry get(String brokerName){ - BrokerService brokerService = BrokerRegistry.getInstance().lookup(brokerName); - return get(brokerService); - } - - public synchronized MessageInterceptorRegistry get(BrokerService brokerService){ - MessageInterceptorRegistry result = messageInterceptorRegistryMap.get(brokerService); - if (result == null){ - result = new MessageInterceptorRegistry(brokerService); - messageInterceptorRegistryMap.put(brokerService,result); - } - return result; - } - - private MessageInterceptorRegistry(){ - this.brokerService=BrokerRegistry.getInstance().findFirst(); - messageInterceptorRegistryMap.put(brokerService,this); - } - - private MessageInterceptorRegistry(BrokerService brokerService) { - this.brokerService = brokerService; - } - - public MessageInterceptor addMessageInterceptor(String destinationName, MessageInterceptor messageInterceptor) { - return getFilter().addMessageInterceptor(destinationName, messageInterceptor); - } - - public void removeMessageInterceptor(String destinationName, MessageInterceptor messageInterceptor) { - getFilter().removeMessageInterceptor(destinationName, messageInterceptor); - } - - - public MessageInterceptor addMessageInterceptorForQueue(String destinationName, MessageInterceptor messageInterceptor) { - return getFilter().addMessageInterceptorForQueue(destinationName, messageInterceptor); - } - - public void removeMessageInterceptorForQueue(String destinationName, MessageInterceptor messageInterceptor) { - getFilter().addMessageInterceptorForQueue(destinationName, messageInterceptor); - } - - - public MessageInterceptor addMessageInterceptorForTopic(String destinationName, MessageInterceptor messageInterceptor) { - return getFilter().addMessageInterceptorForTopic(destinationName, messageInterceptor); - } - - public void removeMessageInterceptorForTopic(String destinationName, MessageInterceptor messageInterceptor) { - getFilter().removeMessageInterceptorForTopic(destinationName, messageInterceptor); - } - - public MessageInterceptor addMessageInterceptor(ActiveMQDestination activeMQDestination, MessageInterceptor messageInterceptor) { - return getFilter().addMessageInterceptor(activeMQDestination, messageInterceptor); - } - - public void removeMessageInterceptor(ActiveMQDestination activeMQDestination, MessageInterceptor interceptor) { - getFilter().removeMessageInterceptor(activeMQDestination, interceptor); - } - - /** - * Re-inject into the Broker chain - */ - - public void injectMessage(ProducerBrokerExchange producerExchange, final Message messageSend) throws Exception { - getFilter().injectMessage(producerExchange, messageSend); - } - - - private synchronized MessageInterceptorFilter getFilter() { - if (filter == null) { - try { - MutableBrokerFilter mutableBrokerFilter = (MutableBrokerFilter) brokerService.getBroker().getAdaptor(MutableBrokerFilter.class); - Broker next = mutableBrokerFilter.getNext(); - filter = new MessageInterceptorFilter(next); - mutableBrokerFilter.setNext(filter); - } catch (Exception e) { - LOG.error("Failed to create MessageInterceptorFilter", e); - } - } - return filter; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/inteceptor/package.html b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/inteceptor/package.html deleted file mode 100644 index 2850fd4df..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/inteceptor/package.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - -MessageInteceptor malarky - - - diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AbortSlowAckConsumerStrategyView.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AbortSlowAckConsumerStrategyView.class deleted file mode 100644 index a8b4676f6..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AbortSlowAckConsumerStrategyView.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AbortSlowAckConsumerStrategyView.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AbortSlowAckConsumerStrategyView.java deleted file mode 100644 index 87758dffe..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AbortSlowAckConsumerStrategyView.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * 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.broker.jmx; - -import org.apache.activemq.broker.region.policy.AbortSlowAckConsumerStrategy; - -public class AbortSlowAckConsumerStrategyView extends AbortSlowConsumerStrategyView implements AbortSlowAckConsumerStrategyViewMBean { - - private final AbortSlowAckConsumerStrategy strategy; - - public AbortSlowAckConsumerStrategyView(ManagedRegionBroker managedRegionBroker, AbortSlowAckConsumerStrategy slowConsumerStrategy) { - super(managedRegionBroker, slowConsumerStrategy); - this.strategy = slowConsumerStrategy; - } - - @Override - public long getMaxTimeSinceLastAck() { - return strategy.getMaxTimeSinceLastAck(); - } - - @Override - public void setMaxTimeSinceLastAck(long maxTimeSinceLastAck) { - this.strategy.setMaxTimeSinceLastAck(maxTimeSinceLastAck); - } - - @Override - public boolean isIgnoreIdleConsumers() { - return strategy.isIgnoreIdleConsumers(); - } - - @Override - public void setIgnoreIdleConsumers(boolean ignoreIdleConsumers) { - this.strategy.setIgnoreIdleConsumers(ignoreIdleConsumers); - } - - @Override - public boolean isIgnoreNetworkConsumers() { - return this.strategy.isIgnoreNetworkSubscriptions(); - } - - @Override - public void setIgnoreNetworkConsumers(boolean ignoreNetworkConsumers) { - this.strategy.setIgnoreNetworkConsumers(ignoreNetworkConsumers); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AbortSlowAckConsumerStrategyViewMBean.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AbortSlowAckConsumerStrategyViewMBean.class deleted file mode 100644 index 3d3a8f6aa..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AbortSlowAckConsumerStrategyViewMBean.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AbortSlowAckConsumerStrategyViewMBean.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AbortSlowAckConsumerStrategyViewMBean.java deleted file mode 100644 index 15e5deb53..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AbortSlowAckConsumerStrategyViewMBean.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * 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.broker.jmx; - -public interface AbortSlowAckConsumerStrategyViewMBean extends AbortSlowConsumerStrategyViewMBean { - - @MBeanInfo("returns the current max time since last ack setting") - long getMaxTimeSinceLastAck(); - - @MBeanInfo("sets the duration (milliseconds) after which a consumer that doesn't ack a message will be marked as slow") - void setMaxTimeSinceLastAck(long maxTimeSinceLastAck); - - @MBeanInfo("returns the current value of the ignore idle consumers setting.") - boolean isIgnoreIdleConsumers(); - - @MBeanInfo("sets whether consumers that are idle (no dispatched messages) should be included when checking for slow acks.") - void setIgnoreIdleConsumers(boolean ignoreIdleConsumers); - - @MBeanInfo("returns the current value of the ignore network connector consumers setting.") - boolean isIgnoreNetworkConsumers(); - - @MBeanInfo("sets whether consumers that are from network connector should be included when checking for slow acks.") - void setIgnoreNetworkConsumers(boolean ignoreIdleConsumers); - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AbortSlowConsumerStrategyView.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AbortSlowConsumerStrategyView.class deleted file mode 100644 index 4ad297501..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AbortSlowConsumerStrategyView.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AbortSlowConsumerStrategyView.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AbortSlowConsumerStrategyView.java deleted file mode 100644 index 43902a0e9..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AbortSlowConsumerStrategyView.java +++ /dev/null @@ -1,118 +0,0 @@ -/** - * 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.broker.jmx; - -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.broker.region.policy.AbortSlowConsumerStrategy; -import org.apache.activemq.broker.region.policy.SlowConsumerEntry; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.management.ObjectName; -import javax.management.openmbean.CompositeType; -import javax.management.openmbean.OpenDataException; -import javax.management.openmbean.TabularData; -import javax.management.openmbean.TabularDataSupport; -import javax.management.openmbean.TabularType; -import java.util.Map; - -public class AbortSlowConsumerStrategyView implements AbortSlowConsumerStrategyViewMBean { - private static final Logger LOG = LoggerFactory.getLogger(AbortSlowConsumerStrategyView.class); - private ManagedRegionBroker broker; - private AbortSlowConsumerStrategy strategy; - - - public AbortSlowConsumerStrategyView(ManagedRegionBroker managedRegionBroker, AbortSlowConsumerStrategy slowConsumerStrategy) { - this.broker = managedRegionBroker; - this.strategy = slowConsumerStrategy; - } - - public long getMaxSlowCount() { - return strategy.getMaxSlowCount(); - } - - public void setMaxSlowCount(long maxSlowCount) { - strategy.setMaxSlowCount(maxSlowCount); - } - - public long getMaxSlowDuration() { - return strategy.getMaxSlowDuration(); - } - - public void setMaxSlowDuration(long maxSlowDuration) { - strategy.setMaxSlowDuration(maxSlowDuration); - } - - public long getCheckPeriod() { - return strategy.getCheckPeriod(); - } - - public TabularData getSlowConsumers() throws OpenDataException { - - OpenTypeSupport.OpenTypeFactory factory = OpenTypeSupport.getFactory(SlowConsumerEntry.class); - CompositeType ct = factory.getCompositeType(); - TabularType tt = new TabularType("SlowConsumers", "Table of current slow Consumers", ct, new String[] {"subscription" }); - TabularDataSupport rc = new TabularDataSupport(tt); - - int index = 0; - Map slowConsumers = strategy.getSlowConsumers(); - for (Map.Entry entry : slowConsumers.entrySet()) { - entry.getValue().setSubscription(broker.getSubscriberObjectName(entry.getKey())); - rc.put(OpenTypeSupport.convert(entry.getValue())); - } - return rc; - } - - public void abortConsumer(ObjectName consumerToAbort) { - Subscription sub = broker.getSubscriber(consumerToAbort); - if (sub != null) { - LOG.info("aborting consumer via jmx: {}", sub.getConsumerInfo().getConsumerId()); - strategy.abortConsumer(sub, false); - } else { - LOG.warn("cannot resolve subscription matching name: {}", consumerToAbort); - } - - } - - public void abortConnection(ObjectName consumerToAbort) { - Subscription sub = broker.getSubscriber(consumerToAbort); - if (sub != null) { - LOG.info("aborting consumer connection via jmx: {}", sub.getConsumerInfo().getConsumerId().getConnectionId()); - strategy.abortConsumer(sub, true); - } else { - LOG.warn("cannot resolve subscription matching name: {}", consumerToAbort); - } - } - - public void abortConsumer(String objectNameOfConsumerToAbort) { - abortConsumer(toObjectName(objectNameOfConsumerToAbort)); - } - - public void abortConnection(String objectNameOfConsumerToAbort) { - abortConnection(toObjectName(objectNameOfConsumerToAbort)); - } - - private ObjectName toObjectName(String objectName) { - ObjectName result = null; - try { - result = new ObjectName(objectName); - } catch (Exception e) { - LOG.warn("cannot create subscription ObjectName to abort, from string: {}", objectName); - } - return result; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AbortSlowConsumerStrategyViewMBean.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AbortSlowConsumerStrategyViewMBean.class deleted file mode 100644 index e25fc288d..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AbortSlowConsumerStrategyViewMBean.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AbortSlowConsumerStrategyViewMBean.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AbortSlowConsumerStrategyViewMBean.java deleted file mode 100644 index 00d9571b4..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AbortSlowConsumerStrategyViewMBean.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * 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.broker.jmx; - -import javax.management.ObjectName; -import javax.management.openmbean.OpenDataException; -import javax.management.openmbean.TabularData; - -public interface AbortSlowConsumerStrategyViewMBean { - - @MBeanInfo("returns the current max slow count, -1 disables") - long getMaxSlowCount(); - - @MBeanInfo("sets the count after which a slow consumer will be aborted, -1 disables") - void setMaxSlowCount(long maxSlowCount); - - @MBeanInfo("returns the current max slow (milliseconds) duration") - long getMaxSlowDuration(); - - @MBeanInfo("sets the duration (milliseconds) after which a continually slow consumer will be aborted") - void setMaxSlowDuration(long maxSlowDuration); - - @MBeanInfo("returns the check period at which a sweep of consumers is done to determine continued slowness") - public long getCheckPeriod(); - - @MBeanInfo("returns the current list of slow consumers, Not HTML friendly") - TabularData getSlowConsumers() throws OpenDataException; - - @MBeanInfo("aborts the slow consumer gracefully by sending a shutdown control message to just that consumer") - void abortConsumer(ObjectName consumerToAbort); - - @MBeanInfo("aborts the slow consumer forcefully by shutting down it's connection, note: all other users of the connection will be affected") - void abortConnection(ObjectName consumerToAbort); - - @MBeanInfo("aborts the slow consumer gracefully by sending a shutdown control message to just that consumer") - void abortConsumer(String objectNameOfConsumerToAbort); - - @MBeanInfo("aborts the slow consumer forcefully by shutting down it's connection, note: all other users of the connection will be affected") - void abortConnection(String objectNameOfConsumerToAbort); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AnnotatedMBean.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AnnotatedMBean.class deleted file mode 100644 index ac17c673c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AnnotatedMBean.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AnnotatedMBean.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AnnotatedMBean.java deleted file mode 100644 index 820762764..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AnnotatedMBean.java +++ /dev/null @@ -1,200 +0,0 @@ -/** - * 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.broker.jmx; - -import java.lang.annotation.Annotation; -import java.lang.reflect.Method; -import java.security.AccessController; -import java.security.Principal; -import java.util.HashMap; -import java.util.Map; - -import javax.management.MBeanAttributeInfo; -import javax.management.MBeanException; -import javax.management.MBeanOperationInfo; -import javax.management.MBeanParameterInfo; -import javax.management.NotCompliantMBeanException; -import javax.management.ObjectName; -import javax.management.ReflectionException; -import javax.management.StandardMBean; -import javax.security.auth.Subject; - -import org.apache.activemq.broker.util.AuditLogEntry; -import org.apache.activemq.broker.util.AuditLogService; -import org.apache.activemq.broker.util.JMXAuditLogEntry; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * MBean that looks for method/parameter descriptions in the Info annotation. - */ -public class AnnotatedMBean extends StandardMBean { - - private static final Map> primitives = new HashMap>(); - - private static final Logger LOG = LoggerFactory.getLogger("org.apache.activemq.audit"); - - private static boolean audit; - private static AuditLogService auditLog; - - static { - Class[] p = { byte.class, short.class, int.class, long.class, float.class, double.class, char.class, boolean.class, }; - for (Class c : p) { - primitives.put(c.getName(), c); - } - audit = "true".equalsIgnoreCase(System.getProperty("org.apache.activemq.audit")); - if (audit) { - auditLog = AuditLogService.getAuditLog(); - } - } - - @SuppressWarnings({ "unchecked", "rawtypes" }) - public static void registerMBean(ManagementContext context, Object object, ObjectName objectName) throws Exception { - - String mbeanName = object.getClass().getName() + "MBean"; - - for (Class c : object.getClass().getInterfaces()) { - if (mbeanName.equals(c.getName())) { - context.registerMBean(new AnnotatedMBean(object, c), objectName); - return; - } - } - - context.registerMBean(object, objectName); - } - - /** Instance where the MBean interface is implemented by another object. */ - public AnnotatedMBean(T impl, Class mbeanInterface) throws NotCompliantMBeanException { - super(impl, mbeanInterface); - } - - /** Instance where the MBean interface is implemented by this object. */ - protected AnnotatedMBean(Class mbeanInterface) throws NotCompliantMBeanException { - super(mbeanInterface); - } - - /** {@inheritDoc} */ - @Override - protected String getDescription(MBeanAttributeInfo info) { - - String descr = info.getDescription(); - Method m = getMethod(getMBeanInterface(), "get" + info.getName().substring(0, 1).toUpperCase() + info.getName().substring(1)); - if (m == null) - m = getMethod(getMBeanInterface(), "is" + info.getName().substring(0, 1).toUpperCase() + info.getName().substring(1)); - if (m == null) - m = getMethod(getMBeanInterface(), "does" + info.getName().substring(0, 1).toUpperCase() + info.getName().substring(1)); - - if (m != null) { - MBeanInfo d = m.getAnnotation(MBeanInfo.class); - if (d != null) - descr = d.value(); - } - return descr; - } - - /** {@inheritDoc} */ - @Override - protected String getDescription(MBeanOperationInfo op) { - - String descr = op.getDescription(); - Method m = getMethod(op); - if (m != null) { - MBeanInfo d = m.getAnnotation(MBeanInfo.class); - if (d != null) - descr = d.value(); - } - return descr; - } - - /** {@inheritDoc} */ - @Override - protected String getParameterName(MBeanOperationInfo op, MBeanParameterInfo param, int paramNo) { - String name = param.getName(); - Method m = getMethod(op); - if (m != null) { - for (Annotation a : m.getParameterAnnotations()[paramNo]) { - if (MBeanInfo.class.isInstance(a)) - name = MBeanInfo.class.cast(a).value(); - } - } - return name; - } - - /** - * Extracts the Method from the MBeanOperationInfo - * - * @param op - * @return - */ - private Method getMethod(MBeanOperationInfo op) { - final MBeanParameterInfo[] params = op.getSignature(); - final String[] paramTypes = new String[params.length]; - for (int i = 0; i < params.length; i++) - paramTypes[i] = params[i].getType(); - - return getMethod(getMBeanInterface(), op.getName(), paramTypes); - } - - /** - * Returns the Method with the specified name and parameter types for the - * given class, null if it doesn't exist. - * - * @param mbean - * @param method - * @param params - * @return - */ - private static Method getMethod(Class mbean, String method, String... params) { - try { - final ClassLoader loader = mbean.getClassLoader(); - final Class[] paramClasses = new Class[params.length]; - for (int i = 0; i < params.length; i++) { - paramClasses[i] = primitives.get(params[i]); - if (paramClasses[i] == null) - paramClasses[i] = Class.forName(params[i], false, loader); - } - return mbean.getMethod(method, paramClasses); - } catch (RuntimeException e) { - throw e; - } catch (Exception e) { - return null; - } - } - - @Override - public Object invoke(String s, Object[] objects, String[] strings) throws MBeanException, ReflectionException { - if (audit) { - Subject subject = Subject.getSubject(AccessController.getContext()); - String caller = "anonymous"; - if (subject != null) { - caller = ""; - for (Principal principal : subject.getPrincipals()) { - caller += principal.getName() + " "; - } - } - - AuditLogEntry entry = new JMXAuditLogEntry(); - entry.setUser(caller); - entry.setTimestamp(System.currentTimeMillis()); - entry.setOperation(this.getMBeanInfo().getClassName() + "." + s); - entry.getParameters().put("arguments", objects); - - auditLog.log(entry); - } - return super.invoke(s, objects, strings); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AsyncAnnotatedMBean$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AsyncAnnotatedMBean$1.class deleted file mode 100644 index c496e7f5a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AsyncAnnotatedMBean$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AsyncAnnotatedMBean.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AsyncAnnotatedMBean.class deleted file mode 100644 index dedc74921..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AsyncAnnotatedMBean.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AsyncAnnotatedMBean.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AsyncAnnotatedMBean.java deleted file mode 100644 index 7460e16c1..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/AsyncAnnotatedMBean.java +++ /dev/null @@ -1,112 +0,0 @@ -/** - * 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.broker.jmx; - -import java.util.concurrent.Callable; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; - -import javax.management.MBeanException; -import javax.management.NotCompliantMBeanException; -import javax.management.ObjectName; -import javax.management.ReflectionException; - -/** - * MBean that invokes the requested operation using an async operation and waits for the result - * if the operation times out then an exception is thrown. - */ -public class AsyncAnnotatedMBean extends AnnotatedMBean { - - private ExecutorService executor; - private long timeout = 0; - - public AsyncAnnotatedMBean(ExecutorService executor, long timeout, T impl, Class mbeanInterface) throws NotCompliantMBeanException { - super(impl, mbeanInterface); - - this.executor = executor; - this.timeout = timeout; - } - - protected AsyncAnnotatedMBean(Class mbeanInterface) throws NotCompliantMBeanException { - super(mbeanInterface); - } - - protected Object asyncInvole(String s, Object[] objects, String[] strings) throws MBeanException, ReflectionException { - return super.invoke(s, objects, strings); - } - - @SuppressWarnings({ "unchecked", "rawtypes" }) - public static void registerMBean(ExecutorService executor, long timeout, ManagementContext context, Object object, ObjectName objectName) throws Exception { - - if (timeout < 0 && executor != null) { - throw new IllegalArgumentException("async timeout cannot be negative."); - } - - if (timeout > 0 && executor == null) { - throw new NullPointerException("timeout given but no ExecutorService instance given."); - } - - String mbeanName = object.getClass().getName() + "MBean"; - - for (Class c : object.getClass().getInterfaces()) { - if (mbeanName.equals(c.getName())) { - if (timeout == 0) { - context.registerMBean(new AnnotatedMBean(object, c), objectName); - } else { - context.registerMBean(new AsyncAnnotatedMBean(executor, timeout, object, c), objectName); - } - return; - } - } - - context.registerMBean(object, objectName); - } - - @Override - public Object invoke(String s, Object[] objects, String[] strings) throws MBeanException, ReflectionException { - - final String action = s; - final Object[] params = objects; - final String[] signature = strings; - - Future task = executor.submit(new Callable() { - - @Override - public Object call() throws Exception { - return asyncInvole(action, params, signature); - } - }); - - try { - return task.get(timeout, TimeUnit.MILLISECONDS); - } catch (ExecutionException e) { - if (e.getCause() instanceof MBeanException) { - throw (MBeanException) e.getCause(); - } - - throw new MBeanException(e); - } catch (Exception e) { - throw new MBeanException(e); - } finally { - if (!task.isDone()) { - task.cancel(true); - } - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/BrokerMBeanSupport.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/BrokerMBeanSupport.class deleted file mode 100644 index bb0a226e9..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/BrokerMBeanSupport.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/BrokerMBeanSupport.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/BrokerMBeanSupport.java deleted file mode 100644 index 3ad4495bc..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/BrokerMBeanSupport.java +++ /dev/null @@ -1,279 +0,0 @@ -/** - * 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.broker.jmx; - -import java.util.Hashtable; - -import javax.management.MalformedObjectNameException; -import javax.management.ObjectName; - -import org.apache.activemq.broker.region.policy.AbortSlowConsumerStrategy; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.command.ProducerInfo; -import org.apache.activemq.transaction.XATransaction; -import org.apache.activemq.util.JMXSupport; - -public class BrokerMBeanSupport { - - // MBean Name Creation - - public static ObjectName createBrokerObjectName(String jmxDomainName, String brokerName) throws MalformedObjectNameException { - String objectNameStr = jmxDomainName + ":type=Broker,brokerName="; - objectNameStr += JMXSupport.encodeObjectNamePart(brokerName); - return new ObjectName(objectNameStr); - } - - public static ObjectName createDestinationName(ObjectName brokerObjectName, ActiveMQDestination destination) throws MalformedObjectNameException { - return createDestinationName(brokerObjectName.toString(), destination); - } - - public static ObjectName createDestinationName(String brokerObjectName, ActiveMQDestination destination) throws MalformedObjectNameException { - String objectNameStr = brokerObjectName; - objectNameStr += createDestinationProperties(destination); - return new ObjectName(objectNameStr); - } - - public static ObjectName createDestinationName(String brokerObjectName, String type, String name) throws MalformedObjectNameException { - String objectNameStr = brokerObjectName; - objectNameStr += createDestinationProperties(type, name); - return new ObjectName(objectNameStr); - } - - private static String createDestinationProperties(ActiveMQDestination destination){ - String result = ""; - if (destination != null){ - result = createDestinationProperties(destination.getDestinationTypeAsString(), destination.getPhysicalName()); - } - return result; - } - - private static String createDestinationProperties(String type, String name){ - return ",destinationType="+ JMXSupport.encodeObjectNamePart(type) + - ",destinationName=" + JMXSupport.encodeObjectNamePart(name); - } - - public static ObjectName createSubscriptionName(ObjectName brokerObjectName, String connectionClientId, ConsumerInfo info) throws MalformedObjectNameException { - return createSubscriptionName(brokerObjectName.toString(), connectionClientId, info); - } - - public static ObjectName createSubscriptionName(String brokerObjectName, String connectionClientId, ConsumerInfo info) throws MalformedObjectNameException { - String objectNameStr = brokerObjectName; - objectNameStr += createDestinationProperties(info.getDestination()) + ",endpoint=Consumer"; - objectNameStr += ",clientId=" + JMXSupport.encodeObjectNamePart(connectionClientId); - objectNameStr += ",consumerId="; - - if (info.isDurable()){ - objectNameStr += "Durable(" + JMXSupport.encodeObjectNamePart(connectionClientId + ":" + info.getSubscriptionName()) +")"; - } else { - objectNameStr += JMXSupport.encodeObjectNamePart(info.getConsumerId().toString()); - } - - return new ObjectName(objectNameStr); - } - - public static ObjectName createProducerName(ObjectName brokerObjectName, String connectionClientId, ProducerInfo info) throws MalformedObjectNameException { - return createProducerName(brokerObjectName.toString(), connectionClientId, info); - } - - public static ObjectName createProducerName(String brokerObjectName, String connectionClientId, ProducerInfo producerInfo) throws MalformedObjectNameException { - String objectNameStr = brokerObjectName; - - if (producerInfo.getDestination() == null) { - objectNameStr += ",endpoint=dynamicProducer"; - } else { - objectNameStr += createDestinationProperties(producerInfo.getDestination()) + ",endpoint=Producer"; - } - - objectNameStr += ",clientId=" + JMXSupport.encodeObjectNamePart(connectionClientId); - objectNameStr += ",producerId=" + JMXSupport.encodeObjectNamePart(producerInfo.getProducerId().toString()); - - return new ObjectName(objectNameStr); - } - - public static ObjectName createXATransactionName(ObjectName brokerObjectName, XATransaction transaction) throws MalformedObjectNameException { - return createXATransactionName(brokerObjectName.toString(), transaction); - } - - public static ObjectName createXATransactionName(String brokerObjectName, XATransaction transaction) throws MalformedObjectNameException { - String objectNameStr = brokerObjectName; - - objectNameStr += "," + "transactionType=RecoveredXaTransaction"; - objectNameStr += "," + "Xid=" + JMXSupport.encodeObjectNamePart(transaction.getTransactionId().toString()); - - return new ObjectName(objectNameStr); - } - - public static ObjectName createPersistenceAdapterName(String brokerObjectName, String name) throws MalformedObjectNameException { - String objectNameStr = brokerObjectName; - - objectNameStr += "," + "Service=PersistenceAdapter"; - objectNameStr += "," + "InstanceName=" + JMXSupport.encodeObjectNamePart(name); - - return new ObjectName(objectNameStr); - } - - public static ObjectName createAbortSlowConsumerStrategyName(ObjectName brokerObjectName, AbortSlowConsumerStrategy strategy) throws MalformedObjectNameException { - return createAbortSlowConsumerStrategyName(brokerObjectName.toString(), strategy); - } - - public static ObjectName createAbortSlowConsumerStrategyName(String brokerObjectName, AbortSlowConsumerStrategy strategy) throws MalformedObjectNameException { - String objectNameStr = brokerObjectName; - objectNameStr += ",Service=SlowConsumerStrategy,InstanceName="+ JMXSupport.encodeObjectNamePart(strategy.getName()); - ObjectName objectName = new ObjectName(objectNameStr); - return objectName; - } - - public static ObjectName createConnectorName(ObjectName brokerObjectName, String type, String name) throws MalformedObjectNameException { - return createConnectorName(brokerObjectName.toString(), type, name); - } - - public static ObjectName createConnectorName(String brokerObjectName, String type, String name) throws MalformedObjectNameException { - String objectNameStr = brokerObjectName; - objectNameStr += ",connector=" + type + ",connectorName="+ JMXSupport.encodeObjectNamePart(name); - ObjectName objectName = new ObjectName(objectNameStr); - return objectName; - } - - public static ObjectName createNetworkConnectorName(ObjectName brokerObjectName, String type, String name) throws MalformedObjectNameException { - return createNetworkConnectorName(brokerObjectName.toString(), type, name); - } - - public static ObjectName createNetworkConnectorName(String brokerObjectName, String type, String name) throws MalformedObjectNameException { - String objectNameStr = brokerObjectName; - objectNameStr += ",connector=" + type + ",networkConnectorName="+ JMXSupport.encodeObjectNamePart(name); - ObjectName objectName = new ObjectName(objectNameStr); - return objectName; - } - - public static ObjectName createConnectionViewByType(ObjectName connectorName, String type, String name) throws MalformedObjectNameException { - String objectNameStr = connectorName.toString(); - objectNameStr += ",connectionViewType=" + JMXSupport.encodeObjectNamePart(type); - objectNameStr += ",connectionName="+ JMXSupport.encodeObjectNamePart(name); - return new ObjectName(objectNameStr); - } - - public static ObjectName createNetworkBridgeObjectName(ObjectName connectorName, String remoteAddress) throws MalformedObjectNameException { - Hashtable map = new Hashtable(connectorName.getKeyPropertyList()); - map.put("networkBridge", JMXSupport.encodeObjectNamePart(remoteAddress)); - return new ObjectName(connectorName.getDomain(), map); - } - - public static ObjectName createProxyConnectorName(ObjectName brokerObjectName, String type, String name) throws MalformedObjectNameException { - return createProxyConnectorName(brokerObjectName.toString(), type, name); - } - - public static ObjectName createProxyConnectorName(String brokerObjectName, String type, String name) throws MalformedObjectNameException { - String objectNameStr = brokerObjectName; - objectNameStr += ",connector=" + type + ",proxyConnectorName="+ JMXSupport.encodeObjectNamePart(name); - ObjectName objectName = new ObjectName(objectNameStr); - return objectName; - } - - public static ObjectName createJmsConnectorName(ObjectName brokerObjectName, String type, String name) throws MalformedObjectNameException { - return createJmsConnectorName(brokerObjectName.toString(), type, name); - } - - public static ObjectName createJmsConnectorName(String brokerObjectName, String type, String name) throws MalformedObjectNameException { - String objectNameStr = brokerObjectName; - objectNameStr += ",connector=" + type + ",JmsConnectors="+ JMXSupport.encodeObjectNamePart(name); - ObjectName objectName = new ObjectName(objectNameStr); - return objectName; - } - - public static ObjectName createJobSchedulerServiceName(ObjectName brokerObjectName) throws MalformedObjectNameException { - return createJobSchedulerServiceName(brokerObjectName.toString()); - } - - public static ObjectName createJobSchedulerServiceName(String brokerObjectName) throws MalformedObjectNameException { - String objectNameStr = brokerObjectName; - objectNameStr += ",service=JobScheduler,name=JMS"; - ObjectName objectName = new ObjectName(objectNameStr); - return objectName; - } - - public static ObjectName createHealthServiceName(ObjectName brokerObjectName) throws MalformedObjectNameException { - return createHealthServiceName(brokerObjectName.toString()); - } - - public static ObjectName createHealthServiceName(String brokerObjectName) throws MalformedObjectNameException { - String objectNameStr = brokerObjectName; - objectNameStr += ",service=Health"; - ObjectName objectName = new ObjectName(objectNameStr); - return objectName; - } - - // MBean Query Creation - - public static ObjectName createConnectionQuery(String jmxDomainName, String brokerName, String name) throws MalformedObjectNameException { - ObjectName brokerMBeanName = createBrokerObjectName(jmxDomainName, brokerName); - return createConnectionQuery(brokerMBeanName.toString(), name); - } - - public static ObjectName createConnectionQuery(String brokerMBeanName, String name) throws MalformedObjectNameException { - return new ObjectName(brokerMBeanName + "," - + "connector=*," + "connectorName=*," + "connectionViewType=*," - + "connectionName=" + JMXSupport.encodeObjectNamePart(name)); - } - - public static ObjectName createQueueQuery(String brokerMBeanName) throws MalformedObjectNameException { - return createConnectionQuery(brokerMBeanName, "*"); - } - - public static ObjectName createQueueQuery(String brokerMBeanName, String destinationName) throws MalformedObjectNameException { - return new ObjectName(brokerMBeanName + "," - + "destinationType=Queue," - + "destinationName=" + JMXSupport.encodeObjectNamePart(destinationName)); - } - - public static ObjectName createTopicQuery(String brokerMBeanName) throws MalformedObjectNameException { - return createConnectionQuery(brokerMBeanName, "*"); - } - - public static ObjectName createTopicQuery(String brokerMBeanName, String destinationName) throws MalformedObjectNameException { - return new ObjectName(brokerMBeanName + "," - + "destinationType=Topic," - + "destinationName=" + JMXSupport.encodeObjectNamePart(destinationName)); - } - - public static ObjectName createConsumerQueury(String jmxDomainName, String clientId) throws MalformedObjectNameException { - return createConsumerQueury(jmxDomainName, null, clientId); - } - - public static ObjectName createConsumerQueury(String jmxDomainName, String brokerName, String clientId) throws MalformedObjectNameException { - return new ObjectName(jmxDomainName + ":type=Broker,brokerName=" - + (brokerName != null ? brokerName : "*") + "," - + "destinationType=*,destinationName=*," - + "endpoint=Consumer," - + "clientId=" + JMXSupport.encodeObjectNamePart(clientId) + "," - + "consumerId=*"); - } - - public static ObjectName createProducerQueury(String jmxDomainName, String clientId) throws MalformedObjectNameException { - return createProducerQueury(jmxDomainName, null, clientId); - } - - public static ObjectName createProducerQueury(String jmxDomainName, String brokerName, String clientId) throws MalformedObjectNameException { - return new ObjectName(jmxDomainName + ":type=Broker,brokerName=" - + (brokerName != null ? brokerName : "*") + "," - + "destinationType=*,destinationName=*," - + "endpoint=Producer," - + "clientId=" + JMXSupport.encodeObjectNamePart(clientId) + "," - + "producerId=*"); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/BrokerView.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/BrokerView.class deleted file mode 100644 index bcf122e01..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/BrokerView.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/BrokerView.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/BrokerView.java deleted file mode 100644 index 91e9609d0..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/BrokerView.java +++ /dev/null @@ -1,562 +0,0 @@ -/** - * 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.broker.jmx; - -import java.io.File; -import java.io.IOException; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URL; -import java.util.HashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.concurrent.atomic.AtomicInteger; - -import javax.management.ObjectName; - -import org.apache.activemq.ActiveMQConnectionMetaData; -import org.apache.activemq.broker.BrokerService; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.TransportConnector; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.command.ActiveMQQueue; -import org.apache.activemq.command.ActiveMQTopic; -import org.apache.activemq.command.ConsumerId; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.command.RemoveSubscriptionInfo; -import org.apache.activemq.network.NetworkConnector; -import org.apache.activemq.util.BrokerSupport; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - */ -public class BrokerView implements BrokerViewMBean { - private static final Logger LOG = LoggerFactory.getLogger(BrokerView.class); - ManagedRegionBroker broker; - private final BrokerService brokerService; - private final AtomicInteger sessionIdCounter = new AtomicInteger(0); - private ObjectName jmsJobScheduler; - - public BrokerView(BrokerService brokerService, ManagedRegionBroker managedBroker) throws Exception { - this.brokerService = brokerService; - this.broker = managedBroker; - } - - public ManagedRegionBroker getBroker() { - return broker; - } - - public void setBroker(ManagedRegionBroker broker) { - this.broker = broker; - } - - @Override - public String getBrokerId() { - return safeGetBroker().getBrokerId().toString(); - } - - @Override - public String getBrokerName() { - return safeGetBroker().getBrokerName(); - } - - @Override - public String getBrokerVersion() { - return ActiveMQConnectionMetaData.PROVIDER_VERSION; - } - - @Override - public String getUptime() { - return brokerService.getUptime(); - } - - @Override - public void gc() throws Exception { - brokerService.getBroker().gc(); - try { - brokerService.getPersistenceAdapter().checkpoint(true); - } catch (IOException e) { - LOG.error("Failed to checkpoint persistence adapter on gc request", e); - } - } - - @Override - public void start() throws Exception { - brokerService.start(); - } - - @Override - public void stop() throws Exception { - brokerService.stop(); - } - - @Override - public void restart() throws Exception { - brokerService.requestRestart(); - brokerService.stop(); - } - - @Override - public void stopGracefully(String connectorName, String queueName, long timeout, long pollInterval) - throws Exception { - brokerService.stopGracefully(connectorName, queueName, timeout, pollInterval); - } - - @Override - public long getTotalEnqueueCount() { - return safeGetBroker().getDestinationStatistics().getEnqueues().getCount(); - } - - @Override - public long getTotalDequeueCount() { - return safeGetBroker().getDestinationStatistics().getDequeues().getCount(); - } - - @Override - public long getTotalConsumerCount() { - return safeGetBroker().getDestinationStatistics().getConsumers().getCount(); - } - - @Override - public long getTotalProducerCount() { - return safeGetBroker().getDestinationStatistics().getProducers().getCount(); - } - - @Override - public long getTotalMessageCount() { - return safeGetBroker().getDestinationStatistics().getMessages().getCount(); - } - - /** - * @return the average size of a message (bytes) - */ - public double getAverageMessageSize() { - return safeGetBroker().getDestinationStatistics().getMessageSize().getAverageSize(); - } - - /** - * @return the max size of a message (bytes) - */ - public long getMaxMessageSize() { - return safeGetBroker().getDestinationStatistics().getMessageSize().getMaxSize(); - } - - /** - * @return the min size of a message (bytes) - */ - public long getMinMessageSize() { - return safeGetBroker().getDestinationStatistics().getMessageSize().getMinSize(); - } - - - public long getTotalMessagesCached() { - return safeGetBroker().getDestinationStatistics().getMessagesCached().getCount(); - } - - @Override - public int getMemoryPercentUsage() { - return brokerService.getSystemUsage().getMemoryUsage().getPercentUsage(); - } - - @Override - public long getMemoryLimit() { - return brokerService.getSystemUsage().getMemoryUsage().getLimit(); - } - - @Override - public void setMemoryLimit(long limit) { - brokerService.getSystemUsage().getMemoryUsage().setLimit(limit); - } - - @Override - public long getStoreLimit() { - return brokerService.getSystemUsage().getStoreUsage().getLimit(); - } - - @Override - public int getStorePercentUsage() { - return brokerService.getSystemUsage().getStoreUsage().getPercentUsage(); - } - - @Override - public long getTempLimit() { - return brokerService.getSystemUsage().getTempUsage().getLimit(); - } - - @Override - public int getTempPercentUsage() { - return brokerService.getSystemUsage().getTempUsage().getPercentUsage(); - } - - @Override - public long getJobSchedulerStoreLimit() { - return brokerService.getSystemUsage().getJobSchedulerUsage().getLimit(); - } - - @Override - public int getJobSchedulerStorePercentUsage() { - return brokerService.getSystemUsage().getJobSchedulerUsage().getPercentUsage(); - } - - @Override - public void setStoreLimit(long limit) { - brokerService.getSystemUsage().getStoreUsage().setLimit(limit); - } - - @Override - public void setTempLimit(long limit) { - brokerService.getSystemUsage().getTempUsage().setLimit(limit); - } - - @Override - public void setJobSchedulerStoreLimit(long limit) { - brokerService.getSystemUsage().getJobSchedulerUsage().setLimit(limit); - } - - @Override - public void resetStatistics() { - safeGetBroker().getDestinationStatistics().reset(); - } - - @Override - public void enableStatistics() { - safeGetBroker().getDestinationStatistics().setEnabled(true); - } - - @Override - public void disableStatistics() { - safeGetBroker().getDestinationStatistics().setEnabled(false); - } - - @Override - public boolean isStatisticsEnabled() { - return safeGetBroker().getDestinationStatistics().isEnabled(); - } - - @Override - public boolean isPersistent() { - return brokerService.isPersistent(); - } - - @Override - public void terminateJVM(int exitCode) { - System.exit(exitCode); - } - - @Override - public ObjectName[] getTopics() { - return safeGetBroker().getTopics(); - } - - @Override - public ObjectName[] getQueues() { - return safeGetBroker().getQueues(); - } - - @Override - public ObjectName[] getTemporaryTopics() { - return safeGetBroker().getTemporaryTopics(); - } - - @Override - public ObjectName[] getTemporaryQueues() { - return safeGetBroker().getTemporaryQueues(); - } - - @Override - public ObjectName[] getTopicSubscribers() { - return safeGetBroker().getTopicSubscribers(); - } - - @Override - public ObjectName[] getDurableTopicSubscribers() { - return safeGetBroker().getDurableTopicSubscribers(); - } - - @Override - public ObjectName[] getQueueSubscribers() { - return safeGetBroker().getQueueSubscribers(); - } - - @Override - public ObjectName[] getTemporaryTopicSubscribers() { - return safeGetBroker().getTemporaryTopicSubscribers(); - } - - @Override - public ObjectName[] getTemporaryQueueSubscribers() { - return safeGetBroker().getTemporaryQueueSubscribers(); - } - - @Override - public ObjectName[] getInactiveDurableTopicSubscribers() { - return safeGetBroker().getInactiveDurableTopicSubscribers(); - } - - @Override - public ObjectName[] getTopicProducers() { - return safeGetBroker().getTopicProducers(); - } - - @Override - public ObjectName[] getQueueProducers() { - return safeGetBroker().getQueueProducers(); - } - - @Override - public ObjectName[] getTemporaryTopicProducers() { - return safeGetBroker().getTemporaryTopicProducers(); - } - - @Override - public ObjectName[] getTemporaryQueueProducers() { - return safeGetBroker().getTemporaryQueueProducers(); - } - - @Override - public ObjectName[] getDynamicDestinationProducers() { - return safeGetBroker().getDynamicDestinationProducers(); - } - - @Override - public String addConnector(String discoveryAddress) throws Exception { - TransportConnector connector = brokerService.addConnector(discoveryAddress); - if (connector == null) { - throw new NoSuchElementException("Not connector matched the given name: " + discoveryAddress); - } - connector.start(); - return connector.getName(); - } - - @Override - public String addNetworkConnector(String discoveryAddress) throws Exception { - NetworkConnector connector = brokerService.addNetworkConnector(discoveryAddress); - if (connector == null) { - throw new NoSuchElementException("Not connector matched the given name: " + discoveryAddress); - } - connector.start(); - return connector.getName(); - } - - @Override - public boolean removeConnector(String connectorName) throws Exception { - TransportConnector connector = brokerService.getConnectorByName(connectorName); - if (connector == null) { - throw new NoSuchElementException("Not connector matched the given name: " + connectorName); - } - connector.stop(); - return brokerService.removeConnector(connector); - } - - @Override - public boolean removeNetworkConnector(String connectorName) throws Exception { - NetworkConnector connector = brokerService.getNetworkConnectorByName(connectorName); - if (connector == null) { - throw new NoSuchElementException("Not connector matched the given name: " + connectorName); - } - connector.stop(); - return brokerService.removeNetworkConnector(connector); - } - - @Override - public void addTopic(String name) throws Exception { - safeGetBroker().getContextBroker().addDestination(BrokerSupport.getConnectionContext(safeGetBroker().getContextBroker()), new ActiveMQTopic(name),true); - } - - @Override - public void addQueue(String name) throws Exception { - safeGetBroker().getContextBroker().addDestination(BrokerSupport.getConnectionContext(safeGetBroker().getContextBroker()), new ActiveMQQueue(name),true); - } - - @Override - public void removeTopic(String name) throws Exception { - safeGetBroker().getContextBroker().removeDestination(BrokerSupport.getConnectionContext(safeGetBroker().getContextBroker()), new ActiveMQTopic(name), 1000); - } - - @Override - public void removeQueue(String name) throws Exception { - safeGetBroker().getContextBroker().removeDestination(BrokerSupport.getConnectionContext(safeGetBroker().getContextBroker()), new ActiveMQQueue(name), 1000); - } - - @Override - public ObjectName createDurableSubscriber(String clientId, String subscriberName, String topicName, - String selector) throws Exception { - ConnectionContext context = new ConnectionContext(); - context.setBroker(safeGetBroker()); - context.setClientId(clientId); - ConsumerInfo info = new ConsumerInfo(); - ConsumerId consumerId = new ConsumerId(); - consumerId.setConnectionId(clientId); - consumerId.setSessionId(sessionIdCounter.incrementAndGet()); - consumerId.setValue(0); - info.setConsumerId(consumerId); - info.setDestination(new ActiveMQTopic(topicName)); - info.setSubscriptionName(subscriberName); - info.setSelector(selector); - Subscription subscription = safeGetBroker().addConsumer(context, info); - safeGetBroker().removeConsumer(context, info); - if (subscription != null) { - return subscription.getObjectName(); - } - return null; - } - - @Override - public void destroyDurableSubscriber(String clientId, String subscriberName) throws Exception { - RemoveSubscriptionInfo info = new RemoveSubscriptionInfo(); - info.setClientId(clientId); - info.setSubscriptionName(subscriberName); - ConnectionContext context = new ConnectionContext(); - context.setBroker(safeGetBroker()); - context.setClientId(clientId); - brokerService.getBroker().removeSubscription(context, info); - } - - // doc comment inherited from BrokerViewMBean - @Override - public void reloadLog4jProperties() throws Throwable { - - // Avoid a direct dependency on log4j.. use reflection. - try { - ClassLoader cl = getClass().getClassLoader(); - Class logManagerClass = cl.loadClass("org.apache.log4j.LogManager"); - - Method resetConfiguration = logManagerClass.getMethod("resetConfiguration", new Class[]{}); - resetConfiguration.invoke(null, new Object[]{}); - - String configurationOptionStr = System.getProperty("log4j.configuration"); - URL log4jprops = null; - if (configurationOptionStr != null) { - try { - log4jprops = new URL(configurationOptionStr); - } catch (MalformedURLException ex) { - log4jprops = cl.getResource("log4j.properties"); - } - } else { - log4jprops = cl.getResource("log4j.properties"); - } - - if (log4jprops != null) { - Class propertyConfiguratorClass = cl.loadClass("org.apache.log4j.PropertyConfigurator"); - Method configure = propertyConfiguratorClass.getMethod("configure", new Class[]{URL.class}); - configure.invoke(null, new Object[]{log4jprops}); - } - } catch (InvocationTargetException e) { - throw e.getTargetException(); - } - } - - @Override - public Map getTransportConnectors() { - Map answer = new HashMap(); - try { - for (TransportConnector connector : brokerService.getTransportConnectors()) { - answer.put(connector.getName(), connector.getConnectUri().toString()); - } - } catch (Exception e) { - LOG.debug("Failed to read URI to build transport connectors map", e); - } - return answer; - } - - @Override - public String getTransportConnectorByType(String type) { - return brokerService.getTransportConnectorURIsAsMap().get(type); - } - - @Override - @Deprecated - /** - * @deprecated use {@link #getTransportConnectors()} or {@link #getTransportConnectorByType(String)} - */ - public String getOpenWireURL() { - String answer = brokerService.getTransportConnectorURIsAsMap().get("tcp"); - return answer != null ? answer : ""; - } - - @Override - @Deprecated - /** - * @deprecated use {@link #getTransportConnectors()} or {@link #getTransportConnectorByType(String)} - */ - public String getStompURL() { - String answer = brokerService.getTransportConnectorURIsAsMap().get("stomp"); - return answer != null ? answer : ""; - } - - @Override - @Deprecated - /** - * @deprecated use {@link #getTransportConnectors()} or {@link #getTransportConnectorByType(String)} - */ - public String getSslURL() { - String answer = brokerService.getTransportConnectorURIsAsMap().get("ssl"); - return answer != null ? answer : ""; - } - - @Override - @Deprecated - /** - * @deprecated use {@link #getTransportConnectors()} or {@link #getTransportConnectorByType(String)} - */ - public String getStompSslURL() { - String answer = brokerService.getTransportConnectorURIsAsMap().get("stomp+ssl"); - return answer != null ? answer : ""; - } - - @Override - public String getVMURL() { - URI answer = brokerService.getVmConnectorURI(); - return answer != null ? answer.toString() : ""; - } - - @Override - public String getDataDirectory() { - File file = brokerService.getDataDirectoryFile(); - try { - return file != null ? file.getCanonicalPath():""; - } catch (IOException e) { - return ""; - } - } - - @Override - public ObjectName getJMSJobScheduler() { - return this.jmsJobScheduler; - } - - public void setJMSJobScheduler(ObjectName name) { - this.jmsJobScheduler=name; - } - - @Override - public boolean isSlave() { - return brokerService.isSlave(); - } - - private ManagedRegionBroker safeGetBroker() { - if (broker == null) { - throw new IllegalStateException("Broker is not yet started."); - } - - return broker; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/BrokerViewMBean.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/BrokerViewMBean.class deleted file mode 100644 index c9a3193e6..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/BrokerViewMBean.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/BrokerViewMBean.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/BrokerViewMBean.java deleted file mode 100644 index c787c5abe..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/BrokerViewMBean.java +++ /dev/null @@ -1,328 +0,0 @@ -/** - * 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.broker.jmx; - -import java.util.Map; - -import javax.management.ObjectName; -import org.apache.activemq.Service; - - -/** - * @author David Martin Clavo david(dot)martin(dot)clavo(at)gmail.com (for the reloadLog4jProperties method) - * - */ -public interface BrokerViewMBean extends Service { - - /** - * @return The unique id of the broker. - */ - @MBeanInfo("The unique id of the broker.") - String getBrokerId(); - - /** - * @return The name of the broker. - */ - @MBeanInfo("The name of the broker.") - String getBrokerName(); - - /** - * @return The name of the broker. - */ - @MBeanInfo("The version of the broker.") - String getBrokerVersion(); - - /** - * @return Uptime of the broker. - */ - @MBeanInfo("Uptime of the broker.") - String getUptime(); - - /** - * The Broker will flush it's caches so that the garbage collector can - * reclaim more memory. - * - * @throws Exception - */ - @MBeanInfo("Runs the Garbage Collector.") - void gc() throws Exception; - - @MBeanInfo("Reset all broker statistics.") - void resetStatistics(); - - @MBeanInfo("Enable broker statistics.") - void enableStatistics(); - - @MBeanInfo("Disable broker statistics.") - void disableStatistics(); - - @MBeanInfo("Broker statistics enabled.") - boolean isStatisticsEnabled(); - - @MBeanInfo("Number of messages that have been sent to the broker.") - long getTotalEnqueueCount(); - - @MBeanInfo("Number of messages that have been acknowledged on the broker.") - long getTotalDequeueCount(); - - @MBeanInfo("Number of message consumers subscribed to destinations on the broker.") - long getTotalConsumerCount(); - - @MBeanInfo("Number of message producers active on destinations on the broker.") - long getTotalProducerCount(); - - @MBeanInfo("Number of unacknowledged messages on the broker.") - long getTotalMessageCount(); - - - @MBeanInfo("Average message size on this broker") - double getAverageMessageSize(); - - @MBeanInfo("Max message size on this broker") - public long getMaxMessageSize(); - - @MBeanInfo("Min message size on this broker") - public long getMinMessageSize(); - - @MBeanInfo("Percent of memory limit used.") - int getMemoryPercentUsage(); - - @MBeanInfo("Memory limit, in bytes, used for holding undelivered messages before paging to temporary storage.") - long getMemoryLimit(); - - void setMemoryLimit(@MBeanInfo("bytes") long limit); - - @MBeanInfo("Percent of store limit used.") - int getStorePercentUsage(); - - @MBeanInfo("Disk limit, in bytes, used for persistent messages before producers are blocked.") - long getStoreLimit(); - - void setStoreLimit(@MBeanInfo("bytes") long limit); - - @MBeanInfo("Percent of temp limit used.") - int getTempPercentUsage(); - - @MBeanInfo("Disk limit, in bytes, used for non-persistent messages and temporary data before producers are blocked.") - long getTempLimit(); - - void setTempLimit(@MBeanInfo("bytes") long limit); - - @MBeanInfo("Percent of job store limit used.") - int getJobSchedulerStorePercentUsage(); - - @MBeanInfo("Disk limit, in bytes, used for scheduled messages before producers are blocked.") - long getJobSchedulerStoreLimit(); - - void setJobSchedulerStoreLimit(@MBeanInfo("bytes") long limit); - - @MBeanInfo("Messages are synchronized to disk.") - boolean isPersistent(); - - @MBeanInfo("Slave broker.") - boolean isSlave(); - - /** - * Shuts down the JVM. - * - * @param exitCode the exit code that will be reported by the JVM process - * when it exits. - */ - @MBeanInfo("Shuts down the JVM.") - void terminateJVM(@MBeanInfo("exitCode") int exitCode); - - /** - * Stop the broker and all it's components. - */ - @MBeanInfo("Stop the broker and all its components.") - void stop() throws Exception; - - /** - * Restart the broker and all it's components. - */ - @MBeanInfo("Restart the broker and all its components.") - void restart() throws Exception; - - @MBeanInfo("Poll for queues matching queueName are empty before stopping") - void stopGracefully(String connectorName, String queueName, long timeout, long pollInterval) throws Exception; - - @MBeanInfo("Topics (broadcasted 'queues'); generally system information.") - ObjectName[] getTopics(); - - @MBeanInfo("Standard Queues containing AIE messages.") - ObjectName[] getQueues(); - - @MBeanInfo("Temporary Topics; generally unused.") - ObjectName[] getTemporaryTopics(); - - @MBeanInfo("Temporary Queues; generally temporary message response holders.") - ObjectName[] getTemporaryQueues(); - - @MBeanInfo("Topic Subscribers") - ObjectName[] getTopicSubscribers(); - - @MBeanInfo("Durable (persistent) topic subscribers") - ObjectName[] getDurableTopicSubscribers(); - - @MBeanInfo("Inactive (disconnected persistent) topic subscribers") - ObjectName[] getInactiveDurableTopicSubscribers(); - - @MBeanInfo("Queue Subscribers.") - ObjectName[] getQueueSubscribers(); - - @MBeanInfo("Temporary Topic Subscribers.") - ObjectName[] getTemporaryTopicSubscribers(); - - @MBeanInfo("Temporary Queue Subscribers.") - ObjectName[] getTemporaryQueueSubscribers(); - - @MBeanInfo("Topic Producers.") - public ObjectName[] getTopicProducers(); - - @MBeanInfo("Queue Producers.") - public ObjectName[] getQueueProducers(); - - @MBeanInfo("Temporary Topic Producers.") - public ObjectName[] getTemporaryTopicProducers(); - - @MBeanInfo("Temporary Queue Producers.") - public ObjectName[] getTemporaryQueueProducers(); - - @MBeanInfo("Dynamic Destination Producers.") - public ObjectName[] getDynamicDestinationProducers(); - - @MBeanInfo("Adds a Connector to the broker.") - String addConnector(@MBeanInfo("discoveryAddress") String discoveryAddress) throws Exception; - - @MBeanInfo("Adds a Network Connector to the broker.") - String addNetworkConnector(@MBeanInfo("discoveryAddress") String discoveryAddress) throws Exception; - - @MBeanInfo("Removes a Connector from the broker.") - boolean removeConnector(@MBeanInfo("connectorName") String connectorName) throws Exception; - - @MBeanInfo("Removes a Network Connector from the broker.") - boolean removeNetworkConnector(@MBeanInfo("connectorName") String connectorName) throws Exception; - - /** - * Adds a Topic destination to the broker. - * - * @param name The name of the Topic - * @throws Exception - */ - @MBeanInfo("Adds a Topic destination to the broker.") - void addTopic(@MBeanInfo("name") String name) throws Exception; - - /** - * Adds a Queue destination to the broker. - * - * @param name The name of the Queue - * @throws Exception - */ - @MBeanInfo("Adds a Queue destination to the broker.") - void addQueue(@MBeanInfo("name") String name) throws Exception; - - /** - * Removes a Topic destination from the broker. - * - * @param name The name of the Topic - * @throws Exception - */ - @MBeanInfo("Removes a Topic destination from the broker.") - void removeTopic(@MBeanInfo("name") String name) throws Exception; - - /** - * Removes a Queue destination from the broker. - * - * @param name The name of the Queue - * @throws Exception - */ - @MBeanInfo("Removes a Queue destination from the broker.") - void removeQueue(@MBeanInfo("name") String name) throws Exception; - - /** - * Creates a new durable topic subscriber - * - * @param clientId the JMS client ID - * @param subscriberName the durable subscriber name - * @param topicName the name of the topic to subscribe to - * @param selector a selector or null - * @return the object name of the MBean registered in JMX - */ - @MBeanInfo(value="Creates a new durable topic subscriber.") - ObjectName createDurableSubscriber(@MBeanInfo("clientId") String clientId, @MBeanInfo("subscriberName") String subscriberName, @MBeanInfo("topicName") String topicName, @MBeanInfo("selector") String selector) throws Exception; - - /** - * Destroys a durable subscriber - * - * @param clientId the JMS client ID - * @param subscriberName the durable subscriber name - */ - @MBeanInfo(value="Destroys a durable subscriber.") - void destroyDurableSubscriber(@MBeanInfo("clientId") String clientId, @MBeanInfo("subscriberName") String subscriberName) throws Exception; - - /** - * Reloads log4j.properties from the classpath. - * This methods calls org.apache.activemq.transport.TransportLoggerControl.reloadLog4jProperties - * @throws Throwable - */ - @MBeanInfo(value="Reloads log4j.properties from the classpath.") - public void reloadLog4jProperties() throws Throwable; - - /** - * @deprecated use {@link #getTransportConnectors()} or {@link #getTransportConnectorByType(String)} - */ - @Deprecated - @MBeanInfo("The url of the openwire connector - deprecated, use getTransportConnectors or getTransportConnectorByType instead") - String getOpenWireURL(); - - /** - * @deprecated use {@link #getTransportConnectors()} or {@link #getTransportConnectorByType(String)} - */ - @Deprecated - @MBeanInfo("The url of the stomp connector - deprecated, use getTransportConnectors or getTransportConnectorByType instead") - String getStompURL(); - - /** - * @deprecated use {@link #getTransportConnectors()} or {@link #getTransportConnectorByType(String)} - */ - @Deprecated - @MBeanInfo("The url of the SSL connector - deprecated, use getTransportConnectors or getTransportConnectorByType instead") - String getSslURL(); - - /** - * @deprecated use {@link #getTransportConnectors()} or {@link #getTransportConnectorByType(String)} - */ - @Deprecated - @MBeanInfo("The url of the Stomp SSL connector - deprecated, use getTransportConnectors or getTransportConnectorByType instead") - String getStompSslURL(); - - @MBeanInfo("The url of the VM connector") - String getVMURL(); - - @MBeanInfo("The map of all defined transport connectors, with transport name as a key") - Map getTransportConnectors(); - - @MBeanInfo("The url of transport connector by it's type; e.g. tcp, stomp, ssl, etc.") - String getTransportConnectorByType(String type); - - @MBeanInfo("The location of the data directory") - public String getDataDirectory(); - - @MBeanInfo("JMSJobScheduler") - ObjectName getJMSJobScheduler(); - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/CompositeDataConstants.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/CompositeDataConstants.class deleted file mode 100644 index cfe111414..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/CompositeDataConstants.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/CompositeDataConstants.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/CompositeDataConstants.java deleted file mode 100644 index 061391078..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/CompositeDataConstants.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * - * 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.broker.jmx; - -/** - * - */ -public interface CompositeDataConstants { - String PROPERTIES = "PropertiesText"; - String JMSXGROUP_SEQ = "JMSXGroupSeq"; - String JMSXGROUP_ID = "JMSXGroupID"; - String JMSXUSER_ID = "JMSXUserID"; - String BROKER_PATH = "BrokerPath"; - String BODY_LENGTH = "BodyLength"; - String BODY_PREVIEW = "BodyPreview"; - String CONTENT_MAP = "ContentMap"; - String MESSAGE_TEXT = "Text"; - String MESSAGE_URL = "Url"; - - String ORIGINAL_DESTINATION = "OriginalDestination"; - - // User properties - String STRING_PROPERTIES = "StringProperties"; - String BOOLEAN_PROPERTIES = "BooleanProperties"; - String BYTE_PROPERTIES = "ByteProperties"; - String SHORT_PROPERTIES = "ShortProperties"; - String INT_PROPERTIES = "IntProperties"; - String LONG_PROPERTIES = "LongProperties"; - String FLOAT_PROPERTIES = "FloatProperties"; - String DOUBLE_PROPERTIES = "DoubleProperties"; -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/CompositeDataHelper.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/CompositeDataHelper.class deleted file mode 100644 index de571827e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/CompositeDataHelper.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/CompositeDataHelper.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/CompositeDataHelper.java deleted file mode 100644 index 73a79177f..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/CompositeDataHelper.java +++ /dev/null @@ -1,73 +0,0 @@ -/** - * - * 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.broker.jmx; - -import javax.management.openmbean.CompositeData; -import javax.management.openmbean.TabularData; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - -/** - * - */ -public class CompositeDataHelper { - - /** - * Extracts the named TabularData field from the CompositeData and converts it to a Map - * which is the method used to get the typesafe user properties. - */ - public static Map getTabularMap(CompositeData cdata, String fieldName) { - Map map = new HashMap(); - appendTabularMap(map, cdata, fieldName); - return map; - } - - public static void appendTabularMap(Map map, CompositeData cdata, String fieldName) { - Object tabularObject = cdata.get(fieldName); - if (tabularObject instanceof TabularData) { - TabularData tabularData = (TabularData) tabularObject; - Collection values = (Collection) tabularData.values(); - for (CompositeData compositeData : values) { - Object key = compositeData.get("key"); - Object value = compositeData.get("value"); - map.put(key, value); - } - } - } - - /** - * Returns a map of all the user properties in the given message {@link javax.management.openmbean.CompositeData} - * object - * - * @param cdata - * @return - */ - public static Map getMessageUserProperties(CompositeData cdata) { - Map map = new HashMap(); - appendTabularMap(map, cdata, CompositeDataConstants.STRING_PROPERTIES); - appendTabularMap(map, cdata, CompositeDataConstants.BOOLEAN_PROPERTIES); - appendTabularMap(map, cdata, CompositeDataConstants.BYTE_PROPERTIES); - appendTabularMap(map, cdata, CompositeDataConstants.SHORT_PROPERTIES); - appendTabularMap(map, cdata, CompositeDataConstants.INT_PROPERTIES); - appendTabularMap(map, cdata, CompositeDataConstants.LONG_PROPERTIES); - appendTabularMap(map, cdata, CompositeDataConstants.FLOAT_PROPERTIES); - appendTabularMap(map, cdata, CompositeDataConstants.DOUBLE_PROPERTIES); - return map; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ConnectionView.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ConnectionView.class deleted file mode 100644 index 1d057470a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ConnectionView.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ConnectionView.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ConnectionView.java deleted file mode 100644 index ba413f373..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ConnectionView.java +++ /dev/null @@ -1,169 +0,0 @@ -/** - * 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.broker.jmx; - -import java.io.IOException; -import java.util.Set; - -import javax.management.ObjectName; - -import org.apache.activemq.broker.Connection; -import org.apache.activemq.util.IOExceptionSupport; - -public class ConnectionView implements ConnectionViewMBean { - - private final Connection connection; - private final ManagementContext managementContext; - private String userName; - - public ConnectionView(Connection connection) { - this(connection, null); - } - - public ConnectionView(Connection connection, ManagementContext managementContext) { - this.connection = connection; - this.managementContext = managementContext; - } - - @Override - public void start() throws Exception { - connection.start(); - } - - @Override - public void stop() throws Exception { - connection.stop(); - } - - /** - * @return true if the Connection is slow - */ - @Override - public boolean isSlow() { - return connection.isSlow(); - } - - /** - * @return if after being marked, the Connection is still writing - */ - @Override - public boolean isBlocked() { - return connection.isBlocked(); - } - - /** - * @return true if the Connection is connected - */ - @Override - public boolean isConnected() { - return connection.isConnected(); - } - - /** - * @return true if the Connection is active - */ - @Override - public boolean isActive() { - return connection.isActive(); - } - - @Override - public int getDispatchQueueSize() { - return connection.getDispatchQueueSize(); - } - - /** - * Resets the statistics - */ - @Override - public void resetStatistics() { - connection.getStatistics().reset(); - } - - @Override - public String getRemoteAddress() { - return connection.getRemoteAddress(); - } - - @Override - public String getClientId() { - return connection.getConnectionId(); - } - - public String getConnectionId() { - return connection.getConnectionId(); - } - - @Override - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName = userName; - } - - @Override - public ObjectName[] getConsumers() { - ObjectName[] result = null; - - if (connection != null && managementContext != null) { - - try { - ObjectName query = createConsumerQueury(connection.getConnectionId()); - Set names = managementContext.queryNames(query, null); - result = names.toArray(new ObjectName[0]); - } catch (Exception e) { - } - } - - return result; - } - - @Override - public ObjectName[] getProducers() { - ObjectName[] result = null; - - if (connection != null && managementContext != null) { - - try { - ObjectName query = createProducerQueury(connection.getConnectionId()); - Set names = managementContext.queryNames(query, null); - result = names.toArray(new ObjectName[0]); - } catch (Exception e) { - } - } - - return result; - } - - private ObjectName createConsumerQueury(String clientId) throws IOException { - try { - return BrokerMBeanSupport.createConsumerQueury(managementContext.getJmxDomainName(), clientId); - } catch (Throwable e) { - throw IOExceptionSupport.create(e); - } - } - - private ObjectName createProducerQueury(String clientId) throws IOException { - try { - return BrokerMBeanSupport.createProducerQueury(managementContext.getJmxDomainName(), clientId); - } catch (Throwable e) { - throw IOExceptionSupport.create(e); - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ConnectionViewMBean.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ConnectionViewMBean.class deleted file mode 100644 index 7cd202fe0..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ConnectionViewMBean.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ConnectionViewMBean.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ConnectionViewMBean.java deleted file mode 100644 index a43542891..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ConnectionViewMBean.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * 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.broker.jmx; - -import javax.management.ObjectName; - -import org.apache.activemq.Service; - -public interface ConnectionViewMBean extends Service { - /** - * @return true if the Connection is slow - */ - @MBeanInfo("Connection is slow.") - boolean isSlow(); - - /** - * @return if after being marked, the Connection is still writing - */ - @MBeanInfo("Connection is blocked.") - boolean isBlocked(); - - /** - * @return true if the Connection is connected - */ - @MBeanInfo("Connection is connected to the broker.") - boolean isConnected(); - - /** - * @return true if the Connection is active - */ - @MBeanInfo("Connection is active (both connected and receiving messages).") - boolean isActive(); - - /** - * Resets the statistics - */ - @MBeanInfo("Resets the statistics") - void resetStatistics(); - - /** - * Returns the source address for this connection - * - * @return the source address for this connection - */ - @MBeanInfo("source address for this connection") - String getRemoteAddress(); - - /** - * Returns the client identifier for this connection - * - * @return the the client identifier for this connection - */ - @MBeanInfo("client id for this connection") - String getClientId(); - - /** - * Returns the number of messages to be dispatched to this connection - * @return the number of messages pending dispatch - */ - @MBeanInfo("The number of messages pending dispatch") - public int getDispatchQueueSize(); - - /** - * Returns the User Name used to authorize creation of this Connection. - * This value can be null if display of user name information is disabled. - * - * @return the name of the user that created this Connection - */ - @MBeanInfo("User Name used to authorize creation of this connection") - String getUserName(); - - /** - * Returns the ObjectNames of all the Consumers created by this Connection. - * - * @return the ObjectNames of all Consumers created by this Connection. - */ - @MBeanInfo("The ObjectNames of all Consumers created by this Connection") - ObjectName[] getConsumers(); - - /** - * Returns the ObjectNames of all the Producers created by this Connection. - * - * @return the ObjectNames of all Producers created by this Connection. - */ - @MBeanInfo("The ObjectNames of all Producers created by this Connection") - ObjectName[] getProducers(); - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ConnectorView.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ConnectorView.class deleted file mode 100644 index b5e33c3bd..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ConnectorView.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ConnectorView.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ConnectorView.java deleted file mode 100644 index 208648b28..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ConnectorView.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * 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.broker.jmx; - -import org.apache.activemq.broker.Connector; -import org.apache.activemq.command.BrokerInfo; - -public class ConnectorView implements ConnectorViewMBean { - - private final Connector connector; - - public ConnectorView(Connector connector) { - this.connector = connector; - } - - public void start() throws Exception { - connector.start(); - } - - public String getBrokerName() { - return getBrokerInfo().getBrokerName(); - } - - public void stop() throws Exception { - connector.stop(); - } - - public String getBrokerURL() { - return getBrokerInfo().getBrokerURL(); - } - - public BrokerInfo getBrokerInfo() { - return connector.getBrokerInfo(); - } - - /** - * Resets the statistics - */ - public void resetStatistics() { - connector.getStatistics().reset(); - } - - /** - * enable statistics gathering - */ - public void enableStatistics() { - connector.getStatistics().setEnabled(true); - } - - /** - * disable statistics gathering - */ - public void disableStatistics() { - connector.getStatistics().setEnabled(false); - } - - /** - * Returns true if statistics is enabled - * - * @return true if statistics is enabled - */ - public boolean isStatisticsEnabled() { - return connector.getStatistics().isEnabled(); - } - - /** - * Returns the number of current connections - */ - public int connectionCount() { - return connector.connectionCount(); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ConnectorViewMBean.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ConnectorViewMBean.class deleted file mode 100644 index 2b2206d42..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ConnectorViewMBean.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ConnectorViewMBean.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ConnectorViewMBean.java deleted file mode 100644 index 0a6a9f2d9..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ConnectorViewMBean.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * 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.broker.jmx; - -import org.apache.activemq.Service; - -public interface ConnectorViewMBean extends Service { - - @MBeanInfo("Connection count") - int connectionCount(); - - /** - * Resets the statistics - */ - @MBeanInfo("Resets the statistics") - void resetStatistics(); - - /** - * enable statistics gathering - */ - @MBeanInfo("Enables statistics gathering") - void enableStatistics(); - - /** - * disable statistics gathering - */ - @MBeanInfo("Disables statistics gathering") - void disableStatistics(); - - /** - * Returns true if statistics is enabled - * - * @return true if statistics is enabled - */ - @MBeanInfo("Statistics gathering enabled") - boolean isStatisticsEnabled(); - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/DestinationView.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/DestinationView.class deleted file mode 100644 index a5d7f2650..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/DestinationView.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/DestinationView.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/DestinationView.java deleted file mode 100644 index 3f6294333..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/DestinationView.java +++ /dev/null @@ -1,539 +0,0 @@ -/** - * 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.broker.jmx; - -import java.io.IOException; -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.jms.Connection; -import javax.jms.InvalidSelectorException; -import javax.jms.MessageProducer; -import javax.jms.Session; -import javax.management.MalformedObjectNameException; -import javax.management.ObjectName; -import javax.management.openmbean.CompositeData; -import javax.management.openmbean.CompositeDataSupport; -import javax.management.openmbean.CompositeType; -import javax.management.openmbean.OpenDataException; -import javax.management.openmbean.TabularData; -import javax.management.openmbean.TabularDataSupport; -import javax.management.openmbean.TabularType; -import org.apache.activemq.ActiveMQConnectionFactory; -import org.apache.activemq.broker.jmx.OpenTypeSupport.OpenTypeFactory; -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.broker.region.policy.AbortSlowConsumerStrategy; -import org.apache.activemq.broker.region.policy.SlowConsumerStrategy; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ActiveMQMessage; -import org.apache.activemq.command.ActiveMQTextMessage; -import org.apache.activemq.command.Message; -import org.apache.activemq.filter.BooleanExpression; -import org.apache.activemq.filter.MessageEvaluationContext; -import org.apache.activemq.selector.SelectorParser; -import org.apache.activemq.util.URISupport; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class DestinationView implements DestinationViewMBean { - private static final Logger LOG = LoggerFactory.getLogger(DestinationViewMBean.class); - protected final Destination destination; - protected final ManagedRegionBroker broker; - - public DestinationView(ManagedRegionBroker broker, Destination destination) { - this.broker = broker; - this.destination = destination; - } - - public void gc() { - destination.gc(); - } - - @Override - public String getName() { - return destination.getName(); - } - - @Override - public void resetStatistics() { - destination.getDestinationStatistics().reset(); - } - - @Override - public long getEnqueueCount() { - return destination.getDestinationStatistics().getEnqueues().getCount(); - } - - @Override - public long getDequeueCount() { - return destination.getDestinationStatistics().getDequeues().getCount(); - } - - @Override - public long getDispatchCount() { - return destination.getDestinationStatistics().getDispatched().getCount(); - } - - @Override - public long getInFlightCount() { - return destination.getDestinationStatistics().getInflight().getCount(); - } - - @Override - public long getExpiredCount() { - return destination.getDestinationStatistics().getExpired().getCount(); - } - - @Override - public long getConsumerCount() { - return destination.getDestinationStatistics().getConsumers().getCount(); - } - - @Override - public long getQueueSize() { - return destination.getDestinationStatistics().getMessages().getCount(); - } - - public long getMessagesCached() { - return destination.getDestinationStatistics().getMessagesCached().getCount(); - } - - @Override - public int getMemoryPercentUsage() { - return destination.getMemoryUsage().getPercentUsage(); - } - - @Override - public long getMemoryUsageByteCount() { - return destination.getMemoryUsage().getUsage(); - } - - @Override - public long getMemoryLimit() { - return destination.getMemoryUsage().getLimit(); - } - - @Override - public void setMemoryLimit(long limit) { - destination.getMemoryUsage().setLimit(limit); - } - - @Override - public double getAverageEnqueueTime() { - return destination.getDestinationStatistics().getProcessTime().getAverageTime(); - } - - @Override - public long getMaxEnqueueTime() { - return destination.getDestinationStatistics().getProcessTime().getMaxTime(); - } - - @Override - public long getMinEnqueueTime() { - return destination.getDestinationStatistics().getProcessTime().getMinTime(); - } - - /** - * @return the average size of a message (bytes) - */ - public double getAverageMessageSize() { - return destination.getDestinationStatistics().getMessageSize().getAverageSize(); - } - - /** - * @return the max size of a message (bytes) - */ - public long getMaxMessageSize() { - return destination.getDestinationStatistics().getMessageSize().getMaxSize(); - } - - /** - * @return the min size of a message (bytes) - */ - public long getMinMessageSize() { - return destination.getDestinationStatistics().getMessageSize().getMinSize(); - } - - - @Override - public boolean isPrioritizedMessages() { - return destination.isPrioritizedMessages(); - } - - @Override - public CompositeData[] browse() throws OpenDataException { - try { - return browse(null); - } catch (InvalidSelectorException e) { - // should not happen. - throw new RuntimeException(e); - } - } - - @Override - public CompositeData[] browse(String selector) throws OpenDataException, InvalidSelectorException { - Message[] messages = destination.browse(); - ArrayList c = new ArrayList(); - - MessageEvaluationContext ctx = new MessageEvaluationContext(); - ctx.setDestination(destination.getActiveMQDestination()); - BooleanExpression selectorExpression = selector == null ? null : SelectorParser.parse(selector); - - for (int i = 0; i < messages.length; i++) { - try { - - if (selectorExpression == null) { - c.add(OpenTypeSupport.convert(messages[i])); - } else { - ctx.setMessageReference(messages[i]); - if (selectorExpression.matches(ctx)) { - c.add(OpenTypeSupport.convert(messages[i])); - } - } - - } catch (Throwable e) { - // TODO DELETE ME - System.out.println(e); - e.printStackTrace(); - // TODO DELETE ME - LOG.warn("exception browsing destination", e); - } - } - - CompositeData rc[] = new CompositeData[c.size()]; - c.toArray(rc); - return rc; - } - - /** - * Browses the current destination returning a list of messages - */ - @Override - public List browseMessages() throws InvalidSelectorException { - return browseMessages(null); - } - - /** - * Browses the current destination with the given selector returning a list - * of messages - */ - @Override - public List browseMessages(String selector) throws InvalidSelectorException { - Message[] messages = destination.browse(); - ArrayList answer = new ArrayList(); - - MessageEvaluationContext ctx = new MessageEvaluationContext(); - ctx.setDestination(destination.getActiveMQDestination()); - BooleanExpression selectorExpression = selector == null ? null : SelectorParser.parse(selector); - - for (int i = 0; i < messages.length; i++) { - try { - Message message = messages[i]; - message.setReadOnlyBody(true); - if (selectorExpression == null) { - answer.add(message); - } else { - ctx.setMessageReference(message); - if (selectorExpression.matches(ctx)) { - answer.add(message); - } - } - - } catch (Throwable e) { - LOG.warn("exception browsing destination", e); - } - } - return answer; - } - - @Override - public TabularData browseAsTable() throws OpenDataException { - try { - return browseAsTable(null); - } catch (InvalidSelectorException e) { - throw new RuntimeException(e); - } - } - - @Override - public TabularData browseAsTable(String selector) throws OpenDataException, InvalidSelectorException { - OpenTypeFactory factory = OpenTypeSupport.getFactory(ActiveMQMessage.class); - Message[] messages = destination.browse(); - CompositeType ct = factory.getCompositeType(); - TabularType tt = new TabularType("MessageList", "MessageList", ct, new String[] { "JMSMessageID" }); - TabularDataSupport rc = new TabularDataSupport(tt); - - MessageEvaluationContext ctx = new MessageEvaluationContext(); - ctx.setDestination(destination.getActiveMQDestination()); - BooleanExpression selectorExpression = selector == null ? null : SelectorParser.parse(selector); - - for (int i = 0; i < messages.length; i++) { - try { - if (selectorExpression == null) { - rc.put(new CompositeDataSupport(ct, factory.getFields(messages[i]))); - } else { - ctx.setMessageReference(messages[i]); - if (selectorExpression.matches(ctx)) { - rc.put(new CompositeDataSupport(ct, factory.getFields(messages[i]))); - } - } - } catch (Throwable e) { - LOG.warn("exception browsing destination", e); - } - } - - return rc; - } - - @Override - public String sendTextMessageWithProperties(String properties) throws Exception { - String[] kvs = properties.split(","); - Map props = new HashMap(); - for (String kv : kvs) { - String[] it = kv.split("="); - if (it.length == 2) { - props.put(it[0],it[1]); - } - } - return sendTextMessage(props, props.remove("body"), props.remove("username"), props.remove("password")); - } - - @Override - public String sendTextMessage(String body) throws Exception { - return sendTextMessage(Collections.EMPTY_MAP, body); - } - - @Override - public String sendTextMessage(Map headers, String body) throws Exception { - return sendTextMessage(headers, body, null, null); - } - - @Override - public String sendTextMessage(String body, String user, String password) throws Exception { - return sendTextMessage(Collections.EMPTY_MAP, body, user, password); - } - - @Override - public String sendTextMessage(Map headers, String body, String userName, String password) throws Exception { - - String brokerUrl = "vm://" + broker.getBrokerName(); - ActiveMQDestination dest = destination.getActiveMQDestination(); - - ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory(brokerUrl); - Connection connection = null; - try { - - connection = cf.createConnection(userName, password); - Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - MessageProducer producer = session.createProducer(dest); - ActiveMQTextMessage msg = (ActiveMQTextMessage) session.createTextMessage(body); - - for (Iterator iter = headers.entrySet().iterator(); iter.hasNext();) { - Map.Entry entry = (Map.Entry) iter.next(); - msg.setObjectProperty((String) entry.getKey(), entry.getValue()); - } - - producer.setDeliveryMode(msg.getJMSDeliveryMode()); - producer.setPriority(msg.getPriority()); - long ttl = 0; - if (msg.getExpiration() != 0) { - ttl = msg.getExpiration() - System.currentTimeMillis(); - } else { - String timeToLive = headers.get("timeToLive"); - if (timeToLive != null) { - ttl = Integer.valueOf(timeToLive); - } - } - producer.setTimeToLive(ttl > 0 ? ttl : 0); - producer.send(msg); - - return msg.getJMSMessageID(); - - } finally { - connection.close(); - } - - } - - @Override - public int getMaxAuditDepth() { - return destination.getMaxAuditDepth(); - } - - @Override - public int getMaxProducersToAudit() { - return destination.getMaxProducersToAudit(); - } - - public boolean isEnableAudit() { - return destination.isEnableAudit(); - } - - public void setEnableAudit(boolean enableAudit) { - destination.setEnableAudit(enableAudit); - } - - @Override - public void setMaxAuditDepth(int maxAuditDepth) { - destination.setMaxAuditDepth(maxAuditDepth); - } - - @Override - public void setMaxProducersToAudit(int maxProducersToAudit) { - destination.setMaxProducersToAudit(maxProducersToAudit); - } - - @Override - public float getMemoryUsagePortion() { - return destination.getMemoryUsage().getUsagePortion(); - } - - @Override - public long getProducerCount() { - return destination.getDestinationStatistics().getProducers().getCount(); - } - - @Override - public boolean isProducerFlowControl() { - return destination.isProducerFlowControl(); - } - - @Override - public void setMemoryUsagePortion(float value) { - destination.getMemoryUsage().setUsagePortion(value); - } - - @Override - public void setProducerFlowControl(boolean producerFlowControl) { - destination.setProducerFlowControl(producerFlowControl); - } - - @Override - public boolean isAlwaysRetroactive() { - return destination.isAlwaysRetroactive(); - } - - @Override - public void setAlwaysRetroactive(boolean alwaysRetroactive) { - destination.setAlwaysRetroactive(alwaysRetroactive); - } - - /** - * Set's the interval at which warnings about producers being blocked by - * resource usage will be triggered. Values of 0 or less will disable - * warnings - * - * @param blockedProducerWarningInterval the interval at which warning about - * blocked producers will be triggered. - */ - @Override - public void setBlockedProducerWarningInterval(long blockedProducerWarningInterval) { - destination.setBlockedProducerWarningInterval(blockedProducerWarningInterval); - } - - /** - * - * @return the interval at which warning about blocked producers will be - * triggered. - */ - @Override - public long getBlockedProducerWarningInterval() { - return destination.getBlockedProducerWarningInterval(); - } - - @Override - public int getMaxPageSize() { - return destination.getMaxPageSize(); - } - - @Override - public void setMaxPageSize(int pageSize) { - destination.setMaxPageSize(pageSize); - } - - @Override - public boolean isUseCache() { - return destination.isUseCache(); - } - - @Override - public void setUseCache(boolean value) { - destination.setUseCache(value); - } - - @Override - public ObjectName[] getSubscriptions() throws IOException, MalformedObjectNameException { - List subscriptions = destination.getConsumers(); - ObjectName[] answer = new ObjectName[subscriptions.size()]; - ObjectName brokerObjectName = broker.getBrokerService().getBrokerObjectName(); - int index = 0; - for (Subscription subscription : subscriptions) { - String connectionClientId = subscription.getContext().getClientId(); - answer[index++] = BrokerMBeanSupport.createSubscriptionName(brokerObjectName, connectionClientId, subscription.getConsumerInfo()); - } - return answer; - } - - @Override - public ObjectName getSlowConsumerStrategy() throws IOException, MalformedObjectNameException { - ObjectName result = null; - SlowConsumerStrategy strategy = destination.getSlowConsumerStrategy(); - if (strategy != null && strategy instanceof AbortSlowConsumerStrategy) { - result = broker.registerSlowConsumerStrategy((AbortSlowConsumerStrategy)strategy); - } - return result; - } - - @Override - public String getOptions() { - Map options = destination.getActiveMQDestination().getOptions(); - String optionsString = ""; - try { - if (options != null) { - optionsString = URISupport.createQueryString(options); - } - } catch (URISyntaxException ignored) {} - return optionsString; - } - - @Override - public boolean isDLQ() { - return destination.isDLQ(); - } - - @Override - public long getBlockedSends() { - return destination.getDestinationStatistics().getBlockedSends().getCount(); - } - - @Override - public double getAverageBlockedTime() { - return destination.getDestinationStatistics().getBlockedTime().getAverageTime(); - } - - @Override - public long getTotalBlockedTime() { - return destination.getDestinationStatistics().getBlockedTime().getTotalTime(); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/DestinationViewMBean.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/DestinationViewMBean.class deleted file mode 100644 index 5d580b20d..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/DestinationViewMBean.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/DestinationViewMBean.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/DestinationViewMBean.java deleted file mode 100644 index f83d47ebc..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/DestinationViewMBean.java +++ /dev/null @@ -1,401 +0,0 @@ -/** - * 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.broker.jmx; - -import java.io.IOException; -import java.util.List; -import java.util.Map; - -import javax.jms.InvalidSelectorException; -import javax.management.MalformedObjectNameException; -import javax.management.ObjectName; -import javax.management.openmbean.CompositeData; -import javax.management.openmbean.OpenDataException; -import javax.management.openmbean.TabularData; - -public interface DestinationViewMBean { - - /** - * Returns the name of this destination - */ - @MBeanInfo("Name of this destination.") - String getName(); - - /** - * Resets the managment counters. - */ - @MBeanInfo("Resets statistics.") - void resetStatistics(); - - /** - * Returns the number of messages that have been sent to the destination. - * - * @return The number of messages that have been sent to the destination. - */ - @MBeanInfo("Number of messages that have been sent to the destination.") - long getEnqueueCount(); - - /** - * Returns the number of messages that have been delivered (potentially not - * acknowledged) to consumers. - * - * @return The number of messages that have been delivered (potentially not - * acknowledged) to consumers. - */ - @MBeanInfo("Number of messages that have been delivered (but potentially not acknowledged) to consumers.") - long getDispatchCount(); - - /** - * Returns the number of messages that have been acknowledged from the - * destination. - * - * @return The number of messages that have been acknowledged from the - * destination. - */ - @MBeanInfo("Number of messages that have been acknowledged (and removed from) from the destination.") - long getDequeueCount(); - - /** - * Returns the number of messages that have been dispatched but not - * acknowledged - * - * @return The number of messages that have been dispatched but not - * acknowledged - */ - @MBeanInfo("Number of messages that have been dispatched to, but not acknowledged by, consumers.") - long getInFlightCount(); - - /** - * Returns the number of messages that have expired - * - * @return The number of messages that have expired - */ - @MBeanInfo("Number of messages that have been expired.") - long getExpiredCount(); - - /** - * Returns the number of consumers subscribed this destination. - * - * @return The number of consumers subscribed this destination. - */ - @MBeanInfo("Number of consumers subscribed to this destination.") - long getConsumerCount(); - - /** - * @return the number of producers publishing to the destination - */ - @MBeanInfo("Number of producers publishing to this destination") - long getProducerCount(); - - /** - * Returns the number of messages in this destination which are yet to be - * consumed - * - * @return Returns the number of messages in this destination which are yet - * to be consumed - */ - @MBeanInfo("Number of messages in the destination which are yet to be consumed. Potentially dispatched but unacknowledged.") - long getQueueSize(); - - /** - * @return An array of all the messages in the destination's queue. - */ - @MBeanInfo("An array of all messages in the destination. Not HTML friendly.") - CompositeData[] browse() throws OpenDataException; - - /** - * @return A list of all the messages in the destination's queue. - */ - @MBeanInfo("A list of all messages in the destination. Not HTML friendly.") - TabularData browseAsTable() throws OpenDataException; - - /** - * @return An array of all the messages in the destination's queue. - * @throws InvalidSelectorException - */ - @MBeanInfo("An array of all messages in the destination based on an SQL-92 selection on the message headers or XPATH on the body. Not HTML friendly.") - CompositeData[] browse(@MBeanInfo("selector") String selector) throws OpenDataException, InvalidSelectorException; - - /** - * @return A list of all the messages in the destination's queue. - * @throws InvalidSelectorException - */ - @MBeanInfo("A list of all messages in the destination based on an SQL-92 selection on the message headers or XPATH on the body. Not HTML friendly.") - TabularData browseAsTable(@MBeanInfo("selector") String selector) throws OpenDataException, InvalidSelectorException; - - /** - * Sends a TextMesage to the destination. - * - * @param body the text to send - * @return the message id of the message sent. - * @throws Exception - */ - @MBeanInfo("Sends a TextMessage to the destination.") - String sendTextMessage(@MBeanInfo("body") String body) throws Exception; - - /** - * Sends a TextMessage to the destination. - * - * @param properties the message properties to set as a comma sep name=value list. Can only - * contain Strings maped to primitive types or JMS properties. eg: body=hi,JMSReplyTo=Queue2 - * @return the message id of the message sent. - * @throws Exception - */ - @MBeanInfo("Sends a TextMessage to the destination.") - public String sendTextMessageWithProperties(String properties) throws Exception; - - /** - * Sends a TextMesage to the destination. - * - * @param headers the message headers and properties to set. Can only - * container Strings maped to primitive types. - * @param body the text to send - * @return the message id of the message sent. - * @throws Exception - */ - @MBeanInfo("Sends a TextMessage to the destination.") - String sendTextMessage(@MBeanInfo("headers") Map headers, @MBeanInfo("body") String body) throws Exception; - - /** - * Sends a TextMesage to the destination. - * @param body the text to send - * @param user - * @param password - * @return - * @throws Exception - */ - @MBeanInfo("Sends a TextMessage to a password-protected destination.") - String sendTextMessage(@MBeanInfo("body") String body, @MBeanInfo("user") String user, @MBeanInfo("password") String password) throws Exception; - - /** - * - * @param headers the message headers and properties to set. Can only - * container Strings maped to primitive types. - * @param body the text to send - * @param user - * @param password - * @return - * @throws Exception - */ - @MBeanInfo("Sends a TextMessage to a password-protected destination.") - String sendTextMessage(@MBeanInfo("headers") Map headers, @MBeanInfo("body") String body, @MBeanInfo("user") String user, @MBeanInfo("password") String password) throws Exception; - /** - * @return the percentage of amount of memory used - */ - @MBeanInfo("The percentage of the memory limit used") - int getMemoryPercentUsage(); - - /** - * @return the amount of memory currently used by this destination - */ - @MBeanInfo("Memory usage, in bytes, used by undelivered messages") - long getMemoryUsageByteCount(); - - /** - * @return the amount of memory allocated to this destination - */ - @MBeanInfo("Memory limit, in bytes, used for holding undelivered messages before paging to temporary storage.") - long getMemoryLimit(); - - /** - * set the amount of memory allocated to this destination - * @param limit - */ - void setMemoryLimit(long limit); - - /** - * @return the portion of memory from the broker memory limit for this destination - */ - @MBeanInfo("Portion of memory from the broker memory limit for this destination") - float getMemoryUsagePortion(); - - /** - * set the portion of memory from the broker memory limit for this destination - * @param value - */ - void setMemoryUsagePortion(@MBeanInfo("bytes") float value); - - /** - * Browses the current destination returning a list of messages - */ - @MBeanInfo("A list of all messages in the destination. Not HTML friendly.") - List browseMessages() throws InvalidSelectorException; - - /** - * Browses the current destination with the given selector returning a list - * of messages - */ - @MBeanInfo("A list of all messages in the destination based on an SQL-92 selection on the message headers or XPATH on the body. Not HTML friendly.") - List browseMessages(String selector) throws InvalidSelectorException; - - /** - * @return longest time a message is held by a destination - */ - @MBeanInfo("The longest time a message has been held this destination.") - long getMaxEnqueueTime(); - - /** - * @return shortest time a message is held by a destination - */ - @MBeanInfo("The shortest time a message has been held this destination.") - long getMinEnqueueTime(); - - - @MBeanInfo("Average time a message has been held this destination.") - double getAverageEnqueueTime(); - - @MBeanInfo("Average message size on this destination") - double getAverageMessageSize(); - - @MBeanInfo("Max message size on this destination") - public long getMaxMessageSize(); - - @MBeanInfo("Min message size on this destination") - public long getMinMessageSize(); - - /** - * @return the producerFlowControl - */ - @MBeanInfo("Producers are flow controlled") - boolean isProducerFlowControl(); - - /** - * @param producerFlowControl the producerFlowControl to set - */ - public void setProducerFlowControl(@MBeanInfo("producerFlowControl") boolean producerFlowControl); - - /** - * @return if we treat consumers as alwaysRetroactive - */ - @MBeanInfo("Always treat consumers as retroActive") - boolean isAlwaysRetroactive(); - - /** - * @param alwaysRetroactive set as always retroActive - */ - public void setAlwaysRetroactive(@MBeanInfo("alwaysRetroactive") boolean alwaysRetroactive); - - /** - * Set's the interval at which warnings about producers being blocked by - * resource usage will be triggered. Values of 0 or less will disable - * warnings - * - * @param blockedProducerWarningInterval the interval at which warning about - * blocked producers will be triggered. - */ - public void setBlockedProducerWarningInterval(@MBeanInfo("blockedProducerWarningInterval") long blockedProducerWarningInterval); - - /** - * - * @return the interval at which warning about blocked producers will be - * triggered. - */ - @MBeanInfo("Blocked Producer Warning Interval") - public long getBlockedProducerWarningInterval(); - - /** - * @return the maxProducersToAudit - */ - @MBeanInfo("Maximum number of producers to audit") - public int getMaxProducersToAudit(); - - /** - * @param maxProducersToAudit the maxProducersToAudit to set - */ - public void setMaxProducersToAudit(@MBeanInfo("maxProducersToAudit") int maxProducersToAudit); - - /** - * @return the maxAuditDepth - */ - @MBeanInfo("Max audit depth") - public int getMaxAuditDepth(); - - /** - * @param maxAuditDepth the maxAuditDepth to set - */ - public void setMaxAuditDepth(@MBeanInfo("maxAuditDepth") int maxAuditDepth); - - /** - * @return the maximum number of message to be paged into the - * destination - */ - @MBeanInfo("Maximum number of messages to be paged in") - public int getMaxPageSize(); - - /** - * @param pageSize - * Set the maximum number of messages to page into the destination - */ - public void setMaxPageSize(@MBeanInfo("pageSize") int pageSize); - - /** - * @return true if caching is allowed of for the destination - */ - @MBeanInfo("Caching is allowed") - public boolean isUseCache(); - - /** - * @return true if prioritized messages are enabled for the destination - */ - @MBeanInfo("Prioritized messages is enabled") - public boolean isPrioritizedMessages(); - - /** - * @param value - * enable/disable caching on the destination - */ - public void setUseCache(@MBeanInfo("cache") boolean value); - - /** - * Returns all the current subscription MBeans matching this destination - * - * @return the names of the subscriptions for this destination - */ - @MBeanInfo("returns all the current subscription MBeans matching this destination") - ObjectName[] getSubscriptions() throws IOException, MalformedObjectNameException; - - - /** - * Returns the slow consumer strategy MBean for this destination - * - * @return the name of the slow consumer handler MBean for this destination - */ - @MBeanInfo("returns the optional slowConsumer handler MBeans for this destination") - ObjectName getSlowConsumerStrategy() throws IOException, MalformedObjectNameException; - - /** - * @return A string of destination options, name value pairs as URL queryString. - */ - @MBeanInfo("returns the destination options, name value pairs as URL queryString") - String getOptions(); - - /** - * @return true if this is dead letter queue - */ - @MBeanInfo("Dead Letter Queue") - boolean isDLQ(); - - @MBeanInfo("Get number of messages blocked for Flow Control") - long getBlockedSends(); - - @MBeanInfo("get the average time (ms) a message is blocked for Flow Control") - double getAverageBlockedTime(); - - @MBeanInfo("Get the total time (ms) messages are blocked for Flow Control") - long getTotalBlockedTime(); - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/DurableSubscriptionView.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/DurableSubscriptionView.class deleted file mode 100644 index 5a25e75b5..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/DurableSubscriptionView.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/DurableSubscriptionView.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/DurableSubscriptionView.java deleted file mode 100644 index 77ec8c2c5..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/DurableSubscriptionView.java +++ /dev/null @@ -1,155 +0,0 @@ -/** - * 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.broker.jmx; - -import javax.management.openmbean.CompositeData; -import javax.management.openmbean.OpenDataException; -import javax.management.openmbean.TabularData; - -import org.apache.activemq.broker.BrokerService; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.region.DurableTopicSubscription; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.command.RemoveSubscriptionInfo; - -/** - * - */ -public class DurableSubscriptionView extends SubscriptionView implements DurableSubscriptionViewMBean { - - protected ManagedRegionBroker broker; - protected BrokerService brokerService; - protected String subscriptionName; - protected DurableTopicSubscription durableSub; - - /** - * Constructor - * - * @param clientId - * @param sub - */ - public DurableSubscriptionView(ManagedRegionBroker broker, BrokerService brokerService, String clientId, String userName, Subscription sub) { - super(clientId, userName, sub); - this.broker = broker; - this.brokerService = brokerService; - this.durableSub=(DurableTopicSubscription) sub; - if (sub != null) { - this.subscriptionName = sub.getConsumerInfo().getSubscriptionName(); - } - } - - /** - * @return name of the durable consumer - */ - public String getSubscriptionName() { - return subscriptionName; - } - - /** - * Browse messages for this durable subscriber - * - * @return messages - * @throws OpenDataException - */ - public CompositeData[] browse() throws OpenDataException { - return broker.browse(this); - } - - /** - * Browse messages for this durable subscriber - * - * @return messages - * @throws OpenDataException - */ - public TabularData browseAsTable() throws OpenDataException { - return broker.browseAsTable(this); - } - - /** - * Destroys the durable subscription so that messages will no longer be - * stored for this subscription - */ - public void destroy() throws Exception { - RemoveSubscriptionInfo info = new RemoveSubscriptionInfo(); - info.setClientId(clientId); - info.setSubscriptionName(subscriptionName); - ConnectionContext context = new ConnectionContext(); - context.setBroker(broker); - context.setClientId(clientId); - brokerService.getBroker().removeSubscription(context, info); - } - - public String toString() { - return "ActiveDurableSubscriptionView: " + getClientId() + ":" + getSubscriptionName(); - } - - - public int cursorSize() { - if (durableSub != null && durableSub.getPending() != null) { - return durableSub.getPending().size(); - } - return 0; - } - - - public boolean doesCursorHaveMessagesBuffered() { - if (durableSub != null && durableSub.getPending() != null) { - return durableSub.getPending().hasMessagesBufferedToDeliver(); - } - return false; - } - - - public boolean doesCursorHaveSpace() { - if (durableSub != null && durableSub.getPending() != null) { - return durableSub.getPending().hasSpace(); - } - return false; - } - - /* (non-Javadoc) - * @see org.apache.activemq.broker.jmx.DurableSubscriptionViewMBean#getCursorMemoryUsage() - */ - public long getCursorMemoryUsage() { - if (durableSub != null && durableSub.getPending() != null && durableSub.getPending().getSystemUsage()!=null) { - return durableSub.getPending().getSystemUsage().getMemoryUsage().getUsage(); - } - return 0; - } - - - public int getCursorPercentUsage() { - if (durableSub != null && durableSub.getPending() != null && durableSub.getPending().getSystemUsage()!=null) { - return durableSub.getPending().getSystemUsage().getMemoryUsage().getPercentUsage(); - } - return 0; - } - - public boolean isCursorFull() { - if (durableSub != null && durableSub.getPending() != null) { - return durableSub.getPending().isFull(); - } - return false; - } - - @Override - public boolean isActive() { - return durableSub.isActive(); - } - - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/DurableSubscriptionViewMBean.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/DurableSubscriptionViewMBean.class deleted file mode 100644 index 29e3ea087..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/DurableSubscriptionViewMBean.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/DurableSubscriptionViewMBean.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/DurableSubscriptionViewMBean.java deleted file mode 100644 index df0841b68..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/DurableSubscriptionViewMBean.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * 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.broker.jmx; - -import javax.management.openmbean.CompositeData; -import javax.management.openmbean.OpenDataException; -import javax.management.openmbean.TabularData; - -/** - * - */ -public interface DurableSubscriptionViewMBean extends SubscriptionViewMBean { - /** - * @return name of the durable subscription name - */ - String getSubscriptionName(); - - /** - * Browse messages for this durable subscriber - * - * @return messages - * @throws OpenDataException - */ - CompositeData[] browse() throws OpenDataException; - - /** - * Browse messages for this durable subscriber - * - * @return messages - * @throws OpenDataException - */ - TabularData browseAsTable() throws OpenDataException; - - /** - * Destroys the durable subscription so that messages will no longer be - * stored for this subscription - */ - void destroy() throws Exception; - - /** - * @return true if the message cursor has memory space available - * to page in more messages - */ - public boolean doesCursorHaveSpace(); - - /** - * @return true if the cursor has reached its memory limit for - * paged in messages - */ - public boolean isCursorFull(); - - /** - * @return true if the cursor has messages buffered to deliver - */ - public boolean doesCursorHaveMessagesBuffered(); - - /** - * @return the cursor memory usage in bytes - */ - public long getCursorMemoryUsage(); - - /** - * @return the cursor memory usage as a percentage - */ - public int getCursorPercentUsage(); - - /** - * @return the number of messages available to be paged in - * by the cursor - */ - public int cursorSize(); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/HealthStatus.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/HealthStatus.class deleted file mode 100644 index 706fc8af4..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/HealthStatus.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/HealthStatus.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/HealthStatus.java deleted file mode 100644 index bcbc70b74..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/HealthStatus.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * 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.broker.jmx; - -import java.io.Serializable; - -public class HealthStatus implements Serializable { - private final String healthId; - private final String level; - private final String message; - private final String resource; - - public HealthStatus(String healthId, String level, String message, String resource) { - this.healthId = healthId; - this.level = level; - this.message = message; - this.resource = resource; - } - - public String getHealthId() { - return healthId; - } - - public String getLevel() { - return level; - } - - public String getMessage() { - return message; - } - - public String getResource() { - return resource; - } - - public String toString(){ - return healthId + ": " + level + " " + message + " from " + resource; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/HealthView.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/HealthView.class deleted file mode 100644 index be7c1edb7..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/HealthView.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/HealthView.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/HealthView.java deleted file mode 100644 index 4dc890b2b..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/HealthView.java +++ /dev/null @@ -1,196 +0,0 @@ -/** - * 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.broker.jmx; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import javax.management.ObjectName; -import javax.management.openmbean.CompositeDataSupport; -import javax.management.openmbean.CompositeType; -import javax.management.openmbean.TabularData; -import javax.management.openmbean.TabularDataSupport; -import javax.management.openmbean.TabularType; -import org.apache.activemq.broker.BrokerService; -import org.apache.activemq.broker.scheduler.JobSchedulerStore; -import org.apache.activemq.store.PersistenceAdapter; -import org.apache.activemq.usage.SystemUsage; - -public class HealthView implements HealthViewMBean { - - ManagedRegionBroker broker; - String currentState = "Good"; - - public HealthView(ManagedRegionBroker broker) { - this.broker = broker; - } - - @Override - public TabularData health() throws Exception { - OpenTypeSupport.OpenTypeFactory factory = OpenTypeSupport.getFactory(HealthStatus.class); - CompositeType ct = factory.getCompositeType(); - TabularType tt = new TabularType("HealthStatus", "HealthStatus", ct, new String[]{"healthId", "level", "message", "resource"}); - TabularDataSupport rc = new TabularDataSupport(tt); - - List list = healthList(); - for (HealthStatus healthStatus : list) { - rc.put(new CompositeDataSupport(ct, factory.getFields(healthStatus))); - } - return rc; - } - - @Override - public List healthList() throws Exception { - List answer = new ArrayList(); - Map queueViews = broker.getQueueViews(); - for (Map.Entry entry : queueViews.entrySet()) { - DestinationView queue = entry.getValue(); - if (queue.getConsumerCount() == 0 && queue.getProducerCount() > 0) { - ObjectName key = entry.getKey(); - String message = "Queue " + queue.getName() + " has no consumers"; - answer.add(new HealthStatus("org.apache.activemq.noConsumer", "WARNING", message, key.toString())); - } - } - - /** - * Check persistence store directory limits - * - */ - BrokerService brokerService = broker.getBrokerService(); - if (brokerService != null && brokerService.getPersistenceAdapter() != null) { - PersistenceAdapter adapter = brokerService.getPersistenceAdapter(); - File dir = adapter.getDirectory(); - if (brokerService.isPersistent()) { - SystemUsage usage = brokerService.getSystemUsage(); - if (dir != null && usage != null) { - String dirPath = dir.getAbsolutePath(); - if (!dir.isAbsolute()) { - dir = new File(dirPath); - } - - - while (dir != null && !dir.isDirectory()) { - dir = dir.getParentFile(); - } - long storeSize = adapter.size(); - long storeLimit = usage.getStoreUsage().getLimit(); - long dirFreeSpace = dir.getUsableSpace(); - - if (storeSize != 0) { - int val = (int) ((storeSize * 100) / storeLimit); - if (val > 90) { - answer.add(new HealthStatus("org.apache.activemq.StoreLimit", "WARNING", "Message Store size is within " + val + "% of its limit", adapter.toString())); - } - } - - - if ((storeLimit - storeSize) > dirFreeSpace) { - String message = "Store limit is " + storeLimit / (1024 * 1024) + - " mb, whilst the data directory: " + dir.getAbsolutePath() + - " only has " + dirFreeSpace / (1024 * 1024) + " mb of usable space"; - answer.add(new HealthStatus("org.apache.activemq.FreeDiskSpaceLeft", "WARNING", message, adapter.toString())); - } - - - } - File tmpDir = brokerService.getTmpDataDirectory(); - if (tmpDir != null) { - - String tmpDirPath = tmpDir.getAbsolutePath(); - if (!tmpDir.isAbsolute()) { - tmpDir = new File(tmpDirPath); - } - - long storeSize = usage.getTempUsage().getUsage(); - long storeLimit = usage.getTempUsage().getLimit(); - while (tmpDir != null && !tmpDir.isDirectory()) { - tmpDir = tmpDir.getParentFile(); - } - - int val = (int) ((storeSize * 100) / storeLimit); - if (val > 90) { - answer.add(new HealthStatus("org.apache.activemq.TempStoreLimit", "WARNING", "TempMessage Store size is within " + val + "% of its limit", adapter.toString())); - } - - - } - - - } - } - - if (brokerService != null && brokerService.getJobSchedulerStore() != null) { - JobSchedulerStore scheduler = brokerService.getJobSchedulerStore(); - File dir = scheduler.getDirectory(); - if (brokerService.isPersistent()) { - SystemUsage usage = brokerService.getSystemUsage(); - if (dir != null && usage != null) { - String dirPath = dir.getAbsolutePath(); - if (!dir.isAbsolute()) { - dir = new File(dirPath); - } - - - while (dir != null && !dir.isDirectory()) { - dir = dir.getParentFile(); - } - long storeSize = scheduler.size(); - long storeLimit = usage.getJobSchedulerUsage().getLimit(); - long dirFreeSpace = dir.getUsableSpace(); - - if (storeSize != 0) { - int val = (int) ((storeSize * 100) / storeLimit); - if (val > 90) { - answer.add(new HealthStatus("org.apache.activemq.JobSchedulerLimit", "WARNING", "JobSchedulerMessage Store size is within " + val + "% of its limit", scheduler.toString())); - } - } - - - if ((storeLimit - storeSize) > dirFreeSpace) { - String message = "JobSchedulerStore limit is " + storeLimit / (1024 * 1024) + - " mb, whilst the data directory: " + dir.getAbsolutePath() + - " only has " + dirFreeSpace / (1024 * 1024) + " mb of usable space"; - answer.add(new HealthStatus("org.apache.activemq.FreeDiskSpaceLeft", "WARNING", message, scheduler.toString())); - } - - } - } - } - - if (answer != null && !answer.isEmpty()){ - this.currentState = "Getting Worried {"; - for (HealthStatus hs: answer){ - currentState += hs + " , "; - } - currentState += " }"; - } else{ - this.currentState="Good"; - } - return answer; - } - - /** - * @return String representation of the current Broker state - */ - @Override - public String getCurrentStatus() { - return this.currentState; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/HealthViewMBean.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/HealthViewMBean.class deleted file mode 100644 index b376ede05..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/HealthViewMBean.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/HealthViewMBean.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/HealthViewMBean.java deleted file mode 100644 index aa1b5205d..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/HealthViewMBean.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * 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.broker.jmx; - -import javax.management.openmbean.TabularData; -import java.util.List; - -/** - * Returns the status events of the broker to indicate any warnings. - */ -public interface HealthViewMBean { - - public TabularData health() throws Exception; - - /** - * Warning this method can only be invoked if you have the correct version - * of {@link HealthStatus} on your classpath or you use something - * like jolokia to access JMX. - * - * If in doubt, please use the {@link #status()} method instead! - */ - @MBeanInfo("List of warnings and errors about the current health of the Broker - empty list is Good!") - List healthList() throws Exception; - - /** - * @return String representation of the current Broker state - */ - @MBeanInfo("String representation of current Broker state") - String getCurrentStatus(); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/InactiveDurableSubscriptionView.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/InactiveDurableSubscriptionView.class deleted file mode 100644 index c649ea30c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/InactiveDurableSubscriptionView.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/InactiveDurableSubscriptionView.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/InactiveDurableSubscriptionView.java deleted file mode 100644 index 35c0b92ab..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/InactiveDurableSubscriptionView.java +++ /dev/null @@ -1,149 +0,0 @@ -/** - * 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.broker.jmx; - -import javax.management.openmbean.CompositeData; -import javax.management.openmbean.OpenDataException; -import javax.management.openmbean.TabularData; - -import org.apache.activemq.broker.BrokerService; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.command.RemoveSubscriptionInfo; -import org.apache.activemq.command.SubscriptionInfo; - -/** - * - * - */ -public class InactiveDurableSubscriptionView extends DurableSubscriptionView implements DurableSubscriptionViewMBean { - protected SubscriptionInfo subscriptionInfo; - - /** - * Constructor - * - * @param broker - * @param clientId - * @param userName - * @param subInfo - */ - public InactiveDurableSubscriptionView(ManagedRegionBroker broker, BrokerService brokerService, String clientId, SubscriptionInfo subInfo, Subscription subscription) { - super(broker, brokerService, clientId, null, subscription); - this.broker = broker; - this.subscriptionInfo = subInfo; - } - - /** - * @return the id of the Subscription - */ - public long getSubcriptionId() { - return -1; - } - - /** - * @return the destination name - */ - public String getDestinationName() { - return subscriptionInfo.getDestination().getPhysicalName(); - - } - - /** - * @return true if the destination is a Queue - */ - public boolean isDestinationQueue() { - return false; - } - - /** - * @return true of the destination is a Topic - */ - public boolean isDestinationTopic() { - return true; - } - - /** - * @return true if the destination is temporary - */ - public boolean isDestinationTemporary() { - return false; - } - - /** - * @return name of the durable consumer - */ - public String getSubscriptionName() { - return subscriptionInfo.getSubscriptionName(); - } - - /** - * @return true if the subscriber is active - */ - public boolean isActive() { - return false; - } - - @Override - protected ConsumerInfo getConsumerInfo() { - // when inactive, consumer info is stale - return null; - } - - /** - * Browse messages for this durable subscriber - * - * @return messages - * @throws OpenDataException - */ - public CompositeData[] browse() throws OpenDataException { - return broker.browse(this); - } - - /** - * Browse messages for this durable subscriber - * - * @return messages - * @throws OpenDataException - */ - public TabularData browseAsTable() throws OpenDataException { - return broker.browseAsTable(this); - } - - /** - * Destroys the durable subscription so that messages will no longer be - * stored for this subscription - */ - public void destroy() throws Exception { - RemoveSubscriptionInfo info = new RemoveSubscriptionInfo(); - info.setClientId(clientId); - info.setSubscriptionName(subscriptionInfo.getSubscriptionName()); - ConnectionContext context = new ConnectionContext(); - context.setBroker(broker); - context.setClientId(clientId); - brokerService.getBroker().removeSubscription(context, info); - } - - public String toString() { - return "InactiveDurableSubscriptionView: " + getClientId() + ":" + getSubscriptionName(); - } - - @Override - public String getSelector() { - return subscriptionInfo.getSelector(); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/JmsConnectorView.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/JmsConnectorView.class deleted file mode 100644 index efee3821d..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/JmsConnectorView.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/JmsConnectorView.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/JmsConnectorView.java deleted file mode 100644 index b4a57df8d..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/JmsConnectorView.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * 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.broker.jmx; - -import org.apache.activemq.network.jms.JmsConnector; - -public class JmsConnectorView implements JmsConnectorViewMBean { - - private final JmsConnector connector; - - public JmsConnectorView(JmsConnector connector) { - this.connector = connector; - } - - public void start() throws Exception { - connector.start(); - } - - public void stop() throws Exception { - connector.stop(); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/JmsConnectorViewMBean.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/JmsConnectorViewMBean.class deleted file mode 100644 index 0f8fc0be7..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/JmsConnectorViewMBean.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/JmsConnectorViewMBean.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/JmsConnectorViewMBean.java deleted file mode 100644 index 21113b25e..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/JmsConnectorViewMBean.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * 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.broker.jmx; - -import org.apache.activemq.Service; - -public interface JmsConnectorViewMBean extends Service { - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/JobSchedulerView.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/JobSchedulerView.class deleted file mode 100644 index efb147b48..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/JobSchedulerView.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/JobSchedulerView.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/JobSchedulerView.java deleted file mode 100644 index 9e5a1fba4..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/JobSchedulerView.java +++ /dev/null @@ -1,101 +0,0 @@ -/** - * 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.broker.jmx; - -import org.apache.activemq.broker.jmx.OpenTypeSupport.OpenTypeFactory; -import org.apache.activemq.broker.scheduler.Job; -import org.apache.activemq.broker.scheduler.JobScheduler; -import org.apache.activemq.broker.scheduler.JobSupport; - -import javax.management.openmbean.*; -import java.io.IOException; -import java.util.List; - -public class JobSchedulerView implements JobSchedulerViewMBean { - - private final JobScheduler jobScheduler; - - public JobSchedulerView(JobScheduler jobScheduler) { - this.jobScheduler = jobScheduler; - } - - public TabularData getAllJobs() throws Exception { - OpenTypeFactory factory = OpenTypeSupport.getFactory(Job.class); - CompositeType ct = factory.getCompositeType(); - TabularType tt = new TabularType("Scheduled Jobs", "Scheduled Jobs", ct, new String[] { "jobId" }); - TabularDataSupport rc = new TabularDataSupport(tt); - List jobs = this.jobScheduler.getAllJobs(); - for (Job job : jobs) { - rc.put(new CompositeDataSupport(ct, factory.getFields(job))); - } - return rc; - } - - public TabularData getAllJobs(String startTime, String finishTime) throws Exception { - OpenTypeFactory factory = OpenTypeSupport.getFactory(Job.class); - CompositeType ct = factory.getCompositeType(); - TabularType tt = new TabularType("Scheduled Jobs", "Scheduled Jobs", ct, new String[] { "jobId" }); - TabularDataSupport rc = new TabularDataSupport(tt); - long start = JobSupport.getDataTime(startTime); - long finish = JobSupport.getDataTime(finishTime); - List jobs = this.jobScheduler.getAllJobs(start, finish); - for (Job job : jobs) { - rc.put(new CompositeDataSupport(ct, factory.getFields(job))); - } - return rc; - } - - public TabularData getNextScheduleJobs() throws Exception { - OpenTypeFactory factory = OpenTypeSupport.getFactory(Job.class); - CompositeType ct = factory.getCompositeType(); - TabularType tt = new TabularType("Scheduled Jobs", "Scheduled Jobs", ct, new String[] { "jobId" }); - TabularDataSupport rc = new TabularDataSupport(tt); - List jobs = this.jobScheduler.getNextScheduleJobs(); - for (Job job : jobs) { - rc.put(new CompositeDataSupport(ct, factory.getFields(job))); - } - return rc; - } - - public String getNextScheduleTime() throws Exception { - long time = this.jobScheduler.getNextScheduleTime(); - return JobSupport.getDateTime(time); - } - - public void removeAllJobs() throws Exception { - this.jobScheduler.removeAllJobs(); - - } - - public void removeAllJobs(String startTime, String finishTime) throws Exception { - long start = JobSupport.getDataTime(startTime); - long finish = JobSupport.getDataTime(finishTime); - this.jobScheduler.removeAllJobs(start, finish); - - } - - public void removeJob(String jobId) throws Exception { - this.jobScheduler.remove(jobId); - - } - - public void removeJobAtScheduledTime(String time) throws IOException { - // TODO Auto-generated method stub - - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/JobSchedulerViewMBean.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/JobSchedulerViewMBean.class deleted file mode 100644 index 31bb6b154..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/JobSchedulerViewMBean.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/JobSchedulerViewMBean.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/JobSchedulerViewMBean.java deleted file mode 100644 index f5745ea60..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/JobSchedulerViewMBean.java +++ /dev/null @@ -1,93 +0,0 @@ -/** - * 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.broker.jmx; - -import javax.management.openmbean.TabularData; - - - -public interface JobSchedulerViewMBean { - /** - * remove all jobs scheduled to run at this time - * @param time - * @throws Exception - */ - @MBeanInfo("remove jobs with matching execution time") - public abstract void removeJobAtScheduledTime(@MBeanInfo("time: yyyy-MM-dd hh:mm:ss")String time) throws Exception; - - /** - * remove a job with the matching jobId - * @param jobId - * @throws Exception - */ - @MBeanInfo("remove jobs with matching jobId") - public abstract void removeJob(@MBeanInfo("jobId")String jobId) throws Exception; - - /** - * remove all the Jobs from the scheduler - * @throws Exception - */ - @MBeanInfo("remove all scheduled jobs") - public abstract void removeAllJobs() throws Exception; - - /** - * remove all the Jobs from the scheduler that are due between the start and finish times - * @param start time - * @param finish time - * @throws Exception - */ - @MBeanInfo("remove all scheduled jobs between time ranges ") - public abstract void removeAllJobs(@MBeanInfo("start: yyyy-MM-dd hh:mm:ss")String start,@MBeanInfo("finish: yyyy-MM-dd hh:mm:ss")String finish) throws Exception; - - - - /** - * Get the next time jobs will be fired - * @return the time in milliseconds - * @throws Exception - */ - @MBeanInfo("get the next time a job is due to be scheduled ") - public abstract String getNextScheduleTime() throws Exception; - - /** - * Get all the jobs scheduled to run next - * @return a list of jobs that will be scheduled next - * @throws Exception - */ - @MBeanInfo("get the next job(s) to be scheduled. Not HTML friendly ") - public abstract TabularData getNextScheduleJobs() throws Exception; - - /** - * Get all the outstanding Jobs - * @return a table of all jobs - * @throws Exception - - */ - @MBeanInfo("get the scheduled Jobs in the Store. Not HTML friendly ") - public abstract TabularData getAllJobs() throws Exception; - - /** - * Get all outstanding jobs due to run between start and finish - * @param start - * @param finish - * @return a table of jobs in the range - * @throws Exception - - */ - @MBeanInfo("get the scheduled Jobs in the Store within the time range. Not HTML friendly ") - public abstract TabularData getAllJobs(@MBeanInfo("start: yyyy-MM-dd hh:mm:ss")String start,@MBeanInfo("finish: yyyy-MM-dd hh:mm:ss")String finish)throws Exception; -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/MBeanInfo.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/MBeanInfo.class deleted file mode 100644 index 5689aa785..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/MBeanInfo.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/MBeanInfo.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/MBeanInfo.java deleted file mode 100644 index 907ff159c..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/MBeanInfo.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * 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.broker.jmx; - -import static java.lang.annotation.ElementType.*; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Retention(value=RetentionPolicy.RUNTIME) -@Target({CONSTRUCTOR, METHOD, PARAMETER, TYPE, FIELD}) -public @interface MBeanInfo { - String value(); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedQueueRegion.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedQueueRegion.class deleted file mode 100644 index 7e1bff061..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedQueueRegion.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedQueueRegion.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedQueueRegion.java deleted file mode 100644 index 7e3bf5551..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedQueueRegion.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * 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.broker.jmx; - -import javax.jms.JMSException; -import javax.management.ObjectName; - -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.DestinationFactory; -import org.apache.activemq.broker.region.DestinationStatistics; -import org.apache.activemq.broker.region.QueueRegion; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.thread.TaskRunnerFactory; -import org.apache.activemq.usage.SystemUsage; - -public class ManagedQueueRegion extends QueueRegion { - - private final ManagedRegionBroker regionBroker; - - public ManagedQueueRegion(ManagedRegionBroker broker, DestinationStatistics destinationStatistics, SystemUsage memoryManager, TaskRunnerFactory taskRunnerFactory, - DestinationFactory destinationFactory) { - super(broker, destinationStatistics, memoryManager, taskRunnerFactory, destinationFactory); - regionBroker = broker; - } - - protected Subscription createSubscription(ConnectionContext context, ConsumerInfo info) throws JMSException { - Subscription sub = super.createSubscription(context, info); - ObjectName name = regionBroker.registerSubscription(context, sub); - sub.setObjectName(name); - return sub; - } - - protected void destroySubscription(Subscription sub) { - regionBroker.unregisterSubscription(sub); - super.destroySubscription(sub); - } - - protected Destination createDestination(ConnectionContext context, ActiveMQDestination destination) throws Exception { - Destination rc = super.createDestination(context, destination); - regionBroker.register(destination, rc); - return rc; - } - - public void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout) throws Exception { - super.removeDestination(context, destination, timeout); - regionBroker.unregister(destination); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedRegionBroker$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedRegionBroker$1.class deleted file mode 100644 index bb0de2ebe..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedRegionBroker$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedRegionBroker.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedRegionBroker.class deleted file mode 100644 index ed168e460..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedRegionBroker.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedRegionBroker.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedRegionBroker.java deleted file mode 100644 index bfbcfe672..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedRegionBroker.java +++ /dev/null @@ -1,746 +0,0 @@ -/** - * 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.broker.jmx; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.CopyOnWriteArraySet; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.ThreadPoolExecutor; - -import javax.management.InstanceNotFoundException; -import javax.management.MalformedObjectNameException; -import javax.management.ObjectName; -import javax.management.openmbean.CompositeData; -import javax.management.openmbean.CompositeDataSupport; -import javax.management.openmbean.CompositeType; -import javax.management.openmbean.OpenDataException; -import javax.management.openmbean.TabularData; -import javax.management.openmbean.TabularDataSupport; -import javax.management.openmbean.TabularType; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.BrokerService; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.ProducerBrokerExchange; -import org.apache.activemq.broker.jmx.OpenTypeSupport.OpenTypeFactory; -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.DestinationFactory; -import org.apache.activemq.broker.region.DestinationFactoryImpl; -import org.apache.activemq.broker.region.DestinationInterceptor; -import org.apache.activemq.broker.region.Queue; -import org.apache.activemq.broker.region.Region; -import org.apache.activemq.broker.region.RegionBroker; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.broker.region.Topic; -import org.apache.activemq.broker.region.TopicRegion; -import org.apache.activemq.broker.region.TopicSubscription; -import org.apache.activemq.broker.region.policy.AbortSlowAckConsumerStrategy; -import org.apache.activemq.broker.region.policy.AbortSlowConsumerStrategy; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ActiveMQMessage; -import org.apache.activemq.command.ActiveMQTopic; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.command.Message; -import org.apache.activemq.command.MessageId; -import org.apache.activemq.command.ProducerInfo; -import org.apache.activemq.command.SubscriptionInfo; -import org.apache.activemq.store.MessageRecoveryListener; -import org.apache.activemq.store.PersistenceAdapter; -import org.apache.activemq.store.TopicMessageStore; -import org.apache.activemq.thread.Scheduler; -import org.apache.activemq.thread.TaskRunnerFactory; -import org.apache.activemq.transaction.XATransaction; -import org.apache.activemq.usage.SystemUsage; -import org.apache.activemq.util.ServiceStopper; -import org.apache.activemq.util.SubscriptionKey; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ManagedRegionBroker extends RegionBroker { - private static final Logger LOG = LoggerFactory.getLogger(ManagedRegionBroker.class); - private final ManagementContext managementContext; - private final ObjectName brokerObjectName; - private final Map topics = new ConcurrentHashMap(); - private final Map queues = new ConcurrentHashMap(); - private final Map temporaryQueues = new ConcurrentHashMap(); - private final Map temporaryTopics = new ConcurrentHashMap(); - private final Map queueSubscribers = new ConcurrentHashMap(); - private final Map topicSubscribers = new ConcurrentHashMap(); - private final Map durableTopicSubscribers = new ConcurrentHashMap(); - private final Map inactiveDurableTopicSubscribers = new ConcurrentHashMap(); - private final Map temporaryQueueSubscribers = new ConcurrentHashMap(); - private final Map temporaryTopicSubscribers = new ConcurrentHashMap(); - private final Map queueProducers = new ConcurrentHashMap(); - private final Map topicProducers = new ConcurrentHashMap(); - private final Map temporaryQueueProducers = new ConcurrentHashMap(); - private final Map temporaryTopicProducers = new ConcurrentHashMap(); - private final Map dynamicDestinationProducers = new ConcurrentHashMap(); - private final Map subscriptionKeys = new ConcurrentHashMap(); - private final Map subscriptionMap = new ConcurrentHashMap(); - private final Set registeredMBeans = new CopyOnWriteArraySet(); - /* This is the first broker in the broker interceptor chain. */ - private Broker contextBroker; - - private final ExecutorService asyncInvokeService; - private final long mbeanTimeout; - - public ManagedRegionBroker(BrokerService brokerService, ManagementContext context, ObjectName brokerObjectName, TaskRunnerFactory taskRunnerFactory, SystemUsage memoryManager, - DestinationFactory destinationFactory, DestinationInterceptor destinationInterceptor,Scheduler scheduler,ThreadPoolExecutor executor) throws IOException { - super(brokerService, taskRunnerFactory, memoryManager, destinationFactory, destinationInterceptor,scheduler,executor); - this.managementContext = context; - this.brokerObjectName = brokerObjectName; - this.mbeanTimeout = brokerService.getMbeanInvocationTimeout(); - this.asyncInvokeService = mbeanTimeout > 0 ? executor : null;; - } - - @Override - public void start() throws Exception { - super.start(); - // build all existing durable subscriptions - buildExistingSubscriptions(); - } - - @Override - protected void doStop(ServiceStopper stopper) { - super.doStop(stopper); - // lets remove any mbeans not yet removed - for (Iterator iter = registeredMBeans.iterator(); iter.hasNext();) { - ObjectName name = iter.next(); - try { - managementContext.unregisterMBean(name); - } catch (InstanceNotFoundException e) { - LOG.warn("The MBean {} is no longer registered with JMX", name); - } catch (Exception e) { - stopper.onException(this, e); - } - } - registeredMBeans.clear(); - } - - @Override - protected Region createQueueRegion(SystemUsage memoryManager, TaskRunnerFactory taskRunnerFactory, DestinationFactory destinationFactory) { - return new ManagedQueueRegion(this, destinationStatistics, memoryManager, taskRunnerFactory, destinationFactory); - } - - @Override - protected Region createTempQueueRegion(SystemUsage memoryManager, TaskRunnerFactory taskRunnerFactory, DestinationFactory destinationFactory) { - return new ManagedTempQueueRegion(this, destinationStatistics, memoryManager, taskRunnerFactory, destinationFactory); - } - - @Override - protected Region createTempTopicRegion(SystemUsage memoryManager, TaskRunnerFactory taskRunnerFactory, DestinationFactory destinationFactory) { - return new ManagedTempTopicRegion(this, destinationStatistics, memoryManager, taskRunnerFactory, destinationFactory); - } - - @Override - protected Region createTopicRegion(SystemUsage memoryManager, TaskRunnerFactory taskRunnerFactory, DestinationFactory destinationFactory) { - return new ManagedTopicRegion(this, destinationStatistics, memoryManager, taskRunnerFactory, destinationFactory); - } - - public void register(ActiveMQDestination destName, Destination destination) { - // TODO refactor to allow views for custom destinations - try { - ObjectName objectName = BrokerMBeanSupport.createDestinationName(brokerObjectName, destName); - DestinationView view; - if (destination instanceof Queue) { - view = new QueueView(this, (Queue)destination); - } else if (destination instanceof Topic) { - view = new TopicView(this, (Topic)destination); - } else { - view = null; - LOG.warn("JMX View is not supported for custom destination {}", destination); - } - if (view != null) { - registerDestination(objectName, destName, view); - } - } catch (Exception e) { - LOG.error("Failed to register destination {}", destName, e); - } - } - - public void unregister(ActiveMQDestination destName) { - try { - ObjectName objectName = BrokerMBeanSupport.createDestinationName(brokerObjectName, destName); - unregisterDestination(objectName); - } catch (Exception e) { - LOG.error("Failed to unregister {}", destName, e); - } - } - - public ObjectName registerSubscription(ConnectionContext context, Subscription sub) { - String connectionClientId = context.getClientId(); - - SubscriptionKey key = new SubscriptionKey(context.getClientId(), sub.getConsumerInfo().getSubscriptionName()); - try { - ObjectName objectName = BrokerMBeanSupport.createSubscriptionName(brokerObjectName, connectionClientId, sub.getConsumerInfo()); - SubscriptionView view; - if (sub.getConsumerInfo().getConsumerId().getConnectionId().equals("OFFLINE")) { - // add offline subscribers to inactive list - SubscriptionInfo info = new SubscriptionInfo(); - info.setClientId(context.getClientId()); - info.setSubscriptionName(sub.getConsumerInfo().getSubscriptionName()); - info.setDestination(sub.getConsumerInfo().getDestination()); - info.setSelector(sub.getSelector()); - addInactiveSubscription(key, info, sub); - } else { - String userName = brokerService.isPopulateUserNameInMBeans() ? context.getUserName() : null; - if (sub.getConsumerInfo().isDurable()) { - view = new DurableSubscriptionView(this, brokerService, context.getClientId(), userName, sub); - } else { - if (sub instanceof TopicSubscription) { - view = new TopicSubscriptionView(context.getClientId(), userName, (TopicSubscription) sub); - } else { - view = new SubscriptionView(context.getClientId(), userName, sub); - } - } - registerSubscription(objectName, sub.getConsumerInfo(), key, view); - } - subscriptionMap.put(sub, objectName); - return objectName; - } catch (Exception e) { - LOG.error("Failed to register subscription {}", sub, e); - return null; - } - } - - @Override - public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { - Subscription sub = super.addConsumer(context, info); - SubscriptionKey subscriptionKey = new SubscriptionKey(sub.getContext().getClientId(), sub.getConsumerInfo().getSubscriptionName()); - ObjectName inactiveName = subscriptionKeys.get(subscriptionKey); - if (inactiveName != null) { - // if it was inactive, register it - registerSubscription(context, sub); - } - return sub; - } - - @Override - public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { - for (Subscription sub : subscriptionMap.keySet()) { - if (sub.getConsumerInfo().equals(info)) { - // unregister all consumer subs - unregisterSubscription(subscriptionMap.get(sub), true); - } - } - super.removeConsumer(context, info); - } - - @Override - public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception { - super.addProducer(context, info); - String connectionClientId = context.getClientId(); - ObjectName objectName = BrokerMBeanSupport.createProducerName(brokerObjectName, context.getClientId(), info); - String userName = brokerService.isPopulateUserNameInMBeans() ? context.getUserName() : null; - ProducerView view = new ProducerView(info, connectionClientId, userName, this); - registerProducer(objectName, info.getDestination(), view); - } - - @Override - public void removeProducer(ConnectionContext context, ProducerInfo info) throws Exception { - ObjectName objectName = BrokerMBeanSupport.createProducerName(brokerObjectName, context.getClientId(), info); - unregisterProducer(objectName); - super.removeProducer(context, info); - } - - @Override - public void send(ProducerBrokerExchange exchange, Message message) throws Exception { - if (exchange != null && exchange.getProducerState() != null && exchange.getProducerState().getInfo() != null) { - ProducerInfo info = exchange.getProducerState().getInfo(); - if (info.getDestination() == null && info.getProducerId() != null) { - ObjectName objectName = BrokerMBeanSupport.createProducerName(brokerObjectName, exchange.getConnectionContext().getClientId(), info); - ProducerView view = this.dynamicDestinationProducers.get(objectName); - if (view != null) { - ActiveMQDestination dest = message.getDestination(); - if (dest != null) { - view.setLastUsedDestinationName(dest); - } - } - } - } - super.send(exchange, message); - } - - public void unregisterSubscription(Subscription sub) { - ObjectName name = subscriptionMap.remove(sub); - if (name != null) { - try { - SubscriptionKey subscriptionKey = new SubscriptionKey(sub.getContext().getClientId(), sub.getConsumerInfo().getSubscriptionName()); - ObjectName inactiveName = subscriptionKeys.get(subscriptionKey); - if (inactiveName != null) { - inactiveDurableTopicSubscribers.remove(inactiveName); - managementContext.unregisterMBean(inactiveName); - } - } catch (Exception e) { - LOG.error("Failed to unregister subscription {}", sub, e); - } - } - } - - protected void registerDestination(ObjectName key, ActiveMQDestination dest, DestinationView view) throws Exception { - if (dest.isQueue()) { - if (dest.isTemporary()) { - temporaryQueues.put(key, view); - } else { - queues.put(key, view); - } - } else { - if (dest.isTemporary()) { - temporaryTopics.put(key, view); - } else { - topics.put(key, view); - } - } - try { - AsyncAnnotatedMBean.registerMBean(asyncInvokeService, mbeanTimeout, managementContext, view, key); - registeredMBeans.add(key); - } catch (Throwable e) { - LOG.warn("Failed to register MBean {}", key); - LOG.debug("Failure reason: ", e); - } - } - - protected void unregisterDestination(ObjectName key) throws Exception { - - DestinationView view = removeAndRemember(topics, key, null); - view = removeAndRemember(queues, key, view); - view = removeAndRemember(temporaryQueues, key, view); - view = removeAndRemember(temporaryTopics, key, view); - if (registeredMBeans.remove(key)) { - try { - managementContext.unregisterMBean(key); - } catch (Throwable e) { - LOG.warn("Failed to unregister MBean {}", key); - LOG.debug("Failure reason: ", e); - } - } - if (view != null) { - key = view.getSlowConsumerStrategy(); - if (key!= null && registeredMBeans.remove(key)) { - try { - managementContext.unregisterMBean(key); - } catch (Throwable e) { - LOG.warn("Failed to unregister slow consumer strategy MBean {}", key); - LOG.debug("Failure reason: ", e); - } - } - } - } - - protected void registerProducer(ObjectName key, ActiveMQDestination dest, ProducerView view) throws Exception { - - if (dest != null) { - if (dest.isQueue()) { - if (dest.isTemporary()) { - temporaryQueueProducers.put(key, view); - } else { - queueProducers.put(key, view); - } - } else { - if (dest.isTemporary()) { - temporaryTopicProducers.put(key, view); - } else { - topicProducers.put(key, view); - } - } - } else { - dynamicDestinationProducers.put(key, view); - } - - try { - AsyncAnnotatedMBean.registerMBean(asyncInvokeService, mbeanTimeout, managementContext, view, key); - registeredMBeans.add(key); - } catch (Throwable e) { - LOG.warn("Failed to register MBean {}", key); - LOG.debug("Failure reason: ", e); - } - } - - protected void unregisterProducer(ObjectName key) throws Exception { - queueProducers.remove(key); - topicProducers.remove(key); - temporaryQueueProducers.remove(key); - temporaryTopicProducers.remove(key); - dynamicDestinationProducers.remove(key); - if (registeredMBeans.remove(key)) { - try { - managementContext.unregisterMBean(key); - } catch (Throwable e) { - LOG.warn("Failed to unregister MBean {}", key); - LOG.debug("Failure reason: ", e); - } - } - } - - private DestinationView removeAndRemember(Map map, ObjectName key, DestinationView view) { - DestinationView candidate = map.remove(key); - if (candidate != null && view == null) { - view = candidate; - } - return candidate != null ? candidate : view; - } - - protected void registerSubscription(ObjectName key, ConsumerInfo info, SubscriptionKey subscriptionKey, SubscriptionView view) throws Exception { - ActiveMQDestination dest = info.getDestination(); - if (dest.isQueue()) { - if (dest.isTemporary()) { - temporaryQueueSubscribers.put(key, view); - } else { - queueSubscribers.put(key, view); - } - } else { - if (dest.isTemporary()) { - temporaryTopicSubscribers.put(key, view); - } else { - if (info.isDurable()) { - durableTopicSubscribers.put(key, view); - // unregister any inactive durable subs - try { - ObjectName inactiveName = subscriptionKeys.get(subscriptionKey); - if (inactiveName != null) { - inactiveDurableTopicSubscribers.remove(inactiveName); - registeredMBeans.remove(inactiveName); - managementContext.unregisterMBean(inactiveName); - } - } catch (Throwable e) { - LOG.error("Unable to unregister inactive durable subscriber {}", subscriptionKey, e); - } - } else { - topicSubscribers.put(key, view); - } - } - } - - try { - AsyncAnnotatedMBean.registerMBean(asyncInvokeService, mbeanTimeout, managementContext, view, key); - registeredMBeans.add(key); - } catch (Throwable e) { - LOG.warn("Failed to register MBean {}", key); - LOG.debug("Failure reason: ", e); - } - - } - - protected void unregisterSubscription(ObjectName key, boolean addToInactive) throws Exception { - queueSubscribers.remove(key); - topicSubscribers.remove(key); - temporaryQueueSubscribers.remove(key); - temporaryTopicSubscribers.remove(key); - if (registeredMBeans.remove(key)) { - try { - managementContext.unregisterMBean(key); - } catch (Throwable e) { - LOG.warn("Failed to unregister MBean {}", key); - LOG.debug("Failure reason: ", e); - } - } - DurableSubscriptionView view = (DurableSubscriptionView)durableTopicSubscribers.remove(key); - if (view != null) { - // need to put this back in the inactive list - SubscriptionKey subscriptionKey = new SubscriptionKey(view.getClientId(), view.getSubscriptionName()); - if (addToInactive) { - SubscriptionInfo info = new SubscriptionInfo(); - info.setClientId(subscriptionKey.getClientId()); - info.setSubscriptionName(subscriptionKey.getSubscriptionName()); - info.setDestination(new ActiveMQTopic(view.getDestinationName())); - info.setSelector(view.getSelector()); - addInactiveSubscription(subscriptionKey, info, (brokerService.isKeepDurableSubsActive() ? view.subscription : null)); - } - } - } - - protected void buildExistingSubscriptions() throws Exception { - Map subscriptions = new HashMap(); - Set destinations = destinationFactory.getDestinations(); - if (destinations != null) { - for (ActiveMQDestination dest : destinations) { - if (dest.isTopic()) { - SubscriptionInfo[] infos = destinationFactory.getAllDurableSubscriptions((ActiveMQTopic)dest); - if (infos != null) { - for (int i = 0; i < infos.length; i++) { - SubscriptionInfo info = infos[i]; - SubscriptionKey key = new SubscriptionKey(info); - if (!alreadyKnown(key)) { - LOG.debug("Restoring durable subscription MBean {}", info); - subscriptions.put(key, info); - } - } - } - } - } - } - - for (Map.Entry entry : subscriptions.entrySet()) { - addInactiveSubscription(entry.getKey(), entry.getValue(), null); - } - } - - private boolean alreadyKnown(SubscriptionKey key) { - boolean known = false; - known = ((TopicRegion) getTopicRegion()).durableSubscriptionExists(key); - LOG.trace("Sub with key: {}, {} already registered", key, (known ? "": "not")); - return known; - } - - protected void addInactiveSubscription(SubscriptionKey key, SubscriptionInfo info, Subscription subscription) { - try { - ConsumerInfo offlineConsumerInfo = subscription != null ? subscription.getConsumerInfo() : ((TopicRegion)getTopicRegion()).createInactiveConsumerInfo(info); - ObjectName objectName = BrokerMBeanSupport.createSubscriptionName(brokerObjectName, info.getClientId(), offlineConsumerInfo); - SubscriptionView view = new InactiveDurableSubscriptionView(this, brokerService, key.getClientId(), info, subscription); - - try { - AsyncAnnotatedMBean.registerMBean(asyncInvokeService, mbeanTimeout, managementContext, view, objectName); - registeredMBeans.add(objectName); - } catch (Throwable e) { - LOG.warn("Failed to register MBean {}", key); - LOG.debug("Failure reason: ", e); - } - - inactiveDurableTopicSubscribers.put(objectName, view); - subscriptionKeys.put(key, objectName); - } catch (Exception e) { - LOG.error("Failed to register subscription {}", info, e); - } - } - - public CompositeData[] browse(SubscriptionView view) throws OpenDataException { - List messages = getSubscriberMessages(view); - CompositeData c[] = new CompositeData[messages.size()]; - for (int i = 0; i < c.length; i++) { - try { - c[i] = OpenTypeSupport.convert(messages.get(i)); - } catch (Throwable e) { - LOG.error("Failed to browse: {}", view, e); - } - } - return c; - } - - public TabularData browseAsTable(SubscriptionView view) throws OpenDataException { - OpenTypeFactory factory = OpenTypeSupport.getFactory(ActiveMQMessage.class); - List messages = getSubscriberMessages(view); - CompositeType ct = factory.getCompositeType(); - TabularType tt = new TabularType("MessageList", "MessageList", ct, new String[] {"JMSMessageID"}); - TabularDataSupport rc = new TabularDataSupport(tt); - for (int i = 0; i < messages.size(); i++) { - rc.put(new CompositeDataSupport(ct, factory.getFields(messages.get(i)))); - } - return rc; - } - - protected List getSubscriberMessages(SubscriptionView view) { - // TODO It is very dangerous operation for big backlogs - if (!(destinationFactory instanceof DestinationFactoryImpl)) { - throw new RuntimeException("unsupported by " + destinationFactory); - } - PersistenceAdapter adapter = ((DestinationFactoryImpl)destinationFactory).getPersistenceAdapter(); - final List result = new ArrayList(); - try { - ActiveMQTopic topic = new ActiveMQTopic(view.getDestinationName()); - TopicMessageStore store = adapter.createTopicMessageStore(topic); - store.recover(new MessageRecoveryListener() { - @Override - public boolean recoverMessage(Message message) throws Exception { - result.add(message); - return true; - } - - @Override - public boolean recoverMessageReference(MessageId messageReference) throws Exception { - throw new RuntimeException("Should not be called."); - } - - @Override - public boolean hasSpace() { - return true; - } - - @Override - public boolean isDuplicate(MessageId id) { - return false; - } - }); - } catch (Throwable e) { - LOG.error("Failed to browse messages for Subscription {}", view, e); - } - return result; - - } - - protected ObjectName[] getTopics() { - Set set = topics.keySet(); - return set.toArray(new ObjectName[set.size()]); - } - - protected ObjectName[] getQueues() { - Set set = queues.keySet(); - return set.toArray(new ObjectName[set.size()]); - } - - protected ObjectName[] getTemporaryTopics() { - Set set = temporaryTopics.keySet(); - return set.toArray(new ObjectName[set.size()]); - } - - protected ObjectName[] getTemporaryQueues() { - Set set = temporaryQueues.keySet(); - return set.toArray(new ObjectName[set.size()]); - } - - protected ObjectName[] getTopicSubscribers() { - Set set = topicSubscribers.keySet(); - return set.toArray(new ObjectName[set.size()]); - } - - protected ObjectName[] getDurableTopicSubscribers() { - Set set = durableTopicSubscribers.keySet(); - return set.toArray(new ObjectName[set.size()]); - } - - protected ObjectName[] getQueueSubscribers() { - Set set = queueSubscribers.keySet(); - return set.toArray(new ObjectName[set.size()]); - } - - protected ObjectName[] getTemporaryTopicSubscribers() { - Set set = temporaryTopicSubscribers.keySet(); - return set.toArray(new ObjectName[set.size()]); - } - - protected ObjectName[] getTemporaryQueueSubscribers() { - Set set = temporaryQueueSubscribers.keySet(); - return set.toArray(new ObjectName[set.size()]); - } - - protected ObjectName[] getInactiveDurableTopicSubscribers() { - Set set = inactiveDurableTopicSubscribers.keySet(); - return set.toArray(new ObjectName[set.size()]); - } - - protected ObjectName[] getTopicProducers() { - Set set = topicProducers.keySet(); - return set.toArray(new ObjectName[set.size()]); - } - - protected ObjectName[] getQueueProducers() { - Set set = queueProducers.keySet(); - return set.toArray(new ObjectName[set.size()]); - } - - protected ObjectName[] getTemporaryTopicProducers() { - Set set = temporaryTopicProducers.keySet(); - return set.toArray(new ObjectName[set.size()]); - } - - protected ObjectName[] getTemporaryQueueProducers() { - Set set = temporaryQueueProducers.keySet(); - return set.toArray(new ObjectName[set.size()]); - } - - protected ObjectName[] getDynamicDestinationProducers() { - Set set = dynamicDestinationProducers.keySet(); - return set.toArray(new ObjectName[set.size()]); - } - - public Broker getContextBroker() { - return contextBroker; - } - - public void setContextBroker(Broker contextBroker) { - this.contextBroker = contextBroker; - } - - public ObjectName registerSlowConsumerStrategy(AbortSlowConsumerStrategy strategy) throws MalformedObjectNameException { - ObjectName objectName = null; - try { - objectName = BrokerMBeanSupport.createAbortSlowConsumerStrategyName(brokerObjectName, strategy); - if (!registeredMBeans.contains(objectName)) { - - AbortSlowConsumerStrategyView view = null; - if (strategy instanceof AbortSlowAckConsumerStrategy) { - view = new AbortSlowAckConsumerStrategyView(this, (AbortSlowAckConsumerStrategy) strategy); - } else { - view = new AbortSlowConsumerStrategyView(this, strategy); - } - - AsyncAnnotatedMBean.registerMBean(asyncInvokeService, mbeanTimeout, managementContext, view, objectName); - registeredMBeans.add(objectName); - } - } catch (Exception e) { - LOG.warn("Failed to register MBean {}", strategy); - LOG.debug("Failure reason: ", e); - } - return objectName; - } - - public void registerRecoveredTransactionMBean(XATransaction transaction) { - try { - ObjectName objectName = BrokerMBeanSupport.createXATransactionName(brokerObjectName, transaction); - if (!registeredMBeans.contains(objectName)) { - RecoveredXATransactionView view = new RecoveredXATransactionView(this, transaction); - AsyncAnnotatedMBean.registerMBean(asyncInvokeService, mbeanTimeout, managementContext, view, objectName); - registeredMBeans.add(objectName); - } - } catch (Exception e) { - LOG.warn("Failed to register prepared transaction MBean {}", transaction); - LOG.debug("Failure reason: ", e); - } - } - - public void unregister(XATransaction transaction) { - try { - ObjectName objectName = BrokerMBeanSupport.createXATransactionName(brokerObjectName, transaction); - if (registeredMBeans.remove(objectName)) { - try { - managementContext.unregisterMBean(objectName); - } catch (Throwable e) { - LOG.warn("Failed to unregister MBean {}", objectName); - LOG.debug("Failure reason: ", e); - } - } - } catch (Exception e) { - LOG.warn("Failed to create object name to unregister {}", transaction, e); - } - } - - public ObjectName getSubscriberObjectName(Subscription key) { - return subscriptionMap.get(key); - } - - public Subscription getSubscriber(ObjectName key) { - Subscription sub = null; - for (Entry entry: subscriptionMap.entrySet()) { - if (entry.getValue().equals(key)) { - sub = entry.getKey(); - break; - } - } - return sub; - } - - public Map getQueueViews() { - return queues; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedTempQueueRegion.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedTempQueueRegion.class deleted file mode 100644 index aafe42b1d..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedTempQueueRegion.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedTempQueueRegion.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedTempQueueRegion.java deleted file mode 100644 index 6f5f20680..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedTempQueueRegion.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * 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.broker.jmx; - -import javax.jms.JMSException; -import javax.management.ObjectName; - -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.DestinationFactory; -import org.apache.activemq.broker.region.DestinationStatistics; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.broker.region.TempQueueRegion; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.thread.TaskRunnerFactory; -import org.apache.activemq.usage.SystemUsage; - -public class ManagedTempQueueRegion extends TempQueueRegion { - - private final ManagedRegionBroker regionBroker; - - public ManagedTempQueueRegion(ManagedRegionBroker broker, DestinationStatistics destinationStatistics, SystemUsage memoryManager, TaskRunnerFactory taskRunnerFactory, - DestinationFactory destinationFactory) { - super(broker, destinationStatistics, memoryManager, taskRunnerFactory, destinationFactory); - this.regionBroker = broker; - } - - protected Subscription createSubscription(ConnectionContext context, ConsumerInfo info) throws JMSException { - Subscription sub = super.createSubscription(context, info); - ObjectName name = regionBroker.registerSubscription(context, sub); - sub.setObjectName(name); - return sub; - } - - protected void destroySubscription(Subscription sub) { - regionBroker.unregisterSubscription(sub); - super.destroySubscription(sub); - } - - protected Destination createDestination(ConnectionContext context, ActiveMQDestination destination) throws Exception { - Destination rc = super.createDestination(context, destination); - regionBroker.register(destination, rc); - return rc; - } - - public void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout) throws Exception { - super.removeDestination(context, destination, timeout); - regionBroker.unregister(destination); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedTempTopicRegion.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedTempTopicRegion.class deleted file mode 100644 index 11add287b..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedTempTopicRegion.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedTempTopicRegion.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedTempTopicRegion.java deleted file mode 100644 index ebc8720c7..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedTempTopicRegion.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * 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.broker.jmx; - -import javax.jms.JMSException; -import javax.management.ObjectName; - -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.DestinationFactory; -import org.apache.activemq.broker.region.DestinationStatistics; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.broker.region.TempTopicRegion; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.thread.TaskRunnerFactory; -import org.apache.activemq.usage.SystemUsage; - -public class ManagedTempTopicRegion extends TempTopicRegion { - - private final ManagedRegionBroker regionBroker; - - public ManagedTempTopicRegion(ManagedRegionBroker regionBroker, DestinationStatistics destinationStatistics, SystemUsage memoryManager, TaskRunnerFactory taskRunnerFactory, - DestinationFactory destinationFactory) { - super(regionBroker, destinationStatistics, memoryManager, taskRunnerFactory, destinationFactory); - this.regionBroker = regionBroker; - } - - protected Subscription createSubscription(ConnectionContext context, ConsumerInfo info) throws JMSException { - Subscription sub = super.createSubscription(context, info); - ObjectName name = regionBroker.registerSubscription(context, sub); - sub.setObjectName(name); - return sub; - } - - protected void destroySubscription(Subscription sub) { - regionBroker.unregisterSubscription(sub); - super.destroySubscription(sub); - } - - protected Destination createDestination(ConnectionContext context, ActiveMQDestination destination) throws Exception { - Destination rc = super.createDestination(context, destination); - regionBroker.register(destination, rc); - return rc; - } - - public void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout) throws Exception { - super.removeDestination(context, destination, timeout); - regionBroker.unregister(destination); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedTopicRegion.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedTopicRegion.class deleted file mode 100644 index 0481620f9..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedTopicRegion.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedTopicRegion.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedTopicRegion.java deleted file mode 100644 index 50fb998aa..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedTopicRegion.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * 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.broker.jmx; - -import javax.jms.JMSException; -import javax.management.ObjectName; - -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.DestinationFactory; -import org.apache.activemq.broker.region.DestinationStatistics; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.broker.region.TopicRegion; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.thread.TaskRunnerFactory; -import org.apache.activemq.usage.SystemUsage; - -public class ManagedTopicRegion extends TopicRegion { - - private final ManagedRegionBroker regionBroker; - - public ManagedTopicRegion(ManagedRegionBroker broker, DestinationStatistics destinationStatistics, SystemUsage memoryManager, TaskRunnerFactory taskRunnerFactory, - DestinationFactory destinationFactory) { - super(broker, destinationStatistics, memoryManager, taskRunnerFactory, destinationFactory); - regionBroker = broker; - } - - protected Subscription createSubscription(ConnectionContext context, ConsumerInfo info) throws JMSException { - Subscription sub = super.createSubscription(context, info); - ObjectName name = regionBroker.registerSubscription(context, sub); - sub.setObjectName(name); - return sub; - } - - protected void destroySubscription(Subscription sub) { - regionBroker.unregisterSubscription(sub); - super.destroySubscription(sub); - } - - protected Destination createDestination(ConnectionContext context, ActiveMQDestination destination) throws Exception { - Destination rc = super.createDestination(context, destination); - regionBroker.register(destination, rc); - return rc; - } - - public void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout) throws Exception { - super.removeDestination(context, destination, timeout); - regionBroker.unregister(destination); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedTransportConnection.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedTransportConnection.class deleted file mode 100644 index f1e893d7c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedTransportConnection.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedTransportConnection.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedTransportConnection.java deleted file mode 100644 index c79fdd737..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedTransportConnection.java +++ /dev/null @@ -1,125 +0,0 @@ -/** - * 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.broker.jmx; - -import java.io.IOException; - -import javax.management.ObjectName; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.TransportConnection; -import org.apache.activemq.broker.TransportConnector; -import org.apache.activemq.command.ConnectionInfo; -import org.apache.activemq.command.Response; -import org.apache.activemq.thread.TaskRunnerFactory; -import org.apache.activemq.transport.Transport; -import org.apache.activemq.util.IOExceptionSupport; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * A managed transport connection - */ -public class ManagedTransportConnection extends TransportConnection { - private static final Logger LOG = LoggerFactory.getLogger(ManagedTransportConnection.class); - - private final ManagementContext managementContext; - private final ObjectName connectorName; - private final ConnectionViewMBean mbean; - - private ObjectName byClientIdName; - private ObjectName byAddressName; - - private final boolean populateUserName; - - public ManagedTransportConnection(TransportConnector connector, Transport transport, Broker broker, - TaskRunnerFactory factory, TaskRunnerFactory stopFactory, - ManagementContext context, ObjectName connectorName) - throws IOException { - super(connector, transport, broker, factory, stopFactory); - this.managementContext = context; - this.connectorName = connectorName; - this.mbean = new ConnectionView(this, managementContext); - this.populateUserName = broker.getBrokerService().isPopulateUserNameInMBeans(); - if (managementContext.isAllowRemoteAddressInMBeanNames()) { - byAddressName = createObjectName("remoteAddress", transport.getRemoteAddress()); - registerMBean(byAddressName); - } - } - - @Override - public void stopAsync() { - if (!isStopping()) { - synchronized (this) { - unregisterMBean(byClientIdName); - unregisterMBean(byAddressName); - byClientIdName = null; - byAddressName = null; - } - } - super.stopAsync(); - } - - @Override - public Response processAddConnection(ConnectionInfo info) throws Exception { - Response answer = super.processAddConnection(info); - String clientId = info.getClientId(); - if (populateUserName) { - ((ConnectionView) mbean).setUserName(info.getUserName()); - } - if (clientId != null) { - if (byClientIdName == null) { - byClientIdName = createObjectName("clientId", clientId); - registerMBean(byClientIdName); - } - } - return answer; - } - - // Implementation methods - // ------------------------------------------------------------------------- - protected void registerMBean(ObjectName name) { - if (name != null) { - try { - AnnotatedMBean.registerMBean(managementContext, mbean, name); - } catch (Throwable e) { - LOG.warn("Failed to register MBean {}", name); - LOG.debug("Failure reason: ", e); - } - } - } - - protected void unregisterMBean(ObjectName name) { - if (name != null) { - try { - managementContext.unregisterMBean(name); - } catch (Throwable e) { - LOG.warn("Failed to unregister MBean {}", name); - LOG.debug("Failure reason: ", e); - } - } - } - - protected ObjectName createObjectName(String type, String value) throws IOException { - try { - return BrokerMBeanSupport.createConnectionViewByType(connectorName, type, value); - } catch (Throwable e) { - throw IOExceptionSupport.create(e); - } - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedTransportConnector.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedTransportConnector.class deleted file mode 100644 index c1b1a52ce..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedTransportConnector.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedTransportConnector.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedTransportConnector.java deleted file mode 100644 index 00d07dd0a..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagedTransportConnector.java +++ /dev/null @@ -1,62 +0,0 @@ -/** - * 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.broker.jmx; - -import org.apache.activemq.broker.Connection; -import org.apache.activemq.broker.TransportConnector; -import org.apache.activemq.transport.Transport; -import org.apache.activemq.transport.TransportServer; -import java.io.IOException; -import java.net.URISyntaxException; -import javax.management.MBeanServer; -import javax.management.ObjectName; - -/** - * A managed transport connector which can create multiple managed connections - * as clients connect. - * - * - */ -public class ManagedTransportConnector extends TransportConnector { - - static long nextConnectionId = 1; - - private final ManagementContext managementContext; - private final ObjectName connectorName; - - public ManagedTransportConnector(ManagementContext context, ObjectName connectorName, TransportServer server) { - super(server); - this.managementContext = context; - this.connectorName = connectorName; - } - - public ManagedTransportConnector asManagedConnector(MBeanServer mbeanServer, ObjectName connectorName) throws IOException, URISyntaxException { - return this; - } - - protected Connection createConnection(Transport transport) throws IOException { - // prefer to use task runner from broker service as stop task runner, as we can then - // tie it to the lifecycle of the broker service - return new ManagedTransportConnection(this, transport, getBroker(), isDisableAsyncDispatch() ? null : getTaskRunnerFactory(), - getBrokerService().getTaskRunnerFactory(), managementContext, connectorName); - } - - protected static synchronized long getNextConnectionId() { - return nextConnectionId++; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagementContext$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagementContext$1.class deleted file mode 100644 index 296b038b2..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagementContext$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagementContext.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagementContext.class deleted file mode 100644 index 2b24b77ee..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagementContext.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagementContext.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagementContext.java deleted file mode 100644 index e4275134d..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ManagementContext.java +++ /dev/null @@ -1,609 +0,0 @@ -/** - * 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.broker.jmx; - -import java.io.IOException; -import java.lang.reflect.Method; -import java.rmi.NoSuchObjectException; -import java.rmi.registry.LocateRegistry; -import java.rmi.registry.Registry; -import java.rmi.server.UnicastRemoteObject; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.atomic.AtomicBoolean; - -import javax.management.Attribute; -import javax.management.InstanceNotFoundException; -import javax.management.JMException; -import javax.management.MBeanServer; -import javax.management.MBeanServerFactory; -import javax.management.MBeanServerInvocationHandler; -import javax.management.MalformedObjectNameException; -import javax.management.ObjectInstance; -import javax.management.ObjectName; -import javax.management.QueryExp; -import javax.management.remote.JMXConnectorServer; -import javax.management.remote.JMXConnectorServerFactory; -import javax.management.remote.JMXServiceURL; - -import org.apache.activemq.Service; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.slf4j.MDC; - -/** - * An abstraction over JMX mbean registration - * - * @org.apache.xbean.XBean - * - */ -public class ManagementContext implements Service { - - /** - * Default activemq domain - */ - public static final String DEFAULT_DOMAIN = "org.apache.activemq"; - - private static final Logger LOG = LoggerFactory.getLogger(ManagementContext.class); - private MBeanServer beanServer; - private String jmxDomainName = DEFAULT_DOMAIN; - private boolean useMBeanServer = true; - private boolean createMBeanServer = true; - private boolean locallyCreateMBeanServer; - private boolean createConnector = true; - private boolean findTigerMbeanServer = true; - private String connectorHost = "localhost"; - private int connectorPort = 1099; - private Map environment; - private int rmiServerPort; - private String connectorPath = "/jmxrmi"; - private final AtomicBoolean started = new AtomicBoolean(false); - private final AtomicBoolean connectorStarting = new AtomicBoolean(false); - private JMXConnectorServer connectorServer; - private ObjectName namingServiceObjectName; - private Registry registry; - private final Map registeredMBeanNames = new ConcurrentHashMap(); - private boolean allowRemoteAddressInMBeanNames = true; - private String brokerName; - - public ManagementContext() { - this(null); - } - - public ManagementContext(MBeanServer server) { - this.beanServer = server; - } - - @Override - public void start() throws IOException { - // lets force the MBeanServer to be created if needed - if (started.compareAndSet(false, true)) { - - // fallback and use localhost - if (connectorHost == null) { - connectorHost = "localhost"; - } - - // force mbean server to be looked up, so we have it - getMBeanServer(); - - if (connectorServer != null) { - try { - if (getMBeanServer().isRegistered(namingServiceObjectName)) { - LOG.debug("Invoking start on mbean: {}", namingServiceObjectName); - getMBeanServer().invoke(namingServiceObjectName, "start", null, null); - } - } catch (Throwable ignore) { - LOG.debug("Error invoking start on MBean {}. This exception is ignored.", namingServiceObjectName, ignore); - } - - Thread t = new Thread("JMX connector") { - @Override - public void run() { - // ensure we use MDC logging with the broker name, so people can see the logs if MDC was in use - if (brokerName != null) { - MDC.put("activemq.broker", brokerName); - } - try { - JMXConnectorServer server = connectorServer; - if (started.get() && server != null) { - LOG.debug("Starting JMXConnectorServer..."); - connectorStarting.set(true); - try { - // need to remove MDC as we must not inherit MDC in child threads causing leaks - MDC.remove("activemq.broker"); - server.start(); - } finally { - if (brokerName != null) { - MDC.put("activemq.broker", brokerName); - } - connectorStarting.set(false); - } - LOG.info("JMX consoles can connect to {}", server.getAddress()); - } - } catch (IOException e) { - LOG.warn("Failed to start JMX connector {}. Will restart management to re-create JMX connector, trying to remedy this issue.", e.getMessage()); - LOG.debug("Reason for failed JMX connector start", e); - } finally { - MDC.remove("activemq.broker"); - } - } - }; - t.setDaemon(true); - t.start(); - } - } - } - - @Override - public void stop() throws Exception { - if (started.compareAndSet(true, false)) { - MBeanServer mbeanServer = getMBeanServer(); - - // unregister the mbeans we have registered - if (mbeanServer != null) { - for (Map.Entry entry : registeredMBeanNames.entrySet()) { - ObjectName actualName = entry.getValue(); - if (actualName != null && beanServer.isRegistered(actualName)) { - LOG.debug("Unregistering MBean {}", actualName); - mbeanServer.unregisterMBean(actualName); - } - } - } - registeredMBeanNames.clear(); - - JMXConnectorServer server = connectorServer; - connectorServer = null; - if (server != null) { - try { - if (!connectorStarting.get()) { - LOG.debug("Stopping jmx connector"); - server.stop(); - } - } catch (IOException e) { - LOG.warn("Failed to stop jmx connector: {}", e.getMessage()); - } - // stop naming service mbean - try { - if (namingServiceObjectName != null && getMBeanServer().isRegistered(namingServiceObjectName)) { - LOG.debug("Stopping MBean {}", namingServiceObjectName); - getMBeanServer().invoke(namingServiceObjectName, "stop", null, null); - LOG.debug("Unregistering MBean {}", namingServiceObjectName); - getMBeanServer().unregisterMBean(namingServiceObjectName); - } - } catch (Throwable ignore) { - LOG.warn("Error stopping and unregsitering MBean {} due to {}", namingServiceObjectName, ignore.getMessage()); - } - namingServiceObjectName = null; - } - - if (locallyCreateMBeanServer && beanServer != null) { - // check to see if the factory knows about this server - List list = MBeanServerFactory.findMBeanServer(null); - if (list != null && !list.isEmpty() && list.contains(beanServer)) { - LOG.debug("Releasing MBeanServer {}", beanServer); - MBeanServerFactory.releaseMBeanServer(beanServer); - } - } - beanServer = null; - } - - // Un-export JMX RMI registry, if it was created - if (registry != null) { - try { - UnicastRemoteObject.unexportObject(registry, true); - LOG.debug("Unexported JMX RMI Registry"); - } catch (NoSuchObjectException e) { - LOG.debug("Error occurred while unexporting JMX RMI registry. This exception will be ignored."); - } - - registry = null; - } - } - - /** - * Gets the broker name this context is used by, may be null - * if the broker name was not set. - */ - public String getBrokerName() { - return brokerName; - } - - /** - * Sets the broker name this context is being used by. - */ - public void setBrokerName(String brokerName) { - this.brokerName = brokerName; - } - - /** - * @return Returns the jmxDomainName. - */ - public String getJmxDomainName() { - return jmxDomainName; - } - - /** - * @param jmxDomainName The jmxDomainName to set. - */ - public void setJmxDomainName(String jmxDomainName) { - this.jmxDomainName = jmxDomainName; - } - - /** - * Get the MBeanServer - * - * @return the MBeanServer - */ - protected MBeanServer getMBeanServer() { - if (this.beanServer == null) { - this.beanServer = findMBeanServer(); - } - return beanServer; - } - - /** - * Set the MBeanServer - * - * @param beanServer - */ - public void setMBeanServer(MBeanServer beanServer) { - this.beanServer = beanServer; - } - - /** - * @return Returns the useMBeanServer. - */ - public boolean isUseMBeanServer() { - return useMBeanServer; - } - - /** - * @param useMBeanServer The useMBeanServer to set. - */ - public void setUseMBeanServer(boolean useMBeanServer) { - this.useMBeanServer = useMBeanServer; - } - - /** - * @return Returns the createMBeanServer flag. - */ - public boolean isCreateMBeanServer() { - return createMBeanServer; - } - - /** - * @param enableJMX Set createMBeanServer. - */ - public void setCreateMBeanServer(boolean enableJMX) { - this.createMBeanServer = enableJMX; - } - - public boolean isFindTigerMbeanServer() { - return findTigerMbeanServer; - } - - public boolean isConnectorStarted() { - return connectorStarting.get() || (connectorServer != null && connectorServer.isActive()); - } - - /** - * Enables/disables the searching for the Java 5 platform MBeanServer - */ - public void setFindTigerMbeanServer(boolean findTigerMbeanServer) { - this.findTigerMbeanServer = findTigerMbeanServer; - } - - /** - * Formulate and return the MBean ObjectName of a custom control MBean - * - * @param type - * @param name - * @return the JMX ObjectName of the MBean, or null if - * customName is invalid. - */ - public ObjectName createCustomComponentMBeanName(String type, String name) { - ObjectName result = null; - String tmp = jmxDomainName + ":" + "type=" + sanitizeString(type) + ",name=" + sanitizeString(name); - try { - result = new ObjectName(tmp); - } catch (MalformedObjectNameException e) { - LOG.error("Couldn't create ObjectName from: {}, {}", type, name); - } - return result; - } - - /** - * The ':' and '/' characters are reserved in ObjectNames - * - * @param in - * @return sanitized String - */ - private static String sanitizeString(String in) { - String result = null; - if (in != null) { - result = in.replace(':', '_'); - result = result.replace('/', '_'); - result = result.replace('\\', '_'); - } - return result; - } - - /** - * Retrieve an System ObjectName - * - * @param domainName - * @param containerName - * @param theClass - * @return the ObjectName - * @throws MalformedObjectNameException - */ - public static ObjectName getSystemObjectName(String domainName, String containerName, Class theClass) throws MalformedObjectNameException, NullPointerException { - String tmp = domainName + ":" + "type=" + theClass.getName() + ",name=" + getRelativeName(containerName, theClass); - return new ObjectName(tmp); - } - - private static String getRelativeName(String containerName, Class theClass) { - String name = theClass.getName(); - int index = name.lastIndexOf("."); - if (index >= 0 && (index + 1) < name.length()) { - name = name.substring(index + 1); - } - return containerName + "." + name; - } - - public Object newProxyInstance(ObjectName objectName, Class interfaceClass, boolean notificationBroadcaster){ - return MBeanServerInvocationHandler.newProxyInstance(getMBeanServer(), objectName, interfaceClass, notificationBroadcaster); - } - - public Object getAttribute(ObjectName name, String attribute) throws Exception{ - return getMBeanServer().getAttribute(name, attribute); - } - - public ObjectInstance registerMBean(Object bean, ObjectName name) throws Exception{ - ObjectInstance result = getMBeanServer().registerMBean(bean, name); - this.registeredMBeanNames.put(name, result.getObjectName()); - return result; - } - - public Set queryNames(ObjectName name, QueryExp query) throws Exception{ - if (name != null) { - ObjectName actualName = this.registeredMBeanNames.get(name); - if (actualName != null) { - return getMBeanServer().queryNames(actualName, query); - } - } - return getMBeanServer().queryNames(name, query); - } - - public ObjectInstance getObjectInstance(ObjectName name) throws InstanceNotFoundException { - return getMBeanServer().getObjectInstance(name); - } - - /** - * Unregister an MBean - * - * @param name - * @throws JMException - */ - public void unregisterMBean(ObjectName name) throws JMException { - ObjectName actualName = this.registeredMBeanNames.get(name); - if (beanServer != null && actualName != null && beanServer.isRegistered(actualName) && this.registeredMBeanNames.remove(name) != null) { - LOG.debug("Unregistering MBean {}", actualName); - beanServer.unregisterMBean(actualName); - } - } - - protected synchronized MBeanServer findMBeanServer() { - MBeanServer result = null; - - try { - if (useMBeanServer) { - if (findTigerMbeanServer) { - result = findTigerMBeanServer(); - } - if (result == null) { - // lets piggy back on another MBeanServer - we could be in an appserver! - List list = MBeanServerFactory.findMBeanServer(null); - if (list != null && list.size() > 0) { - result = list.get(0); - } - } - } - if (result == null && createMBeanServer) { - result = createMBeanServer(); - } - } catch (NoClassDefFoundError e) { - LOG.error("Could not load MBeanServer", e); - } catch (Throwable e) { - // probably don't have access to system properties - LOG.error("Failed to initialize MBeanServer", e); - } - return result; - } - - public MBeanServer findTigerMBeanServer() { - String name = "java.lang.management.ManagementFactory"; - Class type = loadClass(name, ManagementContext.class.getClassLoader()); - if (type != null) { - try { - Method method = type.getMethod("getPlatformMBeanServer", new Class[0]); - if (method != null) { - Object answer = method.invoke(null, new Object[0]); - if (answer instanceof MBeanServer) { - if (createConnector) { - createConnector((MBeanServer)answer); - } - return (MBeanServer)answer; - } else { - LOG.warn("Could not cast: {} into an MBeanServer. There must be some classloader strangeness in town", answer); - } - } else { - LOG.warn("Method getPlatformMBeanServer() does not appear visible on type: {}", type.getName()); - } - } catch (Exception e) { - LOG.warn("Failed to call getPlatformMBeanServer() due to: ", e); - } - } else { - LOG.trace("Class not found: {} so probably running on Java 1.4", name); - } - return null; - } - - private static Class loadClass(String name, ClassLoader loader) { - try { - return loader.loadClass(name); - } catch (ClassNotFoundException e) { - try { - return Thread.currentThread().getContextClassLoader().loadClass(name); - } catch (ClassNotFoundException e1) { - return null; - } - } - } - - /** - * @return - * @throws NullPointerException - * @throws MalformedObjectNameException - * @throws IOException - */ - protected MBeanServer createMBeanServer() throws MalformedObjectNameException, IOException { - MBeanServer mbeanServer = MBeanServerFactory.createMBeanServer(jmxDomainName); - locallyCreateMBeanServer = true; - if (createConnector) { - createConnector(mbeanServer); - } - return mbeanServer; - } - - /** - * @param mbeanServer - * @throws MalformedObjectNameException - * @throws IOException - */ - private void createConnector(MBeanServer mbeanServer) throws MalformedObjectNameException, IOException { - // Create the NamingService, needed by JSR 160 - try { - if (registry == null) { - LOG.debug("Creating RMIRegistry on port {}", connectorPort); - registry = LocateRegistry.createRegistry(connectorPort); - } - namingServiceObjectName = ObjectName.getInstance("naming:type=rmiregistry"); - - // Do not use the createMBean as the mx4j jar may not be in the - // same class loader than the server - Class cl = Class.forName("mx4j.tools.naming.NamingService"); - mbeanServer.registerMBean(cl.newInstance(), namingServiceObjectName); - - // set the naming port - Attribute attr = new Attribute("Port", Integer.valueOf(connectorPort)); - mbeanServer.setAttribute(namingServiceObjectName, attr); - } catch(ClassNotFoundException e) { - LOG.debug("Probably not using JRE 1.4: {}", e.getLocalizedMessage()); - } catch (Throwable e) { - LOG.debug("Failed to create local registry. This exception will be ignored.", e); - } - - // Create the JMXConnectorServer - String rmiServer = ""; - if (rmiServerPort != 0) { - // This is handy to use if you have a firewall and need to force JMX to use fixed ports. - rmiServer = ""+getConnectorHost()+":" + rmiServerPort; - } - String serviceURL = "service:jmx:rmi://" + rmiServer + "/jndi/rmi://" +getConnectorHost()+":" + connectorPort + connectorPath; - JMXServiceURL url = new JMXServiceURL(serviceURL); - connectorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, environment, mbeanServer); - - LOG.debug("Created JMXConnectorServer {}", connectorServer); - } - - public String getConnectorPath() { - return connectorPath; - } - - public void setConnectorPath(String connectorPath) { - this.connectorPath = connectorPath; - } - - public int getConnectorPort() { - return connectorPort; - } - - /** - * @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.MemoryIntPropertyEditor" - */ - public void setConnectorPort(int connectorPort) { - this.connectorPort = connectorPort; - } - - public int getRmiServerPort() { - return rmiServerPort; - } - - /** - * @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.MemoryIntPropertyEditor" - */ - public void setRmiServerPort(int rmiServerPort) { - this.rmiServerPort = rmiServerPort; - } - - public boolean isCreateConnector() { - return createConnector; - } - - /** - * @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.BooleanEditor" - */ - public void setCreateConnector(boolean createConnector) { - this.createConnector = createConnector; - } - - /** - * Get the connectorHost - * @return the connectorHost - */ - public String getConnectorHost() { - return this.connectorHost; - } - - /** - * Set the connectorHost - * @param connectorHost the connectorHost to set - */ - public void setConnectorHost(String connectorHost) { - this.connectorHost = connectorHost; - } - - public Map getEnvironment() { - return environment; - } - - public void setEnvironment(Map environment) { - this.environment = environment; - } - - public boolean isAllowRemoteAddressInMBeanNames() { - return allowRemoteAddressInMBeanNames; - } - - public void setAllowRemoteAddressInMBeanNames(boolean allowRemoteAddressInMBeanNames) { - this.allowRemoteAddressInMBeanNames = allowRemoteAddressInMBeanNames; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/NetworkBridgeView.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/NetworkBridgeView.class deleted file mode 100644 index 0b3dd420f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/NetworkBridgeView.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/NetworkBridgeView.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/NetworkBridgeView.java deleted file mode 100644 index 2201b306a..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/NetworkBridgeView.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * 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.broker.jmx; - -import org.apache.activemq.network.NetworkBridge; - -public class NetworkBridgeView implements NetworkBridgeViewMBean { - - private final NetworkBridge bridge; - private boolean createByDuplex = false; - - public NetworkBridgeView(NetworkBridge bridge) { - this.bridge = bridge; - } - - public void start() throws Exception { - bridge.start(); - } - - public void stop() throws Exception { - bridge.stop(); - } - - public String getLocalAddress() { - return bridge.getLocalAddress(); - } - - public String getRemoteAddress() { - return bridge.getRemoteAddress(); - } - - public String getRemoteBrokerName() { - return bridge.getRemoteBrokerName(); - } - - public String getLocalBrokerName() { - return bridge.getLocalBrokerName(); - } - - public long getEnqueueCounter() { - return bridge.getEnqueueCounter(); - } - - public long getDequeueCounter() { - return bridge.getDequeueCounter(); - } - - public boolean isCreatedByDuplex() { - return createByDuplex; - } - - public void setCreateByDuplex(boolean createByDuplex) { - this.createByDuplex = createByDuplex; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/NetworkBridgeViewMBean.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/NetworkBridgeViewMBean.class deleted file mode 100644 index 7a6144c1f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/NetworkBridgeViewMBean.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/NetworkBridgeViewMBean.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/NetworkBridgeViewMBean.java deleted file mode 100644 index ec7598c54..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/NetworkBridgeViewMBean.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * 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.broker.jmx; - -import org.apache.activemq.Service; - -public interface NetworkBridgeViewMBean extends Service { - - String getLocalAddress(); - - String getRemoteAddress(); - - String getRemoteBrokerName(); - - String getLocalBrokerName(); - - long getEnqueueCounter(); - - long getDequeueCounter(); - - boolean isCreatedByDuplex(); - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/NetworkConnectorView.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/NetworkConnectorView.class deleted file mode 100644 index 4f5a7fa79..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/NetworkConnectorView.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/NetworkConnectorView.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/NetworkConnectorView.java deleted file mode 100644 index e0bae889f..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/NetworkConnectorView.java +++ /dev/null @@ -1,145 +0,0 @@ -/** - * 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.broker.jmx; - -import org.apache.activemq.network.NetworkConnector; - -public class NetworkConnectorView implements NetworkConnectorViewMBean { - - private final NetworkConnector connector; - - public NetworkConnectorView(NetworkConnector connector) { - this.connector = connector; - } - - public void start() throws Exception { - connector.start(); - } - - public void stop() throws Exception { - connector.stop(); - } - - public String getName() { - return connector.getName(); - } - - public int getMessageTTL() { - return connector.getMessageTTL(); - } - - public int getConsumerTTL() { - return connector.getConsumerTTL(); - } - - public int getPrefetchSize() { - return connector.getPrefetchSize(); - } - - public String getUserName() { - return connector.getUserName(); - } - - public boolean isBridgeTempDestinations() { - return connector.isBridgeTempDestinations(); - } - - public boolean isConduitSubscriptions() { - return connector.isConduitSubscriptions(); - } - - public boolean isDecreaseNetworkConsumerPriority() { - return connector.isDecreaseNetworkConsumerPriority(); - } - - public boolean isDispatchAsync() { - return connector.isDispatchAsync(); - } - - public boolean isDynamicOnly() { - return connector.isDynamicOnly(); - } - - public boolean isDuplex() { - return connector.isDuplex(); - } - - public boolean isSuppressDuplicateQueueSubscriptions() { - return connector.isSuppressDuplicateQueueSubscriptions(); - } - - public boolean isSuppressDuplicateTopicSubscriptions() { - return connector.isSuppressDuplicateTopicSubscriptions(); - } - - public void setBridgeTempDestinations(boolean bridgeTempDestinations) { - connector.setBridgeTempDestinations(bridgeTempDestinations); - } - - public void setConduitSubscriptions(boolean conduitSubscriptions) { - connector.setConduitSubscriptions(conduitSubscriptions); - } - - public void setDispatchAsync(boolean dispatchAsync) { - connector.setDispatchAsync(dispatchAsync); - } - - public void setDynamicOnly(boolean dynamicOnly) { - connector.setDynamicOnly(dynamicOnly); - } - - public void setMessageTTL(int messageTTL) { - connector.setMessageTTL(messageTTL); - } - - public void setConsumerTTL(int consumerTTL) { - connector.setConsumerTTL(consumerTTL); - } - - public void setPassword(String password) { - connector.setPassword(password); - } - - public void setPrefetchSize(int prefetchSize) { - connector.setPrefetchSize(prefetchSize); - } - - public void setUserName(String userName) { - connector.setUserName(userName); - } - - public String getPassword() { - String pw = connector.getPassword(); - // Hide the password for security reasons. - if (pw != null) { - pw = pw.replaceAll(".", "*"); - } - return pw; - } - - public void setDecreaseNetworkConsumerPriority(boolean decreaseNetworkConsumerPriority) { - connector.setDecreaseNetworkConsumerPriority(decreaseNetworkConsumerPriority); - } - - public void setSuppressDuplicateQueueSubscriptions(boolean val) { - connector.setSuppressDuplicateQueueSubscriptions(val); - } - - public void setSuppressDuplicateTopicSubscriptions(boolean val) { - connector.setSuppressDuplicateTopicSubscriptions(val); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/NetworkConnectorViewMBean.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/NetworkConnectorViewMBean.class deleted file mode 100644 index ca6b3c50a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/NetworkConnectorViewMBean.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/NetworkConnectorViewMBean.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/NetworkConnectorViewMBean.java deleted file mode 100644 index ab7b86561..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/NetworkConnectorViewMBean.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * 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.broker.jmx; - -import org.apache.activemq.Service; - -public interface NetworkConnectorViewMBean extends Service { - - String getName(); - - int getMessageTTL(); - - int getConsumerTTL(); - - int getPrefetchSize(); - - String getUserName(); - - boolean isBridgeTempDestinations(); - - boolean isConduitSubscriptions(); - - boolean isDecreaseNetworkConsumerPriority(); - - boolean isDispatchAsync(); - - boolean isDynamicOnly(); - - boolean isDuplex(); - - boolean isSuppressDuplicateQueueSubscriptions(); - - boolean isSuppressDuplicateTopicSubscriptions(); - - void setBridgeTempDestinations(boolean bridgeTempDestinations); - - void setConduitSubscriptions(boolean conduitSubscriptions); - - void setDispatchAsync(boolean dispatchAsync); - - void setDynamicOnly(boolean dynamicOnly); - - void setMessageTTL(int messageTTL); - - void setConsumerTTL(int consumerTTL); - - void setPassword(String password); - - void setPrefetchSize(int prefetchSize); - - void setUserName(String userName); - - String getPassword(); - - void setDecreaseNetworkConsumerPriority(boolean decreaseNetworkConsumerPriority); - - void setSuppressDuplicateQueueSubscriptions(boolean val); - - void setSuppressDuplicateTopicSubscriptions(boolean val); - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport$AbstractOpenTypeFactory.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport$AbstractOpenTypeFactory.class deleted file mode 100644 index d7a307949..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport$AbstractOpenTypeFactory.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport$ActiveMQBlobMessageOpenTypeFactory.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport$ActiveMQBlobMessageOpenTypeFactory.class deleted file mode 100644 index 51b50af16..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport$ActiveMQBlobMessageOpenTypeFactory.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport$ByteMessageOpenTypeFactory.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport$ByteMessageOpenTypeFactory.class deleted file mode 100644 index ae7d0095b..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport$ByteMessageOpenTypeFactory.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport$HealthStatusOpenTypeFactory.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport$HealthStatusOpenTypeFactory.class deleted file mode 100644 index 948e60583..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport$HealthStatusOpenTypeFactory.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport$JobOpenTypeFactory.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport$JobOpenTypeFactory.class deleted file mode 100644 index 9d0865a4a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport$JobOpenTypeFactory.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport$MapMessageOpenTypeFactory.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport$MapMessageOpenTypeFactory.class deleted file mode 100644 index 7e7f792dd..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport$MapMessageOpenTypeFactory.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport$MessageOpenTypeFactory.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport$MessageOpenTypeFactory.class deleted file mode 100644 index 1c7cfe5da..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport$MessageOpenTypeFactory.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport$ObjectMessageOpenTypeFactory.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport$ObjectMessageOpenTypeFactory.class deleted file mode 100644 index c19fc4285..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport$ObjectMessageOpenTypeFactory.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport$OpenTypeFactory.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport$OpenTypeFactory.class deleted file mode 100644 index c54dc236e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport$OpenTypeFactory.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport$SlowConsumerEntryOpenTypeFactory.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport$SlowConsumerEntryOpenTypeFactory.class deleted file mode 100644 index 729398643..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport$SlowConsumerEntryOpenTypeFactory.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport$StreamMessageOpenTypeFactory.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport$StreamMessageOpenTypeFactory.class deleted file mode 100644 index fca8b9c66..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport$StreamMessageOpenTypeFactory.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport$TextMessageOpenTypeFactory.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport$TextMessageOpenTypeFactory.class deleted file mode 100644 index 8ec4ffa38..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport$TextMessageOpenTypeFactory.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport.class deleted file mode 100644 index 86ce04a09..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport.java deleted file mode 100644 index d542d36d7..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/OpenTypeSupport.java +++ /dev/null @@ -1,548 +0,0 @@ -/** - * 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.broker.jmx; - -import org.apache.activemq.broker.region.policy.SlowConsumerEntry; -import org.apache.activemq.broker.scheduler.Job; -import org.apache.activemq.command.ActiveMQBlobMessage; -import org.apache.activemq.command.ActiveMQBytesMessage; -import org.apache.activemq.command.ActiveMQMapMessage; -import org.apache.activemq.command.ActiveMQMessage; -import org.apache.activemq.command.ActiveMQObjectMessage; -import org.apache.activemq.command.ActiveMQStreamMessage; -import org.apache.activemq.command.ActiveMQTextMessage; -import org.fusesource.hawtbuf.UTF8Buffer; - -import javax.jms.DeliveryMode; -import javax.jms.JMSException; -import javax.management.openmbean.ArrayType; -import javax.management.openmbean.CompositeData; -import javax.management.openmbean.CompositeDataSupport; -import javax.management.openmbean.CompositeType; -import javax.management.openmbean.OpenDataException; -import javax.management.openmbean.OpenType; -import javax.management.openmbean.SimpleType; -import javax.management.openmbean.TabularDataSupport; -import javax.management.openmbean.TabularType; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -public final class OpenTypeSupport { - - public interface OpenTypeFactory { - CompositeType getCompositeType() throws OpenDataException; - - Map getFields(Object o) throws OpenDataException; - } - - private static final Map OPEN_TYPE_FACTORIES = new HashMap(); - - public abstract static class AbstractOpenTypeFactory implements OpenTypeFactory { - - private CompositeType compositeType; - private final List itemNamesList = new ArrayList(); - private final List itemDescriptionsList = new ArrayList(); - private final List itemTypesList = new ArrayList(); - - public CompositeType getCompositeType() throws OpenDataException { - if (compositeType == null) { - init(); - compositeType = createCompositeType(); - } - return compositeType; - } - - protected void init() throws OpenDataException { - } - - protected CompositeType createCompositeType() throws OpenDataException { - String[] itemNames = itemNamesList.toArray(new String[itemNamesList.size()]); - String[] itemDescriptions = itemDescriptionsList.toArray(new String[itemDescriptionsList.size()]); - OpenType[] itemTypes = itemTypesList.toArray(new OpenType[itemTypesList.size()]); - return new CompositeType(getTypeName(), getDescription(), itemNames, itemDescriptions, itemTypes); - } - - protected abstract String getTypeName(); - - protected void addItem(String name, String description, OpenType type) { - itemNamesList.add(name); - itemDescriptionsList.add(description); - itemTypesList.add(type); - } - - protected String getDescription() { - return getTypeName(); - } - - public Map getFields(Object o) throws OpenDataException { - Map rc = new HashMap(); - return rc; - } - } - - static class MessageOpenTypeFactory extends AbstractOpenTypeFactory { - protected TabularType stringPropertyTabularType; - protected TabularType booleanPropertyTabularType; - protected TabularType bytePropertyTabularType; - protected TabularType shortPropertyTabularType; - protected TabularType intPropertyTabularType; - protected TabularType longPropertyTabularType; - protected TabularType floatPropertyTabularType; - protected TabularType doublePropertyTabularType; - - @Override - protected String getTypeName() { - return ActiveMQMessage.class.getName(); - } - - @Override - protected void init() throws OpenDataException { - super.init(); - addItem("JMSCorrelationID", "JMSCorrelationID", SimpleType.STRING); - addItem("JMSDestination", "JMSDestination", SimpleType.STRING); - addItem("JMSMessageID", "JMSMessageID", SimpleType.STRING); - addItem("JMSReplyTo", "JMSReplyTo", SimpleType.STRING); - addItem("JMSType", "JMSType", SimpleType.STRING); - addItem("JMSDeliveryMode", "JMSDeliveryMode", SimpleType.STRING); - addItem("JMSExpiration", "JMSExpiration", SimpleType.LONG); - addItem("JMSPriority", "JMSPriority", SimpleType.INTEGER); - addItem("JMSRedelivered", "JMSRedelivered", SimpleType.BOOLEAN); - addItem("JMSTimestamp", "JMSTimestamp", SimpleType.DATE); - addItem(CompositeDataConstants.JMSXGROUP_ID, "Message Group ID", SimpleType.STRING); - addItem(CompositeDataConstants.JMSXGROUP_SEQ, "Message Group Sequence Number", SimpleType.INTEGER); - addItem(CompositeDataConstants.JMSXUSER_ID, "The user that sent the message", SimpleType.STRING); - addItem(CompositeDataConstants.BROKER_PATH, "Brokers traversed", SimpleType.STRING); - addItem(CompositeDataConstants.ORIGINAL_DESTINATION, "Original Destination Before Senting To DLQ", SimpleType.STRING); - addItem(CompositeDataConstants.PROPERTIES, "User Properties Text", SimpleType.STRING); - - // now lets expose the type safe properties - stringPropertyTabularType = createTabularType(String.class, SimpleType.STRING); - booleanPropertyTabularType = createTabularType(Boolean.class, SimpleType.BOOLEAN); - bytePropertyTabularType = createTabularType(Byte.class, SimpleType.BYTE); - shortPropertyTabularType = createTabularType(Short.class, SimpleType.SHORT); - intPropertyTabularType = createTabularType(Integer.class, SimpleType.INTEGER); - longPropertyTabularType = createTabularType(Long.class, SimpleType.LONG); - floatPropertyTabularType = createTabularType(Float.class, SimpleType.FLOAT); - doublePropertyTabularType = createTabularType(Double.class, SimpleType.DOUBLE); - - addItem(CompositeDataConstants.STRING_PROPERTIES, "User String Properties", stringPropertyTabularType); - addItem(CompositeDataConstants.BOOLEAN_PROPERTIES, "User Boolean Properties", booleanPropertyTabularType); - addItem(CompositeDataConstants.BYTE_PROPERTIES, "User Byte Properties", bytePropertyTabularType); - addItem(CompositeDataConstants.SHORT_PROPERTIES, "User Short Properties", shortPropertyTabularType); - addItem(CompositeDataConstants.INT_PROPERTIES, "User Integer Properties", intPropertyTabularType); - addItem(CompositeDataConstants.LONG_PROPERTIES, "User Long Properties", longPropertyTabularType); - addItem(CompositeDataConstants.FLOAT_PROPERTIES, "User Float Properties", floatPropertyTabularType); - addItem(CompositeDataConstants.DOUBLE_PROPERTIES, "User Double Properties", doublePropertyTabularType); - } - - @Override - public Map getFields(Object o) throws OpenDataException { - ActiveMQMessage m = (ActiveMQMessage)o; - Map rc = super.getFields(o); - rc.put("JMSCorrelationID", m.getJMSCorrelationID()); - rc.put("JMSDestination", "" + m.getJMSDestination()); - rc.put("JMSMessageID", m.getJMSMessageID()); - rc.put("JMSReplyTo",toString(m.getJMSReplyTo())); - rc.put("JMSType", m.getJMSType()); - rc.put("JMSDeliveryMode", m.getJMSDeliveryMode() == DeliveryMode.PERSISTENT ? "PERSISTENT" : "NON-PERSISTENT"); - rc.put("JMSExpiration", Long.valueOf(m.getJMSExpiration())); - rc.put("JMSPriority", Integer.valueOf(m.getJMSPriority())); - rc.put("JMSRedelivered", Boolean.valueOf(m.getJMSRedelivered())); - rc.put("JMSTimestamp", new Date(m.getJMSTimestamp())); - rc.put(CompositeDataConstants.JMSXGROUP_ID, m.getGroupID()); - rc.put(CompositeDataConstants.JMSXGROUP_SEQ, m.getGroupSequence()); - rc.put(CompositeDataConstants.JMSXUSER_ID, m.getUserID()); - rc.put(CompositeDataConstants.BROKER_PATH, Arrays.toString(m.getBrokerPath())); - rc.put(CompositeDataConstants.ORIGINAL_DESTINATION, toString(m.getOriginalDestination())); - try { - rc.put(CompositeDataConstants.PROPERTIES, "" + m.getProperties()); - } catch (IOException e) { - rc.put(CompositeDataConstants.PROPERTIES, ""); - } - - try { - rc.put(CompositeDataConstants.STRING_PROPERTIES, createTabularData(m, stringPropertyTabularType, String.class)); - } catch (IOException e) { - rc.put(CompositeDataConstants.STRING_PROPERTIES, new TabularDataSupport(stringPropertyTabularType)); - } - try { - rc.put(CompositeDataConstants.BOOLEAN_PROPERTIES, createTabularData(m, booleanPropertyTabularType, Boolean.class)); - } catch (IOException e) { - rc.put(CompositeDataConstants.BOOLEAN_PROPERTIES, new TabularDataSupport(booleanPropertyTabularType)); - } - try { - rc.put(CompositeDataConstants.BYTE_PROPERTIES, createTabularData(m, bytePropertyTabularType, Byte.class)); - } catch (IOException e) { - rc.put(CompositeDataConstants.BYTE_PROPERTIES, new TabularDataSupport(bytePropertyTabularType)); - } - try { - rc.put(CompositeDataConstants.SHORT_PROPERTIES, createTabularData(m, shortPropertyTabularType, Short.class)); - } catch (IOException e) { - rc.put(CompositeDataConstants.SHORT_PROPERTIES, new TabularDataSupport(shortPropertyTabularType)); - } - try { - rc.put(CompositeDataConstants.INT_PROPERTIES, createTabularData(m, intPropertyTabularType, Integer.class)); - } catch (IOException e) { - rc.put(CompositeDataConstants.INT_PROPERTIES, new TabularDataSupport(intPropertyTabularType)); - } - try { - rc.put(CompositeDataConstants.LONG_PROPERTIES, createTabularData(m, longPropertyTabularType, Long.class)); - } catch (IOException e) { - rc.put(CompositeDataConstants.LONG_PROPERTIES, new TabularDataSupport(longPropertyTabularType)); - } - try { - rc.put(CompositeDataConstants.FLOAT_PROPERTIES, createTabularData(m, floatPropertyTabularType, Float.class)); - } catch (IOException e) { - rc.put(CompositeDataConstants.FLOAT_PROPERTIES, new TabularDataSupport(floatPropertyTabularType)); - } - try { - rc.put(CompositeDataConstants.DOUBLE_PROPERTIES, createTabularData(m, doublePropertyTabularType, Double.class)); - } catch (IOException e) { - rc.put(CompositeDataConstants.DOUBLE_PROPERTIES, new TabularDataSupport(doublePropertyTabularType)); - } - return rc; - } - - protected String toString(Object value) { - if (value == null) { - return null; - } - return value.toString(); - } - - - protected TabularType createTabularType(Class type, OpenType openType) throws OpenDataException { - String typeName = "java.util.Map"; - String[] keyValue = new String[]{"key", "value"}; - OpenType[] openTypes = new OpenType[]{SimpleType.STRING, openType}; - CompositeType rowType = new CompositeType(typeName, typeName, keyValue, keyValue, openTypes); - return new TabularType(typeName, typeName, rowType, new String[]{"key"}); - } - - protected TabularDataSupport createTabularData(ActiveMQMessage m, TabularType type, Class valueType) throws IOException, OpenDataException { - TabularDataSupport answer = new TabularDataSupport(type); - Set> entries = m.getProperties().entrySet(); - for (Map.Entry entry : entries) { - Object value = entry.getValue(); - if (value instanceof UTF8Buffer && valueType.equals(String.class)) { - String actual = value.toString(); - CompositeDataSupport compositeData = createTabularRowValue(type, entry.getKey(), actual); - answer.put(compositeData); - } - if (valueType.isInstance(value)) { - CompositeDataSupport compositeData = createTabularRowValue(type, entry.getKey(), value); - answer.put(compositeData); - } - } - return answer; - } - - protected CompositeDataSupport createTabularRowValue(TabularType type, String key, Object value) throws OpenDataException { - Map fields = new HashMap(); - fields.put("key", key); - fields.put("value", value); - return new CompositeDataSupport(type.getRowType(), fields); - } - } - - static class ByteMessageOpenTypeFactory extends MessageOpenTypeFactory { - - - @Override - protected String getTypeName() { - return ActiveMQBytesMessage.class.getName(); - } - - @Override - protected void init() throws OpenDataException { - super.init(); - addItem(CompositeDataConstants.BODY_LENGTH, "Body length", SimpleType.LONG); - addItem(CompositeDataConstants.BODY_PREVIEW, "Body preview", new ArrayType(1, SimpleType.BYTE)); - } - - @Override - public Map getFields(Object o) throws OpenDataException { - ActiveMQBytesMessage m = (ActiveMQBytesMessage)o; - m.setReadOnlyBody(true); - Map rc = super.getFields(o); - long length = 0; - try { - length = m.getBodyLength(); - rc.put(CompositeDataConstants.BODY_LENGTH, Long.valueOf(length)); - } catch (JMSException e) { - rc.put(CompositeDataConstants.BODY_LENGTH, Long.valueOf(0)); - } - try { - byte preview[] = new byte[(int)Math.min(length, 255)]; - m.readBytes(preview); - m.reset(); - - // This is whack! Java 1.5 JMX spec does not support primitive - // arrays! - // In 1.6 it seems it is supported.. but until then... - Byte data[] = new Byte[preview.length]; - for (int i = 0; i < data.length; i++) { - data[i] = new Byte(preview[i]); - } - - rc.put(CompositeDataConstants.BODY_PREVIEW, data); - } catch (JMSException e) { - rc.put(CompositeDataConstants.BODY_PREVIEW, new Byte[] {}); - } - return rc; - } - - } - - static class MapMessageOpenTypeFactory extends MessageOpenTypeFactory { - - @Override - protected String getTypeName() { - return ActiveMQMapMessage.class.getName(); - } - - @Override - protected void init() throws OpenDataException { - super.init(); - addItem(CompositeDataConstants.CONTENT_MAP, "Content map", SimpleType.STRING); - } - - @Override - public Map getFields(Object o) throws OpenDataException { - ActiveMQMapMessage m = (ActiveMQMapMessage)o; - Map rc = super.getFields(o); - try { - rc.put(CompositeDataConstants.CONTENT_MAP, "" + m.getContentMap()); - } catch (JMSException e) { - rc.put(CompositeDataConstants.CONTENT_MAP, ""); - } - return rc; - } - } - - static class ObjectMessageOpenTypeFactory extends MessageOpenTypeFactory { - @Override - protected String getTypeName() { - return ActiveMQObjectMessage.class.getName(); - } - - @Override - protected void init() throws OpenDataException { - super.init(); - } - - @Override - public Map getFields(Object o) throws OpenDataException { - Map rc = super.getFields(o); - return rc; - } - } - - static class StreamMessageOpenTypeFactory extends MessageOpenTypeFactory { - @Override - protected String getTypeName() { - return ActiveMQStreamMessage.class.getName(); - } - - @Override - protected void init() throws OpenDataException { - super.init(); - } - - @Override - public Map getFields(Object o) throws OpenDataException { - Map rc = super.getFields(o); - return rc; - } - } - - static class TextMessageOpenTypeFactory extends MessageOpenTypeFactory { - - @Override - protected String getTypeName() { - return ActiveMQTextMessage.class.getName(); - } - - @Override - protected void init() throws OpenDataException { - super.init(); - addItem(CompositeDataConstants.MESSAGE_TEXT, CompositeDataConstants.MESSAGE_TEXT, SimpleType.STRING); - } - - @Override - public Map getFields(Object o) throws OpenDataException { - ActiveMQTextMessage m = (ActiveMQTextMessage)o; - Map rc = super.getFields(o); - try { - rc.put(CompositeDataConstants.MESSAGE_TEXT, "" + m.getText()); - } catch (JMSException e) { - rc.put(CompositeDataConstants.MESSAGE_TEXT, ""); - } - return rc; - } - } - - - static class JobOpenTypeFactory extends AbstractOpenTypeFactory { - - @Override - protected String getTypeName() { - return Job.class.getName(); - } - - @Override - protected void init() throws OpenDataException { - super.init(); - addItem("jobId", "jobId", SimpleType.STRING); - addItem("cronEntry", "Cron entry", SimpleType.STRING); - addItem("start", "start time", SimpleType.STRING); - addItem("delay", "initial delay", SimpleType.LONG); - addItem("next", "next time", SimpleType.STRING); - addItem("period", "period between jobs", SimpleType.LONG); - addItem("repeat", "number of times to repeat", SimpleType.INTEGER); - } - - @Override - public Map getFields(Object o) throws OpenDataException { - Job job = (Job) o; - Map rc = super.getFields(o); - rc.put("jobId", job.getJobId()); - rc.put("cronEntry", "" + job.getCronEntry()); - rc.put("start", job.getStartTime()); - rc.put("delay", job.getDelay()); - rc.put("next", job.getNextExecutionTime()); - rc.put("period", job.getPeriod()); - rc.put("repeat", job.getRepeat()); - return rc; - } - } - - static class ActiveMQBlobMessageOpenTypeFactory extends MessageOpenTypeFactory { - - @Override - protected String getTypeName() { - return ActiveMQBlobMessage.class.getName(); - } - - @Override - protected void init() throws OpenDataException { - super.init(); - addItem(CompositeDataConstants.MESSAGE_URL, "Body Url", SimpleType.STRING); - } - - @Override - public Map getFields(Object o) throws OpenDataException { - ActiveMQBlobMessage m = (ActiveMQBlobMessage)o; - Map rc = super.getFields(o); - try { - rc.put(CompositeDataConstants.MESSAGE_URL, "" + m.getURL().toString()); - } catch (JMSException e) { - rc.put(CompositeDataConstants.MESSAGE_URL, ""); - } - return rc; - } - } - - static class SlowConsumerEntryOpenTypeFactory extends AbstractOpenTypeFactory { - @Override - protected String getTypeName() { - return SlowConsumerEntry.class.getName(); - } - - @Override - protected void init() throws OpenDataException { - super.init(); - addItem("subscription", "the subscription view", SimpleType.OBJECTNAME); - addItem("slowCount", "number of times deemed slow", SimpleType.INTEGER); - addItem("markCount", "number of periods remaining slow", SimpleType.INTEGER); - } - - @Override - public Map getFields(Object o) throws OpenDataException { - SlowConsumerEntry entry = (SlowConsumerEntry) o; - Map rc = super.getFields(o); - rc.put("subscription", entry.getSubscription()); - rc.put("slowCount", Integer.valueOf(entry.getSlowCount())); - rc.put("markCount", Integer.valueOf(entry.getMarkCount())); - return rc; - } - } - - static class HealthStatusOpenTypeFactory extends AbstractOpenTypeFactory { - @Override - protected String getTypeName() { - return HealthStatus.class.getName(); - } - - @Override - protected void init() throws OpenDataException { - super.init(); - addItem("healthId", "health check id", SimpleType.STRING); - addItem("level", "severity", SimpleType.STRING); - addItem("message", "severity", SimpleType.STRING); - addItem("resource", "event resource", SimpleType.STRING); - } - - @Override - public Map getFields(Object o) throws OpenDataException { - HealthStatus event = (HealthStatus) o; - Map rc = super.getFields(o); - rc.put("healthId", event.getHealthId()); - rc.put("level", event.getLevel()); - rc.put("message", event.getMessage()); - rc.put("resource", event.getResource()); - return rc; - } - } - - static { - OPEN_TYPE_FACTORIES.put(ActiveMQMessage.class, new MessageOpenTypeFactory()); - OPEN_TYPE_FACTORIES.put(ActiveMQBytesMessage.class, new ByteMessageOpenTypeFactory()); - OPEN_TYPE_FACTORIES.put(ActiveMQMapMessage.class, new MapMessageOpenTypeFactory()); - OPEN_TYPE_FACTORIES.put(ActiveMQObjectMessage.class, new ObjectMessageOpenTypeFactory()); - OPEN_TYPE_FACTORIES.put(ActiveMQStreamMessage.class, new StreamMessageOpenTypeFactory()); - OPEN_TYPE_FACTORIES.put(ActiveMQTextMessage.class, new TextMessageOpenTypeFactory()); - OPEN_TYPE_FACTORIES.put(Job.class, new JobOpenTypeFactory()); - OPEN_TYPE_FACTORIES.put(SlowConsumerEntry.class, new SlowConsumerEntryOpenTypeFactory()); - OPEN_TYPE_FACTORIES.put(ActiveMQBlobMessage.class, new ActiveMQBlobMessageOpenTypeFactory()); - OPEN_TYPE_FACTORIES.put(HealthStatus.class, new HealthStatusOpenTypeFactory()); - } - - private OpenTypeSupport() { - } - - public static OpenTypeFactory getFactory(Class clazz) throws OpenDataException { - return OPEN_TYPE_FACTORIES.get(clazz); - } - - public static CompositeData convert(Object message) throws OpenDataException { - OpenTypeFactory f = getFactory(message.getClass()); - if (f == null) { - throw new OpenDataException("Cannot create a CompositeData for type: " + message.getClass().getName()); - } - CompositeType ct = f.getCompositeType(); - Map fields = f.getFields(message); - return new CompositeDataSupport(ct, fields); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/PersistenceAdapterView.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/PersistenceAdapterView.class deleted file mode 100644 index 1fc1ac406..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/PersistenceAdapterView.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/PersistenceAdapterView.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/PersistenceAdapterView.java deleted file mode 100644 index 06b50d002..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/PersistenceAdapterView.java +++ /dev/null @@ -1,74 +0,0 @@ -/** - * 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.broker.jmx; - -import java.util.concurrent.Callable; -import org.apache.activemq.store.PersistenceAdapter; - -public class PersistenceAdapterView implements PersistenceAdapterViewMBean { - - private final String name; - private final PersistenceAdapter persistenceAdapter; - - private Callable inflightTransactionViewCallable; - private Callable dataViewCallable; - - public PersistenceAdapterView(PersistenceAdapter adapter) { - this.name = adapter.toString(); - this.persistenceAdapter = adapter; - } - - @Override - public String getName() { - return name; - } - - @Override - public String getTransactions() { - return invoke(inflightTransactionViewCallable); - } - - @Override - public String getData() { - return invoke(dataViewCallable); - } - - @Override - public long getSize() { - return persistenceAdapter.size(); - } - - private String invoke(Callable callable) { - String result = null; - if (callable != null) { - try { - result = callable.call(); - } catch (Exception e) { - result = e.toString(); - } - } - return result; - } - - public void setDataViewCallable(Callable dataViewCallable) { - this.dataViewCallable = dataViewCallable; - } - - public void setInflightTransactionViewCallable(Callable inflightTransactionViewCallable) { - this.inflightTransactionViewCallable = inflightTransactionViewCallable; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/PersistenceAdapterViewMBean.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/PersistenceAdapterViewMBean.class deleted file mode 100644 index bf2bc9c50..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/PersistenceAdapterViewMBean.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/PersistenceAdapterViewMBean.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/PersistenceAdapterViewMBean.java deleted file mode 100644 index e99fef21c..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/PersistenceAdapterViewMBean.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * 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.broker.jmx; - -public interface PersistenceAdapterViewMBean { - - @MBeanInfo("Name of this persistence adapter.") - String getName(); - - @MBeanInfo("Current inflight local transactions.") - String getTransactions(); - - @MBeanInfo("Current data.") - String getData(); - - @MBeanInfo("Current size.") - long getSize(); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ProducerView.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ProducerView.class deleted file mode 100644 index 4adbcf5e6..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ProducerView.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ProducerView.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ProducerView.java deleted file mode 100644 index 1596d5e96..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ProducerView.java +++ /dev/null @@ -1,187 +0,0 @@ -/** - * 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.broker.jmx; - -import org.apache.activemq.broker.ProducerBrokerExchange; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ProducerInfo; - -public class ProducerView implements ProducerViewMBean { - - protected final ProducerInfo info; - protected final String clientId; - protected final String userName; - protected final ManagedRegionBroker broker; - - protected ActiveMQDestination lastUsedDestination; - - public ProducerView(ProducerInfo info, String clientId, String userName, ManagedRegionBroker broker) { - this.info = info; - this.clientId = clientId; - this.userName = userName; - this.broker = broker; - } - - @Override - public String getClientId() { - return this.clientId; - } - - @Override - public String getConnectionId() { - if (info != null) { - return info.getProducerId().getConnectionId(); - } - return "NOTSET"; - } - - @Override - public long getSessionId() { - if (info != null) { - return info.getProducerId().getSessionId(); - } - return 0; - } - - @Override - public String getProducerId() { - if (info != null) { - return info.getProducerId().toString(); - } - return "NOTSET"; - } - - @Override - public String getDestinationName() { - if (info != null && info.getDestination() != null) { - ActiveMQDestination dest = info.getDestination(); - return dest.getPhysicalName(); - } else if (this.lastUsedDestination != null) { - return this.lastUsedDestination.getPhysicalName(); - } - return "NOTSET"; - } - - @Override - public boolean isDestinationQueue() { - if (info != null) { - if (info.getDestination() != null) { - ActiveMQDestination dest = info.getDestination(); - return dest.isQueue(); - } else if(lastUsedDestination != null) { - return lastUsedDestination.isQueue(); - } - } - return false; - } - - @Override - public boolean isDestinationTopic() { - if (info != null) { - if (info.getDestination() != null) { - ActiveMQDestination dest = info.getDestination(); - return dest.isTopic(); - } else if(lastUsedDestination != null) { - return lastUsedDestination.isTopic(); - } - } - return false; - } - - @Override - public boolean isDestinationTemporary() { - if (info != null) { - if (info.getDestination() != null) { - ActiveMQDestination dest = info.getDestination(); - return dest.isTemporary(); - } else if(lastUsedDestination != null) { - return lastUsedDestination.isTemporary(); - } - } - return false; - } - - @Override - public int getProducerWindowSize() { - if (info != null) { - return info.getWindowSize(); - } - return 0; - } - - @Override - public boolean isDispatchAsync() { - if (info != null) { - return info.isDispatchAsync(); - } - return false; - } - - /** - * @return pretty print - */ - public String toString() { - return "ProducerView: " + getClientId() + ":" + getConnectionId(); - } - - /** - * Set the last used Destination name for a Dynamic Destination Producer. - */ - void setLastUsedDestinationName(ActiveMQDestination destinationName) { - this.lastUsedDestination = destinationName; - } - - @Override - public String getUserName() { - return userName; - } - - @Override - public boolean isProducerBlocked() { - ProducerBrokerExchange producerBrokerExchange = broker.getBrokerService().getProducerBrokerExchange(info); - if (producerBrokerExchange != null){ - return producerBrokerExchange.isBlockedForFlowControl(); - } - return false; - } - - @Override - public long getTotalTimeBlocked() { - ProducerBrokerExchange producerBrokerExchange = broker.getBrokerService().getProducerBrokerExchange(info); - if (producerBrokerExchange != null){ - return producerBrokerExchange.getTotalTimeBlocked(); - } - return 0; - } - - @Override - public int getPercentageBlocked() { - ProducerBrokerExchange producerBrokerExchange = broker.getBrokerService().getProducerBrokerExchange(info); - if (producerBrokerExchange != null){ - return producerBrokerExchange.getPercentageBlocked(); - } - return 0; - } - - @Override - public void resetFlowControlStats() { - ProducerBrokerExchange producerBrokerExchange = broker.getBrokerService().getProducerBrokerExchange(info); - if (producerBrokerExchange != null){ - producerBrokerExchange.resetFlowControl(); - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ProducerViewMBean.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ProducerViewMBean.class deleted file mode 100644 index 6d05898ab..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ProducerViewMBean.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ProducerViewMBean.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ProducerViewMBean.java deleted file mode 100644 index da357c17b..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ProducerViewMBean.java +++ /dev/null @@ -1,101 +0,0 @@ -/** - * 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.broker.jmx; - -public interface ProducerViewMBean { - - /** - * @return the clientId of the Connection the Producer is on - */ - @MBeanInfo("JMS Client id of the Connection the Producer is on.") - String getClientId(); - - /** - * @return the id of the Connection the Producer is on - */ - @MBeanInfo("ID of the Connection the Producer is on.") - String getConnectionId(); - - /** - * @return the id of the Session the Producer is on - */ - @MBeanInfo("ID of the Session the Producer is on.") - long getSessionId(); - - /** - * @return the id of Producer. - */ - @MBeanInfo("ID of the Producer.") - String getProducerId(); - - /** - * @return the destination name - */ - @MBeanInfo("The name of the destionation the Producer is on.") - String getDestinationName(); - - /** - * @return true if the destination is a Queue - */ - @MBeanInfo("Producer is on a Queue") - boolean isDestinationQueue(); - - /** - * @return true of the destination is a Topic - */ - @MBeanInfo("Producer is on a Topic") - boolean isDestinationTopic(); - - /** - * @return true if the destination is temporary - */ - @MBeanInfo("Producer is on a temporary Queue/Topic") - boolean isDestinationTemporary(); - - /** - * @returns the windows size configured for the producer - */ - @MBeanInfo("Configured Window Size for the Producer") - int getProducerWindowSize(); - - /** - * @returns if the Producer is configured for Async dispatch - */ - @MBeanInfo("Is the producer configured for Async Dispatch") - boolean isDispatchAsync(); - - /** - * Returns the User Name used to authorize creation of this Producer. - * This value can be null if display of user name information is disabled. - * - * @return the name of the user that created this Producer - */ - @MBeanInfo("User Name used to authorize creation of this Producer") - String getUserName(); - - @MBeanInfo("is the producer blocked for Flow Control") - boolean isProducerBlocked(); - - @MBeanInfo("total time (ms) Producer Blocked For Flow Control") - long getTotalTimeBlocked(); - - @MBeanInfo("percentage of sends Producer Blocked for Flow Control") - int getPercentageBlocked(); - - @MBeanInfo("reset flow control stata") - void resetFlowControlStats(); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ProxyConnectorView.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ProxyConnectorView.class deleted file mode 100644 index ff156c069..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ProxyConnectorView.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ProxyConnectorView.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ProxyConnectorView.java deleted file mode 100644 index a24be5057..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ProxyConnectorView.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * 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.broker.jmx; - -import org.apache.activemq.proxy.ProxyConnector; - -public class ProxyConnectorView implements ProxyConnectorViewMBean { - - private final ProxyConnector connector; - - public ProxyConnectorView(ProxyConnector connector) { - this.connector = connector; - } - - public void start() throws Exception { - connector.start(); - } - - public void stop() throws Exception { - connector.stop(); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ProxyConnectorViewMBean.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ProxyConnectorViewMBean.class deleted file mode 100644 index 06ef41b57..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ProxyConnectorViewMBean.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ProxyConnectorViewMBean.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ProxyConnectorViewMBean.java deleted file mode 100644 index f4579eccc..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/ProxyConnectorViewMBean.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * 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.broker.jmx; - -import org.apache.activemq.Service; - -public interface ProxyConnectorViewMBean extends Service { - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/QueueView.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/QueueView.class deleted file mode 100644 index ecdac6266..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/QueueView.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/QueueView.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/QueueView.java deleted file mode 100644 index 76d82a3a0..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/QueueView.java +++ /dev/null @@ -1,229 +0,0 @@ -/** - * 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.broker.jmx; - -import java.util.Map; - -import javax.management.openmbean.CompositeData; -import javax.management.openmbean.OpenDataException; -import javax.jms.JMSException; - -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.region.Queue; -import org.apache.activemq.broker.region.QueueMessageReference; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.Message; -import org.apache.activemq.util.BrokerSupport; - -/** - * Provides a JMX Management view of a Queue. - */ -public class QueueView extends DestinationView implements QueueViewMBean { - public QueueView(ManagedRegionBroker broker, Queue destination) { - super(broker, destination); - } - - public CompositeData getMessage(String messageId) throws OpenDataException { - CompositeData result = null; - QueueMessageReference ref = ((Queue)destination).getMessage(messageId); - - if (ref != null) { - Message rc = ref.getMessage(); - if (rc == null) { - return null; - } - result = OpenTypeSupport.convert(rc); - } - - return result; - } - - public void purge() throws Exception { - ((Queue)destination).purge(); - } - - public boolean removeMessage(String messageId) throws Exception { - return ((Queue)destination).removeMessage(messageId); - } - - public int removeMatchingMessages(String selector) throws Exception { - return ((Queue)destination).removeMatchingMessages(selector); - } - - public int removeMatchingMessages(String selector, int maximumMessages) throws Exception { - return ((Queue)destination).removeMatchingMessages(selector, maximumMessages); - } - - public boolean copyMessageTo(String messageId, String destinationName) throws Exception { - ConnectionContext context = BrokerSupport.getConnectionContext(broker.getContextBroker()); - ActiveMQDestination toDestination = ActiveMQDestination.createDestination(destinationName, ActiveMQDestination.QUEUE_TYPE); - return ((Queue)destination).copyMessageTo(context, messageId, toDestination); - } - - public int copyMatchingMessagesTo(String selector, String destinationName) throws Exception { - ConnectionContext context = BrokerSupport.getConnectionContext(broker.getContextBroker()); - ActiveMQDestination toDestination = ActiveMQDestination.createDestination(destinationName, ActiveMQDestination.QUEUE_TYPE); - return ((Queue)destination).copyMatchingMessagesTo(context, selector, toDestination); - } - - public int copyMatchingMessagesTo(String selector, String destinationName, int maximumMessages) throws Exception { - ConnectionContext context = BrokerSupport.getConnectionContext(broker.getContextBroker()); - ActiveMQDestination toDestination = ActiveMQDestination.createDestination(destinationName, ActiveMQDestination.QUEUE_TYPE); - return ((Queue)destination).copyMatchingMessagesTo(context, selector, toDestination, maximumMessages); - } - - public boolean moveMessageTo(String messageId, String destinationName) throws Exception { - ConnectionContext context = BrokerSupport.getConnectionContext(broker.getContextBroker()); - ActiveMQDestination toDestination = ActiveMQDestination.createDestination(destinationName, ActiveMQDestination.QUEUE_TYPE); - return ((Queue)destination).moveMessageTo(context, messageId, toDestination); - } - - public int moveMatchingMessagesTo(String selector, String destinationName) throws Exception { - ConnectionContext context = BrokerSupport.getConnectionContext(broker.getContextBroker()); - ActiveMQDestination toDestination = ActiveMQDestination.createDestination(destinationName, ActiveMQDestination.QUEUE_TYPE); - return ((Queue)destination).moveMatchingMessagesTo(context, selector, toDestination); - } - - public int moveMatchingMessagesTo(String selector, String destinationName, int maximumMessages) throws Exception { - ConnectionContext context = BrokerSupport.getConnectionContext(broker.getContextBroker()); - ActiveMQDestination toDestination = ActiveMQDestination.createDestination(destinationName, ActiveMQDestination.QUEUE_TYPE); - return ((Queue)destination).moveMatchingMessagesTo(context, selector, toDestination, maximumMessages); - } - - public int retryMessages() throws Exception { - ConnectionContext context = BrokerSupport.getConnectionContext(broker.getContextBroker()); - return ((Queue)destination).retryMessages(context, Integer.MAX_VALUE); - } - - /** - * Moves a message back to its original destination - */ - public boolean retryMessage(String messageId) throws Exception { - Queue queue = (Queue) destination; - QueueMessageReference ref = queue.getMessage(messageId); - Message rc = ref.getMessage(); - if (rc != null) { - ActiveMQDestination originalDestination = rc.getOriginalDestination(); - if (originalDestination != null) { - ConnectionContext context = BrokerSupport.getConnectionContext(broker.getContextBroker()); - return queue.moveMessageTo(context, ref, originalDestination); - } - else { - throw new JMSException("No original destination for message: "+ messageId); - } - } - else { - throw new JMSException("Could not find message: "+ messageId); - } - } - - public int cursorSize() { - Queue queue = (Queue) destination; - if (queue.getMessages() != null){ - return queue.getMessages().size(); - } - return 0; - } - - - public boolean doesCursorHaveMessagesBuffered() { - Queue queue = (Queue) destination; - if (queue.getMessages() != null){ - return queue.getMessages().hasMessagesBufferedToDeliver(); - } - return false; - - } - - - public boolean doesCursorHaveSpace() { - Queue queue = (Queue) destination; - if (queue.getMessages() != null){ - return queue.getMessages().hasSpace(); - } - return false; - } - - - public long getCursorMemoryUsage() { - Queue queue = (Queue) destination; - if (queue.getMessages() != null && queue.getMessages().getSystemUsage() != null){ - return queue.getMessages().getSystemUsage().getMemoryUsage().getUsage(); - } - return 0; - } - - public int getCursorPercentUsage() { - Queue queue = (Queue) destination; - if (queue.getMessages() != null && queue.getMessages().getSystemUsage() != null){ - return queue.getMessages().getSystemUsage().getMemoryUsage().getPercentUsage(); - } - return 0; - } - - public boolean isCursorFull() { - Queue queue = (Queue) destination; - if (queue.getMessages() != null){ - return queue.getMessages().isFull(); - } - return false; - } - - public boolean isCacheEnabled() { - Queue queue = (Queue) destination; - if (queue.getMessages() != null){ - return queue.getMessages().isCacheEnabled(); - } - return false; - } - - /** - * @return a Map of groupNames and ConsumerIds - */ - @Override - public Map getMessageGroups() { - Queue queue = (Queue) destination; - return queue.getMessageGroupOwners().getGroups(); - } - - /** - * @return the message group type implementation (simple,bucket,cached) - */ - @Override - public String getMessageGroupType() { - Queue queue = (Queue) destination; - return queue.getMessageGroupOwners().getType(); - } - - /** - * remove a message group = has the effect of rebalancing group - */ - @Override - public void removeMessageGroup(@MBeanInfo("groupName") String groupName) { - Queue queue = (Queue) destination; - queue.getMessageGroupOwners().removeGroup(groupName); - } - - /** - * remove all the message groups - will rebalance all message groups across consumers - */ - @Override - public void removeAllMessageGroups() { - Queue queue = (Queue) destination; - queue.getMessageGroupOwners().removeAll(); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/QueueViewMBean.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/QueueViewMBean.class deleted file mode 100644 index d756236f9..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/QueueViewMBean.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/QueueViewMBean.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/QueueViewMBean.java deleted file mode 100644 index 3f99162a9..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/QueueViewMBean.java +++ /dev/null @@ -1,212 +0,0 @@ -/** - * 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.broker.jmx; - -import java.util.Map; - -import javax.management.openmbean.CompositeData; -import javax.management.openmbean.OpenDataException; - -public interface QueueViewMBean extends DestinationViewMBean { - - /** - * Retrieve a message from the destination's queue. - * - * @param messageId the message id of the message to retrieve - * @return A CompositeData object which is a JMX version of the messages - * @throws OpenDataException - */ - @MBeanInfo("View a message from the destination by JMS message ID.") - CompositeData getMessage(@MBeanInfo("messageId") String messageId) throws OpenDataException; - - /** - * Removes a message from the queue. If the message has already been - * dispatched to another consumer, the message cannot be deleted and this - * method will return false. - * - * @param messageId - * @return true if the message was found and could be successfully deleted. - * @throws Exception - */ - @MBeanInfo("Remove a message from the destination by JMS message ID. If the message has been dispatched, it cannot be deleted and false is returned.") - boolean removeMessage(@MBeanInfo("messageId") String messageId) throws Exception; - - /** - * Removes the messages matching the given selector - * - * @return the number of messages removed - */ - @MBeanInfo("Removes messages from the destination based on an SQL-92 selection on the message headers or XPATH on the body.") - int removeMatchingMessages(@MBeanInfo("selector") String selector) throws Exception; - - /** - * Removes the messages matching the given selector up to the maximum number - * of matched messages - * - * @return the number of messages removed - */ - @MBeanInfo("Removes up to a specified number of messages from the destination based on an SQL-92 selection on the message headers or XPATH on the body.") - int removeMatchingMessages(@MBeanInfo("selector") String selector, @MBeanInfo("maximumMessages") int maximumMessages) throws Exception; - - /** - * Removes all of the messages in the queue. - * - * @throws Exception - */ - @MBeanInfo("Removes all of the messages in the queue.") - void purge() throws Exception; - - /** - * Copies a given message to another destination. - * - * @param messageId - * @param destinationName - * @return true if the message was found and was successfully copied to the - * other destination. - * @throws Exception - */ - @MBeanInfo("Copies a message with the given JMS message ID into the specified destination.") - boolean copyMessageTo(@MBeanInfo("messageId") String messageId, @MBeanInfo("destinationName") String destinationName) throws Exception; - - /** - * Copies the messages matching the given selector - * - * @return the number of messages copied - */ - @MBeanInfo("Copies messages based on an SQL-92 selecton on the message headers or XPATH on the body into the specified destination.") - int copyMatchingMessagesTo(@MBeanInfo("selector") String selector, @MBeanInfo("destinationName") String destinationName) throws Exception; - - /** - * Copies the messages matching the given selector up to the maximum number - * of matched messages - * - * @return the number of messages copied - */ - @MBeanInfo("Copies up to a specified number of messages based on an SQL-92 selecton on the message headers or XPATH on the body into the specified destination.") - int copyMatchingMessagesTo(@MBeanInfo("selector") String selector, @MBeanInfo("destinationName") String destinationName, @MBeanInfo("maximumMessages") int maximumMessages) throws Exception; - - /** - * Moves the message to another destination. - * - * @param messageId - * @param destinationName - * @return true if the message was found and was successfully copied to the - * other destination. - * @throws Exception - */ - @MBeanInfo("Moves a message with the given JMS message ID into the specified destination.") - boolean moveMessageTo(@MBeanInfo("messageId") String messageId, @MBeanInfo("destinationName") String destinationName) throws Exception; - - /** - * Moves a message back to its original destination - */ - @MBeanInfo("Moves a message with the given JMS message back to its original destination") - boolean retryMessage(@MBeanInfo("messageId") String messageId) throws Exception; - - /** - * Moves the messages matching the given selector - * - * @return the number of messages removed - */ - @MBeanInfo("Moves messages based on an SQL-92 selecton on the message headers or XPATH on the body into the specified destination.") - int moveMatchingMessagesTo(@MBeanInfo("selector") String selector, @MBeanInfo("destinationName") String destinationName) throws Exception; - - /** - * Moves the messages matching the given selector up to the maximum number - * of matched messages - */ - @MBeanInfo("Moves up to a specified number of messages based on an SQL-92 selecton on the message headers or XPATH on the body into the specified destination.") - int moveMatchingMessagesTo(@MBeanInfo("selector") String selector, @MBeanInfo("destinationName") String destinationName, @MBeanInfo("maximumMessages") int maximumMessages) throws Exception; - - /** - * Retries messages sent to the DLQ - */ - @MBeanInfo("Retries messages sent to the DLQ") - public int retryMessages() throws Exception; - - /** - * @return true if the message cursor has memory space available - * to page in more messages - */ - @MBeanInfo("Message cursor has memory space available") - public boolean doesCursorHaveSpace(); - - /** - * @return true if the cursor has reached its memory limit for - * paged in messages - */ - @MBeanInfo("Message cusor has reached its memory limit for paged in messages") - public boolean isCursorFull(); - - /** - * @return true if the cursor has messages buffered to deliver - */ - @MBeanInfo("Message cursor has buffered messages to deliver") - public boolean doesCursorHaveMessagesBuffered(); - - /** - * @return the cursor memory usage in bytes - */ - @MBeanInfo("Message cursor memory usage, in bytes.") - public long getCursorMemoryUsage(); - - /** - * @return the cursor memory usage as a percentage - */ - @MBeanInfo("Percentage of memory limit used") - public int getCursorPercentUsage(); - - /** - * @return the number of messages available to be paged in - * by the cursor - */ - @MBeanInfo("Number of messages available to be paged in by the cursor.") - public int cursorSize(); - - /** - * @return true if caching is currently enabled of for the destination - */ - @MBeanInfo("Caching is enabled") - boolean isCacheEnabled(); - - - /** - * @return a Map of groupNames and ConsumerIds - */ - @MBeanInfo("Map of groupNames and ConsumerIds") - Map getMessageGroups(); - - /** - * @return the message group type implementation (simple,bucket,cached) - */ - @MBeanInfo("group implementation (simple,bucket,cached)") - String getMessageGroupType(); - - /** - * remove a message group = has the effect of rebalancing group - * @param groupName - */ - - @MBeanInfo("remove a message group by its groupName") - void removeMessageGroup(@MBeanInfo("groupName")String groupName); - - /** - * remove all the message groups - will rebalance all message groups across consumers - */ - @MBeanInfo("emove all the message groups - will rebalance all message groups across consumers") - void removeAllMessageGroups(); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/RecoveredXATransactionView$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/RecoveredXATransactionView$1.class deleted file mode 100644 index 5d9faa74d..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/RecoveredXATransactionView$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/RecoveredXATransactionView.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/RecoveredXATransactionView.class deleted file mode 100644 index fc7740e65..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/RecoveredXATransactionView.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/RecoveredXATransactionView.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/RecoveredXATransactionView.java deleted file mode 100644 index 29fc9b6e3..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/RecoveredXATransactionView.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * 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.broker.jmx; - -import org.apache.activemq.transaction.Synchronization; -import org.apache.activemq.transaction.XATransaction; - -public class RecoveredXATransactionView implements RecoveredXATransactionViewMBean { - - private final XATransaction transaction; - - public RecoveredXATransactionView(final ManagedRegionBroker managedRegionBroker, final XATransaction transaction) { - this.transaction = transaction; - transaction.addSynchronization(new Synchronization() { - @Override - public void afterCommit() throws Exception { - managedRegionBroker.unregister(transaction); - } - - @Override - public void afterRollback() throws Exception { - managedRegionBroker.unregister(transaction); - } - }); - } - - @Override - public int getFormatId() { - return transaction.getXid().getFormatId(); - } - - @Override - public byte[] getBranchQualifier() { - return transaction.getXid().getBranchQualifier(); - } - - @Override - public byte[] getGlobalTransactionId() { - return transaction.getXid().getGlobalTransactionId(); - } - - @Override - public void heuristicCommit() throws Exception { - transaction.commit(false); - } - - @Override - public void heuristicRollback() throws Exception { - transaction.rollback(); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/RecoveredXATransactionViewMBean.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/RecoveredXATransactionViewMBean.class deleted file mode 100644 index 4050ab115..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/RecoveredXATransactionViewMBean.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/RecoveredXATransactionViewMBean.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/RecoveredXATransactionViewMBean.java deleted file mode 100644 index 0e01095cf..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/RecoveredXATransactionViewMBean.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * 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.broker.jmx; - -public interface RecoveredXATransactionViewMBean { - - @MBeanInfo("The raw xid formatId.") - int getFormatId(); - - @MBeanInfo("The raw xid branchQualifier.") - byte[] getBranchQualifier(); - - @MBeanInfo("The raw xid globalTransactionId.") - byte[] getGlobalTransactionId(); - - @MBeanInfo("force heusistic commit of this transaction") - void heuristicCommit() throws Exception; - - @MBeanInfo("force heusistic rollback of this transaction") - void heuristicRollback() throws Exception; -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/SubscriptionView.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/SubscriptionView.class deleted file mode 100644 index 87746b5e6..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/SubscriptionView.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/SubscriptionView.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/SubscriptionView.java deleted file mode 100644 index 5441b1975..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/SubscriptionView.java +++ /dev/null @@ -1,399 +0,0 @@ -/** - * 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.broker.jmx; - -import java.io.IOException; -import java.util.Set; - -import javax.jms.InvalidSelectorException; -import javax.management.ObjectName; - -import org.apache.activemq.broker.BrokerService; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ActiveMQQueue; -import org.apache.activemq.command.ActiveMQTopic; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.filter.DestinationFilter; -import org.apache.activemq.util.IOExceptionSupport; - -/** - * - */ -public class SubscriptionView implements SubscriptionViewMBean { - - protected final Subscription subscription; - protected final String clientId; - protected final String userName; - - /** - * Constructor - * - * @param subs - */ - public SubscriptionView(String clientId, String userName, Subscription subs) { - this.clientId = clientId; - this.subscription = subs; - this.userName = userName; - } - - /** - * @return the clientId - */ - @Override - public String getClientId() { - return clientId; - } - - /** - * @returns the ObjectName of the Connection that created this subscription - */ - @Override - public ObjectName getConnection() { - ObjectName result = null; - - if (clientId != null && subscription != null) { - ConnectionContext ctx = subscription.getContext(); - if (ctx != null && ctx.getBroker() != null && ctx.getBroker().getBrokerService() != null) { - BrokerService service = ctx.getBroker().getBrokerService(); - ManagementContext managementCtx = service.getManagementContext(); - if (managementCtx != null) { - - try { - ObjectName query = createConnectionQuery(managementCtx, service.getBrokerName()); - Set names = managementCtx.queryNames(query, null); - if (names.size() == 1) { - result = names.iterator().next(); - } - } catch (Exception e) { - } - } - } - } - return result; - } - - private ObjectName createConnectionQuery(ManagementContext ctx, String brokerName) throws IOException { - try { - return BrokerMBeanSupport.createConnectionQuery(ctx.getJmxDomainName(), brokerName, clientId); - } catch (Throwable e) { - throw IOExceptionSupport.create(e); - } - } - - /** - * @return the id of the Connection the Subscription is on - */ - @Override - public String getConnectionId() { - ConsumerInfo info = getConsumerInfo(); - if (info != null) { - return info.getConsumerId().getConnectionId(); - } - return "NOTSET"; - } - - /** - * @return the id of the Session the subscription is on - */ - @Override - public long getSessionId() { - ConsumerInfo info = getConsumerInfo(); - if (info != null) { - return info.getConsumerId().getSessionId(); - } - return 0; - } - - /** - * @return the id of the Subscription - */ - @Override - public long getSubcriptionId() { - ConsumerInfo info = getConsumerInfo(); - if (info != null) { - return info.getConsumerId().getValue(); - } - return 0; - } - - /** - * @return the destination name - */ - @Override - public String getDestinationName() { - ConsumerInfo info = getConsumerInfo(); - if (info != null) { - ActiveMQDestination dest = info.getDestination(); - return dest.getPhysicalName(); - } - return "NOTSET"; - } - - @Override - public String getSelector() { - if (subscription != null) { - return subscription.getSelector(); - } - return null; - } - - @Override - public void setSelector(String selector) throws InvalidSelectorException, UnsupportedOperationException { - if (subscription != null) { - subscription.setSelector(selector); - } else { - throw new UnsupportedOperationException("No subscription object"); - } - } - - /** - * @return true if the destination is a Queue - */ - @Override - public boolean isDestinationQueue() { - ConsumerInfo info = getConsumerInfo(); - if (info != null) { - ActiveMQDestination dest = info.getDestination(); - return dest.isQueue(); - } - return false; - } - - /** - * @return true of the destination is a Topic - */ - @Override - public boolean isDestinationTopic() { - ConsumerInfo info = getConsumerInfo(); - if (info != null) { - ActiveMQDestination dest = info.getDestination(); - return dest.isTopic(); - } - return false; - } - - /** - * @return true if the destination is temporary - */ - @Override - public boolean isDestinationTemporary() { - ConsumerInfo info = getConsumerInfo(); - if (info != null) { - ActiveMQDestination dest = info.getDestination(); - return dest.isTemporary(); - } - return false; - } - - /** - * @return true if the subscriber is active - */ - @Override - public boolean isActive() { - return true; - } - - @Override - public boolean isNetwork() { - ConsumerInfo info = getConsumerInfo(); - if (info != null) { - return info.isNetworkSubscription(); - } - return false; - } - - /** - * The subscription should release as may references as it can to help the - * garbage collector reclaim memory. - */ - public void gc() { - if (subscription != null) { - subscription.gc(); - } - } - - /** - * @return whether or not the subscriber is retroactive or not - */ - @Override - public boolean isRetroactive() { - ConsumerInfo info = getConsumerInfo(); - return info != null ? info.isRetroactive() : false; - } - - /** - * @return whether or not the subscriber is an exclusive consumer - */ - @Override - public boolean isExclusive() { - ConsumerInfo info = getConsumerInfo(); - return info != null ? info.isExclusive() : false; - } - - /** - * @return whether or not the subscriber is durable (persistent) - */ - @Override - public boolean isDurable() { - ConsumerInfo info = getConsumerInfo(); - return info != null ? info.isDurable() : false; - } - - /** - * @return whether or not the subscriber ignores local messages - */ - @Override - public boolean isNoLocal() { - ConsumerInfo info = getConsumerInfo(); - return info != null ? info.isNoLocal() : false; - } - - /** - * @return the maximum number of pending messages allowed in addition to the - * prefetch size. If enabled to a non-zero value then this will - * perform eviction of messages for slow consumers on non-durable - * topics. - */ - @Override - public int getMaximumPendingMessageLimit() { - ConsumerInfo info = getConsumerInfo(); - return info != null ? info.getMaximumPendingMessageLimit() : 0; - } - - /** - * @return the consumer priority - */ - @Override - public byte getPriority() { - ConsumerInfo info = getConsumerInfo(); - return info != null ? info.getPriority() : 0; - } - - /** - * @return the name of the consumer which is only used for durable - * consumers. - */ - @Override - public String getSubcriptionName() { - ConsumerInfo info = getConsumerInfo(); - return info != null ? info.getSubscriptionName() : null; - } - - /** - * @return number of messages pending delivery - */ - @Override - public int getPendingQueueSize() { - return subscription != null ? subscription.getPendingQueueSize() : 0; - } - - /** - * @return number of messages dispatched - */ - @Override - public int getDispatchedQueueSize() { - return subscription != null ? subscription.getDispatchedQueueSize() : 0; - } - - @Override - public int getMessageCountAwaitingAcknowledge() { - return getDispatchedQueueSize(); - } - - /** - * @return number of messages that matched the subscription - */ - @Override - public long getDispatchedCounter() { - return subscription != null ? subscription.getDispatchedCounter() : 0; - } - - /** - * @return number of messages that matched the subscription - */ - @Override - public long getEnqueueCounter() { - return subscription != null ? subscription.getEnqueueCounter() : 0; - } - - /** - * @return number of messages queued by the client - */ - @Override - public long getDequeueCounter() { - return subscription != null ? subscription.getDequeueCounter() : 0; - } - - protected ConsumerInfo getConsumerInfo() { - return subscription != null ? subscription.getConsumerInfo() : null; - } - - /** - * @return pretty print - */ - @Override - public String toString() { - return "SubscriptionView: " + getClientId() + ":" + getConnectionId(); - } - - /** - */ - @Override - public int getPrefetchSize() { - return subscription != null ? subscription.getPrefetchSize() : 0; - } - - @Override - public boolean isMatchingQueue(String queueName) { - if (isDestinationQueue()) { - return matchesDestination(new ActiveMQQueue(queueName)); - } - return false; - } - - @Override - public boolean isMatchingTopic(String topicName) { - if (isDestinationTopic()) { - return matchesDestination(new ActiveMQTopic(topicName)); - } - return false; - } - - /** - * Return true if this subscription matches the given destination - * - * @param destination the destination to compare against - * @return true if this subscription matches the given destination - */ - public boolean matchesDestination(ActiveMQDestination destination) { - ActiveMQDestination subscriptionDestination = subscription.getActiveMQDestination(); - DestinationFilter filter = DestinationFilter.parseFilter(subscriptionDestination); - return filter.matches(destination); - } - - @Override - public boolean isSlowConsumer() { - return subscription.isSlowConsumer(); - } - - @Override - public String getUserName() { - return userName; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/SubscriptionViewMBean.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/SubscriptionViewMBean.class deleted file mode 100644 index dedfc3185..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/SubscriptionViewMBean.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/SubscriptionViewMBean.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/SubscriptionViewMBean.java deleted file mode 100644 index abeff4f58..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/SubscriptionViewMBean.java +++ /dev/null @@ -1,230 +0,0 @@ -/** - * 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.broker.jmx; - -import javax.jms.InvalidSelectorException; -import javax.management.ObjectName; - -/** - * - */ -public interface SubscriptionViewMBean { - - /** - * @return the clientId of the Connection the Subscription is on - */ - @MBeanInfo("JMS Client id of the Connection the Subscription is on.") - String getClientId(); - - /** - * @return the id of the Connection the Subscription is on - */ - @MBeanInfo("ID of the Connection the Subscription is on.") - String getConnectionId(); - - /** - * @return the id of the Session the subscription is on - */ - @MBeanInfo("ID of the Session the Subscription is on.") - long getSessionId(); - - /** - * @return the id of the Subscription - */ - @MBeanInfo("ID of the Subscription.") - long getSubcriptionId(); - - /** - * @return the destination name - */ - @MBeanInfo("The name of the destionation the subscription is on.") - String getDestinationName(); - - /** - * @return the JMS selector on the current subscription - */ - @MBeanInfo("The SQL-92 message header selector or XPATH body selector of the subscription.") - String getSelector(); - - /** - * Attempts to change the current active selector on the subscription. This - * operation is not supported for persistent topics. - */ - void setSelector(@MBeanInfo("selector") String selector) throws InvalidSelectorException, UnsupportedOperationException; - - /** - * @return true if the destination is a Queue - */ - @MBeanInfo("Subscription is on a Queue") - boolean isDestinationQueue(); - - /** - * @return true of the destination is a Topic - */ - @MBeanInfo("Subscription is on a Topic") - boolean isDestinationTopic(); - - /** - * @return true if the destination is temporary - */ - @MBeanInfo("Subscription is on a temporary Queue/Topic") - boolean isDestinationTemporary(); - - /** - * @return true if the subscriber is active - */ - @MBeanInfo("Subscription is active (connected and receiving messages).") - boolean isActive(); - - @MBeanInfo("Subscription was created by a demand-forwarding network bridge") - boolean isNetwork(); - - /** - * @return number of messages pending delivery - */ - @MBeanInfo("Number of messages pending delivery.") - int getPendingQueueSize(); - - /** - * @return number of messages dispatched - */ - @MBeanInfo("Number of messages dispatched awaiting acknowledgement.") - int getDispatchedQueueSize(); - - /** - * The same as the number of messages dispatched - - * making it explicit - * @return - */ - @MBeanInfo("Number of messages dispatched awaiting acknowledgement.") - int getMessageCountAwaitingAcknowledge(); - - /** - * @return number of messages that matched the subscription - */ - @MBeanInfo("Number of messages that sent to the client.") - long getDispatchedCounter(); - - /** - * @return number of messages that matched the subscription - */ - @MBeanInfo("Number of messages that matched the subscription.") - long getEnqueueCounter(); - - /** - * @return number of messages queued by the client - */ - @MBeanInfo("Number of messages were sent to and acknowledge by the client.") - long getDequeueCounter(); - - /** - * @return the prefetch that has been configured for this subscriber - */ - @MBeanInfo("Number of messages to pre-fetch and dispatch to the client.") - int getPrefetchSize(); - - /** - * @return whether or not the subscriber is retroactive or not - */ - @MBeanInfo("The subscriber is retroactive (tries to receive broadcasted topic messages sent prior to connecting)") - boolean isRetroactive(); - - /** - * @return whether or not the subscriber is an exclusive consumer - */ - @MBeanInfo("The subscriber is exclusive (no other subscribers may receive messages from the destination as long as this one is)") - boolean isExclusive(); - - /** - * @return whether or not the subscriber is durable (persistent) - */ - @MBeanInfo("The subsription is persistent.") - boolean isDurable(); - - /** - * @return whether or not the subscriber ignores local messages - */ - @MBeanInfo("The subsription ignores local messages.") - boolean isNoLocal(); - - /** - * @return the maximum number of pending messages allowed in addition to the - * prefetch size. If enabled to a non-zero value then this will - * perform eviction of messages for slow consumers on non-durable - * topics. - */ - @MBeanInfo("The maximum number of pending messages allowed (in addition to the prefetch size).") - int getMaximumPendingMessageLimit(); - - /** - * @return the consumer priority - */ - @MBeanInfo("The subscription priority") - byte getPriority(); - - /** - * @return the name of the consumer which is only used for durable - * consumers. - */ - @MBeanInfo("The name of the subscription (durable subscriptions only).") - String getSubcriptionName(); - - /** - * Returns true if this subscription (which may be using wildcards) matches the given queue name - * - * @param queueName the JMS queue name to match against - * @return true if this subscription matches the given queue or false if not - */ - @MBeanInfo("Returns true if the subscription (which may be using wildcards) matches the given queue name") - boolean isMatchingQueue(String queueName); - - /** - * Returns true if this subscription (which may be using wildcards) matches the given topic name - * - * @param topicName the JMS topic name to match against - * @return true if this subscription matches the given topic or false if not - */ - @MBeanInfo("Returns true if the subscription (which may be using wildcards) matches the given topic name") - boolean isMatchingTopic(String topicName); - - /** - * Returns true if the subscription is slow - * - * @return true if the subscription is slow - */ - @MBeanInfo("Returns true if the subscription is slow") - boolean isSlowConsumer(); - - /** - * Returns the User Name used to authorize creation of this Subscription. - * This value can be null if display of user name information is disabled. - * - * @return the name of the user that created this Subscription - */ - @MBeanInfo("User Name used to authorize creation of this Subscription") - String getUserName(); - - /** - * Returns the ObjectName of the Connection that created this Subscription. - * This value can be null if for instance this is an off-line durable subscription. - * - * @return the name of the Connection that created this Subscription. - */ - @MBeanInfo("ObjectName of the Connection that created this Subscription") - ObjectName getConnection(); - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/TopicSubscriptionView.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/TopicSubscriptionView.class deleted file mode 100644 index 91f766e97..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/TopicSubscriptionView.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/TopicSubscriptionView.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/TopicSubscriptionView.java deleted file mode 100644 index 60f432941..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/TopicSubscriptionView.java +++ /dev/null @@ -1,73 +0,0 @@ -/** - * 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.broker.jmx; - -import org.apache.activemq.broker.region.DurableTopicSubscription; -import org.apache.activemq.broker.region.TopicSubscription; - -/** - * - * - */ -public class TopicSubscriptionView extends SubscriptionView implements TopicSubscriptionViewMBean { - - public TopicSubscriptionView(String clientId, String userName, TopicSubscription subs) { - super(clientId, userName, subs); - } - - protected TopicSubscription getTopicSubscription() { - return (TopicSubscription)subscription; - } - - /** - * @return the number of messages discarded due to being a slow consumer - */ - public int getDiscardedCount() { - TopicSubscription topicSubscription = getTopicSubscription(); - return topicSubscription != null ? topicSubscription.discarded() : 0; - } - - /** - * @return the maximun number of messages that can be pending. - */ - public int getMaximumPendingQueueSize() { - TopicSubscription topicSubscription = getTopicSubscription(); - return topicSubscription != null ? topicSubscription.getMaximumPendingMessages() : 0; - } - - /** - * - */ - public void setMaximumPendingQueueSize(int max) { - TopicSubscription topicSubscription = getTopicSubscription(); - if (topicSubscription != null) { - topicSubscription.setMaximumPendingMessages(max); - } - } - - @Override - public boolean isActive() { - if (subscription instanceof DurableTopicSubscription) { - return ((DurableTopicSubscription)subscription).isActive(); - } else { - return super.isActive(); - } - } - - - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/TopicSubscriptionViewMBean.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/TopicSubscriptionViewMBean.class deleted file mode 100644 index 5992ab86a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/TopicSubscriptionViewMBean.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/TopicSubscriptionViewMBean.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/TopicSubscriptionViewMBean.java deleted file mode 100644 index 1deddd7fd..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/TopicSubscriptionViewMBean.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * 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.broker.jmx; - -/** - * - * - */ -public interface TopicSubscriptionViewMBean extends SubscriptionViewMBean { - - /** - * @return the number of messages discarded due to being a slow consumer - */ - @MBeanInfo("Number of messages discared due to being a slow consumer") - int getDiscardedCount(); - - /** - * @return the maximun number of messages that can be pending. - */ - @MBeanInfo("Maximum number of messages that can be pending") - int getMaximumPendingQueueSize(); - - void setMaximumPendingQueueSize(int max); - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/TopicView.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/TopicView.class deleted file mode 100644 index ec7ae732d..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/TopicView.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/TopicView.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/TopicView.java deleted file mode 100644 index b0c6e9a6e..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/TopicView.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * 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.broker.jmx; - -import org.apache.activemq.broker.region.Topic; - -public class TopicView extends DestinationView implements TopicViewMBean { - - public TopicView(ManagedRegionBroker broker, Topic destination) { - super(broker, destination); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/TopicViewMBean.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/TopicViewMBean.class deleted file mode 100644 index 2afded3a4..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/TopicViewMBean.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/TopicViewMBean.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/TopicViewMBean.java deleted file mode 100644 index 104f383b2..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/TopicViewMBean.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * 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.broker.jmx; - -public interface TopicViewMBean extends DestinationViewMBean { -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/package.html b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/package.html deleted file mode 100644 index 16777ee04..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/jmx/package.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - -JMX MBeans for the broker and its core connectors. - - - diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/package.html b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/package.html deleted file mode 100644 index 9ca2fcc81..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/package.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - -The core classes for the ActiveMQ Message Broker and its connectors. - - - diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/AbstractRegion.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/AbstractRegion.class deleted file mode 100644 index ddc12287f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/AbstractRegion.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/AbstractRegion.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/AbstractRegion.java deleted file mode 100644 index 168bd9661..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/AbstractRegion.java +++ /dev/null @@ -1,579 +0,0 @@ -/** - * 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.broker.region; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.locks.ReentrantReadWriteLock; - -import javax.jms.JMSException; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.ConsumerBrokerExchange; -import org.apache.activemq.DestinationDoesNotExistException; -import org.apache.activemq.broker.ProducerBrokerExchange; -import org.apache.activemq.broker.region.policy.PolicyEntry; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ConsumerControl; -import org.apache.activemq.command.ConsumerId; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.command.Message; -import org.apache.activemq.command.MessageAck; -import org.apache.activemq.command.MessageDispatchNotification; -import org.apache.activemq.command.MessagePull; -import org.apache.activemq.command.ProducerInfo; -import org.apache.activemq.command.RemoveSubscriptionInfo; -import org.apache.activemq.command.Response; -import org.apache.activemq.filter.DestinationFilter; -import org.apache.activemq.filter.DestinationMap; -import org.apache.activemq.security.SecurityContext; -import org.apache.activemq.thread.TaskRunnerFactory; -import org.apache.activemq.usage.SystemUsage; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - */ -public abstract class AbstractRegion implements Region { - - private static final Logger LOG = LoggerFactory.getLogger(AbstractRegion.class); - - protected final Map destinations = new ConcurrentHashMap(); - protected final DestinationMap destinationMap = new DestinationMap(); - protected final Map subscriptions = new ConcurrentHashMap(); - protected final SystemUsage usageManager; - protected final DestinationFactory destinationFactory; - protected final DestinationStatistics destinationStatistics; - protected final RegionBroker broker; - protected boolean autoCreateDestinations = true; - protected final TaskRunnerFactory taskRunnerFactory; - protected final ReentrantReadWriteLock destinationsLock = new ReentrantReadWriteLock(); - protected final Map consumerChangeMutexMap = new HashMap(); - protected boolean started; - - public AbstractRegion(RegionBroker broker, DestinationStatistics destinationStatistics, SystemUsage memoryManager, - TaskRunnerFactory taskRunnerFactory, DestinationFactory destinationFactory) { - if (broker == null) { - throw new IllegalArgumentException("null broker"); - } - this.broker = broker; - this.destinationStatistics = destinationStatistics; - this.usageManager = memoryManager; - this.taskRunnerFactory = taskRunnerFactory; - if (destinationFactory == null) { - throw new IllegalArgumentException("null destinationFactory"); - } - this.destinationFactory = destinationFactory; - } - - public final void start() throws Exception { - started = true; - - Set inactiveDests = getInactiveDestinations(); - for (Iterator iter = inactiveDests.iterator(); iter.hasNext();) { - ActiveMQDestination dest = iter.next(); - - ConnectionContext context = new ConnectionContext(); - context.setBroker(broker.getBrokerService().getBroker()); - context.setSecurityContext(SecurityContext.BROKER_SECURITY_CONTEXT); - context.getBroker().addDestination(context, dest, false); - } - destinationsLock.readLock().lock(); - try{ - for (Iterator i = destinations.values().iterator(); i.hasNext();) { - Destination dest = i.next(); - dest.start(); - } - } finally { - destinationsLock.readLock().unlock(); - } - } - - public void stop() throws Exception { - started = false; - destinationsLock.readLock().lock(); - try{ - for (Iterator i = destinations.values().iterator(); i.hasNext();) { - Destination dest = i.next(); - dest.stop(); - } - } finally { - destinationsLock.readLock().unlock(); - } - destinations.clear(); - } - - public Destination addDestination(ConnectionContext context, ActiveMQDestination destination, - boolean createIfTemporary) throws Exception { - - destinationsLock.writeLock().lock(); - try { - Destination dest = destinations.get(destination); - if (dest == null) { - if (destination.isTemporary() == false || createIfTemporary) { - LOG.debug("{} adding destination: {}", broker.getBrokerName(), destination); - dest = createDestination(context, destination); - // intercept if there is a valid interceptor defined - DestinationInterceptor destinationInterceptor = broker.getDestinationInterceptor(); - if (destinationInterceptor != null) { - dest = destinationInterceptor.intercept(dest); - } - dest.start(); - destinations.put(destination, dest); - destinationMap.put(destination, dest); - addSubscriptionsForDestination(context, dest); - } - if (dest == null) { - throw new DestinationDoesNotExistException(destination.getQualifiedName()); - } - } - return dest; - } finally { - destinationsLock.writeLock().unlock(); - } - } - - public Map getSubscriptions() { - return subscriptions; - } - - protected List addSubscriptionsForDestination(ConnectionContext context, Destination dest) - throws Exception { - - List rc = new ArrayList(); - // Add all consumers that are interested in the destination. - for (Iterator iter = subscriptions.values().iterator(); iter.hasNext();) { - Subscription sub = iter.next(); - if (sub.matches(dest.getActiveMQDestination())) { - dest.addSubscription(context, sub); - rc.add(sub); - } - } - return rc; - - } - - public void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout) - throws Exception { - - // No timeout.. then try to shut down right way, fails if there are - // current subscribers. - if (timeout == 0) { - for (Iterator iter = subscriptions.values().iterator(); iter.hasNext();) { - Subscription sub = iter.next(); - if (sub.matches(destination)) { - throw new JMSException("Destination still has an active subscription: " + destination); - } - } - } - - if (timeout > 0) { - // TODO: implement a way to notify the subscribers that we want to - // take the down - // the destination and that they should un-subscribe.. Then wait up - // to timeout time before - // dropping the subscription. - } - - LOG.debug("{} removing destination: {}", broker.getBrokerName(), destination); - - destinationsLock.writeLock().lock(); - try { - Destination dest = destinations.remove(destination); - if (dest != null) { - // timeout<0 or we timed out, we now force any remaining - // subscriptions to un-subscribe. - for (Iterator iter = subscriptions.values().iterator(); iter.hasNext();) { - Subscription sub = iter.next(); - if (sub.matches(destination)) { - dest.removeSubscription(context, sub, 0l); - } - } - destinationMap.removeAll(destination); - dispose(context, dest); - DestinationInterceptor destinationInterceptor = broker.getDestinationInterceptor(); - if (destinationInterceptor != null) { - destinationInterceptor.remove(dest); - } - - } else { - LOG.debug("Cannot remove a destination that doesn't exist: {}", destination); - } - } finally { - destinationsLock.writeLock().unlock(); - } - } - - /** - * Provide an exact or wildcard lookup of destinations in the region - * - * @return a set of matching destination objects. - */ - @SuppressWarnings("unchecked") - public Set getDestinations(ActiveMQDestination destination) { - destinationsLock.readLock().lock(); - try{ - return destinationMap.get(destination); - } finally { - destinationsLock.readLock().unlock(); - } - } - - public Map getDestinationMap() { - destinationsLock.readLock().lock(); - try{ - return destinations; - } finally { - destinationsLock.readLock().unlock(); - } - } - - @SuppressWarnings("unchecked") - public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { - LOG.debug("{} adding consumer: {} for destination: {}", new Object[]{ broker.getBrokerName(), info.getConsumerId(), info.getDestination() }); - ActiveMQDestination destination = info.getDestination(); - if (destination != null && !destination.isPattern() && !destination.isComposite()) { - // lets auto-create the destination - lookup(context, destination,true); - } - - Object addGuard; - synchronized (consumerChangeMutexMap) { - addGuard = consumerChangeMutexMap.get(info.getConsumerId()); - if (addGuard == null) { - addGuard = new Object(); - consumerChangeMutexMap.put(info.getConsumerId(), addGuard); - } - } - synchronized (addGuard) { - Subscription o = subscriptions.get(info.getConsumerId()); - if (o != null) { - LOG.warn("A duplicate subscription was detected. Clients may be misbehaving. Later warnings you may see about subscription removal are a consequence of this."); - return o; - } - - // We may need to add some destinations that are in persistent store - // but not active - // in the broker. - // - // TODO: think about this a little more. This is good cause - // destinations are not loaded into - // memory until a client needs to use the queue, but a management - // agent viewing the - // broker will not see a destination that exists in persistent - // store. We may want to - // eagerly load all destinations into the broker but have an - // inactive state for the - // destination which has reduced memory usage. - // - DestinationFilter.parseFilter(info.getDestination()); - - Subscription sub = createSubscription(context, info); - - subscriptions.put(info.getConsumerId(), sub); - - // At this point we're done directly manipulating subscriptions, - // but we need to retain the synchronized block here. Consider - // otherwise what would happen if at this point a second - // thread added, then removed, as would be allowed with - // no mutex held. Remove is only essentially run once - // so everything after this point would be leaked. - - // Add the subscription to all the matching queues. - // But copy the matches first - to prevent deadlocks - List addList = new ArrayList(); - destinationsLock.readLock().lock(); - try { - for (Destination dest : (Set) destinationMap.get(info.getDestination())) { - addList.add(dest); - } - } finally { - destinationsLock.readLock().unlock(); - } - - for (Destination dest : addList) { - dest.addSubscription(context, sub); - } - - if (info.isBrowser()) { - ((QueueBrowserSubscription) sub).destinationsAdded(); - } - - return sub; - } - } - - /** - * Get all the Destinations that are in storage - * - * @return Set of all stored destinations - */ - @SuppressWarnings("rawtypes") - public Set getDurableDestinations() { - return destinationFactory.getDestinations(); - } - - /** - * @return all Destinations that don't have active consumers - */ - protected Set getInactiveDestinations() { - Set inactiveDests = destinationFactory.getDestinations(); - destinationsLock.readLock().lock(); - try { - inactiveDests.removeAll(destinations.keySet()); - } finally { - destinationsLock.readLock().unlock(); - } - return inactiveDests; - } - - @SuppressWarnings("unchecked") - public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { - LOG.debug("{} removing consumer: {} for destination: {}", new Object[]{ broker.getBrokerName(), info.getConsumerId(), info.getDestination() }); - - Subscription sub = subscriptions.remove(info.getConsumerId()); - // The sub could be removed elsewhere - see ConnectionSplitBroker - if (sub != null) { - - // remove the subscription from all the matching queues. - List removeList = new ArrayList(); - destinationsLock.readLock().lock(); - try { - for (Destination dest : (Set) destinationMap.get(info.getDestination())) { - removeList.add(dest); - } - } finally { - destinationsLock.readLock().unlock(); - } - for (Destination dest : removeList) { - dest.removeSubscription(context, sub, info.getLastDeliveredSequenceId()); - } - - destroySubscription(sub); - } - synchronized (consumerChangeMutexMap) { - consumerChangeMutexMap.remove(info.getConsumerId()); - } - } - - protected void destroySubscription(Subscription sub) { - sub.destroy(); - } - - public void removeSubscription(ConnectionContext context, RemoveSubscriptionInfo info) throws Exception { - throw new JMSException("Invalid operation."); - } - - public void send(final ProducerBrokerExchange producerExchange, Message messageSend) throws Exception { - final ConnectionContext context = producerExchange.getConnectionContext(); - - if (producerExchange.isMutable() || producerExchange.getRegionDestination() == null) { - final Destination regionDestination = lookup(context, messageSend.getDestination(),false); - producerExchange.setRegionDestination(regionDestination); - } - - producerExchange.getRegionDestination().send(producerExchange, messageSend); - } - - public void acknowledge(ConsumerBrokerExchange consumerExchange, MessageAck ack) throws Exception { - Subscription sub = consumerExchange.getSubscription(); - if (sub == null) { - sub = subscriptions.get(ack.getConsumerId()); - if (sub == null) { - if (!consumerExchange.getConnectionContext().isInRecoveryMode()) { - LOG.warn("Ack for non existent subscription, ack: {}", ack); - throw new IllegalArgumentException("The subscription does not exist: " + ack.getConsumerId()); - } else { - LOG.debug("Ack for non existent subscription in recovery, ack: {}", ack); - return; - } - } - consumerExchange.setSubscription(sub); - } - sub.acknowledge(consumerExchange.getConnectionContext(), ack); - } - - public Response messagePull(ConnectionContext context, MessagePull pull) throws Exception { - Subscription sub = subscriptions.get(pull.getConsumerId()); - if (sub == null) { - throw new IllegalArgumentException("The subscription does not exist: " + pull.getConsumerId()); - } - return sub.pullMessage(context, pull); - } - - protected Destination lookup(ConnectionContext context, ActiveMQDestination destination,boolean createTemporary) throws Exception { - Destination dest = null; - - destinationsLock.readLock().lock(); - try { - dest = destinations.get(destination); - } finally { - destinationsLock.readLock().unlock(); - } - - if (dest == null) { - if (isAutoCreateDestinations()) { - // Try to auto create the destination... re-invoke broker - // from the - // top so that the proper security checks are performed. - context.getBroker().addDestination(context, destination, createTemporary); - dest = addDestination(context, destination, false); - // We should now have the dest created. - destinationsLock.readLock().lock(); - try { - dest = destinations.get(destination); - } finally { - destinationsLock.readLock().unlock(); - } - } - - if (dest == null) { - throw new JMSException("The destination " + destination + " does not exist."); - } - } - return dest; - } - - public void processDispatchNotification(MessageDispatchNotification messageDispatchNotification) throws Exception { - Subscription sub = subscriptions.get(messageDispatchNotification.getConsumerId()); - if (sub != null) { - sub.processMessageDispatchNotification(messageDispatchNotification); - } else { - throw new JMSException("Slave broker out of sync with master - Subscription: " - + messageDispatchNotification.getConsumerId() + " on " - + messageDispatchNotification.getDestination() + " does not exist for dispatch of message: " - + messageDispatchNotification.getMessageId()); - } - } - - /* - * For a Queue/TempQueue, dispatch order is imperative to match acks, so the - * dispatch is deferred till the notification to ensure that the - * subscription chosen by the master is used. AMQ-2102 - */ - protected void processDispatchNotificationViaDestination(MessageDispatchNotification messageDispatchNotification) - throws Exception { - Destination dest = null; - destinationsLock.readLock().lock(); - try { - dest = destinations.get(messageDispatchNotification.getDestination()); - } finally { - destinationsLock.readLock().unlock(); - } - - if (dest != null) { - dest.processDispatchNotification(messageDispatchNotification); - } else { - throw new JMSException("Slave broker out of sync with master - Destination: " - + messageDispatchNotification.getDestination() + " does not exist for consumer " - + messageDispatchNotification.getConsumerId() + " with message: " - + messageDispatchNotification.getMessageId()); - } - } - - public void gc() { - for (Subscription sub : subscriptions.values()) { - sub.gc(); - } - - destinationsLock.readLock().lock(); - try { - for (Destination dest : destinations.values()) { - dest.gc(); - } - } finally { - destinationsLock.readLock().unlock(); - } - } - - protected abstract Subscription createSubscription(ConnectionContext context, ConsumerInfo info) throws Exception; - - protected Destination createDestination(ConnectionContext context, ActiveMQDestination destination) - throws Exception { - return destinationFactory.createDestination(context, destination, destinationStatistics); - } - - public boolean isAutoCreateDestinations() { - return autoCreateDestinations; - } - - public void setAutoCreateDestinations(boolean autoCreateDestinations) { - this.autoCreateDestinations = autoCreateDestinations; - } - - @SuppressWarnings("unchecked") - public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception { - destinationsLock.readLock().lock(); - try { - for (Destination dest : (Set) destinationMap.get(info.getDestination())) { - dest.addProducer(context, info); - } - } finally { - destinationsLock.readLock().unlock(); - } - } - - /** - * Removes a Producer. - * - * @param context - * the environment the operation is being executed under. - * @throws Exception - * TODO - */ - @SuppressWarnings("unchecked") - public void removeProducer(ConnectionContext context, ProducerInfo info) throws Exception { - destinationsLock.readLock().lock(); - try { - for (Destination dest : (Set) destinationMap.get(info.getDestination())) { - dest.removeProducer(context, info); - } - } finally { - destinationsLock.readLock().unlock(); - } - } - - protected void dispose(ConnectionContext context, Destination dest) throws Exception { - dest.dispose(context); - dest.stop(); - destinationFactory.removeDestination(dest); - } - - public void processConsumerControl(ConsumerBrokerExchange consumerExchange, ConsumerControl control) { - Subscription sub = subscriptions.get(control.getConsumerId()); - if (sub != null && sub instanceof AbstractSubscription) { - ((AbstractSubscription) sub).setPrefetchSize(control.getPrefetch()); - if (broker.getDestinationPolicy() != null) { - PolicyEntry entry = broker.getDestinationPolicy().getEntryFor(control.getDestination()); - if (entry != null) { - entry.configurePrefetch(sub); - } - } - LOG.debug("setting prefetch: {}, on subscription: {}; resulting value: {}", new Object[]{ control.getPrefetch(), control.getConsumerId(), sub.getConsumerInfo().getCurrentPrefetchSize()}); - try { - lookup(consumerExchange.getConnectionContext(), control.getDestination(),false).wakeup(); - } catch (Exception e) { - LOG.warn("failed to deliver post consumerControl dispatch-wakeup, to destination: {}", control.getDestination(), e); - } - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/AbstractSubscription.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/AbstractSubscription.class deleted file mode 100644 index 9ed577038..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/AbstractSubscription.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/AbstractSubscription.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/AbstractSubscription.java deleted file mode 100644 index 06a44bf37..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/AbstractSubscription.java +++ /dev/null @@ -1,279 +0,0 @@ -/** - * 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.broker.region; - -import java.io.IOException; -import java.util.Collections; -import java.util.List; -import java.util.concurrent.CopyOnWriteArrayList; - -import javax.jms.InvalidSelectorException; -import javax.jms.JMSException; -import javax.management.ObjectName; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ConsumerId; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.command.MessageAck; -import org.apache.activemq.filter.BooleanExpression; -import org.apache.activemq.filter.DestinationFilter; -import org.apache.activemq.filter.LogicExpression; -import org.apache.activemq.filter.MessageEvaluationContext; -import org.apache.activemq.filter.NoLocalExpression; -import org.apache.activemq.selector.SelectorParser; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public abstract class AbstractSubscription implements Subscription { - - private static final Logger LOG = LoggerFactory.getLogger(AbstractSubscription.class); - protected Broker broker; - protected ConnectionContext context; - protected ConsumerInfo info; - protected final DestinationFilter destinationFilter; - protected final CopyOnWriteArrayList destinations = new CopyOnWriteArrayList(); - private BooleanExpression selectorExpression; - private ObjectName objectName; - private int cursorMemoryHighWaterMark = 70; - private boolean slowConsumer; - private long lastAckTime; - - public AbstractSubscription(Broker broker,ConnectionContext context, ConsumerInfo info) throws InvalidSelectorException { - this.broker = broker; - this.context = context; - this.info = info; - this.destinationFilter = DestinationFilter.parseFilter(info.getDestination()); - this.selectorExpression = parseSelector(info); - this.lastAckTime = System.currentTimeMillis(); - } - - private static BooleanExpression parseSelector(ConsumerInfo info) throws InvalidSelectorException { - BooleanExpression rc = null; - if (info.getSelector() != null) { - rc = SelectorParser.parse(info.getSelector()); - } - if (info.isNoLocal()) { - if (rc == null) { - rc = new NoLocalExpression(info.getConsumerId().getConnectionId()); - } else { - rc = LogicExpression.createAND(new NoLocalExpression(info.getConsumerId().getConnectionId()), rc); - } - } - if (info.getAdditionalPredicate() != null) { - if (rc == null) { - rc = info.getAdditionalPredicate(); - } else { - rc = LogicExpression.createAND(info.getAdditionalPredicate(), rc); - } - } - return rc; - } - - @Override - public synchronized void acknowledge(final ConnectionContext context, final MessageAck ack) throws Exception { - this.lastAckTime = System.currentTimeMillis(); - } - - @Override - public boolean matches(MessageReference node, MessageEvaluationContext context) throws IOException { - ConsumerId targetConsumerId = node.getTargetConsumerId(); - if (targetConsumerId != null) { - if (!targetConsumerId.equals(info.getConsumerId())) { - return false; - } - } - try { - return (selectorExpression == null || selectorExpression.matches(context)) && this.context.isAllowedToConsume(node); - } catch (JMSException e) { - LOG.info("Selector failed to evaluate: {}", e.getMessage(), e); - return false; - } - } - - @Override - public boolean matches(ActiveMQDestination destination) { - return destinationFilter.matches(destination); - } - - @Override - public void add(ConnectionContext context, Destination destination) throws Exception { - destinations.add(destination); - } - - @Override - public List remove(ConnectionContext context, Destination destination) throws Exception { - destinations.remove(destination); - return Collections.EMPTY_LIST; - } - - @Override - public ConsumerInfo getConsumerInfo() { - return info; - } - - @Override - public void gc() { - } - - @Override - public ConnectionContext getContext() { - return context; - } - - public ConsumerInfo getInfo() { - return info; - } - - public BooleanExpression getSelectorExpression() { - return selectorExpression; - } - - @Override - public String getSelector() { - return info.getSelector(); - } - - @Override - public void setSelector(String selector) throws InvalidSelectorException { - ConsumerInfo copy = info.copy(); - copy.setSelector(selector); - BooleanExpression newSelector = parseSelector(copy); - // its valid so lets actually update it now - info.setSelector(selector); - this.selectorExpression = newSelector; - } - - @Override - public ObjectName getObjectName() { - return objectName; - } - - @Override - public void setObjectName(ObjectName objectName) { - this.objectName = objectName; - } - - @Override - public int getPrefetchSize() { - return info.getPrefetchSize(); - } - public void setPrefetchSize(int newSize) { - info.setPrefetchSize(newSize); - } - - @Override - public boolean isRecoveryRequired() { - return true; - } - - @Override - public boolean isSlowConsumer() { - return slowConsumer; - } - - public void setSlowConsumer(boolean val) { - slowConsumer = val; - } - - @Override - public boolean addRecoveredMessage(ConnectionContext context, MessageReference message) throws Exception { - boolean result = false; - MessageEvaluationContext msgContext = context.getMessageEvaluationContext(); - try { - Destination regionDestination = (Destination) message.getRegionDestination(); - msgContext.setDestination(regionDestination.getActiveMQDestination()); - msgContext.setMessageReference(message); - result = matches(message, msgContext); - if (result) { - doAddRecoveredMessage(message); - } - - } finally { - msgContext.clear(); - } - return result; - } - - @Override - public ActiveMQDestination getActiveMQDestination() { - return info != null ? info.getDestination() : null; - } - - @Override - public boolean isBrowser() { - return info != null && info.isBrowser(); - } - - @Override - public int getInFlightUsage() { - if (info.getPrefetchSize() > 0) { - return (getInFlightSize() * 100)/info.getPrefetchSize(); - } - return Integer.MAX_VALUE; - } - - /** - * Add a destination - * @param destination - */ - public void addDestination(Destination destination) { - - } - - /** - * Remove a destination - * @param destination - */ - public void removeDestination(Destination destination) { - - } - - @Override - public int getCursorMemoryHighWaterMark(){ - return this.cursorMemoryHighWaterMark; - } - - @Override - public void setCursorMemoryHighWaterMark(int cursorMemoryHighWaterMark){ - this.cursorMemoryHighWaterMark=cursorMemoryHighWaterMark; - } - - @Override - public int countBeforeFull() { - return getDispatchedQueueSize() - info.getPrefetchSize(); - } - - @Override - public void unmatched(MessageReference node) throws IOException { - // only durable topic subs have something to do here - } - - protected void doAddRecoveredMessage(MessageReference message) throws Exception { - add(message); - } - - @Override - public long getTimeOfLastMessageAck() { - return lastAckTime; - } - - public void setTimeOfLastMessageAck(long value) { - this.lastAckTime = value; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/AbstractTempRegion$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/AbstractTempRegion$1.class deleted file mode 100644 index bfa23e022..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/AbstractTempRegion$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/AbstractTempRegion$CachedDestination.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/AbstractTempRegion$CachedDestination.class deleted file mode 100644 index 31dbb8cc9..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/AbstractTempRegion$CachedDestination.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/AbstractTempRegion.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/AbstractTempRegion.class deleted file mode 100644 index 5c0ce14d3..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/AbstractTempRegion.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/AbstractTempRegion.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/AbstractTempRegion.java deleted file mode 100644 index 5de5123e9..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/AbstractTempRegion.java +++ /dev/null @@ -1,159 +0,0 @@ -/** - * 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.broker.region; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import java.util.Timer; -import java.util.TimerTask; - -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.thread.TaskRunnerFactory; -import org.apache.activemq.usage.SystemUsage; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - */ -public abstract class AbstractTempRegion extends AbstractRegion { - private static final Logger LOG = LoggerFactory.getLogger(TempQueueRegion.class); - - private Map cachedDestinations = new HashMap(); - private final boolean doCacheTempDestinations; - private final int purgeTime; - private Timer purgeTimer; - private TimerTask purgeTask; - - - /** - * @param broker - * @param destinationStatistics - * @param memoryManager - * @param taskRunnerFactory - * @param destinationFactory - */ - public AbstractTempRegion(RegionBroker broker, - DestinationStatistics destinationStatistics, - SystemUsage memoryManager, TaskRunnerFactory taskRunnerFactory, - DestinationFactory destinationFactory) { - super(broker, destinationStatistics, memoryManager, taskRunnerFactory, - destinationFactory); - this.doCacheTempDestinations=broker.getBrokerService().isCacheTempDestinations(); - this.purgeTime = broker.getBrokerService().getTimeBeforePurgeTempDestinations(); - if (this.doCacheTempDestinations) { - this.purgeTimer = new Timer("ActiveMQ Temp destination purge timer", true); - this.purgeTask = new TimerTask() { - public void run() { - doPurge(); - } - - }; - this.purgeTimer.schedule(purgeTask, purgeTime, purgeTime); - } - - } - - public void stop() throws Exception { - super.stop(); - if (purgeTimer != null) { - purgeTimer.cancel(); - } - } - - protected synchronized Destination createDestination( - ConnectionContext context, ActiveMQDestination destination) - throws Exception { - Destination result = cachedDestinations.remove(new CachedDestination( - destination)); - if (result == null) { - result = destinationFactory.createDestination(context, destination, destinationStatistics); - } - return result; - } - - protected final synchronized void dispose(ConnectionContext context, - Destination dest) throws Exception { - // add to cache - if (this.doCacheTempDestinations) { - cachedDestinations.put(new CachedDestination(dest - .getActiveMQDestination()), dest); - }else { - try { - dest.dispose(context); - dest.stop(); - } catch (Exception e) { - LOG.warn("Failed to dispose of {}", dest, e); - } - } - } - - private void doDispose(Destination dest) { - ConnectionContext context = new ConnectionContext(); - try { - dest.dispose(context); - dest.stop(); - } catch (Exception e) { - LOG.warn("Failed to dispose of {}", dest, e); - } - - } - - private synchronized void doPurge() { - long currentTime = System.currentTimeMillis(); - if (cachedDestinations.size() > 0) { - Set tmp = new HashSet( - cachedDestinations.keySet()); - for (CachedDestination key : tmp) { - if ((key.timeStamp + purgeTime) < currentTime) { - Destination dest = cachedDestinations.remove(key); - if (dest != null) { - doDispose(dest); - } - } - } - } - } - - static class CachedDestination { - long timeStamp; - - ActiveMQDestination destination; - - CachedDestination(ActiveMQDestination destination) { - this.destination = destination; - this.timeStamp = System.currentTimeMillis(); - } - - public int hashCode() { - return destination.hashCode(); - } - - public boolean equals(Object o) { - if (o instanceof CachedDestination) { - CachedDestination other = (CachedDestination) o; - return other.destination.equals(this.destination); - } - return false; - } - - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/BaseDestination.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/BaseDestination.class deleted file mode 100644 index 56c2d45fb..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/BaseDestination.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/BaseDestination.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/BaseDestination.java deleted file mode 100644 index 5edbdf3b7..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/BaseDestination.java +++ /dev/null @@ -1,793 +0,0 @@ -/** - * 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.broker.region; - -import java.io.IOException; -import java.util.List; -import javax.jms.ResourceAllocationException; -import org.apache.activemq.advisory.AdvisorySupport; -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.BrokerService; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.ProducerBrokerExchange; -import org.apache.activemq.broker.region.policy.DeadLetterStrategy; -import org.apache.activemq.broker.region.policy.SlowConsumerStrategy; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ActiveMQTopic; -import org.apache.activemq.command.Message; -import org.apache.activemq.command.MessageAck; -import org.apache.activemq.command.MessageDispatchNotification; -import org.apache.activemq.command.ProducerInfo; -import org.apache.activemq.filter.NonCachedMessageEvaluationContext; -import org.apache.activemq.security.SecurityContext; -import org.apache.activemq.state.ProducerState; -import org.apache.activemq.store.MessageStore; -import org.apache.activemq.thread.Scheduler; -import org.apache.activemq.usage.MemoryUsage; -import org.apache.activemq.usage.SystemUsage; -import org.apache.activemq.usage.Usage; -import org.slf4j.Logger; - -/** - * - */ -public abstract class BaseDestination implements Destination { - /** - * The maximum number of messages to page in to the destination from - * persistent storage - */ - public static final int MAX_PAGE_SIZE = 200; - public static final int MAX_BROWSE_PAGE_SIZE = MAX_PAGE_SIZE * 2; - public static final long EXPIRE_MESSAGE_PERIOD = 30 * 1000; - public static final long DEFAULT_INACTIVE_TIMEOUT_BEFORE_GC = 60 * 1000; - public static final int MAX_PRODUCERS_TO_AUDIT = 64; - public static final int MAX_AUDIT_DEPTH = 2048; - - protected final ActiveMQDestination destination; - protected final Broker broker; - protected final MessageStore store; - protected SystemUsage systemUsage; - protected MemoryUsage memoryUsage; - private boolean producerFlowControl = true; - private boolean alwaysRetroactive = false; - protected boolean warnOnProducerFlowControl = true; - protected long blockedProducerWarningInterval = DEFAULT_BLOCKED_PRODUCER_WARNING_INTERVAL; - - private int maxProducersToAudit = 1024; - private int maxAuditDepth = 2048; - private boolean enableAudit = true; - private int maxPageSize = MAX_PAGE_SIZE; - private int maxBrowsePageSize = MAX_BROWSE_PAGE_SIZE; - private boolean useCache = true; - private int minimumMessageSize = 1024; - private boolean lazyDispatch = false; - private boolean advisoryForSlowConsumers; - private boolean advisoryForFastProducers; - private boolean advisoryForDiscardingMessages; - private boolean advisoryWhenFull; - private boolean advisoryForDelivery; - private boolean advisoryForConsumed; - private boolean sendAdvisoryIfNoConsumers; - protected final DestinationStatistics destinationStatistics = new DestinationStatistics(); - protected final BrokerService brokerService; - protected final Broker regionBroker; - protected DeadLetterStrategy deadLetterStrategy = DEFAULT_DEAD_LETTER_STRATEGY; - protected long expireMessagesPeriod = EXPIRE_MESSAGE_PERIOD; - private int maxExpirePageSize = MAX_BROWSE_PAGE_SIZE; - protected int cursorMemoryHighWaterMark = 70; - protected int storeUsageHighWaterMark = 100; - private SlowConsumerStrategy slowConsumerStrategy; - private boolean prioritizedMessages; - private long inactiveTimoutBeforeGC = DEFAULT_INACTIVE_TIMEOUT_BEFORE_GC; - private boolean gcIfInactive; - private boolean gcWithNetworkConsumers; - private long lastActiveTime=0l; - private boolean reduceMemoryFootprint = false; - protected final Scheduler scheduler; - private boolean disposed = false; - private boolean doOptimzeMessageStorage = true; - /* - * percentage of in-flight messages above which optimize message store is disabled - */ - private int optimizeMessageStoreInFlightLimit = 10; - - /** - * @param brokerService - * @param store - * @param destination - * @param parentStats - * @throws Exception - */ - public BaseDestination(BrokerService brokerService, MessageStore store, ActiveMQDestination destination, DestinationStatistics parentStats) throws Exception { - this.brokerService = brokerService; - this.broker = brokerService.getBroker(); - this.store = store; - this.destination = destination; - // let's copy the enabled property from the parent DestinationStatistics - this.destinationStatistics.setEnabled(parentStats.isEnabled()); - this.destinationStatistics.setParent(parentStats); - this.systemUsage = new SystemUsage(brokerService.getProducerSystemUsage(), destination.toString()); - this.memoryUsage = this.systemUsage.getMemoryUsage(); - this.memoryUsage.setUsagePortion(1.0f); - this.regionBroker = brokerService.getRegionBroker(); - this.scheduler = brokerService.getBroker().getScheduler(); - } - - /** - * initialize the destination - * - * @throws Exception - */ - public void initialize() throws Exception { - // Let the store know what usage manager we are using so that he can - // flush messages to disk when usage gets high. - if (store != null) { - store.setMemoryUsage(this.memoryUsage); - } - } - - /** - * @return the producerFlowControl - */ - public boolean isProducerFlowControl() { - return producerFlowControl; - } - - /** - * @param producerFlowControl the producerFlowControl to set - */ - public void setProducerFlowControl(boolean producerFlowControl) { - this.producerFlowControl = producerFlowControl; - } - - public boolean isAlwaysRetroactive() { - return alwaysRetroactive; - } - - public void setAlwaysRetroactive(boolean alwaysRetroactive) { - this.alwaysRetroactive = alwaysRetroactive; - } - - /** - * Set's the interval at which warnings about producers being blocked by - * resource usage will be triggered. Values of 0 or less will disable - * warnings - * - * @param blockedProducerWarningInterval the interval at which warning about - * blocked producers will be triggered. - */ - public void setBlockedProducerWarningInterval(long blockedProducerWarningInterval) { - this.blockedProducerWarningInterval = blockedProducerWarningInterval; - } - - /** - * - * @return the interval at which warning about blocked producers will be - * triggered. - */ - public long getBlockedProducerWarningInterval() { - return blockedProducerWarningInterval; - } - - /** - * @return the maxProducersToAudit - */ - public int getMaxProducersToAudit() { - return maxProducersToAudit; - } - - /** - * @param maxProducersToAudit the maxProducersToAudit to set - */ - public void setMaxProducersToAudit(int maxProducersToAudit) { - this.maxProducersToAudit = maxProducersToAudit; - } - - /** - * @return the maxAuditDepth - */ - public int getMaxAuditDepth() { - return maxAuditDepth; - } - - /** - * @param maxAuditDepth the maxAuditDepth to set - */ - public void setMaxAuditDepth(int maxAuditDepth) { - this.maxAuditDepth = maxAuditDepth; - } - - /** - * @return the enableAudit - */ - public boolean isEnableAudit() { - return enableAudit; - } - - /** - * @param enableAudit the enableAudit to set - */ - public void setEnableAudit(boolean enableAudit) { - this.enableAudit = enableAudit; - } - - public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception { - destinationStatistics.getProducers().increment(); - this.lastActiveTime=0l; - } - - public void removeProducer(ConnectionContext context, ProducerInfo info) throws Exception { - destinationStatistics.getProducers().decrement(); - } - - public void addSubscription(ConnectionContext context, Subscription sub) throws Exception{ - destinationStatistics.getConsumers().increment(); - this.lastActiveTime=0l; - } - - public void removeSubscription(ConnectionContext context, Subscription sub, long lastDeliveredSequenceId) throws Exception{ - destinationStatistics.getConsumers().decrement(); - } - - - public final MemoryUsage getMemoryUsage() { - return memoryUsage; - } - - public void setMemoryUsage(MemoryUsage memoryUsage) { - this.memoryUsage = memoryUsage; - } - - public DestinationStatistics getDestinationStatistics() { - return destinationStatistics; - } - - public ActiveMQDestination getActiveMQDestination() { - return destination; - } - - public final String getName() { - return getActiveMQDestination().getPhysicalName(); - } - - public final MessageStore getMessageStore() { - return store; - } - - public boolean isActive() { - boolean isActive = destinationStatistics.getConsumers().getCount() != 0 || - destinationStatistics.getProducers().getCount() != 0; - if (isActive && isGcWithNetworkConsumers() && destinationStatistics.getConsumers().getCount() != 0) { - isActive = hasRegularConsumers(getConsumers()); - } - return isActive; - } - - public int getMaxPageSize() { - return maxPageSize; - } - - public void setMaxPageSize(int maxPageSize) { - this.maxPageSize = maxPageSize; - } - - public int getMaxBrowsePageSize() { - return this.maxBrowsePageSize; - } - - public void setMaxBrowsePageSize(int maxPageSize) { - this.maxBrowsePageSize = maxPageSize; - } - - public int getMaxExpirePageSize() { - return this.maxExpirePageSize; - } - - public void setMaxExpirePageSize(int maxPageSize) { - this.maxExpirePageSize = maxPageSize; - } - - public void setExpireMessagesPeriod(long expireMessagesPeriod) { - this.expireMessagesPeriod = expireMessagesPeriod; - } - - public long getExpireMessagesPeriod() { - return expireMessagesPeriod; - } - - public boolean isUseCache() { - return useCache; - } - - public void setUseCache(boolean useCache) { - this.useCache = useCache; - } - - public int getMinimumMessageSize() { - return minimumMessageSize; - } - - public void setMinimumMessageSize(int minimumMessageSize) { - this.minimumMessageSize = minimumMessageSize; - } - - public boolean isLazyDispatch() { - return lazyDispatch; - } - - public void setLazyDispatch(boolean lazyDispatch) { - this.lazyDispatch = lazyDispatch; - } - - protected long getDestinationSequenceId() { - return regionBroker.getBrokerSequenceId(); - } - - /** - * @return the advisoryForSlowConsumers - */ - public boolean isAdvisoryForSlowConsumers() { - return advisoryForSlowConsumers; - } - - /** - * @param advisoryForSlowConsumers the advisoryForSlowConsumers to set - */ - public void setAdvisoryForSlowConsumers(boolean advisoryForSlowConsumers) { - this.advisoryForSlowConsumers = advisoryForSlowConsumers; - } - - /** - * @return the advisoryForDiscardingMessages - */ - public boolean isAdvisoryForDiscardingMessages() { - return advisoryForDiscardingMessages; - } - - /** - * @param advisoryForDiscardingMessages the advisoryForDiscardingMessages to - * set - */ - public void setAdvisoryForDiscardingMessages(boolean advisoryForDiscardingMessages) { - this.advisoryForDiscardingMessages = advisoryForDiscardingMessages; - } - - /** - * @return the advisoryWhenFull - */ - public boolean isAdvisoryWhenFull() { - return advisoryWhenFull; - } - - /** - * @param advisoryWhenFull the advisoryWhenFull to set - */ - public void setAdvisoryWhenFull(boolean advisoryWhenFull) { - this.advisoryWhenFull = advisoryWhenFull; - } - - /** - * @return the advisoryForDelivery - */ - public boolean isAdvisoryForDelivery() { - return advisoryForDelivery; - } - - /** - * @param advisoryForDelivery the advisoryForDelivery to set - */ - public void setAdvisoryForDelivery(boolean advisoryForDelivery) { - this.advisoryForDelivery = advisoryForDelivery; - } - - /** - * @return the advisoryForConsumed - */ - public boolean isAdvisoryForConsumed() { - return advisoryForConsumed; - } - - /** - * @param advisoryForConsumed the advisoryForConsumed to set - */ - public void setAdvisoryForConsumed(boolean advisoryForConsumed) { - this.advisoryForConsumed = advisoryForConsumed; - } - - /** - * @return the advisdoryForFastProducers - */ - public boolean isAdvisoryForFastProducers() { - return advisoryForFastProducers; - } - - /** - * @param advisoryForFastProducers the advisdoryForFastProducers to set - */ - public void setAdvisoryForFastProducers(boolean advisoryForFastProducers) { - this.advisoryForFastProducers = advisoryForFastProducers; - } - - public boolean isSendAdvisoryIfNoConsumers() { - return sendAdvisoryIfNoConsumers; - } - - public void setSendAdvisoryIfNoConsumers(boolean sendAdvisoryIfNoConsumers) { - this.sendAdvisoryIfNoConsumers = sendAdvisoryIfNoConsumers; - } - - /** - * @return the dead letter strategy - */ - public DeadLetterStrategy getDeadLetterStrategy() { - return deadLetterStrategy; - } - - /** - * set the dead letter strategy - * - * @param deadLetterStrategy - */ - public void setDeadLetterStrategy(DeadLetterStrategy deadLetterStrategy) { - this.deadLetterStrategy = deadLetterStrategy; - } - - public int getCursorMemoryHighWaterMark() { - return this.cursorMemoryHighWaterMark; - } - - public void setCursorMemoryHighWaterMark(int cursorMemoryHighWaterMark) { - this.cursorMemoryHighWaterMark = cursorMemoryHighWaterMark; - } - - /** - * called when message is consumed - * - * @param context - * @param messageReference - */ - public void messageConsumed(ConnectionContext context, MessageReference messageReference) { - if (advisoryForConsumed) { - broker.messageConsumed(context, messageReference); - } - } - - /** - * Called when message is delivered to the broker - * - * @param context - * @param messageReference - */ - public void messageDelivered(ConnectionContext context, MessageReference messageReference) { - if (advisoryForDelivery) { - broker.messageDelivered(context, messageReference); - } - } - - /** - * Called when a message is discarded - e.g. running low on memory This will - * happen only if the policy is enabled - e.g. non durable topics - * - * @param context - * @param messageReference - */ - public void messageDiscarded(ConnectionContext context, Subscription sub, MessageReference messageReference) { - if (advisoryForDiscardingMessages) { - broker.messageDiscarded(context, sub, messageReference); - } - } - - /** - * Called when there is a slow consumer - * - * @param context - * @param subs - */ - public void slowConsumer(ConnectionContext context, Subscription subs) { - if (advisoryForSlowConsumers) { - broker.slowConsumer(context, this, subs); - } - if (slowConsumerStrategy != null) { - slowConsumerStrategy.slowConsumer(context, subs); - } - } - - /** - * Called to notify a producer is too fast - * - * @param context - * @param producerInfo - */ - public void fastProducer(ConnectionContext context, ProducerInfo producerInfo) { - if (advisoryForFastProducers) { - broker.fastProducer(context, producerInfo, getActiveMQDestination()); - } - } - - /** - * Called when a Usage reaches a limit - * - * @param context - * @param usage - */ - public void isFull(ConnectionContext context, Usage usage) { - if (advisoryWhenFull) { - broker.isFull(context, this, usage); - } - } - - public void dispose(ConnectionContext context) throws IOException { - if (this.store != null) { - this.store.removeAllMessages(context); - this.store.dispose(context); - } - this.destinationStatistics.setParent(null); - this.memoryUsage.stop(); - this.disposed = true; - } - - public boolean isDisposed() { - return this.disposed; - } - - /** - * Provides a hook to allow messages with no consumer to be processed in - * some way - such as to send to a dead letter queue or something.. - */ - protected void onMessageWithNoConsumers(ConnectionContext context, Message msg) throws Exception { - if (!msg.isPersistent()) { - if (isSendAdvisoryIfNoConsumers()) { - // allow messages with no consumers to be dispatched to a dead - // letter queue - if (destination.isQueue() || !AdvisorySupport.isAdvisoryTopic(destination)) { - - Message message = msg.copy(); - // The original destination and transaction id do not get - // filled when the message is first sent, - // it is only populated if the message is routed to another - // destination like the DLQ - if (message.getOriginalDestination() != null) { - message.setOriginalDestination(message.getDestination()); - } - if (message.getOriginalTransactionId() != null) { - message.setOriginalTransactionId(message.getTransactionId()); - } - - ActiveMQTopic advisoryTopic; - if (destination.isQueue()) { - advisoryTopic = AdvisorySupport.getNoQueueConsumersAdvisoryTopic(destination); - } else { - advisoryTopic = AdvisorySupport.getNoTopicConsumersAdvisoryTopic(destination); - } - message.setDestination(advisoryTopic); - message.setTransactionId(null); - - // Disable flow control for this since since we don't want - // to block. - boolean originalFlowControl = context.isProducerFlowControl(); - try { - context.setProducerFlowControl(false); - ProducerBrokerExchange producerExchange = new ProducerBrokerExchange(); - producerExchange.setMutable(false); - producerExchange.setConnectionContext(context); - producerExchange.setProducerState(new ProducerState(new ProducerInfo())); - context.getBroker().send(producerExchange, message); - } finally { - context.setProducerFlowControl(originalFlowControl); - } - - } - } - } - } - - public void processDispatchNotification(MessageDispatchNotification messageDispatchNotification) throws Exception { - } - - public final int getStoreUsageHighWaterMark() { - return this.storeUsageHighWaterMark; - } - - public void setStoreUsageHighWaterMark(int storeUsageHighWaterMark) { - this.storeUsageHighWaterMark = storeUsageHighWaterMark; - } - - protected final void waitForSpace(ConnectionContext context,ProducerBrokerExchange producerBrokerExchange, Usage usage, String warning) throws IOException, InterruptedException, ResourceAllocationException { - waitForSpace(context, producerBrokerExchange, usage, 100, warning); - } - - protected final void waitForSpace(ConnectionContext context, ProducerBrokerExchange producerBrokerExchange, Usage usage, int highWaterMark, String warning) throws IOException, InterruptedException, ResourceAllocationException { - if (!context.isNetworkConnection() && systemUsage.isSendFailIfNoSpace()) { - getLog().debug("sendFailIfNoSpace, forcing exception on send, usage: {}: {}", usage, warning); - throw new ResourceAllocationException(warning); - } - if (!context.isNetworkConnection() && systemUsage.getSendFailIfNoSpaceAfterTimeout() != 0) { - if (!usage.waitForSpace(systemUsage.getSendFailIfNoSpaceAfterTimeout(), highWaterMark)) { - getLog().debug("sendFailIfNoSpaceAfterTimeout expired, forcing exception on send, usage: {}: {}", usage, warning); - throw new ResourceAllocationException(warning); - } - } else { - long start = System.currentTimeMillis(); - long nextWarn = start; - producerBrokerExchange.blockingOnFlowControl(true); - destinationStatistics.getBlockedSends().increment(); - while (!usage.waitForSpace(1000, highWaterMark)) { - if (context.getStopping().get()) { - throw new IOException("Connection closed, send aborted."); - } - - long now = System.currentTimeMillis(); - if (now >= nextWarn) { - getLog().info("{}: {} (blocking for: {}s)", new Object[]{ usage, warning, new Long(((now - start) / 1000))}); - nextWarn = now + blockedProducerWarningInterval; - } - } - long finish = System.currentTimeMillis(); - long totalTimeBlocked = finish - start; - destinationStatistics.getBlockedTime().addTime(totalTimeBlocked); - producerBrokerExchange.incrementTimeBlocked(this,totalTimeBlocked); - producerBrokerExchange.blockingOnFlowControl(false); - } - } - - protected abstract Logger getLog(); - - public void setSlowConsumerStrategy(SlowConsumerStrategy slowConsumerStrategy) { - this.slowConsumerStrategy = slowConsumerStrategy; - } - - public SlowConsumerStrategy getSlowConsumerStrategy() { - return this.slowConsumerStrategy; - } - - - public boolean isPrioritizedMessages() { - return this.prioritizedMessages; - } - - public void setPrioritizedMessages(boolean prioritizedMessages) { - this.prioritizedMessages = prioritizedMessages; - if (store != null) { - store.setPrioritizedMessages(prioritizedMessages); - } - } - - /** - * @return the inactiveTimoutBeforeGC - */ - public long getInactiveTimoutBeforeGC() { - return this.inactiveTimoutBeforeGC; - } - - /** - * @param inactiveTimoutBeforeGC the inactiveTimoutBeforeGC to set - */ - public void setInactiveTimoutBeforeGC(long inactiveTimoutBeforeGC) { - this.inactiveTimoutBeforeGC = inactiveTimoutBeforeGC; - } - - /** - * @return the gcIfInactive - */ - public boolean isGcIfInactive() { - return this.gcIfInactive; - } - - /** - * @param gcIfInactive the gcIfInactive to set - */ - public void setGcIfInactive(boolean gcIfInactive) { - this.gcIfInactive = gcIfInactive; - } - - /** - * Indicate if it is ok to gc destinations that have only network consumers - * @param gcWithNetworkConsumers - */ - public void setGcWithNetworkConsumers(boolean gcWithNetworkConsumers) { - this.gcWithNetworkConsumers = gcWithNetworkConsumers; - } - - public boolean isGcWithNetworkConsumers() { - return gcWithNetworkConsumers; - } - - public void markForGC(long timeStamp) { - if (isGcIfInactive() && this.lastActiveTime == 0 && isActive() == false - && destinationStatistics.messages.getCount() == 0 && getInactiveTimoutBeforeGC() > 0l) { - this.lastActiveTime = timeStamp; - } - } - - public boolean canGC() { - boolean result = false; - if (isGcIfInactive()&& this.lastActiveTime != 0l) { - if ((System.currentTimeMillis() - this.lastActiveTime) >= getInactiveTimoutBeforeGC()) { - result = true; - } - } - return result; - } - - public void setReduceMemoryFootprint(boolean reduceMemoryFootprint) { - this.reduceMemoryFootprint = reduceMemoryFootprint; - } - - protected boolean isReduceMemoryFootprint() { - return this.reduceMemoryFootprint; - } - - public boolean isDoOptimzeMessageStorage() { - return doOptimzeMessageStorage; - } - - public void setDoOptimzeMessageStorage(boolean doOptimzeMessageStorage) { - this.doOptimzeMessageStorage = doOptimzeMessageStorage; - } - - public int getOptimizeMessageStoreInFlightLimit() { - return optimizeMessageStoreInFlightLimit; - } - - public void setOptimizeMessageStoreInFlightLimit(int optimizeMessageStoreInFlightLimit) { - this.optimizeMessageStoreInFlightLimit = optimizeMessageStoreInFlightLimit; - } - - - public abstract List getConsumers(); - - protected boolean hasRegularConsumers(List consumers) { - boolean hasRegularConsumers = false; - for (Subscription subscription: consumers) { - if (!subscription.getConsumerInfo().isNetworkSubscription()) { - hasRegularConsumers = true; - break; - } - } - return hasRegularConsumers; - } - - protected ConnectionContext createConnectionContext() { - ConnectionContext answer = new ConnectionContext(new NonCachedMessageEvaluationContext()); - answer.setBroker(this.broker); - answer.getMessageEvaluationContext().setDestination(getActiveMQDestination()); - answer.setSecurityContext(SecurityContext.BROKER_SECURITY_CONTEXT); - return answer; - } - - protected MessageAck convertToNonRangedAck(MessageAck ack, MessageReference node) { - // the original ack may be a ranged ack, but we are trying to delete - // a specific - // message store here so we need to convert to a non ranged ack. - if (ack.getMessageCount() > 0) { - // Dup the ack - MessageAck a = new MessageAck(); - ack.copy(a); - ack = a; - // Convert to non-ranged. - ack.setFirstMessageId(node.getMessageId()); - ack.setLastMessageId(node.getMessageId()); - ack.setMessageCount(1); - } - return ack; - } - - public boolean isDLQ() { - return getDeadLetterStrategy().isDLQ(this.getActiveMQDestination()); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/CompositeDestinationInterceptor.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/CompositeDestinationInterceptor.class deleted file mode 100644 index a2b18b942..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/CompositeDestinationInterceptor.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/CompositeDestinationInterceptor.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/CompositeDestinationInterceptor.java deleted file mode 100644 index b96a5ef32..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/CompositeDestinationInterceptor.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * 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.broker.region; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.command.ActiveMQDestination; - -/** - * Represents a Composite Pattern of a {@link DestinationInterceptor} - * - * - */ -public class CompositeDestinationInterceptor implements DestinationInterceptor { - - private volatile DestinationInterceptor[] interceptors; - - public CompositeDestinationInterceptor(final DestinationInterceptor[] interceptors) { - this.interceptors = interceptors; - } - - public Destination intercept(Destination destination) { - for (int i = 0; i < interceptors.length; i++) { - destination = interceptors[i].intercept(destination); - } - return destination; - } - - - public void remove(Destination destination) { - for (int i = 0; i < interceptors.length; i++) { - interceptors[i].remove(destination); - } - } - - public void create(Broker broker, ConnectionContext context, ActiveMQDestination destination) throws Exception { - for (int i = 0; i < interceptors.length; i++) { - interceptors[i].create(broker, context, destination); - } - } - - public void setInterceptors(final DestinationInterceptor[] interceptors) { - this.interceptors = interceptors; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/ConnectionStatistics.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/ConnectionStatistics.class deleted file mode 100644 index fb130355e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/ConnectionStatistics.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/ConnectionStatistics.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/ConnectionStatistics.java deleted file mode 100644 index 38eddb96d..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/ConnectionStatistics.java +++ /dev/null @@ -1,72 +0,0 @@ -/** - * 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.broker.region; - -import org.apache.activemq.management.CountStatisticImpl; -import org.apache.activemq.management.StatsImpl; - -/** - * The J2EE Statistics for the Connection. - * - * - */ -public class ConnectionStatistics extends StatsImpl { - - private CountStatisticImpl enqueues; - private CountStatisticImpl dequeues; - - public ConnectionStatistics() { - - enqueues = new CountStatisticImpl("enqueues", "The number of messages that have been sent to the connection"); - dequeues = new CountStatisticImpl("dequeues", "The number of messages that have been dispatched from the connection"); - - addStatistic("enqueues", enqueues); - addStatistic("dequeues", dequeues); - } - - public CountStatisticImpl getEnqueues() { - return enqueues; - } - - public CountStatisticImpl getDequeues() { - return dequeues; - } - - public void reset() { - super.reset(); - enqueues.reset(); - dequeues.reset(); - } - - public void setEnabled(boolean enabled) { - super.setEnabled(enabled); - enqueues.setEnabled(enabled); - dequeues.setEnabled(enabled); - } - - public void setParent(ConnectorStatistics parent) { - if (parent != null) { - enqueues.setParent(parent.getEnqueues()); - dequeues.setParent(parent.getDequeues()); - } else { - enqueues.setParent(null); - dequeues.setParent(null); - } - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/ConnectorStatistics.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/ConnectorStatistics.class deleted file mode 100644 index 0f2e19339..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/ConnectorStatistics.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/ConnectorStatistics.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/ConnectorStatistics.java deleted file mode 100644 index 11a15358b..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/ConnectorStatistics.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * 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.broker.region; - -import org.apache.activemq.management.CountStatisticImpl; -import org.apache.activemq.management.PollCountStatisticImpl; -import org.apache.activemq.management.StatsImpl; - -/** - * The J2EE Statistics for the a Destination. - * - * - */ -public class ConnectorStatistics extends StatsImpl { - - protected CountStatisticImpl enqueues; - protected CountStatisticImpl dequeues; - protected CountStatisticImpl consumers; - protected CountStatisticImpl messages; - protected PollCountStatisticImpl messagesCached; - - public ConnectorStatistics() { - - enqueues = new CountStatisticImpl("enqueues", "The number of messages that have been sent to the destination"); - dequeues = new CountStatisticImpl("dequeues", "The number of messages that have been dispatched from the destination"); - consumers = new CountStatisticImpl("consumers", "The number of consumers that that are subscribing to messages from the destination"); - messages = new CountStatisticImpl("messages", "The number of messages that that are being held by the destination"); - messagesCached = new PollCountStatisticImpl("messagesCached", "The number of messages that are held in the destination's memory cache"); - - addStatistic("enqueues", enqueues); - addStatistic("dequeues", dequeues); - addStatistic("consumers", consumers); - addStatistic("messages", messages); - addStatistic("messagesCached", messagesCached); - } - - public CountStatisticImpl getEnqueues() { - return enqueues; - } - - public CountStatisticImpl getDequeues() { - return dequeues; - } - - public CountStatisticImpl getConsumers() { - return consumers; - } - - public PollCountStatisticImpl getMessagesCached() { - return messagesCached; - } - - public CountStatisticImpl getMessages() { - return messages; - } - - public void reset() { - super.reset(); - enqueues.reset(); - dequeues.reset(); - } - - public void setEnabled(boolean enabled) { - super.setEnabled(enabled); - enqueues.setEnabled(enabled); - dequeues.setEnabled(enabled); - consumers.setEnabled(enabled); - messages.setEnabled(enabled); - messagesCached.setEnabled(enabled); - } - - public void setParent(ConnectorStatistics parent) { - if (parent != null) { - enqueues.setParent(parent.enqueues); - dequeues.setParent(parent.dequeues); - consumers.setParent(parent.consumers); - messagesCached.setParent(parent.messagesCached); - messages.setParent(parent.messages); - } else { - enqueues.setParent(null); - dequeues.setParent(null); - consumers.setParent(null); - messagesCached.setParent(null); - messages.setParent(null); - } - } - - public void setMessagesCached(PollCountStatisticImpl messagesCached) { - this.messagesCached = messagesCached; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Destination.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Destination.class deleted file mode 100644 index 0ddabac49..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Destination.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Destination.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Destination.java deleted file mode 100644 index 93502e70c..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Destination.java +++ /dev/null @@ -1,242 +0,0 @@ -/** - * 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.broker.region; - -import java.io.IOException; -import java.util.List; -import org.apache.activemq.Service; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.ProducerBrokerExchange; -import org.apache.activemq.broker.region.policy.DeadLetterStrategy; -import org.apache.activemq.broker.region.policy.SharedDeadLetterStrategy; -import org.apache.activemq.broker.region.policy.SlowConsumerStrategy; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.Message; -import org.apache.activemq.command.MessageAck; -import org.apache.activemq.command.MessageDispatchNotification; -import org.apache.activemq.command.ProducerInfo; -import org.apache.activemq.store.MessageStore; -import org.apache.activemq.thread.Task; -import org.apache.activemq.usage.MemoryUsage; -import org.apache.activemq.usage.Usage; - -/** - * - */ -public interface Destination extends Service, Task, Message.MessageDestination { - - public static final DeadLetterStrategy DEFAULT_DEAD_LETTER_STRATEGY = new SharedDeadLetterStrategy(); - public static final long DEFAULT_BLOCKED_PRODUCER_WARNING_INTERVAL = 30000; - - void addSubscription(ConnectionContext context, Subscription sub) throws Exception; - - void removeSubscription(ConnectionContext context, Subscription sub, long lastDeliveredSequenceId) throws Exception; - - void addProducer(ConnectionContext context, ProducerInfo info) throws Exception; - - void removeProducer(ConnectionContext context, ProducerInfo info) throws Exception; - - void send(ProducerBrokerExchange producerExchange, Message messageSend) throws Exception; - - void acknowledge(ConnectionContext context, Subscription sub, final MessageAck ack, final MessageReference node) throws IOException; - - long getInactiveTimoutBeforeGC(); - - void markForGC(long timeStamp); - - boolean canGC(); - - void gc(); - - ActiveMQDestination getActiveMQDestination(); - - MemoryUsage getMemoryUsage(); - - void setMemoryUsage(MemoryUsage memoryUsage); - - void dispose(ConnectionContext context) throws IOException; - - boolean isDisposed(); - - DestinationStatistics getDestinationStatistics(); - - DeadLetterStrategy getDeadLetterStrategy(); - - Message[] browse(); - - String getName(); - - MessageStore getMessageStore(); - - boolean isProducerFlowControl(); - - void setProducerFlowControl(boolean value); - - boolean isAlwaysRetroactive(); - - void setAlwaysRetroactive(boolean value); - - /** - * Set's the interval at which warnings about producers being blocked by - * resource usage will be triggered. Values of 0 or less will disable - * warnings - * - * @param blockedProducerWarningInterval the interval at which warning about - * blocked producers will be triggered. - */ - public void setBlockedProducerWarningInterval(long blockedProducerWarningInterval); - - /** - * - * @return the interval at which warning about blocked producers will be - * triggered. - */ - public long getBlockedProducerWarningInterval(); - - int getMaxProducersToAudit(); - - void setMaxProducersToAudit(int maxProducersToAudit); - - int getMaxAuditDepth(); - - void setMaxAuditDepth(int maxAuditDepth); - - boolean isEnableAudit(); - - void setEnableAudit(boolean enableAudit); - - boolean isActive(); - - int getMaxPageSize(); - - public void setMaxPageSize(int maxPageSize); - - public int getMaxBrowsePageSize(); - - public void setMaxBrowsePageSize(int maxPageSize); - - public boolean isUseCache(); - - public void setUseCache(boolean useCache); - - public int getMinimumMessageSize(); - - public void setMinimumMessageSize(int minimumMessageSize); - - public int getCursorMemoryHighWaterMark(); - - public void setCursorMemoryHighWaterMark(int cursorMemoryHighWaterMark); - - /** - * optionally called by a Subscriber - to inform the Destination its ready - * for more messages - */ - public void wakeup(); - - /** - * @return true if lazyDispatch is enabled - */ - public boolean isLazyDispatch(); - - /** - * set the lazy dispatch - default is false - * - * @param value - */ - public void setLazyDispatch(boolean value); - - /** - * Inform the Destination a message has expired - * - * @param context - * @param subs - * @param node - */ - void messageExpired(ConnectionContext context, Subscription subs, MessageReference node); - - /** - * called when message is consumed - * - * @param context - * @param messageReference - */ - void messageConsumed(ConnectionContext context, MessageReference messageReference); - - /** - * Called when message is delivered to the broker - * - * @param context - * @param messageReference - */ - void messageDelivered(ConnectionContext context, MessageReference messageReference); - - /** - * Called when a message is discarded - e.g. running low on memory This will - * happen only if the policy is enabled - e.g. non durable topics - * - * @param context - * @param messageReference - * @param sub - */ - void messageDiscarded(ConnectionContext context, Subscription sub, MessageReference messageReference); - - /** - * Called when there is a slow consumer - * - * @param context - * @param subs - */ - void slowConsumer(ConnectionContext context, Subscription subs); - - /** - * Called to notify a producer is too fast - * - * @param context - * @param producerInfo - */ - void fastProducer(ConnectionContext context, ProducerInfo producerInfo); - - /** - * Called when a Usage reaches a limit - * - * @param context - * @param usage - */ - void isFull(ConnectionContext context, Usage usage); - - List getConsumers(); - - /** - * called on Queues in slave mode to allow dispatch to follow subscription - * choice of master - * - * @param messageDispatchNotification - * @throws Exception - */ - void processDispatchNotification(MessageDispatchNotification messageDispatchNotification) throws Exception; - - boolean isPrioritizedMessages(); - - SlowConsumerStrategy getSlowConsumerStrategy(); - - boolean isDoOptimzeMessageStorage(); - void setDoOptimzeMessageStorage(boolean doOptimzeMessageStorage); - - public void clearPendingMessages(); - - public boolean isDLQ(); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/DestinationFactory.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/DestinationFactory.class deleted file mode 100644 index 87bc5af70..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/DestinationFactory.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/DestinationFactory.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/DestinationFactory.java deleted file mode 100644 index e6fdf08ec..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/DestinationFactory.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * 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.broker.region; - -import java.io.IOException; -import java.util.Set; - -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ActiveMQTopic; -import org.apache.activemq.command.SubscriptionInfo; - -/** - * Used to create Destinations. One instance of DestinationFactory is used per BrokerService. - * - * @author fateev@amazon.com - * - */ -public abstract class DestinationFactory { - - /** - * Create destination implementation. - */ - public abstract Destination createDestination(ConnectionContext context, ActiveMQDestination destination, DestinationStatistics destinationStatistics) throws Exception; - - public abstract void removeDestination(Destination dest); - - /** - * Returns a set of all the {@link org.apache.activemq.command.ActiveMQDestination} - * objects that the persistence store is aware exist. - */ - public abstract Set getDestinations(); - - /** - * Lists all the durable subscirptions for a given destination. - */ - public abstract SubscriptionInfo[] getAllDurableSubscriptions(ActiveMQTopic topic) throws IOException; - - - public abstract long getLastMessageBrokerSequenceId() throws IOException; - - public abstract void setRegionBroker(RegionBroker regionBroker); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/DestinationFactoryImpl.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/DestinationFactoryImpl.class deleted file mode 100644 index ade74dfa7..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/DestinationFactoryImpl.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/DestinationFactoryImpl.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/DestinationFactoryImpl.java deleted file mode 100644 index 6c146f0c8..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/DestinationFactoryImpl.java +++ /dev/null @@ -1,158 +0,0 @@ -/** - * 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.broker.region; - -import java.io.IOException; -import java.util.Set; -import org.apache.activemq.advisory.AdvisorySupport; -import org.apache.activemq.broker.BrokerService; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.region.policy.PolicyEntry; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ActiveMQQueue; -import org.apache.activemq.command.ActiveMQTempDestination; -import org.apache.activemq.command.ActiveMQTopic; -import org.apache.activemq.command.SubscriptionInfo; -import org.apache.activemq.store.MessageStore; -import org.apache.activemq.store.PersistenceAdapter; -import org.apache.activemq.store.TopicMessageStore; -import org.apache.activemq.thread.TaskRunnerFactory; - -/** - * Creates standard ActiveMQ implementations of - * {@link org.apache.activemq.broker.region.Destination}. - * - * @author fateev@amazon.com - * - */ -public class DestinationFactoryImpl extends DestinationFactory { - - protected final TaskRunnerFactory taskRunnerFactory; - protected final PersistenceAdapter persistenceAdapter; - protected RegionBroker broker; - private final BrokerService brokerService; - - public DestinationFactoryImpl(BrokerService brokerService, TaskRunnerFactory taskRunnerFactory, PersistenceAdapter persistenceAdapter) { - this.brokerService = brokerService; - this.taskRunnerFactory = taskRunnerFactory; - if (persistenceAdapter == null) { - throw new IllegalArgumentException("null persistenceAdapter"); - } - this.persistenceAdapter = persistenceAdapter; - } - - @Override - public void setRegionBroker(RegionBroker broker) { - if (broker == null) { - throw new IllegalArgumentException("null broker"); - } - this.broker = broker; - } - - @Override - public Set getDestinations() { - return persistenceAdapter.getDestinations(); - } - - /** - * @return instance of {@link Queue} or {@link Topic} - */ - @Override - public Destination createDestination(ConnectionContext context, ActiveMQDestination destination, DestinationStatistics destinationStatistics) throws Exception { - if (destination.isQueue()) { - if (destination.isTemporary()) { - final ActiveMQTempDestination tempDest = (ActiveMQTempDestination)destination; - Queue queue = new TempQueue(brokerService, destination, null, destinationStatistics, taskRunnerFactory); - configureQueue(queue, destination); - queue.initialize(); - return queue; - } else { - MessageStore store = persistenceAdapter.createQueueMessageStore((ActiveMQQueue)destination); - Queue queue = new Queue(brokerService, destination, store, destinationStatistics, taskRunnerFactory); - configureQueue(queue, destination); - queue.initialize(); - return queue; - } - } else if (destination.isTemporary()) { - - Topic topic = new Topic(brokerService, destination, null, destinationStatistics, taskRunnerFactory); - configureTopic(topic, destination); - topic.initialize(); - return topic; - } else { - TopicMessageStore store = null; - if (!AdvisorySupport.isAdvisoryTopic(destination)) { - store = persistenceAdapter.createTopicMessageStore((ActiveMQTopic)destination); - } - Topic topic = new Topic(brokerService, destination, store, destinationStatistics, taskRunnerFactory); - configureTopic(topic, destination); - topic.initialize(); - return topic; - } - } - - @Override - public void removeDestination(Destination dest) { - ActiveMQDestination destination = dest.getActiveMQDestination(); - if (!destination.isTemporary()) { - if (destination.isQueue()) { - persistenceAdapter.removeQueueMessageStore((ActiveMQQueue) destination); - } - else if (!AdvisorySupport.isAdvisoryTopic(destination)) { - persistenceAdapter.removeTopicMessageStore((ActiveMQTopic) destination); - } - } - } - - protected void configureQueue(Queue queue, ActiveMQDestination destination) { - if (broker == null) { - throw new IllegalStateException("broker property is not set"); - } - if (broker.getDestinationPolicy() != null) { - PolicyEntry entry = broker.getDestinationPolicy().getEntryFor(destination); - if (entry != null) { - entry.configure(broker,queue); - } - } - } - - protected void configureTopic(Topic topic, ActiveMQDestination destination) { - if (broker == null) { - throw new IllegalStateException("broker property is not set"); - } - if (broker.getDestinationPolicy() != null) { - PolicyEntry entry = broker.getDestinationPolicy().getEntryFor(destination); - if (entry != null) { - entry.configure(broker,topic); - } - } - } - - @Override - public long getLastMessageBrokerSequenceId() throws IOException { - return persistenceAdapter.getLastMessageBrokerSequenceId(); - } - - public PersistenceAdapter getPersistenceAdapter() { - return persistenceAdapter; - } - - @Override - public SubscriptionInfo[] getAllDurableSubscriptions(ActiveMQTopic topic) throws IOException { - return persistenceAdapter.createTopicMessageStore(topic).getAllSubscriptions(); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/DestinationFilter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/DestinationFilter.class deleted file mode 100644 index 78c369a43..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/DestinationFilter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/DestinationFilter.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/DestinationFilter.java deleted file mode 100644 index ecf6cf75d..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/DestinationFilter.java +++ /dev/null @@ -1,400 +0,0 @@ -/** - * 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.broker.region; - -import java.io.IOException; -import java.util.List; -import java.util.Set; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.ProducerBrokerExchange; -import org.apache.activemq.broker.region.policy.DeadLetterStrategy; -import org.apache.activemq.broker.region.policy.SlowConsumerStrategy; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.Message; -import org.apache.activemq.command.MessageAck; -import org.apache.activemq.command.MessageDispatchNotification; -import org.apache.activemq.command.ProducerInfo; -import org.apache.activemq.store.MessageStore; -import org.apache.activemq.usage.MemoryUsage; -import org.apache.activemq.usage.Usage; -import org.apache.activemq.util.SubscriptionKey; - -/** - * - * - */ -public class DestinationFilter implements Destination { - - protected final Destination next; - - public DestinationFilter(Destination next) { - this.next = next; - } - - @Override - public void acknowledge(ConnectionContext context, Subscription sub, MessageAck ack, MessageReference node) throws IOException { - next.acknowledge(context, sub, ack, node); - } - - @Override - public void addSubscription(ConnectionContext context, Subscription sub) throws Exception { - next.addSubscription(context, sub); - } - - @Override - public Message[] browse() { - return next.browse(); - } - - @Override - public void dispose(ConnectionContext context) throws IOException { - next.dispose(context); - } - - @Override - public boolean isDisposed() { - return next.isDisposed(); - } - - @Override - public void gc() { - next.gc(); - } - - @Override - public void markForGC(long timeStamp) { - next.markForGC(timeStamp); - } - - @Override - public boolean canGC() { - return next.canGC(); - } - - @Override - public long getInactiveTimoutBeforeGC() { - return next.getInactiveTimoutBeforeGC(); - } - - @Override - public ActiveMQDestination getActiveMQDestination() { - return next.getActiveMQDestination(); - } - - @Override - public DeadLetterStrategy getDeadLetterStrategy() { - return next.getDeadLetterStrategy(); - } - - @Override - public DestinationStatistics getDestinationStatistics() { - return next.getDestinationStatistics(); - } - - @Override - public String getName() { - return next.getName(); - } - - @Override - public MemoryUsage getMemoryUsage() { - return next.getMemoryUsage(); - } - - @Override - public void setMemoryUsage(MemoryUsage memoryUsage) { - next.setMemoryUsage(memoryUsage); - } - - @Override - public void removeSubscription(ConnectionContext context, Subscription sub, long lastDeliveredSequenceId) throws Exception { - next.removeSubscription(context, sub, lastDeliveredSequenceId); - } - - @Override - public void send(ProducerBrokerExchange context, Message messageSend) throws Exception { - next.send(context, messageSend); - } - - @Override - public void start() throws Exception { - next.start(); - } - - @Override - public void stop() throws Exception { - next.stop(); - } - - @Override - public List getConsumers() { - return next.getConsumers(); - } - - /** - * Sends a message to the given destination which may be a wildcard - * - * @param context broker context - * @param message message to send - * @param destination possibly wildcard destination to send the message to - * @throws Exception on error - */ - protected void send(ProducerBrokerExchange context, Message message, ActiveMQDestination destination) throws Exception { - Broker broker = context.getConnectionContext().getBroker(); - Set destinations = broker.getDestinations(destination); - - for (Destination dest : destinations) { - dest.send(context, message.copy()); - } - } - - @Override - public MessageStore getMessageStore() { - return next.getMessageStore(); - } - - @Override - public boolean isProducerFlowControl() { - return next.isProducerFlowControl(); - } - - @Override - public void setProducerFlowControl(boolean value) { - next.setProducerFlowControl(value); - } - - @Override - public boolean isAlwaysRetroactive() { - return next.isAlwaysRetroactive(); - } - - @Override - public void setAlwaysRetroactive(boolean value) { - next.setAlwaysRetroactive(value); - } - - @Override - public void setBlockedProducerWarningInterval(long blockedProducerWarningInterval) { - next.setBlockedProducerWarningInterval(blockedProducerWarningInterval); - } - - @Override - public long getBlockedProducerWarningInterval() { - return next.getBlockedProducerWarningInterval(); - } - - @Override - public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception { - next.addProducer(context, info); - } - - @Override - public void removeProducer(ConnectionContext context, ProducerInfo info) throws Exception { - next.removeProducer(context, info); - } - - @Override - public int getMaxAuditDepth() { - return next.getMaxAuditDepth(); - } - - @Override - public int getMaxProducersToAudit() { - return next.getMaxProducersToAudit(); - } - - @Override - public boolean isEnableAudit() { - return next.isEnableAudit(); - } - - @Override - public void setEnableAudit(boolean enableAudit) { - next.setEnableAudit(enableAudit); - } - - @Override - public void setMaxAuditDepth(int maxAuditDepth) { - next.setMaxAuditDepth(maxAuditDepth); - } - - @Override - public void setMaxProducersToAudit(int maxProducersToAudit) { - next.setMaxProducersToAudit(maxProducersToAudit); - } - - @Override - public boolean isActive() { - return next.isActive(); - } - - @Override - public int getMaxPageSize() { - return next.getMaxPageSize(); - } - - @Override - public void setMaxPageSize(int maxPageSize) { - next.setMaxPageSize(maxPageSize); - } - - @Override - public boolean isUseCache() { - return next.isUseCache(); - } - - @Override - public void setUseCache(boolean useCache) { - next.setUseCache(useCache); - } - - @Override - public int getMinimumMessageSize() { - return next.getMinimumMessageSize(); - } - - @Override - public void setMinimumMessageSize(int minimumMessageSize) { - next.setMinimumMessageSize(minimumMessageSize); - } - - @Override - public void wakeup() { - next.wakeup(); - } - - @Override - public boolean isLazyDispatch() { - return next.isLazyDispatch(); - } - - @Override - public void setLazyDispatch(boolean value) { - next.setLazyDispatch(value); - } - - public void messageExpired(ConnectionContext context, PrefetchSubscription prefetchSubscription, MessageReference node) { - next.messageExpired(context, prefetchSubscription, node); - } - - @Override - public boolean iterate() { - return next.iterate(); - } - - @Override - public void fastProducer(ConnectionContext context, ProducerInfo producerInfo) { - next.fastProducer(context, producerInfo); - } - - @Override - public void isFull(ConnectionContext context, Usage usage) { - next.isFull(context, usage); - } - - @Override - public void messageConsumed(ConnectionContext context, MessageReference messageReference) { - next.messageConsumed(context, messageReference); - } - - @Override - public void messageDelivered(ConnectionContext context, MessageReference messageReference) { - next.messageDelivered(context, messageReference); - } - - @Override - public void messageDiscarded(ConnectionContext context, Subscription sub, MessageReference messageReference) { - next.messageDiscarded(context, sub, messageReference); - } - - @Override - public void slowConsumer(ConnectionContext context, Subscription subs) { - next.slowConsumer(context, subs); - } - - @Override - public void messageExpired(ConnectionContext context, Subscription subs, MessageReference node) { - next.messageExpired(context, subs, node); - } - - @Override - public int getMaxBrowsePageSize() { - return next.getMaxBrowsePageSize(); - } - - @Override - public void setMaxBrowsePageSize(int maxPageSize) { - next.setMaxBrowsePageSize(maxPageSize); - } - - @Override - public void processDispatchNotification(MessageDispatchNotification messageDispatchNotification) throws Exception { - next.processDispatchNotification(messageDispatchNotification); - } - - @Override - public int getCursorMemoryHighWaterMark() { - return next.getCursorMemoryHighWaterMark(); - } - - @Override - public void setCursorMemoryHighWaterMark(int cursorMemoryHighWaterMark) { - next.setCursorMemoryHighWaterMark(cursorMemoryHighWaterMark); - } - - @Override - public boolean isPrioritizedMessages() { - return next.isPrioritizedMessages(); - } - - @Override - public SlowConsumerStrategy getSlowConsumerStrategy() { - return next.getSlowConsumerStrategy(); - } - - @Override - public boolean isDoOptimzeMessageStorage() { - return next.isDoOptimzeMessageStorage(); - } - - @Override - public void setDoOptimzeMessageStorage(boolean doOptimzeMessageStorage) { - next.setDoOptimzeMessageStorage(doOptimzeMessageStorage); - } - - @Override - public void clearPendingMessages() { - next.clearPendingMessages(); - } - - @Override - public boolean isDLQ() { - return next.isDLQ(); - } - - public void deleteSubscription(ConnectionContext context, SubscriptionKey key) throws Exception { - if (next instanceof DestinationFilter) { - DestinationFilter filter = (DestinationFilter) next; - filter.deleteSubscription(context, key); - } else if (next instanceof Topic) { - Topic topic = (Topic)next; - topic.deleteSubscription(context, key); - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/DestinationInterceptor.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/DestinationInterceptor.class deleted file mode 100644 index fccc923a0..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/DestinationInterceptor.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/DestinationInterceptor.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/DestinationInterceptor.java deleted file mode 100644 index 8687589e6..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/DestinationInterceptor.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * 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.broker.region; - - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.command.ActiveMQDestination; - -/** - * Represents an interceptor on destination instances. - * - * - */ -public interface DestinationInterceptor { - - Destination intercept(Destination destination); - - void remove(Destination destination); - - void create(Broker broker, ConnectionContext context, ActiveMQDestination destination) throws Exception; - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/DestinationStatistics.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/DestinationStatistics.class deleted file mode 100644 index d0a133dc6..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/DestinationStatistics.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/DestinationStatistics.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/DestinationStatistics.java deleted file mode 100644 index ee2b47874..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/DestinationStatistics.java +++ /dev/null @@ -1,199 +0,0 @@ -/** - * 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.broker.region; - -import org.apache.activemq.management.CountStatisticImpl; -import org.apache.activemq.management.PollCountStatisticImpl; -import org.apache.activemq.management.StatsImpl; -import org.apache.activemq.management.*; - -/** - * The J2EE Statistics for the a Destination. - * - * - */ -public class DestinationStatistics extends StatsImpl { - - protected CountStatisticImpl enqueues; - protected CountStatisticImpl dequeues; - protected CountStatisticImpl consumers; - protected CountStatisticImpl producers; - protected CountStatisticImpl messages; - protected PollCountStatisticImpl messagesCached; - protected CountStatisticImpl dispatched; - protected CountStatisticImpl inflight; - protected CountStatisticImpl expired; - protected TimeStatisticImpl processTime; - protected CountStatisticImpl blockedSends; - protected TimeStatisticImpl blockedTime; - protected SizeStatisticImpl messageSize; - - - public DestinationStatistics() { - - enqueues = new CountStatisticImpl("enqueues", "The number of messages that have been sent to the destination"); - dispatched = new CountStatisticImpl("dispatched", "The number of messages that have been dispatched from the destination"); - dequeues = new CountStatisticImpl("dequeues", "The number of messages that have been acknowledged from the destination"); - inflight = new CountStatisticImpl("inflight", "The number of messages dispatched but awaiting acknowledgement"); - expired = new CountStatisticImpl("expired", "The number of messages that have expired"); - - consumers = new CountStatisticImpl("consumers", "The number of consumers that that are subscribing to messages from the destination"); - consumers.setDoReset(false); - producers = new CountStatisticImpl("producers", "The number of producers that that are publishing messages to the destination"); - producers.setDoReset(false); - messages = new CountStatisticImpl("messages", "The number of messages that that are being held by the destination"); - messages.setDoReset(false); - messagesCached = new PollCountStatisticImpl("messagesCached", "The number of messages that are held in the destination's memory cache"); - processTime = new TimeStatisticImpl("processTime", "information around length of time messages are held by a destination"); - blockedSends = new CountStatisticImpl("blockedSends", "number of messages that have to wait for flow control"); - blockedTime = new TimeStatisticImpl("blockedTime","amount of time messages are blocked for flow control"); - messageSize = new SizeStatisticImpl("messageSize","Size of messages passing through the destination"); - addStatistic("enqueues", enqueues); - addStatistic("dispatched", dispatched); - addStatistic("dequeues", dequeues); - addStatistic("inflight", inflight); - addStatistic("expired", expired); - addStatistic("consumers", consumers); - addStatistic("producers", producers); - addStatistic("messages", messages); - addStatistic("messagesCached", messagesCached); - addStatistic("processTime", processTime); - addStatistic("blockedSends",blockedSends); - addStatistic("blockedTime",blockedTime); - addStatistic("messageSize",messageSize); - } - - public CountStatisticImpl getEnqueues() { - return enqueues; - } - - public CountStatisticImpl getDequeues() { - return dequeues; - } - - public CountStatisticImpl getInflight() { - return inflight; - } - - public CountStatisticImpl getExpired() { - return expired; - } - - public CountStatisticImpl getConsumers() { - return consumers; - } - - public CountStatisticImpl getProducers() { - return producers; - } - - public PollCountStatisticImpl getMessagesCached() { - return messagesCached; - } - - public CountStatisticImpl getMessages() { - return messages; - } - - public void setMessagesCached(PollCountStatisticImpl messagesCached) { - this.messagesCached = messagesCached; - } - - public CountStatisticImpl getDispatched() { - return dispatched; - } - - public TimeStatisticImpl getProcessTime() { - return this.processTime; - } - - public CountStatisticImpl getBlockedSends(){ - return this.blockedSends; - } - public TimeStatisticImpl getBlockedTime(){ - return this.blockedTime; - } - public SizeStatisticImpl getMessageSize(){ - return this.messageSize; - } - - public void reset() { - if (this.isDoReset()) { - super.reset(); - enqueues.reset(); - dequeues.reset(); - dispatched.reset(); - inflight.reset(); - expired.reset(); - blockedSends.reset(); - blockedTime.reset(); - messageSize.reset(); - } - } - - public void setEnabled(boolean enabled) { - super.setEnabled(enabled); - enqueues.setEnabled(enabled); - dispatched.setEnabled(enabled); - dequeues.setEnabled(enabled); - inflight.setEnabled(enabled); - expired.setEnabled(true); - consumers.setEnabled(enabled); - producers.setEnabled(enabled); - messages.setEnabled(enabled); - messagesCached.setEnabled(enabled); - processTime.setEnabled(enabled); - blockedSends.setEnabled(enabled); - blockedTime.setEnabled(enabled); - messageSize.setEnabled(enabled); - - } - - public void setParent(DestinationStatistics parent) { - if (parent != null) { - enqueues.setParent(parent.enqueues); - dispatched.setParent(parent.dispatched); - dequeues.setParent(parent.dequeues); - inflight.setParent(parent.inflight); - expired.setParent(parent.expired); - consumers.setParent(parent.consumers); - producers.setParent(parent.producers); - messagesCached.setParent(parent.messagesCached); - messages.setParent(parent.messages); - processTime.setParent(parent.processTime); - blockedSends.setParent(parent.blockedSends); - blockedTime.setParent(parent.blockedTime); - messageSize.setParent(parent.messageSize); - } else { - enqueues.setParent(null); - dispatched.setParent(null); - dequeues.setParent(null); - inflight.setParent(null); - expired.setParent(null); - consumers.setParent(null); - producers.setParent(null); - messagesCached.setParent(null); - messages.setParent(null); - processTime.setParent(null); - blockedSends.setParent(null); - blockedTime.setParent(null); - messageSize.setParent(null); - } - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/DurableTopicSubscription.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/DurableTopicSubscription.class deleted file mode 100644 index 60cdc3044..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/DurableTopicSubscription.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/DurableTopicSubscription.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/DurableTopicSubscription.java deleted file mode 100644 index 2fc0b05b5..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/DurableTopicSubscription.java +++ /dev/null @@ -1,377 +0,0 @@ -/** - * 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.broker.region; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicLong; - -import javax.jms.InvalidSelectorException; -import javax.jms.JMSException; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.region.cursors.PendingMessageCursor; -import org.apache.activemq.broker.region.cursors.StoreDurableSubscriberCursor; -import org.apache.activemq.broker.region.policy.PolicyEntry; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.command.Message; -import org.apache.activemq.command.MessageAck; -import org.apache.activemq.command.MessageDispatch; -import org.apache.activemq.command.MessageId; -import org.apache.activemq.store.TopicMessageStore; -import org.apache.activemq.usage.SystemUsage; -import org.apache.activemq.usage.Usage; -import org.apache.activemq.usage.UsageListener; -import org.apache.activemq.util.SubscriptionKey; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class DurableTopicSubscription extends PrefetchSubscription implements UsageListener { - - private static final Logger LOG = LoggerFactory.getLogger(DurableTopicSubscription.class); - private final ConcurrentHashMap redeliveredMessages = new ConcurrentHashMap(); - private final ConcurrentHashMap durableDestinations = new ConcurrentHashMap(); - private final SubscriptionKey subscriptionKey; - private final boolean keepDurableSubsActive; - private final AtomicBoolean active = new AtomicBoolean(); - private final AtomicLong offlineTimestamp = new AtomicLong(-1); - - public DurableTopicSubscription(Broker broker, SystemUsage usageManager, ConnectionContext context, ConsumerInfo info, boolean keepDurableSubsActive) - throws JMSException { - super(broker, usageManager, context, info); - this.pending = new StoreDurableSubscriberCursor(broker, context.getClientId(), info.getSubscriptionName(), info.getPrefetchSize(), this); - this.pending.setSystemUsage(usageManager); - this.pending.setMemoryUsageHighWaterMark(getCursorMemoryHighWaterMark()); - this.keepDurableSubsActive = keepDurableSubsActive; - subscriptionKey = new SubscriptionKey(context.getClientId(), info.getSubscriptionName()); - } - - public final boolean isActive() { - return active.get(); - } - - public final long getOfflineTimestamp() { - return offlineTimestamp.get(); - } - - public void setOfflineTimestamp(long timestamp) { - offlineTimestamp.set(timestamp); - } - - @Override - public boolean isFull() { - return !active.get() || super.isFull(); - } - - @Override - public void gc() { - } - - /** - * store will have a pending ack for all durables, irrespective of the - * selector so we need to ack if node is un-matched - */ - @Override - public void unmatched(MessageReference node) throws IOException { - MessageAck ack = new MessageAck(); - ack.setAckType(MessageAck.UNMATCHED_ACK_TYPE); - ack.setMessageID(node.getMessageId()); - Destination regionDestination = (Destination) node.getRegionDestination(); - regionDestination.acknowledge(this.getContext(), this, ack, node); - } - - @Override - protected void setPendingBatchSize(PendingMessageCursor pending, int numberToDispatch) { - // statically configured via maxPageSize - } - - @Override - public void add(ConnectionContext context, Destination destination) throws Exception { - if (!destinations.contains(destination)) { - super.add(context, destination); - } - // do it just once per destination - if (durableDestinations.containsKey(destination.getActiveMQDestination())) { - return; - } - durableDestinations.put(destination.getActiveMQDestination(), destination); - - if (active.get() || keepDurableSubsActive) { - Topic topic = (Topic) destination; - topic.activate(context, this); - if (pending.isEmpty(topic)) { - topic.recoverRetroactiveMessages(context, this); - } - this.enqueueCounter += pending.size(); - } else if (destination.getMessageStore() != null) { - TopicMessageStore store = (TopicMessageStore) destination.getMessageStore(); - try { - this.enqueueCounter += store.getMessageCount(subscriptionKey.getClientId(), subscriptionKey.getSubscriptionName()); - } catch (IOException e) { - JMSException jmsEx = new JMSException("Failed to retrieve enqueueCount from store " + e); - jmsEx.setLinkedException(e); - throw jmsEx; - } - } - dispatchPending(); - } - - public void activate(SystemUsage memoryManager, ConnectionContext context, ConsumerInfo info, RegionBroker regionBroker) throws Exception { - if (!active.get()) { - this.context = context; - this.info = info; - - LOG.debug("Activating {}", this); - if (!keepDurableSubsActive) { - for (Destination destination : durableDestinations.values()) { - Topic topic = (Topic) destination; - add(context, topic); - topic.activate(context, this); - } - - // On Activation we should update the configuration based on our new consumer info. - ActiveMQDestination dest = this.info.getDestination(); - if (dest != null && regionBroker.getDestinationPolicy() != null) { - PolicyEntry entry = regionBroker.getDestinationPolicy().getEntryFor(dest); - if (entry != null) { - entry.configure(broker, usageManager, this); - } - } - } - - synchronized (pendingLock) { - if (!((StoreDurableSubscriberCursor) pending).isStarted() || !keepDurableSubsActive) { - pending.setSystemUsage(memoryManager); - pending.setMemoryUsageHighWaterMark(getCursorMemoryHighWaterMark()); - pending.setMaxAuditDepth(getMaxAuditDepth()); - pending.setMaxProducersToAudit(getMaxProducersToAudit()); - pending.start(); - // If nothing was in the persistent store, then try to use the - // recovery policy. - if (pending.isEmpty()) { - for (Destination destination : durableDestinations.values()) { - Topic topic = (Topic) destination; - topic.recoverRetroactiveMessages(context, this); - } - } - } - } - this.active.set(true); - this.offlineTimestamp.set(-1); - dispatchPending(); - this.usageManager.getMemoryUsage().addUsageListener(this); - } - } - - public void deactivate(boolean keepDurableSubsActive) throws Exception { - LOG.debug("Deactivating keepActive={}, {}", keepDurableSubsActive, this); - active.set(false); - offlineTimestamp.set(System.currentTimeMillis()); - this.usageManager.getMemoryUsage().removeUsageListener(this); - - ArrayList topicsToDeactivate = new ArrayList(); - List savedDispateched = null; - - synchronized (pendingLock) { - if (!keepDurableSubsActive) { - pending.stop(); - } - - synchronized (dispatchLock) { - for (Destination destination : durableDestinations.values()) { - Topic topic = (Topic) destination; - if (!keepDurableSubsActive) { - topicsToDeactivate.add(topic); - } else { - topic.getDestinationStatistics().getInflight().subtract(dispatched.size()); - } - } - - // Before we add these back to pending they need to be in producer order not - // dispatch order so we can add them to the front of the pending list. - Collections.reverse(dispatched); - - for (final MessageReference node : dispatched) { - // Mark the dispatched messages as redelivered for next time. - Integer count = redeliveredMessages.get(node.getMessageId()); - if (count != null) { - redeliveredMessages.put(node.getMessageId(), Integer.valueOf(count.intValue() + 1)); - } else { - redeliveredMessages.put(node.getMessageId(), Integer.valueOf(1)); - } - if (keepDurableSubsActive && pending.isTransient()) { - pending.addMessageFirst(node); - pending.rollback(node.getMessageId()); - } else { - node.decrementReferenceCount(); - } - } - - if (!topicsToDeactivate.isEmpty()) { - savedDispateched = new ArrayList(dispatched); - } - dispatched.clear(); - } - if (!keepDurableSubsActive && pending.isTransient()) { - try { - pending.reset(); - while (pending.hasNext()) { - MessageReference node = pending.next(); - node.decrementReferenceCount(); - pending.remove(); - } - } finally { - pending.release(); - } - } - } - for(Topic topic: topicsToDeactivate) { - topic.deactivate(context, this, savedDispateched); - } - prefetchExtension.set(0); - } - - @Override - protected MessageDispatch createMessageDispatch(MessageReference node, Message message) { - MessageDispatch md = super.createMessageDispatch(node, message); - if (node != QueueMessageReference.NULL_MESSAGE) { - Integer count = redeliveredMessages.get(node.getMessageId()); - if (count != null) { - md.setRedeliveryCounter(count.intValue()); - } - } - return md; - } - - @Override - public void add(MessageReference node) throws Exception { - if (!active.get() && !keepDurableSubsActive) { - return; - } - super.add(node); - } - - @Override - protected void dispatchPending() throws IOException { - if (isActive()) { - super.dispatchPending(); - } - } - - public void removePending(MessageReference node) throws IOException { - pending.remove(node); - } - - @Override - protected void doAddRecoveredMessage(MessageReference message) throws Exception { - synchronized (pending) { - pending.addRecoveredMessage(message); - } - } - - @Override - public int getPendingQueueSize() { - if (active.get() || keepDurableSubsActive) { - return super.getPendingQueueSize(); - } - // TODO: need to get from store - return 0; - } - - @Override - public void setSelector(String selector) throws InvalidSelectorException { - throw new UnsupportedOperationException("You cannot dynamically change the selector for durable topic subscriptions"); - } - - @Override - protected boolean canDispatch(MessageReference node) { - return true; // let them go, our dispatchPending gates the active / inactive state. - } - - @Override - protected void acknowledge(ConnectionContext context, MessageAck ack, MessageReference node) throws IOException { - this.setTimeOfLastMessageAck(System.currentTimeMillis()); - Destination regionDestination = (Destination) node.getRegionDestination(); - regionDestination.acknowledge(context, this, ack, node); - redeliveredMessages.remove(node.getMessageId()); - node.decrementReferenceCount(); - } - - @Override - public synchronized String toString() { - return "DurableTopicSubscription-" + getSubscriptionKey() + ", id=" + info.getConsumerId() + ", active=" + isActive() + ", destinations=" - + durableDestinations.size() + ", total=" + enqueueCounter + ", pending=" + getPendingQueueSize() + ", dispatched=" + dispatchCounter - + ", inflight=" + dispatched.size() + ", prefetchExtension=" + getPrefetchExtension(); - } - - public SubscriptionKey getSubscriptionKey() { - return subscriptionKey; - } - - /** - * Release any references that we are holding. - */ - @Override - public void destroy() { - synchronized (pendingLock) { - try { - pending.reset(); - while (pending.hasNext()) { - MessageReference node = pending.next(); - node.decrementReferenceCount(); - } - - } finally { - pending.release(); - pending.clear(); - } - } - synchronized (dispatchLock) { - for (MessageReference node : dispatched) { - node.decrementReferenceCount(); - } - dispatched.clear(); - } - setSlowConsumer(false); - } - - @Override - public void onUsageChanged(Usage usage, int oldPercentUsage, int newPercentUsage) { - if (oldPercentUsage > newPercentUsage && oldPercentUsage >= 90) { - try { - dispatchPending(); - } catch (IOException e) { - LOG.warn("problem calling dispatchMatched", e); - } - } - } - - @Override - protected boolean isDropped(MessageReference node) { - return false; - } - - public boolean isKeepDurableSubsActive() { - return keepDurableSubsActive; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/IndirectMessageReference.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/IndirectMessageReference.class deleted file mode 100644 index e9370d842..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/IndirectMessageReference.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/IndirectMessageReference.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/IndirectMessageReference.java deleted file mode 100644 index 3e7cab77b..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/IndirectMessageReference.java +++ /dev/null @@ -1,166 +0,0 @@ -/** - * 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.broker.region; - -import org.apache.activemq.command.ConsumerId; -import org.apache.activemq.command.Message; -import org.apache.activemq.command.MessageId; - -/** - * Keeps track of a message that is flowing through the Broker. This object may - * hold a hard reference to the message or only hold the id of the message if - * the message has been persisted on in a MessageStore. - * - * - */ -public class IndirectMessageReference implements QueueMessageReference { - - /** The subscription that has locked the message */ - private LockOwner lockOwner; - /** Has the message been dropped? */ - private boolean dropped; - /** Has the message been acked? */ - private boolean acked; - /** Direct reference to the message */ - private final Message message; - private final MessageId messageId; - - /** - * @param message - */ - public IndirectMessageReference(final Message message) { - this.message = message; - this.messageId = message.getMessageId().copy(); - message.getMessageId(); - message.getGroupID(); - message.getGroupSequence(); - } - - public Message getMessageHardRef() { - return message; - } - - public int getReferenceCount() { - return message.getReferenceCount(); - } - - public int incrementReferenceCount() { - return message.incrementReferenceCount(); - } - - public int decrementReferenceCount() { - return message.decrementReferenceCount(); - } - - public Message getMessage() { - return message; - } - - public String toString() { - return "Message " + message.getMessageId() + " dropped=" + dropped + " acked=" + acked + " locked=" + (lockOwner != null); - } - - public void incrementRedeliveryCounter() { - message.incrementRedeliveryCounter(); - } - - public synchronized boolean isDropped() { - return dropped; - } - - public synchronized void drop() { - dropped = true; - lockOwner = null; - message.decrementReferenceCount(); - } - - public boolean lock(LockOwner subscription) { - synchronized (this) { - if (dropped || lockOwner != null) { - return false; - } - lockOwner = subscription; - return true; - } - } - - public synchronized boolean unlock() { - boolean result = lockOwner != null; - lockOwner = null; - return result; - } - - public synchronized LockOwner getLockOwner() { - return lockOwner; - } - - public int getRedeliveryCounter() { - return message.getRedeliveryCounter(); - } - - public MessageId getMessageId() { - return messageId; - } - - public Message.MessageDestination getRegionDestination() { - return message.getRegionDestination(); - } - - public boolean isPersistent() { - return message.isPersistent(); - } - - public synchronized boolean isLocked() { - return lockOwner != null; - } - - public synchronized boolean isAcked() { - return acked; - } - - public synchronized void setAcked(boolean b) { - acked = b; - } - - public String getGroupID() { - return message.getGroupID(); - } - - public int getGroupSequence() { - return message.getGroupSequence(); - } - - public ConsumerId getTargetConsumerId() { - return message.getTargetConsumerId(); - } - - public long getExpiration() { - return message.getExpiration(); - } - - public boolean isExpired() { - return message.isExpired(); - } - - public synchronized int getSize() { - return message.getSize(); - } - - public boolean isAdvisory() { - return message.isAdvisory(); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/LockOwner$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/LockOwner$1.class deleted file mode 100644 index 13776ef2f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/LockOwner$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/LockOwner.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/LockOwner.class deleted file mode 100644 index 944531c97..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/LockOwner.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/LockOwner.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/LockOwner.java deleted file mode 100644 index 86982a0ff..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/LockOwner.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * 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.broker.region; - -public interface LockOwner { - - LockOwner HIGH_PRIORITY_LOCK_OWNER = new LockOwner() { - public int getLockPriority() { - return Integer.MAX_VALUE; - } - public boolean isLockExclusive() { - return false; - } - }; - - int getLockPriority(); - boolean isLockExclusive(); - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/MessageReference.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/MessageReference.class deleted file mode 100644 index 27f3d944b..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/MessageReference.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/MessageReference.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/MessageReference.java deleted file mode 100644 index 64c91fa0a..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/MessageReference.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * 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.broker.region; - -import org.apache.activemq.command.ConsumerId; -import org.apache.activemq.command.Message; -import org.apache.activemq.command.MessageId; - -/** - * Keeps track of a message that is flowing through the Broker. This - * object may hold a hard reference to the message or only hold the - * id of the message if the message has been persisted on in a MessageStore. - * - * - */ -public interface MessageReference { - - MessageId getMessageId(); - Message getMessageHardRef(); - Message getMessage(); - boolean isPersistent(); - - Message.MessageDestination getRegionDestination(); - - int getRedeliveryCounter(); - void incrementRedeliveryCounter(); - - int getReferenceCount(); - - int incrementReferenceCount(); - int decrementReferenceCount(); - ConsumerId getTargetConsumerId(); - int getSize(); - long getExpiration(); - String getGroupID(); - int getGroupSequence(); - - /** - * Returns true if this message is expired - */ - boolean isExpired(); - - /** - * Returns true if this message is dropped. - */ - boolean isDropped(); - - /** - * @return true if the message is an advisory - */ - boolean isAdvisory(); - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/MessageReferenceFilter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/MessageReferenceFilter.class deleted file mode 100644 index 46bb9bc5e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/MessageReferenceFilter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/MessageReferenceFilter.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/MessageReferenceFilter.java deleted file mode 100644 index e64a503d1..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/MessageReferenceFilter.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * 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.broker.region; - -import javax.jms.JMSException; - -import org.apache.activemq.broker.ConnectionContext; - -/** - * Represents a filter on message references - * - * - */ -public interface MessageReferenceFilter { - - boolean evaluate(ConnectionContext context, MessageReference messageReference) throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/NullMessageReference.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/NullMessageReference.class deleted file mode 100644 index ea8f950b8..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/NullMessageReference.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/NullMessageReference.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/NullMessageReference.java deleted file mode 100644 index 510f5aa60..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/NullMessageReference.java +++ /dev/null @@ -1,128 +0,0 @@ -/** - * 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.broker.region; - -import org.apache.activemq.command.ActiveMQMessage; -import org.apache.activemq.command.ConsumerId; -import org.apache.activemq.command.Message; -import org.apache.activemq.command.MessageId; - -/** - * Only used by the {@link QueueMessageReference#NULL_MESSAGE} - */ -final class NullMessageReference implements QueueMessageReference { - - private final ActiveMQMessage message = new ActiveMQMessage(); - private volatile int references; - - public void drop() { - throw new RuntimeException("not implemented"); - } - - public LockOwner getLockOwner() { - throw new RuntimeException("not implemented"); - } - - public boolean isAcked() { - return false; - } - - public boolean isDropped() { - return false; - } - - public boolean lock(LockOwner subscription) { - return true; - } - - public void setAcked(boolean b) { - throw new RuntimeException("not implemented"); - } - - public boolean unlock() { - return true; - } - - public int decrementReferenceCount() { - return --references; - } - - public long getExpiration() { - throw new RuntimeException("not implemented"); - } - - public String getGroupID() { - return null; - } - - public int getGroupSequence() { - return 0; - } - - public Message getMessage() { - return message; - } - - public Message getMessageHardRef() { - throw new RuntimeException("not implemented"); - } - - public MessageId getMessageId() { - return message.getMessageId(); - } - - public int getRedeliveryCounter() { - throw new RuntimeException("not implemented"); - } - - public int getReferenceCount() { - return references; - } - - public Destination getRegionDestination() { - return null; - } - - public int getSize() { - throw new RuntimeException("not implemented"); - } - - public ConsumerId getTargetConsumerId() { - throw new RuntimeException("not implemented"); - } - - public void incrementRedeliveryCounter() { - throw new RuntimeException("not implemented"); - } - - public int incrementReferenceCount() { - return ++references; - } - - public boolean isExpired() { - return false; - } - - public boolean isPersistent() { - throw new RuntimeException("not implemented"); - } - - public boolean isAdvisory() { - return false; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/PrefetchSubscription$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/PrefetchSubscription$1.class deleted file mode 100644 index 478a6eaa5..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/PrefetchSubscription$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/PrefetchSubscription$2.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/PrefetchSubscription$2.class deleted file mode 100644 index 62653d1ae..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/PrefetchSubscription$2.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/PrefetchSubscription$3.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/PrefetchSubscription$3.class deleted file mode 100644 index b016d4baa..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/PrefetchSubscription$3.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/PrefetchSubscription.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/PrefetchSubscription.class deleted file mode 100644 index 63d177e8f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/PrefetchSubscription.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/PrefetchSubscription.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/PrefetchSubscription.java deleted file mode 100644 index 81f90fb53..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/PrefetchSubscription.java +++ /dev/null @@ -1,862 +0,0 @@ -/** - * 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.broker.region; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicInteger; - -import javax.jms.JMSException; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.region.cursors.PendingMessageCursor; -import org.apache.activemq.broker.region.cursors.VMPendingMessageCursor; -import org.apache.activemq.command.ConsumerControl; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.command.Message; -import org.apache.activemq.command.MessageAck; -import org.apache.activemq.command.MessageDispatch; -import org.apache.activemq.command.MessageDispatchNotification; -import org.apache.activemq.command.MessageId; -import org.apache.activemq.command.MessagePull; -import org.apache.activemq.command.Response; -import org.apache.activemq.thread.Scheduler; -import org.apache.activemq.transaction.Synchronization; -import org.apache.activemq.transport.TransmitCallback; -import org.apache.activemq.usage.SystemUsage; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * A subscription that honors the pre-fetch option of the ConsumerInfo. - */ -public abstract class PrefetchSubscription extends AbstractSubscription { - - private static final Logger LOG = LoggerFactory.getLogger(PrefetchSubscription.class); - protected final Scheduler scheduler; - - protected PendingMessageCursor pending; - protected final List dispatched = new ArrayList(); - protected final AtomicInteger prefetchExtension = new AtomicInteger(); - protected boolean usePrefetchExtension = true; - protected long enqueueCounter; - protected long dispatchCounter; - protected long dequeueCounter; - private int maxProducersToAudit=32; - private int maxAuditDepth=2048; - protected final SystemUsage usageManager; - protected final Object pendingLock = new Object(); - protected final Object dispatchLock = new Object(); - private final CountDownLatch okForAckAsDispatchDone = new CountDownLatch(1); - - public PrefetchSubscription(Broker broker, SystemUsage usageManager, ConnectionContext context, ConsumerInfo info, PendingMessageCursor cursor) throws JMSException { - super(broker,context, info); - this.usageManager=usageManager; - pending = cursor; - try { - pending.start(); - } catch (Exception e) { - throw new JMSException(e.getMessage()); - } - this.scheduler = broker.getScheduler(); - } - - public PrefetchSubscription(Broker broker,SystemUsage usageManager, ConnectionContext context, ConsumerInfo info) throws JMSException { - this(broker,usageManager,context, info, new VMPendingMessageCursor(false)); - } - - /** - * Allows a message to be pulled on demand by a client - */ - @Override - public Response pullMessage(ConnectionContext context, MessagePull pull) throws Exception { - // The slave should not deliver pull messages. - // TODO: when the slave becomes a master, He should send a NULL message to all the - // consumers to 'wake them up' in case they were waiting for a message. - if (getPrefetchSize() == 0) { - - prefetchExtension.incrementAndGet(); - final long dispatchCounterBeforePull = dispatchCounter; - - // Have the destination push us some messages. - for (Destination dest : destinations) { - dest.iterate(); - } - dispatchPending(); - - synchronized(this) { - // If there was nothing dispatched.. we may need to setup a timeout. - if (dispatchCounterBeforePull == dispatchCounter) { - // immediate timeout used by receiveNoWait() - if (pull.getTimeout() == -1) { - // Send a NULL message. - add(QueueMessageReference.NULL_MESSAGE); - dispatchPending(); - } - if (pull.getTimeout() > 0) { - scheduler.executeAfterDelay(new Runnable() { - @Override - public void run() { - pullTimeout(dispatchCounterBeforePull); - } - }, pull.getTimeout()); - } - } - } - } - return null; - } - - /** - * Occurs when a pull times out. If nothing has been dispatched since the - * timeout was setup, then send the NULL message. - */ - final void pullTimeout(long dispatchCounterBeforePull) { - synchronized (pendingLock) { - if (dispatchCounterBeforePull == dispatchCounter) { - try { - add(QueueMessageReference.NULL_MESSAGE); - dispatchPending(); - } catch (Exception e) { - context.getConnection().serviceException(e); - } - } - } - } - - @Override - public void add(MessageReference node) throws Exception { - synchronized (pendingLock) { - // The destination may have just been removed... - if( !destinations.contains(node.getRegionDestination()) && node!=QueueMessageReference.NULL_MESSAGE) { - // perhaps we should inform the caller that we are no longer valid to dispatch to? - return; - } - - // Don't increment for the pullTimeout control message. - if (!node.equals(QueueMessageReference.NULL_MESSAGE)) { - enqueueCounter++; - } - pending.addMessageLast(node); - } - dispatchPending(); - } - - @Override - public void processMessageDispatchNotification(MessageDispatchNotification mdn) throws Exception { - synchronized(pendingLock) { - try { - pending.reset(); - while (pending.hasNext()) { - MessageReference node = pending.next(); - node.decrementReferenceCount(); - if (node.getMessageId().equals(mdn.getMessageId())) { - // Synchronize between dispatched list and removal of messages from pending list - // related to remove subscription action - synchronized(dispatchLock) { - pending.remove(); - createMessageDispatch(node, node.getMessage()); - dispatched.add(node); - onDispatch(node, node.getMessage()); - } - return; - } - } - } finally { - pending.release(); - } - } - throw new JMSException( - "Slave broker out of sync with master: Dispatched message (" - + mdn.getMessageId() + ") was not in the pending list for " - + mdn.getConsumerId() + " on " + mdn.getDestination().getPhysicalName()); - } - - @Override - public final void acknowledge(final ConnectionContext context,final MessageAck ack) throws Exception { - // Handle the standard acknowledgment case. - boolean callDispatchMatched = false; - Destination destination = null; - - if (!okForAckAsDispatchDone.await(0l, TimeUnit.MILLISECONDS)) { - // suppress unexpected ack exception in this expected case - LOG.warn("Ignoring ack received before dispatch; result of failover with an outstanding ack. Acked messages will be replayed if present on this broker. Ignored ack: {}", ack); - return; - } - - LOG.trace("ack: {}", ack); - - synchronized(dispatchLock) { - if (ack.isStandardAck()) { - // First check if the ack matches the dispatched. When using failover this might - // not be the case. We don't ever want to ack the wrong messages. - assertAckMatchesDispatched(ack); - - // Acknowledge all dispatched messages up till the message id of - // the acknowledgment. - int index = 0; - boolean inAckRange = false; - List removeList = new ArrayList(); - for (final MessageReference node : dispatched) { - MessageId messageId = node.getMessageId(); - if (ack.getFirstMessageId() == null - || ack.getFirstMessageId().equals(messageId)) { - inAckRange = true; - } - if (inAckRange) { - // Don't remove the nodes until we are committed. - if (!context.isInTransaction()) { - dequeueCounter++; - ((Destination)node.getRegionDestination()).getDestinationStatistics().getInflight().decrement(); - removeList.add(node); - } else { - registerRemoveSync(context, node); - } - index++; - acknowledge(context, ack, node); - if (ack.getLastMessageId().equals(messageId)) { - // contract prefetch if dispatch required a pull - if (getPrefetchSize() == 0) { - // Protect extension update against parallel updates. - while (true) { - int currentExtension = prefetchExtension.get(); - int newExtension = Math.max(0, currentExtension - index); - if (prefetchExtension.compareAndSet(currentExtension, newExtension)) { - break; - } - } - } else if (usePrefetchExtension && context.isInTransaction()) { - // extend prefetch window only if not a pulling consumer - while (true) { - int currentExtension = prefetchExtension.get(); - int newExtension = Math.max(currentExtension, index); - if (prefetchExtension.compareAndSet(currentExtension, newExtension)) { - break; - } - } - } - destination = (Destination) node.getRegionDestination(); - callDispatchMatched = true; - break; - } - } - } - for (final MessageReference node : removeList) { - dispatched.remove(node); - } - // this only happens after a reconnect - get an ack which is not - // valid - if (!callDispatchMatched) { - LOG.warn("Could not correlate acknowledgment with dispatched message: {}", ack); - } - } else if (ack.isIndividualAck()) { - // Message was delivered and acknowledge - but only delete the - // individual message - for (final MessageReference node : dispatched) { - MessageId messageId = node.getMessageId(); - if (ack.getLastMessageId().equals(messageId)) { - // Don't remove the nodes until we are committed - immediateAck option - if (!context.isInTransaction()) { - dequeueCounter++; - ((Destination)node.getRegionDestination()).getDestinationStatistics().getInflight().decrement(); - dispatched.remove(node); - } else { - registerRemoveSync(context, node); - } - - // Protect extension update against parallel updates. - while (true) { - int currentExtension = prefetchExtension.get(); - int newExtension = Math.max(0, currentExtension - 1); - if (prefetchExtension.compareAndSet(currentExtension, newExtension)) { - break; - } - } - acknowledge(context, ack, node); - destination = (Destination) node.getRegionDestination(); - callDispatchMatched = true; - break; - } - } - }else if (ack.isDeliveredAck()) { - // Message was delivered but not acknowledged: update pre-fetch - // counters. - int index = 0; - for (Iterator iter = dispatched.iterator(); iter.hasNext(); index++) { - final MessageReference node = iter.next(); - Destination nodeDest = (Destination) node.getRegionDestination(); - if (node.isExpired()) { - if (broker.isExpired(node)) { - Destination regionDestination = nodeDest; - regionDestination.messageExpired(context, this, node); - } - iter.remove(); - nodeDest.getDestinationStatistics().getInflight().decrement(); - } - if (ack.getLastMessageId().equals(node.getMessageId())) { - if (usePrefetchExtension) { - while (true) { - int currentExtension = prefetchExtension.get(); - int newExtension = Math.max(currentExtension, index + 1); - if (prefetchExtension.compareAndSet(currentExtension, newExtension)) { - break; - } - } - } - destination = nodeDest; - callDispatchMatched = true; - break; - } - } - if (!callDispatchMatched) { - throw new JMSException( - "Could not correlate acknowledgment with dispatched message: " - + ack); - } - } else if (ack.isRedeliveredAck()) { - // Message was re-delivered but it was not yet considered to be - // a DLQ message. - boolean inAckRange = false; - for (final MessageReference node : dispatched) { - MessageId messageId = node.getMessageId(); - if (ack.getFirstMessageId() == null - || ack.getFirstMessageId().equals(messageId)) { - inAckRange = true; - } - if (inAckRange) { - if (ack.getLastMessageId().equals(messageId)) { - destination = (Destination) node.getRegionDestination(); - callDispatchMatched = true; - break; - } - } - } - if (!callDispatchMatched) { - throw new JMSException( - "Could not correlate acknowledgment with dispatched message: " - + ack); - } - } else if (ack.isPoisonAck()) { - // TODO: what if the message is already in a DLQ??? - // Handle the poison ACK case: we need to send the message to a - // DLQ - if (ack.isInTransaction()) { - throw new JMSException("Poison ack cannot be transacted: " - + ack); - } - int index = 0; - boolean inAckRange = false; - List removeList = new ArrayList(); - for (final MessageReference node : dispatched) { - MessageId messageId = node.getMessageId(); - if (ack.getFirstMessageId() == null - || ack.getFirstMessageId().equals(messageId)) { - inAckRange = true; - } - if (inAckRange) { - sendToDLQ(context, node, ack.getPoisonCause()); - Destination nodeDest = (Destination) node.getRegionDestination(); - nodeDest.getDestinationStatistics() - .getInflight().decrement(); - removeList.add(node); - dequeueCounter++; - index++; - acknowledge(context, ack, node); - if (ack.getLastMessageId().equals(messageId)) { - while (true) { - int currentExtension = prefetchExtension.get(); - int newExtension = Math.max(0, currentExtension - (index + 1)); - if (prefetchExtension.compareAndSet(currentExtension, newExtension)) { - break; - } - } - destination = nodeDest; - callDispatchMatched = true; - break; - } - } - } - for (final MessageReference node : removeList) { - dispatched.remove(node); - } - if (!callDispatchMatched) { - throw new JMSException( - "Could not correlate acknowledgment with dispatched message: " - + ack); - } - } - } - if (callDispatchMatched && destination != null) { - destination.wakeup(); - dispatchPending(); - - if (pending.isEmpty()) { - for (Destination dest : destinations) { - dest.wakeup(); - } - } - } else { - LOG.debug("Acknowledgment out of sync (Normally occurs when failover connection reconnects): {}", ack); - } - } - - private void registerRemoveSync(ConnectionContext context, final MessageReference node) { - // setup a Synchronization to remove nodes from the - // dispatched list. - context.getTransaction().addSynchronization( - new Synchronization() { - - @Override - public void afterCommit() - throws Exception { - Destination nodeDest = (Destination) node.getRegionDestination(); - synchronized(dispatchLock) { - dequeueCounter++; - dispatched.remove(node); - nodeDest.getDestinationStatistics().getInflight().decrement(); - } - nodeDest.wakeup(); - dispatchPending(); - } - - @Override - public void afterRollback() throws Exception { - synchronized(dispatchLock) { - // poisionAck will decrement - otherwise still inflight on client - } - } - }); - } - - /** - * Checks an ack versus the contents of the dispatched list. - * called with dispatchLock held - * @param ack - * @throws JMSException if it does not match - */ - protected void assertAckMatchesDispatched(MessageAck ack) throws JMSException { - MessageId firstAckedMsg = ack.getFirstMessageId(); - MessageId lastAckedMsg = ack.getLastMessageId(); - int checkCount = 0; - boolean checkFoundStart = false; - boolean checkFoundEnd = false; - for (MessageReference node : dispatched) { - - if (firstAckedMsg == null) { - checkFoundStart = true; - } else if (!checkFoundStart && firstAckedMsg.equals(node.getMessageId())) { - checkFoundStart = true; - } - - if (checkFoundStart) { - checkCount++; - } - - if (lastAckedMsg != null && lastAckedMsg.equals(node.getMessageId())) { - checkFoundEnd = true; - break; - } - } - if (!checkFoundStart && firstAckedMsg != null) - throw new JMSException("Unmatched acknowledge: " + ack - + "; Could not find Message-ID " + firstAckedMsg - + " in dispatched-list (start of ack)"); - if (!checkFoundEnd && lastAckedMsg != null) - throw new JMSException("Unmatched acknowledge: " + ack - + "; Could not find Message-ID " + lastAckedMsg - + " in dispatched-list (end of ack)"); - if (ack.getMessageCount() != checkCount && !ack.isInTransaction()) { - throw new JMSException("Unmatched acknowledge: " + ack - + "; Expected message count (" + ack.getMessageCount() - + ") differs from count in dispatched-list (" + checkCount - + ")"); - } - } - - /** - * - * @param context - * @param node - * @param poisonCause - * @throws IOException - * @throws Exception - */ - protected void sendToDLQ(final ConnectionContext context, final MessageReference node, Throwable poisonCause) throws IOException, Exception { - broker.getRoot().sendToDeadLetterQueue(context, node, this, poisonCause); - } - - @Override - public int getInFlightSize() { - return dispatched.size(); - } - - /** - * Used to determine if the broker can dispatch to the consumer. - * - * @return - */ - @Override - public boolean isFull() { - return dispatched.size() - prefetchExtension.get() >= info.getPrefetchSize(); - } - - /** - * @return true when 60% or more room is left for dispatching messages - */ - @Override - public boolean isLowWaterMark() { - return (dispatched.size() - prefetchExtension.get()) <= (info.getPrefetchSize() * .4); - } - - /** - * @return true when 10% or less room is left for dispatching messages - */ - @Override - public boolean isHighWaterMark() { - return (dispatched.size() - prefetchExtension.get()) >= (info.getPrefetchSize() * .9); - } - - @Override - public int countBeforeFull() { - return info.getPrefetchSize() + prefetchExtension.get() - dispatched.size(); - } - - @Override - public int getPendingQueueSize() { - return pending.size(); - } - - @Override - public int getDispatchedQueueSize() { - return dispatched.size(); - } - - @Override - public long getDequeueCounter() { - return dequeueCounter; - } - - @Override - public long getDispatchedCounter() { - return dispatchCounter; - } - - @Override - public long getEnqueueCounter() { - return enqueueCounter; - } - - @Override - public boolean isRecoveryRequired() { - return pending.isRecoveryRequired(); - } - - public PendingMessageCursor getPending() { - return this.pending; - } - - public void setPending(PendingMessageCursor pending) { - this.pending = pending; - if (this.pending!=null) { - this.pending.setSystemUsage(usageManager); - this.pending.setMemoryUsageHighWaterMark(getCursorMemoryHighWaterMark()); - } - } - - @Override - public void add(ConnectionContext context, Destination destination) throws Exception { - synchronized(pendingLock) { - super.add(context, destination); - pending.add(context, destination); - } - } - - @Override - public List remove(ConnectionContext context, Destination destination) throws Exception { - return remove(context, destination, dispatched); - } - - public List remove(ConnectionContext context, Destination destination, List dispatched) throws Exception { - List rc = new ArrayList(); - synchronized(pendingLock) { - super.remove(context, destination); - // Here is a potential problem concerning Inflight stat: - // Messages not already committed or rolled back may not be removed from dispatched list at the moment - // Except if each commit or rollback callback action comes before remove of subscriber. - rc.addAll(pending.remove(context, destination)); - - if (dispatched == null) { - return rc; - } - - // Synchronized to DispatchLock if necessary - if (dispatched == this.dispatched) { - synchronized(dispatchLock) { - updateDestinationStats(rc, destination, dispatched); - } - } else { - updateDestinationStats(rc, destination, dispatched); - } - } - return rc; - } - - private void updateDestinationStats(List rc, Destination destination, List dispatched) { - ArrayList references = new ArrayList(); - for (MessageReference r : dispatched) { - if (r.getRegionDestination() == destination) { - references.add(r); - } - } - rc.addAll(references); - destination.getDestinationStatistics().getDispatched().subtract(references.size()); - destination.getDestinationStatistics().getInflight().subtract(references.size()); - dispatched.removeAll(references); - } - - protected void dispatchPending() throws IOException { - synchronized(pendingLock) { - try { - int numberToDispatch = countBeforeFull(); - if (numberToDispatch > 0) { - setSlowConsumer(false); - setPendingBatchSize(pending, numberToDispatch); - int count = 0; - pending.reset(); - while (pending.hasNext() && !isFull() && count < numberToDispatch) { - MessageReference node = pending.next(); - if (node == null) { - break; - } - - // Synchronize between dispatched list and remove of message from pending list - // related to remove subscription action - synchronized(dispatchLock) { - pending.remove(); - node.decrementReferenceCount(); - if( !isDropped(node) && canDispatch(node)) { - - // Message may have been sitting in the pending - // list a while waiting for the consumer to ak the message. - if (node!=QueueMessageReference.NULL_MESSAGE && node.isExpired()) { - //increment number to dispatch - numberToDispatch++; - if (broker.isExpired(node)) { - ((Destination)node.getRegionDestination()).messageExpired(context, this, node); - } - continue; - } - dispatch(node); - count++; - } - } - } - } else if (!isSlowConsumer()) { - setSlowConsumer(true); - for (Destination dest :destinations) { - dest.slowConsumer(context, this); - } - } - } finally { - pending.release(); - } - } - } - - protected void setPendingBatchSize(PendingMessageCursor pending, int numberToDispatch) { - pending.setMaxBatchSize(numberToDispatch); - } - - // called with dispatchLock held - protected boolean dispatch(final MessageReference node) throws IOException { - final Message message = node.getMessage(); - if (message == null) { - return false; - } - - okForAckAsDispatchDone.countDown(); - - // No reentrant lock - Patch needed to IndirectMessageReference on method lock - MessageDispatch md = createMessageDispatch(node, message); - // NULL messages don't count... they don't get Acked. - if (node != QueueMessageReference.NULL_MESSAGE) { - dispatchCounter++; - dispatched.add(node); - } else { - while (true) { - int currentExtension = prefetchExtension.get(); - int newExtension = Math.max(0, currentExtension - 1); - if (prefetchExtension.compareAndSet(currentExtension, newExtension)) { - break; - } - } - } - if (info.isDispatchAsync()) { - md.setTransmitCallback(new TransmitCallback() { - - @Override - public void onSuccess() { - // Since the message gets queued up in async dispatch, we don't want to - // decrease the reference count until it gets put on the wire. - onDispatch(node, message); - } - - @Override - public void onFailure() { - Destination nodeDest = (Destination) node.getRegionDestination(); - if (nodeDest != null) { - if (node != QueueMessageReference.NULL_MESSAGE) { - nodeDest.getDestinationStatistics().getDispatched().increment(); - nodeDest.getDestinationStatistics().getInflight().increment(); - LOG.trace("{} failed to dispatch: {} - {}, dispatched: {}, inflight: {}", new Object[]{ info.getConsumerId(), message.getMessageId(), message.getDestination(), dispatchCounter, dispatched.size() }); - } - } - } - }); - context.getConnection().dispatchAsync(md); - } else { - context.getConnection().dispatchSync(md); - onDispatch(node, message); - } - return true; - } - - protected void onDispatch(final MessageReference node, final Message message) { - Destination nodeDest = (Destination) node.getRegionDestination(); - if (nodeDest != null) { - if (node != QueueMessageReference.NULL_MESSAGE) { - nodeDest.getDestinationStatistics().getDispatched().increment(); - nodeDest.getDestinationStatistics().getInflight().increment(); - LOG.trace("{} dispatched: {} - {}, dispatched: {}, inflight: {}", new Object[]{ info.getConsumerId(), message.getMessageId(), message.getDestination(), dispatchCounter, dispatched.size() }); - } - } - - if (info.isDispatchAsync()) { - try { - dispatchPending(); - } catch (IOException e) { - context.getConnection().serviceExceptionAsync(e); - } - } - } - - /** - * inform the MessageConsumer on the client to change it's prefetch - * - * @param newPrefetch - */ - @Override - public void updateConsumerPrefetch(int newPrefetch) { - if (context != null && context.getConnection() != null && context.getConnection().isManageable()) { - ConsumerControl cc = new ConsumerControl(); - cc.setConsumerId(info.getConsumerId()); - cc.setPrefetch(newPrefetch); - context.getConnection().dispatchAsync(cc); - } - } - - /** - * @param node - * @param message - * @return MessageDispatch - */ - protected MessageDispatch createMessageDispatch(MessageReference node, Message message) { - MessageDispatch md = new MessageDispatch(); - md.setConsumerId(info.getConsumerId()); - - if (node == QueueMessageReference.NULL_MESSAGE) { - md.setMessage(null); - md.setDestination(null); - } else { - Destination regionDestination = (Destination) node.getRegionDestination(); - md.setDestination(regionDestination.getActiveMQDestination()); - md.setMessage(message); - md.setRedeliveryCounter(node.getRedeliveryCounter()); - } - - return md; - } - - /** - * Use when a matched message is about to be dispatched to the client. - * - * @param node - * @return false if the message should not be dispatched to the client - * (another sub may have already dispatched it for example). - * @throws IOException - */ - protected abstract boolean canDispatch(MessageReference node) throws IOException; - - protected abstract boolean isDropped(MessageReference node); - - /** - * Used during acknowledgment to remove the message. - * - * @throws IOException - */ - protected abstract void acknowledge(ConnectionContext context, final MessageAck ack, final MessageReference node) throws IOException; - - - public int getMaxProducersToAudit() { - return maxProducersToAudit; - } - - public void setMaxProducersToAudit(int maxProducersToAudit) { - this.maxProducersToAudit = maxProducersToAudit; - if (this.pending != null) { - this.pending.setMaxProducersToAudit(maxProducersToAudit); - } - } - - public int getMaxAuditDepth() { - return maxAuditDepth; - } - - public void setMaxAuditDepth(int maxAuditDepth) { - this.maxAuditDepth = maxAuditDepth; - if (this.pending != null) { - this.pending.setMaxAuditDepth(maxAuditDepth); - } - } - - public boolean isUsePrefetchExtension() { - return usePrefetchExtension; - } - - public void setUsePrefetchExtension(boolean usePrefetchExtension) { - this.usePrefetchExtension = usePrefetchExtension; - } - - protected int getPrefetchExtension() { - return this.prefetchExtension.get(); - } - - @Override - public void setPrefetchSize(int prefetchSize) { - this.info.setPrefetchSize(prefetchSize); - try { - this.dispatchPending(); - } catch (Exception e) { - LOG.trace("Caught exception during dispatch after prefetch change.", e); - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$1.class deleted file mode 100644 index 9ffc29fad..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$2.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$2.class deleted file mode 100644 index 103ae4a6b..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$2.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$3.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$3.class deleted file mode 100644 index 0be3aa2cb..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$3.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$4.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$4.class deleted file mode 100644 index d8af0e808..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$4.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$5.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$5.class deleted file mode 100644 index dd30def57..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$5.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$6.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$6.class deleted file mode 100644 index cd68e284c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$6.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$7.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$7.class deleted file mode 100644 index 18c3970cb..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$7.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$8.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$8.class deleted file mode 100644 index e389a62a3..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$8.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$BatchMessageRecoveryListener.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$BatchMessageRecoveryListener.class deleted file mode 100644 index ee6910726..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$BatchMessageRecoveryListener.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$BrowserDispatch.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$BrowserDispatch.class deleted file mode 100644 index 8e88d456f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$BrowserDispatch.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$FlowControlTimeoutTask.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$FlowControlTimeoutTask.class deleted file mode 100644 index 8e99c5a1c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$FlowControlTimeoutTask.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$QueueThread.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$QueueThread.class deleted file mode 100644 index 9a884fc9e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$QueueThread.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$SendSync$MessageContext.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$SendSync$MessageContext.class deleted file mode 100644 index ad47178fa..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$SendSync$MessageContext.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$SendSync.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$SendSync.class deleted file mode 100644 index 5c8528879..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$SendSync.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$TimeoutMessage.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$TimeoutMessage.class deleted file mode 100644 index 2f9ed94c7..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue$TimeoutMessage.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue.class deleted file mode 100644 index 910748f61..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue.java deleted file mode 100644 index 7713d7194..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Queue.java +++ /dev/null @@ -1,2271 +0,0 @@ -/** - * 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.broker.region; - -import java.io.IOException; -import java.util.*; -import java.util.concurrent.CancellationException; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentLinkedQueue; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.DelayQueue; -import java.util.concurrent.Delayed; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicLong; -import java.util.concurrent.locks.Lock; -import java.util.concurrent.locks.ReentrantLock; -import java.util.concurrent.locks.ReentrantReadWriteLock; - -import javax.jms.InvalidSelectorException; -import javax.jms.JMSException; -import javax.jms.ResourceAllocationException; -import org.apache.activemq.broker.BrokerService; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.ProducerBrokerExchange; -import org.apache.activemq.broker.region.cursors.OrderedPendingList; -import org.apache.activemq.broker.region.cursors.PendingList; -import org.apache.activemq.broker.region.cursors.PendingMessageCursor; -import org.apache.activemq.broker.region.cursors.PrioritizedPendingList; -import org.apache.activemq.broker.region.cursors.StoreQueueCursor; -import org.apache.activemq.broker.region.cursors.VMPendingMessageCursor; -import org.apache.activemq.broker.region.group.CachedMessageGroupMapFactory; -import org.apache.activemq.broker.region.group.MessageGroupMap; -import org.apache.activemq.broker.region.group.MessageGroupMapFactory; -import org.apache.activemq.broker.region.policy.DeadLetterStrategy; -import org.apache.activemq.broker.region.policy.DispatchPolicy; -import org.apache.activemq.broker.region.policy.RoundRobinDispatchPolicy; -import org.apache.activemq.broker.util.InsertionCountList; -import org.apache.activemq.command.*; -import org.apache.activemq.filter.BooleanExpression; -import org.apache.activemq.filter.MessageEvaluationContext; -import org.apache.activemq.filter.NonCachedMessageEvaluationContext; -import org.apache.activemq.selector.SelectorParser; -import org.apache.activemq.state.ProducerState; -import org.apache.activemq.store.MessageRecoveryListener; -import org.apache.activemq.store.MessageStore; -import org.apache.activemq.thread.Task; -import org.apache.activemq.thread.TaskRunner; -import org.apache.activemq.thread.TaskRunnerFactory; -import org.apache.activemq.transaction.Synchronization; -import org.apache.activemq.transaction.Transaction; -import org.apache.activemq.usage.Usage; -import org.apache.activemq.usage.UsageListener; -import org.apache.activemq.util.BrokerSupport; -import org.apache.activemq.util.ThreadPoolUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.slf4j.MDC; - -/** - * The Queue is a List of MessageEntry objects that are dispatched to matching - * subscriptions. - */ -public class Queue extends BaseDestination implements Task, UsageListener { - protected static final Logger LOG = LoggerFactory.getLogger(Queue.class); - protected final TaskRunnerFactory taskFactory; - protected TaskRunner taskRunner; - private final ReentrantReadWriteLock consumersLock = new ReentrantReadWriteLock(); - protected final List consumers = new ArrayList(50); - private final ReentrantReadWriteLock messagesLock = new ReentrantReadWriteLock(); - protected PendingMessageCursor messages; - private final ReentrantReadWriteLock pagedInMessagesLock = new ReentrantReadWriteLock(); - private final LinkedHashMap pagedInMessages = new LinkedHashMap(); - // Messages that are paged in but have not yet been targeted at a subscription - private final ReentrantReadWriteLock pagedInPendingDispatchLock = new ReentrantReadWriteLock(); - protected PendingList pagedInPendingDispatch = new OrderedPendingList(); - protected PendingList redeliveredWaitingDispatch = new OrderedPendingList(); - private MessageGroupMap messageGroupOwners; - private DispatchPolicy dispatchPolicy = new RoundRobinDispatchPolicy(); - private MessageGroupMapFactory messageGroupMapFactory = new CachedMessageGroupMapFactory(); - final Lock sendLock = new ReentrantLock(); - private ExecutorService executor; - private final Map messagesWaitingForSpace = new LinkedHashMap(); - private boolean useConsumerPriority = true; - private boolean strictOrderDispatch = false; - private final QueueDispatchSelector dispatchSelector; - private boolean optimizedDispatch = false; - private boolean iterationRunning = false; - private boolean firstConsumer = false; - private int timeBeforeDispatchStarts = 0; - private int consumersBeforeDispatchStarts = 0; - private CountDownLatch consumersBeforeStartsLatch; - private final AtomicLong pendingWakeups = new AtomicLong(); - private boolean allConsumersExclusiveByDefault = false; - - private final Runnable sendMessagesWaitingForSpaceTask = new Runnable() { - @Override - public void run() { - asyncWakeup(); - } - }; - private final Runnable expireMessagesTask = new Runnable() { - @Override - public void run() { - expireMessages(); - } - }; - - private final Object iteratingMutex = new Object(); - - class TimeoutMessage implements Delayed { - - Message message; - ConnectionContext context; - long trigger; - - public TimeoutMessage(Message message, ConnectionContext context, long delay) { - this.message = message; - this.context = context; - this.trigger = System.currentTimeMillis() + delay; - } - - @Override - public long getDelay(TimeUnit unit) { - long n = trigger - System.currentTimeMillis(); - return unit.convert(n, TimeUnit.MILLISECONDS); - } - - @Override - public int compareTo(Delayed delayed) { - long other = ((TimeoutMessage) delayed).trigger; - int returnValue; - if (this.trigger < other) { - returnValue = -1; - } else if (this.trigger > other) { - returnValue = 1; - } else { - returnValue = 0; - } - return returnValue; - } - } - - DelayQueue flowControlTimeoutMessages = new DelayQueue(); - - class FlowControlTimeoutTask extends Thread { - - @Override - public void run() { - TimeoutMessage timeout; - try { - while (true) { - timeout = flowControlTimeoutMessages.take(); - if (timeout != null) { - synchronized (messagesWaitingForSpace) { - if (messagesWaitingForSpace.remove(timeout.message.getMessageId()) != null) { - ExceptionResponse response = new ExceptionResponse( - new ResourceAllocationException( - "Usage Manager Memory Limit reached. Stopping producer (" - + timeout.message.getProducerId() - + ") to prevent flooding " - + getActiveMQDestination().getQualifiedName() - + "." - + " See http://activemq.apache.org/producer-flow-control.html for more info")); - response.setCorrelationId(timeout.message.getCommandId()); - timeout.context.getConnection().dispatchAsync(response); - } - } - } - } - } catch (InterruptedException e) { - LOG.debug(getName() + "Producer Flow Control Timeout Task is stopping"); - } - } - }; - - private final FlowControlTimeoutTask flowControlTimeoutTask = new FlowControlTimeoutTask(); - - private final Comparator orderedCompare = new Comparator() { - - @Override - public int compare(Subscription s1, Subscription s2) { - // We want the list sorted in descending order - int val = s2.getConsumerInfo().getPriority() - s1.getConsumerInfo().getPriority(); - if (val == 0 && messageGroupOwners != null) { - // then ascending order of assigned message groups to favour less loaded consumers - // Long.compare in jdk7 - long x = s1.getConsumerInfo().getLastDeliveredSequenceId(); - long y = s2.getConsumerInfo().getLastDeliveredSequenceId(); - val = (x < y) ? -1 : ((x == y) ? 0 : 1); - } - return val; - } - }; - - public Queue(BrokerService brokerService, final ActiveMQDestination destination, MessageStore store, - DestinationStatistics parentStats, TaskRunnerFactory taskFactory) throws Exception { - super(brokerService, store, destination, parentStats); - this.taskFactory = taskFactory; - this.dispatchSelector = new QueueDispatchSelector(destination); - } - - @Override - public List getConsumers() { - consumersLock.readLock().lock(); - try { - return new ArrayList(consumers); - } finally { - consumersLock.readLock().unlock(); - } - } - - // make the queue easily visible in the debugger from its task runner - // threads - final class QueueThread extends Thread { - final Queue queue; - - public QueueThread(Runnable runnable, String name, Queue queue) { - super(runnable, name); - this.queue = queue; - } - } - - class BatchMessageRecoveryListener implements MessageRecoveryListener { - final LinkedList toExpire = new LinkedList(); - final double totalMessageCount; - int recoveredAccumulator = 0; - int currentBatchCount; - - BatchMessageRecoveryListener(int totalMessageCount) { - this.totalMessageCount = totalMessageCount; - currentBatchCount = recoveredAccumulator; - } - - @Override - public boolean recoverMessage(Message message) { - recoveredAccumulator++; - if ((recoveredAccumulator % 10000) == 0) { - LOG.info("cursor for {} has recovered {} messages. {}% complete", new Object[]{ getActiveMQDestination().getQualifiedName(), recoveredAccumulator, new Integer((int) (recoveredAccumulator * 100 / totalMessageCount))}); - } - // Message could have expired while it was being - // loaded.. - if (message.isExpired() && broker.isExpired(message)) { - toExpire.add(message); - return true; - } - if (hasSpace()) { - message.setRegionDestination(Queue.this); - messagesLock.writeLock().lock(); - try { - try { - messages.addMessageLast(message); - } catch (Exception e) { - LOG.error("Failed to add message to cursor", e); - } - } finally { - messagesLock.writeLock().unlock(); - } - destinationStatistics.getMessages().increment(); - return true; - } - return false; - } - - @Override - public boolean recoverMessageReference(MessageId messageReference) throws Exception { - throw new RuntimeException("Should not be called."); - } - - @Override - public boolean hasSpace() { - return true; - } - - @Override - public boolean isDuplicate(MessageId id) { - return false; - } - - public void reset() { - currentBatchCount = recoveredAccumulator; - } - - public void processExpired() { - for (Message message: toExpire) { - messageExpired(createConnectionContext(), createMessageReference(message)); - // drop message will decrement so counter - // balance here - destinationStatistics.getMessages().increment(); - } - toExpire.clear(); - } - - public boolean done() { - return currentBatchCount == recoveredAccumulator; - } - } - - @Override - public void setPrioritizedMessages(boolean prioritizedMessages) { - super.setPrioritizedMessages(prioritizedMessages); - - if (prioritizedMessages && this.pagedInPendingDispatch instanceof OrderedPendingList) { - pagedInPendingDispatch = new PrioritizedPendingList(); - redeliveredWaitingDispatch = new PrioritizedPendingList(); - } else if(pagedInPendingDispatch instanceof PrioritizedPendingList) { - pagedInPendingDispatch = new OrderedPendingList(); - redeliveredWaitingDispatch = new OrderedPendingList(); - } - } - - @Override - public void initialize() throws Exception { - - if (this.messages == null) { - if (destination.isTemporary() || broker == null || store == null) { - this.messages = new VMPendingMessageCursor(isPrioritizedMessages()); - } else { - this.messages = new StoreQueueCursor(broker, this); - } - } - - // If a VMPendingMessageCursor don't use the default Producer System - // Usage - // since it turns into a shared blocking queue which can lead to a - // network deadlock. - // If we are cursoring to disk..it's not and issue because it does not - // block due - // to large disk sizes. - if (messages instanceof VMPendingMessageCursor) { - this.systemUsage = brokerService.getSystemUsage(); - memoryUsage.setParent(systemUsage.getMemoryUsage()); - } - - this.taskRunner = taskFactory.createTaskRunner(this, "Queue:" + destination.getPhysicalName()); - - super.initialize(); - if (store != null) { - // Restore the persistent messages. - messages.setSystemUsage(systemUsage); - messages.setEnableAudit(isEnableAudit()); - messages.setMaxAuditDepth(getMaxAuditDepth()); - messages.setMaxProducersToAudit(getMaxProducersToAudit()); - messages.setUseCache(isUseCache()); - messages.setMemoryUsageHighWaterMark(getCursorMemoryHighWaterMark()); - final int messageCount = store.getMessageCount(); - if (messageCount > 0 && messages.isRecoveryRequired()) { - BatchMessageRecoveryListener listener = new BatchMessageRecoveryListener(messageCount); - do { - listener.reset(); - store.recoverNextMessages(getMaxPageSize(), listener); - listener.processExpired(); - } while (!listener.done()); - } else { - destinationStatistics.getMessages().setCount(messageCount); - } - } - } - - /* - * Holder for subscription that needs attention on next iterate browser - * needs access to existing messages in the queue that have already been - * dispatched - */ - class BrowserDispatch { - QueueBrowserSubscription browser; - - public BrowserDispatch(QueueBrowserSubscription browserSubscription) { - browser = browserSubscription; - browser.incrementQueueRef(); - } - - void done() { - try { - browser.decrementQueueRef(); - } catch (Exception e) { - LOG.warn("decrement ref on browser: " + browser, e); - } - } - - public QueueBrowserSubscription getBrowser() { - return browser; - } - } - - ConcurrentLinkedQueue browserDispatches = new ConcurrentLinkedQueue(); - - @Override - public void addSubscription(ConnectionContext context, Subscription sub) throws Exception { - LOG.debug("{} add sub: {}, dequeues: {}, dispatched: {}, inflight: {}", new Object[]{ getActiveMQDestination().getQualifiedName(), getDestinationStatistics().getDequeues().getCount(), getDestinationStatistics().getDispatched().getCount(), getDestinationStatistics().getInflight().getCount() }); - - super.addSubscription(context, sub); - // synchronize with dispatch method so that no new messages are sent - // while setting up a subscription. avoid out of order messages, - // duplicates, etc. - pagedInPendingDispatchLock.writeLock().lock(); - try { - - sub.add(context, this); - - // needs to be synchronized - so no contention with dispatching - // consumersLock. - consumersLock.writeLock().lock(); - try { - // set a flag if this is a first consumer - if (consumers.size() == 0) { - firstConsumer = true; - if (consumersBeforeDispatchStarts != 0) { - consumersBeforeStartsLatch = new CountDownLatch(consumersBeforeDispatchStarts - 1); - } - } else { - if (consumersBeforeStartsLatch != null) { - consumersBeforeStartsLatch.countDown(); - } - } - - addToConsumerList(sub); - if (sub.getConsumerInfo().isExclusive() || isAllConsumersExclusiveByDefault()) { - Subscription exclusiveConsumer = dispatchSelector.getExclusiveConsumer(); - if (exclusiveConsumer == null) { - exclusiveConsumer = sub; - } else if (sub.getConsumerInfo().getPriority() == Byte.MAX_VALUE || - sub.getConsumerInfo().getPriority() > exclusiveConsumer.getConsumerInfo().getPriority()) { - exclusiveConsumer = sub; - } - dispatchSelector.setExclusiveConsumer(exclusiveConsumer); - } - } finally { - consumersLock.writeLock().unlock(); - } - - if (sub instanceof QueueBrowserSubscription) { - // tee up for dispatch in next iterate - QueueBrowserSubscription browserSubscription = (QueueBrowserSubscription) sub; - BrowserDispatch browserDispatch = new BrowserDispatch(browserSubscription); - browserDispatches.add(browserDispatch); - } - - if (!this.optimizedDispatch) { - wakeup(); - } - } finally { - pagedInPendingDispatchLock.writeLock().unlock(); - } - if (this.optimizedDispatch) { - // Outside of dispatchLock() to maintain the lock hierarchy of - // iteratingMutex -> dispatchLock. - see - // https://issues.apache.org/activemq/browse/AMQ-1878 - wakeup(); - } - } - - @Override - public void removeSubscription(ConnectionContext context, Subscription sub, long lastDeiveredSequenceId) - throws Exception { - super.removeSubscription(context, sub, lastDeiveredSequenceId); - // synchronize with dispatch method so that no new messages are sent - // while removing up a subscription. - pagedInPendingDispatchLock.writeLock().lock(); - try { - LOG.debug("{} remove sub: {}, lastDeliveredSeqId: {}, dequeues: {}, dispatched: {}, inflight: {}", new Object[]{ - getActiveMQDestination().getQualifiedName(), - sub, - lastDeiveredSequenceId, - getDestinationStatistics().getDequeues().getCount(), - getDestinationStatistics().getDispatched().getCount(), - getDestinationStatistics().getInflight().getCount() - }); - consumersLock.writeLock().lock(); - try { - removeFromConsumerList(sub); - if (sub.getConsumerInfo().isExclusive()) { - Subscription exclusiveConsumer = dispatchSelector.getExclusiveConsumer(); - if (exclusiveConsumer == sub) { - exclusiveConsumer = null; - for (Subscription s : consumers) { - if (s.getConsumerInfo().isExclusive() - && (exclusiveConsumer == null || s.getConsumerInfo().getPriority() > exclusiveConsumer - .getConsumerInfo().getPriority())) { - exclusiveConsumer = s; - - } - } - dispatchSelector.setExclusiveConsumer(exclusiveConsumer); - } - } else if (isAllConsumersExclusiveByDefault()) { - Subscription exclusiveConsumer = null; - for (Subscription s : consumers) { - if (exclusiveConsumer == null - || s.getConsumerInfo().getPriority() > exclusiveConsumer - .getConsumerInfo().getPriority()) { - exclusiveConsumer = s; - } - } - dispatchSelector.setExclusiveConsumer(exclusiveConsumer); - } - ConsumerId consumerId = sub.getConsumerInfo().getConsumerId(); - getMessageGroupOwners().removeConsumer(consumerId); - - // redeliver inflight messages - - boolean markAsRedelivered = false; - MessageReference lastDeliveredRef = null; - List unAckedMessages = sub.remove(context, this); - - // locate last redelivered in unconsumed list (list in delivery rather than seq order) - if (lastDeiveredSequenceId != 0) { - for (MessageReference ref : unAckedMessages) { - if (ref.getMessageId().getBrokerSequenceId() == lastDeiveredSequenceId) { - lastDeliveredRef = ref; - markAsRedelivered = true; - LOG.debug("found lastDeliveredSeqID: {}, message reference: {}", lastDeiveredSequenceId, ref.getMessageId()); - break; - } - } - } - - for (MessageReference ref : unAckedMessages) { - QueueMessageReference qmr = (QueueMessageReference) ref; - if (qmr.getLockOwner() == sub) { - qmr.unlock(); - - // have no delivery information - if (lastDeiveredSequenceId == 0) { - qmr.incrementRedeliveryCounter(); - } else { - if (markAsRedelivered) { - qmr.incrementRedeliveryCounter(); - } - if (ref == lastDeliveredRef) { - // all that follow were not redelivered - markAsRedelivered = false; - } - } - } - if (!qmr.isDropped()) { - redeliveredWaitingDispatch.addMessageLast(qmr); - } - } - if (sub instanceof QueueBrowserSubscription) { - ((QueueBrowserSubscription)sub).decrementQueueRef(); - browserDispatches.remove(sub); - } - if (!redeliveredWaitingDispatch.isEmpty()) { - doDispatch(new OrderedPendingList()); - } - } finally { - consumersLock.writeLock().unlock(); - } - if (!this.optimizedDispatch) { - wakeup(); - } - } finally { - pagedInPendingDispatchLock.writeLock().unlock(); - } - if (this.optimizedDispatch) { - // Outside of dispatchLock() to maintain the lock hierarchy of - // iteratingMutex -> dispatchLock. - see - // https://issues.apache.org/activemq/browse/AMQ-1878 - wakeup(); - } - } - - @Override - public void send(final ProducerBrokerExchange producerExchange, final Message message) throws Exception { - final ConnectionContext context = producerExchange.getConnectionContext(); - // There is delay between the client sending it and it arriving at the - // destination.. it may have expired. - message.setRegionDestination(this); - ProducerState state = producerExchange.getProducerState(); - if (state == null) { - LOG.warn("Send failed for: {}, missing producer state for: {}", message, producerExchange); - throw new JMSException("Cannot send message to " + getActiveMQDestination() + " with invalid (null) producer state"); - } - final ProducerInfo producerInfo = producerExchange.getProducerState().getInfo(); - final boolean sendProducerAck = !message.isResponseRequired() && producerInfo.getWindowSize() > 0 - && !context.isInRecoveryMode(); - if (message.isExpired()) { - // message not stored - or added to stats yet - so chuck here - broker.getRoot().messageExpired(context, message, null); - if (sendProducerAck) { - ProducerAck ack = new ProducerAck(producerInfo.getProducerId(), message.getSize()); - context.getConnection().dispatchAsync(ack); - } - return; - } - if (memoryUsage.isFull()) { - isFull(context, memoryUsage); - fastProducer(context, producerInfo); - if (isProducerFlowControl() && context.isProducerFlowControl()) { - if (warnOnProducerFlowControl) { - warnOnProducerFlowControl = false; - LOG.info("Usage Manager Memory Limit ({}) reached on {}. Producers will be throttled to the rate at which messages are removed from this destination to prevent flooding it. See http://activemq.apache.org/producer-flow-control.html for more info.", - memoryUsage.getLimit(), getActiveMQDestination().getQualifiedName()); - } - - if (!context.isNetworkConnection() && systemUsage.isSendFailIfNoSpace()) { - throw new ResourceAllocationException("Usage Manager Memory Limit reached. Stopping producer (" - + message.getProducerId() + ") to prevent flooding " - + getActiveMQDestination().getQualifiedName() + "." - + " See http://activemq.apache.org/producer-flow-control.html for more info"); - } - - // We can avoid blocking due to low usage if the producer is - // sending - // a sync message or if it is using a producer window - if (producerInfo.getWindowSize() > 0 || message.isResponseRequired()) { - // copy the exchange state since the context will be - // modified while we are waiting - // for space. - final ProducerBrokerExchange producerExchangeCopy = producerExchange.copy(); - synchronized (messagesWaitingForSpace) { - // Start flow control timeout task - // Prevent trying to start it multiple times - if (!flowControlTimeoutTask.isAlive()) { - flowControlTimeoutTask.setName(getName()+" Producer Flow Control Timeout Task"); - flowControlTimeoutTask.start(); - } - messagesWaitingForSpace.put(message.getMessageId(), new Runnable() { - @Override - public void run() { - - try { - // While waiting for space to free up... the - // message may have expired. - if (message.isExpired()) { - LOG.error("expired waiting for space.."); - broker.messageExpired(context, message, null); - destinationStatistics.getExpired().increment(); - } else { - doMessageSend(producerExchangeCopy, message); - } - - if (sendProducerAck) { - ProducerAck ack = new ProducerAck(producerInfo.getProducerId(), message - .getSize()); - context.getConnection().dispatchAsync(ack); - } else { - Response response = new Response(); - response.setCorrelationId(message.getCommandId()); - context.getConnection().dispatchAsync(response); - } - - } catch (Exception e) { - if (!sendProducerAck && !context.isInRecoveryMode() && !brokerService.isStopping()) { - ExceptionResponse response = new ExceptionResponse(e); - response.setCorrelationId(message.getCommandId()); - context.getConnection().dispatchAsync(response); - } else { - LOG.debug("unexpected exception on deferred send of: {}", message, e); - } - } - } - }); - - if (!context.isNetworkConnection() && systemUsage.getSendFailIfNoSpaceAfterTimeout() != 0) { - flowControlTimeoutMessages.add(new TimeoutMessage(message, context, systemUsage - .getSendFailIfNoSpaceAfterTimeout())); - } - - registerCallbackForNotFullNotification(); - context.setDontSendReponse(true); - return; - } - - } else { - - if (memoryUsage.isFull()) { - waitForSpace(context, producerExchange, memoryUsage, "Usage Manager Memory Limit reached. Producer (" - + message.getProducerId() + ") stopped to prevent flooding " - + getActiveMQDestination().getQualifiedName() + "." - + " See http://activemq.apache.org/producer-flow-control.html for more info"); - } - - // The usage manager could have delayed us by the time - // we unblock the message could have expired.. - if (message.isExpired()) { - LOG.debug("Expired message: {}", message); - broker.getRoot().messageExpired(context, message, null); - return; - } - } - } - } - doMessageSend(producerExchange, message); - if (sendProducerAck) { - ProducerAck ack = new ProducerAck(producerInfo.getProducerId(), message.getSize()); - context.getConnection().dispatchAsync(ack); - } - } - - private void registerCallbackForNotFullNotification() { - // If the usage manager is not full, then the task will not - // get called.. - if (!memoryUsage.notifyCallbackWhenNotFull(sendMessagesWaitingForSpaceTask)) { - // so call it directly here. - sendMessagesWaitingForSpaceTask.run(); - } - } - - final ConcurrentHashMap sendSyncs = new ConcurrentHashMap(); - private volatile LinkedList orderIndexUpdates = new LinkedList(); - - // roll up all message sends - class SendSync extends Synchronization { - - class MessageContext { - public Message message; - public ConnectionContext context; - - public MessageContext(ConnectionContext context, Message message) { - this.context = context; - this.message = message; - } - } - - final Transaction transaction; - List additions = new ArrayList(); - - public SendSync(Transaction transaction) { - this.transaction = transaction; - } - - public void add(ConnectionContext context, Message message) { - additions.add(new MessageContext(context, message)); - } - - @Override - public void beforeCommit() throws Exception { - synchronized (sendLock) { - orderIndexUpdates.addLast(transaction); - } - } - - @Override - public void afterCommit() throws Exception { - LinkedList orderedWork = new LinkedList();; - // use existing object to sync orderIndexUpdates that can be reassigned - synchronized (sendLock) { - Transaction next = orderIndexUpdates.peek(); - while( next!=null && next.isCommitted() ) { - orderedWork.addLast(orderIndexUpdates.removeFirst()); - next = orderIndexUpdates.peek(); - } - } - // do the ordered work - if (!orderedWork.isEmpty()) { - - ArrayList syncs = new ArrayList(orderedWork.size());; - for (Transaction tx : orderedWork) { - syncs.add(sendSyncs.remove(tx)); - } - sendLock.lockInterruptibly(); - try { - for (SendSync sync : syncs) { - sync.processSend(); - } - } finally { - sendLock.unlock(); - } - for (SendSync sync : syncs) { - sync.processSent(); - } - } - } - - // called with sendLock - private void processSend() throws Exception { - - for (Iterator iterator = additions.iterator(); iterator.hasNext(); ) { - MessageContext messageContext = iterator.next(); - // It could take while before we receive the commit - // op, by that time the message could have expired.. - if (broker.isExpired(messageContext.message)) { - broker.messageExpired(messageContext.context, messageContext.message, null); - destinationStatistics.getExpired().increment(); - iterator.remove(); - continue; - } - sendMessage(messageContext.message); - messageContext.message.decrementReferenceCount(); - } - } - - private void processSent() throws Exception { - for (MessageContext messageContext : additions) { - messageSent(messageContext.context, messageContext.message); - } - } - - @Override - public void afterRollback() throws Exception { - try { - for (MessageContext messageContext : additions) { - messageContext.message.decrementReferenceCount(); - } - } finally { - sendSyncs.remove(transaction); - } - } - } - - // called while holding the sendLock - private void registerSendSync(Message message, ConnectionContext context) { - final Transaction transaction = context.getTransaction(); - Queue.SendSync currentSync = sendSyncs.get(transaction); - if (currentSync == null) { - currentSync = new Queue.SendSync(transaction); - transaction.addSynchronization(currentSync); - sendSyncs.put(transaction, currentSync); - } - currentSync.add(context, message); - } - - void doMessageSend(final ProducerBrokerExchange producerExchange, final Message message) throws IOException, - Exception { - final ConnectionContext context = producerExchange.getConnectionContext(); - Future result = null; - - producerExchange.incrementSend(); - checkUsage(context, producerExchange, message); - sendLock.lockInterruptibly(); - try { - if (store != null && message.isPersistent()) { - message.getMessageId().setBrokerSequenceId(getDestinationSequenceId()); - if (messages.isCacheEnabled()) { - result = store.asyncAddQueueMessage(context, message, isOptimizeStorage()); - } else { - store.addMessage(context, message); - } - if (isReduceMemoryFootprint()) { - message.clearMarshalledState(); - } - } - if (context.isInTransaction()) { - // If this is a transacted message.. increase the usage now so that - // a big TX does not blow up - // our memory. This increment is decremented once the tx finishes.. - message.incrementReferenceCount(); - - registerSendSync(message, context); - } else { - // Add to the pending list, this takes care of incrementing the - // usage manager. - sendMessage(message); - } - } finally { - sendLock.unlock(); - } - if (!context.isInTransaction()) { - messageSent(context, message); - } - if (result != null && !result.isCancelled()) { - try { - result.get(); - } catch (CancellationException e) { - // ignore - the task has been cancelled if the message - // has already been deleted - } - } - } - - private void checkUsage(ConnectionContext context,ProducerBrokerExchange producerBrokerExchange, Message message) throws ResourceAllocationException, IOException, InterruptedException { - if (message.isPersistent()) { - if (store != null && systemUsage.getStoreUsage().isFull(getStoreUsageHighWaterMark())) { - final String logMessage = "Persistent store is Full, " + getStoreUsageHighWaterMark() + "% of " - + systemUsage.getStoreUsage().getLimit() + ". Stopping producer (" - + message.getProducerId() + ") to prevent flooding " - + getActiveMQDestination().getQualifiedName() + "." - + " See http://activemq.apache.org/producer-flow-control.html for more info"; - - waitForSpace(context, producerBrokerExchange, systemUsage.getStoreUsage(), getStoreUsageHighWaterMark(), logMessage); - } - } else if (messages.getSystemUsage() != null && systemUsage.getTempUsage().isFull()) { - final String logMessage = "Temp Store is Full (" - + systemUsage.getTempUsage().getPercentUsage() + "% of " + systemUsage.getTempUsage().getLimit() - +"). Stopping producer (" + message.getProducerId() - + ") to prevent flooding " + getActiveMQDestination().getQualifiedName() + "." - + " See http://activemq.apache.org/producer-flow-control.html for more info"; - - waitForSpace(context, producerBrokerExchange, messages.getSystemUsage().getTempUsage(), logMessage); - } - } - - private void expireMessages() { - LOG.debug("{} expiring messages ..", getActiveMQDestination().getQualifiedName()); - - // just track the insertion count - List browsedMessages = new InsertionCountList(); - doBrowse(browsedMessages, this.getMaxExpirePageSize()); - asyncWakeup(); - LOG.debug("{} expiring messages done.", getActiveMQDestination().getQualifiedName()); - } - - @Override - public void gc() { - } - - @Override - public void acknowledge(ConnectionContext context, Subscription sub, MessageAck ack, MessageReference node) - throws IOException { - messageConsumed(context, node); - if (store != null && node.isPersistent()) { - store.removeAsyncMessage(context, convertToNonRangedAck(ack, node)); - } - } - - Message loadMessage(MessageId messageId) throws IOException { - Message msg = null; - if (store != null) { // can be null for a temp q - msg = store.getMessage(messageId); - if (msg != null) { - msg.setRegionDestination(this); - } - } - return msg; - } - - @Override - public String toString() { - int size = 0; - messagesLock.readLock().lock(); - try { - size = messages.size(); - } finally { - messagesLock.readLock().unlock(); - } - return destination.getQualifiedName() + ", subscriptions=" + consumers.size() - + ", memory=" + memoryUsage.getPercentUsage() + "%, size=" + size + ", in flight groups=" - + messageGroupOwners; - } - - @Override - public void start() throws Exception { - if (memoryUsage != null) { - memoryUsage.start(); - } - if (systemUsage.getStoreUsage() != null) { - systemUsage.getStoreUsage().start(); - } - systemUsage.getMemoryUsage().addUsageListener(this); - messages.start(); - if (getExpireMessagesPeriod() > 0) { - scheduler.schedualPeriodically(expireMessagesTask, getExpireMessagesPeriod()); - } - doPageIn(false); - } - - @Override - public void stop() throws Exception { - if (taskRunner != null) { - taskRunner.shutdown(); - } - if (this.executor != null) { - ThreadPoolUtils.shutdownNow(executor); - executor = null; - } - - scheduler.cancel(expireMessagesTask); - - if (flowControlTimeoutTask.isAlive()) { - flowControlTimeoutTask.interrupt(); - } - - if (messages != null) { - messages.stop(); - } - - systemUsage.getMemoryUsage().removeUsageListener(this); - if (memoryUsage != null) { - memoryUsage.stop(); - } - if (store != null) { - store.stop(); - } - } - - // Properties - // ------------------------------------------------------------------------- - @Override - public ActiveMQDestination getActiveMQDestination() { - return destination; - } - - public MessageGroupMap getMessageGroupOwners() { - if (messageGroupOwners == null) { - messageGroupOwners = getMessageGroupMapFactory().createMessageGroupMap(); - } - return messageGroupOwners; - } - - public DispatchPolicy getDispatchPolicy() { - return dispatchPolicy; - } - - public void setDispatchPolicy(DispatchPolicy dispatchPolicy) { - this.dispatchPolicy = dispatchPolicy; - } - - public MessageGroupMapFactory getMessageGroupMapFactory() { - return messageGroupMapFactory; - } - - public void setMessageGroupMapFactory(MessageGroupMapFactory messageGroupMapFactory) { - this.messageGroupMapFactory = messageGroupMapFactory; - } - - public PendingMessageCursor getMessages() { - return this.messages; - } - - public void setMessages(PendingMessageCursor messages) { - this.messages = messages; - } - - public boolean isUseConsumerPriority() { - return useConsumerPriority; - } - - public void setUseConsumerPriority(boolean useConsumerPriority) { - this.useConsumerPriority = useConsumerPriority; - } - - public boolean isStrictOrderDispatch() { - return strictOrderDispatch; - } - - public void setStrictOrderDispatch(boolean strictOrderDispatch) { - this.strictOrderDispatch = strictOrderDispatch; - } - - public boolean isOptimizedDispatch() { - return optimizedDispatch; - } - - public void setOptimizedDispatch(boolean optimizedDispatch) { - this.optimizedDispatch = optimizedDispatch; - } - - public int getTimeBeforeDispatchStarts() { - return timeBeforeDispatchStarts; - } - - public void setTimeBeforeDispatchStarts(int timeBeforeDispatchStarts) { - this.timeBeforeDispatchStarts = timeBeforeDispatchStarts; - } - - public int getConsumersBeforeDispatchStarts() { - return consumersBeforeDispatchStarts; - } - - public void setConsumersBeforeDispatchStarts(int consumersBeforeDispatchStarts) { - this.consumersBeforeDispatchStarts = consumersBeforeDispatchStarts; - } - - public void setAllConsumersExclusiveByDefault(boolean allConsumersExclusiveByDefault) { - this.allConsumersExclusiveByDefault = allConsumersExclusiveByDefault; - } - - public boolean isAllConsumersExclusiveByDefault() { - return allConsumersExclusiveByDefault; - } - - // Implementation methods - // ------------------------------------------------------------------------- - private QueueMessageReference createMessageReference(Message message) { - QueueMessageReference result = new IndirectMessageReference(message); - return result; - } - - @Override - public Message[] browse() { - List browseList = new ArrayList(); - doBrowse(browseList, getMaxBrowsePageSize()); - return browseList.toArray(new Message[browseList.size()]); - } - - public void doBrowse(List browseList, int max) { - final ConnectionContext connectionContext = createConnectionContext(); - try { - pageInMessages(true); - List toExpire = new ArrayList(); - - pagedInPendingDispatchLock.writeLock().lock(); - try { - addAll(pagedInPendingDispatch.values(), browseList, max, toExpire); - for (MessageReference ref : toExpire) { - pagedInPendingDispatch.remove(ref); - if (broker.isExpired(ref)) { - LOG.debug("expiring from pagedInPending: {}", ref); - messageExpired(connectionContext, ref); - } - } - } finally { - pagedInPendingDispatchLock.writeLock().unlock(); - } - toExpire.clear(); - pagedInMessagesLock.readLock().lock(); - try { - addAll(pagedInMessages.values(), browseList, max, toExpire); - } finally { - pagedInMessagesLock.readLock().unlock(); - } - for (MessageReference ref : toExpire) { - if (broker.isExpired(ref)) { - LOG.debug("expiring from pagedInMessages: {}", ref); - messageExpired(connectionContext, ref); - } else { - pagedInMessagesLock.writeLock().lock(); - try { - pagedInMessages.remove(ref.getMessageId()); - } finally { - pagedInMessagesLock.writeLock().unlock(); - } - } - } - - if (browseList.size() < getMaxBrowsePageSize()) { - messagesLock.writeLock().lock(); - try { - try { - messages.reset(); - while (messages.hasNext() && browseList.size() < max) { - MessageReference node = messages.next(); - if (node.isExpired()) { - if (broker.isExpired(node)) { - LOG.debug("expiring from messages: {}", node); - messageExpired(connectionContext, createMessageReference(node.getMessage())); - } - messages.remove(); - } else { - messages.rollback(node.getMessageId()); - if (browseList.contains(node.getMessage()) == false) { - browseList.add(node.getMessage()); - } - } - node.decrementReferenceCount(); - } - } finally { - messages.release(); - } - } finally { - messagesLock.writeLock().unlock(); - } - } - } catch (Exception e) { - LOG.error("Problem retrieving message for browse", e); - } - } - - private void addAll(Collection refs, List l, int maxBrowsePageSize, - List toExpire) throws Exception { - for (Iterator i = refs.iterator(); i.hasNext() && l.size() < getMaxBrowsePageSize();) { - QueueMessageReference ref = (QueueMessageReference) i.next(); - if (ref.isExpired()) { - toExpire.add(ref); - } else if (l.contains(ref.getMessage()) == false) { - l.add(ref.getMessage()); - } - } - } - - public QueueMessageReference getMessage(String id) { - MessageId msgId = new MessageId(id); - pagedInMessagesLock.readLock().lock(); - try { - QueueMessageReference ref = this.pagedInMessages.get(msgId); - if (ref != null) { - return ref; - } - } finally { - pagedInMessagesLock.readLock().unlock(); - } - messagesLock.readLock().lock(); - try{ - try { - messages.reset(); - while (messages.hasNext()) { - MessageReference mr = messages.next(); - QueueMessageReference qmr = createMessageReference(mr.getMessage()); - qmr.decrementReferenceCount(); - messages.rollback(qmr.getMessageId()); - if (msgId.equals(qmr.getMessageId())) { - return qmr; - } - } - } finally { - messages.release(); - } - }finally { - messagesLock.readLock().unlock(); - } - return null; - } - - public void purge() throws Exception { - ConnectionContext c = createConnectionContext(); - List list = null; - do { - doPageIn(true, false); // signal no expiry processing needed. - pagedInMessagesLock.readLock().lock(); - try { - list = new ArrayList(pagedInMessages.values()); - }finally { - pagedInMessagesLock.readLock().unlock(); - } - - for (MessageReference ref : list) { - try { - QueueMessageReference r = (QueueMessageReference) ref; - removeMessage(c, r); - } catch (IOException e) { - } - } - // don't spin/hang if stats are out and there is nothing left in the - // store - } while (!list.isEmpty() && this.destinationStatistics.getMessages().getCount() > 0); - - if (this.destinationStatistics.getMessages().getCount() > 0) { - LOG.warn("{} after purge complete, message count stats report: {}", getActiveMQDestination().getQualifiedName(), this.destinationStatistics.getMessages().getCount()); - } - gc(); - this.destinationStatistics.getMessages().setCount(0); - getMessages().clear(); - } - - @Override - public void clearPendingMessages() { - messagesLock.writeLock().lock(); - try { - if (store != null) { - store.resetBatching(); - } - messages.gc(); - messages.reset(); - asyncWakeup(); - } finally { - messagesLock.writeLock().unlock(); - } - } - - /** - * Removes the message matching the given messageId - */ - public boolean removeMessage(String messageId) throws Exception { - return removeMatchingMessages(createMessageIdFilter(messageId), 1) > 0; - } - - /** - * Removes the messages matching the given selector - * - * @return the number of messages removed - */ - public int removeMatchingMessages(String selector) throws Exception { - return removeMatchingMessages(selector, -1); - } - - /** - * Removes the messages matching the given selector up to the maximum number - * of matched messages - * - * @return the number of messages removed - */ - public int removeMatchingMessages(String selector, int maximumMessages) throws Exception { - return removeMatchingMessages(createSelectorFilter(selector), maximumMessages); - } - - /** - * Removes the messages matching the given filter up to the maximum number - * of matched messages - * - * @return the number of messages removed - */ - public int removeMatchingMessages(MessageReferenceFilter filter, int maximumMessages) throws Exception { - int movedCounter = 0; - Set set = new LinkedHashSet(); - ConnectionContext context = createConnectionContext(); - do { - doPageIn(true); - pagedInMessagesLock.readLock().lock(); - try { - set.addAll(pagedInMessages.values()); - } finally { - pagedInMessagesLock.readLock().unlock(); - } - List list = new ArrayList(set); - for (MessageReference ref : list) { - IndirectMessageReference r = (IndirectMessageReference) ref; - if (filter.evaluate(context, r)) { - - removeMessage(context, r); - set.remove(r); - if (++movedCounter >= maximumMessages && maximumMessages > 0) { - return movedCounter; - } - } - } - } while (set.size() < this.destinationStatistics.getMessages().getCount()); - return movedCounter; - } - - /** - * Copies the message matching the given messageId - */ - public boolean copyMessageTo(ConnectionContext context, String messageId, ActiveMQDestination dest) - throws Exception { - return copyMatchingMessages(context, createMessageIdFilter(messageId), dest, 1) > 0; - } - - /** - * Copies the messages matching the given selector - * - * @return the number of messages copied - */ - public int copyMatchingMessagesTo(ConnectionContext context, String selector, ActiveMQDestination dest) - throws Exception { - return copyMatchingMessagesTo(context, selector, dest, -1); - } - - /** - * Copies the messages matching the given selector up to the maximum number - * of matched messages - * - * @return the number of messages copied - */ - public int copyMatchingMessagesTo(ConnectionContext context, String selector, ActiveMQDestination dest, - int maximumMessages) throws Exception { - return copyMatchingMessages(context, createSelectorFilter(selector), dest, maximumMessages); - } - - /** - * Copies the messages matching the given filter up to the maximum number of - * matched messages - * - * @return the number of messages copied - */ - public int copyMatchingMessages(ConnectionContext context, MessageReferenceFilter filter, ActiveMQDestination dest, - int maximumMessages) throws Exception { - int movedCounter = 0; - int count = 0; - Set set = new LinkedHashSet(); - do { - int oldMaxSize = getMaxPageSize(); - setMaxPageSize((int) this.destinationStatistics.getMessages().getCount()); - doPageIn(true); - setMaxPageSize(oldMaxSize); - pagedInMessagesLock.readLock().lock(); - try { - set.addAll(pagedInMessages.values()); - } finally { - pagedInMessagesLock.readLock().unlock(); - } - List list = new ArrayList(set); - for (MessageReference ref : list) { - IndirectMessageReference r = (IndirectMessageReference) ref; - if (filter.evaluate(context, r)) { - - r.incrementReferenceCount(); - try { - Message m = r.getMessage(); - BrokerSupport.resend(context, m, dest); - if (++movedCounter >= maximumMessages && maximumMessages > 0) { - return movedCounter; - } - } finally { - r.decrementReferenceCount(); - } - } - count++; - } - } while (count < this.destinationStatistics.getMessages().getCount()); - return movedCounter; - } - - /** - * Move a message - * - * @param context - * connection context - * @param m - * QueueMessageReference - * @param dest - * ActiveMQDestination - * @throws Exception - */ - public boolean moveMessageTo(ConnectionContext context, QueueMessageReference m, ActiveMQDestination dest) throws Exception { - BrokerSupport.resend(context, m.getMessage(), dest); - removeMessage(context, m); - messagesLock.writeLock().lock(); - try { - messages.rollback(m.getMessageId()); - if (isDLQ()) { - DeadLetterStrategy stratagy = getDeadLetterStrategy(); - stratagy.rollback(m.getMessage()); - } - } finally { - messagesLock.writeLock().unlock(); - } - return true; - } - - /** - * Moves the message matching the given messageId - */ - public boolean moveMessageTo(ConnectionContext context, String messageId, ActiveMQDestination dest) - throws Exception { - return moveMatchingMessagesTo(context, createMessageIdFilter(messageId), dest, 1) > 0; - } - - /** - * Moves the messages matching the given selector - * - * @return the number of messages removed - */ - public int moveMatchingMessagesTo(ConnectionContext context, String selector, ActiveMQDestination dest) - throws Exception { - return moveMatchingMessagesTo(context, selector, dest, Integer.MAX_VALUE); - } - - /** - * Moves the messages matching the given selector up to the maximum number - * of matched messages - */ - public int moveMatchingMessagesTo(ConnectionContext context, String selector, ActiveMQDestination dest, - int maximumMessages) throws Exception { - return moveMatchingMessagesTo(context, createSelectorFilter(selector), dest, maximumMessages); - } - - /** - * Moves the messages matching the given filter up to the maximum number of - * matched messages - */ - public int moveMatchingMessagesTo(ConnectionContext context, MessageReferenceFilter filter, - ActiveMQDestination dest, int maximumMessages) throws Exception { - int movedCounter = 0; - Set set = new LinkedHashSet(); - do { - doPageIn(true); - pagedInMessagesLock.readLock().lock(); - try { - set.addAll(pagedInMessages.values()); - } finally { - pagedInMessagesLock.readLock().unlock(); - } - List list = new ArrayList(set); - for (QueueMessageReference ref : list) { - if (filter.evaluate(context, ref)) { - // We should only move messages that can be locked. - moveMessageTo(context, ref, dest); - set.remove(ref); - if (++movedCounter >= maximumMessages && maximumMessages > 0) { - return movedCounter; - } - } - } - } while (set.size() < this.destinationStatistics.getMessages().getCount() && set.size() < maximumMessages); - return movedCounter; - } - - public int retryMessages(ConnectionContext context, int maximumMessages) throws Exception { - if (!isDLQ()) { - throw new Exception("Retry of message is only possible on Dead Letter Queues!"); - } - int restoredCounter = 0; - Set set = new LinkedHashSet(); - do { - doPageIn(true); - pagedInMessagesLock.readLock().lock(); - try { - set.addAll(pagedInMessages.values()); - } finally { - pagedInMessagesLock.readLock().unlock(); - } - List list = new ArrayList(set); - for (QueueMessageReference ref : list) { - if (ref.getMessage().getOriginalDestination() != null) { - - moveMessageTo(context, ref, ref.getMessage().getOriginalDestination()); - set.remove(ref); - if (++restoredCounter >= maximumMessages && maximumMessages > 0) { - return restoredCounter; - } - } - } - } while (set.size() < this.destinationStatistics.getMessages().getCount() && set.size() < maximumMessages); - return restoredCounter; - } - - /** - * @return true if we would like to iterate again - * @see org.apache.activemq.thread.Task#iterate() - */ - @Override - public boolean iterate() { - MDC.put("activemq.destination", getName()); - boolean pageInMoreMessages = false; - synchronized (iteratingMutex) { - - // If optimize dispatch is on or this is a slave this method could be called recursively - // we set this state value to short-circuit wakeup in those cases to avoid that as it - // could lead to errors. - iterationRunning = true; - - // do early to allow dispatch of these waiting messages - synchronized (messagesWaitingForSpace) { - Iterator it = messagesWaitingForSpace.values().iterator(); - while (it.hasNext()) { - if (!memoryUsage.isFull()) { - Runnable op = it.next(); - it.remove(); - op.run(); - } else { - registerCallbackForNotFullNotification(); - break; - } - } - } - - if (firstConsumer) { - firstConsumer = false; - try { - if (consumersBeforeDispatchStarts > 0) { - int timeout = 1000; // wait one second by default if - // consumer count isn't reached - if (timeBeforeDispatchStarts > 0) { - timeout = timeBeforeDispatchStarts; - } - if (consumersBeforeStartsLatch.await(timeout, TimeUnit.MILLISECONDS)) { - LOG.debug("{} consumers subscribed. Starting dispatch.", consumers.size()); - } else { - LOG.debug("{} ms elapsed and {} consumers subscribed. Starting dispatch.", timeout, consumers.size()); - } - } - if (timeBeforeDispatchStarts > 0 && consumersBeforeDispatchStarts <= 0) { - iteratingMutex.wait(timeBeforeDispatchStarts); - LOG.debug("{} ms elapsed. Starting dispatch.", timeBeforeDispatchStarts); - } - } catch (Exception e) { - LOG.error(e.toString()); - } - } - - messagesLock.readLock().lock(); - try{ - pageInMoreMessages |= !messages.isEmpty(); - } finally { - messagesLock.readLock().unlock(); - } - - pagedInPendingDispatchLock.readLock().lock(); - try { - pageInMoreMessages |= !pagedInPendingDispatch.isEmpty(); - } finally { - pagedInPendingDispatchLock.readLock().unlock(); - } - - // Perhaps we should page always into the pagedInPendingDispatch - // list if - // !messages.isEmpty(), and then if - // !pagedInPendingDispatch.isEmpty() - // then we do a dispatch. - boolean hasBrowsers = browserDispatches.size() > 0; - - if (pageInMoreMessages || hasBrowsers || !redeliveredWaitingDispatch.isEmpty()) { - try { - pageInMessages(hasBrowsers); - } catch (Throwable e) { - LOG.error("Failed to page in more queue messages ", e); - } - } - - if (hasBrowsers) { - ArrayList alreadyDispatchedMessages = null; - pagedInMessagesLock.readLock().lock(); - try{ - alreadyDispatchedMessages = new ArrayList(pagedInMessages.values()); - }finally { - pagedInMessagesLock.readLock().unlock(); - } - - Iterator browsers = browserDispatches.iterator(); - while (browsers.hasNext()) { - BrowserDispatch browserDispatch = browsers.next(); - try { - MessageEvaluationContext msgContext = new NonCachedMessageEvaluationContext(); - msgContext.setDestination(destination); - - QueueBrowserSubscription browser = browserDispatch.getBrowser(); - - LOG.debug("dispatch to browser: {}, already dispatched/paged count: {}", browser, alreadyDispatchedMessages.size()); - boolean added = false; - for (QueueMessageReference node : alreadyDispatchedMessages) { - if (!node.isAcked() && !browser.isDuplicate(node.getMessageId())) { - msgContext.setMessageReference(node); - if (browser.matches(node, msgContext)) { - browser.add(node); - added = true; - } - } - } - // are we done browsing? no new messages paged - if (!added) { - browser.decrementQueueRef(); - browserDispatches.remove(browserDispatch); - } - } catch (Exception e) { - LOG.warn("exception on dispatch to browser: {}", browserDispatch.getBrowser(), e); - } - } - } - - if (pendingWakeups.get() > 0) { - pendingWakeups.decrementAndGet(); - } - MDC.remove("activemq.destination"); - iterationRunning = false; - - return pendingWakeups.get() > 0; - } - } - - protected MessageReferenceFilter createMessageIdFilter(final String messageId) { - return new MessageReferenceFilter() { - @Override - public boolean evaluate(ConnectionContext context, MessageReference r) { - return messageId.equals(r.getMessageId().toString()); - } - - @Override - public String toString() { - return "MessageIdFilter: " + messageId; - } - }; - } - - protected MessageReferenceFilter createSelectorFilter(String selector) throws InvalidSelectorException { - - if (selector == null || selector.isEmpty()) { - return new MessageReferenceFilter() { - - @Override - public boolean evaluate(ConnectionContext context, MessageReference messageReference) throws JMSException { - return true; - } - }; - } - - final BooleanExpression selectorExpression = SelectorParser.parse(selector); - - return new MessageReferenceFilter() { - @Override - public boolean evaluate(ConnectionContext context, MessageReference r) throws JMSException { - MessageEvaluationContext messageEvaluationContext = context.getMessageEvaluationContext(); - - messageEvaluationContext.setMessageReference(r); - if (messageEvaluationContext.getDestination() == null) { - messageEvaluationContext.setDestination(getActiveMQDestination()); - } - - return selectorExpression.matches(messageEvaluationContext); - } - }; - } - - protected void removeMessage(ConnectionContext c, QueueMessageReference r) throws IOException { - removeMessage(c, null, r); - pagedInPendingDispatchLock.writeLock().lock(); - try { - pagedInPendingDispatch.remove(r); - } finally { - pagedInPendingDispatchLock.writeLock().unlock(); - } - } - - protected void removeMessage(ConnectionContext c, Subscription subs, QueueMessageReference r) throws IOException { - MessageAck ack = new MessageAck(); - ack.setAckType(MessageAck.STANDARD_ACK_TYPE); - ack.setDestination(destination); - ack.setMessageID(r.getMessageId()); - removeMessage(c, subs, r, ack); - } - - protected void removeMessage(ConnectionContext context, Subscription sub, final QueueMessageReference reference, - MessageAck ack) throws IOException { - reference.setAcked(true); - // This sends the ack the the journal.. - if (!ack.isInTransaction()) { - acknowledge(context, sub, ack, reference); - getDestinationStatistics().getDequeues().increment(); - dropMessage(reference); - } else { - try { - acknowledge(context, sub, ack, reference); - } finally { - context.getTransaction().addSynchronization(new Synchronization() { - - @Override - public void afterCommit() throws Exception { - getDestinationStatistics().getDequeues().increment(); - dropMessage(reference); - wakeup(); - } - - @Override - public void afterRollback() throws Exception { - reference.setAcked(false); - wakeup(); - } - }); - } - } - if (ack.isPoisonAck() || (sub != null && sub.getConsumerInfo().isNetworkSubscription())) { - // message gone to DLQ, is ok to allow redelivery - messagesLock.writeLock().lock(); - try { - messages.rollback(reference.getMessageId()); - } finally { - messagesLock.writeLock().unlock(); - } - } - - } - - private void dropMessage(QueueMessageReference reference) { - if (!reference.isDropped()) { - reference.drop(); - destinationStatistics.getMessages().decrement(); - pagedInMessagesLock.writeLock().lock(); - try { - pagedInMessages.remove(reference.getMessageId()); - } finally { - pagedInMessagesLock.writeLock().unlock(); - } - } - } - - public void messageExpired(ConnectionContext context, MessageReference reference) { - messageExpired(context, null, reference); - } - - @Override - public void messageExpired(ConnectionContext context, Subscription subs, MessageReference reference) { - LOG.debug("message expired: {}", reference); - broker.messageExpired(context, reference, subs); - destinationStatistics.getExpired().increment(); - try { - removeMessage(context, subs, (QueueMessageReference) reference); - messagesLock.writeLock().lock(); - try { - messages.rollback(reference.getMessageId()); - } finally { - messagesLock.writeLock().unlock(); - } - } catch (IOException e) { - LOG.error("Failed to remove expired Message from the store ", e); - } - } - - final void sendMessage(final Message msg) throws Exception { - messagesLock.writeLock().lock(); - try { - messages.addMessageLast(msg); - } finally { - messagesLock.writeLock().unlock(); - } - } - - final void messageSent(final ConnectionContext context, final Message msg) throws Exception { - destinationStatistics.getEnqueues().increment(); - destinationStatistics.getMessages().increment(); - destinationStatistics.getMessageSize().addSize(msg.getSize()); - messageDelivered(context, msg); - consumersLock.readLock().lock(); - try { - if (consumers.isEmpty()) { - onMessageWithNoConsumers(context, msg); - } - }finally { - consumersLock.readLock().unlock(); - } - LOG.debug("{} Message {} sent to {}", new Object[]{ broker.getBrokerName(), msg.getMessageId(), this.destination }); - wakeup(); - } - - @Override - public void wakeup() { - if (optimizedDispatch && !iterationRunning) { - iterate(); - pendingWakeups.incrementAndGet(); - } else { - asyncWakeup(); - } - } - - private void asyncWakeup() { - try { - pendingWakeups.incrementAndGet(); - this.taskRunner.wakeup(); - } catch (InterruptedException e) { - LOG.warn("Async task runner failed to wakeup ", e); - } - } - - private void doPageIn(boolean force) throws Exception { - doPageIn(force, true); - } - - private void doPageIn(boolean force, boolean processExpired) throws Exception { - PendingList newlyPaged = doPageInForDispatch(force, processExpired); - pagedInPendingDispatchLock.writeLock().lock(); - try { - if (pagedInPendingDispatch.isEmpty()) { - pagedInPendingDispatch.addAll(newlyPaged); - - } else { - for (MessageReference qmr : newlyPaged) { - if (!pagedInPendingDispatch.contains(qmr)) { - pagedInPendingDispatch.addMessageLast(qmr); - } - } - } - } finally { - pagedInPendingDispatchLock.writeLock().unlock(); - } - } - - private PendingList doPageInForDispatch(boolean force, boolean processExpired) throws Exception { - List result = null; - PendingList resultList = null; - - int toPageIn = Math.min(getMaxPageSize(), messages.size()); - LOG.debug("{} toPageIn: {}, Inflight: {}, pagedInMessages.size {}, enqueueCount: {}, dequeueCount: {}", - new Object[]{ - destination.getPhysicalName(), - toPageIn, - destinationStatistics.getInflight().getCount(), - pagedInMessages.size(), - destinationStatistics.getEnqueues().getCount(), - destinationStatistics.getDequeues().getCount() - }); - if (isLazyDispatch() && !force) { - // Only page in the minimum number of messages which can be - // dispatched immediately. - toPageIn = Math.min(getConsumerMessageCountBeforeFull(), toPageIn); - } - int pagedInPendingSize = 0; - pagedInPendingDispatchLock.readLock().lock(); - try { - pagedInPendingSize = pagedInPendingDispatch.size(); - } finally { - pagedInPendingDispatchLock.readLock().unlock(); - } - if (toPageIn > 0 && (force || (!consumers.isEmpty() && pagedInPendingSize < getMaxPageSize()))) { - int count = 0; - result = new ArrayList(toPageIn); - messagesLock.writeLock().lock(); - try { - try { - messages.setMaxBatchSize(toPageIn); - messages.reset(); - while (messages.hasNext() && count < toPageIn) { - MessageReference node = messages.next(); - messages.remove(); - - QueueMessageReference ref = createMessageReference(node.getMessage()); - if (processExpired && ref.isExpired()) { - if (broker.isExpired(ref)) { - messageExpired(createConnectionContext(), ref); - } else { - ref.decrementReferenceCount(); - } - } else { - result.add(ref); - count++; - } - } - } finally { - messages.release(); - } - } finally { - messagesLock.writeLock().unlock(); - } - // Only add new messages, not already pagedIn to avoid multiple - // dispatch attempts - pagedInMessagesLock.writeLock().lock(); - try { - if(isPrioritizedMessages()) { - resultList = new PrioritizedPendingList(); - } else { - resultList = new OrderedPendingList(); - } - for (QueueMessageReference ref : result) { - if (!pagedInMessages.containsKey(ref.getMessageId())) { - pagedInMessages.put(ref.getMessageId(), ref); - resultList.addMessageLast(ref); - } else { - ref.decrementReferenceCount(); - } - } - } finally { - pagedInMessagesLock.writeLock().unlock(); - } - } else { - // Avoid return null list, if condition is not validated - resultList = new OrderedPendingList(); - } - - return resultList; - } - - private void doDispatch(PendingList list) throws Exception { - boolean doWakeUp = false; - - pagedInPendingDispatchLock.writeLock().lock(); - try { - if (!redeliveredWaitingDispatch.isEmpty()) { - // Try first to dispatch redelivered messages to keep an - // proper order - redeliveredWaitingDispatch = doActualDispatch(redeliveredWaitingDispatch); - } - if (!pagedInPendingDispatch.isEmpty()) { - // Next dispatch anything that had not been - // dispatched before. - pagedInPendingDispatch = doActualDispatch(pagedInPendingDispatch); - } - // and now see if we can dispatch the new stuff.. and append to - // the pending - // list anything that does not actually get dispatched. - if (list != null && !list.isEmpty()) { - if (pagedInPendingDispatch.isEmpty()) { - pagedInPendingDispatch.addAll(doActualDispatch(list)); - } else { - for (MessageReference qmr : list) { - if (!pagedInPendingDispatch.contains(qmr)) { - pagedInPendingDispatch.addMessageLast(qmr); - } - } - doWakeUp = true; - } - } - } finally { - pagedInPendingDispatchLock.writeLock().unlock(); - } - - if (doWakeUp) { - // avoid lock order contention - asyncWakeup(); - } - } - - /** - * @return list of messages that could get dispatched to consumers if they - * were not full. - */ - private PendingList doActualDispatch(PendingList list) throws Exception { - List consumers; - consumersLock.writeLock().lock(); - - try { - if (this.consumers.isEmpty()) { - // slave dispatch happens in processDispatchNotification - return list; - } - consumers = new ArrayList(this.consumers); - } finally { - consumersLock.writeLock().unlock(); - } - - Set fullConsumers = new HashSet(this.consumers.size()); - - for (Iterator iterator = list.iterator(); iterator.hasNext();) { - - MessageReference node = iterator.next(); - Subscription target = null; - for (Subscription s : consumers) { - if (s instanceof QueueBrowserSubscription) { - continue; - } - if (!fullConsumers.contains(s)) { - if (!s.isFull()) { - if (dispatchSelector.canSelect(s, node) && assignMessageGroup(s, (QueueMessageReference)node) && !((QueueMessageReference) node).isAcked() ) { - // Dispatch it. - s.add(node); - iterator.remove(); - target = s; - break; - } - } else { - // no further dispatch of list to a full consumer to - // avoid out of order message receipt - fullConsumers.add(s); - LOG.trace("Subscription full {}", s); - } - } - } - - if (target == null && node.isDropped()) { - iterator.remove(); - } - - // return if there are no consumers or all consumers are full - if (target == null && consumers.size() == fullConsumers.size()) { - return list; - } - - // If it got dispatched, rotate the consumer list to get round robin - // distribution. - if (target != null && !strictOrderDispatch && consumers.size() > 1 - && !dispatchSelector.isExclusiveConsumer(target)) { - consumersLock.writeLock().lock(); - try { - if (removeFromConsumerList(target)) { - addToConsumerList(target); - consumers = new ArrayList(this.consumers); - } - } finally { - consumersLock.writeLock().unlock(); - } - } - } - - return list; - } - - protected boolean assignMessageGroup(Subscription subscription, QueueMessageReference node) throws Exception { - boolean result = true; - // Keep message groups together. - String groupId = node.getGroupID(); - int sequence = node.getGroupSequence(); - if (groupId != null) { - - MessageGroupMap messageGroupOwners = getMessageGroupOwners(); - // If we can own the first, then no-one else should own the - // rest. - if (sequence == 1) { - assignGroup(subscription, messageGroupOwners, node, groupId); - } else { - - // Make sure that the previous owner is still valid, we may - // need to become the new owner. - ConsumerId groupOwner; - - groupOwner = messageGroupOwners.get(groupId); - if (groupOwner == null) { - assignGroup(subscription, messageGroupOwners, node, groupId); - } else { - if (groupOwner.equals(subscription.getConsumerInfo().getConsumerId())) { - // A group sequence < 1 is an end of group signal. - if (sequence < 0) { - messageGroupOwners.removeGroup(groupId); - subscription.getConsumerInfo().setLastDeliveredSequenceId(subscription.getConsumerInfo().getLastDeliveredSequenceId() - 1); - } - } else { - result = false; - } - } - } - } - - return result; - } - - protected void assignGroup(Subscription subs, MessageGroupMap messageGroupOwners, MessageReference n, String groupId) throws IOException { - messageGroupOwners.put(groupId, subs.getConsumerInfo().getConsumerId()); - Message message = n.getMessage(); - message.setJMSXGroupFirstForConsumer(true); - subs.getConsumerInfo().setLastDeliveredSequenceId(subs.getConsumerInfo().getLastDeliveredSequenceId() + 1); - } - - protected void pageInMessages(boolean force) throws Exception { - doDispatch(doPageInForDispatch(force, true)); - } - - private void addToConsumerList(Subscription sub) { - if (useConsumerPriority) { - consumers.add(sub); - Collections.sort(consumers, orderedCompare); - } else { - consumers.add(sub); - } - } - - private boolean removeFromConsumerList(Subscription sub) { - return consumers.remove(sub); - } - - private int getConsumerMessageCountBeforeFull() throws Exception { - int total = 0; - boolean zeroPrefetch = false; - consumersLock.readLock().lock(); - try { - for (Subscription s : consumers) { - zeroPrefetch |= s.getPrefetchSize() == 0; - int countBeforeFull = s.countBeforeFull(); - total += countBeforeFull; - } - } finally { - consumersLock.readLock().unlock(); - } - if (total == 0 && zeroPrefetch) { - total = 1; - } - return total; - } - - /* - * In slave mode, dispatch is ignored till we get this notification as the - * dispatch process is non deterministic between master and slave. On a - * notification, the actual dispatch to the subscription (as chosen by the - * master) is completed. (non-Javadoc) - * @see - * org.apache.activemq.broker.region.BaseDestination#processDispatchNotification - * (org.apache.activemq.command.MessageDispatchNotification) - */ - @Override - public void processDispatchNotification(MessageDispatchNotification messageDispatchNotification) throws Exception { - // do dispatch - Subscription sub = getMatchingSubscription(messageDispatchNotification); - if (sub != null) { - MessageReference message = getMatchingMessage(messageDispatchNotification); - sub.add(message); - sub.processMessageDispatchNotification(messageDispatchNotification); - } - } - - private QueueMessageReference getMatchingMessage(MessageDispatchNotification messageDispatchNotification) - throws Exception { - QueueMessageReference message = null; - MessageId messageId = messageDispatchNotification.getMessageId(); - - pagedInPendingDispatchLock.writeLock().lock(); - try { - for (MessageReference ref : pagedInPendingDispatch) { - if (messageId.equals(ref.getMessageId())) { - message = (QueueMessageReference)ref; - pagedInPendingDispatch.remove(ref); - break; - } - } - } finally { - pagedInPendingDispatchLock.writeLock().unlock(); - } - - if (message == null) { - pagedInMessagesLock.readLock().lock(); - try { - message = pagedInMessages.get(messageId); - } finally { - pagedInMessagesLock.readLock().unlock(); - } - } - - if (message == null) { - messagesLock.writeLock().lock(); - try { - try { - messages.setMaxBatchSize(getMaxPageSize()); - messages.reset(); - while (messages.hasNext()) { - MessageReference node = messages.next(); - messages.remove(); - if (messageId.equals(node.getMessageId())) { - message = this.createMessageReference(node.getMessage()); - break; - } - } - } finally { - messages.release(); - } - } finally { - messagesLock.writeLock().unlock(); - } - } - - if (message == null) { - Message msg = loadMessage(messageId); - if (msg != null) { - message = this.createMessageReference(msg); - } - } - - if (message == null) { - throw new JMSException("Slave broker out of sync with master - Message: " - + messageDispatchNotification.getMessageId() + " on " - + messageDispatchNotification.getDestination() + " does not exist among pending(" - + pagedInPendingDispatch.size() + ") for subscription: " - + messageDispatchNotification.getConsumerId()); - } - return message; - } - - /** - * Find a consumer that matches the id in the message dispatch notification - * - * @param messageDispatchNotification - * @return sub or null if the subscription has been removed before dispatch - * @throws JMSException - */ - private Subscription getMatchingSubscription(MessageDispatchNotification messageDispatchNotification) - throws JMSException { - Subscription sub = null; - consumersLock.readLock().lock(); - try { - for (Subscription s : consumers) { - if (messageDispatchNotification.getConsumerId().equals(s.getConsumerInfo().getConsumerId())) { - sub = s; - break; - } - } - } finally { - consumersLock.readLock().unlock(); - } - return sub; - } - - @Override - public void onUsageChanged(@SuppressWarnings("rawtypes") Usage usage, int oldPercentUsage, int newPercentUsage) { - if (oldPercentUsage > newPercentUsage) { - asyncWakeup(); - } - } - - @Override - protected Logger getLog() { - return LOG; - } - - protected boolean isOptimizeStorage(){ - boolean result = false; - if (isDoOptimzeMessageStorage()){ - consumersLock.readLock().lock(); - try{ - if (consumers.isEmpty()==false){ - result = true; - for (Subscription s : consumers) { - if (s.getPrefetchSize()==0){ - result = false; - break; - } - if (s.isSlowConsumer()){ - result = false; - break; - } - if (s.getInFlightUsage() > getOptimizeMessageStoreInFlightLimit()){ - result = false; - break; - } - } - } - } finally { - consumersLock.readLock().unlock(); - } - } - return result; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/QueueBrowserSubscription.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/QueueBrowserSubscription.class deleted file mode 100644 index d1efbb47b..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/QueueBrowserSubscription.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/QueueBrowserSubscription.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/QueueBrowserSubscription.java deleted file mode 100644 index 9bc3c1d10..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/QueueBrowserSubscription.java +++ /dev/null @@ -1,118 +0,0 @@ -/** - * 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.broker.region; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.jms.JMSException; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.command.MessageAck; -import org.apache.activemq.command.MessageId; -import org.apache.activemq.filter.MessageEvaluationContext; -import org.apache.activemq.usage.SystemUsage; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class QueueBrowserSubscription extends QueueSubscription { - - protected static final Logger LOG = LoggerFactory.getLogger(QueueBrowserSubscription.class); - - int queueRefs; - boolean browseDone; - boolean destinationsAdded; - - private final Map audit = new HashMap(); - - public QueueBrowserSubscription(Broker broker, SystemUsage usageManager, ConnectionContext context, ConsumerInfo info) throws JMSException { - super(broker, usageManager, context, info); - } - - @Override - protected boolean canDispatch(MessageReference node) { - return !((QueueMessageReference) node).isAcked(); - } - - @Override - public synchronized String toString() { - return "QueueBrowserSubscription:" + " consumer=" + info.getConsumerId() + - ", destinations=" + destinations.size() + ", dispatched=" + dispatched.size() + - ", delivered=" + this.prefetchExtension + ", pending=" + getPendingQueueSize(); - } - - synchronized public void destinationsAdded() throws Exception { - destinationsAdded = true; - checkDone(); - } - - public boolean isDuplicate(MessageId messageId) { - - if (!audit.containsKey(messageId)) { - audit.put(messageId, Boolean.TRUE); - return false; - } - - return true; - } - - private void checkDone() throws Exception { - if (!browseDone && queueRefs == 0 && destinationsAdded) { - browseDone = true; - add(QueueMessageReference.NULL_MESSAGE); - } - } - - @Override - public boolean matches(MessageReference node, MessageEvaluationContext context) throws IOException { - return !browseDone && super.matches(node, context); - } - - /** - * Since we are a browser we don't really remove the message from the queue. - */ - @Override - protected void acknowledge(ConnectionContext context, final MessageAck ack, final MessageReference n) throws IOException { - if (info.isNetworkSubscription()) { - super.acknowledge(context, ack, n); - } - } - - synchronized public void incrementQueueRef() { - queueRefs++; - } - - synchronized public void decrementQueueRef() throws Exception { - if (queueRefs > 0) { - queueRefs--; - } - checkDone(); - } - - @Override - public List remove(ConnectionContext context, Destination destination) throws Exception { - super.remove(context, destination); - // there's no unacked messages that needs to be redelivered - // in case of browser - return new ArrayList(); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/QueueDispatchSelector.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/QueueDispatchSelector.class deleted file mode 100644 index 940aef9bb..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/QueueDispatchSelector.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/QueueDispatchSelector.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/QueueDispatchSelector.java deleted file mode 100644 index c73d9601e..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/QueueDispatchSelector.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * 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.broker.region; - -import org.apache.activemq.broker.region.policy.SimpleDispatchSelector; -import org.apache.activemq.command.ActiveMQDestination; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Queue dispatch policy that determines if a message can be sent to a subscription - * - * @org.apache.xbean.XBean - * - */ -public class QueueDispatchSelector extends SimpleDispatchSelector { - private static final Logger LOG = LoggerFactory.getLogger(QueueDispatchSelector.class); - private Subscription exclusiveConsumer; - - - /** - * @param destination - */ - public QueueDispatchSelector(ActiveMQDestination destination) { - super(destination); - } - - public Subscription getExclusiveConsumer() { - return exclusiveConsumer; - } - public void setExclusiveConsumer(Subscription exclusiveConsumer) { - this.exclusiveConsumer = exclusiveConsumer; - } - - public boolean isExclusiveConsumer(Subscription s) { - return s == this.exclusiveConsumer; - } - - - public boolean canSelect(Subscription subscription, - MessageReference m) throws Exception { - - boolean result = super.canDispatch(subscription, m); - if (result && !subscription.isBrowser()) { - result = exclusiveConsumer == null || exclusiveConsumer == subscription; - } - return result; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/QueueMessageReference.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/QueueMessageReference.class deleted file mode 100644 index e1cab79b9..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/QueueMessageReference.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/QueueMessageReference.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/QueueMessageReference.java deleted file mode 100644 index 21d43e493..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/QueueMessageReference.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * 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.broker.region; - -/** - * Queue specific MessageReference. - * - * @author fateev@amazon.com - * - */ -public interface QueueMessageReference extends MessageReference { - - QueueMessageReference NULL_MESSAGE = new NullMessageReference(); - - boolean isAcked(); - - void setAcked(boolean b); - - void drop(); - - boolean isDropped(); - - boolean lock(LockOwner subscription); - - boolean unlock(); - - LockOwner getLockOwner(); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/QueueRegion.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/QueueRegion.class deleted file mode 100644 index 1470d8734..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/QueueRegion.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/QueueRegion.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/QueueRegion.java deleted file mode 100644 index 05aa6333d..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/QueueRegion.java +++ /dev/null @@ -1,93 +0,0 @@ -/** - * 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.broker.region; - -import java.util.Iterator; -import java.util.Set; - -import javax.jms.JMSException; - -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.region.policy.PolicyEntry; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.command.MessageDispatchNotification; -import org.apache.activemq.thread.TaskRunnerFactory; -import org.apache.activemq.usage.SystemUsage; - -/** - * - * - */ -public class QueueRegion extends AbstractRegion { - - public QueueRegion(RegionBroker broker, DestinationStatistics destinationStatistics, - SystemUsage memoryManager, TaskRunnerFactory taskRunnerFactory, - DestinationFactory destinationFactory) { - super(broker, destinationStatistics, memoryManager, taskRunnerFactory, destinationFactory); - } - - public String toString() { - return "QueueRegion: destinations=" + destinations.size() + ", subscriptions=" + subscriptions.size() - + ", memory=" + usageManager.getMemoryUsage().getPercentUsage() + "%"; - } - - protected Subscription createSubscription(ConnectionContext context, ConsumerInfo info) - throws JMSException { - ActiveMQDestination destination = info.getDestination(); - PolicyEntry entry = null; - if (destination != null && broker.getDestinationPolicy() != null) { - entry = broker.getDestinationPolicy().getEntryFor(destination); - - } - if (info.isBrowser()) { - QueueBrowserSubscription sub = new QueueBrowserSubscription(broker,usageManager, context, info); - if (entry != null) { - entry.configure(broker, usageManager, sub); - } - return sub; - } else { - QueueSubscription sub = new QueueSubscription(broker, usageManager,context, info); - if (entry != null) { - entry.configure(broker, usageManager, sub); - } - return sub; - } - } - - protected Set getInactiveDestinations() { - Set inactiveDestinations = super.getInactiveDestinations(); - for (Iterator iter = inactiveDestinations.iterator(); iter.hasNext();) { - ActiveMQDestination dest = iter.next(); - if (!dest.isQueue()) { - iter.remove(); - } - } - return inactiveDestinations; - } - - /* - * For a Queue, dispatch order is imperative to match acks, so the dispatch is deferred till - * the notification to ensure that the subscription chosen by the master is used. - * - * (non-Javadoc) - * @see org.apache.activemq.broker.region.AbstractRegion#processDispatchNotification(org.apache.activemq.command.MessageDispatchNotification) - */ - public void processDispatchNotification(MessageDispatchNotification messageDispatchNotification) throws Exception { - processDispatchNotificationViaDestination(messageDispatchNotification); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/QueueSubscription.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/QueueSubscription.class deleted file mode 100644 index 4c867981f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/QueueSubscription.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/QueueSubscription.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/QueueSubscription.java deleted file mode 100644 index 7c7027fed..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/QueueSubscription.java +++ /dev/null @@ -1,111 +0,0 @@ -/** - * 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.broker.region; - -import java.io.IOException; - -import javax.jms.JMSException; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.region.group.MessageGroupMap; -import org.apache.activemq.command.ActiveMQMessage; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.command.Message; -import org.apache.activemq.command.MessageAck; -import org.apache.activemq.usage.SystemUsage; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class QueueSubscription extends PrefetchSubscription implements LockOwner { - - private static final Logger LOG = LoggerFactory.getLogger(QueueSubscription.class); - - public QueueSubscription(Broker broker, SystemUsage usageManager, ConnectionContext context, ConsumerInfo info) throws JMSException { - super(broker,usageManager, context, info); - } - - /** - * In the queue case, mark the node as dropped and then a gc cycle will - * remove it from the queue. - * - * @throws IOException - */ - @Override - protected void acknowledge(final ConnectionContext context, final MessageAck ack, final MessageReference n) throws IOException { - this.setTimeOfLastMessageAck(System.currentTimeMillis()); - - final Destination q = (Destination) n.getRegionDestination(); - final QueueMessageReference node = (QueueMessageReference)n; - final Queue queue = (Queue)q; - - if (n.isExpired()) { - // sync with message expiry processing - if (!broker.isExpired(n)) { - LOG.debug("ignoring ack {}, for already expired message: {}", ack, n); - return; - } - } - queue.removeMessage(context, this, node, ack); - } - - @Override - protected boolean canDispatch(MessageReference n) throws IOException { - boolean result = true; - QueueMessageReference node = (QueueMessageReference)n; - if (node.isAcked() || node.isDropped()) { - result = false; - } - result = result && (isBrowser() || node.lock(this)); - return result; - } - - @Override - public synchronized String toString() { - return "QueueSubscription:" + " consumer=" + info.getConsumerId() + ", destinations=" + destinations.size() + ", dispatched=" + dispatched.size() + ", delivered=" - + this.prefetchExtension + ", pending=" + getPendingQueueSize(); - } - - @Override - public int getLockPriority() { - return info.getPriority(); - } - - @Override - public boolean isLockExclusive() { - return info.isExclusive(); - } - - /** - */ - @Override - public void destroy() { - setSlowConsumer(false); - } - - - @Override - protected boolean isDropped(MessageReference node) { - boolean result = false; - if(node instanceof IndirectMessageReference) { - QueueMessageReference qmr = (QueueMessageReference) node; - result = qmr.isDropped(); - } - return result; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Region.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Region.class deleted file mode 100644 index 24b6b13dc..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Region.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Region.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Region.java deleted file mode 100644 index ab9d1ebd4..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Region.java +++ /dev/null @@ -1,153 +0,0 @@ -/** - * 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.broker.region; - -import java.util.Map; -import java.util.Set; -import org.apache.activemq.Service; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.ConsumerBrokerExchange; -import org.apache.activemq.broker.ProducerBrokerExchange; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ConsumerControl; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.command.Message; -import org.apache.activemq.command.MessageAck; -import org.apache.activemq.command.MessageDispatchNotification; -import org.apache.activemq.command.MessagePull; -import org.apache.activemq.command.ProducerInfo; -import org.apache.activemq.command.RemoveSubscriptionInfo; -import org.apache.activemq.command.Response; - -/** - * A Region is used to implement the different QOS options available to - * a broker. A Broker is composed of multiple message processing Regions that - * provide different QOS options. - * - * - */ -public interface Region extends Service { - - /** - * Used to create a destination. Usually, this method is invoked as a side-effect of sending - * a message to a destination that does not exist yet. - * - * @param context - * @param destination the destination to create. - * @param createIfTemporary - * @return TODO - * @throws Exception TODO - */ - Destination addDestination(ConnectionContext context, ActiveMQDestination destination, boolean createIfTemporary) throws Exception; - - /** - * Used to destroy a destination. - * This should try to quiesce use of the destination up to the timeout allotted time before removing the destination. - * This will remove all persistent messages associated with the destination. - * - * @param context the environment the operation is being executed under. - * @param destination what is being removed from the broker. - * @param timeout the max amount of time to wait for the destination to quiesce - * @throws Exception TODO - */ - void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout) throws Exception; - - /** - * Returns a reference to the concurrent hash map that holds known destinations, do not modify - */ - Map getDestinationMap(); - - - /** - * Adds a consumer. - * @param context the environment the operation is being executed under. - * @return TODO - * @throws Exception TODO - */ - Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception; - - /** - * Removes a consumer. - * @param context the environment the operation is being executed under. - * @throws Exception TODO - */ - void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception; - - /** - * Adds a Producer. - * @param context the environment the operation is being executed under. - * @throws Exception TODO - */ - void addProducer(ConnectionContext context, ProducerInfo info) throws Exception; - - /** - * Removes a Producer. - * @param context the environment the operation is being executed under. - * @throws Exception TODO - */ - void removeProducer(ConnectionContext context, ProducerInfo info) throws Exception; - - - /** - * Deletes a durable subscription. - * @param context the environment the operation is being executed under. - * @param info TODO - * @throws Exception TODO - */ - void removeSubscription(ConnectionContext context, RemoveSubscriptionInfo info) throws Exception; - - /** - * Send a message to the broker to using the specified destination. The destination specified - * in the message does not need to match the destination the message is sent to. This is - * handy in case the message is being sent to a dead letter destination. - * @param producerExchange the environment the operation is being executed under. - * @param message - * @throws Exception TODO - */ - void send(ProducerBrokerExchange producerExchange, Message message) throws Exception; - - /** - * Used to acknowledge the receipt of a message by a client. - * @param consumerExchange the environment the operation is being executed under. - * @throws Exception TODO - */ - void acknowledge(ConsumerBrokerExchange consumerExchange, MessageAck ack) throws Exception; - - /** - * Allows a consumer to pull a message from a queue - */ - Response messagePull(ConnectionContext context, MessagePull pull) throws Exception; - - /** - * Process a notification of a dispatch - used by a Slave Broker - * @param messageDispatchNotification - * @throws Exception TODO - */ - void processDispatchNotification(MessageDispatchNotification messageDispatchNotification) throws Exception; - - void gc(); - - /** - * Provide an exact or wildcard lookup of destinations in the region - * - * @return a set of matching destination objects. - */ - Set getDestinations(ActiveMQDestination destination); - - void processConsumerControl(ConsumerBrokerExchange consumerExchange, ConsumerControl control); - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/RegionBroker$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/RegionBroker$1.class deleted file mode 100644 index fdd5cd621..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/RegionBroker$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/RegionBroker.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/RegionBroker.class deleted file mode 100644 index 840d13429..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/RegionBroker.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/RegionBroker.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/RegionBroker.java deleted file mode 100644 index 108670a5f..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/RegionBroker.java +++ /dev/null @@ -1,863 +0,0 @@ -/** - * 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.broker.region; - -import java.io.IOException; -import java.net.URI; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.CopyOnWriteArrayList; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.locks.ReentrantReadWriteLock; - -import javax.jms.InvalidClientIDException; -import javax.jms.JMSException; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.BrokerService; -import org.apache.activemq.broker.Connection; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.ConsumerBrokerExchange; -import org.apache.activemq.broker.EmptyBroker; -import org.apache.activemq.broker.ProducerBrokerExchange; -import org.apache.activemq.broker.TransportConnector; -import org.apache.activemq.broker.region.policy.DeadLetterStrategy; -import org.apache.activemq.broker.region.policy.PolicyMap; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ActiveMQMessage; -import org.apache.activemq.command.BrokerId; -import org.apache.activemq.command.BrokerInfo; -import org.apache.activemq.command.ConnectionId; -import org.apache.activemq.command.ConnectionInfo; -import org.apache.activemq.command.ConsumerControl; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.command.DestinationInfo; -import org.apache.activemq.command.Message; -import org.apache.activemq.command.MessageAck; -import org.apache.activemq.command.MessageDispatch; -import org.apache.activemq.command.MessageDispatchNotification; -import org.apache.activemq.command.MessagePull; -import org.apache.activemq.command.ProducerInfo; -import org.apache.activemq.command.RemoveSubscriptionInfo; -import org.apache.activemq.command.Response; -import org.apache.activemq.command.TransactionId; -import org.apache.activemq.state.ConnectionState; -import org.apache.activemq.store.PListStore; -import org.apache.activemq.thread.Scheduler; -import org.apache.activemq.thread.TaskRunnerFactory; -import org.apache.activemq.usage.SystemUsage; -import org.apache.activemq.util.BrokerSupport; -import org.apache.activemq.util.IdGenerator; -import org.apache.activemq.util.InetAddressUtil; -import org.apache.activemq.util.LongSequenceGenerator; -import org.apache.activemq.util.ServiceStopper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Routes Broker operations to the correct messaging regions for processing. - */ -public class RegionBroker extends EmptyBroker { - public static final String ORIGINAL_EXPIRATION = "originalExpiration"; - private static final Logger LOG = LoggerFactory.getLogger(RegionBroker.class); - private static final IdGenerator BROKER_ID_GENERATOR = new IdGenerator(); - - protected final DestinationStatistics destinationStatistics = new DestinationStatistics(); - protected DestinationFactory destinationFactory; - protected final Map connectionStates = Collections.synchronizedMap(new HashMap()); - - private final Region queueRegion; - private final Region topicRegion; - private final Region tempQueueRegion; - private final Region tempTopicRegion; - protected final BrokerService brokerService; - private boolean started; - private boolean keepDurableSubsActive; - - private final CopyOnWriteArrayList connections = new CopyOnWriteArrayList(); - private final Map destinationGate = new HashMap(); - private final Map destinations = new ConcurrentHashMap(); - private final Map brokerInfos = new HashMap(); - - private final LongSequenceGenerator sequenceGenerator = new LongSequenceGenerator(); - private BrokerId brokerId; - private String brokerName; - private final Map clientIdSet = new HashMap(); - private final DestinationInterceptor destinationInterceptor; - private ConnectionContext adminConnectionContext; - private final Scheduler scheduler; - private final ThreadPoolExecutor executor; - private boolean allowTempAutoCreationOnSend; - - private final ReentrantReadWriteLock inactiveDestinationsPurgeLock = new ReentrantReadWriteLock(); - private final Runnable purgeInactiveDestinationsTask = new Runnable() { - @Override - public void run() { - purgeInactiveDestinations(); - } - }; - - public RegionBroker(BrokerService brokerService, TaskRunnerFactory taskRunnerFactory, SystemUsage memoryManager, DestinationFactory destinationFactory, - DestinationInterceptor destinationInterceptor, Scheduler scheduler, ThreadPoolExecutor executor) throws IOException { - this.brokerService = brokerService; - this.executor = executor; - this.scheduler = scheduler; - if (destinationFactory == null) { - throw new IllegalArgumentException("null destinationFactory"); - } - this.sequenceGenerator.setLastSequenceId(destinationFactory.getLastMessageBrokerSequenceId()); - this.destinationFactory = destinationFactory; - queueRegion = createQueueRegion(memoryManager, taskRunnerFactory, destinationFactory); - topicRegion = createTopicRegion(memoryManager, taskRunnerFactory, destinationFactory); - this.destinationInterceptor = destinationInterceptor; - tempQueueRegion = createTempQueueRegion(memoryManager, taskRunnerFactory, destinationFactory); - tempTopicRegion = createTempTopicRegion(memoryManager, taskRunnerFactory, destinationFactory); - } - - @Override - public Map getDestinationMap() { - Map answer = new HashMap(getQueueRegion().getDestinationMap()); - answer.putAll(getTopicRegion().getDestinationMap()); - return answer; - } - - @Override - public Set getDestinations(ActiveMQDestination destination) { - try { - return getRegion(destination).getDestinations(destination); - } catch (JMSException jmse) { - return Collections.emptySet(); - } - } - - @Override - @SuppressWarnings("rawtypes") - public Broker getAdaptor(Class type) { - if (type.isInstance(this)) { - return this; - } - return null; - } - - public Region getQueueRegion() { - return queueRegion; - } - - public Region getTempQueueRegion() { - return tempQueueRegion; - } - - public Region getTempTopicRegion() { - return tempTopicRegion; - } - - public Region getTopicRegion() { - return topicRegion; - } - - protected Region createTempTopicRegion(SystemUsage memoryManager, TaskRunnerFactory taskRunnerFactory, DestinationFactory destinationFactory) { - return new TempTopicRegion(this, destinationStatistics, memoryManager, taskRunnerFactory, destinationFactory); - } - - protected Region createTempQueueRegion(SystemUsage memoryManager, TaskRunnerFactory taskRunnerFactory, DestinationFactory destinationFactory) { - return new TempQueueRegion(this, destinationStatistics, memoryManager, taskRunnerFactory, destinationFactory); - } - - protected Region createTopicRegion(SystemUsage memoryManager, TaskRunnerFactory taskRunnerFactory, DestinationFactory destinationFactory) { - return new TopicRegion(this, destinationStatistics, memoryManager, taskRunnerFactory, destinationFactory); - } - - protected Region createQueueRegion(SystemUsage memoryManager, TaskRunnerFactory taskRunnerFactory, DestinationFactory destinationFactory) { - return new QueueRegion(this, destinationStatistics, memoryManager, taskRunnerFactory, destinationFactory); - } - - @Override - public void start() throws Exception { - started = true; - queueRegion.start(); - topicRegion.start(); - tempQueueRegion.start(); - tempTopicRegion.start(); - int period = this.brokerService.getSchedulePeriodForDestinationPurge(); - if (period > 0) { - this.scheduler.executePeriodically(purgeInactiveDestinationsTask, period); - } - } - - @Override - public void stop() throws Exception { - started = false; - this.scheduler.cancel(purgeInactiveDestinationsTask); - ServiceStopper ss = new ServiceStopper(); - doStop(ss); - ss.throwFirstException(); - // clear the state - clientIdSet.clear(); - connections.clear(); - destinations.clear(); - brokerInfos.clear(); - } - - public PolicyMap getDestinationPolicy() { - return brokerService != null ? brokerService.getDestinationPolicy() : null; - } - - @Override - public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception { - String clientId = info.getClientId(); - if (clientId == null) { - throw new InvalidClientIDException("No clientID specified for connection request"); - } - synchronized (clientIdSet) { - ConnectionContext oldContext = clientIdSet.get(clientId); - if (oldContext != null) { - if (context.isAllowLinkStealing()){ - clientIdSet.remove(clientId); - if (oldContext.getConnection() != null) { - LOG.warn("Stealing link for clientId {} From Connection {}", clientId, oldContext.getConnection()); - oldContext.getConnection().stop(); - }else{ - LOG.error("Not Connection for {}", oldContext); - } - }else{ - throw new InvalidClientIDException("Broker: " + getBrokerName() + " - Client: " + clientId + " already connected from " - + oldContext.getConnection().getRemoteAddress()); - } - } else { - clientIdSet.put(clientId, context); - } - } - - connections.add(context.getConnection()); - } - - @Override - public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception { - String clientId = info.getClientId(); - if (clientId == null) { - throw new InvalidClientIDException("No clientID specified for connection disconnect request"); - } - synchronized (clientIdSet) { - ConnectionContext oldValue = clientIdSet.get(clientId); - // we may be removing the duplicate connection, not the first - // connection to be created - // so lets check that their connection IDs are the same - if (oldValue == context) { - if (isEqual(oldValue.getConnectionId(), info.getConnectionId())) { - clientIdSet.remove(clientId); - } - } - } - connections.remove(context.getConnection()); - } - - protected boolean isEqual(ConnectionId connectionId, ConnectionId connectionId2) { - return connectionId == connectionId2 || (connectionId != null && connectionId.equals(connectionId2)); - } - - @Override - public Connection[] getClients() throws Exception { - ArrayList l = new ArrayList(connections); - Connection rc[] = new Connection[l.size()]; - l.toArray(rc); - return rc; - } - - @Override - public Destination addDestination(ConnectionContext context, ActiveMQDestination destination, boolean createIfTemp) throws Exception { - - Destination answer; - - answer = destinations.get(destination); - if (answer != null) { - return answer; - } - - synchronized (destinationGate) { - answer = destinations.get(destination); - if (answer != null) { - return answer; - } - - if (destinationGate.get(destination) != null) { - // Guard against spurious wakeup. - while (destinationGate.containsKey(destination)) { - destinationGate.wait(); - } - answer = destinations.get(destination); - if (answer != null) { - return answer; - } else { - // In case of intermediate remove or add failure - destinationGate.put(destination, destination); - } - } - } - - try { - boolean create = true; - if (destination.isTemporary()) { - create = createIfTemp; - } - answer = getRegion(destination).addDestination(context, destination, create); - destinations.put(destination, answer); - } finally { - synchronized (destinationGate) { - destinationGate.remove(destination); - destinationGate.notifyAll(); - } - } - - return answer; - } - - @Override - public void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout) throws Exception { - if (destinations.containsKey(destination)) { - getRegion(destination).removeDestination(context, destination, timeout); - destinations.remove(destination); - } - } - - @Override - public void addDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception { - addDestination(context, info.getDestination(), true); - - } - - @Override - public void removeDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception { - removeDestination(context, info.getDestination(), info.getTimeout()); - } - - @Override - public ActiveMQDestination[] getDestinations() throws Exception { - ArrayList l; - - l = new ArrayList(getDestinationMap().keySet()); - - ActiveMQDestination rc[] = new ActiveMQDestination[l.size()]; - l.toArray(rc); - return rc; - } - - @Override - public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception { - ActiveMQDestination destination = info.getDestination(); - if (destination != null) { - inactiveDestinationsPurgeLock.readLock().lock(); - try { - // This seems to cause the destination to be added but without - // advisories firing... - context.getBroker().addDestination(context, destination, isAllowTempAutoCreationOnSend()); - getRegion(destination).addProducer(context, info); - } finally { - inactiveDestinationsPurgeLock.readLock().unlock(); - } - } - } - - @Override - public void removeProducer(ConnectionContext context, ProducerInfo info) throws Exception { - ActiveMQDestination destination = info.getDestination(); - if (destination != null) { - inactiveDestinationsPurgeLock.readLock().lock(); - try { - getRegion(destination).removeProducer(context, info); - } finally { - inactiveDestinationsPurgeLock.readLock().unlock(); - } - } - } - - @Override - public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { - ActiveMQDestination destination = info.getDestination(); - if (destinationInterceptor != null) { - destinationInterceptor.create(this, context, destination); - } - inactiveDestinationsPurgeLock.readLock().lock(); - try { - return getRegion(destination).addConsumer(context, info); - } finally { - inactiveDestinationsPurgeLock.readLock().unlock(); - } - } - - @Override - public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { - ActiveMQDestination destination = info.getDestination(); - inactiveDestinationsPurgeLock.readLock().lock(); - try { - getRegion(destination).removeConsumer(context, info); - } finally { - inactiveDestinationsPurgeLock.readLock().unlock(); - } - } - - @Override - public void removeSubscription(ConnectionContext context, RemoveSubscriptionInfo info) throws Exception { - inactiveDestinationsPurgeLock.readLock().lock(); - try { - topicRegion.removeSubscription(context, info); - } finally { - inactiveDestinationsPurgeLock.readLock().unlock(); - - } - } - - @Override - public void send(ProducerBrokerExchange producerExchange, Message message) throws Exception { - ActiveMQDestination destination = message.getDestination(); - message.setBrokerInTime(System.currentTimeMillis()); - if (producerExchange.isMutable() || producerExchange.getRegion() == null - || (producerExchange.getRegionDestination() != null && producerExchange.getRegionDestination().isDisposed())) { - // ensure the destination is registered with the RegionBroker - producerExchange.getConnectionContext().getBroker() - .addDestination(producerExchange.getConnectionContext(), destination, isAllowTempAutoCreationOnSend()); - producerExchange.setRegion(getRegion(destination)); - producerExchange.setRegionDestination(null); - } - - producerExchange.getRegion().send(producerExchange, message); - - // clean up so these references aren't kept (possible leak) in the producer exchange - // especially since temps are transitory - if (producerExchange.isMutable()) { - producerExchange.setRegionDestination(null); - producerExchange.setRegion(null); - } - } - - @Override - public void acknowledge(ConsumerBrokerExchange consumerExchange, MessageAck ack) throws Exception { - if (consumerExchange.isWildcard() || consumerExchange.getRegion() == null) { - ActiveMQDestination destination = ack.getDestination(); - consumerExchange.setRegion(getRegion(destination)); - } - consumerExchange.getRegion().acknowledge(consumerExchange, ack); - } - - protected Region getRegion(ActiveMQDestination destination) throws JMSException { - switch (destination.getDestinationType()) { - case ActiveMQDestination.QUEUE_TYPE: - return queueRegion; - case ActiveMQDestination.TOPIC_TYPE: - return topicRegion; - case ActiveMQDestination.TEMP_QUEUE_TYPE: - return tempQueueRegion; - case ActiveMQDestination.TEMP_TOPIC_TYPE: - return tempTopicRegion; - default: - throw createUnknownDestinationTypeException(destination); - } - } - - @Override - public Response messagePull(ConnectionContext context, MessagePull pull) throws Exception { - ActiveMQDestination destination = pull.getDestination(); - return getRegion(destination).messagePull(context, pull); - } - - @Override - public TransactionId[] getPreparedTransactions(ConnectionContext context) throws Exception { - throw new IllegalAccessException("Transaction operation not implemented by this broker."); - } - - @Override - public void beginTransaction(ConnectionContext context, TransactionId xid) throws Exception { - throw new IllegalAccessException("Transaction operation not implemented by this broker."); - } - - @Override - public int prepareTransaction(ConnectionContext context, TransactionId xid) throws Exception { - throw new IllegalAccessException("Transaction operation not implemented by this broker."); - } - - @Override - public void rollbackTransaction(ConnectionContext context, TransactionId xid) throws Exception { - throw new IllegalAccessException("Transaction operation not implemented by this broker."); - } - - @Override - public void commitTransaction(ConnectionContext context, TransactionId xid, boolean onePhase) throws Exception { - throw new IllegalAccessException("Transaction operation not implemented by this broker."); - } - - @Override - public void forgetTransaction(ConnectionContext context, TransactionId transactionId) throws Exception { - throw new IllegalAccessException("Transaction operation not implemented by this broker."); - } - - @Override - public void gc() { - queueRegion.gc(); - topicRegion.gc(); - } - - @Override - public BrokerId getBrokerId() { - if (brokerId == null) { - brokerId = new BrokerId(BROKER_ID_GENERATOR.generateId()); - } - return brokerId; - } - - public void setBrokerId(BrokerId brokerId) { - this.brokerId = brokerId; - } - - @Override - public String getBrokerName() { - if (brokerName == null) { - try { - brokerName = InetAddressUtil.getLocalHostName().toLowerCase(Locale.ENGLISH); - } catch (Exception e) { - brokerName = "localhost"; - } - } - return brokerName; - } - - public void setBrokerName(String brokerName) { - this.brokerName = brokerName; - } - - public DestinationStatistics getDestinationStatistics() { - return destinationStatistics; - } - - protected JMSException createUnknownDestinationTypeException(ActiveMQDestination destination) { - return new JMSException("Unknown destination type: " + destination.getDestinationType()); - } - - @Override - public synchronized void addBroker(Connection connection, BrokerInfo info) { - BrokerInfo existing = brokerInfos.get(info.getBrokerId()); - if (existing == null) { - existing = info.copy(); - existing.setPeerBrokerInfos(null); - brokerInfos.put(info.getBrokerId(), existing); - } - existing.incrementRefCount(); - LOG.debug("{} addBroker: {} brokerInfo size: {}", new Object[]{ getBrokerName(), info.getBrokerName(), brokerInfos.size() }); - addBrokerInClusterUpdate(info); - } - - @Override - public synchronized void removeBroker(Connection connection, BrokerInfo info) { - if (info != null) { - BrokerInfo existing = brokerInfos.get(info.getBrokerId()); - if (existing != null && existing.decrementRefCount() == 0) { - brokerInfos.remove(info.getBrokerId()); - } - LOG.debug("{} removeBroker: {} brokerInfo size: {}", new Object[]{ getBrokerName(), info.getBrokerName(), brokerInfos.size()}); - // When stopping don't send cluster updates since we are the one's tearing down - // our own bridges. - if (!brokerService.isStopping()) { - removeBrokerInClusterUpdate(info); - } - } - } - - @Override - public synchronized BrokerInfo[] getPeerBrokerInfos() { - BrokerInfo[] result = new BrokerInfo[brokerInfos.size()]; - result = brokerInfos.values().toArray(result); - return result; - } - - @Override - public void preProcessDispatch(MessageDispatch messageDispatch) { - Message message = messageDispatch.getMessage(); - if (message != null) { - long endTime = System.currentTimeMillis(); - message.setBrokerOutTime(endTime); - if (getBrokerService().isEnableStatistics()) { - long totalTime = endTime - message.getBrokerInTime(); - ((Destination) message.getRegionDestination()).getDestinationStatistics().getProcessTime().addTime(totalTime); - } - } - } - - @Override - public void postProcessDispatch(MessageDispatch messageDispatch) { - } - - @Override - public void processDispatchNotification(MessageDispatchNotification messageDispatchNotification) throws Exception { - ActiveMQDestination destination = messageDispatchNotification.getDestination(); - getRegion(destination).processDispatchNotification(messageDispatchNotification); - } - - @Override - public boolean isStopped() { - return !started; - } - - @Override - public Set getDurableDestinations() { - return destinationFactory.getDestinations(); - } - - protected void doStop(ServiceStopper ss) { - ss.stop(queueRegion); - ss.stop(topicRegion); - ss.stop(tempQueueRegion); - ss.stop(tempTopicRegion); - } - - public boolean isKeepDurableSubsActive() { - return keepDurableSubsActive; - } - - public void setKeepDurableSubsActive(boolean keepDurableSubsActive) { - this.keepDurableSubsActive = keepDurableSubsActive; - ((TopicRegion) topicRegion).setKeepDurableSubsActive(keepDurableSubsActive); - } - - public DestinationInterceptor getDestinationInterceptor() { - return destinationInterceptor; - } - - @Override - public ConnectionContext getAdminConnectionContext() { - return adminConnectionContext; - } - - @Override - public void setAdminConnectionContext(ConnectionContext adminConnectionContext) { - this.adminConnectionContext = adminConnectionContext; - } - - public Map getConnectionStates() { - return connectionStates; - } - - @Override - public PListStore getTempDataStore() { - return brokerService.getTempDataStore(); - } - - @Override - public URI getVmConnectorURI() { - return brokerService.getVmConnectorURI(); - } - - @Override - public void brokerServiceStarted() { - } - - @Override - public BrokerService getBrokerService() { - return brokerService; - } - - @Override - public boolean isExpired(MessageReference messageReference) { - boolean expired = false; - if (messageReference.isExpired()) { - try { - // prevent duplicate expiry processing - Message message = messageReference.getMessage(); - synchronized (message) { - expired = stampAsExpired(message); - } - } catch (IOException e) { - LOG.warn("unexpected exception on message expiry determination for: {}", messageReference, e); - } - } - return expired; - } - - private boolean stampAsExpired(Message message) throws IOException { - boolean stamped = false; - if (message.getProperty(ORIGINAL_EXPIRATION) == null) { - long expiration = message.getExpiration(); - message.setProperty(ORIGINAL_EXPIRATION, new Long(expiration)); - stamped = true; - } - return stamped; - } - - @Override - public void messageExpired(ConnectionContext context, MessageReference node, Subscription subscription) { - LOG.debug("Message expired {}", node); - getRoot().sendToDeadLetterQueue(context, node, subscription, new Throwable("Message Expired. Expiration:" + node.getExpiration())); - } - - @Override - public boolean sendToDeadLetterQueue(ConnectionContext context, MessageReference node, Subscription subscription, Throwable poisonCause) { - try { - if (node != null) { - Message message = node.getMessage(); - if (message != null && node.getRegionDestination() != null) { - DeadLetterStrategy deadLetterStrategy = ((Destination) node.getRegionDestination()).getDeadLetterStrategy(); - if (deadLetterStrategy != null) { - if (deadLetterStrategy.isSendToDeadLetterQueue(message)) { - // message may be inflight to other subscriptions so do not modify - message = message.copy(); - stampAsExpired(message); - message.setExpiration(0); - if (!message.isPersistent()) { - message.setPersistent(true); - message.setProperty("originalDeliveryMode", "NON_PERSISTENT"); - } - if (poisonCause != null) { - message.setProperty(ActiveMQMessage.DLQ_DELIVERY_FAILURE_CAUSE_PROPERTY, - poisonCause.toString()); - } - // The original destination and transaction id do - // not get filled when the message is first sent, - // it is only populated if the message is routed to - // another destination like the DLQ - ActiveMQDestination deadLetterDestination = deadLetterStrategy.getDeadLetterQueueFor(message, subscription); - if (context.getBroker() == null) { - context.setBroker(getRoot()); - } - BrokerSupport.resendNoCopy(context, message, deadLetterDestination); - return true; - } - } else { - LOG.debug("Dead Letter message with no DLQ strategy in place, message id: {}, destination: {}", message.getMessageId(), message.getDestination()); - } - } - } - } catch (Exception e) { - LOG.warn("Caught an exception sending to DLQ: {}", node, e); - } - - return false; - } - - @Override - public Broker getRoot() { - try { - return getBrokerService().getBroker(); - } catch (Exception e) { - LOG.error("Trying to get Root Broker", e); - throw new RuntimeException("The broker from the BrokerService should not throw an exception"); - } - } - - /** - * @return the broker sequence id - */ - @Override - public long getBrokerSequenceId() { - synchronized (sequenceGenerator) { - return sequenceGenerator.getNextSequenceId(); - } - } - - @Override - public Scheduler getScheduler() { - return this.scheduler; - } - - @Override - public ThreadPoolExecutor getExecutor() { - return this.executor; - } - - @Override - public void processConsumerControl(ConsumerBrokerExchange consumerExchange, ConsumerControl control) { - ActiveMQDestination destination = control.getDestination(); - try { - getRegion(destination).processConsumerControl(consumerExchange, control); - } catch (JMSException jmse) { - LOG.warn("unmatched destination: {}, in consumerControl: {}", destination, control); - } - } - - protected void addBrokerInClusterUpdate(BrokerInfo info) { - List connectors = this.brokerService.getTransportConnectors(); - for (TransportConnector connector : connectors) { - if (connector.isUpdateClusterClients()) { - connector.addPeerBroker(info); - connector.updateClientClusterInfo(); - } - } - } - - protected void removeBrokerInClusterUpdate(BrokerInfo info) { - List connectors = this.brokerService.getTransportConnectors(); - for (TransportConnector connector : connectors) { - if (connector.isUpdateClusterClients() && connector.isUpdateClusterClientsOnRemove()) { - connector.removePeerBroker(info); - connector.updateClientClusterInfo(); - } - } - } - - protected void purgeInactiveDestinations() { - inactiveDestinationsPurgeLock.writeLock().lock(); - try { - List list = new ArrayList(); - Map map = getDestinationMap(); - if (isAllowTempAutoCreationOnSend()) { - map.putAll(tempQueueRegion.getDestinationMap()); - map.putAll(tempTopicRegion.getDestinationMap()); - } - long maxPurgedDests = this.brokerService.getMaxPurgedDestinationsPerSweep(); - long timeStamp = System.currentTimeMillis(); - for (Destination d : map.values()) { - d.markForGC(timeStamp); - if (d.canGC()) { - list.add(d); - if (maxPurgedDests > 0 && list.size() == maxPurgedDests) { - break; - } - } - } - - if (!list.isEmpty()) { - ConnectionContext context = BrokerSupport.getConnectionContext(this); - context.setBroker(this); - - for (Destination dest : list) { - Logger log = LOG; - if (dest instanceof BaseDestination) { - log = ((BaseDestination) dest).getLog(); - } - log.info("{} Inactive for longer than {} ms - removing ...", dest.getName(), dest.getInactiveTimoutBeforeGC()); - try { - getRoot().removeDestination(context, dest.getActiveMQDestination(), isAllowTempAutoCreationOnSend() ? 1 : 0); - } catch (Exception e) { - LOG.error("Failed to remove inactive destination {}", dest, e); - } - } - } - } finally { - inactiveDestinationsPurgeLock.writeLock().unlock(); - } - } - - public boolean isAllowTempAutoCreationOnSend() { - return allowTempAutoCreationOnSend; - } - - public void setAllowTempAutoCreationOnSend(boolean allowTempAutoCreationOnSend) { - this.allowTempAutoCreationOnSend = allowTempAutoCreationOnSend; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Subscription.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Subscription.class deleted file mode 100644 index 7228ebc26..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Subscription.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Subscription.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Subscription.java deleted file mode 100644 index dfd427d12..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Subscription.java +++ /dev/null @@ -1,237 +0,0 @@ -/** - * 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.broker.region; - -import java.io.IOException; -import java.util.List; - -import javax.jms.InvalidSelectorException; -import javax.management.ObjectName; - -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.command.MessageAck; -import org.apache.activemq.command.MessageDispatchNotification; -import org.apache.activemq.command.MessagePull; -import org.apache.activemq.command.Response; -import org.apache.activemq.filter.MessageEvaluationContext; - -/** - * - */ -public interface Subscription extends SubscriptionRecovery { - - /** - * Used to add messages that match the subscription. - * @param node - * @throws Exception - * @throws InterruptedException - * @throws IOException - */ - void add(MessageReference node) throws Exception; - - /** - * Used when client acknowledge receipt of dispatched message. - * @param node - * @throws IOException - * @throws Exception - */ - void acknowledge(ConnectionContext context, final MessageAck ack) throws Exception; - - /** - * Allows a consumer to pull a message on demand - */ - Response pullMessage(ConnectionContext context, MessagePull pull) throws Exception; - - /** - * Is the subscription interested in the message? - * @param node - * @param context - * @return - * @throws IOException - */ - boolean matches(MessageReference node, MessageEvaluationContext context) throws IOException; - - /** - * Is the subscription interested in messages in the destination? - * @param context - * @return - */ - boolean matches(ActiveMQDestination destination); - - /** - * The subscription will be receiving messages from the destination. - * @param context - * @param destination - * @throws Exception - */ - void add(ConnectionContext context, Destination destination) throws Exception; - - /** - * The subscription will be no longer be receiving messages from the destination. - * @param context - * @param destination - * @return a list of un-acked messages that were added to the subscription. - */ - List remove(ConnectionContext context, Destination destination) throws Exception; - - /** - * The ConsumerInfo object that created the subscription. - * @param destination - */ - ConsumerInfo getConsumerInfo(); - - /** - * The subscription should release as may references as it can to help the garbage collector - * reclaim memory. - */ - void gc(); - - /** - * Used by a Slave Broker to update dispatch infomation - * @param mdn - * @throws Exception - */ - void processMessageDispatchNotification(MessageDispatchNotification mdn) throws Exception; - - /** - * @return number of messages pending delivery - */ - int getPendingQueueSize(); - - /** - * @return number of messages dispatched to the client - */ - int getDispatchedQueueSize(); - - /** - * @return number of messages dispatched to the client - */ - long getDispatchedCounter(); - - /** - * @return number of messages that matched the subscription - */ - long getEnqueueCounter(); - - /** - * @return number of messages queued by the client - */ - long getDequeueCounter(); - - /** - * @return the JMS selector on the current subscription - */ - String getSelector(); - - /** - * Attempts to change the current active selector on the subscription. - * This operation is not supported for persistent topics. - */ - void setSelector(String selector) throws InvalidSelectorException, UnsupportedOperationException; - - /** - * @return the JMX object name that this subscription was registered as if applicable - */ - ObjectName getObjectName(); - - /** - * Set when the subscription is registered in JMX - */ - void setObjectName(ObjectName objectName); - - /** - * @return true when 60% or more room is left for dispatching messages - */ - boolean isLowWaterMark(); - - /** - * @return true when 10% or less room is left for dispatching messages - */ - boolean isHighWaterMark(); - - /** - * @return true if there is no space to dispatch messages - */ - boolean isFull(); - - /** - * inform the MessageConsumer on the client to change it's prefetch - * @param newPrefetch - */ - void updateConsumerPrefetch(int newPrefetch); - - /** - * Called when the subscription is destroyed. - */ - void destroy(); - - /** - * @return the prefetch size that is configured for the subscription - */ - int getPrefetchSize(); - - /** - * @return the number of messages awaiting acknowledgement - */ - int getInFlightSize(); - - /** - * @return the in flight messages as a percentage of the prefetch size - */ - int getInFlightUsage(); - - /** - * Informs the Broker if the subscription needs to intervention to recover it's state - * e.g. DurableTopicSubscriber may do - * @see org.apache.activemq.region.cursors.PendingMessageCursor - * @return true if recovery required - */ - boolean isRecoveryRequired(); - - /** - * @return true if a browser - */ - boolean isBrowser(); - - /** - * @return the number of messages this subscription can accept before its full - */ - int countBeforeFull(); - - ConnectionContext getContext(); - - public int getCursorMemoryHighWaterMark(); - - public void setCursorMemoryHighWaterMark(int cursorMemoryHighWaterMark); - - boolean isSlowConsumer(); - - void unmatched(MessageReference node) throws IOException; - - /** - * Returns the time since the last Ack message was received by this subscription. - * - * If there has never been an ack this value should be set to the creation time of the - * subscription. - * - * @return time of last received Ack message or Subscription create time if no Acks. - */ - long getTimeOfLastMessageAck(); - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/SubscriptionRecovery.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/SubscriptionRecovery.class deleted file mode 100644 index 2eceadea5..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/SubscriptionRecovery.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/SubscriptionRecovery.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/SubscriptionRecovery.java deleted file mode 100644 index 7d801b2e0..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/SubscriptionRecovery.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * 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.broker.region; - -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.command.ActiveMQDestination; - -/** - * An interface for recoverying transient messages held by the broker for - * retractive recovery for subscribers - * - * - */ -public interface SubscriptionRecovery { - - /** - * Add a message to the SubscriptionRecovery - * - * @param context - * @param message - * @return true if the message is accepted - * @throws Exception - */ - boolean addRecoveredMessage(ConnectionContext context, MessageReference message) throws Exception; - - /** - * @return the Destination associated with this Subscription - */ - ActiveMQDestination getActiveMQDestination(); - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TempQueue.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TempQueue.class deleted file mode 100644 index 4bde78d19..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TempQueue.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TempQueue.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TempQueue.java deleted file mode 100644 index 813827797..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TempQueue.java +++ /dev/null @@ -1,97 +0,0 @@ -/** - * 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.broker.region; - -import java.io.IOException; -import org.apache.activemq.broker.BrokerService; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.region.cursors.VMPendingMessageCursor; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ActiveMQTempDestination; -import org.apache.activemq.store.MessageStore; -import org.apache.activemq.thread.TaskRunnerFactory; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * The Queue is a List of MessageEntry objects that are dispatched to matching - * subscriptions. - * - * - */ -public class TempQueue extends Queue{ - private static final Logger LOG = LoggerFactory.getLogger(TempQueue.class); - private final ActiveMQTempDestination tempDest; - - - /** - * @param brokerService - * @param destination - * @param store - * @param parentStats - * @param taskFactory - * @throws Exception - */ - public TempQueue(BrokerService brokerService, - ActiveMQDestination destination, MessageStore store, - DestinationStatistics parentStats, TaskRunnerFactory taskFactory) - throws Exception { - super(brokerService, destination, store, parentStats, taskFactory); - this.tempDest = (ActiveMQTempDestination) destination; - } - - @Override - public void initialize() throws Exception { - this.messages=new VMPendingMessageCursor(false); - this.messages.setMemoryUsageHighWaterMark(getCursorMemoryHighWaterMark()); - this.systemUsage = brokerService.getSystemUsage(); - memoryUsage.setParent(systemUsage.getMemoryUsage()); - this.taskRunner = taskFactory.createTaskRunner(this, "TempQueue: " + destination.getPhysicalName()); - } - - @Override - public void addSubscription(ConnectionContext context, Subscription sub) throws Exception { - // Only consumers on the same connection can consume from - // the temporary destination - // However, we could have failed over - and we do this - // check client side anyways .... - if (!context.isFaultTolerant() - && (!context.isNetworkConnection() && !tempDest - .getConnectionId().equals( - sub.getConsumerInfo().getConsumerId() - .getConnectionId()))) { - - tempDest.setConnectionId(sub.getConsumerInfo().getConsumerId().getConnectionId()); - LOG.debug("changed ownership of {} to {}", this, tempDest.getConnectionId()); - } - super.addSubscription(context, sub); - } - - @Override - public void dispose(ConnectionContext context) throws IOException { - if (this.destinationStatistics.getMessages().getCount() > 0) { - LOG.info("{} on dispose, purge of {} pending messages: {}", new Object[]{ getActiveMQDestination().getQualifiedName(), this.destinationStatistics.getMessages().getCount(), messages }); - // we may want to capture these message ids in an advisory - } - try { - purge(); - } catch (Exception e) { - LOG.warn("Caught an exception purging Queue: {}", destination, e); - } - super.dispose(context); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TempQueueRegion.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TempQueueRegion.class deleted file mode 100644 index 429881391..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TempQueueRegion.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TempQueueRegion.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TempQueueRegion.java deleted file mode 100644 index 78d695557..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TempQueueRegion.java +++ /dev/null @@ -1,72 +0,0 @@ -/** - * 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.broker.region; - -import javax.jms.JMSException; - -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.command.MessageDispatchNotification; -import org.apache.activemq.thread.TaskRunnerFactory; -import org.apache.activemq.usage.SystemUsage; - -/** - * - */ -public class TempQueueRegion extends AbstractTempRegion { - - public TempQueueRegion(RegionBroker broker, DestinationStatistics destinationStatistics, SystemUsage memoryManager, TaskRunnerFactory taskRunnerFactory, - DestinationFactory destinationFactory) { - super(broker, destinationStatistics, memoryManager, taskRunnerFactory, destinationFactory); - } - - protected Subscription createSubscription(ConnectionContext context, ConsumerInfo info) throws JMSException { - if (info.isBrowser()) { - return new QueueBrowserSubscription(broker,usageManager,context, info); - } else { - return new QueueSubscription(broker,usageManager,context, info); - } - } - - public String toString() { - return "TempQueueRegion: destinations=" + destinations.size() + ", subscriptions=" + subscriptions.size() + ", memory=" + usageManager.getMemoryUsage().getPercentUsage() + "%"; - } - - public void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout) throws Exception { - - // Force a timeout value so that we don't get an error that - // there is still an active sub. Temp destination may be removed - // while a network sub is still active which is valid. - if (timeout == 0) { - timeout = 1; - } - - super.removeDestination(context, destination, timeout); - } - - /* - * For a Queue, dispatch order is imperative to match acks, so the dispatch is deferred till - * the notification to ensure that the subscription chosen by the master is used. - * - * (non-Javadoc) - * @see org.apache.activemq.broker.region.AbstractRegion#processDispatchNotification(org.apache.activemq.command.MessageDispatchNotification) - */ - public void processDispatchNotification(MessageDispatchNotification messageDispatchNotification) throws Exception { - processDispatchNotificationViaDestination(messageDispatchNotification); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TempTopic.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TempTopic.class deleted file mode 100644 index c40e9930a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TempTopic.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TempTopic.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TempTopic.java deleted file mode 100644 index 9bf4658e9..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TempTopic.java +++ /dev/null @@ -1,73 +0,0 @@ -/** - * 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.broker.region; - -import org.apache.activemq.broker.BrokerService; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ActiveMQTempDestination; -import org.apache.activemq.store.TopicMessageStore; -import org.apache.activemq.thread.Task; -import org.apache.activemq.thread.TaskRunnerFactory; - -/** - * The Topic is a destination that sends a copy of a message to every active - * Subscription registered. - * - * - */ -public class TempTopic extends Topic implements Task{ - private final ActiveMQTempDestination tempDest; - /** - * @param brokerService - * @param destination - * @param store - * @param parentStats - * @param taskFactory - * @throws Exception - */ - public TempTopic(BrokerService brokerService, - ActiveMQDestination destination, TopicMessageStore store, - DestinationStatistics parentStats, TaskRunnerFactory taskFactory) - throws Exception { - super(brokerService, destination, store, parentStats, taskFactory); - this.tempDest = (ActiveMQTempDestination) destination; - - } - - public void addSubscription(ConnectionContext context, Subscription sub) throws Exception { - // Only consumers on the same connection can consume from - // the temporary destination - // However, we could have failed over - and we do this - // check client side anyways .... - if (!context.isFaultTolerant() - && (!context.isNetworkConnection() && !tempDest - .getConnectionId().equals( - sub.getConsumerInfo().getConsumerId() - .getConnectionId()))) { - - tempDest.setConnectionId(sub.getConsumerInfo().getConsumerId().getConnectionId()); - if (LOG.isDebugEnabled()) { - LOG.debug(" changed ownership of " + this + " to "+ tempDest.getConnectionId()); - } - } - super.addSubscription(context, sub); - } - - public void initialize() { - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TempTopicRegion.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TempTopicRegion.class deleted file mode 100644 index a051d3176..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TempTopicRegion.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TempTopicRegion.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TempTopicRegion.java deleted file mode 100644 index bc0f8a97d..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TempTopicRegion.java +++ /dev/null @@ -1,82 +0,0 @@ -/** - * 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.broker.region; - -import javax.jms.JMSException; - -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.region.policy.PolicyEntry; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.thread.TaskRunnerFactory; -import org.apache.activemq.usage.SystemUsage; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - */ -public class TempTopicRegion extends AbstractTempRegion { - - private static final Logger LOG = LoggerFactory.getLogger(TempTopicRegion.class); - - public TempTopicRegion(RegionBroker broker, DestinationStatistics destinationStatistics, SystemUsage memoryManager, TaskRunnerFactory taskRunnerFactory, - DestinationFactory destinationFactory) { - super(broker, destinationStatistics, memoryManager, taskRunnerFactory, destinationFactory); - } - - protected Subscription createSubscription(ConnectionContext context, ConsumerInfo info) throws JMSException { - if (info.isDurable()) { - throw new JMSException("A durable subscription cannot be created for a temporary topic."); - } - try { - TopicSubscription answer = new TopicSubscription(broker, context, info, usageManager); - // lets configure the subscription depending on the destination - ActiveMQDestination destination = info.getDestination(); - if (destination != null && broker.getDestinationPolicy() != null) { - PolicyEntry entry = broker.getDestinationPolicy().getEntryFor(destination); - if (entry != null) { - entry.configure(broker, usageManager, answer); - } - } - answer.init(); - return answer; - } catch (Exception e) { - LOG.error("Failed to create TopicSubscription ", e); - JMSException jmsEx = new JMSException("Couldn't create TopicSubscription"); - jmsEx.setLinkedException(e); - throw jmsEx; - } - } - - public String toString() { - return "TempTopicRegion: destinations=" + destinations.size() + ", subscriptions=" + subscriptions.size() + ", memory=" + usageManager.getMemoryUsage().getPercentUsage() + "%"; - } - - public void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout) throws Exception { - - // Force a timeout value so that we don't get an error that - // there is still an active sub. Temp destination may be removed - // while a network sub is still active which is valid. - if (timeout == 0) { - timeout = 1; - } - - super.removeDestination(context, destination, timeout); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Topic$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Topic$1.class deleted file mode 100644 index ff4f53295..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Topic$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Topic$2.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Topic$2.class deleted file mode 100644 index 7aaf3be4c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Topic$2.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Topic$3.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Topic$3.class deleted file mode 100644 index abafdd74c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Topic$3.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Topic$4.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Topic$4.class deleted file mode 100644 index a985745bf..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Topic$4.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Topic$5.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Topic$5.class deleted file mode 100644 index ecbac6f1c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Topic$5.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Topic$6.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Topic$6.class deleted file mode 100644 index c770a4b3b..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Topic$6.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Topic.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Topic.class deleted file mode 100644 index cd9c3c90a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Topic.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Topic.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Topic.java deleted file mode 100644 index 328410c08..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/Topic.java +++ /dev/null @@ -1,810 +0,0 @@ -/** - * 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.broker.region; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.CancellationException; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.CopyOnWriteArrayList; -import java.util.concurrent.Future; -import java.util.concurrent.locks.ReentrantReadWriteLock; - -import org.apache.activemq.advisory.AdvisorySupport; -import org.apache.activemq.broker.BrokerService; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.ProducerBrokerExchange; -import org.apache.activemq.broker.region.policy.DispatchPolicy; -import org.apache.activemq.broker.region.policy.LastImageSubscriptionRecoveryPolicy; -import org.apache.activemq.broker.region.policy.NoSubscriptionRecoveryPolicy; -import org.apache.activemq.broker.region.policy.SimpleDispatchPolicy; -import org.apache.activemq.broker.region.policy.SubscriptionRecoveryPolicy; -import org.apache.activemq.broker.util.InsertionCountList; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ExceptionResponse; -import org.apache.activemq.command.Message; -import org.apache.activemq.command.MessageAck; -import org.apache.activemq.command.MessageId; -import org.apache.activemq.command.ProducerAck; -import org.apache.activemq.command.ProducerInfo; -import org.apache.activemq.command.Response; -import org.apache.activemq.command.SubscriptionInfo; -import org.apache.activemq.filter.MessageEvaluationContext; -import org.apache.activemq.filter.NonCachedMessageEvaluationContext; -import org.apache.activemq.store.MessageRecoveryListener; -import org.apache.activemq.store.TopicMessageStore; -import org.apache.activemq.thread.Task; -import org.apache.activemq.thread.TaskRunner; -import org.apache.activemq.thread.TaskRunnerFactory; -import org.apache.activemq.transaction.Synchronization; -import org.apache.activemq.util.SubscriptionKey; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * The Topic is a destination that sends a copy of a message to every active - * Subscription registered. - */ -public class Topic extends BaseDestination implements Task { - protected static final Logger LOG = LoggerFactory.getLogger(Topic.class); - private final TopicMessageStore topicStore; - protected final CopyOnWriteArrayList consumers = new CopyOnWriteArrayList(); - private final ReentrantReadWriteLock dispatchLock = new ReentrantReadWriteLock(); - private DispatchPolicy dispatchPolicy = new SimpleDispatchPolicy(); - private SubscriptionRecoveryPolicy subscriptionRecoveryPolicy; - private final ConcurrentHashMap durableSubscribers = new ConcurrentHashMap(); - private final TaskRunner taskRunner; - private final LinkedList messagesWaitingForSpace = new LinkedList(); - private final Runnable sendMessagesWaitingForSpaceTask = new Runnable() { - @Override - public void run() { - try { - Topic.this.taskRunner.wakeup(); - } catch (InterruptedException e) { - } - }; - }; - - public Topic(BrokerService brokerService, ActiveMQDestination destination, TopicMessageStore store, - DestinationStatistics parentStats, TaskRunnerFactory taskFactory) throws Exception { - super(brokerService, store, destination, parentStats); - this.topicStore = store; - // set default subscription recovery policy - if (AdvisorySupport.isMasterBrokerAdvisoryTopic(destination)) { - subscriptionRecoveryPolicy = new LastImageSubscriptionRecoveryPolicy(); - setAlwaysRetroactive(true); - } else { - subscriptionRecoveryPolicy = new NoSubscriptionRecoveryPolicy(); - } - this.taskRunner = taskFactory.createTaskRunner(this, "Topic " + destination.getPhysicalName()); - } - - @Override - public void initialize() throws Exception { - super.initialize(); - if (store != null) { - // AMQ-2586: Better to leave this stat at zero than to give the user - // misleading metrics. - // int messageCount = store.getMessageCount(); - // destinationStatistics.getMessages().setCount(messageCount); - } - } - - @Override - public List getConsumers() { - synchronized (consumers) { - return new ArrayList(consumers); - } - } - - public boolean lock(MessageReference node, LockOwner sub) { - return true; - } - - @Override - public void addSubscription(ConnectionContext context, final Subscription sub) throws Exception { - if (!sub.getConsumerInfo().isDurable()) { - - // Do a retroactive recovery if needed. - if (sub.getConsumerInfo().isRetroactive() || isAlwaysRetroactive()) { - - // synchronize with dispatch method so that no new messages are sent - // while we are recovering a subscription to avoid out of order messages. - dispatchLock.writeLock().lock(); - try { - boolean applyRecovery = false; - synchronized (consumers) { - if (!consumers.contains(sub)){ - sub.add(context, this); - consumers.add(sub); - applyRecovery=true; - super.addSubscription(context, sub); - } - } - if (applyRecovery){ - subscriptionRecoveryPolicy.recover(context, this, sub); - } - } finally { - dispatchLock.writeLock().unlock(); - } - - } else { - synchronized (consumers) { - if (!consumers.contains(sub)){ - sub.add(context, this); - consumers.add(sub); - super.addSubscription(context, sub); - } - } - } - } else { - DurableTopicSubscription dsub = (DurableTopicSubscription) sub; - super.addSubscription(context, sub); - sub.add(context, this); - if(dsub.isActive()) { - synchronized (consumers) { - boolean hasSubscription = false; - - if (consumers.size() == 0) { - hasSubscription = false; - } else { - for (Subscription currentSub : consumers) { - if (currentSub.getConsumerInfo().isDurable()) { - DurableTopicSubscription dcurrentSub = (DurableTopicSubscription) currentSub; - if (dcurrentSub.getSubscriptionKey().equals(dsub.getSubscriptionKey())) { - hasSubscription = true; - break; - } - } - } - } - - if (!hasSubscription) { - consumers.add(sub); - } - } - } - durableSubscribers.put(dsub.getSubscriptionKey(), dsub); - } - } - - @Override - public void removeSubscription(ConnectionContext context, Subscription sub, long lastDeliveredSequenceId) throws Exception { - if (!sub.getConsumerInfo().isDurable()) { - super.removeSubscription(context, sub, lastDeliveredSequenceId); - synchronized (consumers) { - consumers.remove(sub); - } - } - sub.remove(context, this); - } - - public void deleteSubscription(ConnectionContext context, SubscriptionKey key) throws Exception { - if (topicStore != null) { - topicStore.deleteSubscription(key.clientId, key.subscriptionName); - DurableTopicSubscription removed = durableSubscribers.remove(key); - if (removed != null) { - destinationStatistics.getConsumers().decrement(); - // deactivate and remove - removed.deactivate(false); - consumers.remove(removed); - } - } - } - - public void activate(ConnectionContext context, final DurableTopicSubscription subscription) throws Exception { - // synchronize with dispatch method so that no new messages are sent - // while we are recovering a subscription to avoid out of order messages. - dispatchLock.writeLock().lock(); - try { - - if (topicStore == null) { - return; - } - - // Recover the durable subscription. - String clientId = subscription.getSubscriptionKey().getClientId(); - String subscriptionName = subscription.getSubscriptionKey().getSubscriptionName(); - String selector = subscription.getConsumerInfo().getSelector(); - SubscriptionInfo info = topicStore.lookupSubscription(clientId, subscriptionName); - if (info != null) { - // Check to see if selector changed. - String s1 = info.getSelector(); - if (s1 == null ^ selector == null || (s1 != null && !s1.equals(selector))) { - // Need to delete the subscription - topicStore.deleteSubscription(clientId, subscriptionName); - info = null; - synchronized (consumers) { - consumers.remove(subscription); - } - } else { - synchronized (consumers) { - if (!consumers.contains(subscription)) { - consumers.add(subscription); - } - } - } - } - - // Do we need to create the subscription? - if (info == null) { - info = new SubscriptionInfo(); - info.setClientId(clientId); - info.setSelector(selector); - info.setSubscriptionName(subscriptionName); - info.setDestination(getActiveMQDestination()); - // This destination is an actual destination id. - info.setSubscribedDestination(subscription.getConsumerInfo().getDestination()); - // This destination might be a pattern - synchronized (consumers) { - consumers.add(subscription); - topicStore.addSubsciption(info, subscription.getConsumerInfo().isRetroactive()); - } - } - - final MessageEvaluationContext msgContext = new NonCachedMessageEvaluationContext(); - msgContext.setDestination(destination); - if (subscription.isRecoveryRequired()) { - topicStore.recoverSubscription(clientId, subscriptionName, new MessageRecoveryListener() { - @Override - public boolean recoverMessage(Message message) throws Exception { - message.setRegionDestination(Topic.this); - try { - msgContext.setMessageReference(message); - if (subscription.matches(message, msgContext)) { - subscription.add(message); - } - } catch (IOException e) { - LOG.error("Failed to recover this message {}", message, e); - } - return true; - } - - @Override - public boolean recoverMessageReference(MessageId messageReference) throws Exception { - throw new RuntimeException("Should not be called."); - } - - @Override - public boolean hasSpace() { - return true; - } - - @Override - public boolean isDuplicate(MessageId id) { - return false; - } - }); - } - } finally { - dispatchLock.writeLock().unlock(); - } - } - - public void deactivate(ConnectionContext context, DurableTopicSubscription sub, List dispatched) throws Exception { - synchronized (consumers) { - consumers.remove(sub); - } - sub.remove(context, this, dispatched); - } - - protected void recoverRetroactiveMessages(ConnectionContext context, Subscription subscription) throws Exception { - if (subscription.getConsumerInfo().isRetroactive()) { - subscriptionRecoveryPolicy.recover(context, this, subscription); - } - } - - @Override - public void send(final ProducerBrokerExchange producerExchange, final Message message) throws Exception { - final ConnectionContext context = producerExchange.getConnectionContext(); - - final ProducerInfo producerInfo = producerExchange.getProducerState().getInfo(); - producerExchange.incrementSend(); - final boolean sendProducerAck = !message.isResponseRequired() && producerInfo.getWindowSize() > 0 - && !context.isInRecoveryMode(); - - // There is delay between the client sending it and it arriving at the - // destination.. it may have expired. - if (message.isExpired()) { - broker.messageExpired(context, message, null); - getDestinationStatistics().getExpired().increment(); - if (sendProducerAck) { - ProducerAck ack = new ProducerAck(producerInfo.getProducerId(), message.getSize()); - context.getConnection().dispatchAsync(ack); - } - return; - } - - if (memoryUsage.isFull()) { - isFull(context, memoryUsage); - fastProducer(context, producerInfo); - - if (isProducerFlowControl() && context.isProducerFlowControl()) { - - if (warnOnProducerFlowControl) { - warnOnProducerFlowControl = false; - LOG.info("{}, Usage Manager memory limit reached for {}. Producers will be throttled to the rate at which messages are removed from this destination to prevent flooding it. See http://activemq.apache.org/producer-flow-control.html for more info.", getActiveMQDestination().getQualifiedName()); - } - - if (!context.isNetworkConnection() && systemUsage.isSendFailIfNoSpace()) { - throw new javax.jms.ResourceAllocationException("Usage Manager memory limit (" - + memoryUsage.getLimit() + ") reached. Rejecting send for producer (" + message.getProducerId() - + ") to prevent flooding " + getActiveMQDestination().getQualifiedName() + "." - + " See http://activemq.apache.org/producer-flow-control.html for more info"); - } - - // We can avoid blocking due to low usage if the producer is sending a sync message or - // if it is using a producer window - if (producerInfo.getWindowSize() > 0 || message.isResponseRequired()) { - synchronized (messagesWaitingForSpace) { - messagesWaitingForSpace.add(new Runnable() { - @Override - public void run() { - try { - - // While waiting for space to free up... the - // message may have expired. - if (message.isExpired()) { - broker.messageExpired(context, message, null); - getDestinationStatistics().getExpired().increment(); - } else { - doMessageSend(producerExchange, message); - } - - if (sendProducerAck) { - ProducerAck ack = new ProducerAck(producerInfo.getProducerId(), message - .getSize()); - context.getConnection().dispatchAsync(ack); - } else { - Response response = new Response(); - response.setCorrelationId(message.getCommandId()); - context.getConnection().dispatchAsync(response); - } - - } catch (Exception e) { - if (!sendProducerAck && !context.isInRecoveryMode()) { - ExceptionResponse response = new ExceptionResponse(e); - response.setCorrelationId(message.getCommandId()); - context.getConnection().dispatchAsync(response); - } - } - } - }); - - registerCallbackForNotFullNotification(); - context.setDontSendReponse(true); - return; - } - - } else { - // Producer flow control cannot be used, so we have do the flow control - // at the broker by blocking this thread until there is space available. - - if (memoryUsage.isFull()) { - if (context.isInTransaction()) { - - int count = 0; - while (!memoryUsage.waitForSpace(1000)) { - if (context.getStopping().get()) { - throw new IOException("Connection closed, send aborted."); - } - if (count > 2 && context.isInTransaction()) { - count = 0; - int size = context.getTransaction().size(); - LOG.warn("Waiting for space to send transacted message - transaction elements = {} need more space to commit. Message = {}", size, message); - } - count++; - } - } else { - waitForSpace( - context, - producerExchange, - memoryUsage, - "Usage Manager Memory Usage limit reached. Stopping producer (" - + message.getProducerId() - + ") to prevent flooding " - + getActiveMQDestination().getQualifiedName() - + "." - + " See http://activemq.apache.org/producer-flow-control.html for more info"); - } - } - - // The usage manager could have delayed us by the time - // we unblock the message could have expired.. - if (message.isExpired()) { - getDestinationStatistics().getExpired().increment(); - LOG.debug("Expired message: {}", message); - return; - } - } - } - } - - doMessageSend(producerExchange, message); - messageDelivered(context, message); - if (sendProducerAck) { - ProducerAck ack = new ProducerAck(producerInfo.getProducerId(), message.getSize()); - context.getConnection().dispatchAsync(ack); - } - } - - /** - * do send the message - this needs to be synchronized to ensure messages - * are stored AND dispatched in the right order - * - * @param producerExchange - * @param message - * @throws IOException - * @throws Exception - */ - synchronized void doMessageSend(final ProducerBrokerExchange producerExchange, final Message message) - throws IOException, Exception { - final ConnectionContext context = producerExchange.getConnectionContext(); - message.setRegionDestination(this); - message.getMessageId().setBrokerSequenceId(getDestinationSequenceId()); - Future result = null; - - if (topicStore != null && message.isPersistent() && !canOptimizeOutPersistence()) { - if (systemUsage.getStoreUsage().isFull(getStoreUsageHighWaterMark())) { - final String logMessage = "Persistent store is Full, " + getStoreUsageHighWaterMark() + "% of " - + systemUsage.getStoreUsage().getLimit() + ". Stopping producer (" + message.getProducerId() - + ") to prevent flooding " + getActiveMQDestination().getQualifiedName() + "." - + " See http://activemq.apache.org/producer-flow-control.html for more info"; - if (!context.isNetworkConnection() && systemUsage.isSendFailIfNoSpace()) { - throw new javax.jms.ResourceAllocationException(logMessage); - } - - waitForSpace(context,producerExchange, systemUsage.getStoreUsage(), getStoreUsageHighWaterMark(), logMessage); - } - result = topicStore.asyncAddTopicMessage(context, message,isOptimizeStorage()); - } - - message.incrementReferenceCount(); - - if (context.isInTransaction()) { - context.getTransaction().addSynchronization(new Synchronization() { - @Override - public void afterCommit() throws Exception { - // It could take while before we receive the commit - // operation.. by that time the message could have - // expired.. - if (broker.isExpired(message)) { - getDestinationStatistics().getExpired().increment(); - broker.messageExpired(context, message, null); - message.decrementReferenceCount(); - return; - } - try { - dispatch(context, message); - } finally { - message.decrementReferenceCount(); - } - } - }); - - } else { - try { - dispatch(context, message); - } finally { - message.decrementReferenceCount(); - } - } - - if (result != null && !result.isCancelled()) { - try { - result.get(); - } catch (CancellationException e) { - // ignore - the task has been cancelled if the message - // has already been deleted - } - } - } - - private boolean canOptimizeOutPersistence() { - return durableSubscribers.size() == 0; - } - - @Override - public String toString() { - return "Topic: destination=" + destination.getPhysicalName() + ", subscriptions=" + consumers.size(); - } - - @Override - public void acknowledge(ConnectionContext context, Subscription sub, final MessageAck ack, - final MessageReference node) throws IOException { - if (topicStore != null && node.isPersistent()) { - DurableTopicSubscription dsub = (DurableTopicSubscription) sub; - SubscriptionKey key = dsub.getSubscriptionKey(); - topicStore.acknowledge(context, key.getClientId(), key.getSubscriptionName(), node.getMessageId(), - convertToNonRangedAck(ack, node)); - } - messageConsumed(context, node); - } - - @Override - public void gc() { - } - - public Message loadMessage(MessageId messageId) throws IOException { - return topicStore != null ? topicStore.getMessage(messageId) : null; - } - - @Override - public void start() throws Exception { - this.subscriptionRecoveryPolicy.start(); - if (memoryUsage != null) { - memoryUsage.start(); - } - - if (getExpireMessagesPeriod() > 0) { - scheduler.schedualPeriodically(expireMessagesTask, getExpireMessagesPeriod()); - } - } - - @Override - public void stop() throws Exception { - if (taskRunner != null) { - taskRunner.shutdown(); - } - this.subscriptionRecoveryPolicy.stop(); - if (memoryUsage != null) { - memoryUsage.stop(); - } - if (this.topicStore != null) { - this.topicStore.stop(); - } - - scheduler.cancel(expireMessagesTask); - } - - @Override - public Message[] browse() { - final List result = new ArrayList(); - doBrowse(result, getMaxBrowsePageSize()); - return result.toArray(new Message[result.size()]); - } - - private void doBrowse(final List browseList, final int max) { - try { - if (topicStore != null) { - final List toExpire = new ArrayList(); - topicStore.recover(new MessageRecoveryListener() { - @Override - public boolean recoverMessage(Message message) throws Exception { - if (message.isExpired()) { - toExpire.add(message); - } - browseList.add(message); - return true; - } - - @Override - public boolean recoverMessageReference(MessageId messageReference) throws Exception { - return true; - } - - @Override - public boolean hasSpace() { - return browseList.size() < max; - } - - @Override - public boolean isDuplicate(MessageId id) { - return false; - } - }); - final ConnectionContext connectionContext = createConnectionContext(); - for (Message message : toExpire) { - for (DurableTopicSubscription sub : durableSubscribers.values()) { - if (!sub.isActive()) { - messageExpired(connectionContext, sub, message); - } - } - } - Message[] msgs = subscriptionRecoveryPolicy.browse(getActiveMQDestination()); - if (msgs != null) { - for (int i = 0; i < msgs.length && browseList.size() < max; i++) { - browseList.add(msgs[i]); - } - } - } - } catch (Throwable e) { - LOG.warn("Failed to browse Topic: {}", getActiveMQDestination().getPhysicalName(), e); - } - } - - @Override - public boolean iterate() { - synchronized (messagesWaitingForSpace) { - while (!memoryUsage.isFull() && !messagesWaitingForSpace.isEmpty()) { - Runnable op = messagesWaitingForSpace.removeFirst(); - op.run(); - } - - if (!messagesWaitingForSpace.isEmpty()) { - registerCallbackForNotFullNotification(); - } - } - return false; - } - - private void registerCallbackForNotFullNotification() { - // If the usage manager is not full, then the task will not - // get called.. - if (!memoryUsage.notifyCallbackWhenNotFull(sendMessagesWaitingForSpaceTask)) { - // so call it directly here. - sendMessagesWaitingForSpaceTask.run(); - } - } - - // Properties - // ------------------------------------------------------------------------- - - public DispatchPolicy getDispatchPolicy() { - return dispatchPolicy; - } - - public void setDispatchPolicy(DispatchPolicy dispatchPolicy) { - this.dispatchPolicy = dispatchPolicy; - } - - public SubscriptionRecoveryPolicy getSubscriptionRecoveryPolicy() { - return subscriptionRecoveryPolicy; - } - - public void setSubscriptionRecoveryPolicy(SubscriptionRecoveryPolicy subscriptionRecoveryPolicy) { - this.subscriptionRecoveryPolicy = subscriptionRecoveryPolicy; - } - - // Implementation methods - // ------------------------------------------------------------------------- - - @Override - public final void wakeup() { - } - - protected void dispatch(final ConnectionContext context, Message message) throws Exception { - // AMQ-2586: Better to leave this stat at zero than to give the user - // misleading metrics. - // destinationStatistics.getMessages().increment(); - destinationStatistics.getEnqueues().increment(); - destinationStatistics.getMessageSize().addSize(message.getSize()); - MessageEvaluationContext msgContext = null; - - dispatchLock.readLock().lock(); - try { - if (!subscriptionRecoveryPolicy.add(context, message)) { - return; - } - synchronized (consumers) { - if (consumers.isEmpty()) { - onMessageWithNoConsumers(context, message); - return; - } - } - msgContext = context.getMessageEvaluationContext(); - msgContext.setDestination(destination); - msgContext.setMessageReference(message); - if (!dispatchPolicy.dispatch(message, msgContext, consumers)) { - onMessageWithNoConsumers(context, message); - } - - } finally { - dispatchLock.readLock().unlock(); - if (msgContext != null) { - msgContext.clear(); - } - } - } - - private final Runnable expireMessagesTask = new Runnable() { - @Override - public void run() { - List browsedMessages = new InsertionCountList(); - doBrowse(browsedMessages, getMaxExpirePageSize()); - } - }; - - @Override - public void messageExpired(ConnectionContext context, Subscription subs, MessageReference reference) { - broker.messageExpired(context, reference, subs); - // AMQ-2586: Better to leave this stat at zero than to give the user - // misleading metrics. - // destinationStatistics.getMessages().decrement(); - destinationStatistics.getExpired().increment(); - MessageAck ack = new MessageAck(); - ack.setAckType(MessageAck.STANDARD_ACK_TYPE); - ack.setDestination(destination); - ack.setMessageID(reference.getMessageId()); - try { - if (subs instanceof DurableTopicSubscription) { - ((DurableTopicSubscription)subs).removePending(reference); - } - acknowledge(context, subs, ack, reference); - } catch (Exception e) { - LOG.error("Failed to remove expired Message from the store ", e); - } - } - - @Override - protected Logger getLog() { - return LOG; - } - - protected boolean isOptimizeStorage(){ - boolean result = false; - - if (isDoOptimzeMessageStorage() && durableSubscribers.isEmpty()==false){ - result = true; - for (DurableTopicSubscription s : durableSubscribers.values()) { - if (s.isActive()== false){ - result = false; - break; - } - if (s.getPrefetchSize()==0){ - result = false; - break; - } - if (s.isSlowConsumer()){ - result = false; - break; - } - if (s.getInFlightUsage() > getOptimizeMessageStoreInFlightLimit()){ - result = false; - break; - } - } - } - return result; - } - - /** - * force a reread of the store - after transaction recovery completion - */ - @Override - public void clearPendingMessages() { - dispatchLock.readLock().lock(); - try { - for (DurableTopicSubscription durableTopicSubscription : durableSubscribers.values()) { - clearPendingAndDispatch(durableTopicSubscription); - } - } finally { - dispatchLock.readLock().unlock(); - } - } - - private void clearPendingAndDispatch(DurableTopicSubscription durableTopicSubscription) { - synchronized (durableTopicSubscription.pendingLock) { - durableTopicSubscription.pending.clear(); - try { - durableTopicSubscription.dispatchPending(); - } catch (IOException exception) { - LOG.warn("After clear of pending, failed to dispatch to: {}, for: {}, pending: {}", new Object[]{ - durableTopicSubscription, - destination, - durableTopicSubscription.pending }, exception); - } - } - } - - public Map getDurableTopicSubs() { - return durableSubscribers; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TopicRegion$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TopicRegion$1.class deleted file mode 100644 index 66c3a47ec..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TopicRegion$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TopicRegion.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TopicRegion.class deleted file mode 100644 index 6e6efad49..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TopicRegion.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TopicRegion.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TopicRegion.java deleted file mode 100644 index 27e1d288e..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TopicRegion.java +++ /dev/null @@ -1,382 +0,0 @@ -/** - * 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.broker.region; - -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.Timer; -import java.util.TimerTask; -import java.util.concurrent.ConcurrentHashMap; - -import javax.jms.InvalidDestinationException; -import javax.jms.JMSException; - -import org.apache.activemq.advisory.AdvisorySupport; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.region.policy.PolicyEntry; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ConnectionId; -import org.apache.activemq.command.ConsumerId; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.command.RemoveSubscriptionInfo; -import org.apache.activemq.command.SessionId; -import org.apache.activemq.command.SubscriptionInfo; -import org.apache.activemq.store.TopicMessageStore; -import org.apache.activemq.thread.TaskRunnerFactory; -import org.apache.activemq.usage.SystemUsage; -import org.apache.activemq.util.LongSequenceGenerator; -import org.apache.activemq.util.SubscriptionKey; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - */ -public class TopicRegion extends AbstractRegion { - private static final Logger LOG = LoggerFactory.getLogger(TopicRegion.class); - protected final ConcurrentHashMap durableSubscriptions = new ConcurrentHashMap(); - private final LongSequenceGenerator recoveredDurableSubIdGenerator = new LongSequenceGenerator(); - private final SessionId recoveredDurableSubSessionId = new SessionId(new ConnectionId("OFFLINE"), recoveredDurableSubIdGenerator.getNextSequenceId()); - private boolean keepDurableSubsActive; - - private Timer cleanupTimer; - private TimerTask cleanupTask; - - public TopicRegion(RegionBroker broker, DestinationStatistics destinationStatistics, SystemUsage memoryManager, TaskRunnerFactory taskRunnerFactory, - DestinationFactory destinationFactory) { - super(broker, destinationStatistics, memoryManager, taskRunnerFactory, destinationFactory); - if (broker.getBrokerService().getOfflineDurableSubscriberTaskSchedule() != -1 && broker.getBrokerService().getOfflineDurableSubscriberTimeout() != -1) { - this.cleanupTimer = new Timer("ActiveMQ Durable Subscriber Cleanup Timer", true); - this.cleanupTask = new TimerTask() { - @Override - public void run() { - doCleanup(); - } - }; - this.cleanupTimer.schedule(cleanupTask, broker.getBrokerService().getOfflineDurableSubscriberTaskSchedule(), broker.getBrokerService().getOfflineDurableSubscriberTaskSchedule()); - } - } - - @Override - public void stop() throws Exception { - super.stop(); - if (cleanupTimer != null) { - cleanupTimer.cancel(); - } - } - - public void doCleanup() { - long now = System.currentTimeMillis(); - for (Map.Entry entry : durableSubscriptions.entrySet()) { - DurableTopicSubscription sub = entry.getValue(); - if (!sub.isActive()) { - long offline = sub.getOfflineTimestamp(); - if (offline != -1 && now - offline >= broker.getBrokerService().getOfflineDurableSubscriberTimeout()) { - LOG.info("Destroying durable subscriber due to inactivity: {}", sub); - try { - RemoveSubscriptionInfo info = new RemoveSubscriptionInfo(); - info.setClientId(entry.getKey().getClientId()); - info.setSubscriptionName(entry.getKey().getSubscriptionName()); - ConnectionContext context = new ConnectionContext(); - context.setBroker(broker); - context.setClientId(entry.getKey().getClientId()); - removeSubscription(context, info); - } catch (Exception e) { - LOG.error("Failed to remove inactive durable subscriber", e); - } - } - } - } - } - - @Override - public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { - if (info.isDurable()) { - ActiveMQDestination destination = info.getDestination(); - if (!destination.isPattern()) { - // Make sure the destination is created. - lookup(context, destination,true); - } - String clientId = context.getClientId(); - String subscriptionName = info.getSubscriptionName(); - SubscriptionKey key = new SubscriptionKey(clientId, subscriptionName); - DurableTopicSubscription sub = durableSubscriptions.get(key); - if (sub != null) { - if (sub.isActive()) { - throw new JMSException("Durable consumer is in use for client: " + clientId + " and subscriptionName: " + subscriptionName); - } - // Has the selector changed?? - if (hasDurableSubChanged(info, sub.getConsumerInfo())) { - // Remove the consumer first then add it. - durableSubscriptions.remove(key); - destinationsLock.readLock().lock(); - try { - for (Destination dest : destinations.values()) { - //Account for virtual destinations - if (dest instanceof Topic){ - Topic topic = (Topic)dest; - topic.deleteSubscription(context, key); - } - } - } finally { - destinationsLock.readLock().unlock(); - } - super.removeConsumer(context, sub.getConsumerInfo()); - super.addConsumer(context, info); - sub = durableSubscriptions.get(key); - } else { - // Change the consumer id key of the durable sub. - if (sub.getConsumerInfo().getConsumerId() != null) { - subscriptions.remove(sub.getConsumerInfo().getConsumerId()); - } - subscriptions.put(info.getConsumerId(), sub); - } - } else { - super.addConsumer(context, info); - sub = durableSubscriptions.get(key); - if (sub == null) { - throw new JMSException("Cannot use the same consumerId: " + info.getConsumerId() + " for two different durable subscriptions clientID: " + key.getClientId() - + " subscriberName: " + key.getSubscriptionName()); - } - } - sub.activate(usageManager, context, info, broker); - return sub; - } else { - return super.addConsumer(context, info); - } - } - - @Override - public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { - if (info.isDurable()) { - - SubscriptionKey key = new SubscriptionKey(context.getClientId(), info.getSubscriptionName()); - DurableTopicSubscription sub = durableSubscriptions.get(key); - if (sub != null) { - sub.deactivate(keepDurableSubsActive); - } - - } else { - super.removeConsumer(context, info); - } - } - - @Override - public void removeSubscription(ConnectionContext context, RemoveSubscriptionInfo info) throws Exception { - SubscriptionKey key = new SubscriptionKey(info.getClientId(), info.getSubscriptionName()); - DurableTopicSubscription sub = durableSubscriptions.get(key); - if (sub == null) { - throw new InvalidDestinationException("No durable subscription exists for: " + info.getSubscriptionName()); - } - if (sub.isActive()) { - throw new JMSException("Durable consumer is in use"); - } else { - durableSubscriptions.remove(key); - } - - destinationsLock.readLock().lock(); - try { - for (Destination dest : destinations.values()) { - if (dest instanceof Topic){ - Topic topic = (Topic)dest; - topic.deleteSubscription(context, key); - } else if (dest instanceof DestinationFilter) { - DestinationFilter filter = (DestinationFilter) dest; - filter.deleteSubscription(context, key); - } - } - } finally { - destinationsLock.readLock().unlock(); - } - - if (subscriptions.get(sub.getConsumerInfo().getConsumerId()) != null) { - super.removeConsumer(context, sub.getConsumerInfo()); - } else { - // try destroying inactive subscriptions - destroySubscription(sub); - } - } - - @Override - public String toString() { - return "TopicRegion: destinations=" + destinations.size() + ", subscriptions=" + subscriptions.size() + ", memory=" + usageManager.getMemoryUsage().getPercentUsage() + "%"; - } - - @Override - protected List addSubscriptionsForDestination(ConnectionContext context, Destination dest) throws Exception { - List rc = super.addSubscriptionsForDestination(context, dest); - Set dupChecker = new HashSet(rc); - - TopicMessageStore store = (TopicMessageStore)dest.getMessageStore(); - // Eagerly recover the durable subscriptions - if (store != null) { - SubscriptionInfo[] infos = store.getAllSubscriptions(); - for (int i = 0; i < infos.length; i++) { - - SubscriptionInfo info = infos[i]; - LOG.debug("Restoring durable subscription: {}", info); - SubscriptionKey key = new SubscriptionKey(info); - - // A single durable sub may be subscribing to multiple topics. - // so it might exist already. - DurableTopicSubscription sub = durableSubscriptions.get(key); - ConsumerInfo consumerInfo = createInactiveConsumerInfo(info); - if (sub == null) { - ConnectionContext c = new ConnectionContext(); - c.setBroker(context.getBroker()); - c.setClientId(key.getClientId()); - c.setConnectionId(consumerInfo.getConsumerId().getParentId().getParentId()); - sub = (DurableTopicSubscription)createSubscription(c, consumerInfo); - sub.setOfflineTimestamp(System.currentTimeMillis()); - } - - if (dupChecker.contains(sub)) { - continue; - } - - dupChecker.add(sub); - rc.add(sub); - dest.addSubscription(context, sub); - } - - // Now perhaps there other durable subscriptions (via wild card) - // that would match this destination.. - durableSubscriptions.values(); - for (DurableTopicSubscription sub : durableSubscriptions.values()) { - // Skip over subscriptions that we already added.. - if (dupChecker.contains(sub)) { - continue; - } - - if (sub.matches(dest.getActiveMQDestination())) { - rc.add(sub); - dest.addSubscription(context, sub); - } - } - } - return rc; - } - - public ConsumerInfo createInactiveConsumerInfo(SubscriptionInfo info) { - ConsumerInfo rc = new ConsumerInfo(); - rc.setSelector(info.getSelector()); - rc.setSubscriptionName(info.getSubscriptionName()); - rc.setDestination(info.getSubscribedDestination()); - rc.setConsumerId(createConsumerId()); - return rc; - } - - private ConsumerId createConsumerId() { - return new ConsumerId(recoveredDurableSubSessionId, recoveredDurableSubIdGenerator.getNextSequenceId()); - } - - protected void configureTopic(Topic topic, ActiveMQDestination destination) { - if (broker.getDestinationPolicy() != null) { - PolicyEntry entry = broker.getDestinationPolicy().getEntryFor(destination); - if (entry != null) { - entry.configure(broker,topic); - } - } - } - - @Override - protected Subscription createSubscription(ConnectionContext context, ConsumerInfo info) throws JMSException { - ActiveMQDestination destination = info.getDestination(); - - if (info.isDurable()) { - if (AdvisorySupport.isAdvisoryTopic(info.getDestination())) { - throw new JMSException("Cannot create a durable subscription for an advisory Topic"); - } - SubscriptionKey key = new SubscriptionKey(context.getClientId(), info.getSubscriptionName()); - DurableTopicSubscription sub = durableSubscriptions.get(key); - - if (sub == null) { - - sub = new DurableTopicSubscription(broker, usageManager, context, info, keepDurableSubsActive); - - if (destination != null && broker.getDestinationPolicy() != null) { - PolicyEntry entry = broker.getDestinationPolicy().getEntryFor(destination); - if (entry != null) { - entry.configure(broker, usageManager, sub); - } - } - durableSubscriptions.put(key, sub); - } else { - throw new JMSException("That durable subscription is already active."); - } - return sub; - } - try { - TopicSubscription answer = new TopicSubscription(broker, context, info, usageManager); - // lets configure the subscription depending on the destination - if (destination != null && broker.getDestinationPolicy() != null) { - PolicyEntry entry = broker.getDestinationPolicy().getEntryFor(destination); - if (entry != null) { - entry.configure(broker, usageManager, answer); - } - } - answer.init(); - return answer; - } catch (Exception e) { - LOG.error("Failed to create TopicSubscription ", e); - JMSException jmsEx = new JMSException("Couldn't create TopicSubscription"); - jmsEx.setLinkedException(e); - throw jmsEx; - } - } - - private boolean hasDurableSubChanged(ConsumerInfo info1, ConsumerInfo info2) { - if (info1.getSelector() != null ^ info2.getSelector() != null) { - return true; - } - if (info1.getSelector() != null && !info1.getSelector().equals(info2.getSelector())) { - return true; - } - return !info1.getDestination().equals(info2.getDestination()); - } - - @Override - protected Set getInactiveDestinations() { - Set inactiveDestinations = super.getInactiveDestinations(); - for (Iterator iter = inactiveDestinations.iterator(); iter.hasNext();) { - ActiveMQDestination dest = iter.next(); - if (!dest.isTopic()) { - iter.remove(); - } - } - return inactiveDestinations; - } - - public boolean isKeepDurableSubsActive() { - return keepDurableSubsActive; - } - - public void setKeepDurableSubsActive(boolean keepDurableSubsActive) { - this.keepDurableSubsActive = keepDurableSubsActive; - } - - public boolean durableSubscriptionExists(SubscriptionKey key) { - return this.durableSubscriptions.containsKey(key); - } - - public DurableTopicSubscription getDurableSubscription(SubscriptionKey key) { - return durableSubscriptions.get(key); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TopicSubscription$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TopicSubscription$1.class deleted file mode 100644 index 4474f46f8..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TopicSubscription$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TopicSubscription$2.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TopicSubscription$2.class deleted file mode 100644 index 41cabb49c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TopicSubscription$2.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TopicSubscription$3.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TopicSubscription$3.class deleted file mode 100644 index 8985bbc88..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TopicSubscription$3.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TopicSubscription.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TopicSubscription.class deleted file mode 100644 index f1615a619..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TopicSubscription.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TopicSubscription.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TopicSubscription.java deleted file mode 100644 index 7e17cf34b..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/TopicSubscription.java +++ /dev/null @@ -1,669 +0,0 @@ -/** - * 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.broker.region; - -import java.io.IOException; -import java.util.LinkedList; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicLong; - -import javax.jms.JMSException; - -import org.apache.activemq.ActiveMQMessageAudit; -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.region.cursors.FilePendingMessageCursor; -import org.apache.activemq.broker.region.cursors.PendingMessageCursor; -import org.apache.activemq.broker.region.cursors.VMPendingMessageCursor; -import org.apache.activemq.broker.region.policy.MessageEvictionStrategy; -import org.apache.activemq.broker.region.policy.OldestMessageEvictionStrategy; -import org.apache.activemq.command.ConsumerControl; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.command.Message; -import org.apache.activemq.command.MessageAck; -import org.apache.activemq.command.MessageDispatch; -import org.apache.activemq.command.MessageDispatchNotification; -import org.apache.activemq.command.MessagePull; -import org.apache.activemq.command.Response; -import org.apache.activemq.thread.Scheduler; -import org.apache.activemq.transaction.Synchronization; -import org.apache.activemq.transport.TransmitCallback; -import org.apache.activemq.usage.SystemUsage; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TopicSubscription extends AbstractSubscription { - - private static final Logger LOG = LoggerFactory.getLogger(TopicSubscription.class); - private static final AtomicLong CURSOR_NAME_COUNTER = new AtomicLong(0); - - protected PendingMessageCursor matched; - protected final SystemUsage usageManager; - protected AtomicLong dispatchedCounter = new AtomicLong(); - - boolean singleDestination = true; - Destination destination; - private final Scheduler scheduler; - - private int maximumPendingMessages = -1; - private MessageEvictionStrategy messageEvictionStrategy = new OldestMessageEvictionStrategy(); - private int discarded; - private final Object matchedListMutex = new Object(); - private final AtomicLong enqueueCounter = new AtomicLong(0); - private final AtomicLong dequeueCounter = new AtomicLong(0); - private final AtomicBoolean prefetchWindowOpen = new AtomicBoolean(false); - private int memoryUsageHighWaterMark = 95; - // allow duplicate suppression in a ring network of brokers - protected int maxProducersToAudit = 1024; - protected int maxAuditDepth = 1000; - protected boolean enableAudit = false; - protected ActiveMQMessageAudit audit; - protected boolean active = false; - - public TopicSubscription(Broker broker,ConnectionContext context, ConsumerInfo info, SystemUsage usageManager) throws Exception { - super(broker, context, info); - this.usageManager = usageManager; - String matchedName = "TopicSubscription:" + CURSOR_NAME_COUNTER.getAndIncrement() + "[" + info.getConsumerId().toString() + "]"; - if (info.getDestination().isTemporary() || broker.getTempDataStore()==null ) { - this.matched = new VMPendingMessageCursor(false); - } else { - this.matched = new FilePendingMessageCursor(broker,matchedName,false); - } - - this.scheduler = broker.getScheduler(); - } - - public void init() throws Exception { - this.matched.setSystemUsage(usageManager); - this.matched.setMemoryUsageHighWaterMark(getCursorMemoryHighWaterMark()); - this.matched.start(); - if (enableAudit) { - audit= new ActiveMQMessageAudit(maxAuditDepth, maxProducersToAudit); - } - this.active=true; - } - - @Override - public void add(MessageReference node) throws Exception { - if (isDuplicate(node)) { - return; - } - // Lets use an indirect reference so that we can associate a unique - // locator /w the message. - node = new IndirectMessageReference(node.getMessage()); - enqueueCounter.incrementAndGet(); - if (!isFull() && matched.isEmpty()) { - // if maximumPendingMessages is set we will only discard messages which - // have not been dispatched (i.e. we allow the prefetch buffer to be filled) - dispatch(node); - setSlowConsumer(false); - } else { - if (info.getPrefetchSize() > 1 && matched.size() > info.getPrefetchSize()) { - // Slow consumers should log and set their state as such. - if (!isSlowConsumer()) { - LOG.warn("{}: has twice its prefetch limit pending, without an ack; it appears to be slow", toString()); - setSlowConsumer(true); - for (Destination dest: destinations) { - dest.slowConsumer(getContext(), this); - } - } - } - if (maximumPendingMessages != 0) { - boolean warnedAboutWait = false; - while (active) { - synchronized (matchedListMutex) { - while (matched.isFull()) { - if (getContext().getStopping().get()) { - LOG.warn("{}: stopped waiting for space in pendingMessage cursor for: {}", toString(), node.getMessageId()); - enqueueCounter.decrementAndGet(); - return; - } - if (!warnedAboutWait) { - LOG.info("{}: Pending message cursor [{}] is full, temp usag ({}%) or memory usage ({}%) limit reached, blocking message add() pending the release of resources.", - new Object[]{ - toString(), - matched, - matched.getSystemUsage().getTempUsage().getPercentUsage(), - matched.getSystemUsage().getMemoryUsage().getPercentUsage() - }); - warnedAboutWait = true; - } - matchedListMutex.wait(20); - } - // Temporary storage could be full - so just try to add the message - // see https://issues.apache.org/activemq/browse/AMQ-2475 - if (matched.tryAddMessageLast(node, 10)) { - break; - } - } - } - synchronized (matchedListMutex) { - // NOTE - be careful about the slaveBroker! - if (maximumPendingMessages > 0) { - // calculate the high water mark from which point we - // will eagerly evict expired messages - int max = messageEvictionStrategy.getEvictExpiredMessagesHighWatermark(); - if (maximumPendingMessages > 0 && maximumPendingMessages < max) { - max = maximumPendingMessages; - } - if (!matched.isEmpty() && matched.size() > max) { - removeExpiredMessages(); - } - // lets discard old messages as we are a slow consumer - while (!matched.isEmpty() && matched.size() > maximumPendingMessages) { - int pageInSize = matched.size() - maximumPendingMessages; - // only page in a 1000 at a time - else we could blow the memory - pageInSize = Math.max(1000, pageInSize); - LinkedList list = null; - MessageReference[] oldMessages=null; - synchronized(matched){ - list = matched.pageInList(pageInSize); - oldMessages = messageEvictionStrategy.evictMessages(list); - for (MessageReference ref : list) { - ref.decrementReferenceCount(); - } - } - int messagesToEvict = 0; - if (oldMessages != null){ - messagesToEvict = oldMessages.length; - for (int i = 0; i < messagesToEvict; i++) { - MessageReference oldMessage = oldMessages[i]; - discard(oldMessage); - } - } - // lets avoid an infinite loop if we are given a bad eviction strategy - // for a bad strategy lets just not evict - if (messagesToEvict == 0) { - LOG.warn("No messages to evict returned for {} from eviction strategy: {} out of {} candidates", new Object[]{ - destination, messageEvictionStrategy, list.size() - }); - break; - } - } - } - } - dispatchMatched(); - } - } - } - - private boolean isDuplicate(MessageReference node) { - boolean duplicate = false; - if (enableAudit && audit != null) { - duplicate = audit.isDuplicate(node); - if (LOG.isDebugEnabled()) { - if (duplicate) { - LOG.debug("{}, ignoring duplicate add: {}", this, node.getMessageId()); - } - } - } - return duplicate; - } - - /** - * Discard any expired messages from the matched list. Called from a - * synchronized block. - * - * @throws IOException - */ - protected void removeExpiredMessages() throws IOException { - try { - matched.reset(); - while (matched.hasNext()) { - MessageReference node = matched.next(); - node.decrementReferenceCount(); - if (broker.isExpired(node)) { - matched.remove(); - dispatchedCounter.incrementAndGet(); - node.decrementReferenceCount(); - ((Destination)node.getRegionDestination()).getDestinationStatistics().getExpired().increment(); - broker.messageExpired(getContext(), node, this); - break; - } - } - } finally { - matched.release(); - } - } - - @Override - public void processMessageDispatchNotification(MessageDispatchNotification mdn) { - synchronized (matchedListMutex) { - try { - matched.reset(); - while (matched.hasNext()) { - MessageReference node = matched.next(); - node.decrementReferenceCount(); - if (node.getMessageId().equals(mdn.getMessageId())) { - matched.remove(); - dispatchedCounter.incrementAndGet(); - node.decrementReferenceCount(); - break; - } - } - } finally { - matched.release(); - } - } - } - - @Override - public synchronized void acknowledge(final ConnectionContext context, final MessageAck ack) throws Exception { - super.acknowledge(context, ack); - - // Handle the standard acknowledgment case. - if (ack.isStandardAck() || ack.isPoisonAck() || ack.isIndividualAck()) { - if (context.isInTransaction()) { - context.getTransaction().addSynchronization(new Synchronization() { - - @Override - public void afterCommit() throws Exception { - synchronized (TopicSubscription.this) { - if (singleDestination && destination != null) { - destination.getDestinationStatistics().getDequeues().add(ack.getMessageCount()); - } - } - dequeueCounter.addAndGet(ack.getMessageCount()); - dispatchMatched(); - } - }); - } else { - if (singleDestination && destination != null) { - destination.getDestinationStatistics().getDequeues().add(ack.getMessageCount()); - destination.getDestinationStatistics().getInflight().subtract(ack.getMessageCount()); - } - dequeueCounter.addAndGet(ack.getMessageCount()); - } - dispatchMatched(); - return; - } else if (ack.isDeliveredAck()) { - // Message was delivered but not acknowledged: update pre-fetch counters. - // also. get these for a consumer expired message. - if (destination != null && !ack.isInTransaction()) { - destination.getDestinationStatistics().getDequeues().add(ack.getMessageCount()); - destination.getDestinationStatistics().getInflight().subtract(ack.getMessageCount()); - } - dequeueCounter.addAndGet(ack.getMessageCount()); - dispatchMatched(); - return; - } else if (ack.isRedeliveredAck()) { - // nothing to do atm - return; - } - throw new JMSException("Invalid acknowledgment: " + ack); - } - - @Override - public Response pullMessage(ConnectionContext context, MessagePull pull) throws Exception { - - // The slave should not deliver pull messages. - if (getPrefetchSize() == 0 ) { - - prefetchWindowOpen.set(true); - dispatchMatched(); - - // If there was nothing dispatched.. we may need to setup a timeout. - if (prefetchWindowOpen.get()) { - - // immediate timeout used by receiveNoWait() - if (pull.getTimeout() == -1) { - prefetchWindowOpen.set(false); - // Send a NULL message to signal nothing pending. - dispatch(null); - } - - if (pull.getTimeout() > 0) { - scheduler.executeAfterDelay(new Runnable() { - - @Override - public void run() { - pullTimeout(); - } - }, pull.getTimeout()); - } - } - } - return null; - } - - /** - * Occurs when a pull times out. If nothing has been dispatched since the - * timeout was setup, then send the NULL message. - */ - private final void pullTimeout() { - synchronized (matchedListMutex) { - if (prefetchWindowOpen.compareAndSet(true, false)) { - try { - dispatch(null); - } catch (Exception e) { - context.getConnection().serviceException(e); - } - } - } - } - - @Override - public int getPendingQueueSize() { - return matched(); - } - - @Override - public int getDispatchedQueueSize() { - return (int)(dispatchedCounter.get() - dequeueCounter.get()); - } - - public int getMaximumPendingMessages() { - return maximumPendingMessages; - } - - @Override - public long getDispatchedCounter() { - return dispatchedCounter.get(); - } - - @Override - public long getEnqueueCounter() { - return enqueueCounter.get(); - } - - @Override - public long getDequeueCounter() { - return dequeueCounter.get(); - } - - /** - * @return the number of messages discarded due to being a slow consumer - */ - public int discarded() { - synchronized (matchedListMutex) { - return discarded; - } - } - - /** - * @return the number of matched messages (messages targeted for the - * subscription but not yet able to be dispatched due to the - * prefetch buffer being full). - */ - public int matched() { - synchronized (matchedListMutex) { - return matched.size(); - } - } - - /** - * Sets the maximum number of pending messages that can be matched against - * this consumer before old messages are discarded. - */ - public void setMaximumPendingMessages(int maximumPendingMessages) { - this.maximumPendingMessages = maximumPendingMessages; - } - - public MessageEvictionStrategy getMessageEvictionStrategy() { - return messageEvictionStrategy; - } - - /** - * Sets the eviction strategy used to decide which message to evict when the - * slow consumer needs to discard messages - */ - public void setMessageEvictionStrategy(MessageEvictionStrategy messageEvictionStrategy) { - this.messageEvictionStrategy = messageEvictionStrategy; - } - - public int getMaxProducersToAudit() { - return maxProducersToAudit; - } - - public synchronized void setMaxProducersToAudit(int maxProducersToAudit) { - this.maxProducersToAudit = maxProducersToAudit; - if (audit != null) { - audit.setMaximumNumberOfProducersToTrack(maxProducersToAudit); - } - } - - public int getMaxAuditDepth() { - return maxAuditDepth; - } - - public synchronized void setMaxAuditDepth(int maxAuditDepth) { - this.maxAuditDepth = maxAuditDepth; - if (audit != null) { - audit.setAuditDepth(maxAuditDepth); - } - } - - public boolean isEnableAudit() { - return enableAudit; - } - - public synchronized void setEnableAudit(boolean enableAudit) { - this.enableAudit = enableAudit; - if (enableAudit && audit == null) { - audit = new ActiveMQMessageAudit(maxAuditDepth,maxProducersToAudit); - } - } - - // Implementation methods - // ------------------------------------------------------------------------- - @Override - public boolean isFull() { - return getDispatchedQueueSize() >= info.getPrefetchSize() && !prefetchWindowOpen.get(); - } - - @Override - public int getInFlightSize() { - return getDispatchedQueueSize(); - } - - /** - * @return true when 60% or more room is left for dispatching messages - */ - @Override - public boolean isLowWaterMark() { - return getDispatchedQueueSize() <= (info.getPrefetchSize() * .4); - } - - /** - * @return true when 10% or less room is left for dispatching messages - */ - @Override - public boolean isHighWaterMark() { - return getDispatchedQueueSize() >= (info.getPrefetchSize() * .9); - } - - /** - * @param memoryUsageHighWaterMark the memoryUsageHighWaterMark to set - */ - public void setMemoryUsageHighWaterMark(int memoryUsageHighWaterMark) { - this.memoryUsageHighWaterMark = memoryUsageHighWaterMark; - } - - /** - * @return the memoryUsageHighWaterMark - */ - public int getMemoryUsageHighWaterMark() { - return this.memoryUsageHighWaterMark; - } - - /** - * @return the usageManager - */ - public SystemUsage getUsageManager() { - return this.usageManager; - } - - /** - * @return the matched - */ - public PendingMessageCursor getMatched() { - return this.matched; - } - - /** - * @param matched the matched to set - */ - public void setMatched(PendingMessageCursor matched) { - this.matched = matched; - } - - /** - * inform the MessageConsumer on the client to change it's prefetch - * - * @param newPrefetch - */ - @Override - public void updateConsumerPrefetch(int newPrefetch) { - if (context != null && context.getConnection() != null && context.getConnection().isManageable()) { - ConsumerControl cc = new ConsumerControl(); - cc.setConsumerId(info.getConsumerId()); - cc.setPrefetch(newPrefetch); - context.getConnection().dispatchAsync(cc); - } - } - - private void dispatchMatched() throws IOException { - synchronized (matchedListMutex) { - if (!matched.isEmpty() && !isFull()) { - try { - matched.reset(); - - while (matched.hasNext() && !isFull()) { - MessageReference message = matched.next(); - message.decrementReferenceCount(); - matched.remove(); - // Message may have been sitting in the matched list a while - // waiting for the consumer to ak the message. - if (message.isExpired()) { - discard(message); - continue; // just drop it. - } - dispatch(message); - prefetchWindowOpen.set(false); - } - } finally { - matched.release(); - } - } - } - } - - private void dispatch(final MessageReference node) throws IOException { - Message message = node.getMessage(); - if (node != null) { - node.incrementReferenceCount(); - } - // Make sure we can dispatch a message. - MessageDispatch md = new MessageDispatch(); - md.setMessage(message); - md.setConsumerId(info.getConsumerId()); - if (node != null) { - md.setDestination(((Destination)node.getRegionDestination()).getActiveMQDestination()); - dispatchedCounter.incrementAndGet(); - // Keep track if this subscription is receiving messages from a single destination. - if (singleDestination) { - if (destination == null) { - destination = (Destination)node.getRegionDestination(); - } else { - if (destination != node.getRegionDestination()) { - singleDestination = false; - } - } - } - } - if (info.isDispatchAsync()) { - if (node != null) { - md.setTransmitCallback(new TransmitCallback() { - - @Override - public void onSuccess() { - Destination regionDestination = (Destination) node.getRegionDestination(); - regionDestination.getDestinationStatistics().getDispatched().increment(); - regionDestination.getDestinationStatistics().getInflight().increment(); - node.decrementReferenceCount(); - } - - @Override - public void onFailure() { - Destination regionDestination = (Destination) node.getRegionDestination(); - regionDestination.getDestinationStatistics().getDispatched().increment(); - regionDestination.getDestinationStatistics().getInflight().increment(); - node.decrementReferenceCount(); - } - }); - } - context.getConnection().dispatchAsync(md); - } else { - context.getConnection().dispatchSync(md); - if (node != null) { - Destination regionDestination = (Destination) node.getRegionDestination(); - regionDestination.getDestinationStatistics().getDispatched().increment(); - regionDestination.getDestinationStatistics().getInflight().increment(); - node.decrementReferenceCount(); - } - } - } - - private void discard(MessageReference message) { - message.decrementReferenceCount(); - matched.remove(message); - discarded++; - if(destination != null) { - destination.getDestinationStatistics().getDequeues().increment(); - } - LOG.debug("{}, discarding message {}", this, message); - Destination dest = (Destination) message.getRegionDestination(); - if (dest != null) { - dest.messageDiscarded(getContext(), this, message); - } - broker.getRoot().sendToDeadLetterQueue(getContext(), message, this, new Throwable("TopicSubDiscard. ID:" + info.getConsumerId())); - } - - @Override - public String toString() { - return "TopicSubscription:" + " consumer=" + info.getConsumerId() + ", destinations=" + destinations.size() + ", dispatched=" + getDispatchedQueueSize() + ", delivered=" - + getDequeueCounter() + ", matched=" + matched() + ", discarded=" + discarded(); - } - - @Override - public void destroy() { - this.active=false; - synchronized (matchedListMutex) { - try { - matched.destroy(); - } catch (Exception e) { - LOG.warn("Failed to destroy cursor", e); - } - } - setSlowConsumer(false); - } - - @Override - public int getPrefetchSize() { - return info.getPrefetchSize(); - } - - @Override - public void setPrefetchSize(int newSize) { - info.setPrefetchSize(newSize); - try { - dispatchMatched(); - } catch(Exception e) { - LOG.trace("Caught exception on dispatch after prefetch size change."); - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/AbstractPendingMessageCursor.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/AbstractPendingMessageCursor.class deleted file mode 100644 index d44897e42..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/AbstractPendingMessageCursor.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/AbstractPendingMessageCursor.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/AbstractPendingMessageCursor.java deleted file mode 100644 index b962a1a8d..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/AbstractPendingMessageCursor.java +++ /dev/null @@ -1,338 +0,0 @@ -/** - * 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.broker.region.cursors; - -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; -import java.util.Set; -import org.apache.activemq.ActiveMQMessageAudit; -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.region.BaseDestination; -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.command.MessageId; -import org.apache.activemq.usage.SystemUsage; - -/** - * Abstract method holder for pending message (messages awaiting disptach to a - * consumer) cursor - * - * - */ -public abstract class AbstractPendingMessageCursor implements PendingMessageCursor { - protected int memoryUsageHighWaterMark = 70; - protected int maxBatchSize = BaseDestination.MAX_PAGE_SIZE; - protected SystemUsage systemUsage; - protected int maxProducersToAudit = BaseDestination.MAX_PRODUCERS_TO_AUDIT; - protected int maxAuditDepth = BaseDestination.MAX_AUDIT_DEPTH; - protected boolean enableAudit=true; - protected ActiveMQMessageAudit audit; - protected boolean useCache=true; - private boolean cacheEnabled=true; - private boolean started=false; - protected MessageReference last = null; - protected final boolean prioritizedMessages; - - public AbstractPendingMessageCursor(boolean prioritizedMessages) { - this.prioritizedMessages=prioritizedMessages; - } - - - public synchronized void start() throws Exception { - if (!started && enableAudit && audit==null) { - audit= new ActiveMQMessageAudit(maxAuditDepth,maxProducersToAudit); - } - started=true; - } - - public synchronized void stop() throws Exception { - started=false; - gc(); - } - - public void add(ConnectionContext context, Destination destination) throws Exception { - } - - @SuppressWarnings("unchecked") - public List remove(ConnectionContext context, Destination destination) throws Exception { - return Collections.EMPTY_LIST; - } - - public boolean isRecoveryRequired() { - return true; - } - - public void addMessageFirst(MessageReference node) throws Exception { - } - - public void addMessageLast(MessageReference node) throws Exception { - } - - public boolean tryAddMessageLast(MessageReference node, long maxWaitTime) throws Exception { - addMessageLast(node); - return true; - } - - public void addRecoveredMessage(MessageReference node) throws Exception { - addMessageLast(node); - } - - public void clear() { - } - - public boolean hasNext() { - return false; - } - - public boolean isEmpty() { - return false; - } - - public boolean isEmpty(Destination destination) { - return isEmpty(); - } - - public MessageReference next() { - return null; - } - - public void remove() { - } - - public void reset() { - } - - public int size() { - return 0; - } - - public int getMaxBatchSize() { - return maxBatchSize; - } - - public void setMaxBatchSize(int maxBatchSize) { - this.maxBatchSize = maxBatchSize; - } - - protected void fillBatch() throws Exception { - } - - public void resetForGC() { - reset(); - } - - public void remove(MessageReference node) { - } - - public void gc() { - } - - public void setSystemUsage(SystemUsage usageManager) { - this.systemUsage = usageManager; - } - - public boolean hasSpace() { - return systemUsage != null ? (!systemUsage.getMemoryUsage().isFull(memoryUsageHighWaterMark)) : true; - } - - public boolean isFull() { - return systemUsage != null ? systemUsage.getMemoryUsage().isFull() : false; - } - - public void release() { - } - - public boolean hasMessagesBufferedToDeliver() { - return false; - } - - /** - * @return the memoryUsageHighWaterMark - */ - public int getMemoryUsageHighWaterMark() { - return memoryUsageHighWaterMark; - } - - /** - * @param memoryUsageHighWaterMark the memoryUsageHighWaterMark to set - */ - public void setMemoryUsageHighWaterMark(int memoryUsageHighWaterMark) { - this.memoryUsageHighWaterMark = memoryUsageHighWaterMark; - } - - /** - * @return the usageManager - */ - public SystemUsage getSystemUsage() { - return this.systemUsage; - } - - /** - * destroy the cursor - * - * @throws Exception - */ - public void destroy() throws Exception { - stop(); - } - - /** - * Page in a restricted number of messages - * - * @param maxItems maximum number of messages to return - * @return a list of paged in messages - */ - public LinkedList pageInList(int maxItems) { - throw new RuntimeException("Not supported"); - } - - /** - * @return the maxProducersToAudit - */ - public int getMaxProducersToAudit() { - return maxProducersToAudit; - } - - /** - * @param maxProducersToAudit the maxProducersToAudit to set - */ - public synchronized void setMaxProducersToAudit(int maxProducersToAudit) { - this.maxProducersToAudit = maxProducersToAudit; - if (audit != null) { - audit.setMaximumNumberOfProducersToTrack(maxProducersToAudit); - } - } - - /** - * @return the maxAuditDepth - */ - public int getMaxAuditDepth() { - return maxAuditDepth; - } - - - /** - * @param maxAuditDepth the maxAuditDepth to set - */ - public synchronized void setMaxAuditDepth(int maxAuditDepth) { - this.maxAuditDepth = maxAuditDepth; - if (audit != null) { - audit.setAuditDepth(maxAuditDepth); - } - } - - - /** - * @return the enableAudit - */ - public boolean isEnableAudit() { - return enableAudit; - } - - /** - * @param enableAudit the enableAudit to set - */ - public synchronized void setEnableAudit(boolean enableAudit) { - this.enableAudit = enableAudit; - if (enableAudit && started && audit==null) { - audit= new ActiveMQMessageAudit(maxAuditDepth,maxProducersToAudit); - } - } - - public boolean isTransient() { - return false; - } - - - /** - * set the audit - * @param audit new audit component - */ - public void setMessageAudit(ActiveMQMessageAudit audit) { - this.audit=audit; - } - - - /** - * @return the audit - */ - public ActiveMQMessageAudit getMessageAudit() { - return audit; - } - - public boolean isUseCache() { - return useCache; - } - - public void setUseCache(boolean useCache) { - this.useCache = useCache; - } - - public synchronized boolean isDuplicate(MessageId messageId) { - boolean unique = recordUniqueId(messageId); - rollback(messageId); - return !unique; - } - - /** - * records a message id and checks if it is a duplicate - * @param messageId - * @return true if id is unique, false otherwise. - */ - public synchronized boolean recordUniqueId(MessageId messageId) { - if (!enableAudit || audit==null) { - return true; - } - return !audit.isDuplicate(messageId); - } - - public synchronized void rollback(MessageId id) { - if (audit != null) { - audit.rollback(id); - } - } - - public synchronized boolean isStarted() { - return started; - } - - public static boolean isPrioritizedMessageSubscriber(Broker broker,Subscription sub) { - boolean result = false; - Set destinations = broker.getDestinations(sub.getActiveMQDestination()); - if (destinations != null) { - for (Destination dest:destinations) { - if (dest.isPrioritizedMessages()) { - result = true; - break; - } - } - } - return result; - - } - - public synchronized boolean isCacheEnabled() { - return cacheEnabled; - } - - public synchronized void setCacheEnabled(boolean val) { - cacheEnabled = val; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/AbstractStoreCursor.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/AbstractStoreCursor.class deleted file mode 100644 index 162406ba9..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/AbstractStoreCursor.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/AbstractStoreCursor.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/AbstractStoreCursor.java deleted file mode 100644 index 624c4f325..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/AbstractStoreCursor.java +++ /dev/null @@ -1,300 +0,0 @@ -/** - * 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.broker.region.cursors; - -import java.util.Iterator; -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.command.Message; -import org.apache.activemq.command.MessageId; -import org.apache.activemq.store.MessageRecoveryListener; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Store based cursor - * - */ -public abstract class AbstractStoreCursor extends AbstractPendingMessageCursor implements MessageRecoveryListener { - private static final Logger LOG = LoggerFactory.getLogger(AbstractStoreCursor.class); - protected final Destination regionDestination; - protected final PendingList batchList; - private Iterator iterator = null; - protected boolean batchResetNeeded = false; - private boolean storeHasMessages = false; - protected int size; - private MessageId lastCachedId; - protected boolean hadSpace = false; - - protected AbstractStoreCursor(Destination destination) { - super((destination != null ? destination.isPrioritizedMessages():false)); - this.regionDestination=destination; - if (this.prioritizedMessages) { - this.batchList= new PrioritizedPendingList(); - } else { - this.batchList = new OrderedPendingList(); - } - } - - - public final synchronized void start() throws Exception{ - if (!isStarted()) { - super.start(); - resetBatch(); - resetSize(); - setCacheEnabled(!this.storeHasMessages&&useCache); - } - } - - protected void resetSize() { - this.size = getStoreSize(); - this.storeHasMessages=this.size > 0; - } - - public final synchronized void stop() throws Exception { - resetBatch(); - super.stop(); - gc(); - } - - - public final boolean recoverMessage(Message message) throws Exception { - return recoverMessage(message,false); - } - - public synchronized boolean recoverMessage(Message message, boolean cached) throws Exception { - boolean recovered = false; - if (recordUniqueId(message.getMessageId())) { - if (!cached) { - message.setRegionDestination(regionDestination); - if( message.getMemoryUsage()==null ) { - message.setMemoryUsage(this.getSystemUsage().getMemoryUsage()); - } - } - message.incrementReferenceCount(); - batchList.addMessageLast(message); - clearIterator(true); - recovered = true; - storeHasMessages = true; - } else { - /* - * we should expect to get these - as the message is recorded as it before it goes into - * the cache. If subsequently, we pull out that message from the store (before its deleted) - * it will be a duplicate - but should be ignored - */ - LOG.trace("{} - cursor got duplicate: {}, {}", new Object[]{ this, message.getMessageId(), message.getPriority() }); - } - return recovered; - } - - - public final synchronized void reset() { - if (batchList.isEmpty()) { - try { - fillBatch(); - } catch (Exception e) { - LOG.error("{} - Failed to fill batch", this, e); - throw new RuntimeException(e); - } - } - clearIterator(true); - size(); - } - - - public synchronized void release() { - clearIterator(false); - } - - private synchronized void clearIterator(boolean ensureIterator) { - boolean haveIterator = this.iterator != null; - this.iterator=null; - if(haveIterator&&ensureIterator) { - ensureIterator(); - } - } - - private synchronized void ensureIterator() { - if(this.iterator==null) { - this.iterator=this.batchList.iterator(); - } - } - - - public final void finished() { - } - - - public final synchronized boolean hasNext() { - if (batchList.isEmpty()) { - try { - fillBatch(); - } catch (Exception e) { - LOG.error("{} - Failed to fill batch", this, e); - throw new RuntimeException(e); - } - } - ensureIterator(); - return this.iterator.hasNext(); - } - - - public final synchronized MessageReference next() { - MessageReference result = null; - if (!this.batchList.isEmpty()&&this.iterator.hasNext()) { - result = this.iterator.next(); - } - last = result; - if (result != null) { - result.incrementReferenceCount(); - } - return result; - } - - - public final synchronized void addMessageLast(MessageReference node) throws Exception { - boolean disableCache = false; - if (hasSpace()) { - if (!isCacheEnabled() && size==0 && isStarted() && useCache) { - LOG.trace("{} - enabling cache for empty store {}", this, node.getMessageId()); - setCacheEnabled(true); - } - if (isCacheEnabled()) { - if (recoverMessage(node.getMessage(),true)) { - lastCachedId = node.getMessageId(); - } else { - // failed to recover, possible duplicate from concurrent dispatchPending, - // lets not recover further in case of out of order - disableCache = true; - } - } - } else { - disableCache = true; - } - - if (disableCache && isCacheEnabled()) { - setCacheEnabled(false); - // sync with store on disabling the cache - if (lastCachedId != null) { - LOG.trace(this + "{} - disabling cache, lastCachedId: {} current node Id: {} batchList size: {}", new Object[]{ this, lastCachedId, node.getMessageId(), batchList.size() }); - setBatch(lastCachedId); - lastCachedId = null; - } - } - this.storeHasMessages = true; - size++; - } - - protected void setBatch(MessageId messageId) throws Exception { - } - - - public synchronized void addMessageFirst(MessageReference node) throws Exception { - setCacheEnabled(false); - size++; - } - - - public final synchronized void remove() { - size--; - if (iterator!=null) { - iterator.remove(); - } - if (last != null) { - last.decrementReferenceCount(); - } - } - - - public final synchronized void remove(MessageReference node) { - if (batchList.remove(node) != null) { - size--; - setCacheEnabled(false); - } - } - - - public final synchronized void clear() { - gc(); - } - - - public synchronized void gc() { - for (Iteratori = batchList.iterator();i.hasNext();) { - MessageReference msg = i.next(); - rollback(msg.getMessageId()); - msg.decrementReferenceCount(); - } - batchList.clear(); - clearIterator(false); - batchResetNeeded = true; - setCacheEnabled(false); - } - - protected final synchronized void fillBatch() { - LOG.trace("{} - fillBatch", this); - if (batchResetNeeded) { - resetSize(); - setMaxBatchSize(Math.min(regionDestination.getMaxPageSize(), size)); - resetBatch(); - this.batchResetNeeded = false; - } - if (this.batchList.isEmpty() && this.storeHasMessages && this.size >0) { - try { - doFillBatch(); - } catch (Exception e) { - LOG.error("{} - Failed to fill batch", this, e); - throw new RuntimeException(e); - } - this.storeHasMessages = !this.batchList.isEmpty() || !hadSpace; - } - } - - - public final synchronized boolean isEmpty() { - // negative means more messages added to store through queue.send since last reset - return size == 0; - } - - - public final synchronized boolean hasMessagesBufferedToDeliver() { - return !batchList.isEmpty(); - } - - - public final synchronized int size() { - if (size < 0) { - this.size = getStoreSize(); - } - return size; - } - - @Override - public String toString() { - return super.toString() + ":" + regionDestination.getActiveMQDestination().getPhysicalName() + ",batchResetNeeded=" + batchResetNeeded - + ",storeHasMessages=" + this.storeHasMessages + ",size=" + this.size + ",cacheEnabled=" + isCacheEnabled() - + ",maxBatchSize:" + maxBatchSize; - } - - protected abstract void doFillBatch() throws Exception; - - protected abstract void resetBatch(); - - protected abstract int getStoreSize(); - - protected abstract boolean isStoreEmpty(); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/FilePendingMessageCursor$DiskIterator.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/FilePendingMessageCursor$DiskIterator.class deleted file mode 100644 index 7986fe5fa..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/FilePendingMessageCursor$DiskIterator.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/FilePendingMessageCursor.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/FilePendingMessageCursor.class deleted file mode 100644 index d27f896a6..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/FilePendingMessageCursor.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/FilePendingMessageCursor.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/FilePendingMessageCursor.java deleted file mode 100644 index b1767e3fb..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/FilePendingMessageCursor.java +++ /dev/null @@ -1,528 +0,0 @@ -/** - * 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.broker.region.cursors; - -import java.io.IOException; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicLong; -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.IndirectMessageReference; -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.broker.region.QueueMessageReference; -import org.apache.activemq.command.Message; -import org.apache.activemq.filter.NonCachedMessageEvaluationContext; -import org.apache.activemq.openwire.OpenWireFormat; -import org.apache.activemq.store.PList; -import org.apache.activemq.store.PListStore; -import org.apache.activemq.store.PListEntry; -import org.apache.activemq.usage.SystemUsage; -import org.apache.activemq.usage.Usage; -import org.apache.activemq.usage.UsageListener; -import org.apache.activemq.wireformat.WireFormat; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.apache.activemq.util.ByteSequence; - -/** - * persist pending messages pending message (messages awaiting dispatch to a - * consumer) cursor - * - * - */ -public class FilePendingMessageCursor extends AbstractPendingMessageCursor implements UsageListener { - static final Logger LOG = LoggerFactory.getLogger(FilePendingMessageCursor.class); - private static final AtomicLong NAME_COUNT = new AtomicLong(); - protected Broker broker; - private final PListStore store; - private final String name; - private PendingList memoryList; - private PList diskList; - private Iterator iter; - private Destination regionDestination; - private boolean iterating; - private boolean flushRequired; - private final AtomicBoolean started = new AtomicBoolean(); - private final WireFormat wireFormat = new OpenWireFormat(); - /** - * @param broker - * @param name - * @param prioritizedMessages - */ - public FilePendingMessageCursor(Broker broker, String name, boolean prioritizedMessages) { - super(prioritizedMessages); - if (this.prioritizedMessages) { - this.memoryList = new PrioritizedPendingList(); - } else { - this.memoryList = new OrderedPendingList(); - } - this.broker = broker; - // the store can be null if the BrokerService has persistence - // turned off - this.store = broker.getTempDataStore(); - this.name = NAME_COUNT.incrementAndGet() + "_" + name; - } - - @Override - public void start() throws Exception { - if (started.compareAndSet(false, true)) { - if( this.broker != null) { - wireFormat.setVersion(this.broker.getBrokerService().getStoreOpenWireVersion()); - } - super.start(); - if (systemUsage != null) { - systemUsage.getMemoryUsage().addUsageListener(this); - } - } - } - - @Override - public void stop() throws Exception { - if (started.compareAndSet(true, false)) { - super.stop(); - if (systemUsage != null) { - systemUsage.getMemoryUsage().removeUsageListener(this); - } - } - } - - /** - * @return true if there are no pending messages - */ - @Override - public synchronized boolean isEmpty() { - if (memoryList.isEmpty() && isDiskListEmpty()) { - return true; - } - for (Iterator iterator = memoryList.iterator(); iterator.hasNext();) { - MessageReference node = iterator.next(); - if (node == QueueMessageReference.NULL_MESSAGE) { - continue; - } - if (!node.isDropped()) { - return false; - } - // We can remove dropped references. - iterator.remove(); - } - return isDiskListEmpty(); - } - - /** - * reset the cursor - */ - @Override - public synchronized void reset() { - iterating = true; - last = null; - if (isDiskListEmpty()) { - this.iter = this.memoryList.iterator(); - } else { - this.iter = new DiskIterator(); - } - } - - @Override - public synchronized void release() { - iterating = false; - if (iter instanceof DiskIterator) { - ((DiskIterator)iter).release(); - }; - if (flushRequired) { - flushRequired = false; - if (!hasSpace()) { - flushToDisk(); - } - } - // ensure any memory ref is released - iter = null; - } - - @Override - public synchronized void destroy() throws Exception { - stop(); - for (Iterator i = memoryList.iterator(); i.hasNext();) { - MessageReference node = i.next(); - node.decrementReferenceCount(); - } - memoryList.clear(); - destroyDiskList(); - } - - private void destroyDiskList() throws Exception { - if (diskList != null) { - store.removePList(name); - diskList = null; - } - } - - @Override - public synchronized LinkedList pageInList(int maxItems) { - LinkedList result = new LinkedList(); - int count = 0; - for (Iterator i = memoryList.iterator(); i.hasNext() && count < maxItems;) { - MessageReference ref = i.next(); - ref.incrementReferenceCount(); - result.add(ref); - count++; - } - if (count < maxItems && !isDiskListEmpty()) { - for (Iterator i = new DiskIterator(); i.hasNext() && count < maxItems;) { - Message message = (Message) i.next(); - message.setRegionDestination(regionDestination); - message.setMemoryUsage(this.getSystemUsage().getMemoryUsage()); - message.incrementReferenceCount(); - result.add(message); - count++; - } - } - return result; - } - - /** - * add message to await dispatch - * - * @param node - * @throws Exception - */ - @Override - public synchronized void addMessageLast(MessageReference node) throws Exception { - tryAddMessageLast(node, 0); - } - - @Override - public synchronized boolean tryAddMessageLast(MessageReference node, long maxWaitTime) throws Exception { - if (!node.isExpired()) { - try { - regionDestination = (Destination) node.getMessage().getRegionDestination(); - if (isDiskListEmpty()) { - if (hasSpace() || this.store == null) { - memoryList.addMessageLast(node); - node.incrementReferenceCount(); - setCacheEnabled(true); - return true; - } - } - if (!hasSpace()) { - if (isDiskListEmpty()) { - expireOldMessages(); - if (hasSpace()) { - memoryList.addMessageLast(node); - node.incrementReferenceCount(); - return true; - } else { - flushToDisk(); - } - } - } - if (systemUsage.getTempUsage().waitForSpace(maxWaitTime)) { - ByteSequence bs = getByteSequence(node.getMessage()); - getDiskList().addLast(node.getMessageId().toString(), bs); - return true; - } - return false; - - } catch (Exception e) { - LOG.error("Caught an Exception adding a message: {} first to FilePendingMessageCursor ", node, e); - throw new RuntimeException(e); - } - } else { - discardExpiredMessage(node); - } - //message expired - return true; - } - - /** - * add message to await dispatch - * - * @param node - */ - @Override - public synchronized void addMessageFirst(MessageReference node) { - if (!node.isExpired()) { - try { - regionDestination = (Destination) node.getMessage().getRegionDestination(); - if (isDiskListEmpty()) { - if (hasSpace()) { - memoryList.addMessageFirst(node); - node.incrementReferenceCount(); - setCacheEnabled(true); - return; - } - } - if (!hasSpace()) { - if (isDiskListEmpty()) { - expireOldMessages(); - if (hasSpace()) { - memoryList.addMessageFirst(node); - node.incrementReferenceCount(); - return; - } else { - flushToDisk(); - } - } - } - systemUsage.getTempUsage().waitForSpace(); - node.decrementReferenceCount(); - ByteSequence bs = getByteSequence(node.getMessage()); - Object locator = getDiskList().addFirst(node.getMessageId().toString(), bs); - node.getMessageId().setPlistLocator(locator); - - } catch (Exception e) { - LOG.error("Caught an Exception adding a message: {} first to FilePendingMessageCursor ", node, e); - throw new RuntimeException(e); - } - } else { - discardExpiredMessage(node); - } - } - - /** - * @return true if there pending messages to dispatch - */ - @Override - public synchronized boolean hasNext() { - return iter.hasNext(); - } - - /** - * @return the next pending message - */ - @Override - public synchronized MessageReference next() { - MessageReference reference = iter.next(); - last = reference; - if (!isDiskListEmpty()) { - // got from disk - reference.getMessage().setRegionDestination(regionDestination); - reference.getMessage().setMemoryUsage(this.getSystemUsage().getMemoryUsage()); - } - reference.incrementReferenceCount(); - return reference; - } - - /** - * remove the message at the cursor position - */ - @Override - public synchronized void remove() { - iter.remove(); - if (last != null) { - last.decrementReferenceCount(); - } - } - - /** - * @param node - * @see org.apache.activemq.broker.region.cursors.AbstractPendingMessageCursor#remove(org.apache.activemq.broker.region.MessageReference) - */ - @Override - public synchronized void remove(MessageReference node) { - if (memoryList.remove(node) != null) { - node.decrementReferenceCount(); - } - if (!isDiskListEmpty()) { - try { - getDiskList().remove(node.getMessageId().getPlistLocator()); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - } - - /** - * @return the number of pending messages - */ - @Override - public synchronized int size() { - return memoryList.size() + (isDiskListEmpty() ? 0 : (int)getDiskList().size()); - } - - /** - * clear all pending messages - */ - @Override - public synchronized void clear() { - memoryList.clear(); - if (!isDiskListEmpty()) { - try { - getDiskList().destroy(); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - last = null; - } - - @Override - public synchronized boolean isFull() { - - return super.isFull() || (!isDiskListEmpty() && systemUsage != null && systemUsage.getTempUsage().isFull()); - - } - - @Override - public boolean hasMessagesBufferedToDeliver() { - return !isEmpty(); - } - - @Override - public void setSystemUsage(SystemUsage usageManager) { - super.setSystemUsage(usageManager); - } - - public void onUsageChanged(Usage usage, int oldPercentUsage, int newPercentUsage) { - if (newPercentUsage >= getMemoryUsageHighWaterMark()) { - synchronized (this) { - if (!flushRequired && size() != 0) { - flushRequired =true; - if (!iterating) { - expireOldMessages(); - if (!hasSpace()) { - flushToDisk(); - flushRequired = false; - } - } - } - } - } - } - - @Override - public boolean isTransient() { - return true; - } - - protected boolean isSpaceInMemoryList() { - return hasSpace() && isDiskListEmpty(); - } - - protected synchronized void expireOldMessages() { - if (!memoryList.isEmpty()) { - for (Iterator iterator = memoryList.iterator(); iterator.hasNext();) { - MessageReference node = iterator.next(); - if (node.isExpired()) { - node.decrementReferenceCount(); - discardExpiredMessage(node); - iterator.remove(); - } - } - } - } - - protected synchronized void flushToDisk() { - if (!memoryList.isEmpty() && store != null) { - long start = 0; - if (LOG.isTraceEnabled()) { - start = System.currentTimeMillis(); - LOG.trace("{}, flushToDisk() mem list size: {} {}", new Object[]{ name, memoryList.size(), (systemUsage != null ? systemUsage.getMemoryUsage() : "") }); - } - for (Iterator iterator = memoryList.iterator(); iterator.hasNext();) { - MessageReference node = iterator.next(); - node.decrementReferenceCount(); - ByteSequence bs; - try { - bs = getByteSequence(node.getMessage()); - getDiskList().addLast(node.getMessageId().toString(), bs); - } catch (IOException e) { - LOG.error("Failed to write to disk list", e); - throw new RuntimeException(e); - } - - } - memoryList.clear(); - setCacheEnabled(false); - LOG.trace("{}, flushToDisk() done - {} ms {}", new Object[]{ name, (System.currentTimeMillis() - start), (systemUsage != null ? systemUsage.getMemoryUsage() : "") }); - } - } - - protected boolean isDiskListEmpty() { - return diskList == null || diskList.isEmpty(); - } - - public PList getDiskList() { - if (diskList == null) { - try { - diskList = store.getPList(name); - } catch (Exception e) { - LOG.error("Caught an IO Exception getting the DiskList {}", name, e); - throw new RuntimeException(e); - } - } - return diskList; - } - - private void discardExpiredMessage(MessageReference reference) { - LOG.debug("Discarding expired message {}", reference); - if (broker.isExpired(reference)) { - ConnectionContext context = new ConnectionContext(new NonCachedMessageEvaluationContext()); - context.setBroker(broker); - ((Destination)reference.getRegionDestination()).messageExpired(context, null, new IndirectMessageReference(reference.getMessage())); - } - } - - protected ByteSequence getByteSequence(Message message) throws IOException { - org.apache.activemq.util.ByteSequence packet = wireFormat.marshal(message); - return new ByteSequence(packet.data, packet.offset, packet.length); - } - - protected Message getMessage(ByteSequence bs) throws IOException { - org.apache.activemq.util.ByteSequence packet = new org.apache.activemq.util.ByteSequence(bs.getData(), bs - .getOffset(), bs.getLength()); - return (Message) this.wireFormat.unmarshal(packet); - - } - - final class DiskIterator implements Iterator { - private final PList.PListIterator iterator; - DiskIterator() { - try { - iterator = getDiskList().iterator(); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - public boolean hasNext() { - return iterator.hasNext(); - } - - public MessageReference next() { - try { - PListEntry entry = iterator.next(); - Message message = getMessage(entry.getByteSequence()); - message.getMessageId().setPlistLocator(entry.getLocator()); - return message; - } catch (IOException e) { - LOG.error("I/O error", e); - throw new RuntimeException(e); - } - } - - public void remove() { - iterator.remove(); - } - - public void release() { - iterator.release(); - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/OrderedPendingList$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/OrderedPendingList$1.class deleted file mode 100644 index c6b805c1a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/OrderedPendingList$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/OrderedPendingList.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/OrderedPendingList.class deleted file mode 100644 index 779af1730..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/OrderedPendingList.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/OrderedPendingList.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/OrderedPendingList.java deleted file mode 100644 index 33062e7d7..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/OrderedPendingList.java +++ /dev/null @@ -1,167 +0,0 @@ -/** - * 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.broker.region.cursors; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.command.MessageId; - -public class OrderedPendingList implements PendingList { - - private PendingNode root = null; - private PendingNode tail = null; - private final Map map = new HashMap(); - - public PendingNode addMessageFirst(MessageReference message) { - PendingNode node = new PendingNode(this, message); - if (root == null) { - root = node; - tail = node; - } else { - root.linkBefore(node); - root = node; - } - this.map.put(message.getMessageId(), node); - return node; - } - - public PendingNode addMessageLast(MessageReference message) { - PendingNode node = new PendingNode(this, message); - if (root == null) { - root = node; - } else { - tail.linkAfter(node); - } - tail = node; - this.map.put(message.getMessageId(), node); - return node; - } - - public void clear() { - this.root = null; - this.tail = null; - this.map.clear(); - } - - public boolean isEmpty() { - return this.map.isEmpty(); - } - - public Iterator iterator() { - return new Iterator() { - private PendingNode current = null; - private PendingNode next = root; - - public boolean hasNext() { - return next != null; - } - - public MessageReference next() { - MessageReference result = null; - this.current = this.next; - result = this.current.getMessage(); - this.next = (PendingNode) this.next.getNext(); - return result; - } - - public void remove() { - if (this.current != null && this.current.getMessage() != null) { - map.remove(this.current.getMessage().getMessageId()); - } - removeNode(this.current); - } - }; - } - - public PendingNode remove(MessageReference message) { - PendingNode node = null; - if (message != null) { - node = this.map.remove(message.getMessageId()); - removeNode(node); - } - return node; - } - - public int size() { - return this.map.size(); - } - - void removeNode(PendingNode node) { - if (node != null) { - map.remove(node.getMessage().getMessageId()); - if (root == node) { - root = (PendingNode) node.getNext(); - } - if (tail == node) { - tail = (PendingNode) node.getPrevious(); - } - node.unlink(); - } - } - - List getAsList() { - List result = new ArrayList(size()); - PendingNode node = root; - while (node != null) { - result.add(node); - node = (PendingNode) node.getNext(); - } - return result; - } - - @Override - public String toString() { - return "OrderedPendingList(" + System.identityHashCode(this) + ")"; - } - - @Override - public boolean contains(MessageReference message) { - if (message != null) { - for (PendingNode value : map.values()) { - if (value.getMessage().equals(message)) { - return true; - } - } - } - return false; - } - - @Override - public Collection values() { - List messageReferences = new ArrayList(); - Iterator iterator = iterator(); - while (iterator.hasNext()) { - messageReferences.add(iterator.next()); - } - return messageReferences; - } - - @Override - public void addAll(PendingList pendingList) { - if (pendingList != null) { - for(MessageReference messageReference : pendingList) { - addMessageLast(messageReference); - } - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/PendingList.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/PendingList.class deleted file mode 100644 index 01e75cbcf..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/PendingList.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/PendingList.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/PendingList.java deleted file mode 100644 index a44d80e6f..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/PendingList.java +++ /dev/null @@ -1,111 +0,0 @@ -/** - * 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.broker.region.cursors; - -import java.util.Collection; -import java.util.Iterator; - -import org.apache.activemq.broker.region.MessageReference; - -public interface PendingList extends Iterable { - - /** - * Returns true if there are no Messages in the PendingList currently. - * @return true if the PendingList is currently empty. - */ - public boolean isEmpty(); - - /** - * Discards all Messages currently held in the PendingList. - */ - public void clear(); - - /** - * Adds the given message to the head of the list. - * - * @param message - * The MessageReference that is to be added to this list. - * - * @return the PendingNode that contains the newly added message. - */ - public PendingNode addMessageFirst(MessageReference message); - - /** - * Adds the given message to the tail of the list. - * - * @param message - * The MessageReference that is to be added to this list. - * - * @return the PendingNode that contains the newly added message. - */ - public PendingNode addMessageLast(MessageReference message); - - /** - * Removes the given MessageReference from the PendingList if it is - * contained within. - * - * @param message - * The MessageReference that is to be removed to this list. - * - * @return the PendingNode that contains the removed message or null if the - * message was not present in this list. - */ - public PendingNode remove(MessageReference message); - - /** - * Returns the number of MessageReferences that are awaiting dispatch. - * @return current count of the pending messages. - */ - public int size(); - - /** - * Returns an iterator over the pending Messages. The subclass controls how - * the returned iterator actually traverses the list of pending messages allowing - * for the order to vary based on factors like Message priority or some other - * mechanism. - * - * @return an Iterator that returns MessageReferences contained in this list. - */ - public Iterator iterator(); - - /** - * Query the PendingList to determine if the given message is contained within. - * - * @param message - * The Message that is the target of this query. - * - * @return true if the MessageReference is contained in this list. - */ - public boolean contains(MessageReference message); - - /** - * Returns a new Collection that contains all the MessageReferences currently - * held in this PendingList. The elements of the list are ordered using the - * same rules as the subclass uses for iteration. - * - * @return a new Collection containing this lists MessageReferences. - */ - public Collection values(); - - /** - * Adds all the elements of the given PendingList to this PendingList. - * - * @param pendingList - * The PendingList that is to be added to this collection. - */ - public void addAll(PendingList pendingList); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/PendingMessageCursor.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/PendingMessageCursor.class deleted file mode 100644 index 75ea33da1..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/PendingMessageCursor.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/PendingMessageCursor.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/PendingMessageCursor.java deleted file mode 100644 index 52e517438..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/PendingMessageCursor.java +++ /dev/null @@ -1,303 +0,0 @@ -/** - * 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.broker.region.cursors; - -import java.io.IOException; -import java.util.LinkedList; -import java.util.List; -import org.apache.activemq.ActiveMQMessageAudit; -import org.apache.activemq.Service; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.command.MessageId; -import org.apache.activemq.usage.SystemUsage; - -/** - * Interface to pending message (messages awaiting disptach to a consumer) - * cursor - * - * - */ -public interface PendingMessageCursor extends Service { - - /** - * Add a destination - * - * @param context - * @param destination - * @throws Exception - */ - void add(ConnectionContext context, Destination destination) throws Exception; - - /** - * remove a destination - * - * @param context - * @param destination - * @throws Exception - */ - List remove(ConnectionContext context, Destination destination) throws Exception; - - /** - * @return true if there are no pending messages - */ - boolean isEmpty(); - - /** - * check if a Destination is Empty for this cursor - * - * @param destination - * @return true id the Destination is empty - */ - boolean isEmpty(Destination destination); - - /** - * reset the cursor - */ - void reset(); - - /** - * hint to the cursor to release any locks it might have grabbed after a - * reset - */ - void release(); - - /** - * add message to await dispatch - * - * @param node - * @throws IOException - * @throws Exception - */ - void addMessageLast(MessageReference node) throws Exception; - /** - * add message to await dispatch - if it can - * - * @param node - * @param maxWaitTime - * @return true if successful - * @throws IOException - * @throws Exception - */ - boolean tryAddMessageLast(MessageReference node, long maxWaitTime) throws Exception; - - /** - * add message to await dispatch - * - * @param node - * @throws Exception - */ - void addMessageFirst(MessageReference node) throws Exception; - - /** - * Add a message recovered from a retroactive policy - * - * @param node - * @throws Exception - */ - void addRecoveredMessage(MessageReference node) throws Exception; - - /** - * @return true if there pending messages to dispatch - */ - boolean hasNext(); - - /** - * @return the next pending message with its reference count increment - */ - MessageReference next(); - - /** - * remove the message at the cursor position - */ - void remove(); - - /** - * @return the number of pending messages - */ - int size(); - - /** - * clear all pending messages - */ - void clear(); - - /** - * Informs the Broker if the subscription needs to intervention to recover - * it's state e.g. DurableTopicSubscriber may do - * - * @return true if recovery required - */ - boolean isRecoveryRequired(); - - /** - * @return the maximum batch size - */ - int getMaxBatchSize(); - - /** - * Set the max batch size - * - * @param maxBatchSize - */ - void setMaxBatchSize(int maxBatchSize); - - /** - * Give the cursor a hint that we are about to remove messages from memory - * only - */ - void resetForGC(); - - /** - * remove a node - * - * @param node - */ - void remove(MessageReference node); - - /** - * free up any internal buffers - */ - void gc(); - - /** - * Set the UsageManager - * - * @param systemUsage - * @see org.apache.activemq.usage.SystemUsage - */ - void setSystemUsage(SystemUsage systemUsage); - - /** - * @return the usageManager - */ - SystemUsage getSystemUsage(); - - /** - * @return the memoryUsageHighWaterMark - */ - int getMemoryUsageHighWaterMark(); - - /** - * @param memoryUsageHighWaterMark the memoryUsageHighWaterMark to set - */ - void setMemoryUsageHighWaterMark(int memoryUsageHighWaterMark); - - /** - * @return true if the cursor is full - */ - boolean isFull(); - - /** - * @return true if the cursor has space to page messages into - */ - public boolean hasSpace(); - - /** - * @return true if the cursor has buffered messages ready to deliver - */ - boolean hasMessagesBufferedToDeliver(); - - /** - * destroy the cursor - * - * @throws Exception - */ - void destroy() throws Exception; - - /** - * Page in a restricted number of messages and increment the reference count - * - * @param maxItems - * @return a list of paged in messages - */ - LinkedList pageInList(int maxItems); - - /** - * set the maximum number of producers to track at one time - * @param value - */ - void setMaxProducersToAudit(int value); - - /** - * @return the maximum number of producers to audit - */ - int getMaxProducersToAudit(); - - /** - * Set the maximum depth of message ids to track - * @param depth - */ - void setMaxAuditDepth(int depth); - - /** - * @return the audit depth - */ - int getMaxAuditDepth(); - - /** - * @return the enableAudit - */ - public boolean isEnableAudit(); - /** - * @param enableAudit the enableAudit to set - */ - public void setEnableAudit(boolean enableAudit); - - /** - * @return true if the underlying state of this cursor - * disappears when the broker shuts down - */ - public boolean isTransient(); - - - /** - * set the audit - * @param audit - */ - public void setMessageAudit(ActiveMQMessageAudit audit); - - - /** - * @return the audit - could be null - */ - public ActiveMQMessageAudit getMessageAudit(); - - /** - * use a cache to improve performance - * @param useCache - */ - public void setUseCache(boolean useCache); - - /** - * @return true if a cache may be used - */ - public boolean isUseCache(); - - /** - * remove from auditing the message id - * @param id - */ - public void rollback(MessageId id); - - /** - * @return true if cache is being used - */ - public boolean isCacheEnabled(); - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/PendingNode.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/PendingNode.class deleted file mode 100644 index 82c4de4aa..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/PendingNode.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/PendingNode.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/PendingNode.java deleted file mode 100644 index 21cdcd096..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/PendingNode.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * 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.broker.region.cursors; - -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.util.LinkedNode; - -public class PendingNode extends LinkedNode { - private final MessageReference message; - private final OrderedPendingList list; - public PendingNode(OrderedPendingList list,MessageReference message) { - this.list = list; - this.message = message; - } - - MessageReference getMessage() { - return this.message; - } - - OrderedPendingList getList() { - return this.list; - } - - @Override - public String toString() { - PendingNode n = (PendingNode) getNext(); - String str = "PendingNode("; - str += System.identityHashCode(this) + "),root="+isHeadNode()+",next="+(n != null ?System.identityHashCode(n):"NULL"); - return str; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/PrioritizedPendingList$PrioritizedPendingListIterator.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/PrioritizedPendingList$PrioritizedPendingListIterator.class deleted file mode 100644 index db6a976ba..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/PrioritizedPendingList$PrioritizedPendingListIterator.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/PrioritizedPendingList.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/PrioritizedPendingList.class deleted file mode 100644 index 3cf5e6cdc..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/PrioritizedPendingList.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/PrioritizedPendingList.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/PrioritizedPendingList.java deleted file mode 100644 index 0772b201b..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/PrioritizedPendingList.java +++ /dev/null @@ -1,159 +0,0 @@ -/** - * 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.broker.region.cursors; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.command.MessageId; - -public class PrioritizedPendingList implements PendingList { - - private static final Integer MAX_PRIORITY = 10; - private final OrderedPendingList[] lists = new OrderedPendingList[MAX_PRIORITY]; - private final Map map = new HashMap(); - - public PrioritizedPendingList() { - for (int i = 0; i < MAX_PRIORITY; i++) { - this.lists[i] = new OrderedPendingList(); - } - } - - public PendingNode addMessageFirst(MessageReference message) { - PendingNode node = getList(message).addMessageFirst(message); - this.map.put(message.getMessageId(), node); - return node; - } - - public PendingNode addMessageLast(MessageReference message) { - PendingNode node = getList(message).addMessageLast(message); - this.map.put(message.getMessageId(), node); - return node; - } - - public void clear() { - for (int i = 0; i < MAX_PRIORITY; i++) { - this.lists[i].clear(); - } - this.map.clear(); - } - - public boolean isEmpty() { - return this.map.isEmpty(); - } - - public Iterator iterator() { - return new PrioritizedPendingListIterator(); - } - - public PendingNode remove(MessageReference message) { - PendingNode node = null; - if (message != null) { - node = this.map.remove(message.getMessageId()); - if (node != null) { - node.getList().removeNode(node); - } - } - return node; - } - - public int size() { - return this.map.size(); - } - - @Override - public String toString() { - return "PrioritizedPendingList(" + System.identityHashCode(this) + ")"; - } - - protected int getPriority(MessageReference message) { - int priority = javax.jms.Message.DEFAULT_PRIORITY; - if (message.getMessageId() != null) { - priority = Math.max(message.getMessage().getPriority(), 0); - priority = Math.min(priority, 9); - } - return priority; - } - - protected OrderedPendingList getList(MessageReference msg) { - return lists[getPriority(msg)]; - } - - private class PrioritizedPendingListIterator implements Iterator { - private int index = 0; - private int currentIndex = 0; - List list = new ArrayList(size()); - - PrioritizedPendingListIterator() { - for (int i = MAX_PRIORITY - 1; i >= 0; i--) { - OrderedPendingList orderedPendingList = lists[i]; - if (!orderedPendingList.isEmpty()) { - list.addAll(orderedPendingList.getAsList()); - } - } - } - public boolean hasNext() { - return list.size() > index; - } - - public MessageReference next() { - PendingNode node = list.get(this.index); - this.currentIndex = this.index; - this.index++; - return node.getMessage(); - } - - public void remove() { - PendingNode node = list.get(this.currentIndex); - if (node != null) { - map.remove(node.getMessage().getMessageId()); - node.getList().removeNode(node); - } - } - } - - @Override - public boolean contains(MessageReference message) { - if (map.values().contains(message)) { - return true; - } - - return false; - } - - @Override - public Collection values() { - List messageReferences = new ArrayList(); - for (PendingNode pendingNode : map.values()) { - messageReferences.add(pendingNode.getMessage()); - } - return messageReferences; - } - - @Override - public void addAll(PendingList pendingList) { - for(MessageReference messageReference : pendingList) { - addMessageLast(messageReference); - } - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/QueueStorePrefetch.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/QueueStorePrefetch.class deleted file mode 100644 index 2546228b8..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/QueueStorePrefetch.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/QueueStorePrefetch.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/QueueStorePrefetch.java deleted file mode 100644 index b7fd289c2..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/QueueStorePrefetch.java +++ /dev/null @@ -1,110 +0,0 @@ -/** - * 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.broker.region.cursors; - -import java.io.IOException; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.BrokerService; -import org.apache.activemq.broker.region.Queue; -import org.apache.activemq.command.Message; -import org.apache.activemq.command.MessageId; -import org.apache.activemq.store.MessageStore; -import org.apache.activemq.store.memory.MemoryMessageStore; -import org.apache.activemq.store.memory.MemoryTransactionStore; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * persist pending messages pending message (messages awaiting dispatch to a - * consumer) cursor - * - * - */ -class QueueStorePrefetch extends AbstractStoreCursor { - private static final Logger LOG = LoggerFactory.getLogger(QueueStorePrefetch.class); - private final MessageStore store; - private final Broker broker; - - /** - * Construct it - * @param queue - */ - public QueueStorePrefetch(Queue queue, Broker broker) { - super(queue); - this.store = queue.getMessageStore(); - this.broker = broker; - - } - - public boolean recoverMessageReference(MessageId messageReference) throws Exception { - Message msg = this.store.getMessage(messageReference); - if (msg != null) { - return recoverMessage(msg); - } else { - String err = "Failed to retrieve message for id: " + messageReference; - LOG.error(err); - throw new IOException(err); - } - } - - - - @Override - protected synchronized int getStoreSize() { - try { - int result = this.store.getMessageCount(); - return result; - - } catch (IOException e) { - LOG.error("Failed to get message count", e); - throw new RuntimeException(e); - } - } - - @Override - protected synchronized boolean isStoreEmpty() { - try { - return this.store.isEmpty(); - - } catch (Exception e) { - LOG.error("Failed to get message count", e); - throw new RuntimeException(e); - } - } - - @Override - protected void resetBatch() { - this.store.resetBatching(); - } - - @Override - protected void setBatch(MessageId messageId) throws Exception { - store.setBatch(messageId); - batchResetNeeded = false; - } - - - @Override - protected void doFillBatch() throws Exception { - hadSpace = this.hasSpace(); - if (!broker.getBrokerService().isPersistent() || hadSpace) { - this.store.recoverNextMessages(this.maxBatchSize, this); - } - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/StoreDurableSubscriberCursor.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/StoreDurableSubscriberCursor.class deleted file mode 100644 index ae55063a4..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/StoreDurableSubscriberCursor.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/StoreDurableSubscriberCursor.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/StoreDurableSubscriberCursor.java deleted file mode 100644 index 6d03eeb0c..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/StoreDurableSubscriberCursor.java +++ /dev/null @@ -1,398 +0,0 @@ -/** - * 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.broker.region.cursors; - -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.CopyOnWriteArrayList; - -import org.apache.activemq.advisory.AdvisorySupport; -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.DurableTopicSubscription; -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.broker.region.Topic; -import org.apache.activemq.command.Message; -import org.apache.activemq.usage.SystemUsage; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * persist pending messages pending message (messages awaiting dispatch to a - * consumer) cursor - */ -public class StoreDurableSubscriberCursor extends AbstractPendingMessageCursor { - - private static final Logger LOG = LoggerFactory.getLogger(StoreDurableSubscriberCursor.class); - private final String clientId; - private final String subscriberName; - private final Map topics = new HashMap(); - private final List storePrefetches = new CopyOnWriteArrayList(); - private final PendingMessageCursor nonPersistent; - private PendingMessageCursor currentCursor; - private final DurableTopicSubscription subscription; - private boolean immediatePriorityDispatch = true; - - /** - * @param broker Broker for this cursor - * @param clientId clientId for this cursor - * @param subscriberName subscriber name for this cursor - * @param maxBatchSize currently ignored - * @param subscription subscription for this cursor - */ - public StoreDurableSubscriberCursor(Broker broker,String clientId, String subscriberName,int maxBatchSize, DurableTopicSubscription subscription) { - super(AbstractPendingMessageCursor.isPrioritizedMessageSubscriber(broker,subscription)); - this.subscription=subscription; - this.clientId = clientId; - this.subscriberName = subscriberName; - if (broker.getBrokerService().isPersistent()) { - this.nonPersistent = new FilePendingMessageCursor(broker,clientId + subscriberName,this.prioritizedMessages); - } else { - this.nonPersistent = new VMPendingMessageCursor(this.prioritizedMessages); - } - - this.nonPersistent.setMaxBatchSize(maxBatchSize); - this.nonPersistent.setSystemUsage(systemUsage); - this.storePrefetches.add(this.nonPersistent); - - if (prioritizedMessages) { - setMaxAuditDepth(10*getMaxAuditDepth()); - } - } - - @Override - public synchronized void start() throws Exception { - if (!isStarted()) { - super.start(); - for (PendingMessageCursor tsp : storePrefetches) { - tsp.setMessageAudit(getMessageAudit()); - tsp.start(); - } - } - } - - @Override - public synchronized void stop() throws Exception { - if (isStarted()) { - if (subscription.isKeepDurableSubsActive()) { - super.gc(); - for (PendingMessageCursor tsp : storePrefetches) { - tsp.gc(); - } - } else { - super.stop(); - for (PendingMessageCursor tsp : storePrefetches) { - tsp.stop(); - } - getMessageAudit().clear(); - } - } - } - - /** - * Add a destination - * - * @param context - * @param destination - * @throws Exception - */ - @Override - public synchronized void add(ConnectionContext context, Destination destination) throws Exception { - if (destination != null && !AdvisorySupport.isAdvisoryTopic(destination.getActiveMQDestination())) { - TopicStorePrefetch tsp = new TopicStorePrefetch(this.subscription,(Topic)destination, clientId, subscriberName); - tsp.setMaxBatchSize(destination.getMaxPageSize()); - tsp.setSystemUsage(systemUsage); - tsp.setMessageAudit(getMessageAudit()); - tsp.setEnableAudit(isEnableAudit()); - tsp.setMemoryUsageHighWaterMark(getMemoryUsageHighWaterMark()); - tsp.setUseCache(isUseCache()); - tsp.setCacheEnabled(isUseCache() && tsp.isEmpty()); - topics.put(destination, tsp); - storePrefetches.add(tsp); - if (isStarted()) { - tsp.start(); - } - } - } - - /** - * remove a destination - * - * @param context - * @param destination - * @throws Exception - */ - @Override - public synchronized List remove(ConnectionContext context, Destination destination) throws Exception { - PendingMessageCursor tsp = topics.remove(destination); - if (tsp != null) { - storePrefetches.remove(tsp); - } - return Collections.EMPTY_LIST; - } - - /** - * @return true if there are no pending messages - */ - @Override - public synchronized boolean isEmpty() { - for (PendingMessageCursor tsp : storePrefetches) { - if( !tsp.isEmpty() ) - return false; - } - return true; - } - - @Override - public synchronized boolean isEmpty(Destination destination) { - boolean result = true; - TopicStorePrefetch tsp = topics.get(destination); - if (tsp != null) { - result = tsp.isEmpty(); - } - return result; - } - - /** - * Informs the Broker if the subscription needs to intervention to recover - * it's state e.g. DurableTopicSubscriber may do - * - * @see org.apache.activemq.broker.region.cursors.AbstractPendingMessageCursor - * @return true if recovery required - */ - @Override - public boolean isRecoveryRequired() { - return false; - } - - @Override - public synchronized void addMessageLast(MessageReference node) throws Exception { - if (node != null) { - Message msg = node.getMessage(); - if (isStarted()) { - if (!msg.isPersistent()) { - nonPersistent.addMessageLast(node); - } - } - if (msg.isPersistent()) { - Destination dest = (Destination) msg.getRegionDestination(); - TopicStorePrefetch tsp = topics.get(dest); - if (tsp != null) { - tsp.addMessageLast(node); - if (prioritizedMessages && immediatePriorityDispatch && tsp.isPaging()) { - if (msg.getPriority() > tsp.getLastRecoveredPriority()) { - tsp.recoverMessage(node.getMessage(), true); - LOG.trace("cached high priority ({} message: {}, current paged batch priority: {}, cache size: {}", new Object[]{ msg.getPriority(), msg.getMessageId(), tsp.getLastRecoveredPriority(), tsp.batchList.size()}); - } - } - } - } - - } - } - - @Override - public boolean isTransient() { - return subscription.isKeepDurableSubsActive(); - } - - @Override - public void addMessageFirst(MessageReference node) throws Exception { - // for keep durable subs active, need to deal with redispatch - if (node != null) { - Message msg = node.getMessage(); - if (!msg.isPersistent()) { - nonPersistent.addMessageFirst(node); - } else { - Destination dest = (Destination) msg.getRegionDestination(); - TopicStorePrefetch tsp = topics.get(dest); - if (tsp != null) { - tsp.addMessageFirst(node); - } - } - } - } - - @Override - public synchronized void addRecoveredMessage(MessageReference node) throws Exception { - nonPersistent.addMessageLast(node); - } - - @Override - public synchronized void clear() { - for (PendingMessageCursor tsp : storePrefetches) { - tsp.clear(); - } - } - - @Override - public synchronized boolean hasNext() { - boolean result = true; - if (result) { - try { - currentCursor = getNextCursor(); - } catch (Exception e) { - LOG.error("Failed to get current cursor ", e); - throw new RuntimeException(e); - } - result = currentCursor != null ? currentCursor.hasNext() : false; - } - return result; - } - - @Override - public synchronized MessageReference next() { - MessageReference result = currentCursor != null ? currentCursor.next() : null; - return result; - } - - @Override - public synchronized void remove() { - if (currentCursor != null) { - currentCursor.remove(); - } - } - - @Override - public synchronized void remove(MessageReference node) { - for (PendingMessageCursor tsp : storePrefetches) { - tsp.remove(node); - } - } - - @Override - public synchronized void reset() { - for (PendingMessageCursor storePrefetch : storePrefetches) { - storePrefetch.reset(); - } - } - - @Override - public synchronized void release() { - this.currentCursor = null; - for (PendingMessageCursor storePrefetch : storePrefetches) { - storePrefetch.release(); - } - } - - @Override - public synchronized int size() { - int pendingCount=0; - for (PendingMessageCursor tsp : storePrefetches) { - pendingCount += tsp.size(); - } - return pendingCount; - } - - @Override - public void setMaxBatchSize(int newMaxBatchSize) { - for (PendingMessageCursor storePrefetch : storePrefetches) { - storePrefetch.setMaxBatchSize(newMaxBatchSize); - } - super.setMaxBatchSize(newMaxBatchSize); - } - - @Override - public synchronized void gc() { - for (PendingMessageCursor tsp : storePrefetches) { - tsp.gc(); - } - } - - @Override - public void setSystemUsage(SystemUsage usageManager) { - super.setSystemUsage(usageManager); - for (PendingMessageCursor tsp : storePrefetches) { - tsp.setSystemUsage(usageManager); - } - } - - @Override - public void setMemoryUsageHighWaterMark(int memoryUsageHighWaterMark) { - super.setMemoryUsageHighWaterMark(memoryUsageHighWaterMark); - for (PendingMessageCursor cursor : storePrefetches) { - cursor.setMemoryUsageHighWaterMark(memoryUsageHighWaterMark); - } - } - - @Override - public void setMaxProducersToAudit(int maxProducersToAudit) { - super.setMaxProducersToAudit(maxProducersToAudit); - for (PendingMessageCursor cursor : storePrefetches) { - cursor.setMaxAuditDepth(maxAuditDepth); - } - } - - @Override - public void setMaxAuditDepth(int maxAuditDepth) { - super.setMaxAuditDepth(maxAuditDepth); - for (PendingMessageCursor cursor : storePrefetches) { - cursor.setMaxAuditDepth(maxAuditDepth); - } - } - - @Override - public void setEnableAudit(boolean enableAudit) { - super.setEnableAudit(enableAudit); - for (PendingMessageCursor cursor : storePrefetches) { - cursor.setEnableAudit(enableAudit); - } - } - - @Override - public void setUseCache(boolean useCache) { - super.setUseCache(useCache); - for (PendingMessageCursor cursor : storePrefetches) { - cursor.setUseCache(useCache); - } - } - - protected synchronized PendingMessageCursor getNextCursor() throws Exception { - if (currentCursor == null || currentCursor.isEmpty()) { - currentCursor = null; - for (PendingMessageCursor tsp : storePrefetches) { - if (tsp.hasNext()) { - currentCursor = tsp; - break; - } - } - // round-robin - if (storePrefetches.size()>1) { - PendingMessageCursor first = storePrefetches.remove(0); - storePrefetches.add(first); - } - } - return currentCursor; - } - - @Override - public String toString() { - return "StoreDurableSubscriber(" + clientId + ":" + subscriberName + ")"; - } - - public boolean isImmediatePriorityDispatch() { - return immediatePriorityDispatch; - } - - public void setImmediatePriorityDispatch(boolean immediatePriorityDispatch) { - this.immediatePriorityDispatch = immediatePriorityDispatch; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/StoreQueueCursor.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/StoreQueueCursor.class deleted file mode 100644 index 4fd9192c5..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/StoreQueueCursor.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/StoreQueueCursor.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/StoreQueueCursor.java deleted file mode 100644 index 24f31c709..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/StoreQueueCursor.java +++ /dev/null @@ -1,312 +0,0 @@ -/** - * 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.broker.region.cursors; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.broker.region.Queue; -import org.apache.activemq.command.Message; -import org.apache.activemq.usage.SystemUsage; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Store based Cursor for Queues - */ -public class StoreQueueCursor extends AbstractPendingMessageCursor { - - private static final Logger LOG = LoggerFactory.getLogger(StoreQueueCursor.class); - private final Broker broker; - private int pendingCount; - private final Queue queue; - private PendingMessageCursor nonPersistent; - private final QueueStorePrefetch persistent; - private boolean started; - private PendingMessageCursor currentCursor; - - /** - * Construct - * @param broker - * @param queue - */ - public StoreQueueCursor(Broker broker,Queue queue) { - super((queue != null ? queue.isPrioritizedMessages():false)); - this.broker=broker; - this.queue = queue; - this.persistent = new QueueStorePrefetch(queue, broker); - currentCursor = persistent; - } - - public synchronized void start() throws Exception { - started = true; - super.start(); - if (nonPersistent == null) { - if (broker.getBrokerService().isPersistent()) { - nonPersistent = new FilePendingMessageCursor(broker,queue.getName(),this.prioritizedMessages); - }else { - nonPersistent = new VMPendingMessageCursor(this.prioritizedMessages); - } - nonPersistent.setMaxBatchSize(getMaxBatchSize()); - nonPersistent.setSystemUsage(systemUsage); - nonPersistent.setEnableAudit(isEnableAudit()); - nonPersistent.setMaxAuditDepth(getMaxAuditDepth()); - nonPersistent.setMaxProducersToAudit(getMaxProducersToAudit()); - } - nonPersistent.setMessageAudit(getMessageAudit()); - nonPersistent.start(); - persistent.setMessageAudit(getMessageAudit()); - persistent.start(); - pendingCount = persistent.size() + nonPersistent.size(); - } - - public synchronized void stop() throws Exception { - started = false; - if (nonPersistent != null) { -// nonPersistent.clear(); -// nonPersistent.stop(); -// nonPersistent.gc(); - nonPersistent.destroy(); - } - persistent.stop(); - persistent.gc(); - super.stop(); - pendingCount = 0; - } - - public synchronized void addMessageLast(MessageReference node) throws Exception { - if (node != null) { - Message msg = node.getMessage(); - if (started) { - pendingCount++; - if (!msg.isPersistent()) { - nonPersistent.addMessageLast(node); - } - } - if (msg.isPersistent()) { - persistent.addMessageLast(node); - } - } - } - - public synchronized void addMessageFirst(MessageReference node) throws Exception { - if (node != null) { - Message msg = node.getMessage(); - if (started) { - pendingCount++; - if (!msg.isPersistent()) { - nonPersistent.addMessageFirst(node); - } - } - if (msg.isPersistent()) { - persistent.addMessageFirst(node); - } - } - } - - public synchronized void clear() { - pendingCount = 0; - } - - public synchronized boolean hasNext() { - try { - getNextCursor(); - } catch (Exception e) { - LOG.error("Failed to get current cursor ", e); - throw new RuntimeException(e); - } - return currentCursor != null ? currentCursor.hasNext() : false; - } - - public synchronized MessageReference next() { - MessageReference result = currentCursor != null ? currentCursor.next() : null; - return result; - } - - public synchronized void remove() { - if (currentCursor != null) { - currentCursor.remove(); - } - pendingCount--; - } - - public synchronized void remove(MessageReference node) { - if (!node.isPersistent()) { - nonPersistent.remove(node); - } else { - persistent.remove(node); - } - pendingCount--; - } - - public synchronized void reset() { - nonPersistent.reset(); - persistent.reset(); - pendingCount = persistent.size() + nonPersistent.size(); - } - - public void release() { - nonPersistent.release(); - persistent.release(); - } - - - public synchronized int size() { - if (pendingCount < 0) { - pendingCount = persistent.size() + nonPersistent.size(); - } - return pendingCount; - } - - public synchronized boolean isEmpty() { - // if negative, more messages arrived in store since last reset so non empty - return pendingCount == 0; - } - - /** - * Informs the Broker if the subscription needs to intervention to recover - * it's state e.g. DurableTopicSubscriber may do - * - * @see org.apache.activemq.broker.region.cursors.PendingMessageCursor - * @return true if recovery required - */ - public boolean isRecoveryRequired() { - return false; - } - - /** - * @return the nonPersistent Cursor - */ - public PendingMessageCursor getNonPersistent() { - return this.nonPersistent; - } - - /** - * @param nonPersistent cursor to set - */ - public void setNonPersistent(PendingMessageCursor nonPersistent) { - this.nonPersistent = nonPersistent; - } - - public void setMaxBatchSize(int maxBatchSize) { - persistent.setMaxBatchSize(maxBatchSize); - if (nonPersistent != null) { - nonPersistent.setMaxBatchSize(maxBatchSize); - } - super.setMaxBatchSize(maxBatchSize); - } - - - public void setMaxProducersToAudit(int maxProducersToAudit) { - super.setMaxProducersToAudit(maxProducersToAudit); - if (persistent != null) { - persistent.setMaxProducersToAudit(maxProducersToAudit); - } - if (nonPersistent != null) { - nonPersistent.setMaxProducersToAudit(maxProducersToAudit); - } - } - - public void setMaxAuditDepth(int maxAuditDepth) { - super.setMaxAuditDepth(maxAuditDepth); - if (persistent != null) { - persistent.setMaxAuditDepth(maxAuditDepth); - } - if (nonPersistent != null) { - nonPersistent.setMaxAuditDepth(maxAuditDepth); - } - } - - public void setEnableAudit(boolean enableAudit) { - super.setEnableAudit(enableAudit); - if (persistent != null) { - persistent.setEnableAudit(enableAudit); - } - if (nonPersistent != null) { - nonPersistent.setEnableAudit(enableAudit); - } - } - - @Override - public void setUseCache(boolean useCache) { - super.setUseCache(useCache); - if (persistent != null) { - persistent.setUseCache(useCache); - } - if (nonPersistent != null) { - nonPersistent.setUseCache(useCache); - } - } - - @Override - public void setMemoryUsageHighWaterMark(int memoryUsageHighWaterMark) { - super.setMemoryUsageHighWaterMark(memoryUsageHighWaterMark); - if (persistent != null) { - persistent.setMemoryUsageHighWaterMark(memoryUsageHighWaterMark); - } - if (nonPersistent != null) { - nonPersistent.setMemoryUsageHighWaterMark(memoryUsageHighWaterMark); - } - } - - - - public synchronized void gc() { - if (persistent != null) { - persistent.gc(); - } - if (nonPersistent != null) { - nonPersistent.gc(); - } - pendingCount = persistent.size() + nonPersistent.size(); - } - - public void setSystemUsage(SystemUsage usageManager) { - super.setSystemUsage(usageManager); - if (persistent != null) { - persistent.setSystemUsage(usageManager); - } - if (nonPersistent != null) { - nonPersistent.setSystemUsage(usageManager); - } - } - - protected synchronized PendingMessageCursor getNextCursor() throws Exception { - if (currentCursor == null || !currentCursor.hasMessagesBufferedToDeliver()) { - currentCursor = currentCursor == persistent ? nonPersistent : persistent; - // sanity check - if (currentCursor.isEmpty()) { - currentCursor = currentCursor == persistent ? nonPersistent : persistent; - } - } - return currentCursor; - } - - @Override - public boolean isCacheEnabled() { - boolean cacheEnabled = isUseCache(); - if (cacheEnabled) { - if (persistent != null) { - cacheEnabled &= persistent.isCacheEnabled(); - } - if (nonPersistent != null) { - cacheEnabled &= nonPersistent.isCacheEnabled(); - } - setCacheEnabled(cacheEnabled); - } - return cacheEnabled; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/TopicStorePrefetch.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/TopicStorePrefetch.class deleted file mode 100644 index 91f371d71..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/TopicStorePrefetch.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/TopicStorePrefetch.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/TopicStorePrefetch.java deleted file mode 100644 index aec5c06c6..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/TopicStorePrefetch.java +++ /dev/null @@ -1,129 +0,0 @@ -/** - * 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.broker.region.cursors; - -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.broker.region.Topic; -import org.apache.activemq.command.Message; -import org.apache.activemq.command.MessageId; -import org.apache.activemq.filter.MessageEvaluationContext; -import org.apache.activemq.filter.NonCachedMessageEvaluationContext; -import org.apache.activemq.store.TopicMessageStore; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * persist pendingCount messages pendingCount message (messages awaiting disptach - * to a consumer) cursor - * - * - */ -class TopicStorePrefetch extends AbstractStoreCursor { - private static final Logger LOG = LoggerFactory.getLogger(TopicStorePrefetch.class); - private final TopicMessageStore store; - private final String clientId; - private final String subscriberName; - private final Subscription subscription; - private byte lastRecoveredPriority = 9; - /** - * @param topic - * @param clientId - * @param subscriberName - */ - public TopicStorePrefetch(Subscription subscription,Topic topic, String clientId, String subscriberName) { - super(topic); - this.subscription=subscription; - this.store = (TopicMessageStore)topic.getMessageStore(); - this.clientId = clientId; - this.subscriberName = subscriberName; - this.maxProducersToAudit=32; - this.maxAuditDepth=10000; - resetSize(); - } - - public boolean recoverMessageReference(MessageId messageReference) throws Exception { - // shouldn't get called - throw new RuntimeException("Not supported"); - } - - public synchronized void addMessageFirst(MessageReference node) throws Exception { - batchList.addMessageFirst(node); - size++; - } - - - @Override - public synchronized boolean recoverMessage(Message message, boolean cached) throws Exception { - LOG.trace("recover: {}, priority: {}", message.getMessageId(), message.getPriority()); - boolean recovered = false; - MessageEvaluationContext messageEvaluationContext = new NonCachedMessageEvaluationContext(); - messageEvaluationContext.setMessageReference(message); - if (this.subscription.matches(message, messageEvaluationContext)) { - recovered = super.recoverMessage(message, cached); - if (recovered && !cached) { - lastRecoveredPriority = message.getPriority(); - } - } - return recovered; - } - - @Override - protected synchronized int getStoreSize() { - try { - return store.getMessageCount(clientId, subscriberName); - } catch (Exception e) { - LOG.error("{} Failed to get the outstanding message count from the store", this, e); - throw new RuntimeException(e); - } - } - - @Override - protected synchronized boolean isStoreEmpty() { - try { - return this.store.isEmpty(); - } catch (Exception e) { - LOG.error("Failed to determine if store is empty", e); - throw new RuntimeException(e); - } - } - - - @Override - protected void resetBatch() { - this.store.resetBatching(clientId, subscriberName); - } - - @Override - protected void doFillBatch() throws Exception { - this.store.recoverNextMessages(clientId, subscriberName, - maxBatchSize, this); - } - - public byte getLastRecoveredPriority() { - return lastRecoveredPriority; - } - - public final boolean isPaging() { - return !isCacheEnabled() && !batchList.isEmpty(); - } - - @Override - public String toString() { - return "TopicStorePrefetch(" + clientId + "," + subscriberName + ") " + this.subscription.getConsumerInfo().getConsumerId() + " - " + super.toString(); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/VMPendingMessageCursor.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/VMPendingMessageCursor.class deleted file mode 100644 index 28703487e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/VMPendingMessageCursor.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/VMPendingMessageCursor.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/VMPendingMessageCursor.java deleted file mode 100644 index 9518981ff..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/VMPendingMessageCursor.java +++ /dev/null @@ -1,204 +0,0 @@ -/** - * 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.broker.region.cursors; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.broker.region.QueueMessageReference; - -/** - * hold pending messages in a linked list (messages awaiting disptach to a - * consumer) cursor - * - * - */ -public class VMPendingMessageCursor extends AbstractPendingMessageCursor { - private final PendingList list; - private Iterator iter; - - public VMPendingMessageCursor(boolean prioritizedMessages) { - super(prioritizedMessages); - if (this.prioritizedMessages) { - this.list= new PrioritizedPendingList(); - }else { - this.list = new OrderedPendingList(); - } - } - - - public synchronized List remove(ConnectionContext context, Destination destination) - throws Exception { - List rc = new ArrayList(); - for (Iterator iterator = list.iterator(); iterator.hasNext();) { - MessageReference r = iterator.next(); - if (r.getRegionDestination() == destination) { - r.decrementReferenceCount(); - rc.add(r); - iterator.remove(); - } - } - return rc; - } - - /** - * @return true if there are no pending messages - */ - - public synchronized boolean isEmpty() { - if (list.isEmpty()) { - return true; - } else { - for (Iterator iterator = list.iterator(); iterator.hasNext();) { - MessageReference node = iterator.next(); - if (node == QueueMessageReference.NULL_MESSAGE) { - continue; - } - if (!node.isDropped()) { - return false; - } - // We can remove dropped references. - iterator.remove(); - } - return true; - } - } - - /** - * reset the cursor - */ - - public synchronized void reset() { - iter = list.iterator(); - last = null; - } - - /** - * add message to await dispatch - * - * @param node - */ - - public synchronized void addMessageLast(MessageReference node) { - node.incrementReferenceCount(); - list.addMessageLast(node); - } - - /** - * add message to await dispatch - * - * @param position - * @param node - */ - - public synchronized void addMessageFirst(MessageReference node) { - node.incrementReferenceCount(); - list.addMessageFirst(node); - } - - /** - * @return true if there pending messages to dispatch - */ - - public synchronized boolean hasNext() { - return iter.hasNext(); - } - - /** - * @return the next pending message - */ - - public synchronized MessageReference next() { - last = iter.next(); - if (last != null) { - last.incrementReferenceCount(); - } - return last; - } - - /** - * remove the message at the cursor position - */ - - public synchronized void remove() { - if (last != null) { - last.decrementReferenceCount(); - } - iter.remove(); - } - - /** - * @return the number of pending messages - */ - - public synchronized int size() { - return list.size(); - } - - /** - * clear all pending messages - */ - - public synchronized void clear() { - for (Iterator i = list.iterator(); i.hasNext();) { - MessageReference ref = i.next(); - ref.decrementReferenceCount(); - } - list.clear(); - } - - - public synchronized void remove(MessageReference node) { - list.remove(node); - node.decrementReferenceCount(); - } - - /** - * Page in a restricted number of messages - * - * @param maxItems - * @return a list of paged in messages - */ - - public LinkedList pageInList(int maxItems) { - LinkedList result = new LinkedList(); - for (Iteratori = list.iterator();i.hasNext();) { - MessageReference ref = i.next(); - ref.incrementReferenceCount(); - result.add(ref); - if (result.size() >= maxItems) { - break; - } - } - return result; - } - - - public boolean isTransient() { - return true; - } - - - public void destroy() throws Exception { - super.destroy(); - clear(); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/package.html b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/package.html deleted file mode 100644 index f9c24741f..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/cursors/package.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - Cursors used to page persistent messages into the broker from the store - - - diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/CachedMessageGroupMap.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/CachedMessageGroupMap.class deleted file mode 100644 index 15be1435d..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/CachedMessageGroupMap.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/CachedMessageGroupMap.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/CachedMessageGroupMap.java deleted file mode 100644 index 084e8d05d..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/CachedMessageGroupMap.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * 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.broker.region.group; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import org.apache.activemq.command.ConsumerId; -import org.apache.activemq.memory.LRUMap; - -/** - * A simple implementation which tracks every individual GroupID value in a LRUCache - * - * - */ -public class CachedMessageGroupMap implements MessageGroupMap { - private final LRUMap cache; - private final int maximumCacheSize; - CachedMessageGroupMap(int size){ - cache = new LRUMap(size); - maximumCacheSize = size; - } - public synchronized void put(String groupId, ConsumerId consumerId) { - cache.put(groupId, consumerId); - } - - public synchronized ConsumerId get(String groupId) { - return cache.get(groupId); - } - - public synchronized ConsumerId removeGroup(String groupId) { - return cache.remove(groupId); - } - - public synchronized MessageGroupSet removeConsumer(ConsumerId consumerId) { - SimpleMessageGroupSet ownedGroups = new SimpleMessageGroupSet(); - Map map = new HashMap(); - map.putAll(cache); - for (Iterator iter = map.keySet().iterator(); iter.hasNext();) { - String group = iter.next(); - ConsumerId owner = map.get(group); - if (owner.equals(consumerId)) { - ownedGroups.add(group); - } - } - for (String group:ownedGroups.getUnderlyingSet()){ - cache.remove(group); - } - return ownedGroups; - } - - - @Override - public synchronized void removeAll(){ - cache.clear(); - } - - @Override - public synchronized Map getGroups() { - Map result = new HashMap(); - for (Map.Entryentry: cache.entrySet()){ - result.put(entry.getKey(),entry.getValue().toString()); - } - return result; - } - - @Override - public String getType() { - return "cached"; - } - - public int getMaximumCacheSize(){ - return maximumCacheSize; - } - - public String toString() { - return "message groups: " + cache.size(); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/CachedMessageGroupMapFactory.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/CachedMessageGroupMapFactory.class deleted file mode 100644 index c5c96bde6..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/CachedMessageGroupMapFactory.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/CachedMessageGroupMapFactory.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/CachedMessageGroupMapFactory.java deleted file mode 100644 index b0a0be8ee..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/CachedMessageGroupMapFactory.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * 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.broker.region.group; - -/** - * A factory to create instances of {@link org.apache.activemq.broker.region.group.CachedMessageGroupMap} when implementing the - * Message Groups functionality. - * - * @org.apache.xbean.XBean - * - * - */ -public class CachedMessageGroupMapFactory implements MessageGroupMapFactory { - - private int cacheSize = 1024; - public int getCacheSize() { - return cacheSize; - } - - public void setCacheSize(int cacheSize) { - this.cacheSize = cacheSize; - } - - - public MessageGroupMap createMessageGroupMap() { - return new CachedMessageGroupMap(getCacheSize()); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/EmptyMessageGroupSet.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/EmptyMessageGroupSet.class deleted file mode 100644 index 2da505ea7..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/EmptyMessageGroupSet.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/EmptyMessageGroupSet.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/EmptyMessageGroupSet.java deleted file mode 100644 index 9ded71f88..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/EmptyMessageGroupSet.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * 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.broker.region.group; - -/** - * Represents an empty {@link MessageGroupSet} - * - * - */ -public class EmptyMessageGroupSet implements MessageGroupSet { - - public static final MessageGroupSet INSTANCE = new EmptyMessageGroupSet(); - - public boolean contains(String groupID) { - return false; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/GroupFactoryFinder.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/GroupFactoryFinder.class deleted file mode 100644 index 3c6a69904..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/GroupFactoryFinder.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/GroupFactoryFinder.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/GroupFactoryFinder.java deleted file mode 100644 index 718b37d70..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/GroupFactoryFinder.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * 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.broker.region.group; - -import java.io.IOException; -import java.util.Map; - -import org.apache.activemq.util.FactoryFinder; -import org.apache.activemq.util.IOExceptionSupport; -import org.apache.activemq.util.IntrospectionSupport; -import org.apache.activemq.util.URISupport; - -public class GroupFactoryFinder { - private static final FactoryFinder GROUP_FACTORY_FINDER = new FactoryFinder("META-INF/services/org/apache/activemq/groups/"); - - private GroupFactoryFinder() { - } - - public static MessageGroupMapFactory createMessageGroupMapFactory(String type) throws IOException { - try { - Map properties = null; - String factoryType = type.trim(); - int p = factoryType.indexOf('?'); - if (p >= 0){ - String propertiesString = factoryType.substring(p+1); - factoryType = factoryType.substring(0,p); - properties = URISupport.parseQuery(propertiesString); - } - MessageGroupMapFactory result = (MessageGroupMapFactory)GROUP_FACTORY_FINDER.newInstance(factoryType); - if (properties != null && result != null){ - IntrospectionSupport.setProperties(result,properties); - } - return result; - - } catch (Throwable e) { - throw IOExceptionSupport.create("Could not load " + type + " factory:" + e, e); - } - } - - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/MessageGroupHashBucket$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/MessageGroupHashBucket$1.class deleted file mode 100644 index d44543b7d..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/MessageGroupHashBucket$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/MessageGroupHashBucket$2.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/MessageGroupHashBucket$2.class deleted file mode 100644 index f0a5dca4c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/MessageGroupHashBucket$2.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/MessageGroupHashBucket.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/MessageGroupHashBucket.class deleted file mode 100644 index 681aaabef..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/MessageGroupHashBucket.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/MessageGroupHashBucket.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/MessageGroupHashBucket.java deleted file mode 100644 index 652b98517..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/MessageGroupHashBucket.java +++ /dev/null @@ -1,142 +0,0 @@ -/** - * 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.broker.region.group; - -import java.util.Map; - -import org.apache.activemq.command.ConsumerId; -import org.apache.activemq.memory.LRUMap; - -/** - * Uses hash-code buckets to associate consumers with sets of message group IDs. - * - * - */ -public class MessageGroupHashBucket implements MessageGroupMap { - - private final int bucketCount; - private final ConsumerId[] consumers; - private final LRUMapcache; - - public MessageGroupHashBucket(int bucketCount, int cachedSize) { - this.bucketCount = bucketCount; - this.consumers = new ConsumerId[bucketCount]; - this.cache=new LRUMap(cachedSize); - } - - public synchronized void put(String groupId, ConsumerId consumerId) { - int bucket = getBucketNumber(groupId); - consumers[bucket] = consumerId; - if (consumerId != null){ - cache.put(groupId,consumerId.toString()); - } - } - - public synchronized ConsumerId get(String groupId) { - int bucket = getBucketNumber(groupId); - //excersise cache - cache.get(groupId); - return consumers[bucket]; - } - - public synchronized ConsumerId removeGroup(String groupId) { - int bucket = getBucketNumber(groupId); - ConsumerId answer = consumers[bucket]; - consumers[bucket] = null; - cache.remove(groupId); - return answer; - } - - public synchronized MessageGroupSet removeConsumer(ConsumerId consumerId) { - MessageGroupSet answer = null; - for (int i = 0; i < consumers.length; i++) { - ConsumerId owner = consumers[i]; - if (owner != null && owner.equals(consumerId)) { - answer = createMessageGroupSet(i, answer); - consumers[i] = null; - } - } - if (answer == null) { - // make an empty set - answer = EmptyMessageGroupSet.INSTANCE; - } - return answer; - } - - public synchronized void removeAll(){ - for (int i =0; i < consumers.length; i++){ - consumers[i] = null; - } - } - - @Override - public Map getGroups() { - return cache; - } - - @Override - public String getType() { - return "bucket"; - } - - public int getBucketCount(){ - return bucketCount; - } - - - public String toString() { - int count = 0; - for (int i = 0; i < consumers.length; i++) { - if (consumers[i] != null) { - count++; - } - } - return "active message group buckets: " + count; - } - - protected MessageGroupSet createMessageGroupSet(int bucketNumber, final MessageGroupSet parent) { - final MessageGroupSet answer = createMessageGroupSet(bucketNumber); - if (parent == null) { - return answer; - } else { - // union the two sets together - return new MessageGroupSet() { - public boolean contains(String groupID) { - return parent.contains(groupID) || answer.contains(groupID); - } - }; - } - } - - protected MessageGroupSet createMessageGroupSet(final int bucketNumber) { - return new MessageGroupSet() { - public boolean contains(String groupID) { - int bucket = getBucketNumber(groupID); - return bucket == bucketNumber; - } - }; - } - - protected int getBucketNumber(String groupId) { - int bucket = groupId.hashCode() % bucketCount; - // bucket could be negative - if (bucket < 0) { - bucket *= -1; - } - return bucket; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/MessageGroupHashBucketFactory.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/MessageGroupHashBucketFactory.class deleted file mode 100644 index 58cea1363..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/MessageGroupHashBucketFactory.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/MessageGroupHashBucketFactory.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/MessageGroupHashBucketFactory.java deleted file mode 100644 index 8961c465e..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/MessageGroupHashBucketFactory.java +++ /dev/null @@ -1,61 +0,0 @@ -/** - * 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.broker.region.group; - -/** - * A factory to create instances of {@link SimpleMessageGroupMap} when - * implementing the Message - * Groups functionality. - * - * @org.apache.xbean.XBean - * - * - */ -public class MessageGroupHashBucketFactory implements MessageGroupMapFactory { - - private int bucketCount = 1024; - private int cacheSize = 64; - - public MessageGroupMap createMessageGroupMap() { - return new MessageGroupHashBucket(getBucketCount(), getCacheSize()); - } - - public int getBucketCount() { - return bucketCount; - } - - /** - * Sets the number of hash buckets to use for the message group - * functionality. This is only applicable to using message groups to - * parallelize processing of a queue while preserving order across an - * individual JMSXGroupID header value. This value sets the number of hash - * buckets that will be used (i.e. the maximum possible concurrency). - */ - public void setBucketCount(int bucketCount) { - this.bucketCount = bucketCount; - } - - public int getCacheSize() { - return cacheSize; - } - - public void setCacheSize(int cacheSize) { - this.cacheSize = cacheSize; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/MessageGroupMap.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/MessageGroupMap.class deleted file mode 100644 index 5f8be23aa..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/MessageGroupMap.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/MessageGroupMap.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/MessageGroupMap.java deleted file mode 100644 index c952c94a2..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/MessageGroupMap.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * 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.broker.region.group; - -import java.util.Map; - -import org.apache.activemq.command.ConsumerId; - -/** - * Represents a map of JMSXGroupID values to consumer IDs - * - * - */ -public interface MessageGroupMap { - - void put(String groupId, ConsumerId consumerId); - - ConsumerId get(String groupId); - - ConsumerId removeGroup(String groupId); - - MessageGroupSet removeConsumer(ConsumerId consumerId); - - void removeAll(); - - /** - * @return a map of group names and associated consumer Id - */ - Map getGroups(); - - String getType(); - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/MessageGroupMapFactory.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/MessageGroupMapFactory.class deleted file mode 100644 index 336111df7..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/MessageGroupMapFactory.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/MessageGroupMapFactory.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/MessageGroupMapFactory.java deleted file mode 100644 index 7493972d2..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/MessageGroupMapFactory.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * 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.broker.region.group; - -/** - * Represents a factory used to create new instances of {@link MessageGroupMap} - * for a destination. - * - * - */ -public interface MessageGroupMapFactory { - - MessageGroupMap createMessageGroupMap(); - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/MessageGroupSet.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/MessageGroupSet.class deleted file mode 100644 index c6c6ddc45..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/MessageGroupSet.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/MessageGroupSet.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/MessageGroupSet.java deleted file mode 100644 index 3017c2ba4..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/MessageGroupSet.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * 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.broker.region.group; - -/** - * Represents a set of Message Group IDs - * - * - */ -public interface MessageGroupSet { - - boolean contains(String groupID); - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/SimpleMessageGroupMap.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/SimpleMessageGroupMap.class deleted file mode 100644 index fcc2ffebf..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/SimpleMessageGroupMap.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/SimpleMessageGroupMap.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/SimpleMessageGroupMap.java deleted file mode 100644 index e3fd4edf0..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/SimpleMessageGroupMap.java +++ /dev/null @@ -1,85 +0,0 @@ -/** - * 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.broker.region.group; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -import org.apache.activemq.command.ConsumerId; - -/** - * A simple implementation which tracks every individual GroupID value but - * which can become a memory leak if clients die before they complete a message - * group. - * - * - */ -public class SimpleMessageGroupMap implements MessageGroupMap { - private Map map = new ConcurrentHashMap(); - - public void put(String groupId, ConsumerId consumerId) { - map.put(groupId, consumerId); - } - - public ConsumerId get(String groupId) { - return map.get(groupId); - } - - public ConsumerId removeGroup(String groupId) { - return map.remove(groupId); - } - - public MessageGroupSet removeConsumer(ConsumerId consumerId) { - SimpleMessageGroupSet ownedGroups = new SimpleMessageGroupSet(); - for (Iterator iter = map.keySet().iterator(); iter.hasNext();) { - String group = iter.next(); - ConsumerId owner = map.get(group); - if (owner.equals(consumerId)) { - ownedGroups.add(group); - iter.remove(); - } - } - return ownedGroups; - } - - - @Override - public void removeAll(){ - map.clear(); - } - - @Override - public Map getGroups() { - Map result = new HashMap(); - for (Map.Entryentry:map.entrySet()){ - result.put(entry.getKey(),entry.getValue().toString()); - } - return result; - } - - @Override - public String getType() { - return "simple"; - } - - public String toString() { - return "message groups: " + map.size(); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/SimpleMessageGroupMapFactory.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/SimpleMessageGroupMapFactory.class deleted file mode 100644 index e37b8703e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/SimpleMessageGroupMapFactory.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/SimpleMessageGroupMapFactory.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/SimpleMessageGroupMapFactory.java deleted file mode 100644 index 266cf6170..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/SimpleMessageGroupMapFactory.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * 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.broker.region.group; - -/** - * A factory to create instances of {@link SimpleMessageGroupMap} when implementing the - * Message Groups functionality. - * - * @org.apache.xbean.XBean - * - * - */ -public class SimpleMessageGroupMapFactory implements MessageGroupMapFactory { - - public MessageGroupMap createMessageGroupMap() { - return new SimpleMessageGroupMap(); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/SimpleMessageGroupSet.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/SimpleMessageGroupSet.class deleted file mode 100644 index 4ef5241e5..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/SimpleMessageGroupSet.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/SimpleMessageGroupSet.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/SimpleMessageGroupSet.java deleted file mode 100644 index 91f9713e4..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/SimpleMessageGroupSet.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * 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.broker.region.group; - -import java.util.HashSet; -import java.util.Set; - -/** - * A simple implementation which just uses a {@link Set} - * - * - */ -public class SimpleMessageGroupSet implements MessageGroupSet { - - private Set set = new HashSet(); - - public boolean contains(String groupID) { - return set.contains(groupID); - } - - public void add(String group) { - set.add(group); - } - - protected Set getUnderlyingSet(){ - return set; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/package.html b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/package.html deleted file mode 100644 index 4271db889..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/group/package.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - Classes to implement the Message Groups feature. - - - diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/package.html b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/package.html deleted file mode 100644 index b3d759d14..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/package.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - Region abstraction and implementations in the Broker. - - - diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/AbortSlowAckConsumerStrategy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/AbortSlowAckConsumerStrategy.class deleted file mode 100644 index 31f78df3c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/AbortSlowAckConsumerStrategy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/AbortSlowAckConsumerStrategy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/AbortSlowAckConsumerStrategy.java deleted file mode 100644 index 5e538c7c3..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/AbortSlowAckConsumerStrategy.java +++ /dev/null @@ -1,245 +0,0 @@ -/** - * 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.broker.region.policy; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map.Entry; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.Subscription; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Abort slow consumers when they reach the configured threshold of slowness, - * - * default is that a consumer that has not Ack'd a message for 30 seconds is slow. - * - * @org.apache.xbean.XBean - */ -public class AbortSlowAckConsumerStrategy extends AbortSlowConsumerStrategy { - - private static final Logger LOG = LoggerFactory.getLogger(AbortSlowAckConsumerStrategy.class); - - private final List destinations = new LinkedList(); - private long maxTimeSinceLastAck = 30*1000; - private boolean ignoreIdleConsumers = true; - private boolean ignoreNetworkConsumers = true; - - public AbortSlowAckConsumerStrategy() { - this.name = "AbortSlowAckConsumerStrategy@" + hashCode(); - } - - @Override - public void setBrokerService(Broker broker) { - super.setBrokerService(broker); - - // Task starts right away since we may not receive any slow consumer events. - if (taskStarted.compareAndSet(false, true)) { - scheduler.executePeriodically(this, getCheckPeriod()); - } - } - - @Override - public void slowConsumer(ConnectionContext context, Subscription subs) { - // Ignore these events, we just look at time since last Ack. - } - - @Override - public void run() { - - if (maxTimeSinceLastAck < 0) { - // nothing to do - LOG.info("no limit set, slowConsumer strategy has nothing to do"); - return; - } - - if (getMaxSlowDuration() > 0) { - // For subscriptions that are already slow we mark them again and check below if - // they've exceeded their configured lifetime. - for (SlowConsumerEntry entry : slowConsumers.values()) { - entry.mark(); - } - } - - List disposed = new ArrayList(); - - for (Destination destination : destinations) { - if (destination.isDisposed()) { - disposed.add(destination); - continue; - } - - // Not explicitly documented but this returns a stable copy. - List subscribers = destination.getConsumers(); - - updateSlowConsumersList(subscribers); - } - - // Clean up an disposed destinations to save space. - destinations.removeAll(disposed); - - abortAllQualifiedSlowConsumers(); - } - - private void updateSlowConsumersList(List subscribers) { - for (Subscription subscriber : subscribers) { - if (isIgnoreNetworkSubscriptions() && subscriber.getConsumerInfo().isNetworkSubscription()) { - if (slowConsumers.remove(subscriber) != null) { - LOG.info("network sub: {} is no longer slow", subscriber.getConsumerInfo().getConsumerId()); - } - continue; - } - - if (isIgnoreIdleConsumers() && subscriber.getDispatchedQueueSize() == 0) { - // Not considered Idle so ensure its cleared from the list - if (slowConsumers.remove(subscriber) != null) { - LOG.info("idle sub: {} is no longer slow", subscriber.getConsumerInfo().getConsumerId()); - } - continue; - } - - long lastAckTime = subscriber.getTimeOfLastMessageAck(); - long timeDelta = System.currentTimeMillis() - lastAckTime; - - if (timeDelta > maxTimeSinceLastAck) { - if (!slowConsumers.containsKey(subscriber)) { - LOG.debug("sub: {} is now slow", subscriber.getConsumerInfo().getConsumerId()); - SlowConsumerEntry entry = new SlowConsumerEntry(subscriber.getContext()); - entry.mark(); // mark consumer on first run - slowConsumers.put(subscriber, entry); - } else if (getMaxSlowCount() > 0) { - slowConsumers.get(subscriber).slow(); - } - } else { - if (slowConsumers.remove(subscriber) != null) { - LOG.info("sub: {} is no longer slow", subscriber.getConsumerInfo().getConsumerId()); - } - } - } - } - - private void abortAllQualifiedSlowConsumers() { - HashMap toAbort = new HashMap(); - for (Entry entry : slowConsumers.entrySet()) { - if (getMaxSlowDuration() > 0 && (entry.getValue().markCount * getCheckPeriod() >= getMaxSlowDuration()) || - getMaxSlowCount() > 0 && entry.getValue().slowCount >= getMaxSlowCount()) { - - LOG.trace("Transferring consumer{} to the abort list: {} slow duration = {}, slow count = {}", - new Object[]{ entry.getKey().getConsumerInfo().getConsumerId(), - entry.getValue().markCount * getCheckPeriod(), - entry.getValue().getSlowCount() }); - - toAbort.put(entry.getKey(), entry.getValue()); - slowConsumers.remove(entry.getKey()); - } else { - - LOG.trace("Not yet time to abort consumer {}: slow duration = {}, slow count = {}", new Object[]{ entry.getKey().getConsumerInfo().getConsumerId(), entry.getValue().markCount * getCheckPeriod(), entry.getValue().slowCount }); - - } - } - - // Now if any subscriptions made it into the aborts list we can kick them. - abortSubscription(toAbort, isAbortConnection()); - } - - @Override - public void addDestination(Destination destination) { - this.destinations.add(destination); - } - - /** - * Gets the maximum time since last Ack before a subscription is considered to be slow. - * - * @return the maximum time since last Ack before the consumer is considered to be slow. - */ - public long getMaxTimeSinceLastAck() { - return maxTimeSinceLastAck; - } - - /** - * Sets the maximum time since last Ack before a subscription is considered to be slow. - * - * @param maxTimeSinceLastAck - * the maximum time since last Ack (mills) before the consumer is considered to be slow. - */ - public void setMaxTimeSinceLastAck(long maxTimeSinceLastAck) { - this.maxTimeSinceLastAck = maxTimeSinceLastAck; - } - - /** - * Returns whether the strategy is configured to ignore consumers that are simply idle, i.e - * consumers that have no pending acks (dispatch queue is empty). - * - * @return true if the strategy will ignore idle consumer when looking for slow consumers. - */ - public boolean isIgnoreIdleConsumers() { - return ignoreIdleConsumers; - } - - /** - * Sets whether the strategy is configured to ignore consumers that are simply idle, i.e - * consumers that have no pending acks (dispatch queue is empty). - * - * When configured to not ignore idle consumers this strategy acks not only on consumers - * that are actually slow but also on any consumer that has not received any messages for - * the maxTimeSinceLastAck. This allows for a way to evict idle consumers while also - * aborting slow consumers. - * - * @param ignoreIdleConsumers - * Should this strategy ignore idle consumers or consider all consumers when checking - * the last ack time verses the maxTimeSinceLastAck value. - */ - public void setIgnoreIdleConsumers(boolean ignoreIdleConsumers) { - this.ignoreIdleConsumers = ignoreIdleConsumers; - } - - /** - * Returns whether the strategy is configured to ignore subscriptions that are from a network - * connection. - * - * @return true if the strategy will ignore network connection subscriptions when looking - * for slow consumers. - */ - public boolean isIgnoreNetworkSubscriptions() { - return ignoreNetworkConsumers; - } - - /** - * Sets whether the strategy is configured to ignore consumers that are part of a network - * connection to another broker. - * - * When configured to not ignore idle consumers this strategy acts not only on consumers - * that are actually slow but also on any consumer that has not received any messages for - * the maxTimeSinceLastAck. This allows for a way to evict idle consumers while also - * aborting slow consumers however for a network subscription this can create a lot of - * unnecessary churn and if the abort connection option is also enabled this can result - * in the entire network connection being torn down and rebuilt for no reason. - * - * @param ignoreNetworkConsumers - * Should this strategy ignore subscriptions made by a network connector. - */ - public void setIgnoreNetworkConsumers(boolean ignoreNetworkConsumers) { - this.ignoreNetworkConsumers = ignoreNetworkConsumers; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/AbortSlowConsumerStrategy$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/AbortSlowConsumerStrategy$1.class deleted file mode 100644 index a14141769..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/AbortSlowConsumerStrategy$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/AbortSlowConsumerStrategy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/AbortSlowConsumerStrategy.class deleted file mode 100644 index 0adaedf8c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/AbortSlowConsumerStrategy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/AbortSlowConsumerStrategy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/AbortSlowConsumerStrategy.java deleted file mode 100644 index 867d2b246..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/AbortSlowConsumerStrategy.java +++ /dev/null @@ -1,261 +0,0 @@ -/** - * 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.broker.region.policy; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.atomic.AtomicBoolean; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.Connection; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.command.ConsumerControl; -import org.apache.activemq.thread.Scheduler; -import org.apache.activemq.transport.InactivityIOException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Abort slow consumers when they reach the configured threshold of slowness, default is slow for 30 seconds - * - * @org.apache.xbean.XBean - */ -public class AbortSlowConsumerStrategy implements SlowConsumerStrategy, Runnable { - - private static final Logger LOG = LoggerFactory.getLogger(AbortSlowConsumerStrategy.class); - - protected String name = "AbortSlowConsumerStrategy@" + hashCode(); - protected Scheduler scheduler; - protected Broker broker; - protected final AtomicBoolean taskStarted = new AtomicBoolean(false); - protected final Map slowConsumers = - new ConcurrentHashMap(); - - private long maxSlowCount = -1; - private long maxSlowDuration = 30*1000; - private long checkPeriod = 30*1000; - private boolean abortConnection = false; - - @Override - public void setBrokerService(Broker broker) { - this.scheduler = broker.getScheduler(); - this.broker = broker; - } - - @Override - public void slowConsumer(ConnectionContext context, Subscription subs) { - if (maxSlowCount < 0 && maxSlowDuration < 0) { - // nothing to do - LOG.info("no limits set, slowConsumer strategy has nothing to do"); - return; - } - - if (taskStarted.compareAndSet(false, true)) { - scheduler.executePeriodically(this, checkPeriod); - } - - if (!slowConsumers.containsKey(subs)) { - slowConsumers.put(subs, new SlowConsumerEntry(context)); - } else if (maxSlowCount > 0) { - slowConsumers.get(subs).slow(); - } - } - - @Override - public void run() { - if (maxSlowDuration > 0) { - // mark - for (SlowConsumerEntry entry : slowConsumers.values()) { - entry.mark(); - } - } - - HashMap toAbort = new HashMap(); - for (Entry entry : slowConsumers.entrySet()) { - if (entry.getKey().isSlowConsumer()) { - if (maxSlowDuration > 0 && (entry.getValue().markCount * checkPeriod >= maxSlowDuration) - || maxSlowCount > 0 && entry.getValue().slowCount >= maxSlowCount) { - toAbort.put(entry.getKey(), entry.getValue()); - slowConsumers.remove(entry.getKey()); - } - } else { - LOG.info("sub: " + entry.getKey().getConsumerInfo().getConsumerId() + " is no longer slow"); - slowConsumers.remove(entry.getKey()); - } - } - - abortSubscription(toAbort, abortConnection); - } - - protected void abortSubscription(Map toAbort, boolean abortSubscriberConnection) { - - Map> abortMap = new HashMap>(); - - for (final Entry entry : toAbort.entrySet()) { - ConnectionContext connectionContext = entry.getValue().context; - if (connectionContext == null) { - continue; - } - - Connection connection = connectionContext.getConnection(); - if (connection == null) { - LOG.debug("slowConsumer abort ignored, no connection in context:" + connectionContext); - } - - if (!abortMap.containsKey(connection)) { - abortMap.put(connection, new ArrayList()); - } - - abortMap.get(connection).add(entry.getKey()); - } - - for (Entry> entry : abortMap.entrySet()) { - final Connection connection = entry.getKey(); - final List subscriptions = entry.getValue(); - - if (abortSubscriberConnection) { - - LOG.info("aborting connection:{} with {} slow consumers", - connection.getConnectionId(), subscriptions.size()); - - if (LOG.isTraceEnabled()) { - for (Subscription subscription : subscriptions) { - LOG.trace("Connection {} being aborted because of slow consumer: {} on destination: {}", - new Object[] { connection.getConnectionId(), - subscription.getConsumerInfo().getConsumerId(), - subscription.getActiveMQDestination() }); - } - } - - try { - scheduler.executeAfterDelay(new Runnable() { - @Override - public void run() { - connection.serviceException(new InactivityIOException( - subscriptions.size() + " Consumers was slow too often (>" - + maxSlowCount + ") or too long (>" - + maxSlowDuration + "): ")); - }}, 0l); - } catch (Exception e) { - LOG.info("exception on aborting connection {} with {} slow consumers", - connection.getConnectionId(), subscriptions.size()); - } - } else { - // just abort each consumer by telling it to stop - for (Subscription subscription : subscriptions) { - LOG.info("aborting slow consumer: {} for destination:{}", - subscription.getConsumerInfo().getConsumerId(), - subscription.getActiveMQDestination()); - - try { - ConsumerControl stopConsumer = new ConsumerControl(); - stopConsumer.setConsumerId(subscription.getConsumerInfo().getConsumerId()); - stopConsumer.setClose(true); - connection.dispatchAsync(stopConsumer); - } catch (Exception e) { - LOG.info("exception on aborting slow consumer: {}", subscription.getConsumerInfo().getConsumerId()); - } - } - } - } - } - - public void abortConsumer(Subscription sub, boolean abortSubscriberConnection) { - if (sub != null) { - SlowConsumerEntry entry = slowConsumers.remove(sub); - if (entry != null) { - Map toAbort = new HashMap(); - toAbort.put(sub, entry); - abortSubscription(toAbort, abortSubscriberConnection); - } else { - LOG.warn("cannot abort subscription as it no longer exists in the map of slow consumers: " + sub); - } - } - } - - public long getMaxSlowCount() { - return maxSlowCount; - } - - /** - * number of times a subscription can be deemed slow before triggering abort - * effect depends on dispatch rate as slow determination is done on dispatch - */ - public void setMaxSlowCount(long maxSlowCount) { - this.maxSlowCount = maxSlowCount; - } - - public long getMaxSlowDuration() { - return maxSlowDuration; - } - - /** - * time in milliseconds that a sub can remain slow before triggering - * an abort. - * @param maxSlowDuration - */ - public void setMaxSlowDuration(long maxSlowDuration) { - this.maxSlowDuration = maxSlowDuration; - } - - public long getCheckPeriod() { - return checkPeriod; - } - - /** - * time in milliseconds between checks for slow subscriptions - * @param checkPeriod - */ - public void setCheckPeriod(long checkPeriod) { - this.checkPeriod = checkPeriod; - } - - public boolean isAbortConnection() { - return abortConnection; - } - - /** - * abort the consumers connection rather than sending a stop command to the remote consumer - * @param abortConnection - */ - public void setAbortConnection(boolean abortConnection) { - this.abortConnection = abortConnection; - } - - public void setName(String name) { - this.name = name; - } - - public String getName() { - return name; - } - - public Map getSlowConsumers() { - return slowConsumers; - } - - @Override - public void addDestination(Destination destination) { - // Not needed for this strategy. - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/AbstractDeadLetterStrategy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/AbstractDeadLetterStrategy.class deleted file mode 100644 index 695d24389..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/AbstractDeadLetterStrategy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/AbstractDeadLetterStrategy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/AbstractDeadLetterStrategy.java deleted file mode 100644 index f0299201b..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/AbstractDeadLetterStrategy.java +++ /dev/null @@ -1,101 +0,0 @@ -/** - * 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.broker.region.policy; - -import org.apache.activemq.ActiveMQMessageAudit; -import org.apache.activemq.command.Message; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * A strategy for choosing which destination is used for dead letter queue - * messages. - * - */ -public abstract class AbstractDeadLetterStrategy implements DeadLetterStrategy { - private static final Logger LOG = LoggerFactory.getLogger(AbstractDeadLetterStrategy.class); - private boolean processNonPersistent = false; - private boolean processExpired = true; - private boolean enableAudit = true; - private final ActiveMQMessageAudit messageAudit = new ActiveMQMessageAudit(); - - @Override - public void rollback(Message message) { - if (message != null && this.enableAudit) { - messageAudit.rollback(message); - } - } - - @Override - public boolean isSendToDeadLetterQueue(Message message) { - boolean result = false; - if (message != null) { - result = true; - if (enableAudit && messageAudit.isDuplicate(message)) { - result = false; - LOG.debug("Not adding duplicate to DLQ: {}, dest: {}", message.getMessageId(), message.getDestination()); - } - if (!message.isPersistent() && !processNonPersistent) { - result = false; - } - if (message.isExpired() && !processExpired) { - result = false; - } - } - return result; - } - - /** - * @return the processExpired - */ - @Override - public boolean isProcessExpired() { - return this.processExpired; - } - - /** - * @param processExpired the processExpired to set - */ - @Override - public void setProcessExpired(boolean processExpired) { - this.processExpired = processExpired; - } - - /** - * @return the processNonPersistent - */ - @Override - public boolean isProcessNonPersistent() { - return this.processNonPersistent; - } - - /** - * @param processNonPersistent the processNonPersistent to set - */ - @Override - public void setProcessNonPersistent(boolean processNonPersistent) { - this.processNonPersistent = processNonPersistent; - } - - public boolean isEnableAudit() { - return enableAudit; - } - - public void setEnableAudit(boolean enableAudit) { - this.enableAudit = enableAudit; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/ConstantPendingMessageLimitStrategy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/ConstantPendingMessageLimitStrategy.class deleted file mode 100644 index e98e377d9..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/ConstantPendingMessageLimitStrategy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/ConstantPendingMessageLimitStrategy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/ConstantPendingMessageLimitStrategy.java deleted file mode 100644 index ae227cc42..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/ConstantPendingMessageLimitStrategy.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * 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.broker.region.policy; - -import org.apache.activemq.broker.region.TopicSubscription; - -/** - * This PendingMessageLimitStrategy is configured to a constant value for all subscriptions. - * - * @org.apache.xbean.XBean - * - * - */ -public class ConstantPendingMessageLimitStrategy implements PendingMessageLimitStrategy { - - private int limit = -1; - - public int getMaximumPendingMessageLimit(TopicSubscription subscription) { - return limit; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/DeadLetterStrategy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/DeadLetterStrategy.class deleted file mode 100644 index 39dfdd91b..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/DeadLetterStrategy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/DeadLetterStrategy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/DeadLetterStrategy.java deleted file mode 100644 index 5affb7223..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/DeadLetterStrategy.java +++ /dev/null @@ -1,74 +0,0 @@ -/** - * 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.broker.region.policy; - -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.Message; - -/** - * A strategy for choosing which destination is used for dead letter queue messages. - * - * - */ -public interface DeadLetterStrategy { - - /** - * Allow pluggable strategy for deciding if message should be sent to a dead letter queue - * for example, you might not want to ignore expired or non-persistent messages - * @param message - * @return true if message should be sent to a dead letter queue - */ - boolean isSendToDeadLetterQueue(Message message); - - /** - * Returns the dead letter queue for the given message and subscription. - */ - ActiveMQDestination getDeadLetterQueueFor(Message message, Subscription subscription); - - /** - * @return true if processes expired messages - */ - public boolean isProcessExpired() ; - - /** - * @param processExpired the processExpired to set - */ - public void setProcessExpired(boolean processExpired); - - /** - * @return the processNonPersistent - */ - public boolean isProcessNonPersistent(); - - /** - * @param processNonPersistent the processNonPersistent to set - */ - public void setProcessNonPersistent(boolean processNonPersistent); - - public boolean isDLQ(ActiveMQDestination destination); - - /** - * Allows for a Message that was already processed by a DLQ to be rolled back in case - * of a move or a retry of that message, otherwise the Message would be considered a - * duplicate if this strategy is doing Message Auditing. - * - * @param message - */ - public void rollback(Message message); - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/DiscardingDeadLetterStrategy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/DiscardingDeadLetterStrategy.class deleted file mode 100644 index 0f22ca72c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/DiscardingDeadLetterStrategy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/DiscardingDeadLetterStrategy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/DiscardingDeadLetterStrategy.java deleted file mode 100644 index 06abd747f..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/DiscardingDeadLetterStrategy.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * 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.broker.region.policy; - -import org.apache.activemq.command.Message; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * A {@link DeadLetterStrategy} where each destination has its own individual - * DLQ using the subject naming hierarchy. - * - * @org.apache.xbean.XBean element="discarding" description="Dead Letter Strategy that discards all messages" - * - */ -public class DiscardingDeadLetterStrategy extends SharedDeadLetterStrategy { - - private static final Logger LOG = LoggerFactory.getLogger(DiscardingDeadLetterStrategy.class); - - @Override - public boolean isSendToDeadLetterQueue(Message message) { - boolean result = false; - LOG.debug("Discarding message sent to DLQ: {}, dest: {}", message.getMessageId(), message.getDestination()); - return result; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/DispatchPolicy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/DispatchPolicy.class deleted file mode 100644 index ef2231c8f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/DispatchPolicy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/DispatchPolicy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/DispatchPolicy.java deleted file mode 100644 index 8bf95a5de..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/DispatchPolicy.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * 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.broker.region.policy; - -import java.util.List; - -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.filter.MessageEvaluationContext; - -/** - * Abstraction to allow different dispatching policies to be plugged - * into the topic region implementations. This is used by a topic to deliver - * messages to the matching subscriptions. - * - * - */ -public interface DispatchPolicy { - - /** - * Decides how to dispatch a selected message to a collection of consumers. A safe - * approach is to dispatch to every subscription that matches. - * - * The list will be safe to iterate over when this method is called - * - * @return true if at least one consumer was dispatched or false if there are no active subscriptions that could be dispatched - */ - boolean dispatch(MessageReference node, MessageEvaluationContext msgContext, List consumers) throws Exception; - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/DispatchSelector.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/DispatchSelector.class deleted file mode 100644 index beca8e4c9..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/DispatchSelector.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/DispatchSelector.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/DispatchSelector.java deleted file mode 100644 index 22799781f..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/DispatchSelector.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * 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.broker.region.policy; - -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.broker.region.Subscription; - -/** - * Determines if a subscription can dispatch a message reference - * - */ -public interface DispatchSelector { - - - /** - * return true if a subscription can dispatch a message reference - * @param subscription - * @param node - * @return true if can dispatch - * @throws Exception - */ - - boolean canDispatch(Subscription subscription, MessageReference node) throws Exception; -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/FilePendingDurableSubscriberMessageStoragePolicy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/FilePendingDurableSubscriberMessageStoragePolicy.class deleted file mode 100644 index 1343da508..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/FilePendingDurableSubscriberMessageStoragePolicy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/FilePendingDurableSubscriberMessageStoragePolicy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/FilePendingDurableSubscriberMessageStoragePolicy.java deleted file mode 100644 index 0f714eb63..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/FilePendingDurableSubscriberMessageStoragePolicy.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * 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.broker.region.policy; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.region.DurableTopicSubscription; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.broker.region.cursors.AbstractPendingMessageCursor; -import org.apache.activemq.broker.region.cursors.FilePendingMessageCursor; -import org.apache.activemq.broker.region.cursors.PendingMessageCursor; - -/** - * Creates a PendIngMessageCursor for Durable subscribers * - * - * @org.apache.xbean.XBean element="fileDurableSubscriberCursor" - * description="Pending messages for durable subscribers - * held in temporary files" - * - */ -public class FilePendingDurableSubscriberMessageStoragePolicy implements PendingDurableSubscriberMessageStoragePolicy { - - /** - * Retrieve the configured pending message storage cursor; - * @param broker - * - * @param clientId - * @param name - * @param maxBatchSize - * @param sub - * @return the Pending Message cursor - */ - public PendingMessageCursor getSubscriberPendingMessageCursor(Broker broker,String clientId, String name, int maxBatchSize, DurableTopicSubscription sub) { - return new FilePendingMessageCursor(broker,name,AbstractPendingMessageCursor.isPrioritizedMessageSubscriber(broker, sub)); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/FilePendingQueueMessageStoragePolicy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/FilePendingQueueMessageStoragePolicy.class deleted file mode 100644 index 1ad0d59ab..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/FilePendingQueueMessageStoragePolicy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/FilePendingQueueMessageStoragePolicy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/FilePendingQueueMessageStoragePolicy.java deleted file mode 100644 index 27feef0f3..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/FilePendingQueueMessageStoragePolicy.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * 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.broker.region.policy; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.region.Queue; -import org.apache.activemq.broker.region.cursors.FilePendingMessageCursor; -import org.apache.activemq.broker.region.cursors.PendingMessageCursor; - -/** - * Creates a FilePendingMessageCursor * - * - * @org.apache.xbean.XBean element="fileQueueCursor" description="Pending - * messages paged in from file" - * - * - */ -public class FilePendingQueueMessageStoragePolicy implements PendingQueueMessageStoragePolicy { - - /** - * @param broker - * @param queue - * @return the cursor - * @see org.apache.activemq.broker.region.policy.PendingQueueMessageStoragePolicy#getQueuePendingMessageCursor(org.apache.openjpa.lib.util.concurrent.Queue, - * org.apache.activemq.kaha.Store) - */ - public PendingMessageCursor getQueuePendingMessageCursor(Broker broker,Queue queue) { - return new FilePendingMessageCursor(broker,"PendingCursor:" + queue.getName(),queue.isPrioritizedMessages()); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/FilePendingSubscriberMessageStoragePolicy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/FilePendingSubscriberMessageStoragePolicy.class deleted file mode 100644 index dfe0c7f04..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/FilePendingSubscriberMessageStoragePolicy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/FilePendingSubscriberMessageStoragePolicy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/FilePendingSubscriberMessageStoragePolicy.java deleted file mode 100644 index 2a42d0e64..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/FilePendingSubscriberMessageStoragePolicy.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * 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.broker.region.policy; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.broker.region.cursors.AbstractPendingMessageCursor; -import org.apache.activemq.broker.region.cursors.FilePendingMessageCursor; -import org.apache.activemq.broker.region.cursors.PendingMessageCursor; - -/** - * Creates a PendIngMessageCursor for Durable subscribers * - * - * @org.apache.xbean.XBean element="fileCursor" description="Pending messages - * for durable subscribers held in temporary files" - * - * - */ -public class FilePendingSubscriberMessageStoragePolicy implements PendingSubscriberMessageStoragePolicy { - - /** - * @param broker - * @param name - * @param maxBatchSize - * @return a Cursor - * @see org.apache.activemq.broker.region.policy.PendingSubscriberMessageStoragePolicy#getSubscriberPendingMessageCursor(java.lang.String, - * org.apache.activemq.kaha.Store, int) - */ - public PendingMessageCursor getSubscriberPendingMessageCursor(Broker broker, String name, int maxBatchSize, - Subscription subs) { - return new FilePendingMessageCursor(broker, "PendingCursor:" + name, AbstractPendingMessageCursor - .isPrioritizedMessageSubscriber(broker, subs)); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/FixedCountSubscriptionRecoveryPolicy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/FixedCountSubscriptionRecoveryPolicy.class deleted file mode 100644 index 842ef8247..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/FixedCountSubscriptionRecoveryPolicy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/FixedCountSubscriptionRecoveryPolicy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/FixedCountSubscriptionRecoveryPolicy.java deleted file mode 100644 index 84b645058..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/FixedCountSubscriptionRecoveryPolicy.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * 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.broker.region.policy; - -import java.util.ArrayList; -import java.util.List; -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.broker.region.SubscriptionRecovery; -import org.apache.activemq.broker.region.Topic; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.Message; -import org.apache.activemq.filter.DestinationFilter; - -/** - * This implementation of {@link SubscriptionRecoveryPolicy} will keep a fixed - * count of last messages. - * - * @org.apache.xbean.XBean - * - */ -public class FixedCountSubscriptionRecoveryPolicy implements SubscriptionRecoveryPolicy { - private volatile MessageReference messages[]; - private int maximumSize = 100; - private int tail; - - public SubscriptionRecoveryPolicy copy() { - FixedCountSubscriptionRecoveryPolicy rc = new FixedCountSubscriptionRecoveryPolicy(); - rc.setMaximumSize(maximumSize); - return rc; - } - - public synchronized boolean add(ConnectionContext context, MessageReference node) throws Exception { - messages[tail++] = node; - if (tail >= messages.length) { - tail = 0; - } - return true; - } - - public synchronized void recover(ConnectionContext context, Topic topic, SubscriptionRecovery sub) throws Exception { - // Re-dispatch the last message seen. - int t = tail; - // The buffer may not have rolled over yet..., start from the front - if (messages[t] == null) { - t = 0; - } - // Well the buffer is really empty then. - if (messages[t] == null) { - return; - } - // Keep dispatching until t hit's tail again. - do { - MessageReference node = messages[t]; - sub.addRecoveredMessage(context, node); - t++; - if (t >= messages.length) { - t = 0; - } - } while (t != tail); - } - - public void start() throws Exception { - messages = new MessageReference[maximumSize]; - } - - public void stop() throws Exception { - messages = null; - } - - public int getMaximumSize() { - return maximumSize; - } - - /** - * Sets the maximum number of messages that this destination will hold - * around in RAM - */ - public void setMaximumSize(int maximumSize) { - this.maximumSize = maximumSize; - } - - public synchronized Message[] browse(ActiveMQDestination destination) throws Exception { - List result = new ArrayList(); - DestinationFilter filter = DestinationFilter.parseFilter(destination); - int t = tail; - if (messages[t] == null) { - t = 0; - } - if (messages[t] != null) { - do { - MessageReference ref = messages[t]; - Message message = ref.getMessage(); - if (filter.matches(message.getDestination())) { - result.add(message); - } - t++; - if (t >= messages.length) { - t = 0; - } - } while (t != tail); - } - return result.toArray(new Message[result.size()]); - } - - public void setBroker(Broker broker) { - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/FixedSizedSubscriptionRecoveryPolicy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/FixedSizedSubscriptionRecoveryPolicy.class deleted file mode 100644 index c27565533..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/FixedSizedSubscriptionRecoveryPolicy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/FixedSizedSubscriptionRecoveryPolicy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/FixedSizedSubscriptionRecoveryPolicy.java deleted file mode 100644 index 8c58e4cad..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/FixedSizedSubscriptionRecoveryPolicy.java +++ /dev/null @@ -1,128 +0,0 @@ -/** - * 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.broker.region.policy; - -import java.util.Iterator; -import java.util.List; -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.broker.region.SubscriptionRecovery; -import org.apache.activemq.broker.region.Topic; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.Message; -import org.apache.activemq.memory.list.DestinationBasedMessageList; -import org.apache.activemq.memory.list.MessageList; -import org.apache.activemq.memory.list.SimpleMessageList; - -/** - * This implementation of {@link SubscriptionRecoveryPolicy} will keep a fixed - * amount of memory available in RAM for message history which is evicted in - * time order. - * - * @org.apache.xbean.XBean - * - */ -public class FixedSizedSubscriptionRecoveryPolicy implements SubscriptionRecoveryPolicy { - - private MessageList buffer; - private int maximumSize = 64 * 1024; - private boolean useSharedBuffer = true; - - public FixedSizedSubscriptionRecoveryPolicy() { - - } - - public SubscriptionRecoveryPolicy copy() { - FixedSizedSubscriptionRecoveryPolicy rc = new FixedSizedSubscriptionRecoveryPolicy(); - rc.setMaximumSize(maximumSize); - rc.setUseSharedBuffer(useSharedBuffer); - return rc; - } - - public boolean add(ConnectionContext context, MessageReference message) throws Exception { - buffer.add(message); - return true; - } - - public void recover(ConnectionContext context, Topic topic, SubscriptionRecovery sub) throws Exception { - // Re-dispatch the messages from the buffer. - List copy = buffer.getMessages(sub.getActiveMQDestination()); - if (!copy.isEmpty()) { - for (Iterator iter = copy.iterator(); iter.hasNext();) { - MessageReference node = (MessageReference)iter.next(); - sub.addRecoveredMessage(context, node); - } - } - } - - public void start() throws Exception { - buffer = createMessageList(); - } - - public void stop() throws Exception { - buffer.clear(); - } - - // Properties - // ------------------------------------------------------------------------- - public MessageList getBuffer() { - return buffer; - } - - public void setBuffer(MessageList buffer) { - this.buffer = buffer; - } - - public int getMaximumSize() { - return maximumSize; - } - - /** - * Sets the maximum amount of RAM in bytes that this buffer can hold in RAM - */ - public void setMaximumSize(int maximumSize) { - this.maximumSize = maximumSize; - } - - public boolean isUseSharedBuffer() { - return useSharedBuffer; - } - - public void setUseSharedBuffer(boolean useSharedBuffer) { - this.useSharedBuffer = useSharedBuffer; - } - - public Message[] browse(ActiveMQDestination destination) throws Exception { - return buffer.browse(destination); - } - - public void setBroker(Broker broker) { - } - - // Implementation methods - - // ------------------------------------------------------------------------- - protected MessageList createMessageList() { - if (useSharedBuffer) { - return new SimpleMessageList(maximumSize); - } else { - return new DestinationBasedMessageList(maximumSize); - } - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/IndividualDeadLetterStrategy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/IndividualDeadLetterStrategy.class deleted file mode 100644 index 5198cbe8f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/IndividualDeadLetterStrategy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/IndividualDeadLetterStrategy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/IndividualDeadLetterStrategy.java deleted file mode 100644 index 72c0a269b..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/IndividualDeadLetterStrategy.java +++ /dev/null @@ -1,185 +0,0 @@ -/** - * 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.broker.region.policy; - -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.DurableTopicSubscription; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ActiveMQQueue; -import org.apache.activemq.command.ActiveMQTopic; -import org.apache.activemq.command.Message; - -/** - * A {@link DeadLetterStrategy} where each destination has its own individual - * DLQ using the subject naming hierarchy. - * - * @org.apache.xbean.XBean - * - */ -public class IndividualDeadLetterStrategy extends AbstractDeadLetterStrategy { - - private String topicPrefix = "ActiveMQ.DLQ.Topic."; - private String queuePrefix = "ActiveMQ.DLQ.Queue."; - private String topicSuffix; - private String queueSuffix; - private boolean useQueueForQueueMessages = true; - private boolean useQueueForTopicMessages = true; - private boolean destinationPerDurableSubscriber; - - public ActiveMQDestination getDeadLetterQueueFor(Message message, Subscription subscription) { - if (message.getDestination().isQueue()) { - return createDestination(message, queuePrefix, queueSuffix, useQueueForQueueMessages, subscription); - } else { - return createDestination(message, topicPrefix, topicSuffix, useQueueForTopicMessages, subscription); - } - } - - // Properties - // ------------------------------------------------------------------------- - - public String getQueuePrefix() { - return queuePrefix; - } - - /** - * Sets the prefix to use for all dead letter queues for queue messages - */ - public void setQueuePrefix(String queuePrefix) { - this.queuePrefix = queuePrefix; - } - - public String getTopicPrefix() { - return topicPrefix; - } - - /** - * Sets the prefix to use for all dead letter queues for topic messages - */ - public void setTopicPrefix(String topicPrefix) { - this.topicPrefix = topicPrefix; - } - - public String getQueueSuffix() { - return queueSuffix; - } - - /** - * Sets the suffix to use for all dead letter queues for queue messages - */ - public void setQueueSuffix(String queueSuffix) { - this.queueSuffix = queueSuffix; - } - - public String getTopicSuffix() { - return topicSuffix; - } - - /** - * Sets the suffix to use for all dead letter queues for topic messages - */ - public void setTopicSuffix(String topicSuffix) { - this.topicSuffix = topicSuffix; - } - - public boolean isUseQueueForQueueMessages() { - return useQueueForQueueMessages; - } - - /** - * Sets whether a queue or topic should be used for queue messages sent to a - * DLQ. The default is to use a Queue - */ - public void setUseQueueForQueueMessages(boolean useQueueForQueueMessages) { - this.useQueueForQueueMessages = useQueueForQueueMessages; - } - - public boolean isUseQueueForTopicMessages() { - return useQueueForTopicMessages; - } - - /** - * Sets whether a queue or topic should be used for topic messages sent to a - * DLQ. The default is to use a Queue - */ - public void setUseQueueForTopicMessages(boolean useQueueForTopicMessages) { - this.useQueueForTopicMessages = useQueueForTopicMessages; - } - - public boolean isDestinationPerDurableSubscriber() { - return destinationPerDurableSubscriber; - } - - /** - * sets whether durable topic subscriptions are to get individual dead letter destinations. - * When true, the DLQ is of the form 'topicPrefix.clientId:subscriptionName' - * The default is false. - * @param destinationPerDurableSubscriber - */ - public void setDestinationPerDurableSubscriber(boolean destinationPerDurableSubscriber) { - this.destinationPerDurableSubscriber = destinationPerDurableSubscriber; - } - - // Implementation methods - // ------------------------------------------------------------------------- - protected ActiveMQDestination createDestination(Message message, - String prefix, - String suffix, - boolean useQueue, - Subscription subscription ) { - String name = null; - - Destination regionDestination = (Destination) message.getRegionDestination(); - if (regionDestination != null - && regionDestination.getActiveMQDestination() != null - && regionDestination.getActiveMQDestination().getPhysicalName() != null - && !regionDestination.getActiveMQDestination().getPhysicalName().isEmpty()){ - name = prefix + regionDestination.getActiveMQDestination().getPhysicalName(); - } else { - name = prefix + message.getDestination().getPhysicalName(); - } - - if (destinationPerDurableSubscriber && subscription instanceof DurableTopicSubscription) { - name += "." + ((DurableTopicSubscription)subscription).getSubscriptionKey(); - } - - if (suffix != null && !suffix.isEmpty()) { - name += suffix; - } - - if (useQueue) { - return new ActiveMQQueue(name); - } else { - return new ActiveMQTopic(name); - } - } - - @Override - public boolean isDLQ(ActiveMQDestination destination) { - String name = destination.getPhysicalName(); - if (destination.isQueue()) { - if ((queuePrefix != null && name.startsWith(queuePrefix)) || (queueSuffix != null && name.endsWith(queueSuffix))) { - return true; - } - } else { - if ((topicPrefix != null && name.startsWith(topicPrefix)) || (topicSuffix != null && name.endsWith(topicSuffix))) { - return true; - } - } - return false; - } -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/LastImageSubscriptionRecoveryPolicy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/LastImageSubscriptionRecoveryPolicy.class deleted file mode 100644 index c1717f5ee..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/LastImageSubscriptionRecoveryPolicy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/LastImageSubscriptionRecoveryPolicy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/LastImageSubscriptionRecoveryPolicy.java deleted file mode 100644 index ffcd1dab4..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/LastImageSubscriptionRecoveryPolicy.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * 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.broker.region.policy; - -import java.util.ArrayList; -import java.util.List; -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.broker.region.SubscriptionRecovery; -import org.apache.activemq.broker.region.Topic; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.Message; -import org.apache.activemq.filter.DestinationFilter; - -/** - * This implementation of {@link SubscriptionRecoveryPolicy} will only keep the - * last message. - * - * @org.apache.xbean.XBean - * - */ -public class LastImageSubscriptionRecoveryPolicy implements SubscriptionRecoveryPolicy { - - private volatile MessageReference lastImage; - - public boolean add(ConnectionContext context, MessageReference node) throws Exception { - lastImage = node; - return true; - } - - public void recover(ConnectionContext context, Topic topic, SubscriptionRecovery sub) throws Exception { - // Re-dispatch the last message seen. - MessageReference node = lastImage; - if (node != null) { - sub.addRecoveredMessage(context, node); - } - } - - public void start() throws Exception { - } - - public void stop() throws Exception { - } - - public Message[] browse(ActiveMQDestination destination) throws Exception { - List result = new ArrayList(); - if (lastImage != null) { - DestinationFilter filter = DestinationFilter.parseFilter(destination); - if (filter.matches(lastImage.getMessage().getDestination())) { - result.add(lastImage.getMessage()); - } - } - return result.toArray(new Message[result.size()]); - } - - public SubscriptionRecoveryPolicy copy() { - return new LastImageSubscriptionRecoveryPolicy(); - } - - public void setBroker(Broker broker) { - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/MessageEvictionStrategy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/MessageEvictionStrategy.class deleted file mode 100644 index 81a53fe0f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/MessageEvictionStrategy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/MessageEvictionStrategy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/MessageEvictionStrategy.java deleted file mode 100644 index 334cb3730..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/MessageEvictionStrategy.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * 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.broker.region.policy; - -import java.io.IOException; -import java.util.LinkedList; - -import org.apache.activemq.broker.region.MessageReference; - -/** - * A strategy for evicting messages from slow consumers. - * - * - */ -public interface MessageEvictionStrategy { - - /** - * Find the message reference in the given list with oldest messages at the front and newer messages at the end - * - * @return the message that has been evicted. - * @throws IOException if an exception occurs such as reading a message content (but should not ever happen - * as usually all the messages will be in RAM when this method is called). - */ - MessageReference[] evictMessages(LinkedList messages) throws IOException; - - /** - * REturns the high water mark on which we will eagerly evict expired messages from RAM - */ - int getEvictExpiredMessagesHighWatermark(); - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/MessageEvictionStrategySupport.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/MessageEvictionStrategySupport.class deleted file mode 100644 index c45fdedd2..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/MessageEvictionStrategySupport.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/MessageEvictionStrategySupport.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/MessageEvictionStrategySupport.java deleted file mode 100644 index 32f0c6f0c..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/MessageEvictionStrategySupport.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * 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.broker.region.policy; - -/** - * A useful base class for implementation inheritence. - * - * - */ -public abstract class MessageEvictionStrategySupport implements MessageEvictionStrategy { - - private int evictExpiredMessagesHighWatermark = 1000; - - public int getEvictExpiredMessagesHighWatermark() { - return evictExpiredMessagesHighWatermark; - } - - /** - * Sets the high water mark on which we will eagerly evict expired messages from RAM - */ - public void setEvictExpiredMessagesHighWatermark(int evictExpiredMessagesHighWaterMark) { - this.evictExpiredMessagesHighWatermark = evictExpiredMessagesHighWaterMark; - } - - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/MessageQuery.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/MessageQuery.class deleted file mode 100644 index f309e6cb3..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/MessageQuery.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/MessageQuery.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/MessageQuery.java deleted file mode 100644 index ae462a7ec..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/MessageQuery.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * 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.broker.region.policy; - -import javax.jms.MessageListener; - -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.Message; - -/** - * Represents some kind of query which will load initial messages from some source for a new topic subscriber. - * - * - */ -public interface MessageQuery { - - /** - * Executes the query for messages; each message is passed into the listener - * - * @param destination the destination on which the query is to be performed - * @param listener is the listener to notify as each message is created or loaded - */ - void execute(ActiveMQDestination destination, MessageListener listener) throws Exception; - - /** - * Returns true if the given update is valid and does not overlap with the initial message query. - * When performing an initial load from some source, there is a chance that an update may occur which is logically before - * the message sent on the initial load - so this method provides a hook where the query instance can keep track of the version IDs - * of the messages sent so that if an older version is sent as an update it can be excluded to avoid going backwards in time. - * - * e.g. if the execute() method creates version 2 of an object and then an update message is sent for version 1, this method should return false to - * hide the old update message. - * - * @param message the update message which may have been sent before the query actually completed - * @return true if the update message is valid otherwise false in which case the update message will be discarded. - */ - boolean validateUpdate(Message message); - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/NoSubscriptionRecoveryPolicy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/NoSubscriptionRecoveryPolicy.class deleted file mode 100644 index 2faff9959..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/NoSubscriptionRecoveryPolicy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/NoSubscriptionRecoveryPolicy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/NoSubscriptionRecoveryPolicy.java deleted file mode 100644 index 69745a262..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/NoSubscriptionRecoveryPolicy.java +++ /dev/null @@ -1,60 +0,0 @@ -/** - * 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.broker.region.policy; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.broker.region.SubscriptionRecovery; -import org.apache.activemq.broker.region.Topic; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.Message; - -/** - * This SubscriptionRecoveryPolicy disable recovery of messages. - * - * @org.apache.xbean.XBean - * - */ -public class NoSubscriptionRecoveryPolicy implements SubscriptionRecoveryPolicy { - - public SubscriptionRecoveryPolicy copy() { - // This object is immutable - return this; - } - - public boolean add(ConnectionContext context, MessageReference node) throws Exception { - return true; - } - - public void recover(ConnectionContext context, Topic topic, SubscriptionRecovery sub) throws Exception { - } - - public void start() throws Exception { - } - - public void stop() throws Exception { - } - - public Message[] browse(ActiveMQDestination dest) throws Exception { - return new Message[0]; - } - - public void setBroker(Broker broker) { - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/OldestMessageEvictionStrategy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/OldestMessageEvictionStrategy.class deleted file mode 100644 index a8e05413e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/OldestMessageEvictionStrategy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/OldestMessageEvictionStrategy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/OldestMessageEvictionStrategy.java deleted file mode 100644 index 90bf3cb0c..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/OldestMessageEvictionStrategy.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * 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.broker.region.policy; - -import java.util.LinkedList; - -import org.apache.activemq.broker.region.MessageReference; - -/** - * An eviction strategy which evicts the oldest message first (which is the - * default). - * - * @org.apache.xbean.XBean - * - * - */ -public class OldestMessageEvictionStrategy extends MessageEvictionStrategySupport { - - public MessageReference[] evictMessages(LinkedList messages) { - return new MessageReference[] {(MessageReference) messages.removeFirst()}; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/OldestMessageWithLowestPriorityEvictionStrategy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/OldestMessageWithLowestPriorityEvictionStrategy.class deleted file mode 100644 index 4a4c1c8e7..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/OldestMessageWithLowestPriorityEvictionStrategy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/OldestMessageWithLowestPriorityEvictionStrategy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/OldestMessageWithLowestPriorityEvictionStrategy.java deleted file mode 100644 index 38ccbdaa5..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/OldestMessageWithLowestPriorityEvictionStrategy.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * 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.broker.region.policy; - -import java.io.IOException; -import java.util.Iterator; -import java.util.LinkedList; - -import org.apache.activemq.broker.region.MessageReference; - -/** - * An eviction strategy which evicts the oldest message with the lowest priority first. - * - * @org.apache.xbean.XBean - * - * messageEvictionStrategy - */ -public class OldestMessageWithLowestPriorityEvictionStrategy extends MessageEvictionStrategySupport { - - public MessageReference[] evictMessages(LinkedList messages) throws IOException { - byte lowestPriority = Byte.MAX_VALUE; - int pivot = 0; - Iterator iter = messages.iterator(); - for (int i = 0; iter.hasNext(); i++) { - MessageReference reference = (MessageReference) iter.next(); - byte priority = reference.getMessage().getPriority(); - if (priority < lowestPriority) { - lowestPriority = priority; - pivot = i; - } - } - return new MessageReference[] {(MessageReference) messages.remove(pivot)}; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PendingDurableSubscriberMessageStoragePolicy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PendingDurableSubscriberMessageStoragePolicy.class deleted file mode 100644 index a1e3c4924..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PendingDurableSubscriberMessageStoragePolicy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PendingDurableSubscriberMessageStoragePolicy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PendingDurableSubscriberMessageStoragePolicy.java deleted file mode 100644 index 9a7b6134c..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PendingDurableSubscriberMessageStoragePolicy.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * 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.broker.region.policy; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.region.DurableTopicSubscription; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.broker.region.cursors.PendingMessageCursor; - -/** - * Abstraction to allow different policies for holding messages awaiting - * dispatch to active clients - * - * - */ -public interface PendingDurableSubscriberMessageStoragePolicy { - - /** - * Retrieve the configured pending message storage cursor; - * @param broker - * - * @param clientId - * @param name - * @param maxBatchSize - * @param sub - * @return the Pending Message cursor - */ - PendingMessageCursor getSubscriberPendingMessageCursor(Broker broker,String clientId, String name, int maxBatchSize, DurableTopicSubscription sub); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PendingMessageLimitStrategy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PendingMessageLimitStrategy.class deleted file mode 100644 index 4f7a89f43..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PendingMessageLimitStrategy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PendingMessageLimitStrategy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PendingMessageLimitStrategy.java deleted file mode 100644 index 9015fa057..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PendingMessageLimitStrategy.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * 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.broker.region.policy; - -import org.apache.activemq.broker.region.TopicSubscription; - -/** - * A pluggable strategy to calculate the maximum number of messages that are allowed to be pending on - * consumers (in addition to their prefetch sizes). - * - * Once the limit is reached, non-durable topics can then start discarding old messages. - * This allows us to keep dispatching messages to slow consumers while not blocking fast consumers - * and discarding the messages oldest first. - * - * - */ -public interface PendingMessageLimitStrategy { - - /** - * Calculate the maximum number of pending messages (in excess of the prefetch size) - * for the given subscription - * - * @return the maximum or -1 if there is no maximum - */ - int getMaximumPendingMessageLimit(TopicSubscription subscription); - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PendingQueueMessageStoragePolicy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PendingQueueMessageStoragePolicy.class deleted file mode 100644 index 752de5823..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PendingQueueMessageStoragePolicy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PendingQueueMessageStoragePolicy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PendingQueueMessageStoragePolicy.java deleted file mode 100644 index d2f5802c1..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PendingQueueMessageStoragePolicy.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * 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.broker.region.policy; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.region.Queue; -import org.apache.activemq.broker.region.cursors.PendingMessageCursor; - -/** - * Abstraction to allow different policies for holding messages awaiting - * dispatch on a Queue - * - * - */ -public interface PendingQueueMessageStoragePolicy { - - /** - * Retrieve the configured pending message storage cursor; - * @param broker - * - * @param queue - * @return the cursor - */ - PendingMessageCursor getQueuePendingMessageCursor(Broker broker,Queue queue); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PendingSubscriberMessageStoragePolicy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PendingSubscriberMessageStoragePolicy.class deleted file mode 100644 index c3fe6ed1e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PendingSubscriberMessageStoragePolicy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PendingSubscriberMessageStoragePolicy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PendingSubscriberMessageStoragePolicy.java deleted file mode 100644 index 36430aea9..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PendingSubscriberMessageStoragePolicy.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * 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.broker.region.policy; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.broker.region.cursors.PendingMessageCursor; - -/** - * Abstraction to allow different policies for holding messages awaiting - * dispatch to active clients - * - * - */ -public interface PendingSubscriberMessageStoragePolicy { - - /** - * Retrieve the configured pending message storage cursor; - * @param broker - * - * @param name - * @param maxBatchSize - * @return the Pending Message cursor - */ - PendingMessageCursor getSubscriberPendingMessageCursor(Broker broker,String name,int maxBatchSize,Subscription subs); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PolicyEntry.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PolicyEntry.class deleted file mode 100644 index 828e84335..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PolicyEntry.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PolicyEntry.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PolicyEntry.java deleted file mode 100644 index c219b191f..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PolicyEntry.java +++ /dev/null @@ -1,920 +0,0 @@ -/** - * 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.broker.region.policy; - -import org.apache.activemq.ActiveMQPrefetchPolicy; -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.region.BaseDestination; -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.DurableTopicSubscription; -import org.apache.activemq.broker.region.Queue; -import org.apache.activemq.broker.region.QueueBrowserSubscription; -import org.apache.activemq.broker.region.QueueSubscription; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.broker.region.Topic; -import org.apache.activemq.broker.region.TopicSubscription; -import org.apache.activemq.broker.region.cursors.PendingMessageCursor; -import org.apache.activemq.broker.region.group.GroupFactoryFinder; -import org.apache.activemq.broker.region.group.MessageGroupMapFactory; -import org.apache.activemq.filter.DestinationMapEntry; -import org.apache.activemq.network.NetworkBridgeFilterFactory; -import org.apache.activemq.usage.SystemUsage; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Represents an entry in a {@link PolicyMap} for assigning policies to a - * specific destination or a hierarchical wildcard area of destinations. - * - * @org.apache.xbean.XBean - * - */ -public class PolicyEntry extends DestinationMapEntry { - - private static final Logger LOG = LoggerFactory.getLogger(PolicyEntry.class); - private DispatchPolicy dispatchPolicy; - private SubscriptionRecoveryPolicy subscriptionRecoveryPolicy; - private boolean sendAdvisoryIfNoConsumers; - private DeadLetterStrategy deadLetterStrategy = Destination.DEFAULT_DEAD_LETTER_STRATEGY; - private PendingMessageLimitStrategy pendingMessageLimitStrategy; - private MessageEvictionStrategy messageEvictionStrategy; - private long memoryLimit; - private String messageGroupMapFactoryType = "cached"; - private MessageGroupMapFactory messageGroupMapFactory; - private PendingQueueMessageStoragePolicy pendingQueuePolicy; - private PendingDurableSubscriberMessageStoragePolicy pendingDurableSubscriberPolicy; - private PendingSubscriberMessageStoragePolicy pendingSubscriberPolicy; - private int maxProducersToAudit=BaseDestination.MAX_PRODUCERS_TO_AUDIT; - private int maxAuditDepth=BaseDestination.MAX_AUDIT_DEPTH; - private int maxQueueAuditDepth=BaseDestination.MAX_AUDIT_DEPTH; - private boolean enableAudit=true; - private boolean producerFlowControl = true; - private boolean alwaysRetroactive = false; - private long blockedProducerWarningInterval = Destination.DEFAULT_BLOCKED_PRODUCER_WARNING_INTERVAL; - private boolean optimizedDispatch=false; - private int maxPageSize=BaseDestination.MAX_PAGE_SIZE; - private int maxBrowsePageSize=BaseDestination.MAX_BROWSE_PAGE_SIZE; - private boolean useCache=true; - private long minimumMessageSize=1024; - private boolean useConsumerPriority=true; - private boolean strictOrderDispatch=false; - private boolean lazyDispatch=false; - private int timeBeforeDispatchStarts = 0; - private int consumersBeforeDispatchStarts = 0; - private boolean advisoryForSlowConsumers; - private boolean advisoryForFastProducers; - private boolean advisoryForDiscardingMessages; - private boolean advisoryWhenFull; - private boolean advisoryForDelivery; - private boolean advisoryForConsumed; - private long expireMessagesPeriod = BaseDestination.EXPIRE_MESSAGE_PERIOD; - private int maxExpirePageSize = BaseDestination.MAX_BROWSE_PAGE_SIZE; - private int queuePrefetch=ActiveMQPrefetchPolicy.DEFAULT_QUEUE_PREFETCH; - private int queueBrowserPrefetch=ActiveMQPrefetchPolicy.DEFAULT_QUEUE_BROWSER_PREFETCH; - private int topicPrefetch=ActiveMQPrefetchPolicy.DEFAULT_TOPIC_PREFETCH; - private int durableTopicPrefetch=ActiveMQPrefetchPolicy.DEFAULT_DURABLE_TOPIC_PREFETCH; - private boolean usePrefetchExtension = true; - private int cursorMemoryHighWaterMark = 70; - private int storeUsageHighWaterMark = 100; - private SlowConsumerStrategy slowConsumerStrategy; - private boolean prioritizedMessages; - private boolean allConsumersExclusiveByDefault; - private boolean gcInactiveDestinations; - private boolean gcWithNetworkConsumers; - private long inactiveTimoutBeforeGC = BaseDestination.DEFAULT_INACTIVE_TIMEOUT_BEFORE_GC; - private boolean reduceMemoryFootprint; - private NetworkBridgeFilterFactory networkBridgeFilterFactory; - private boolean doOptimzeMessageStorage = true; - /* - * percentage of in-flight messages above which optimize message store is disabled - */ - private int optimizeMessageStoreInFlightLimit = 10; - - - public void configure(Broker broker,Queue queue) { - baseConfiguration(broker,queue); - if (dispatchPolicy != null) { - queue.setDispatchPolicy(dispatchPolicy); - } - queue.setDeadLetterStrategy(getDeadLetterStrategy()); - queue.setMessageGroupMapFactory(getMessageGroupMapFactory()); - if (memoryLimit > 0) { - queue.getMemoryUsage().setLimit(memoryLimit); - } - if (pendingQueuePolicy != null) { - PendingMessageCursor messages = pendingQueuePolicy.getQueuePendingMessageCursor(broker,queue); - queue.setMessages(messages); - } - - queue.setUseConsumerPriority(isUseConsumerPriority()); - queue.setStrictOrderDispatch(isStrictOrderDispatch()); - queue.setOptimizedDispatch(isOptimizedDispatch()); - queue.setLazyDispatch(isLazyDispatch()); - queue.setTimeBeforeDispatchStarts(getTimeBeforeDispatchStarts()); - queue.setConsumersBeforeDispatchStarts(getConsumersBeforeDispatchStarts()); - queue.setAllConsumersExclusiveByDefault(isAllConsumersExclusiveByDefault()); - } - - public void update(Queue queue) { - baseUpdate(queue); - if (memoryLimit > 0) { - queue.getMemoryUsage().setLimit(memoryLimit); - } - queue.setUseConsumerPriority(isUseConsumerPriority()); - queue.setStrictOrderDispatch(isStrictOrderDispatch()); - queue.setOptimizedDispatch(isOptimizedDispatch()); - queue.setLazyDispatch(isLazyDispatch()); - queue.setTimeBeforeDispatchStarts(getTimeBeforeDispatchStarts()); - queue.setConsumersBeforeDispatchStarts(getConsumersBeforeDispatchStarts()); - queue.setAllConsumersExclusiveByDefault(isAllConsumersExclusiveByDefault()); - } - - public void configure(Broker broker,Topic topic) { - baseConfiguration(broker,topic); - if (dispatchPolicy != null) { - topic.setDispatchPolicy(dispatchPolicy); - } - topic.setDeadLetterStrategy(getDeadLetterStrategy()); - if (subscriptionRecoveryPolicy != null) { - SubscriptionRecoveryPolicy srp = subscriptionRecoveryPolicy.copy(); - srp.setBroker(broker); - topic.setSubscriptionRecoveryPolicy(srp); - } - if (memoryLimit > 0) { - topic.getMemoryUsage().setLimit(memoryLimit); - } - topic.setLazyDispatch(isLazyDispatch()); - } - - public void update(Topic topic) { - baseUpdate(topic); - if (memoryLimit > 0) { - topic.getMemoryUsage().setLimit(memoryLimit); - } - topic.setLazyDispatch(isLazyDispatch()); - } - - // attributes that can change on the fly - public void baseUpdate(BaseDestination destination) { - destination.setProducerFlowControl(isProducerFlowControl()); - destination.setAlwaysRetroactive(isAlwaysRetroactive()); - destination.setBlockedProducerWarningInterval(getBlockedProducerWarningInterval()); - - destination.setMaxPageSize(getMaxPageSize()); - destination.setMaxBrowsePageSize(getMaxBrowsePageSize()); - - destination.setMinimumMessageSize((int) getMinimumMessageSize()); - destination.setMaxExpirePageSize(getMaxExpirePageSize()); - destination.setCursorMemoryHighWaterMark(getCursorMemoryHighWaterMark()); - destination.setStoreUsageHighWaterMark(getStoreUsageHighWaterMark()); - - destination.setGcIfInactive(isGcInactiveDestinations()); - destination.setGcWithNetworkConsumers(isGcWithNetworkConsumers()); - destination.setInactiveTimoutBeforeGC(getInactiveTimoutBeforeGC()); - destination.setReduceMemoryFootprint(isReduceMemoryFootprint()); - destination.setDoOptimzeMessageStorage(isDoOptimzeMessageStorage()); - destination.setOptimizeMessageStoreInFlightLimit(getOptimizeMessageStoreInFlightLimit()); - - destination.setAdvisoryForConsumed(isAdvisoryForConsumed()); - destination.setAdvisoryForDelivery(isAdvisoryForDelivery()); - destination.setAdvisoryForDiscardingMessages(isAdvisoryForDiscardingMessages()); - destination.setAdvisoryForSlowConsumers(isAdvisoryForSlowConsumers()); - destination.setAdvisoryForFastProducers(isAdvisoryForFastProducers()); - destination.setAdvisoryWhenFull(isAdvisoryWhenFull()); - destination.setSendAdvisoryIfNoConsumers(isSendAdvisoryIfNoConsumers()); - } - - public void baseConfiguration(Broker broker, BaseDestination destination) { - baseUpdate(destination); - destination.setEnableAudit(isEnableAudit()); - destination.setMaxAuditDepth(getMaxQueueAuditDepth()); - destination.setMaxProducersToAudit(getMaxProducersToAudit()); - destination.setUseCache(isUseCache()); - destination.setExpireMessagesPeriod(getExpireMessagesPeriod()); - SlowConsumerStrategy scs = getSlowConsumerStrategy(); - if (scs != null) { - scs.setBrokerService(broker); - scs.addDestination(destination); - } - destination.setSlowConsumerStrategy(scs); - destination.setPrioritizedMessages(isPrioritizedMessages()); - } - - public void configure(Broker broker, SystemUsage memoryManager, TopicSubscription subscription) { - configurePrefetch(subscription); - if (pendingMessageLimitStrategy != null) { - int value = pendingMessageLimitStrategy.getMaximumPendingMessageLimit(subscription); - int consumerLimit = subscription.getInfo().getMaximumPendingMessageLimit(); - if (consumerLimit > 0) { - if (value < 0 || consumerLimit < value) { - value = consumerLimit; - } - } - if (value >= 0) { - LOG.debug("Setting the maximumPendingMessages size to: {} for consumer: {}", value, subscription.getInfo().getConsumerId()); - subscription.setMaximumPendingMessages(value); - } - } - if (messageEvictionStrategy != null) { - subscription.setMessageEvictionStrategy(messageEvictionStrategy); - } - if (pendingSubscriberPolicy != null) { - String name = subscription.getContext().getClientId() + "_" + subscription.getConsumerInfo().getConsumerId(); - int maxBatchSize = subscription.getConsumerInfo().getPrefetchSize(); - subscription.setMatched(pendingSubscriberPolicy.getSubscriberPendingMessageCursor(broker,name, maxBatchSize,subscription)); - } - if (enableAudit) { - subscription.setEnableAudit(enableAudit); - subscription.setMaxProducersToAudit(maxProducersToAudit); - subscription.setMaxAuditDepth(maxAuditDepth); - } - } - - public void configure(Broker broker, SystemUsage memoryManager, DurableTopicSubscription sub) { - String clientId = sub.getSubscriptionKey().getClientId(); - String subName = sub.getSubscriptionKey().getSubscriptionName(); - sub.setCursorMemoryHighWaterMark(getCursorMemoryHighWaterMark()); - configurePrefetch(sub); - if (pendingDurableSubscriberPolicy != null) { - PendingMessageCursor cursor = pendingDurableSubscriberPolicy.getSubscriberPendingMessageCursor(broker,clientId, subName,sub.getPrefetchSize(),sub); - cursor.setSystemUsage(memoryManager); - sub.setPending(cursor); - } - int auditDepth = getMaxAuditDepth(); - if (auditDepth == BaseDestination.MAX_AUDIT_DEPTH && this.isPrioritizedMessages()) { - sub.setMaxAuditDepth(auditDepth * 10); - } else { - sub.setMaxAuditDepth(auditDepth); - } - sub.setMaxProducersToAudit(getMaxProducersToAudit()); - sub.setUsePrefetchExtension(isUsePrefetchExtension()); - } - - public void configure(Broker broker, SystemUsage memoryManager, QueueBrowserSubscription sub) { - configurePrefetch(sub); - sub.setCursorMemoryHighWaterMark(getCursorMemoryHighWaterMark()); - sub.setUsePrefetchExtension(isUsePrefetchExtension()); - - // TODO - // We currently need an infinite audit because of the way that browser dispatch - // is done. We should refactor the browsers to better handle message dispatch so - // we can remove this and perform a more efficient dispatch. - sub.setMaxProducersToAudit(Integer.MAX_VALUE); - sub.setMaxAuditDepth(Short.MAX_VALUE); - } - - public void configure(Broker broker, SystemUsage memoryManager, QueueSubscription sub) { - configurePrefetch(sub); - sub.setCursorMemoryHighWaterMark(getCursorMemoryHighWaterMark()); - sub.setUsePrefetchExtension(isUsePrefetchExtension()); - sub.setMaxProducersToAudit(getMaxProducersToAudit()); - } - - public void configurePrefetch(Subscription subscription) { - - final int currentPrefetch = subscription.getConsumerInfo().getPrefetchSize(); - if (subscription instanceof QueueBrowserSubscription) { - if (currentPrefetch == ActiveMQPrefetchPolicy.DEFAULT_QUEUE_BROWSER_PREFETCH) { - ((QueueBrowserSubscription) subscription).setPrefetchSize(getQueueBrowserPrefetch()); - } - } else if (subscription instanceof QueueSubscription) { - if (currentPrefetch == ActiveMQPrefetchPolicy.DEFAULT_QUEUE_PREFETCH) { - ((QueueSubscription) subscription).setPrefetchSize(getQueuePrefetch()); - } - } else if (subscription instanceof DurableTopicSubscription) { - if (currentPrefetch == ActiveMQPrefetchPolicy.DEFAULT_DURABLE_TOPIC_PREFETCH || - subscription.getConsumerInfo().getPrefetchSize() == ActiveMQPrefetchPolicy.DEFAULT_OPTIMIZE_DURABLE_TOPIC_PREFETCH) { - ((DurableTopicSubscription)subscription).setPrefetchSize(getDurableTopicPrefetch()); - } - } else if (subscription instanceof TopicSubscription) { - if (currentPrefetch == ActiveMQPrefetchPolicy.DEFAULT_TOPIC_PREFETCH) { - ((TopicSubscription) subscription).setPrefetchSize(getTopicPrefetch()); - } - } - if (currentPrefetch != 0 && subscription.getPrefetchSize() == 0) { - // tell the sub so that it can issue a pull request - subscription.updateConsumerPrefetch(0); - } - } - - // Properties - // ------------------------------------------------------------------------- - public DispatchPolicy getDispatchPolicy() { - return dispatchPolicy; - } - - public void setDispatchPolicy(DispatchPolicy policy) { - this.dispatchPolicy = policy; - } - - public SubscriptionRecoveryPolicy getSubscriptionRecoveryPolicy() { - return subscriptionRecoveryPolicy; - } - - public void setSubscriptionRecoveryPolicy(SubscriptionRecoveryPolicy subscriptionRecoveryPolicy) { - this.subscriptionRecoveryPolicy = subscriptionRecoveryPolicy; - } - - public boolean isSendAdvisoryIfNoConsumers() { - return sendAdvisoryIfNoConsumers; - } - - /** - * Sends an advisory message if a non-persistent message is sent and there - * are no active consumers - */ - public void setSendAdvisoryIfNoConsumers(boolean sendAdvisoryIfNoConsumers) { - this.sendAdvisoryIfNoConsumers = sendAdvisoryIfNoConsumers; - } - - public DeadLetterStrategy getDeadLetterStrategy() { - return deadLetterStrategy; - } - - /** - * Sets the policy used to determine which dead letter queue destination - * should be used - */ - public void setDeadLetterStrategy(DeadLetterStrategy deadLetterStrategy) { - this.deadLetterStrategy = deadLetterStrategy; - } - - public PendingMessageLimitStrategy getPendingMessageLimitStrategy() { - return pendingMessageLimitStrategy; - } - - /** - * Sets the strategy to calculate the maximum number of messages that are - * allowed to be pending on consumers (in addition to their prefetch sizes). - * Once the limit is reached, non-durable topics can then start discarding - * old messages. This allows us to keep dispatching messages to slow - * consumers while not blocking fast consumers and discarding the messages - * oldest first. - */ - public void setPendingMessageLimitStrategy(PendingMessageLimitStrategy pendingMessageLimitStrategy) { - this.pendingMessageLimitStrategy = pendingMessageLimitStrategy; - } - - public MessageEvictionStrategy getMessageEvictionStrategy() { - return messageEvictionStrategy; - } - - /** - * Sets the eviction strategy used to decide which message to evict when the - * slow consumer needs to discard messages - */ - public void setMessageEvictionStrategy(MessageEvictionStrategy messageEvictionStrategy) { - this.messageEvictionStrategy = messageEvictionStrategy; - } - - public long getMemoryLimit() { - return memoryLimit; - } - - /** - * When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used - * @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.MemoryPropertyEditor" - */ - public void setMemoryLimit(long memoryLimit) { - this.memoryLimit = memoryLimit; - } - - public MessageGroupMapFactory getMessageGroupMapFactory() { - if (messageGroupMapFactory == null) { - try { - messageGroupMapFactory = GroupFactoryFinder.createMessageGroupMapFactory(getMessageGroupMapFactoryType()); - }catch(Exception e){ - LOG.error("Failed to create message group Factory ",e); - } - } - return messageGroupMapFactory; - } - - /** - * Sets the factory used to create new instances of {MessageGroupMap} used - * to implement the Message Groups - * functionality. - */ - public void setMessageGroupMapFactory(MessageGroupMapFactory messageGroupMapFactory) { - this.messageGroupMapFactory = messageGroupMapFactory; - } - - - public String getMessageGroupMapFactoryType() { - return messageGroupMapFactoryType; - } - - public void setMessageGroupMapFactoryType(String messageGroupMapFactoryType) { - this.messageGroupMapFactoryType = messageGroupMapFactoryType; - } - - - /** - * @return the pendingDurableSubscriberPolicy - */ - public PendingDurableSubscriberMessageStoragePolicy getPendingDurableSubscriberPolicy() { - return this.pendingDurableSubscriberPolicy; - } - - /** - * @param pendingDurableSubscriberPolicy the pendingDurableSubscriberPolicy - * to set - */ - public void setPendingDurableSubscriberPolicy(PendingDurableSubscriberMessageStoragePolicy pendingDurableSubscriberPolicy) { - this.pendingDurableSubscriberPolicy = pendingDurableSubscriberPolicy; - } - - /** - * @return the pendingQueuePolicy - */ - public PendingQueueMessageStoragePolicy getPendingQueuePolicy() { - return this.pendingQueuePolicy; - } - - /** - * @param pendingQueuePolicy the pendingQueuePolicy to set - */ - public void setPendingQueuePolicy(PendingQueueMessageStoragePolicy pendingQueuePolicy) { - this.pendingQueuePolicy = pendingQueuePolicy; - } - - /** - * @return the pendingSubscriberPolicy - */ - public PendingSubscriberMessageStoragePolicy getPendingSubscriberPolicy() { - return this.pendingSubscriberPolicy; - } - - /** - * @param pendingSubscriberPolicy the pendingSubscriberPolicy to set - */ - public void setPendingSubscriberPolicy(PendingSubscriberMessageStoragePolicy pendingSubscriberPolicy) { - this.pendingSubscriberPolicy = pendingSubscriberPolicy; - } - - /** - * @return true if producer flow control enabled - */ - public boolean isProducerFlowControl() { - return producerFlowControl; - } - - /** - * @param producerFlowControl - */ - public void setProducerFlowControl(boolean producerFlowControl) { - this.producerFlowControl = producerFlowControl; - } - - /** - * @return true if topic is always retroactive - */ - public boolean isAlwaysRetroactive() { - return alwaysRetroactive; - } - - /** - * @param alwaysRetroactive - */ - public void setAlwaysRetroactive(boolean alwaysRetroactive) { - this.alwaysRetroactive = alwaysRetroactive; - } - - - /** - * Set's the interval at which warnings about producers being blocked by - * resource usage will be triggered. Values of 0 or less will disable - * warnings - * - * @param blockedProducerWarningInterval the interval at which warning about - * blocked producers will be triggered. - */ - public void setBlockedProducerWarningInterval(long blockedProducerWarningInterval) { - this.blockedProducerWarningInterval = blockedProducerWarningInterval; - } - - /** - * - * @return the interval at which warning about blocked producers will be - * triggered. - */ - public long getBlockedProducerWarningInterval() { - return blockedProducerWarningInterval; - } - - /** - * @return the maxProducersToAudit - */ - public int getMaxProducersToAudit() { - return maxProducersToAudit; - } - - /** - * @param maxProducersToAudit the maxProducersToAudit to set - */ - public void setMaxProducersToAudit(int maxProducersToAudit) { - this.maxProducersToAudit = maxProducersToAudit; - } - - /** - * @return the maxAuditDepth - */ - public int getMaxAuditDepth() { - return maxAuditDepth; - } - - /** - * @param maxAuditDepth the maxAuditDepth to set - */ - public void setMaxAuditDepth(int maxAuditDepth) { - this.maxAuditDepth = maxAuditDepth; - } - - /** - * @return the enableAudit - */ - public boolean isEnableAudit() { - return enableAudit; - } - - /** - * @param enableAudit the enableAudit to set - */ - public void setEnableAudit(boolean enableAudit) { - this.enableAudit = enableAudit; - } - - public int getMaxQueueAuditDepth() { - return maxQueueAuditDepth; - } - - public void setMaxQueueAuditDepth(int maxQueueAuditDepth) { - this.maxQueueAuditDepth = maxQueueAuditDepth; - } - - public boolean isOptimizedDispatch() { - return optimizedDispatch; - } - - public void setOptimizedDispatch(boolean optimizedDispatch) { - this.optimizedDispatch = optimizedDispatch; - } - - public int getMaxPageSize() { - return maxPageSize; - } - - public void setMaxPageSize(int maxPageSize) { - this.maxPageSize = maxPageSize; - } - - public int getMaxBrowsePageSize() { - return maxBrowsePageSize; - } - - public void setMaxBrowsePageSize(int maxPageSize) { - this.maxBrowsePageSize = maxPageSize; - } - - public boolean isUseCache() { - return useCache; - } - - public void setUseCache(boolean useCache) { - this.useCache = useCache; - } - - public long getMinimumMessageSize() { - return minimumMessageSize; - } - - public void setMinimumMessageSize(long minimumMessageSize) { - this.minimumMessageSize = minimumMessageSize; - } - - public boolean isUseConsumerPriority() { - return useConsumerPriority; - } - - public void setUseConsumerPriority(boolean useConsumerPriority) { - this.useConsumerPriority = useConsumerPriority; - } - - public boolean isStrictOrderDispatch() { - return strictOrderDispatch; - } - - public void setStrictOrderDispatch(boolean strictOrderDispatch) { - this.strictOrderDispatch = strictOrderDispatch; - } - - public boolean isLazyDispatch() { - return lazyDispatch; - } - - public void setLazyDispatch(boolean lazyDispatch) { - this.lazyDispatch = lazyDispatch; - } - - public int getTimeBeforeDispatchStarts() { - return timeBeforeDispatchStarts; - } - - public void setTimeBeforeDispatchStarts(int timeBeforeDispatchStarts) { - this.timeBeforeDispatchStarts = timeBeforeDispatchStarts; - } - - public int getConsumersBeforeDispatchStarts() { - return consumersBeforeDispatchStarts; - } - - public void setConsumersBeforeDispatchStarts(int consumersBeforeDispatchStarts) { - this.consumersBeforeDispatchStarts = consumersBeforeDispatchStarts; - } - - /** - * @return the advisoryForSlowConsumers - */ - public boolean isAdvisoryForSlowConsumers() { - return advisoryForSlowConsumers; - } - - /** - * @param advisoryForSlowConsumers the advisoryForSlowConsumers to set - */ - public void setAdvisoryForSlowConsumers(boolean advisoryForSlowConsumers) { - this.advisoryForSlowConsumers = advisoryForSlowConsumers; - } - - /** - * @return the advisoryForDiscardingMessages - */ - public boolean isAdvisoryForDiscardingMessages() { - return advisoryForDiscardingMessages; - } - - /** - * @param advisoryForDiscardingMessages the advisoryForDiscardingMessages to set - */ - public void setAdvisoryForDiscardingMessages( - boolean advisoryForDiscardingMessages) { - this.advisoryForDiscardingMessages = advisoryForDiscardingMessages; - } - - /** - * @return the advisoryWhenFull - */ - public boolean isAdvisoryWhenFull() { - return advisoryWhenFull; - } - - /** - * @param advisoryWhenFull the advisoryWhenFull to set - */ - public void setAdvisoryWhenFull(boolean advisoryWhenFull) { - this.advisoryWhenFull = advisoryWhenFull; - } - - /** - * @return the advisoryForDelivery - */ - public boolean isAdvisoryForDelivery() { - return advisoryForDelivery; - } - - /** - * @param advisoryForDelivery the advisoryForDelivery to set - */ - public void setAdvisoryForDelivery(boolean advisoryForDelivery) { - this.advisoryForDelivery = advisoryForDelivery; - } - - /** - * @return the advisoryForConsumed - */ - public boolean isAdvisoryForConsumed() { - return advisoryForConsumed; - } - - /** - * @param advisoryForConsumed the advisoryForConsumed to set - */ - public void setAdvisoryForConsumed(boolean advisoryForConsumed) { - this.advisoryForConsumed = advisoryForConsumed; - } - - /** - * @return the advisdoryForFastProducers - */ - public boolean isAdvisoryForFastProducers() { - return advisoryForFastProducers; - } - - /** - * @param advisoryForFastProducers the advisdoryForFastProducers to set - */ - public void setAdvisoryForFastProducers(boolean advisoryForFastProducers) { - this.advisoryForFastProducers = advisoryForFastProducers; - } - - public void setMaxExpirePageSize(int maxExpirePageSize) { - this.maxExpirePageSize = maxExpirePageSize; - } - - public int getMaxExpirePageSize() { - return maxExpirePageSize; - } - - public void setExpireMessagesPeriod(long expireMessagesPeriod) { - this.expireMessagesPeriod = expireMessagesPeriod; - } - - public long getExpireMessagesPeriod() { - return expireMessagesPeriod; - } - - /** - * Get the queuePrefetch - * @return the queuePrefetch - */ - public int getQueuePrefetch() { - return this.queuePrefetch; - } - - /** - * Set the queuePrefetch - * @param queuePrefetch the queuePrefetch to set - */ - public void setQueuePrefetch(int queuePrefetch) { - this.queuePrefetch = queuePrefetch; - } - - /** - * Get the queueBrowserPrefetch - * @return the queueBrowserPrefetch - */ - public int getQueueBrowserPrefetch() { - return this.queueBrowserPrefetch; - } - - /** - * Set the queueBrowserPrefetch - * @param queueBrowserPrefetch the queueBrowserPrefetch to set - */ - public void setQueueBrowserPrefetch(int queueBrowserPrefetch) { - this.queueBrowserPrefetch = queueBrowserPrefetch; - } - - /** - * Get the topicPrefetch - * @return the topicPrefetch - */ - public int getTopicPrefetch() { - return this.topicPrefetch; - } - - /** - * Set the topicPrefetch - * @param topicPrefetch the topicPrefetch to set - */ - public void setTopicPrefetch(int topicPrefetch) { - this.topicPrefetch = topicPrefetch; - } - - /** - * Get the durableTopicPrefetch - * @return the durableTopicPrefetch - */ - public int getDurableTopicPrefetch() { - return this.durableTopicPrefetch; - } - - /** - * Set the durableTopicPrefetch - * @param durableTopicPrefetch the durableTopicPrefetch to set - */ - public void setDurableTopicPrefetch(int durableTopicPrefetch) { - this.durableTopicPrefetch = durableTopicPrefetch; - } - - public boolean isUsePrefetchExtension() { - return this.usePrefetchExtension; - } - - public void setUsePrefetchExtension(boolean usePrefetchExtension) { - this.usePrefetchExtension = usePrefetchExtension; - } - - public int getCursorMemoryHighWaterMark() { - return this.cursorMemoryHighWaterMark; - } - - public void setCursorMemoryHighWaterMark(int cursorMemoryHighWaterMark) { - this.cursorMemoryHighWaterMark = cursorMemoryHighWaterMark; - } - - public void setStoreUsageHighWaterMark(int storeUsageHighWaterMark) { - this.storeUsageHighWaterMark = storeUsageHighWaterMark; - } - - public int getStoreUsageHighWaterMark() { - return storeUsageHighWaterMark; - } - - public void setSlowConsumerStrategy(SlowConsumerStrategy slowConsumerStrategy) { - this.slowConsumerStrategy = slowConsumerStrategy; - } - - public SlowConsumerStrategy getSlowConsumerStrategy() { - return this.slowConsumerStrategy; - } - - - public boolean isPrioritizedMessages() { - return this.prioritizedMessages; - } - - public void setPrioritizedMessages(boolean prioritizedMessages) { - this.prioritizedMessages = prioritizedMessages; - } - - public void setAllConsumersExclusiveByDefault(boolean allConsumersExclusiveByDefault) { - this.allConsumersExclusiveByDefault = allConsumersExclusiveByDefault; - } - - public boolean isAllConsumersExclusiveByDefault() { - return allConsumersExclusiveByDefault; - } - - public boolean isGcInactiveDestinations() { - return this.gcInactiveDestinations; - } - - public void setGcInactiveDestinations(boolean gcInactiveDestinations) { - this.gcInactiveDestinations = gcInactiveDestinations; - } - - public long getInactiveTimoutBeforeGC() { - return this.inactiveTimoutBeforeGC; - } - - public void setInactiveTimoutBeforeGC(long inactiveTimoutBeforeGC) { - this.inactiveTimoutBeforeGC = inactiveTimoutBeforeGC; - } - - public void setGcWithNetworkConsumers(boolean gcWithNetworkConsumers) { - this.gcWithNetworkConsumers = gcWithNetworkConsumers; - } - - public boolean isGcWithNetworkConsumers() { - return gcWithNetworkConsumers; - } - - public boolean isReduceMemoryFootprint() { - return reduceMemoryFootprint; - } - - public void setReduceMemoryFootprint(boolean reduceMemoryFootprint) { - this.reduceMemoryFootprint = reduceMemoryFootprint; - } - - public void setNetworkBridgeFilterFactory(NetworkBridgeFilterFactory networkBridgeFilterFactory) { - this.networkBridgeFilterFactory = networkBridgeFilterFactory; - } - - public NetworkBridgeFilterFactory getNetworkBridgeFilterFactory() { - return networkBridgeFilterFactory; - } - - public boolean isDoOptimzeMessageStorage() { - return doOptimzeMessageStorage; - } - - public void setDoOptimzeMessageStorage(boolean doOptimzeMessageStorage) { - this.doOptimzeMessageStorage = doOptimzeMessageStorage; - } - - public int getOptimizeMessageStoreInFlightLimit() { - return optimizeMessageStoreInFlightLimit; - } - - public void setOptimizeMessageStoreInFlightLimit(int optimizeMessageStoreInFlightLimit) { - this.optimizeMessageStoreInFlightLimit = optimizeMessageStoreInFlightLimit; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PolicyMap.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PolicyMap.class deleted file mode 100644 index b1628d06a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PolicyMap.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PolicyMap.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PolicyMap.java deleted file mode 100644 index b901dc1f2..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PolicyMap.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * 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.broker.region.policy; - -import java.util.List; - -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.filter.DestinationMap; -import org.apache.activemq.filter.DestinationMapEntry; - -/** - * Represents a destination based configuration of policies so that individual - * destinations or wildcard hierarchies of destinations can be configured using - * different policies. - * - * @org.apache.xbean.XBean - * - * - */ -public class PolicyMap extends DestinationMap { - - private PolicyEntry defaultEntry; - - public PolicyEntry getEntryFor(ActiveMQDestination destination) { - PolicyEntry answer = (PolicyEntry) chooseValue(destination); - if (answer == null) { - answer = getDefaultEntry(); - } - return answer; - } - - /** - * Sets the individual entries on the policy map - * - * @org.apache.xbean.ElementType class="org.apache.activemq.broker.region.policy.PolicyEntry" - */ - public void setPolicyEntries(List entries) { - super.setEntries(entries); - } - - public PolicyEntry getDefaultEntry() { - return defaultEntry; - } - - public void setDefaultEntry(PolicyEntry defaultEntry) { - this.defaultEntry = defaultEntry; - } - - protected Class getEntryClass() { - return PolicyEntry.class; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PrefetchRatePendingMessageLimitStrategy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PrefetchRatePendingMessageLimitStrategy.class deleted file mode 100644 index 3cf3b480e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PrefetchRatePendingMessageLimitStrategy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PrefetchRatePendingMessageLimitStrategy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PrefetchRatePendingMessageLimitStrategy.java deleted file mode 100644 index 22e329580..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PrefetchRatePendingMessageLimitStrategy.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * 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.broker.region.policy; - -import org.apache.activemq.broker.region.TopicSubscription; - -/** - * This PendingMessageLimitStrategy sets the maximum pending message limit value to be - * a multiplier of the prefetch limit of the subscription. - * - * @org.apache.xbean.XBean - * - * - */ -public class PrefetchRatePendingMessageLimitStrategy implements PendingMessageLimitStrategy { - - private double multiplier = 0.5; - - public int getMaximumPendingMessageLimit(TopicSubscription subscription) { - int prefetchSize = subscription.getConsumerInfo().getPrefetchSize(); - return (int) (prefetchSize * multiplier); - } - - public double getMultiplier() { - return multiplier; - } - - /** - * Sets the multiplier of the prefetch size which will be used to define the maximum number of pending - * messages for non-durable topics before messages are discarded. - */ - public void setMultiplier(double rate) { - this.multiplier = rate; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PriorityDispatchPolicy$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PriorityDispatchPolicy$1.class deleted file mode 100644 index b0bef4ec9..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PriorityDispatchPolicy$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PriorityDispatchPolicy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PriorityDispatchPolicy.class deleted file mode 100644 index c2951846a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PriorityDispatchPolicy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PriorityDispatchPolicy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PriorityDispatchPolicy.java deleted file mode 100644 index 63511211b..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PriorityDispatchPolicy.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * 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.broker.region.policy; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.filter.MessageEvaluationContext; - -/** - * Priority dispatch policy that sends a message to every subscription that - * matches the message in consumer priority order. - * - * @org.apache.xbean.XBean - * - */ -public class PriorityDispatchPolicy extends SimpleDispatchPolicy { - - private final Comparator orderedCompare = new Comparator() { - @Override - public int compare(Subscription o1, Subscription o2) { - // We want the list sorted in descending order - return o2.getConsumerInfo().getPriority() - o1.getConsumerInfo().getPriority(); - } - }; - - public boolean dispatch(MessageReference node, MessageEvaluationContext msgContext, List consumers) - throws Exception { - ArrayList ordered = new ArrayList(consumers); - Collections.sort(ordered, orderedCompare); - - StringBuffer stringBuffer = new StringBuffer(); - for (Subscription sub: ordered) { - stringBuffer.append(sub.getConsumerInfo().getPriority()); - stringBuffer.append(','); - } - //System.err.println("Priority:" + stringBuffer.toString() + ", msg: " + node.getMessage()); - return super.dispatch(node, msgContext, ordered); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PriorityNetworkDispatchPolicy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PriorityNetworkDispatchPolicy.class deleted file mode 100644 index 8cbdc901a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PriorityNetworkDispatchPolicy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PriorityNetworkDispatchPolicy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PriorityNetworkDispatchPolicy.java deleted file mode 100644 index a71825c3f..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/PriorityNetworkDispatchPolicy.java +++ /dev/null @@ -1,99 +0,0 @@ -/** - * 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.broker.region.policy; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.command.ConsumerId; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.filter.MessageEvaluationContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * dispatch policy that ignores lower priority duplicate network consumers, - * used in conjunction with network bridge suppresDuplicateTopicSubscriptions - * - * @org.apache.xbean.XBean - */ -public class PriorityNetworkDispatchPolicy extends SimpleDispatchPolicy { - - private static final Logger LOG = LoggerFactory.getLogger(PriorityNetworkDispatchPolicy.class); - @Override - public boolean dispatch(MessageReference node, - MessageEvaluationContext msgContext, - List consumers) throws Exception { - - List duplicateFreeSubs = new ArrayList(); - synchronized (consumers) { - for (Subscription sub: consumers) { - ConsumerInfo info = sub.getConsumerInfo(); - if (info.isNetworkSubscription()) { - boolean highestPrioritySub = true; - for (Iterator it = duplicateFreeSubs.iterator(); it.hasNext(); ) { - Subscription candidate = it.next(); - if (matches(candidate, info)) { - if (hasLowerPriority(candidate, info)) { - it.remove(); - } else { - // higher priority matching sub exists - highestPrioritySub = false; - LOG.debug("ignoring lower priority: {} [{}, {}] in favour of: {} [{}, {}]", - new Object[]{ candidate, - candidate.getConsumerInfo().getNetworkConsumerIds(), - candidate.getConsumerInfo().getNetworkConsumerIds(), - sub, - sub.getConsumerInfo().getNetworkConsumerIds(), - sub.getConsumerInfo().getNetworkConsumerIds() }); - } - } - } - if (highestPrioritySub) { - duplicateFreeSubs.add(sub); - } - } else { - duplicateFreeSubs.add(sub); - } - } - } - - return super.dispatch(node, msgContext, duplicateFreeSubs); - } - - private boolean hasLowerPriority(Subscription candidate, - ConsumerInfo info) { - return candidate.getConsumerInfo().getPriority() < info.getPriority(); - } - - private boolean matches(Subscription candidate, ConsumerInfo info) { - boolean matched = false; - for (ConsumerId candidateId: candidate.getConsumerInfo().getNetworkConsumerIds()) { - for (ConsumerId subId: info.getNetworkConsumerIds()) { - if (candidateId.equals(subId)) { - matched = true; - break; - } - } - } - return matched; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/QueryBasedSubscriptionRecoveryPolicy$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/QueryBasedSubscriptionRecoveryPolicy$1.class deleted file mode 100644 index 7471041fe..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/QueryBasedSubscriptionRecoveryPolicy$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/QueryBasedSubscriptionRecoveryPolicy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/QueryBasedSubscriptionRecoveryPolicy.class deleted file mode 100644 index e47b0ef2c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/QueryBasedSubscriptionRecoveryPolicy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/QueryBasedSubscriptionRecoveryPolicy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/QueryBasedSubscriptionRecoveryPolicy.java deleted file mode 100644 index 43c344f1c..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/QueryBasedSubscriptionRecoveryPolicy.java +++ /dev/null @@ -1,134 +0,0 @@ -/** - * 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.broker.region.policy; - -import java.util.concurrent.atomic.AtomicLong; -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.MessageListener; -import org.apache.activemq.ActiveMQMessageTransformation; -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.broker.region.SubscriptionRecovery; -import org.apache.activemq.broker.region.Topic; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ActiveMQMessage; -import org.apache.activemq.command.ConnectionId; -import org.apache.activemq.command.MessageId; -import org.apache.activemq.command.ProducerId; -import org.apache.activemq.command.SessionId; -import org.apache.activemq.util.IdGenerator; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * This implementation of {@link SubscriptionRecoveryPolicy} will perform a user - * specific query mechanism to load any messages they may have missed. - * - * @org.apache.xbean.XBean - * - */ -public class QueryBasedSubscriptionRecoveryPolicy implements SubscriptionRecoveryPolicy { - - private static final Logger LOG = LoggerFactory.getLogger(QueryBasedSubscriptionRecoveryPolicy.class); - - private MessageQuery query; - private final AtomicLong messageSequence = new AtomicLong(0); - private final IdGenerator idGenerator = new IdGenerator(); - private final ProducerId producerId = createProducerId(); - - public SubscriptionRecoveryPolicy copy() { - QueryBasedSubscriptionRecoveryPolicy rc = new QueryBasedSubscriptionRecoveryPolicy(); - rc.setQuery(query); - return rc; - } - - public boolean add(ConnectionContext context, MessageReference message) throws Exception { - return query.validateUpdate(message.getMessage()); - } - - public void recover(final ConnectionContext context, final Topic topic, final SubscriptionRecovery sub) throws Exception { - if (query != null) { - ActiveMQDestination destination = sub.getActiveMQDestination(); - query.execute(destination, new MessageListener() { - - public void onMessage(Message message) { - dispatchInitialMessage(message, topic, context, sub); - } - }); - } - } - - public void start() throws Exception { - if (query == null) { - throw new IllegalArgumentException("No query property configured"); - } - } - - public void stop() throws Exception { - } - - public MessageQuery getQuery() { - return query; - } - - /** - * Sets the query strategy to load initial messages - */ - public void setQuery(MessageQuery query) { - this.query = query; - } - - public org.apache.activemq.command.Message[] browse(ActiveMQDestination dest) throws Exception { - return new org.apache.activemq.command.Message[0]; - } - - public void setBroker(Broker broker) { - } - - protected void dispatchInitialMessage(Message message, Destination regionDestination, ConnectionContext context, SubscriptionRecovery sub) { - try { - ActiveMQMessage activeMessage = ActiveMQMessageTransformation.transformMessage(message, null); - ActiveMQDestination destination = activeMessage.getDestination(); - if (destination == null) { - destination = sub.getActiveMQDestination(); - activeMessage.setDestination(destination); - } - activeMessage.setRegionDestination(regionDestination); - configure(activeMessage); - sub.addRecoveredMessage(context, activeMessage); - } catch (Throwable e) { - LOG.warn("Failed to dispatch initial message: {} into subscription. Reason: ", message, e); - } - } - - protected void configure(ActiveMQMessage msg) throws JMSException { - long sequenceNumber = messageSequence.incrementAndGet(); - msg.setMessageId(new MessageId(producerId, sequenceNumber)); - msg.onSend(); - msg.setProducerId(producerId); - } - - protected ProducerId createProducerId() { - String id = idGenerator.generateId(); - ConnectionId connectionId = new ConnectionId(id); - SessionId sessionId = new SessionId(connectionId, 1); - return new ProducerId(sessionId, 1); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/RedeliveryPolicyMap.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/RedeliveryPolicyMap.class deleted file mode 100644 index 7ff2eaf18..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/RedeliveryPolicyMap.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/RedeliveryPolicyMap.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/RedeliveryPolicyMap.java deleted file mode 100644 index 098c317cf..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/RedeliveryPolicyMap.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * 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.broker.region.policy; - -import java.util.List; -import org.apache.activemq.RedeliveryPolicy; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.filter.DestinationMap; -import org.apache.activemq.filter.DestinationMapEntry; - -/** - * Represents a destination based configuration of policies so that individual - * destinations or wildcard hierarchies of destinations can be configured using - * different policies. - * - * @org.apache.xbean.XBean - * - * - */ -public class RedeliveryPolicyMap extends DestinationMap { - - private RedeliveryPolicy defaultEntry; - - public RedeliveryPolicy getEntryFor(ActiveMQDestination destination) { - RedeliveryPolicy answer = (RedeliveryPolicy) chooseValue(destination); - if (answer == null) { - answer = getDefaultEntry(); - } - return answer; - } - - /** - * Sets the individual entries on the redeliveryPolicyMap - * - * @org.apache.xbean.ElementType class="org.apache.activemq.RedeliveryPolicy" - */ - public void setRedeliveryPolicyEntries(List entries) { - super.setEntries(entries); - } - - public RedeliveryPolicy getDefaultEntry() { - return defaultEntry; - } - - public void setDefaultEntry(RedeliveryPolicy defaultEntry) { - this.defaultEntry = defaultEntry; - } - - protected Class getEntryClass() { - return RedeliveryPolicy.class; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/RoundRobinDispatchPolicy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/RoundRobinDispatchPolicy.class deleted file mode 100644 index 1c1b7a10a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/RoundRobinDispatchPolicy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/RoundRobinDispatchPolicy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/RoundRobinDispatchPolicy.java deleted file mode 100644 index 95a45342f..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/RoundRobinDispatchPolicy.java +++ /dev/null @@ -1,79 +0,0 @@ -/** - * 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.broker.region.policy; - -import java.util.Iterator; -import java.util.List; -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.filter.MessageEvaluationContext; - -/** - * Simple dispatch policy that sends a message to every subscription that - * matches the message. - * - * @org.apache.xbean.XBean - * - */ -public class RoundRobinDispatchPolicy implements DispatchPolicy { - - /** - * @param node - * @param msgContext - * @param consumers - * @return true if dispatched - * @throws Exception - * @see org.apache.activemq.broker.region.policy.DispatchPolicy#dispatch(org.apache.activemq.broker.region.MessageReference, - * org.apache.activemq.filter.MessageEvaluationContext, java.util.List) - */ - public boolean dispatch(MessageReference node, - MessageEvaluationContext msgContext, List consumers) - throws Exception { - int count = 0; - - Subscription firstMatchingConsumer = null; - synchronized (consumers) { - for (Iterator iter = consumers.iterator(); iter - .hasNext();) { - Subscription sub = iter.next(); - - // Only dispatch to interested subscriptions - if (!sub.matches(node, msgContext)) { - sub.unmatched(node); - continue; - } - - if (firstMatchingConsumer == null) { - firstMatchingConsumer = sub; - } - - sub.add(node); - count++; - } - - if (firstMatchingConsumer != null) { - // Rotate the consumer list. - try { - consumers.remove(firstMatchingConsumer); - consumers.add(firstMatchingConsumer); - } catch (Throwable bestEffort) { - } - } - } - return count > 0; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/SharedDeadLetterStrategy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/SharedDeadLetterStrategy.class deleted file mode 100644 index c6d0e5b8a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/SharedDeadLetterStrategy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/SharedDeadLetterStrategy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/SharedDeadLetterStrategy.java deleted file mode 100644 index 42b35ce7b..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/SharedDeadLetterStrategy.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * 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.broker.region.policy; - -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ActiveMQQueue; -import org.apache.activemq.command.Message; - -/** - * A default implementation of {@link DeadLetterStrategy} which uses - * a constant destination. - * - * - * @org.apache.xbean.XBean - * - * - */ -public class SharedDeadLetterStrategy extends AbstractDeadLetterStrategy { - - public static final String DEFAULT_DEAD_LETTER_QUEUE_NAME = "ActiveMQ.DLQ"; - - private ActiveMQDestination deadLetterQueue = new ActiveMQQueue(DEFAULT_DEAD_LETTER_QUEUE_NAME); - - public ActiveMQDestination getDeadLetterQueueFor(Message message, Subscription subscription) { - return deadLetterQueue; - } - - public ActiveMQDestination getDeadLetterQueue() { - return deadLetterQueue; - } - - public void setDeadLetterQueue(ActiveMQDestination deadLetterQueue) { - this.deadLetterQueue = deadLetterQueue; - } - - @Override - public boolean isDLQ(ActiveMQDestination destination) { - if (destination.equals(deadLetterQueue)) { - return true; - } else { - return false; - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/SimpleDispatchPolicy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/SimpleDispatchPolicy.class deleted file mode 100644 index 066aa814a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/SimpleDispatchPolicy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/SimpleDispatchPolicy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/SimpleDispatchPolicy.java deleted file mode 100644 index 7d8e2f073..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/SimpleDispatchPolicy.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * 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.broker.region.policy; - -import java.util.List; -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.filter.MessageEvaluationContext; - -/** - * Simple dispatch policy that sends a message to every subscription that - * matches the message. - * - * @org.apache.xbean.XBean - * - */ -public class SimpleDispatchPolicy implements DispatchPolicy { - - public boolean dispatch(MessageReference node, MessageEvaluationContext msgContext, List consumers) - throws Exception { - - int count = 0; - for (Subscription sub : consumers) { - // Don't deliver to browsers - if (sub.getConsumerInfo().isBrowser()) { - continue; - } - // Only dispatch to interested subscriptions - if (!sub.matches(node, msgContext)) { - sub.unmatched(node); - continue; - } - - sub.add(node); - count++; - } - - return count > 0; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/SimpleDispatchSelector.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/SimpleDispatchSelector.class deleted file mode 100644 index 42e7323fb..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/SimpleDispatchSelector.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/SimpleDispatchSelector.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/SimpleDispatchSelector.java deleted file mode 100644 index 4a488c334..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/SimpleDispatchSelector.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * 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.broker.region.policy; - -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.filter.MessageEvaluationContext; -import org.apache.activemq.filter.NonCachedMessageEvaluationContext; - -/** - * Simple dispatch policy that determines if a message can be sent to a subscription - * - * @org.apache.xbean.XBean - * - */ -public class SimpleDispatchSelector implements DispatchSelector { - - private final ActiveMQDestination destination; - - /** - * @param destination - */ - public SimpleDispatchSelector(ActiveMQDestination destination) { - this.destination = destination; - } - - public boolean canDispatch(Subscription subscription, MessageReference node) throws Exception { - MessageEvaluationContext msgContext = new NonCachedMessageEvaluationContext(); - msgContext.setDestination(this.destination); - msgContext.setMessageReference(node); - return subscription.matches(node, msgContext); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/SlowConsumerEntry.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/SlowConsumerEntry.class deleted file mode 100644 index 6993e74c8..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/SlowConsumerEntry.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/SlowConsumerEntry.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/SlowConsumerEntry.java deleted file mode 100644 index 9d2550960..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/SlowConsumerEntry.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * 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.broker.region.policy; - -import org.apache.activemq.broker.ConnectionContext; - -public class SlowConsumerEntry { - - final ConnectionContext context; - Object subscription; - int slowCount = 1; - int markCount = 0; - - SlowConsumerEntry(ConnectionContext context) { - this.context = context; - } - - public void slow() { - slowCount++; - } - - public void mark() { - markCount++; - } - - public void setSubscription(Object subscriptionObjectName) { - this.subscription = subscriptionObjectName; - } - - public Object getSubscription() { - return subscription; - } - - public int getSlowCount() { - return slowCount; - } - - public int getMarkCount() { - return markCount; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/SlowConsumerStrategy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/SlowConsumerStrategy.class deleted file mode 100644 index 919289260..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/SlowConsumerStrategy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/SlowConsumerStrategy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/SlowConsumerStrategy.java deleted file mode 100644 index 7b8ca4cc5..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/SlowConsumerStrategy.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * 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.broker.region.policy; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.Subscription; - -/** - * Interface for a strategy for dealing with slow consumers - */ -public interface SlowConsumerStrategy { - - /** - * Slow consumer event. - * - * @param context - * Connection context of the subscription. - * @param subs - * The subscription object for the slow consumer. - */ - void slowConsumer(ConnectionContext context, Subscription subs); - - /** - * Sets the Broker instance which can provide a Scheduler among other things. - * - * @param broker - * The running Broker. - */ - void setBrokerService(Broker broker); - - /** - * For Strategies that need to examine assigned destination for slow consumers - * periodically the destination is assigned here. - * - * If the strategy doesn't is event driven it can just ignore assigned destination. - * - * @param destination - * A destination to add to a watch list. - */ - void addDestination(Destination destination); - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/StorePendingDurableSubscriberMessageStoragePolicy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/StorePendingDurableSubscriberMessageStoragePolicy.class deleted file mode 100644 index e096170c7..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/StorePendingDurableSubscriberMessageStoragePolicy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/StorePendingDurableSubscriberMessageStoragePolicy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/StorePendingDurableSubscriberMessageStoragePolicy.java deleted file mode 100644 index 726e29629..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/StorePendingDurableSubscriberMessageStoragePolicy.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * 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.broker.region.policy; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.region.DurableTopicSubscription; -import org.apache.activemq.broker.region.cursors.PendingMessageCursor; -import org.apache.activemq.broker.region.cursors.StoreDurableSubscriberCursor; - -/** - * Creates a PendingMessageCursor that access the persistent store to retrieve - * messages - * - * @org.apache.xbean.XBean element="storeDurableSubscriberCursor" - * description="Pending messages for a durable - * subscriber are referenced from the Store" - * - */ -public class StorePendingDurableSubscriberMessageStoragePolicy implements PendingDurableSubscriberMessageStoragePolicy { - boolean immediatePriorityDispatch = true; - boolean useCache = true; - - public boolean isImmediatePriorityDispatch() { - return immediatePriorityDispatch; - } - - /** - * Ensure that new higher priority messages will get an immediate dispatch - * rather than wait for the end of the current cursor batch. - * Useful when there is a large message backlog and intermittent high priority messages. - * - * @param immediatePriorityDispatch - */ - public void setImmediatePriorityDispatch(boolean immediatePriorityDispatch) { - this.immediatePriorityDispatch = immediatePriorityDispatch; - } - - public boolean isUseCache() { - return useCache; - } - - public void setUseCache(boolean useCache) { - this.useCache = useCache; - } - - /** - * Retrieve the configured pending message storage cursor; - * @param broker - * - * @param clientId - * @param name - * @param maxBatchSize - * @param sub - * @return the Pending Message cursor - */ - public PendingMessageCursor getSubscriberPendingMessageCursor(Broker broker,String clientId, String name, int maxBatchSize, DurableTopicSubscription sub) { - StoreDurableSubscriberCursor cursor = new StoreDurableSubscriberCursor(broker,clientId, name, maxBatchSize, sub); - cursor.setUseCache(isUseCache()); - cursor.setImmediatePriorityDispatch(isImmediatePriorityDispatch()); - return cursor; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/StorePendingQueueMessageStoragePolicy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/StorePendingQueueMessageStoragePolicy.class deleted file mode 100644 index bc5110b7d..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/StorePendingQueueMessageStoragePolicy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/StorePendingQueueMessageStoragePolicy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/StorePendingQueueMessageStoragePolicy.java deleted file mode 100644 index 0570ae1c1..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/StorePendingQueueMessageStoragePolicy.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * 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.broker.region.policy; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.region.Queue; -import org.apache.activemq.broker.region.cursors.PendingMessageCursor; -import org.apache.activemq.broker.region.cursors.StoreQueueCursor; - -/** - * Creates a StoreQueueCursor * - * - * @org.apache.xbean.XBean element="storeCursor" description="Pending messages - * paged in from the Store" - * - * - */ -public class StorePendingQueueMessageStoragePolicy implements PendingQueueMessageStoragePolicy { - - /** - * @param broker - * @param queue - * @return the cursor - * @see org.apache.activemq.broker.region.policy.PendingQueueMessageStoragePolicy#getQueuePendingMessageCursor(org.apache.openjpa.lib.util.concurrent.Queue, - * org.apache.activemq.kaha.Store) - */ - public PendingMessageCursor getQueuePendingMessageCursor(Broker broker,Queue queue) { - return new StoreQueueCursor(broker,queue); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/StrictOrderDispatchPolicy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/StrictOrderDispatchPolicy.class deleted file mode 100644 index ca3f4465a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/StrictOrderDispatchPolicy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/StrictOrderDispatchPolicy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/StrictOrderDispatchPolicy.java deleted file mode 100644 index f974ce19f..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/StrictOrderDispatchPolicy.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * 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.broker.region.policy; - -import java.util.Iterator; -import java.util.List; -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.filter.MessageEvaluationContext; - -/** - * Dispatch policy that causes every subscription to see messages in the same - * order. - * - * @org.apache.xbean.XBean - * - */ -public class StrictOrderDispatchPolicy implements DispatchPolicy { - - /** - * @param node - * @param msgContext - * @param consumers - * @return true if dispatched - * @throws Exception - * @see org.apache.activemq.broker.region.policy.DispatchPolicy#dispatch(org.apache.activemq.broker.region.MessageReference, - * org.apache.activemq.filter.MessageEvaluationContext, java.util.List) - */ - public boolean dispatch(MessageReference node, MessageEvaluationContext msgContext, List consumers) throws Exception { - // Big synch here so that only 1 message gets dispatched at a time. - // Ensures - // Everyone sees the same order. - synchronized (consumers) { - int count = 0; - for (Iterator iter = consumers.iterator(); iter.hasNext();) { - Subscription sub = (Subscription)iter.next(); - - // Only dispatch to interested subscriptions - if (!sub.matches(node, msgContext)) { - sub.unmatched(node); - continue; - } - - sub.add(node); - count++; - } - return count > 0; - } - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/SubscriptionRecoveryPolicy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/SubscriptionRecoveryPolicy.class deleted file mode 100644 index cd243e114..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/SubscriptionRecoveryPolicy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/SubscriptionRecoveryPolicy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/SubscriptionRecoveryPolicy.java deleted file mode 100644 index d571952d2..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/SubscriptionRecoveryPolicy.java +++ /dev/null @@ -1,73 +0,0 @@ -/** - * 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.broker.region.policy; - - -import org.apache.activemq.Service; -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.broker.region.SubscriptionRecovery; -import org.apache.activemq.broker.region.Topic; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.Message; - -/** - * Abstraction to allow different recovery policies to be plugged - * into the region implementations. This is used by a topic to retroactively recover - * messages that the subscription missed. - * - * - */ -public interface SubscriptionRecoveryPolicy extends Service { - - /** - * A message was sent to the destination. - * - * @param context - * @param message - * @return true if successful - * @throws Exception - */ - boolean add(ConnectionContext context, MessageReference message) throws Exception; - - /** - * Let a subscription recover message held by the policy. - * - * @param context - * @param topic - * @param sub - * @throws Exception - */ - void recover(ConnectionContext context, Topic topic, SubscriptionRecovery sub) throws Exception; - - - /** - * @param dest - * @return messages - * @throws Exception - */ - Message[] browse(ActiveMQDestination dest) throws Exception; - - /** - * Used to copy the policy object. - * @return the copy - */ - SubscriptionRecoveryPolicy copy(); - - void setBroker(Broker broker); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/TimedSubscriptionRecoveryPolicy$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/TimedSubscriptionRecoveryPolicy$1.class deleted file mode 100644 index 6d977696c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/TimedSubscriptionRecoveryPolicy$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/TimedSubscriptionRecoveryPolicy$TimestampWrapper.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/TimedSubscriptionRecoveryPolicy$TimestampWrapper.class deleted file mode 100644 index 20505ff64..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/TimedSubscriptionRecoveryPolicy$TimestampWrapper.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/TimedSubscriptionRecoveryPolicy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/TimedSubscriptionRecoveryPolicy.class deleted file mode 100644 index 69afd7c8a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/TimedSubscriptionRecoveryPolicy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/TimedSubscriptionRecoveryPolicy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/TimedSubscriptionRecoveryPolicy.java deleted file mode 100644 index 5985cc5fb..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/TimedSubscriptionRecoveryPolicy.java +++ /dev/null @@ -1,142 +0,0 @@ -/** - * 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.broker.region.policy; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.broker.region.SubscriptionRecovery; -import org.apache.activemq.broker.region.Topic; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.Message; -import org.apache.activemq.filter.DestinationFilter; -import org.apache.activemq.thread.Scheduler; - -/** - * This implementation of {@link SubscriptionRecoveryPolicy} will keep a timed - * buffer of messages around in memory and use that to recover new - * subscriptions. - * - * @org.apache.xbean.XBean - * - */ -public class TimedSubscriptionRecoveryPolicy implements SubscriptionRecoveryPolicy { - - private static final int GC_INTERVAL = 1000; - private Scheduler scheduler; - - // TODO: need to get a better synchronized linked list that has little - // contention between enqueuing and dequeuing - private final List buffer = Collections.synchronizedList(new LinkedList()); - private volatile long lastGCRun = System.currentTimeMillis(); - - private long recoverDuration = 60 * 1000; // Buffer for 1 min. - - static class TimestampWrapper { - public MessageReference message; - public long timestamp; - - public TimestampWrapper(MessageReference message, long timestamp) { - this.message = message; - this.timestamp = timestamp; - } - } - - private final Runnable gcTask = new Runnable() { - public void run() { - gc(); - } - }; - - public SubscriptionRecoveryPolicy copy() { - TimedSubscriptionRecoveryPolicy rc = new TimedSubscriptionRecoveryPolicy(); - rc.setRecoverDuration(recoverDuration); - return rc; - } - - public boolean add(ConnectionContext context, MessageReference message) throws Exception { - buffer.add(new TimestampWrapper(message, lastGCRun)); - return true; - } - - public void recover(ConnectionContext context, Topic topic, SubscriptionRecovery sub) throws Exception { - // Re-dispatch the messages from the buffer. - ArrayList copy = new ArrayList(buffer); - if (!copy.isEmpty()) { - for (Iterator iter = copy.iterator(); iter.hasNext();) { - TimestampWrapper timestampWrapper = iter.next(); - MessageReference message = timestampWrapper.message; - sub.addRecoveredMessage(context, message); - } - } - } - - public void setBroker(Broker broker) { - this.scheduler = broker.getScheduler(); - } - - public void start() throws Exception { - scheduler.executePeriodically(gcTask, GC_INTERVAL); - } - - public void stop() throws Exception { - scheduler.cancel(gcTask); - } - - - public void gc() { - lastGCRun = System.currentTimeMillis(); - while (buffer.size() > 0) { - TimestampWrapper timestampWrapper = buffer.get(0); - if (lastGCRun > timestampWrapper.timestamp + recoverDuration) { - // GC it. - buffer.remove(0); - } else { - break; - } - } - } - - public long getRecoverDuration() { - return recoverDuration; - } - - public void setRecoverDuration(long recoverDuration) { - this.recoverDuration = recoverDuration; - } - - public Message[] browse(ActiveMQDestination destination) throws Exception { - List result = new ArrayList(); - ArrayList copy = new ArrayList(buffer); - DestinationFilter filter = DestinationFilter.parseFilter(destination); - for (Iterator iter = copy.iterator(); iter.hasNext();) { - TimestampWrapper timestampWrapper = iter.next(); - MessageReference ref = timestampWrapper.message; - Message message = ref.getMessage(); - if (filter.matches(message.getDestination())) { - result.add(message); - } - } - return result.toArray(new Message[result.size()]); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/UniquePropertyMessageEvictionStrategy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/UniquePropertyMessageEvictionStrategy.class deleted file mode 100644 index 5441ccc9e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/UniquePropertyMessageEvictionStrategy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/UniquePropertyMessageEvictionStrategy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/UniquePropertyMessageEvictionStrategy.java deleted file mode 100644 index 39d54d3aa..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/UniquePropertyMessageEvictionStrategy.java +++ /dev/null @@ -1,79 +0,0 @@ -/** - * 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.broker.region.policy; - -import org.apache.activemq.broker.region.MessageReference; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedList; - - -/** - * An eviction strategy which evicts the oldest message within messages with the same property value - * - * - * @org.apache.xbean.XBean - * - */ -public class UniquePropertyMessageEvictionStrategy extends MessageEvictionStrategySupport { - - protected String propertyName; - - public String getPropertyName() { - return propertyName; - } - - public void setPropertyName(String propertyName) { - this.propertyName = propertyName; - } - - @Override - public MessageReference[] evictMessages(LinkedList messages) throws IOException { - MessageReference oldest = (MessageReference)messages.getFirst(); - HashMap pivots = new HashMap(); - Iterator iter = messages.iterator(); - - for (int i = 0; iter.hasNext(); i++) { - MessageReference reference = (MessageReference) iter.next(); - if (propertyName != null && reference.getMessage().getProperty(propertyName) != null) { - Object key = reference.getMessage().getProperty(propertyName); - if (pivots.containsKey(key)) { - MessageReference pivot = pivots.get(key); - if (reference.getMessage().getTimestamp() > pivot.getMessage().getTimestamp()) { - pivots.put(key, reference); - } - } else { - pivots.put(key, reference); - } - } - } - - if (!pivots.isEmpty()) { - for (MessageReference ref : pivots.values()) { - messages.remove(ref); - } - - if (messages.size() != 0) { - return (MessageReference[])messages.toArray(new MessageReference[messages.size()]); - } - } - return new MessageReference[] {oldest}; - - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/VMPendingDurableSubscriberMessageStoragePolicy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/VMPendingDurableSubscriberMessageStoragePolicy.class deleted file mode 100644 index fb1500aac..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/VMPendingDurableSubscriberMessageStoragePolicy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/VMPendingDurableSubscriberMessageStoragePolicy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/VMPendingDurableSubscriberMessageStoragePolicy.java deleted file mode 100644 index 327257ad7..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/VMPendingDurableSubscriberMessageStoragePolicy.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * 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.broker.region.policy; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.region.DurableTopicSubscription; -import org.apache.activemq.broker.region.cursors.AbstractPendingMessageCursor; -import org.apache.activemq.broker.region.cursors.PendingMessageCursor; -import org.apache.activemq.broker.region.cursors.VMPendingMessageCursor; - -/** - * Creates a VMPendingMessageCursor * - * - * @org.apache.xbean.XBean element="vmDurableCursor" description="Pending - * messages held in the JVM" - * - */ -public class VMPendingDurableSubscriberMessageStoragePolicy implements PendingDurableSubscriberMessageStoragePolicy { - - /** - * Retrieve the configured pending message storage cursor; - * @param broker - * @param clientId - * @param name - * @param maxBatchSize - * @param sub - * @return the Pending Message cursor - */ - public PendingMessageCursor getSubscriberPendingMessageCursor(Broker broker,String clientId, String name,int maxBatchSize, DurableTopicSubscription sub) { - return new VMPendingMessageCursor(AbstractPendingMessageCursor.isPrioritizedMessageSubscriber(broker, sub)); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/VMPendingQueueMessageStoragePolicy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/VMPendingQueueMessageStoragePolicy.class deleted file mode 100644 index 26e93206a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/VMPendingQueueMessageStoragePolicy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/VMPendingQueueMessageStoragePolicy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/VMPendingQueueMessageStoragePolicy.java deleted file mode 100644 index 9e2d66120..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/VMPendingQueueMessageStoragePolicy.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * 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.broker.region.policy; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.region.Queue; -import org.apache.activemq.broker.region.cursors.PendingMessageCursor; -import org.apache.activemq.broker.region.cursors.VMPendingMessageCursor; - -/** - * Creates a VMPendingMessageCursor * - * - * @org.apache.xbean.XBean element="vmQueueCursor" description="Pending messages - * held in the JVM" - * - * - */ -public class VMPendingQueueMessageStoragePolicy implements PendingQueueMessageStoragePolicy { - - /** - * @param broker - * @param queue - * @return the cursor - */ - public PendingMessageCursor getQueuePendingMessageCursor(Broker broker,Queue queue) { - return new VMPendingMessageCursor(queue.isPrioritizedMessages()); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/VMPendingSubscriberMessageStoragePolicy.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/VMPendingSubscriberMessageStoragePolicy.class deleted file mode 100644 index 0de8b8868..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/VMPendingSubscriberMessageStoragePolicy.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/VMPendingSubscriberMessageStoragePolicy.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/VMPendingSubscriberMessageStoragePolicy.java deleted file mode 100644 index 65d181359..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/VMPendingSubscriberMessageStoragePolicy.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * 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.broker.region.policy; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.broker.region.cursors.AbstractPendingMessageCursor; -import org.apache.activemq.broker.region.cursors.PendingMessageCursor; -import org.apache.activemq.broker.region.cursors.VMPendingMessageCursor; - -/** - * Creates a VMPendingMessageCursor * - * - * @org.apache.xbean.XBean element="vmCursor" description="Pending messages held - * in the JVM" - * - * - */ -public class VMPendingSubscriberMessageStoragePolicy implements PendingSubscriberMessageStoragePolicy { - - /** - * @param broker - * @param name - * @param maxBatchSize - * @return a Cursor - * @see org.apache.activemq.broker.region.policy.PendingSubscriberMessageStoragePolicy#getSubscriberPendingMessageCursor(java.lang.String, - * org.apache.activemq.kaha.Store, int) - */ - public PendingMessageCursor getSubscriberPendingMessageCursor(Broker broker,String name,int maxBatchSize,Subscription subs) { - return new VMPendingMessageCursor(AbstractPendingMessageCursor.isPrioritizedMessageSubscriber(broker, subs)); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/package.html b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/package.html deleted file mode 100644 index c77c4ed8c..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/policy/package.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - -The policies which can be associated with a particular destination or wildcard. - - - diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/CompositeDestination.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/CompositeDestination.class deleted file mode 100644 index 5684630b0..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/CompositeDestination.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/CompositeDestination.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/CompositeDestination.java deleted file mode 100644 index e3416f3b0..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/CompositeDestination.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * 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.broker.region.virtual; - -import java.util.Collection; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.command.ActiveMQDestination; - -/** - * - * - */ -public abstract class CompositeDestination implements VirtualDestination { - - private String name; - private Collection forwardTo; - private boolean forwardOnly = true; - private boolean copyMessage = true; - - public Destination intercept(Destination destination) { - return new CompositeDestinationFilter(destination, getForwardTo(), isForwardOnly(), isCopyMessage()); - } - - public void create(Broker broker, ConnectionContext context, ActiveMQDestination destination) { - } - - public void remove(Destination destination) { - } - - public String getName() { - return name; - } - - /** - * Sets the name of this composite destination - */ - public void setName(String name) { - this.name = name; - } - - public Collection getForwardTo() { - return forwardTo; - } - - /** - * Sets the list of destinations to forward to - */ - public void setForwardTo(Collection forwardDestinations) { - this.forwardTo = forwardDestinations; - } - - public boolean isForwardOnly() { - return forwardOnly; - } - - /** - * Sets if the virtual destination is forward only (and so there is no - * physical queue to match the virtual queue) or if there is also a physical - * queue with the same name). - */ - public void setForwardOnly(boolean forwardOnly) { - this.forwardOnly = forwardOnly; - } - - public boolean isCopyMessage() { - return copyMessage; - } - - /** - * Sets whether a copy of the message will be sent to each destination. - * Defaults to true so that the forward destination is set as the - * destination of the message - */ - public void setCopyMessage(boolean copyMessage) { - this.copyMessage = copyMessage; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/CompositeDestinationFilter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/CompositeDestinationFilter.class deleted file mode 100644 index 725738d41..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/CompositeDestinationFilter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/CompositeDestinationFilter.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/CompositeDestinationFilter.java deleted file mode 100644 index 7ca0049b8..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/CompositeDestinationFilter.java +++ /dev/null @@ -1,92 +0,0 @@ -/** - * 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.broker.region.virtual; - -import java.util.Collection; -import java.util.Iterator; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.ProducerBrokerExchange; -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.DestinationFilter; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.Message; -import org.apache.activemq.filter.MessageEvaluationContext; -import org.apache.activemq.filter.NonCachedMessageEvaluationContext; - -/** - * Represents a composite {@link Destination} where send()s are replicated to - * each Destination instance. - * - * - */ -public class CompositeDestinationFilter extends DestinationFilter { - - private Collection forwardDestinations; - private boolean forwardOnly; - private boolean copyMessage; - - public CompositeDestinationFilter(Destination next, Collection forwardDestinations, boolean forwardOnly, boolean copyMessage) { - super(next); - this.forwardDestinations = forwardDestinations; - this.forwardOnly = forwardOnly; - this.copyMessage = copyMessage; - } - - public void send(ProducerBrokerExchange context, Message message) throws Exception { - MessageEvaluationContext messageContext = null; - - for (Iterator iter = forwardDestinations.iterator(); iter.hasNext();) { - ActiveMQDestination destination = null; - Object value = iter.next(); - - if (value instanceof FilteredDestination) { - FilteredDestination filteredDestination = (FilteredDestination)value; - if (messageContext == null) { - messageContext = new NonCachedMessageEvaluationContext(); - messageContext.setMessageReference(message); - } - messageContext.setDestination(filteredDestination.getDestination()); - if (filteredDestination.matches(messageContext)) { - destination = filteredDestination.getDestination(); - } - } else if (value instanceof ActiveMQDestination) { - destination = (ActiveMQDestination)value; - } - if (destination == null) { - continue; - } - - Message forwarded_message; - if (copyMessage) { - forwarded_message = message.copy(); - forwarded_message.setDestination(destination); - } - else { - forwarded_message = message; - } - - // Send it back through the region broker for routing. - context.setMutable(true); - Broker regionBroker = context.getConnectionContext().getBroker().getBrokerService().getRegionBroker(); - regionBroker.send(context, forwarded_message); - } - if (!forwardOnly) { - super.send(context, message); - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/CompositeQueue.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/CompositeQueue.class deleted file mode 100644 index ab4c254e2..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/CompositeQueue.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/CompositeQueue.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/CompositeQueue.java deleted file mode 100644 index a425efdd6..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/CompositeQueue.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * 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.broker.region.virtual; - -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ActiveMQQueue; - -/** - * Represents a virtual queue which forwards to a number of other destinations. - * - * @org.apache.xbean.XBean - * - * - */ -public class CompositeQueue extends CompositeDestination { - - public ActiveMQDestination getVirtualDestination() { - return new ActiveMQQueue(getName()); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/CompositeTopic.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/CompositeTopic.class deleted file mode 100644 index 09035e258..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/CompositeTopic.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/CompositeTopic.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/CompositeTopic.java deleted file mode 100644 index c3087a8d9..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/CompositeTopic.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * 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.broker.region.virtual; - -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ActiveMQTopic; - -/** - * Represents a virtual topic which forwards to a number of other destinations. - * - * @org.apache.xbean.XBean - * - * - */ -public class CompositeTopic extends CompositeDestination { - - public ActiveMQDestination getVirtualDestination() { - return new ActiveMQTopic(getName()); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/FilteredDestination.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/FilteredDestination.class deleted file mode 100644 index 4ae9a7503..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/FilteredDestination.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/FilteredDestination.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/FilteredDestination.java deleted file mode 100644 index dc81a0e04..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/FilteredDestination.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * 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.broker.region.virtual; - -import javax.jms.InvalidSelectorException; -import javax.jms.JMSException; - -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.filter.BooleanExpression; -import org.apache.activemq.filter.MessageEvaluationContext; -import org.apache.activemq.selector.SelectorParser; - -/** - * Represents a destination which is filtered using some predicate such as a selector - * so that messages are only dispatched to the destination if they match the filter. - * - * @org.apache.xbean.XBean - * - * - */ -public class FilteredDestination { - - private ActiveMQDestination destination; - private String selector; - private BooleanExpression filter; - - public boolean matches(MessageEvaluationContext context) throws JMSException { - BooleanExpression booleanExpression = getFilter(); - if (booleanExpression == null) { - return false; - } - return booleanExpression.matches(context); - } - - public ActiveMQDestination getDestination() { - return destination; - } - - /** - * The destination to send messages to if they match the filter - */ - public void setDestination(ActiveMQDestination destination) { - this.destination = destination; - } - - public String getSelector() { - return selector; - } - - /** - * Sets the JMS selector used to filter messages before forwarding them to this destination - */ - public void setSelector(String selector) throws InvalidSelectorException { - this.selector = selector; - setFilter(SelectorParser.parse(selector)); - } - - public BooleanExpression getFilter() { - return filter; - } - - public void setFilter(BooleanExpression filter) { - this.filter = filter; - } - - - /** - * Sets the destination property to the given queue name - */ - public void setQueue(String queue) { - setDestination(ActiveMQDestination.createDestination(queue, ActiveMQDestination.QUEUE_TYPE)); - } - - /** - * Sets the destination property to the given topic name - */ - public void setTopic(String topic) { - setDestination(ActiveMQDestination.createDestination(topic, ActiveMQDestination.TOPIC_TYPE)); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/MirroredQueue$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/MirroredQueue$1.class deleted file mode 100644 index 8f2e0559a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/MirroredQueue$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/MirroredQueue.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/MirroredQueue.class deleted file mode 100644 index fba66c304..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/MirroredQueue.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/MirroredQueue.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/MirroredQueue.java deleted file mode 100644 index e5ee5ebc4..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/MirroredQueue.java +++ /dev/null @@ -1,147 +0,0 @@ -/** - * 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.broker.region.virtual; - -import org.apache.activemq.broker.*; -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.DestinationFilter; -import org.apache.activemq.broker.region.DestinationInterceptor; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ActiveMQTopic; -import org.apache.activemq.command.Message; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Creates Mirrored - * Queue using a prefix and postfix to define the topic name on which to mirror the queue to. - * - * - * @org.apache.xbean.XBean - */ -public class MirroredQueue implements DestinationInterceptor, BrokerServiceAware { - private static final transient Logger LOG = LoggerFactory.getLogger(MirroredQueue.class); - private String prefix = "VirtualTopic.Mirror."; - private String postfix = ""; - private boolean copyMessage = true; - private BrokerService brokerService; - - public Destination intercept(final Destination destination) { - if (destination.getActiveMQDestination().isQueue()) { - if (!destination.getActiveMQDestination().isTemporary() || brokerService.isUseTempMirroredQueues()) { - try { - final Destination mirrorDestination = getMirrorDestination(destination); - if (mirrorDestination != null) { - return new DestinationFilter(destination) { - public void send(ProducerBrokerExchange context, Message message) throws Exception { - message.setDestination(mirrorDestination.getActiveMQDestination()); - mirrorDestination.send(context, message); - - if (isCopyMessage()) { - message = message.copy(); - } - message.setDestination(destination.getActiveMQDestination()); - message.setMemoryUsage(null); // set this to null so that it will use the queue memoryUsage instance instead of the topic. - super.send(context, message); - } - }; - } - } - catch (Exception e) { - LOG.error("Failed to lookup the mirror destination for: {}", destination, e); - } - } - } - return destination; - } - - - public void remove(Destination destination) { - if (brokerService == null) { - throw new IllegalArgumentException("No brokerService injected!"); - } - ActiveMQDestination topic = getMirrorTopic(destination.getActiveMQDestination()); - if (topic != null) { - try { - brokerService.removeDestination(topic); - } catch (Exception e) { - LOG.error("Failed to remove mirror destination for {}", destination, e); - } - } - - } - - public void create(Broker broker, ConnectionContext context, ActiveMQDestination destination) {} - - // Properties - // ------------------------------------------------------------------------- - - public String getPostfix() { - return postfix; - } - - /** - * Sets any postix used to identify the queue consumers - */ - public void setPostfix(String postfix) { - this.postfix = postfix; - } - - public String getPrefix() { - return prefix; - } - - /** - * Sets the prefix wildcard used to identify the queue consumers for a given - * topic - */ - public void setPrefix(String prefix) { - this.prefix = prefix; - } - - public boolean isCopyMessage() { - return copyMessage; - } - - /** - * Sets whether a copy of the message will be sent to each destination. - * Defaults to true so that the forward destination is set as the - * destination of the message - */ - public void setCopyMessage(boolean copyMessage) { - this.copyMessage = copyMessage; - } - - public void setBrokerService(BrokerService brokerService) { - this.brokerService = brokerService; - } - - // Implementation methods - //------------------------------------------------------------------------- - protected Destination getMirrorDestination(Destination destination) throws Exception { - if (brokerService == null) { - throw new IllegalArgumentException("No brokerService injected!"); - } - ActiveMQDestination topic = getMirrorTopic(destination.getActiveMQDestination()); - return brokerService.getDestination(topic); - } - - protected ActiveMQDestination getMirrorTopic(ActiveMQDestination original) { - return new ActiveMQTopic(prefix + original.getPhysicalName() + postfix); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/SelectorAwareVirtualTopicInterceptor.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/SelectorAwareVirtualTopicInterceptor.class deleted file mode 100644 index b6031e408..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/SelectorAwareVirtualTopicInterceptor.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/SelectorAwareVirtualTopicInterceptor.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/SelectorAwareVirtualTopicInterceptor.java deleted file mode 100644 index 8d58a4317..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/SelectorAwareVirtualTopicInterceptor.java +++ /dev/null @@ -1,134 +0,0 @@ -/** - * 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.broker.region.virtual; - -import java.io.IOException; -import java.util.List; -import java.util.Set; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.ProducerBrokerExchange; -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.Message; -import org.apache.activemq.filter.BooleanExpression; -import org.apache.activemq.filter.MessageEvaluationContext; -import org.apache.activemq.filter.NonCachedMessageEvaluationContext; -import org.apache.activemq.plugin.SubQueueSelectorCacheBroker; -import org.apache.activemq.selector.SelectorParser; -import org.apache.activemq.util.LRUCache; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class SelectorAwareVirtualTopicInterceptor extends VirtualTopicInterceptor { - private static final Logger LOG = LoggerFactory.getLogger(SelectorAwareVirtualTopicInterceptor.class); - LRUCache expressionCache = new LRUCache(); - private SubQueueSelectorCacheBroker selectorCachePlugin; - - public SelectorAwareVirtualTopicInterceptor(Destination next, String prefix, String postfix, boolean local) { - super(next, prefix, postfix, local); - } - - /** - * Respect the selectors of the subscriptions to ensure only matched messages are dispatched to - * the virtual queues, hence there is no build up of unmatched messages on these destinations - */ - @Override - protected void send(ProducerBrokerExchange context, Message message, ActiveMQDestination destination) throws Exception { - Broker broker = context.getConnectionContext().getBroker(); - Set destinations = broker.getDestinations(destination); - - for (Destination dest : destinations) { - if (matchesSomeConsumer(broker, message, dest)) { - dest.send(context, message.copy()); - } - } - } - - private boolean matchesSomeConsumer(final Broker broker, Message message, Destination dest) throws IOException { - boolean matches = false; - MessageEvaluationContext msgContext = new NonCachedMessageEvaluationContext(); - msgContext.setDestination(dest.getActiveMQDestination()); - msgContext.setMessageReference(message); - List subs = dest.getConsumers(); - for (Subscription sub : subs) { - if (sub.matches(message, msgContext)) { - matches = true; - break; - - } - } - if (matches == false && subs.size() == 0) { - matches = tryMatchingCachedSubs(broker, dest, msgContext); - } - return matches; - } - - private boolean tryMatchingCachedSubs(final Broker broker, Destination dest, MessageEvaluationContext msgContext) { - boolean matches = false; - LOG.debug("No active consumer match found. Will try cache if configured..."); - - //retrieve the specific plugin class and lookup the selector for the destination. - final SubQueueSelectorCacheBroker cache = getSubQueueSelectorCacheBrokerPlugin(broker); - - if (cache != null) { - final String selector = cache.getSelector(dest.getActiveMQDestination().getQualifiedName()); - if (selector != null) { - try { - final BooleanExpression expression = getExpression(selector); - matches = expression.matches(msgContext); - } catch (Exception e) { - LOG.error(e.getMessage(), e); - } - } - } - return matches; - } - - private BooleanExpression getExpression(String selector) throws Exception{ - BooleanExpression result; - synchronized(expressionCache){ - result = expressionCache.get(selector); - if (result == null){ - result = compileSelector(selector); - expressionCache.put(selector,result); - } - } - return result; - } - - /** - * @return The SubQueueSelectorCacheBroker instance or null if no such broker is available. - */ - private SubQueueSelectorCacheBroker getSubQueueSelectorCacheBrokerPlugin(final Broker broker) { - if (selectorCachePlugin == null) { - selectorCachePlugin = (SubQueueSelectorCacheBroker) broker.getAdaptor(SubQueueSelectorCacheBroker.class); - } //if - - return selectorCachePlugin; - } - - /** - * Pre-compile the JMS selector. - * - * @param selectorExpression The non-null JMS selector expression. - */ - private BooleanExpression compileSelector(final String selectorExpression) throws Exception { - return SelectorParser.parse(selectorExpression); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/VirtualDestination.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/VirtualDestination.class deleted file mode 100644 index 001bd5fc1..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/VirtualDestination.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/VirtualDestination.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/VirtualDestination.java deleted file mode 100644 index 57d742c20..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/VirtualDestination.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * 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.broker.region.virtual; - -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.DestinationInterceptor; -import org.apache.activemq.command.ActiveMQDestination; - -/** - * Represents some kind of virtual destination. - * - * - */ -public interface VirtualDestination extends DestinationInterceptor { - - /** - * Returns the virtual destination - */ - ActiveMQDestination getVirtualDestination(); - - /** - * Creates a virtual destination from the physical destination - */ - Destination intercept(Destination destination); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/VirtualDestinationInterceptor$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/VirtualDestinationInterceptor$1.class deleted file mode 100644 index 5ac6f8254..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/VirtualDestinationInterceptor$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/VirtualDestinationInterceptor.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/VirtualDestinationInterceptor.class deleted file mode 100644 index 5b9dc8e6b..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/VirtualDestinationInterceptor.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/VirtualDestinationInterceptor.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/VirtualDestinationInterceptor.java deleted file mode 100644 index bcb131c28..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/VirtualDestinationInterceptor.java +++ /dev/null @@ -1,104 +0,0 @@ -/** - * 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.broker.region.virtual; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.ProducerBrokerExchange; -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.DestinationFilter; -import org.apache.activemq.broker.region.DestinationInterceptor; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.Message; -import org.apache.activemq.filter.DestinationMap; - -/** - * Implements Virtual Topics. - * - * @org.apache.xbean.XBean - * - */ -public class VirtualDestinationInterceptor implements DestinationInterceptor { - - private DestinationMap destinationMap = new DestinationMap(); - private VirtualDestination[] virtualDestinations; - - public Destination intercept(Destination destination) { - Set matchingDestinations = destinationMap.get(destination.getActiveMQDestination()); - List destinations = new ArrayList(); - for (Iterator iter = matchingDestinations.iterator(); iter.hasNext();) { - VirtualDestination virtualDestination = (VirtualDestination)iter.next(); - Destination newDestination = virtualDestination.intercept(destination); - destinations.add(newDestination); - } - if (!destinations.isEmpty()) { - if (destinations.size() == 1) { - return destinations.get(0); - } else { - // should rarely be used but here just in case - return createCompositeDestination(destination, destinations); - } - } - return destination; - } - - - public synchronized void create(Broker broker, ConnectionContext context, ActiveMQDestination destination) throws Exception { - for (VirtualDestination virt: virtualDestinations) { - virt.create(broker, context, destination); - } - } - - public synchronized void remove(Destination destination) { - } - - public VirtualDestination[] getVirtualDestinations() { - return virtualDestinations; - } - - public void setVirtualDestinations(VirtualDestination[] virtualDestinations) { - destinationMap = new DestinationMap(); - this.virtualDestinations = virtualDestinations; - for (int i = 0; i < virtualDestinations.length; i++) { - VirtualDestination virtualDestination = virtualDestinations[i]; - destinationMap.put(virtualDestination.getVirtualDestination(), virtualDestination); - } - } - - protected Destination createCompositeDestination(Destination destination, final List destinations) { - return new DestinationFilter(destination) { - public void send(ProducerBrokerExchange context, Message messageSend) throws Exception { - for (Iterator iter = destinations.iterator(); iter.hasNext();) { - Destination destination = iter.next(); - destination.send(context, messageSend); - } - } - }; - } - - @Override - public String toString() { - return "VirtualDestinationInterceptor" + Arrays.asList(virtualDestinations); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/VirtualTopic.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/VirtualTopic.class deleted file mode 100644 index 37f8a18d9..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/VirtualTopic.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/VirtualTopic.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/VirtualTopic.java deleted file mode 100644 index a4d8f135d..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/VirtualTopic.java +++ /dev/null @@ -1,128 +0,0 @@ -/** - * 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.broker.region.virtual; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ActiveMQQueue; -import org.apache.activemq.command.ActiveMQTopic; -import org.apache.activemq.filter.DestinationFilter; - -/** - * Creates Virtual - * Topics using a prefix and postfix. The virtual destination creates a - * wildcard that is then used to look up all active queue subscriptions which - * match. - * - * @org.apache.xbean.XBean - * - * - */ -public class VirtualTopic implements VirtualDestination { - - private String prefix = "Consumer.*."; - private String postfix = ""; - private String name = ">"; - private boolean selectorAware = false; - private boolean local = false; - - - public ActiveMQDestination getVirtualDestination() { - return new ActiveMQTopic(getName()); - } - - public Destination intercept(Destination destination) { - return selectorAware ? new SelectorAwareVirtualTopicInterceptor(destination, getPrefix(), getPostfix(), isLocal()) : - new VirtualTopicInterceptor(destination, getPrefix(), getPostfix(), isLocal()); - } - - - public void create(Broker broker, ConnectionContext context, ActiveMQDestination destination) throws Exception { - if (destination.isQueue() && destination.isPattern() && broker.getDestinations(destination).isEmpty()) { - DestinationFilter filter = DestinationFilter.parseFilter(new ActiveMQQueue(prefix + DestinationFilter.ANY_DESCENDENT)); - if (filter.matches(destination)) { - broker.addDestination(context, destination, false); - } - } - } - - public void remove(Destination destination) { - } - - // Properties - // ------------------------------------------------------------------------- - - public String getPostfix() { - return postfix; - } - - /** - * Sets any postix used to identify the queue consumers - */ - public void setPostfix(String postfix) { - this.postfix = postfix; - } - - public String getPrefix() { - return prefix; - } - - /** - * Sets the prefix wildcard used to identify the queue consumers for a given - * topic - */ - public void setPrefix(String prefix) { - this.prefix = prefix; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - /** - * Indicates whether the selectors of consumers are used to determine dispatch - * to a virtual destination, when true only messages matching an existing - * consumer will be dispatched. - * @param selectorAware when true take consumer selectors into consideration - */ - public void setSelectorAware(boolean selectorAware) { - this.selectorAware = selectorAware; - } - - public boolean isSelectorAware() { - return selectorAware; - } - - public boolean isLocal() { - return local; - } - - public void setLocal(boolean local) { - this.local = local; - } - - @Override - public String toString() { - return new StringBuilder("VirtualTopic:").append(prefix).append(',').append(name).append(',').append(postfix).append(',').append(selectorAware).append(',').append(local).toString(); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/VirtualTopicInterceptor.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/VirtualTopicInterceptor.class deleted file mode 100644 index ad765534d..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/VirtualTopicInterceptor.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/VirtualTopicInterceptor.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/VirtualTopicInterceptor.java deleted file mode 100644 index 21c1d239c..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/VirtualTopicInterceptor.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * 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.broker.region.virtual; - -import org.apache.activemq.broker.ProducerBrokerExchange; -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.DestinationFilter; -import org.apache.activemq.broker.region.Topic; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ActiveMQQueue; -import org.apache.activemq.command.Message; -import org.apache.activemq.util.LRUCache; - -/** - * A Destination which implements Virtual Topic - */ -public class VirtualTopicInterceptor extends DestinationFilter { - - private final String prefix; - private final String postfix; - private final boolean local; - private final LRUCache cache = new LRUCache(); - - public VirtualTopicInterceptor(Destination next, String prefix, String postfix, boolean local) { - super(next); - this.prefix = prefix; - this.postfix = postfix; - this.local = local; - } - - public Topic getTopic() { - return (Topic) this.next; - } - - @Override - public void send(ProducerBrokerExchange context, Message message) throws Exception { - if (!message.isAdvisory() && !(local && message.getBrokerPath() != null)) { - ActiveMQDestination queueConsumers = getQueueConsumersWildcard(message.getDestination()); - send(context, message, queueConsumers); - } - super.send(context, message); - } - - protected ActiveMQDestination getQueueConsumersWildcard(ActiveMQDestination original) { - ActiveMQQueue queue; - synchronized (cache) { - queue = cache.get(original); - if (queue == null) { - queue = new ActiveMQQueue(prefix + original.getPhysicalName() + postfix); - cache.put(original, queue); - } - } - return queue; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/package.html b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/package.html deleted file mode 100644 index 6a66e9f32..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/region/virtual/package.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - -Implementation classes for Virtual Destinations - - - diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/CronParser$CronEntry.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/CronParser$CronEntry.class deleted file mode 100644 index df5274ebf..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/CronParser$CronEntry.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/CronParser.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/CronParser.class deleted file mode 100644 index eb44c775a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/CronParser.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/CronParser.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/CronParser.java deleted file mode 100644 index 4251466a0..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/CronParser.java +++ /dev/null @@ -1,362 +0,0 @@ -/** - * 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.broker.scheduler; - -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Collections; -import java.util.List; -import java.util.StringTokenizer; - -import javax.jms.MessageFormatException; - -public class CronParser { - - private static final int NUMBER_TOKENS = 5; - private static final int MINUTES = 0; - private static final int HOURS = 1; - private static final int DAY_OF_MONTH = 2; - private static final int MONTH = 3; - private static final int DAY_OF_WEEK = 4; - - public static long getNextScheduledTime(final String cronEntry, long currentTime) throws MessageFormatException { - - long result = 0; - - if (cronEntry == null || cronEntry.length() == 0) { - return result; - } - - // Handle the once per minute case "* * * * *" - // starting the next event at the top of the minute. - if (cronEntry.equals("* * * * *")) { - result = currentTime + 60 * 1000; - result = result / 60000 * 60000; - return result; - } - - List list = tokenize(cronEntry); - List entries = buildCronEntries(list); - Calendar working = Calendar.getInstance(); - working.setTimeInMillis(currentTime); - working.set(Calendar.SECOND, 0); - - CronEntry minutes = entries.get(MINUTES); - CronEntry hours = entries.get(HOURS); - CronEntry dayOfMonth = entries.get(DAY_OF_MONTH); - CronEntry month = entries.get(MONTH); - CronEntry dayOfWeek = entries.get(DAY_OF_WEEK); - - // Start at the top of the next minute, cron is only guaranteed to be - // run on the minute. - int timeToNextMinute = 60 - working.get(Calendar.SECOND); - working.add(Calendar.SECOND, timeToNextMinute); - - // If its already to late in the day this will roll us over to tomorrow - // so we'll need to check again when done updating month and day. - int currentMinutes = working.get(Calendar.MINUTE); - if (!isCurrent(minutes, currentMinutes)) { - int nextMinutes = getNext(minutes, currentMinutes); - working.add(Calendar.MINUTE, nextMinutes); - } - - int currentHours = working.get(Calendar.HOUR_OF_DAY); - if (!isCurrent(hours, currentHours)) { - int nextHour = getNext(hours, currentHours); - working.add(Calendar.HOUR_OF_DAY, nextHour); - } - - // We can roll into the next month here which might violate the cron setting - // rules so we check once then recheck again after applying the month settings. - doUpdateCurrentDay(working, dayOfMonth, dayOfWeek); - - // Start by checking if we are in the right month, if not then calculations - // need to start from the beginning of the month to ensure that we don't end - // up on the wrong day. (Can happen when DAY_OF_WEEK is set and current time - // is ahead of the day of the week to execute on). - doUpdateCurrentMonth(working, month); - - // Now Check day of week and day of month together since they can be specified - // together in one entry, if both "day of month" and "day of week" are restricted - // (not "*"), then either the "day of month" field (3) or the "day of week" field - // (5) must match the current day or the Calenday must be advanced. - doUpdateCurrentDay(working, dayOfMonth, dayOfWeek); - - // Now we can chose the correct hour and minute of the day in question. - - currentHours = working.get(Calendar.HOUR_OF_DAY); - if (!isCurrent(hours, currentHours)) { - int nextHour = getNext(hours, currentHours); - working.add(Calendar.HOUR_OF_DAY, nextHour); - } - - currentMinutes = working.get(Calendar.MINUTE); - if (!isCurrent(minutes, currentMinutes)) { - int nextMinutes = getNext(minutes, currentMinutes); - working.add(Calendar.MINUTE, nextMinutes); - } - - result = working.getTimeInMillis(); - - if (result <= currentTime) { - throw new ArithmeticException("Unable to compute next scheduled exection time."); - } - - return result; - } - - protected static long doUpdateCurrentMonth(Calendar working, CronEntry month) throws MessageFormatException { - - int currentMonth = working.get(Calendar.MONTH) + 1; - if (!isCurrent(month, currentMonth)) { - int nextMonth = getNext(month, currentMonth); - working.add(Calendar.MONTH, nextMonth); - - // Reset to start of month. - resetToStartOfDay(working, 1); - - return working.getTimeInMillis(); - } - - return 0L; - } - - protected static long doUpdateCurrentDay(Calendar working, CronEntry dayOfMonth, CronEntry dayOfWeek) throws MessageFormatException { - - int currentDayOfWeek = working.get(Calendar.DAY_OF_WEEK) - 1; - int currentDayOfMonth = working.get(Calendar.DAY_OF_MONTH); - - // Simplest case, both are unrestricted or both match today otherwise - // result must be the closer of the two if both are set, or the next - // match to the one that is. - if (!isCurrent(dayOfWeek, currentDayOfWeek) || - !isCurrent(dayOfMonth, currentDayOfMonth) ) { - - int nextWeekDay = Integer.MAX_VALUE; - int nextCalendarDay = Integer.MAX_VALUE; - - if (!isCurrent(dayOfWeek, currentDayOfWeek)) { - nextWeekDay = getNext(dayOfWeek, currentDayOfWeek); - } - - if (!isCurrent(dayOfMonth, currentDayOfMonth)) { - nextCalendarDay = getNext(dayOfMonth, currentDayOfMonth); - } - - if( nextWeekDay < nextCalendarDay ) { - working.add(Calendar.DAY_OF_WEEK, nextWeekDay); - } else { - working.add(Calendar.DAY_OF_MONTH, nextCalendarDay); - } - - // Since the day changed, we restart the clock at the start of the day - // so that the next time will either be at 12am + value of hours and - // minutes pattern. - resetToStartOfDay(working, working.get(Calendar.DAY_OF_MONTH)); - - return working.getTimeInMillis(); - } - - return 0L; - } - - public static void validate(final String cronEntry) throws MessageFormatException { - List list = tokenize(cronEntry); - List entries = buildCronEntries(list); - for (CronEntry e : entries) { - validate(e); - } - } - - static void validate(final CronEntry entry) throws MessageFormatException { - - List list = entry.currentWhen; - if (list.isEmpty() || list.get(0).intValue() < entry.start || list.get(list.size() - 1).intValue() > entry.end) { - throw new MessageFormatException("Invalid token: " + entry); - } - } - - static int getNext(final CronEntry entry, final int current) throws MessageFormatException { - int result = 0; - - if (entry.currentWhen == null) { - entry.currentWhen = calculateValues(entry); - } - - List list = entry.currentWhen; - int next = -1; - for (Integer i : list) { - if (i.intValue() > current) { - next = i.intValue(); - break; - } - } - if (next != -1) { - result = next - current; - } else { - int first = list.get(0).intValue(); - result = entry.end + first - entry.start - current; - - // Account for difference of one vs zero based indices. - if (entry.name.equals("DayOfWeek") || entry.name.equals("Month")) { - result++; - } - } - - return result; - } - - static boolean isCurrent(final CronEntry entry, final int current) throws MessageFormatException { - boolean result = entry.currentWhen.contains(new Integer(current)); - return result; - } - - protected static void resetToStartOfDay(Calendar target, int day) { - target.set(Calendar.DAY_OF_MONTH, day); - target.set(Calendar.HOUR_OF_DAY, 0); - target.set(Calendar.MINUTE, 0); - target.set(Calendar.SECOND, 0); - } - - static List tokenize(String cron) throws IllegalArgumentException { - StringTokenizer tokenize = new StringTokenizer(cron); - List result = new ArrayList(); - while (tokenize.hasMoreTokens()) { - result.add(tokenize.nextToken()); - } - if (result.size() != NUMBER_TOKENS) { - throw new IllegalArgumentException("Not a valid cron entry - wrong number of tokens(" + result.size() - + "): " + cron); - } - return result; - } - - protected static List calculateValues(final CronEntry entry) { - List result = new ArrayList(); - if (isAll(entry.token)) { - for (int i = entry.start; i <= entry.end; i++) { - result.add(i); - } - } else if (isAStep(entry.token)) { - int denominator = getDenominator(entry.token); - String numerator = getNumerator(entry.token); - CronEntry ce = new CronEntry(entry.name, numerator, entry.start, entry.end); - List list = calculateValues(ce); - for (Integer i : list) { - if (i.intValue() % denominator == 0) { - result.add(i); - } - } - } else if (isAList(entry.token)) { - StringTokenizer tokenizer = new StringTokenizer(entry.token, ","); - while (tokenizer.hasMoreTokens()) { - String str = tokenizer.nextToken(); - CronEntry ce = new CronEntry(entry.name, str, entry.start, entry.end); - List list = calculateValues(ce); - result.addAll(list); - } - } else if (isARange(entry.token)) { - int index = entry.token.indexOf('-'); - int first = Integer.parseInt(entry.token.substring(0, index)); - int last = Integer.parseInt(entry.token.substring(index + 1)); - for (int i = first; i <= last; i++) { - result.add(i); - } - } else { - int value = Integer.parseInt(entry.token); - result.add(value); - } - Collections.sort(result); - return result; - } - - protected static boolean isARange(String token) { - return token != null && token.indexOf('-') >= 0; - } - - protected static boolean isAStep(String token) { - return token != null && token.indexOf('/') >= 0; - } - - protected static boolean isAList(String token) { - return token != null && token.indexOf(',') >= 0; - } - - protected static boolean isAll(String token) { - return token != null && token.length() == 1 && (token.charAt(0) == '*' || token.charAt(0) == '?'); - } - - protected static int getDenominator(final String token) { - int result = 0; - int index = token.indexOf('/'); - String str = token.substring(index + 1); - result = Integer.parseInt(str); - return result; - } - - protected static String getNumerator(final String token) { - int index = token.indexOf('/'); - String str = token.substring(0, index); - return str; - } - - static List buildCronEntries(List tokens) { - - List result = new ArrayList(); - - CronEntry minutes = new CronEntry("Minutes", tokens.get(MINUTES), 0, 60); - minutes.currentWhen = calculateValues(minutes); - result.add(minutes); - CronEntry hours = new CronEntry("Hours", tokens.get(HOURS), 0, 24); - hours.currentWhen = calculateValues(hours); - result.add(hours); - CronEntry dayOfMonth = new CronEntry("DayOfMonth", tokens.get(DAY_OF_MONTH), 1, 31); - dayOfMonth.currentWhen = calculateValues(dayOfMonth); - result.add(dayOfMonth); - CronEntry month = new CronEntry("Month", tokens.get(MONTH), 1, 12); - month.currentWhen = calculateValues(month); - result.add(month); - CronEntry dayOfWeek = new CronEntry("DayOfWeek", tokens.get(DAY_OF_WEEK), 0, 6); - dayOfWeek.currentWhen = calculateValues(dayOfWeek); - result.add(dayOfWeek); - - return result; - } - - static class CronEntry { - - final String name; - final String token; - final int start; - final int end; - - List currentWhen; - - CronEntry(String name, String token, int start, int end) { - this.name = name; - this.token = token; - this.start = start; - this.end = end; - } - - @Override - public String toString() { - return this.name + ":" + token; - } - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/Job.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/Job.class deleted file mode 100644 index 32cde4751..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/Job.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/Job.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/Job.java deleted file mode 100644 index 7b28a5bb9..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/Job.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * 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.broker.scheduler; - - -public interface Job { - - /** - * @return the jobId - */ - public abstract String getJobId(); - - /** - * @return the repeat - */ - public abstract int getRepeat(); - - /** - * @return the start - */ - public abstract long getStart(); - - /** - * @return the Delay - */ - public abstract long getDelay(); - /** - * @return the period - */ - public abstract long getPeriod(); - - /** - * @return the cron entry - */ - public abstract String getCronEntry(); - - /** - * @return the payload - */ - public abstract byte[] getPayload(); - - /** - * Get the start time as a Date time string - * @return the date time - */ - public String getStartTime(); - - /** - * Get the time the job is next due to execute - * @return the date time - */ - public String getNextExecutionTime(); - -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/JobListener.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/JobListener.class deleted file mode 100644 index 76d50686e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/JobListener.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/JobListener.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/JobListener.java deleted file mode 100644 index c53d9c668..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/JobListener.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * 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.broker.scheduler; - -import org.apache.activemq.util.ByteSequence; - -public interface JobListener { - - /** - * A Job that has been scheduled is now ready - * @param id - * @param job - */ - public void scheduledJob(String id,ByteSequence job); - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/JobScheduler.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/JobScheduler.class deleted file mode 100644 index b649c6a62..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/JobScheduler.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/JobScheduler.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/JobScheduler.java deleted file mode 100644 index 2e96eae1f..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/JobScheduler.java +++ /dev/null @@ -1,177 +0,0 @@ -/** - * 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.broker.scheduler; - -import java.util.List; - -import org.apache.activemq.util.ByteSequence; - -public interface JobScheduler { - - /** - * @return the name of the scheduler - * @throws Exception - */ - String getName() throws Exception; - - /** - * Starts dispatch of scheduled Jobs to registered listeners. - * - * Any listener added after the start dispatch method can miss jobs so its - * important to register critical listeners before the start of job dispatching. - * - * @throws Exception - */ - void startDispatching() throws Exception; - - /** - * Stops dispatching of scheduled Jobs to registered listeners. - * - * @throws Exception - */ - void stopDispatching() throws Exception; - - /** - * Add a Job listener - * - * @param l - * @throws Exception - */ - void addListener(JobListener l) throws Exception; - - /** - * remove a JobListener - * - * @param l - * @throws Exception - */ - void removeListener(JobListener l) throws Exception; - - /** - * Add a job to be scheduled - * - * @param jobId - * a unique identifier for the job - * @param payload - * the message to be sent when the job is scheduled - * @param delay - * the time in milliseconds before the job will be run - * @throws Exception - */ - void schedule(String jobId, ByteSequence payload, long delay) throws Exception; - - /** - * Add a job to be scheduled - * - * @param jobId - * a unique identifier for the job - * @param payload - * the message to be sent when the job is scheduled - * @param cronEntry - * - cron entry - * @throws Exception - */ - void schedule(String jobId, ByteSequence payload, String cronEntry) throws Exception; - - /** - * Add a job to be scheduled - * - * @param jobId - * a unique identifier for the job - * @param payload - * the message to be sent when the job is scheduled - * @param cronEntry - * - cron entry - * @param delay - * time in ms to wait before scheduling - * @param period - * the time in milliseconds between successive executions of the Job - * @param repeat - * the number of times to execute the job - less than 0 will be repeated forever - * @throws Exception - */ - void schedule(String jobId, ByteSequence payload, String cronEntry, long delay, long period, int repeat) throws Exception; - - /** - * remove all jobs scheduled to run at this time - * - * @param time - * @throws Exception - */ - void remove(long time) throws Exception; - - /** - * remove a job with the matching jobId - * - * @param jobId - * @throws Exception - */ - void remove(String jobId) throws Exception; - - /** - * remove all the Jobs from the scheduler - * - * @throws Exception - */ - void removeAllJobs() throws Exception; - - /** - * remove all the Jobs from the scheduler that are due between the start and finish times - * - * @param start - * time in milliseconds - * @param finish - * time in milliseconds - * @throws Exception - */ - void removeAllJobs(long start, long finish) throws Exception; - - /** - * Get the next time jobs will be fired - * - * @return the time in milliseconds - * @throws Exception - */ - long getNextScheduleTime() throws Exception; - - /** - * Get all the jobs scheduled to run next - * - * @return a list of jobs that will be scheduled next - * @throws Exception - */ - List getNextScheduleJobs() throws Exception; - - /** - * Get all the outstanding Jobs - * - * @return a list of all jobs - * @throws Exception - */ - List getAllJobs() throws Exception; - - /** - * Get all outstanding jobs due to run between start and finish - * - * @param start - * @param finish - * @return a list of jobs - * @throws Exception - */ - List getAllJobs(long start, long finish) throws Exception; - -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/JobSchedulerFacade.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/JobSchedulerFacade.class deleted file mode 100644 index 3bebe8f6f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/JobSchedulerFacade.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/JobSchedulerFacade.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/JobSchedulerFacade.java deleted file mode 100644 index d46d04aa3..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/JobSchedulerFacade.java +++ /dev/null @@ -1,164 +0,0 @@ -/** - * 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.broker.scheduler; - -import java.util.Collections; -import java.util.List; - -import org.apache.activemq.util.ByteSequence; - -public class JobSchedulerFacade implements JobScheduler { - - private final SchedulerBroker broker; - - JobSchedulerFacade(SchedulerBroker broker) { - this.broker = broker; - } - - @Override - public void addListener(JobListener l) throws Exception { - JobScheduler js = this.broker.getInternalScheduler(); - if (js != null) { - js.addListener(l); - } - } - - @Override - public List getAllJobs() throws Exception { - JobScheduler js = this.broker.getInternalScheduler(); - if (js != null) { - return js.getAllJobs(); - } - return Collections.emptyList(); - } - - @Override - public List getAllJobs(long start, long finish) throws Exception { - JobScheduler js = this.broker.getInternalScheduler(); - if (js != null) { - return js.getAllJobs(start, finish); - } - return Collections.emptyList(); - } - - @Override - public String getName() throws Exception { - JobScheduler js = this.broker.getInternalScheduler(); - if (js != null) { - return js.getName(); - } - return ""; - } - - @Override - public List getNextScheduleJobs() throws Exception { - JobScheduler js = this.broker.getInternalScheduler(); - if (js != null) { - return js.getNextScheduleJobs(); - } - return Collections.emptyList(); - } - - @Override - public long getNextScheduleTime() throws Exception { - JobScheduler js = this.broker.getInternalScheduler(); - if (js != null) { - return js.getNextScheduleTime(); - } - return 0; - } - - @Override - public void remove(long time) throws Exception { - JobScheduler js = this.broker.getInternalScheduler(); - if (js != null) { - js.remove(time); - } - } - - @Override - public void remove(String jobId) throws Exception { - JobScheduler js = this.broker.getInternalScheduler(); - if (js != null) { - js.remove(jobId); - } - } - - @Override - public void removeAllJobs() throws Exception { - JobScheduler js = this.broker.getInternalScheduler(); - if (js != null) { - js.removeAllJobs(); - } - } - - @Override - public void removeAllJobs(long start, long finish) throws Exception { - JobScheduler js = this.broker.getInternalScheduler(); - if (js != null) { - js.removeAllJobs(start, finish); - } - } - - @Override - public void removeListener(JobListener l) throws Exception { - JobScheduler js = this.broker.getInternalScheduler(); - if (js != null) { - js.removeListener(l); - } - } - - @Override - public void schedule(String jobId, ByteSequence payload, long delay) throws Exception { - JobScheduler js = this.broker.getInternalScheduler(); - if (js != null) { - js.schedule(jobId, payload, delay); - } - } - - @Override - public void schedule(String jobId, ByteSequence payload, String cronEntry, long start, long period, int repeat) throws Exception { - JobScheduler js = this.broker.getInternalScheduler(); - if (js != null) { - js.schedule(jobId, payload, cronEntry, start, period, repeat); - } - } - - @Override - public void schedule(String jobId, ByteSequence payload, String cronEntry) throws Exception { - JobScheduler js = this.broker.getInternalScheduler(); - if (js != null) { - js.schedule(jobId, payload, cronEntry); - } - } - - @Override - public void startDispatching() throws Exception { - JobScheduler js = this.broker.getInternalScheduler(); - if (js != null) { - js.startDispatching(); - } - } - - @Override - public void stopDispatching() throws Exception { - JobScheduler js = this.broker.getInternalScheduler(); - if (js != null) { - js.stopDispatching(); - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/JobSchedulerStore.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/JobSchedulerStore.class deleted file mode 100644 index 0dc87bb7e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/JobSchedulerStore.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/JobSchedulerStore.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/JobSchedulerStore.java deleted file mode 100644 index 3cbc367fb..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/JobSchedulerStore.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * 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.broker.scheduler; - -import java.io.File; - -import org.apache.activemq.Service; - -/** - * A Job Scheduler Store interface use to manage delay processing of Messaging - * related jobs. - */ -public interface JobSchedulerStore extends Service { - - File getDirectory(); - - void setDirectory(File directory); - - long size(); - - JobScheduler getJobScheduler(String name) throws Exception; - - boolean removeJobScheduler(String name) throws Exception; -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/JobSupport.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/JobSupport.class deleted file mode 100644 index bb87e89ed..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/JobSupport.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/JobSupport.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/JobSupport.java deleted file mode 100644 index 6b78d7752..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/JobSupport.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * 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.broker.scheduler; - -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.Date; - -public class JobSupport { - public static String getDateTime(long value) { - DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - Date date = new Date(value); - return dateFormat.format(date); - } - - public static long getDataTime(String value) throws Exception { - DateFormat dfm = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - Date date = dfm.parse(value); - return date.getTime(); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/SchedulerBroker$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/SchedulerBroker$1.class deleted file mode 100644 index 87d865d89..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/SchedulerBroker$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/SchedulerBroker.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/SchedulerBroker.class deleted file mode 100644 index 13c97cb32..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/SchedulerBroker.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/SchedulerBroker.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/SchedulerBroker.java deleted file mode 100644 index 6cd476f62..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/SchedulerBroker.java +++ /dev/null @@ -1,331 +0,0 @@ -/** - * 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.broker.scheduler; - -import java.io.IOException; -import java.util.concurrent.atomic.AtomicBoolean; - -import org.apache.activemq.ScheduledMessage; -import org.apache.activemq.advisory.AdvisorySupport; -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.BrokerFilter; -import org.apache.activemq.broker.BrokerService; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.ProducerBrokerExchange; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.Message; -import org.apache.activemq.command.MessageId; -import org.apache.activemq.command.ProducerId; -import org.apache.activemq.command.ProducerInfo; -import org.apache.activemq.openwire.OpenWireFormat; -import org.apache.activemq.security.SecurityContext; -import org.apache.activemq.state.ProducerState; -import org.apache.activemq.transaction.Synchronization; -import org.apache.activemq.usage.JobSchedulerUsage; -import org.apache.activemq.usage.SystemUsage; -import org.apache.activemq.util.ByteSequence; -import org.apache.activemq.util.IdGenerator; -import org.apache.activemq.util.LongSequenceGenerator; -import org.apache.activemq.util.TypeConversionSupport; -import org.apache.activemq.wireformat.WireFormat; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class SchedulerBroker extends BrokerFilter implements JobListener { - private static final Logger LOG = LoggerFactory.getLogger(SchedulerBroker.class); - private static final IdGenerator ID_GENERATOR = new IdGenerator(); - private final LongSequenceGenerator messageIdGenerator = new LongSequenceGenerator(); - private final AtomicBoolean started = new AtomicBoolean(); - private final WireFormat wireFormat = new OpenWireFormat(); - private final ConnectionContext context = new ConnectionContext(); - private final ProducerId producerId = new ProducerId(); - private final SystemUsage systemUsage; - - private final JobSchedulerStore store; - private JobScheduler scheduler; - - public SchedulerBroker(BrokerService brokerService, Broker next, JobSchedulerStore store) throws Exception { - super(next); - - this.store = store; - this.producerId.setConnectionId(ID_GENERATOR.generateId()); - this.context.setSecurityContext(SecurityContext.BROKER_SECURITY_CONTEXT); - this.context.setBroker(next); - this.systemUsage = brokerService.getSystemUsage(); - - wireFormat.setVersion(brokerService.getStoreOpenWireVersion()); - } - - public synchronized JobScheduler getJobScheduler() throws Exception { - return new JobSchedulerFacade(this); - } - - @Override - public void start() throws Exception { - this.started.set(true); - getInternalScheduler(); - super.start(); - } - - @Override - public void stop() throws Exception { - if (this.started.compareAndSet(true, false)) { - - if (this.store != null) { - this.store.stop(); - } - if (this.scheduler != null) { - this.scheduler.removeListener(this); - this.scheduler = null; - } - } - super.stop(); - } - - @Override - public void send(ProducerBrokerExchange producerExchange, final Message messageSend) throws Exception { - ConnectionContext context = producerExchange.getConnectionContext(); - - final String jobId = (String) messageSend.getProperty(ScheduledMessage.AMQ_SCHEDULED_ID); - final Object cronValue = messageSend.getProperty(ScheduledMessage.AMQ_SCHEDULED_CRON); - final Object periodValue = messageSend.getProperty(ScheduledMessage.AMQ_SCHEDULED_PERIOD); - final Object delayValue = messageSend.getProperty(ScheduledMessage.AMQ_SCHEDULED_DELAY); - - String physicalName = messageSend.getDestination().getPhysicalName(); - boolean schedularManage = physicalName.regionMatches(true, 0, ScheduledMessage.AMQ_SCHEDULER_MANAGEMENT_DESTINATION, 0, - ScheduledMessage.AMQ_SCHEDULER_MANAGEMENT_DESTINATION.length()); - - if (schedularManage == true) { - - JobScheduler scheduler = getInternalScheduler(); - ActiveMQDestination replyTo = messageSend.getReplyTo(); - - String action = (String) messageSend.getProperty(ScheduledMessage.AMQ_SCHEDULER_ACTION); - - if (action != null) { - - Object startTime = messageSend.getProperty(ScheduledMessage.AMQ_SCHEDULER_ACTION_START_TIME); - Object endTime = messageSend.getProperty(ScheduledMessage.AMQ_SCHEDULER_ACTION_END_TIME); - - if (replyTo != null && action.equals(ScheduledMessage.AMQ_SCHEDULER_ACTION_BROWSE)) { - - if (startTime != null && endTime != null) { - - long start = (Long) TypeConversionSupport.convert(startTime, Long.class); - long finish = (Long) TypeConversionSupport.convert(endTime, Long.class); - - for (Job job : scheduler.getAllJobs(start, finish)) { - sendScheduledJob(producerExchange.getConnectionContext(), job, replyTo); - } - } else { - for (Job job : scheduler.getAllJobs()) { - sendScheduledJob(producerExchange.getConnectionContext(), job, replyTo); - } - } - } - if (jobId != null && action.equals(ScheduledMessage.AMQ_SCHEDULER_ACTION_REMOVE)) { - scheduler.remove(jobId); - } else if (action.equals(ScheduledMessage.AMQ_SCHEDULER_ACTION_REMOVEALL)) { - - if (startTime != null && endTime != null) { - - long start = (Long) TypeConversionSupport.convert(startTime, Long.class); - long finish = (Long) TypeConversionSupport.convert(endTime, Long.class); - - scheduler.removeAllJobs(start, finish); - } else { - scheduler.removeAllJobs(); - } - } - } - - } else if ((cronValue != null || periodValue != null || delayValue != null) && jobId == null) { - - if (context.isInTransaction()) { - context.getTransaction().addSynchronization(new Synchronization() { - @Override - public void afterCommit() throws Exception { - doSchedule(messageSend, cronValue, periodValue, delayValue); - } - }); - } else { - doSchedule(messageSend, cronValue, periodValue, delayValue); - } - } else { - super.send(producerExchange, messageSend); - } - } - - private void doSchedule(Message messageSend, Object cronValue, Object periodValue, Object delayValue) throws Exception { - long delay = 0; - long period = 0; - int repeat = 0; - String cronEntry = ""; - - // clear transaction context - Message msg = messageSend.copy(); - msg.setTransactionId(null); - org.apache.activemq.util.ByteSequence packet = wireFormat.marshal(msg); - if (cronValue != null) { - cronEntry = cronValue.toString(); - } - if (periodValue != null) { - period = (Long) TypeConversionSupport.convert(periodValue, Long.class); - } - if (delayValue != null) { - delay = (Long) TypeConversionSupport.convert(delayValue, Long.class); - } - Object repeatValue = msg.getProperty(ScheduledMessage.AMQ_SCHEDULED_REPEAT); - if (repeatValue != null) { - repeat = (Integer) TypeConversionSupport.convert(repeatValue, Integer.class); - } - - getInternalScheduler().schedule(msg.getMessageId().toString(), - new ByteSequence(packet.data, packet.offset, packet.length), cronEntry, delay, period, repeat); - } - - @Override - public void scheduledJob(String id, ByteSequence job) { - org.apache.activemq.util.ByteSequence packet = new org.apache.activemq.util.ByteSequence(job.getData(), job.getOffset(), job.getLength()); - try { - Message messageSend = (Message) this.wireFormat.unmarshal(packet); - messageSend.setOriginalTransactionId(null); - Object repeatValue = messageSend.getProperty(ScheduledMessage.AMQ_SCHEDULED_REPEAT); - Object cronValue = messageSend.getProperty(ScheduledMessage.AMQ_SCHEDULED_CRON); - String cronStr = cronValue != null ? cronValue.toString() : null; - int repeat = 0; - if (repeatValue != null) { - repeat = (Integer) TypeConversionSupport.convert(repeatValue, Integer.class); - } - - // Check for room in the job scheduler store - if (systemUsage.getJobSchedulerUsage() != null) { - JobSchedulerUsage usage = systemUsage.getJobSchedulerUsage(); - if (usage.isFull()) { - final String logMessage = "Job Scheduler Store is Full (" + - usage.getPercentUsage() + "% of " + usage.getLimit() + - "). Stopping producer (" + messageSend.getProducerId() + - ") to prevent flooding of the job scheduler store." + - " See http://activemq.apache.org/producer-flow-control.html for more info"; - - long start = System.currentTimeMillis(); - long nextWarn = start; - while (!usage.waitForSpace(1000)) { - if (context.getStopping().get()) { - throw new IOException("Connection closed, send aborted."); - } - - long now = System.currentTimeMillis(); - if (now >= nextWarn) { - LOG.info("" + usage + ": " + logMessage + " (blocking for: " + (now - start) / 1000 + "s)"); - nextWarn = now + 30000l; - } - } - } - } - - if (repeat != 0 || cronStr != null && cronStr.length() > 0) { - // create a unique id - the original message could be sent - // lots of times - messageSend.setMessageId(new MessageId(this.producerId, this.messageIdGenerator.getNextSequenceId())); - } - - // Add the jobId as a property - messageSend.setProperty("scheduledJobId", id); - - // if this goes across a network - we don't want it rescheduled - messageSend.removeProperty(ScheduledMessage.AMQ_SCHEDULED_PERIOD); - messageSend.removeProperty(ScheduledMessage.AMQ_SCHEDULED_DELAY); - messageSend.removeProperty(ScheduledMessage.AMQ_SCHEDULED_REPEAT); - messageSend.removeProperty(ScheduledMessage.AMQ_SCHEDULED_CRON); - - if (messageSend.getTimestamp() > 0 && messageSend.getExpiration() > 0) { - - long oldExpiration = messageSend.getExpiration(); - long newTimeStamp = System.currentTimeMillis(); - long timeToLive = 0; - long oldTimestamp = messageSend.getTimestamp(); - - if (oldExpiration > 0) { - timeToLive = oldExpiration - oldTimestamp; - } - - long expiration = timeToLive + newTimeStamp; - - if (expiration > oldExpiration) { - if (timeToLive > 0 && expiration > 0) { - messageSend.setExpiration(expiration); - } - messageSend.setTimestamp(newTimeStamp); - LOG.debug("Set message {} timestamp from {} to {}", new Object[]{ messageSend.getMessageId(), oldTimestamp, newTimeStamp }); - } - } - - final ProducerBrokerExchange producerExchange = new ProducerBrokerExchange(); - producerExchange.setConnectionContext(context); - producerExchange.setMutable(true); - producerExchange.setProducerState(new ProducerState(new ProducerInfo())); - super.send(producerExchange, messageSend); - } catch (Exception e) { - LOG.error("Failed to send scheduled message {}", id, e); - } - } - - protected synchronized JobScheduler getInternalScheduler() throws Exception { - if (this.started.get()) { - if (this.scheduler == null && store != null) { - this.scheduler = store.getJobScheduler("JMS"); - this.scheduler.addListener(this); - this.scheduler.startDispatching(); - } - return this.scheduler; - } - return null; - } - - protected void sendScheduledJob(ConnectionContext context, Job job, ActiveMQDestination replyTo) throws Exception { - - org.apache.activemq.util.ByteSequence packet = new org.apache.activemq.util.ByteSequence(job.getPayload()); - try { - Message msg = (Message) this.wireFormat.unmarshal(packet); - msg.setOriginalTransactionId(null); - msg.setPersistent(false); - msg.setType(AdvisorySupport.ADIVSORY_MESSAGE_TYPE); - msg.setMessageId(new MessageId(this.producerId, this.messageIdGenerator.getNextSequenceId())); - msg.setDestination(replyTo); - msg.setResponseRequired(false); - msg.setProducerId(this.producerId); - - // Add the jobId as a property - msg.setProperty("scheduledJobId", job.getJobId()); - - final boolean originalFlowControl = context.isProducerFlowControl(); - final ProducerBrokerExchange producerExchange = new ProducerBrokerExchange(); - producerExchange.setConnectionContext(context); - producerExchange.setMutable(true); - producerExchange.setProducerState(new ProducerState(new ProducerInfo())); - try { - context.setProducerFlowControl(false); - this.next.send(producerExchange, msg); - } finally { - context.setProducerFlowControl(originalFlowControl); - } - } catch (Exception e) { - LOG.error("Failed to send scheduled message {}", job.getJobId(), e); - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/package.html b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/package.html deleted file mode 100644 index e4e8d6930..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/scheduler/package.html +++ /dev/null @@ -1,25 +0,0 @@ -package.html - - - - - -The Message Scheduler for delayed (or scheduled) message delivery - - - diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/AuditLog.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/AuditLog.class deleted file mode 100644 index dd0bdb8de..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/AuditLog.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/AuditLog.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/AuditLog.java deleted file mode 100644 index 7dfae57f7..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/AuditLog.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * 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.broker.util; - -public interface AuditLog { - - public void log(AuditLogEntry entry); - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/AuditLogEntry.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/AuditLogEntry.class deleted file mode 100644 index 778f8e40e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/AuditLogEntry.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/AuditLogEntry.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/AuditLogEntry.java deleted file mode 100644 index 6644310ed..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/AuditLogEntry.java +++ /dev/null @@ -1,79 +0,0 @@ -/** - * 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.broker.util; - -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; - -public class AuditLogEntry { - - protected String user = "anonymous"; - protected long timestamp; - protected String operation; - protected String remoteAddr; - - SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss,SSS"); - - protected Map parameters = new HashMap(); - - public String getUser() { - return user; - } - - public void setUser(String user) { - this.user = user; - } - - public long getTimestamp() { - return timestamp; - } - - public void setTimestamp(long timestamp) { - this.timestamp = timestamp; - } - - public String getFormattedTime() { - return formatter.format(new Date(timestamp)); - } - - public String getOperation() { - return operation; - } - - public void setOperation(String operation) { - this.operation = operation; - } - - public String getRemoteAddr() { - return remoteAddr; - } - - public void setRemoteAddr(String remoteAddr) { - this.remoteAddr = remoteAddr; - } - - public Map getParameters() { - return parameters; - } - - public void setParameters(Map parameters) { - this.parameters = parameters; - } -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/AuditLogFactory.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/AuditLogFactory.class deleted file mode 100644 index 7cf4c88d3..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/AuditLogFactory.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/AuditLogFactory.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/AuditLogFactory.java deleted file mode 100644 index 5f68f7bfa..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/AuditLogFactory.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * 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.broker.util; - -import java.util.List; - -public interface AuditLogFactory { - - public List getAuditLogs(); - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/AuditLogService.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/AuditLogService.class deleted file mode 100644 index f81307b12..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/AuditLogService.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/AuditLogService.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/AuditLogService.java deleted file mode 100644 index 2052feade..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/AuditLogService.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * 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.broker.util; - -public class AuditLogService { - - private AuditLogFactory factory; - - private static AuditLogService auditLog; - - public static AuditLogService getAuditLog() { - if (auditLog == null) { - auditLog = new AuditLogService(); - } - return auditLog; - } - - private AuditLogService() { - factory = new DefaultAuditLogFactory(); - } - - public void log(AuditLogEntry entry) { - for (AuditLog log : factory.getAuditLogs()) { - log.log(entry); - } - } - - public void setFactory(AuditLogFactory factory) { - this.factory = factory; - } -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/DefaultAuditLog.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/DefaultAuditLog.class deleted file mode 100644 index c92787da4..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/DefaultAuditLog.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/DefaultAuditLog.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/DefaultAuditLog.java deleted file mode 100644 index d047fc018..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/DefaultAuditLog.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * 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.broker.util; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class DefaultAuditLog implements AuditLog { - - private static final Logger LOG = LoggerFactory.getLogger("org.apache.activemq.audit"); - - public void log(AuditLogEntry entry) { - LOG.info(entry.toString()); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/DefaultAuditLogFactory.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/DefaultAuditLogFactory.class deleted file mode 100644 index 47c899a40..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/DefaultAuditLogFactory.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/DefaultAuditLogFactory.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/DefaultAuditLogFactory.java deleted file mode 100644 index 19cd150b6..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/DefaultAuditLogFactory.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * 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.broker.util; - -import java.util.ArrayList; -import java.util.List; -import java.util.ServiceLoader; - -public class DefaultAuditLogFactory implements AuditLogFactory { - - private ArrayList auditLogs = new ArrayList(); - - public DefaultAuditLogFactory() { - ServiceLoader logs = ServiceLoader.load(AuditLog.class); - - for (AuditLog log : logs) { - auditLogs.add(log); - } - - // add default audit log if non was found - if (auditLogs.size() == 0) { - auditLogs.add(new DefaultAuditLog()); - } - } - - @Override - public List getAuditLogs() { - return auditLogs; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/DestinationPathSeparatorBroker.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/DestinationPathSeparatorBroker.class deleted file mode 100644 index aaa45d77a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/DestinationPathSeparatorBroker.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/DestinationPathSeparatorBroker.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/DestinationPathSeparatorBroker.java deleted file mode 100644 index 7e3be2d73..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/DestinationPathSeparatorBroker.java +++ /dev/null @@ -1,134 +0,0 @@ -/** - * 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.broker.util; - -import org.apache.activemq.broker.BrokerPluginSupport; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.ConsumerBrokerExchange; -import org.apache.activemq.broker.ProducerBrokerExchange; -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.command.*; -import org.apache.activemq.filter.DestinationPath; - -import java.util.ArrayList; -import java.util.List; -import java.util.StringTokenizer; - -/** - * @org.apache.xbean.XBean element="destinationPathSeparatorPlugin" - */ - -public class DestinationPathSeparatorBroker extends BrokerPluginSupport { - - String pathSeparator = "/"; - - protected ActiveMQDestination convertDestination(ActiveMQDestination destination) { - if (destination != null && destination.getPhysicalName().contains(pathSeparator)) { - List l = new ArrayList(); - StringTokenizer iter = new StringTokenizer(destination.getPhysicalName(), pathSeparator); - while (iter.hasMoreTokens()) { - String name = iter.nextToken().trim(); - if (name.length() == 0) { - continue; - } - l.add(name); - } - - String newName = DestinationPath.toString(l.toArray(new String[l.size()])); - return ActiveMQDestination.createDestination(newName, destination.getDestinationType()); - } else { - return destination; - } - } - - - @Override - public void acknowledge(ConsumerBrokerExchange consumerExchange, MessageAck ack) throws Exception { - ack.setDestination(convertDestination(ack.getDestination())); - super.acknowledge(consumerExchange, ack); - } - - @Override - public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { - info.setDestination(convertDestination(info.getDestination())); - return super.addConsumer(context, info); - } - - @Override - public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception { - info.setDestination(convertDestination(info.getDestination())); - super.addProducer(context, info); - } - - @Override - public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { - info.setDestination(convertDestination(info.getDestination())); - super.removeConsumer(context, info); - } - - @Override - public void removeProducer(ConnectionContext context, ProducerInfo info) throws Exception { - info.setDestination(convertDestination(info.getDestination())); - super.removeProducer(context, info); - } - - @Override - public void send(ProducerBrokerExchange producerExchange, Message messageSend) throws Exception { - messageSend.setDestination(convertDestination(messageSend.getDestination())); - super.send(producerExchange, messageSend); - } - - @Override - public Destination addDestination(ConnectionContext context, ActiveMQDestination destination, boolean createIfTemporary) throws Exception { - return super.addDestination(context, convertDestination(destination), createIfTemporary); - } - - @Override - public void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout) throws Exception { - super.removeDestination(context, convertDestination(destination), timeout); - } - - @Override - public void addDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception { - info.setDestination(convertDestination(info.getDestination())); - super.addDestinationInfo(context, info); - } - - @Override - public void removeDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception { - info.setDestination(convertDestination(info.getDestination())); - super.removeDestinationInfo(context, info); - } - - @Override - public void processConsumerControl(ConsumerBrokerExchange consumerExchange, ConsumerControl control) { - control.setDestination(convertDestination(control.getDestination())); - super.processConsumerControl(consumerExchange, control); - } - - @Override - public Response messagePull(ConnectionContext context, MessagePull pull) throws Exception { - pull.setDestination(convertDestination(pull.getDestination())); - return super.messagePull(context, pull); - } - - public void setPathSeparator(String pathSeparator) { - this.pathSeparator = pathSeparator; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/InsertionCountList.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/InsertionCountList.class deleted file mode 100644 index 01bde9ad8..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/InsertionCountList.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/InsertionCountList.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/InsertionCountList.java deleted file mode 100644 index 1227baa3e..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/InsertionCountList.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * 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.broker.util; - -import java.util.AbstractList; - -public class InsertionCountList extends AbstractList { - int size = 0; - - @Override - public void add(int index, T element) { - size++; - } - - @Override - public int size() { - return size; - } - - @Override - public T get(int index) { - return null; - } -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/JMXAuditLogEntry.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/JMXAuditLogEntry.class deleted file mode 100644 index 3aadd2b2a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/JMXAuditLogEntry.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/JMXAuditLogEntry.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/JMXAuditLogEntry.java deleted file mode 100644 index 42517569c..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/JMXAuditLogEntry.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * 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.broker.util; - -import java.util.Arrays; - -public class JMXAuditLogEntry extends AuditLogEntry { - - @Override - public String toString() { - return user.trim() + " called " + operation + Arrays.toString((Object[])parameters.get("arguments")) + " at " + getFormattedTime(); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/LoggingBrokerPlugin.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/LoggingBrokerPlugin.class deleted file mode 100644 index 9d296d4cb..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/LoggingBrokerPlugin.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/LoggingBrokerPlugin.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/LoggingBrokerPlugin.java deleted file mode 100644 index f21589af0..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/LoggingBrokerPlugin.java +++ /dev/null @@ -1,624 +0,0 @@ -/** - * 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.broker.util; - -import java.util.Set; - -import javax.annotation.PostConstruct; - -import org.apache.activemq.broker.BrokerPluginSupport; -import org.apache.activemq.broker.Connection; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.ConsumerBrokerExchange; -import org.apache.activemq.broker.ProducerBrokerExchange; -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.command.*; -import org.apache.activemq.usage.Usage; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * A simple Broker intercepter which allows you to enable/disable logging. - * - * @org.apache.xbean.XBean - */ -public class LoggingBrokerPlugin extends BrokerPluginSupport { - - private static final Logger LOG = LoggerFactory.getLogger(LoggingBrokerPlugin.class); - - private boolean logAll = false; - private boolean logMessageEvents = false; - private boolean logConnectionEvents = true; - private boolean logSessionEvents = true; - private boolean logTransactionEvents = false; - private boolean logConsumerEvents = false; - private boolean logProducerEvents = false; - private boolean logInternalEvents = false; - private boolean perDestinationLogger = false; - - /** - * JSR-250 callback wrapper; converts checked exceptions to runtime exceptions - * - * delegates to afterPropertiesSet, done to prevent backwards incompatible signature change - */ - @PostConstruct - private void postConstruct() { - try { - afterPropertiesSet(); - } catch (Exception ex) { - throw new RuntimeException(ex); - } - } - - /** - * @throws Exception - * @org.apache.xbean.InitMethod - */ - public void afterPropertiesSet() throws Exception { - LOG.info("Created LoggingBrokerPlugin: {}", this.toString()); - } - - public boolean isLogAll() { - return logAll; - } - - /** - * Logger all Events that go through the Plugin - */ - public void setLogAll(boolean logAll) { - this.logAll = logAll; - } - - public boolean isLogMessageEvents() { - return logMessageEvents; - } - - /** - * Logger Events that are related to message processing - */ - public void setLogMessageEvents(boolean logMessageEvents) { - this.logMessageEvents = logMessageEvents; - } - - public boolean isLogConnectionEvents() { - return logConnectionEvents; - } - - /** - * Logger Events that are related to connections - */ - public void setLogConnectionEvents(boolean logConnectionEvents) { - this.logConnectionEvents = logConnectionEvents; - } - - public boolean isLogSessionEvents() { - return logSessionEvents; - } - - /** - * Logger Events that are related to sessions - */ - public void setLogSessionEvents(boolean logSessionEvents) { - this.logSessionEvents = logSessionEvents; - } - - public boolean isLogTransactionEvents() { - return logTransactionEvents; - } - - /** - * Logger Events that are related to transaction processing - */ - public void setLogTransactionEvents(boolean logTransactionEvents) { - this.logTransactionEvents = logTransactionEvents; - } - - public boolean isLogConsumerEvents() { - return logConsumerEvents; - } - - /** - * Logger Events that are related to Consumers - */ - public void setLogConsumerEvents(boolean logConsumerEvents) { - this.logConsumerEvents = logConsumerEvents; - } - - public boolean isLogProducerEvents() { - return logProducerEvents; - } - - /** - * Logger Events that are related to Producers - */ - public void setLogProducerEvents(boolean logProducerEvents) { - this.logProducerEvents = logProducerEvents; - } - - public boolean isLogInternalEvents() { - return logInternalEvents; - } - - /** - * Logger Events that are normally internal to the broker - */ - public void setLogInternalEvents(boolean logInternalEvents) { - this.logInternalEvents = logInternalEvents; - } - - @Override - public void acknowledge(ConsumerBrokerExchange consumerExchange, MessageAck ack) throws Exception { - if (isLogAll() || isLogConsumerEvents()) { - LOG.info("Acknowledging message for client ID: {}{}", consumerExchange.getConnectionContext().getClientId(), (ack.getMessageCount() == 1 ? ", " + ack.getLastMessageId() : "")); - if (ack.getMessageCount() > 1) { - LOG.trace("Message count: {}, First Message Id: {}, Last Message Id: {}", new Object[]{ ack.getMessageCount(), ack.getFirstMessageId(), ack.getLastMessageId() }); - } - } - super.acknowledge(consumerExchange, ack); - } - - @Override - public Response messagePull(ConnectionContext context, MessagePull pull) throws Exception { - if (isLogAll() || isLogConsumerEvents()) { - LOG.info("Message Pull from: {} on {}", context.getClientId(), pull.getDestination().getPhysicalName()); - } - return super.messagePull(context, pull); - } - - @Override - public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception { - if (isLogAll() || isLogConnectionEvents()) { - LOG.info("Adding Connection: {}", info); - } - super.addConnection(context, info); - } - - @Override - public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { - if (isLogAll() || isLogConsumerEvents()) { - LOG.info("Adding Consumer: {}", info); - } - return super.addConsumer(context, info); - } - - @Override - public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception { - if (isLogAll() || isLogProducerEvents()) { - LOG.info("Adding Producer: {}", info); - } - super.addProducer(context, info); - } - - @Override - public void commitTransaction(ConnectionContext context, TransactionId xid, boolean onePhase) throws Exception { - if (isLogAll() || isLogTransactionEvents()) { - LOG.info("Committing transaction: {}", xid.getTransactionKey()); - } - super.commitTransaction(context, xid, onePhase); - } - - @Override - public void removeSubscription(ConnectionContext context, RemoveSubscriptionInfo info) throws Exception { - if (isLogAll() || isLogConsumerEvents()) { - LOG.info("Removing subscription: {}", info); - } - super.removeSubscription(context, info); - } - - @Override - public TransactionId[] getPreparedTransactions(ConnectionContext context) throws Exception { - - TransactionId[] result = super.getPreparedTransactions(context); - if ((isLogAll() || isLogTransactionEvents()) && result != null) { - StringBuffer tids = new StringBuffer(); - for (TransactionId tid : result) { - if (tids.length() > 0) { - tids.append(", "); - } - tids.append(tid.getTransactionKey()); - } - LOG.info("Prepared transactions: {}", tids); - } - return result; - } - - @Override - public int prepareTransaction(ConnectionContext context, TransactionId xid) throws Exception { - if (isLogAll() || isLogTransactionEvents()) { - LOG.info("Preparing transaction: {}", xid.getTransactionKey()); - } - return super.prepareTransaction(context, xid); - } - - @Override - public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception { - if (isLogAll() || isLogConnectionEvents()) { - LOG.info("Removing Connection: {}", info); - } - super.removeConnection(context, info, error); - } - - @Override - public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { - if (isLogAll() || isLogConsumerEvents()) { - LOG.info("Removing Consumer: {}", info); - } - super.removeConsumer(context, info); - } - - @Override - public void removeProducer(ConnectionContext context, ProducerInfo info) throws Exception { - if (isLogAll() || isLogProducerEvents()) { - LOG.info("Removing Producer: {}", info); - } - super.removeProducer(context, info); - } - - @Override - public void rollbackTransaction(ConnectionContext context, TransactionId xid) throws Exception { - if (isLogAll() || isLogTransactionEvents()) { - LOG.info("Rolling back Transaction: {}", xid.getTransactionKey()); - } - super.rollbackTransaction(context, xid); - } - - @Override - public void send(ProducerBrokerExchange producerExchange, Message messageSend) throws Exception { - if (isLogAll() || isLogProducerEvents()) { - logSend(messageSend.copy()); - } - super.send(producerExchange, messageSend); - } - - private void logSend(Message copy) { - Logger perDestinationsLogger = LOG; - if (isPerDestinationLogger()) { - ActiveMQDestination destination = copy.getDestination(); - perDestinationsLogger = LoggerFactory.getLogger(LOG.getName() + - "." + destination.getDestinationTypeAsString() + "." + destination.getPhysicalName()); - } - perDestinationsLogger.info("Sending message: {}", copy); - } - - @Override - public void beginTransaction(ConnectionContext context, TransactionId xid) throws Exception { - if (isLogAll() || isLogTransactionEvents()) { - LOG.info("Beginning transaction: {}", xid.getTransactionKey()); - } - super.beginTransaction(context, xid); - } - - @Override - public void forgetTransaction(ConnectionContext context, TransactionId transactionId) throws Exception { - if (isLogAll() || isLogTransactionEvents()) { - LOG.info("Forgetting transaction: {}", transactionId.getTransactionKey()); - } - super.forgetTransaction(context, transactionId); - } - - @Override - public Connection[] getClients() throws Exception { - Connection[] result = super.getClients(); - - if (isLogAll() || isLogInternalEvents()) { - if (result == null) { - LOG.info("Get Clients returned empty list."); - } else { - StringBuffer cids = new StringBuffer(); - for (Connection c : result) { - cids.append(cids.length() > 0 ? ", " : ""); - cids.append(c.getConnectionId()); - } - LOG.info("Connected clients: {}", cids); - } - } - return super.getClients(); - } - - @Override - public org.apache.activemq.broker.region.Destination addDestination(ConnectionContext context, - ActiveMQDestination destination, boolean create) throws Exception { - if (isLogAll() || isLogInternalEvents()) { - LOG.info("Adding destination: {}:{}", destination.getDestinationTypeAsString(), destination.getPhysicalName()); - } - return super.addDestination(context, destination, create); - } - - @Override - public void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout) - throws Exception { - if (isLogAll() || isLogInternalEvents()) { - LOG.info("Removing destination: {}:{}", destination.getDestinationTypeAsString(), destination.getPhysicalName()); - } - super.removeDestination(context, destination, timeout); - } - - @Override - public ActiveMQDestination[] getDestinations() throws Exception { - ActiveMQDestination[] result = super.getDestinations(); - if (isLogAll() || isLogInternalEvents()) { - if (result == null) { - LOG.info("Get Destinations returned empty list."); - } else { - StringBuffer destinations = new StringBuffer(); - for (ActiveMQDestination dest : result) { - destinations.append(destinations.length() > 0 ? ", " : ""); - destinations.append(dest.getPhysicalName()); - } - LOG.info("Get Destinations: {}", destinations); - } - } - return result; - } - - @Override - public void start() throws Exception { - if (isLogAll() || isLogInternalEvents()) { - LOG.info("Starting {}", getBrokerName()); - } - super.start(); - } - - @Override - public void stop() throws Exception { - if (isLogAll() || isLogInternalEvents()) { - LOG.info("Stopping {}", getBrokerName()); - } - super.stop(); - } - - @Override - public void addSession(ConnectionContext context, SessionInfo info) throws Exception { - if (isLogAll() || isLogSessionEvents()) { - LOG.info("Adding Session: {}", info); - } - super.addSession(context, info); - } - - @Override - public void removeSession(ConnectionContext context, SessionInfo info) throws Exception { - if (isLogAll() || isLogSessionEvents()) { - LOG.info("Removing Session: {}", info); - } - super.removeSession(context, info); - } - - @Override - public void addBroker(Connection connection, BrokerInfo info) { - if (isLogAll() || isLogInternalEvents()) { - LOG.info("Adding Broker {}", info.getBrokerName()); - } - super.addBroker(connection, info); - } - - @Override - public void removeBroker(Connection connection, BrokerInfo info) { - if (isLogAll() || isLogInternalEvents()) { - LOG.info("Removing Broker {}", info.getBrokerName()); - } - super.removeBroker(connection, info); - } - - @Override - public BrokerInfo[] getPeerBrokerInfos() { - BrokerInfo[] result = super.getPeerBrokerInfos(); - if (isLogAll() || isLogInternalEvents()) { - if (result == null) { - LOG.info("Get Peer Broker Infos returned empty list."); - } else { - StringBuffer peers = new StringBuffer(); - for (BrokerInfo bi : result) { - peers.append(peers.length() > 0 ? ", " : ""); - peers.append(bi.getBrokerName()); - } - LOG.info("Get Peer Broker Infos: {}", peers); - } - } - return result; - } - - @Override - public void preProcessDispatch(MessageDispatch messageDispatch) { - if (isLogAll() || isLogInternalEvents() || isLogConsumerEvents()) { - LOG.info("preProcessDispatch: {}", messageDispatch); - } - super.preProcessDispatch(messageDispatch); - } - - @Override - public void postProcessDispatch(MessageDispatch messageDispatch) { - if (isLogAll() || isLogInternalEvents() || isLogConsumerEvents()) { - LOG.info("postProcessDispatch: {}", messageDispatch); - } - super.postProcessDispatch(messageDispatch); - } - - @Override - public void processDispatchNotification(MessageDispatchNotification messageDispatchNotification) throws Exception { - if (isLogAll() || isLogInternalEvents() || isLogConsumerEvents()) { - LOG.info("ProcessDispatchNotification: {}", messageDispatchNotification); - } - super.processDispatchNotification(messageDispatchNotification); - } - - @Override - public Set getDurableDestinations() { - Set result = super.getDurableDestinations(); - if (isLogAll() || isLogInternalEvents()) { - if (result == null) { - LOG.info("Get Durable Destinations returned empty list."); - } else { - StringBuffer destinations = new StringBuffer(); - for (ActiveMQDestination dest : result) { - destinations.append(destinations.length() > 0 ? ", " : ""); - destinations.append(dest.getPhysicalName()); - } - LOG.info("Get Durable Destinations: {}", destinations); - } - } - return result; - } - - @Override - public void addDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception { - if (isLogAll() || isLogInternalEvents()) { - LOG.info("Adding destination info: {}", info); - } - super.addDestinationInfo(context, info); - } - - @Override - public void removeDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception { - if (isLogAll() || isLogInternalEvents()) { - LOG.info("Removing destination info: {}", info); - } - super.removeDestinationInfo(context, info); - } - - @Override - public void messageExpired(ConnectionContext context, MessageReference message, Subscription subscription) { - if (isLogAll() || isLogInternalEvents()) { - String msg = "Unable to display message."; - - msg = message.getMessage().toString(); - - LOG.info("Message has expired: {}", msg); - } - super.messageExpired(context, message, subscription); - } - - @Override - public boolean sendToDeadLetterQueue(ConnectionContext context, MessageReference messageReference, - Subscription subscription, Throwable poisonCause) { - if (isLogAll() || isLogInternalEvents()) { - String msg = "Unable to display message."; - - msg = messageReference.getMessage().toString(); - - LOG.info("Sending to DLQ: {}", msg); - } - return super.sendToDeadLetterQueue(context, messageReference, subscription, poisonCause); - } - - @Override - public void fastProducer(ConnectionContext context, ProducerInfo producerInfo,ActiveMQDestination destination) { - if (isLogAll() || isLogProducerEvents() || isLogInternalEvents()) { - LOG.info("Fast Producer: {}", producerInfo); - } - super.fastProducer(context, producerInfo, destination); - } - - @Override - public void isFull(ConnectionContext context, Destination destination, Usage usage) { - if (isLogAll() || isLogProducerEvents() || isLogInternalEvents()) { - LOG.info("Destination is full: {}", destination.getName()); - } - super.isFull(context, destination, usage); - } - - @Override - public void messageConsumed(ConnectionContext context, MessageReference messageReference) { - if (isLogAll() || isLogConsumerEvents() || isLogInternalEvents()) { - String msg = "Unable to display message."; - - msg = messageReference.getMessage().toString(); - - LOG.info("Message consumed: {}", msg); - } - super.messageConsumed(context, messageReference); - } - - @Override - public void messageDelivered(ConnectionContext context, MessageReference messageReference) { - if (isLogAll() || isLogConsumerEvents() || isLogInternalEvents()) { - String msg = "Unable to display message."; - - msg = messageReference.getMessage().toString(); - - LOG.info("Message delivered: {}", msg); - } - super.messageDelivered(context, messageReference); - } - - @Override - public void messageDiscarded(ConnectionContext context, Subscription sub, MessageReference messageReference) { - if (isLogAll() || isLogInternalEvents()) { - String msg = "Unable to display message."; - - msg = messageReference.getMessage().toString(); - - LOG.info("Message discarded: {}", msg); - } - super.messageDiscarded(context, sub, messageReference); - } - - @Override - public void slowConsumer(ConnectionContext context, Destination destination, Subscription subs) { - if (isLogAll() || isLogConsumerEvents() || isLogInternalEvents()) { - LOG.info("Detected slow consumer on {}", destination.getName()); - StringBuffer buf = new StringBuffer("Connection("); - buf.append(subs.getConsumerInfo().getConsumerId().getConnectionId()); - buf.append(") Session("); - buf.append(subs.getConsumerInfo().getConsumerId().getSessionId()); - buf.append(")"); - LOG.info(buf.toString()); - } - super.slowConsumer(context, destination, subs); - } - - @Override - public void nowMasterBroker() { - if (isLogAll() || isLogInternalEvents()) { - LOG.info("Is now the master broker: {}", getBrokerName()); - } - super.nowMasterBroker(); - } - - @Override - public String toString() { - StringBuffer buf = new StringBuffer(); - buf.append("LoggingBrokerPlugin("); - buf.append("logAll="); - buf.append(isLogAll()); - buf.append(", logConnectionEvents="); - buf.append(isLogConnectionEvents()); - buf.append(", logSessionEvents="); - buf.append(isLogSessionEvents()); - buf.append(", logConsumerEvents="); - buf.append(isLogConsumerEvents()); - buf.append(", logProducerEvents="); - buf.append(isLogProducerEvents()); - buf.append(", logMessageEvents="); - buf.append(isLogMessageEvents()); - buf.append(", logTransactionEvents="); - buf.append(isLogTransactionEvents()); - buf.append(", logInternalEvents="); - buf.append(isLogInternalEvents()); - buf.append(")"); - return buf.toString(); - } - - public void setPerDestinationLogger(boolean perDestinationLogger) { - this.perDestinationLogger = perDestinationLogger; - } - - public boolean isPerDestinationLogger() { - return perDestinationLogger; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/MulticastTraceBrokerPlugin.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/MulticastTraceBrokerPlugin.class deleted file mode 100644 index cb83738d1..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/MulticastTraceBrokerPlugin.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/MulticastTraceBrokerPlugin.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/MulticastTraceBrokerPlugin.java deleted file mode 100644 index 07152a3ae..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/MulticastTraceBrokerPlugin.java +++ /dev/null @@ -1,61 +0,0 @@ -/** - * 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.broker.util; - -import java.io.IOException; -import java.net.DatagramSocket; -import java.net.MulticastSocket; -import java.net.URI; -import java.net.URISyntaxException; - -/** - * A Broker interceptor which allows you to trace all operations to a Multicast - * socket. - * - * @org.apache.xbean.XBean - * - * - */ -public class MulticastTraceBrokerPlugin extends UDPTraceBrokerPlugin { - - private int timeToLive = 1; - - public MulticastTraceBrokerPlugin() { - try { - destination = new URI("multicast://224.1.2.3:61616"); - } catch (URISyntaxException wontHappen) { - } - } - - protected DatagramSocket createSocket() throws IOException { - MulticastSocket s = new MulticastSocket(); - s.setSendBufferSize(maxTraceDatagramSize); - s.setBroadcast(broadcast); - s.setLoopbackMode(true); - s.setTimeToLive(timeToLive); - return s; - } - - public int getTimeToLive() { - return timeToLive; - } - - public void setTimeToLive(int timeToLive) { - this.timeToLive = timeToLive; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/RedeliveryPlugin.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/RedeliveryPlugin.class deleted file mode 100644 index d000abb2f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/RedeliveryPlugin.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/RedeliveryPlugin.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/RedeliveryPlugin.java deleted file mode 100644 index 0245ffbab..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/RedeliveryPlugin.java +++ /dev/null @@ -1,210 +0,0 @@ -/** - * 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.broker.util; - -import java.io.IOException; - -import org.apache.activemq.RedeliveryPolicy; -import org.apache.activemq.ScheduledMessage; -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.BrokerPluginSupport; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.ProducerBrokerExchange; -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.broker.region.policy.RedeliveryPolicyMap; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ActiveMQQueue; -import org.apache.activemq.command.ActiveMQTopic; -import org.apache.activemq.command.Message; -import org.apache.activemq.command.ProducerInfo; -import org.apache.activemq.filter.AnyDestination; -import org.apache.activemq.state.ProducerState; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Replace regular DLQ handling with redelivery via a resend to the original destination - * after a delay - * A destination matching RedeliveryPolicy controls the quantity and delay for re-sends - * If there is no matching policy or an existing policy limit is exceeded by default - * regular DLQ processing resumes. This is controlled via sendToDlqIfMaxRetriesExceeded - * and fallbackToDeadLetter - * - * @org.apache.xbean.XBean element="redeliveryPlugin" - */ -public class RedeliveryPlugin extends BrokerPluginSupport { - private static final Logger LOG = LoggerFactory.getLogger(RedeliveryPlugin.class); - public static final String REDELIVERY_DELAY = "redeliveryDelay"; - - RedeliveryPolicyMap redeliveryPolicyMap = new RedeliveryPolicyMap(); - boolean sendToDlqIfMaxRetriesExceeded = true; - private boolean fallbackToDeadLetter = true; - - @Override - public Broker installPlugin(Broker broker) throws Exception { - if (!broker.getBrokerService().isSchedulerSupport()) { - throw new IllegalStateException("RedeliveryPlugin requires schedulerSupport=true on the broker"); - } - validatePolicyDelay(1000); - return super.installPlugin(broker); - } - - /* - * sending to dlq is called as part of a poison ack processing, before the message is acknowledged and removed - * by the destination so a delay is vital to avoid resending before it has been consumed - */ - private void validatePolicyDelay(long limit) { - final ActiveMQDestination matchAll = new AnyDestination(new ActiveMQDestination[]{new ActiveMQQueue(">"), new ActiveMQTopic(">")}); - for (Object entry : redeliveryPolicyMap.get(matchAll)) { - RedeliveryPolicy redeliveryPolicy = (RedeliveryPolicy) entry; - validateLimit(limit, redeliveryPolicy); - } - RedeliveryPolicy defaultEntry = redeliveryPolicyMap.getDefaultEntry(); - if (defaultEntry != null) { - validateLimit(limit, defaultEntry); - } - } - - private void validateLimit(long limit, RedeliveryPolicy redeliveryPolicy) { - if (redeliveryPolicy.getInitialRedeliveryDelay() < limit) { - throw new IllegalStateException("RedeliveryPolicy initialRedeliveryDelay must exceed: " + limit + ". " + redeliveryPolicy); - } - if (redeliveryPolicy.getRedeliveryDelay() < limit) { - throw new IllegalStateException("RedeliveryPolicy redeliveryDelay must exceed: " + limit + ". " + redeliveryPolicy); - } - } - - public RedeliveryPolicyMap getRedeliveryPolicyMap() { - return redeliveryPolicyMap; - } - - public void setRedeliveryPolicyMap(RedeliveryPolicyMap redeliveryPolicyMap) { - this.redeliveryPolicyMap = redeliveryPolicyMap; - } - - public boolean isSendToDlqIfMaxRetriesExceeded() { - return sendToDlqIfMaxRetriesExceeded; - } - - /** - * What to do if the maxretries on a matching redelivery policy is exceeded. - * when true, the region broker DLQ processing will be used via sendToDeadLetterQueue - * when false, there is no action - * @param sendToDlqIfMaxRetriesExceeded - */ - public void setSendToDlqIfMaxRetriesExceeded(boolean sendToDlqIfMaxRetriesExceeded) { - this.sendToDlqIfMaxRetriesExceeded = sendToDlqIfMaxRetriesExceeded; - } - - public boolean isFallbackToDeadLetter() { - return fallbackToDeadLetter; - } - - /** - * What to do if there is no matching redelivery policy for a destination. - * when true, the region broker DLQ processing will be used via sendToDeadLetterQueue - * when false, there is no action - * @param fallbackToDeadLetter - */ - public void setFallbackToDeadLetter(boolean fallbackToDeadLetter) { - this.fallbackToDeadLetter = fallbackToDeadLetter; - } - - @Override - public boolean sendToDeadLetterQueue(ConnectionContext context, MessageReference messageReference, Subscription subscription, Throwable poisonCause) { - if (messageReference.isExpired()) { - // there are two uses of sendToDeadLetterQueue, we are only interested in valid messages - return super.sendToDeadLetterQueue(context, messageReference, subscription, poisonCause); - } else { - try { - Destination regionDestination = (Destination) messageReference.getRegionDestination(); - final RedeliveryPolicy redeliveryPolicy = redeliveryPolicyMap.getEntryFor(regionDestination.getActiveMQDestination()); - if (redeliveryPolicy != null) { - final int maximumRedeliveries = redeliveryPolicy.getMaximumRedeliveries(); - int redeliveryCount = messageReference.getRedeliveryCounter(); - if (RedeliveryPolicy.NO_MAXIMUM_REDELIVERIES == maximumRedeliveries || redeliveryCount < maximumRedeliveries) { - - long delay = ( redeliveryCount == 0 ? - redeliveryPolicy.getInitialRedeliveryDelay() : - redeliveryPolicy.getNextRedeliveryDelay(getExistingDelay(messageReference))); - - scheduleRedelivery(context, messageReference, delay, ++redeliveryCount); - } else if (isSendToDlqIfMaxRetriesExceeded()) { - return super.sendToDeadLetterQueue(context, messageReference, subscription, poisonCause); - } else { - LOG.debug("Discarding message that exceeds max redelivery count({}), {}", maximumRedeliveries, messageReference.getMessageId()); - } - } else if (isFallbackToDeadLetter()) { - return super.sendToDeadLetterQueue(context, messageReference, subscription, poisonCause); - } else { - LOG.debug("Ignoring dlq request for: {}, RedeliveryPolicy not found (and no fallback) for: {}", messageReference.getMessageId(), regionDestination.getActiveMQDestination()); - } - - return false; - } catch (Exception exception) { - // abort the ack, will be effective if client use transactions or individual ack with sync send - RuntimeException toThrow = new RuntimeException("Failed to schedule redelivery for: " + messageReference.getMessageId(), exception); - LOG.error(toThrow.toString(), exception); - throw toThrow; - } - } - } - - private void scheduleRedelivery(ConnectionContext context, MessageReference messageReference, long delay, int redeliveryCount) throws Exception { - if (LOG.isTraceEnabled()) { - Destination regionDestination = (Destination) messageReference.getRegionDestination(); - LOG.trace("redelivery #{} of: {} with delay: {}, dest: {}", new Object[]{ - redeliveryCount, messageReference.getMessageId(), delay, regionDestination.getActiveMQDestination() - }); - } - final Message old = messageReference.getMessage(); - Message message = old.copy(); - - message.setTransactionId(null); - message.setMemoryUsage(null); - message.setMarshalledProperties(null); - message.removeProperty(ScheduledMessage.AMQ_SCHEDULED_ID); - - message.setProperty(REDELIVERY_DELAY, delay); - message.setProperty(ScheduledMessage.AMQ_SCHEDULED_DELAY, delay); - message.setRedeliveryCounter(redeliveryCount); - - boolean originalFlowControl = context.isProducerFlowControl(); - try { - context.setProducerFlowControl(false); - ProducerInfo info = new ProducerInfo(); - ProducerState state = new ProducerState(info); - ProducerBrokerExchange producerExchange = new ProducerBrokerExchange(); - producerExchange.setProducerState(state); - producerExchange.setMutable(true); - producerExchange.setConnectionContext(context); - context.getBroker().send(producerExchange, message); - } finally { - context.setProducerFlowControl(originalFlowControl); - } - } - - private int getExistingDelay(MessageReference messageReference) throws IOException { - Object val = messageReference.getMessage().getProperty(REDELIVERY_DELAY); - if (val instanceof Long) { - return ((Long)val).intValue(); - } - return 0; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/TimeStampingBrokerPlugin.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/TimeStampingBrokerPlugin.class deleted file mode 100644 index 171bb6271..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/TimeStampingBrokerPlugin.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/TimeStampingBrokerPlugin.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/TimeStampingBrokerPlugin.java deleted file mode 100644 index af6128f64..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/TimeStampingBrokerPlugin.java +++ /dev/null @@ -1,156 +0,0 @@ -/** - * 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.broker.util; - -import org.apache.activemq.broker.BrokerPluginSupport; -import org.apache.activemq.broker.ProducerBrokerExchange; -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.broker.region.policy.DeadLetterStrategy; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ActiveMQMessage; -import org.apache.activemq.command.Message; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * A Broker interceptor which updates a JMS Client's timestamp on the message - * with a broker timestamp. Useful when the clocks on client machines are known - * to not be correct and you can only trust the time set on the broker machines. - * - * Enabling this plugin will break JMS compliance since the timestamp that the - * producer sees on the messages after as send() will be different from the - * timestamp the consumer will observe when he receives the message. This plugin - * is not enabled in the default ActiveMQ configuration. - * - * 2 new attributes have been added which will allow the administrator some override control - * over the expiration time for incoming messages: - * - * Attribute 'zeroExpirationOverride' can be used to apply an expiration - * time to incoming messages with no expiration defined (messages that would never expire) - * - * Attribute 'ttlCeiling' can be used to apply a limit to the expiration time - * - * @org.apache.xbean.XBean element="timeStampingBrokerPlugin" - * - * - */ -public class TimeStampingBrokerPlugin extends BrokerPluginSupport { - private static final Logger LOG = LoggerFactory.getLogger(TimeStampingBrokerPlugin.class); - /** - * variable which (when non-zero) is used to override - * the expiration date for messages that arrive with - * no expiration date set (in Milliseconds). - */ - long zeroExpirationOverride = 0; - - /** - * variable which (when non-zero) is used to limit - * the expiration date (in Milliseconds). - */ - long ttlCeiling = 0; - - /** - * If true, the plugin will not update timestamp to past values - * False by default - */ - boolean futureOnly = false; - - - /** - * if true, update timestamp even if message has passed through a network - * default false - */ - boolean processNetworkMessages = false; - - /** - * setter method for zeroExpirationOverride - */ - public void setZeroExpirationOverride(long ttl) - { - this.zeroExpirationOverride = ttl; - } - - /** - * setter method for ttlCeiling - */ - public void setTtlCeiling(long ttlCeiling) - { - this.ttlCeiling = ttlCeiling; - } - - public void setFutureOnly(boolean futureOnly) { - this.futureOnly = futureOnly; - } - - public void setProcessNetworkMessages(Boolean processNetworkMessages) { - this.processNetworkMessages = processNetworkMessages; - } - - @Override - public void send(ProducerBrokerExchange producerExchange, Message message) throws Exception { - - if (message.getTimestamp() > 0 && !isDestinationDLQ(message) && - (processNetworkMessages || (message.getBrokerPath() == null || message.getBrokerPath().length == 0))) { - // timestamp not been disabled and has not passed through a network or processNetworkMessages=true - - long oldExpiration = message.getExpiration(); - long newTimeStamp = System.currentTimeMillis(); - long timeToLive = zeroExpirationOverride; - long oldTimestamp = message.getTimestamp(); - if (oldExpiration > 0) { - timeToLive = oldExpiration - oldTimestamp; - } - if (timeToLive > 0 && ttlCeiling > 0 && timeToLive > ttlCeiling) { - timeToLive = ttlCeiling; - } - long expiration = timeToLive + newTimeStamp; - // In the scenario that the Broker is behind the clients we never want to set the - // Timestamp and Expiration in the past - if(!futureOnly || (expiration > oldExpiration)) { - if (timeToLive > 0 && expiration > 0) { - message.setExpiration(expiration); - } - message.setTimestamp(newTimeStamp); - LOG.debug("Set message {} timestamp from {} to {}", new Object[]{ message.getMessageId(), oldTimestamp, newTimeStamp }); - } - } - super.send(producerExchange, message); - } - - private boolean isDestinationDLQ(Message message) { - DeadLetterStrategy deadLetterStrategy; - Message tmp; - - Destination regionDestination = (Destination) message.getRegionDestination(); - if (message != null && regionDestination != null) { - deadLetterStrategy = regionDestination.getDeadLetterStrategy(); - if (deadLetterStrategy != null && message.getOriginalDestination() != null) { - // Cheap copy, since we only need two fields - tmp = new ActiveMQMessage(); - tmp.setDestination(message.getOriginalDestination()); - tmp.setRegionDestination(regionDestination); - - // Determine if we are headed for a DLQ - ActiveMQDestination deadLetterDestination = deadLetterStrategy.getDeadLetterQueueFor(tmp, null); - if (deadLetterDestination.equals(message.getDestination())) { - return true; - } - } - } - return false; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/TraceBrokerPathPlugin.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/TraceBrokerPathPlugin.class deleted file mode 100644 index 174a41dfd..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/TraceBrokerPathPlugin.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/TraceBrokerPathPlugin.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/TraceBrokerPathPlugin.java deleted file mode 100644 index e593aef3f..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/TraceBrokerPathPlugin.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * 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.broker.util; - -import java.io.IOException; - -import org.apache.activemq.broker.BrokerPluginSupport; -import org.apache.activemq.command.MessageDispatch; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * The TraceBrokerPathPlugin can be used in a network of Brokers. Each Broker - * that has the plugin configured, will add it's brokerName to the content - * of a JMS Property. If all Brokers have this property enabled, the path the - * message actually took through the network can be seen in the defined property. - * - * @org.apache.xbean.XBean element="traceBrokerPathPlugin" - * - */ -@SuppressWarnings("unchecked") -public class TraceBrokerPathPlugin extends BrokerPluginSupport { - - private String stampProperty = "BrokerPath"; - private static final Logger LOG = LoggerFactory.getLogger(TraceBrokerPathPlugin.class); - - public String getStampProperty() { - return stampProperty; - } - - public void setStampProperty(String stampProperty) { - if (stampProperty != null && !stampProperty.isEmpty()) { - this.stampProperty = stampProperty; - } - } - - public void preProcessDispatch(MessageDispatch messageDispatch) { - try { - if (messageDispatch != null && messageDispatch.getMessage() != null) { - String brokerStamp = (String)messageDispatch.getMessage().getProperty(getStampProperty()); - if (brokerStamp == null) { - brokerStamp = getBrokerName(); - } else { - brokerStamp += "," + getBrokerName(); - } - messageDispatch.getMessage().setProperty(getStampProperty(), brokerStamp); - messageDispatch.getMessage().setMarshalledProperties(null); - } - } catch (IOException ioe) { - LOG.warn("Setting broker property failed", ioe); - } - super.preProcessDispatch(messageDispatch); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/UDPTraceBrokerPlugin.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/UDPTraceBrokerPlugin.class deleted file mode 100644 index a5e2da16f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/UDPTraceBrokerPlugin.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/UDPTraceBrokerPlugin.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/UDPTraceBrokerPlugin.java deleted file mode 100644 index f023f5498..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/UDPTraceBrokerPlugin.java +++ /dev/null @@ -1,314 +0,0 @@ -/** - * 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.broker.util; - -import java.io.DataOutputStream; -import java.io.IOException; -import java.net.DatagramPacket; -import java.net.DatagramSocket; -import java.net.InetAddress; -import java.net.InetSocketAddress; -import java.net.SocketAddress; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.UnknownHostException; - -import org.apache.activemq.broker.BrokerPluginSupport; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.ConsumerBrokerExchange; -import org.apache.activemq.broker.ProducerBrokerExchange; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.BrokerId; -import org.apache.activemq.command.ConnectionInfo; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.command.DataStructure; -import org.apache.activemq.command.DestinationInfo; -import org.apache.activemq.command.JournalTrace; -import org.apache.activemq.command.Message; -import org.apache.activemq.command.MessageAck; -import org.apache.activemq.command.MessageDispatch; -import org.apache.activemq.command.MessageDispatchNotification; -import org.apache.activemq.command.MessagePull; -import org.apache.activemq.command.ProducerInfo; -import org.apache.activemq.command.RemoveSubscriptionInfo; -import org.apache.activemq.command.Response; -import org.apache.activemq.command.SessionInfo; -import org.apache.activemq.command.TransactionId; -import org.apache.activemq.command.TransactionInfo; -import org.apache.activemq.openwire.OpenWireFormatFactory; -import org.apache.activemq.util.ByteArrayOutputStream; -import org.apache.activemq.util.ByteSequence; -import org.apache.activemq.wireformat.WireFormat; -import org.apache.activemq.wireformat.WireFormatFactory; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * A Broker interceptor which allows you to trace all operations to a UDP - * socket. - * - * @org.apache.xbean.XBean element="udpTraceBrokerPlugin" - * - */ -public class UDPTraceBrokerPlugin extends BrokerPluginSupport { - - private static final Logger LOG = LoggerFactory.getLogger(UDPTraceBrokerPlugin.class); - protected WireFormat wireFormat; - protected WireFormatFactory wireFormatFactory; - protected int maxTraceDatagramSize = 1024 * 4; - protected URI destination; - protected DatagramSocket socket; - - protected BrokerId brokerId; - protected SocketAddress address; - protected boolean broadcast; - - public UDPTraceBrokerPlugin() { - try { - destination = new URI("udp://127.0.0.1:61616"); - } catch (URISyntaxException wontHappen) { - } - } - - public void start() throws Exception { - super.start(); - if (getWireFormat() == null) { - throw new IllegalArgumentException("Wireformat must be specifed."); - } - if (address == null) { - address = createSocketAddress(destination); - } - socket = createSocket(); - - brokerId = super.getBrokerId(); - trace(new JournalTrace("START")); - } - - protected DatagramSocket createSocket() throws IOException { - DatagramSocket s = new DatagramSocket(); - s.setSendBufferSize(maxTraceDatagramSize); - s.setBroadcast(broadcast); - return s; - } - - public void stop() throws Exception { - trace(new JournalTrace("STOP")); - socket.close(); - super.stop(); - } - - private void trace(DataStructure command) { - try { - - ByteArrayOutputStream baos = new ByteArrayOutputStream(maxTraceDatagramSize); - DataOutputStream out = new DataOutputStream(baos); - wireFormat.marshal(brokerId, out); - wireFormat.marshal(command, out); - out.close(); - ByteSequence sequence = baos.toByteSequence(); - DatagramPacket datagram = new DatagramPacket(sequence.getData(), sequence.getOffset(), sequence.getLength(), address); - socket.send(datagram); - - } catch (Throwable e) { - LOG.debug("Failed to trace: {}", command, e); - } - } - - public void send(ProducerBrokerExchange producerExchange, Message messageSend) throws Exception { - trace(messageSend); - super.send(producerExchange, messageSend); - } - - public void acknowledge(ConsumerBrokerExchange consumerExchange, MessageAck ack) throws Exception { - trace(ack); - super.acknowledge(consumerExchange, ack); - } - - public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception { - trace(info); - super.addConnection(context, info); - } - - public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { - trace(info); - return super.addConsumer(context, info); - } - - public void addDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception { - trace(info); - super.addDestinationInfo(context, info); - } - - public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception { - trace(info); - super.addProducer(context, info); - } - - public void addSession(ConnectionContext context, SessionInfo info) throws Exception { - trace(info); - super.addSession(context, info); - } - - public void beginTransaction(ConnectionContext context, TransactionId xid) throws Exception { - trace(new TransactionInfo(context.getConnectionId(), xid, TransactionInfo.BEGIN)); - super.beginTransaction(context, xid); - } - - public void commitTransaction(ConnectionContext context, TransactionId xid, boolean onePhase) throws Exception { - trace(new TransactionInfo(context.getConnectionId(), xid, onePhase ? TransactionInfo.COMMIT_ONE_PHASE : TransactionInfo.COMMIT_TWO_PHASE)); - super.commitTransaction(context, xid, onePhase); - } - - public void forgetTransaction(ConnectionContext context, TransactionId xid) throws Exception { - trace(new TransactionInfo(context.getConnectionId(), xid, TransactionInfo.FORGET)); - super.forgetTransaction(context, xid); - } - - public Response messagePull(ConnectionContext context, MessagePull pull) throws Exception { - trace(pull); - return super.messagePull(context, pull); - } - - public int prepareTransaction(ConnectionContext context, TransactionId xid) throws Exception { - trace(new TransactionInfo(context.getConnectionId(), xid, TransactionInfo.PREPARE)); - return super.prepareTransaction(context, xid); - } - - public void postProcessDispatch(MessageDispatch messageDispatch) { - trace(messageDispatch); - super.postProcessDispatch(messageDispatch); - } - - public void processDispatchNotification(MessageDispatchNotification messageDispatchNotification) throws Exception { - trace(messageDispatchNotification); - super.processDispatchNotification(messageDispatchNotification); - } - - public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception { - trace(info.createRemoveCommand()); - super.removeConnection(context, info, error); - } - - public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { - trace(info.createRemoveCommand()); - super.removeConsumer(context, info); - } - - public void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout) throws Exception { - super.removeDestination(context, destination, timeout); - } - - public void removeDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception { - trace(info); - super.removeDestinationInfo(context, info); - } - - public void removeProducer(ConnectionContext context, ProducerInfo info) throws Exception { - trace(info.createRemoveCommand()); - super.removeProducer(context, info); - } - - public void removeSession(ConnectionContext context, SessionInfo info) throws Exception { - trace(info.createRemoveCommand()); - super.removeSession(context, info); - } - - public void removeSubscription(ConnectionContext context, RemoveSubscriptionInfo info) throws Exception { - trace(info); - super.removeSubscription(context, info); - } - - public void rollbackTransaction(ConnectionContext context, TransactionId xid) throws Exception { - trace(new TransactionInfo(context.getConnectionId(), xid, TransactionInfo.ROLLBACK)); - super.rollbackTransaction(context, xid); - } - - public WireFormat getWireFormat() { - if (wireFormat == null) { - wireFormat = createWireFormat(); - } - return wireFormat; - } - - protected WireFormat createWireFormat() { - return getWireFormatFactory().createWireFormat(); - } - - public void setWireFormat(WireFormat wireFormat) { - this.wireFormat = wireFormat; - } - - public WireFormatFactory getWireFormatFactory() { - if (wireFormatFactory == null) { - wireFormatFactory = createWireFormatFactory(); - } - return wireFormatFactory; - } - - protected OpenWireFormatFactory createWireFormatFactory() { - OpenWireFormatFactory wf = new OpenWireFormatFactory(); - wf.setCacheEnabled(false); - wf.setVersion(1); - wf.setTightEncodingEnabled(true); - wf.setSizePrefixDisabled(true); - return wf; - } - - public void setWireFormatFactory(WireFormatFactory wireFormatFactory) { - this.wireFormatFactory = wireFormatFactory; - } - - protected SocketAddress createSocketAddress(URI location) throws UnknownHostException { - InetAddress a = InetAddress.getByName(location.getHost()); - int port = location.getPort(); - return new InetSocketAddress(a, port); - } - - public URI getDestination() { - return destination; - } - - public void setDestination(URI destination) { - this.destination = destination; - } - - public int getMaxTraceDatagramSize() { - return maxTraceDatagramSize; - } - - public void setMaxTraceDatagramSize(int maxTraceDatagramSize) { - this.maxTraceDatagramSize = maxTraceDatagramSize; - } - - public boolean isBroadcast() { - return broadcast; - } - - public void setBroadcast(boolean broadcast) { - this.broadcast = broadcast; - } - - public SocketAddress getAddress() { - return address; - } - - public void setAddress(SocketAddress address) { - this.address = address; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/package.html b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/package.html deleted file mode 100644 index 72c5da2a1..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/util/package.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - -Some utility Broker Plugins - - - diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/BrokerDestinationView.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/BrokerDestinationView.class deleted file mode 100644 index c045ecffd..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/BrokerDestinationView.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/BrokerDestinationView.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/BrokerDestinationView.java deleted file mode 100644 index a80e64e74..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/BrokerDestinationView.java +++ /dev/null @@ -1,198 +0,0 @@ -/** - * 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.broker.view; - -import org.apache.activemq.broker.region.Destination; - -public class BrokerDestinationView { - private final Destination destination; - - - BrokerDestinationView(Destination destination) { - this.destination = destination; - } - - - /** - * @return the name of the DestinationView - */ - public String getName() { - return destination.getName(); - } - - /** - * @return the number of messages enqueued by this destination - */ - - public long getEnqueueCount() { - return destination.getDestinationStatistics().getEnqueues().getCount(); - } - - /** - * @return the number of messages dequeued (dispatched and removed) by this destination - */ - public long getDequeueCount() { - return destination.getDestinationStatistics().getDequeues().getCount(); - } - - /** - * @return the number of messages dispatched by this destination - */ - public long getDispatchCount() { - return destination.getDestinationStatistics().getDispatched().getCount(); - } - - /** - * @return the number of messages inflight (dispatched by not acknowledged) by this destination - */ - public long getInFlightCount() { - return destination.getDestinationStatistics().getInflight().getCount(); - } - - /** - * @return the number of messages expired by this destination - */ - public long getExpiredCount() { - return destination.getDestinationStatistics().getExpired().getCount(); - } - - /** - * @return the number of active consumers on this destination - */ - public int getConsumerCount() { - return (int)destination.getDestinationStatistics().getConsumers().getCount(); - } - - /** - * @return the number of active consumers on this destination - */ - public int getProducerCount() { - return (int)destination.getDestinationStatistics().getProducers().getCount(); - } - - /** - * @return the depth of the Destination - */ - public long getQueueSize() { - return destination.getDestinationStatistics().getMessages().getCount(); - } - - /** - * @return the number of messages cached in memory by this destination - */ - public long getMessagesCached() { - return destination.getDestinationStatistics().getMessagesCached().getCount(); - } - - /** - * @return the memory usage as a percentage for this Destination - */ - public int getMemoryPercentUsage() { - return destination.getMemoryUsage().getPercentUsage(); - } - - /** - * @return the memory used by this destination in bytes - */ - public long getMemoryUsageByteCount() { - return destination.getMemoryUsage().getUsage(); - } - - - /** - * @return the memory limit for this destination in bytes - */ - public long getMemoryLimit() { - return destination.getMemoryUsage().getLimit(); - } - - - /** - * @return the average time it takes to store a message on this destination (ms) - */ - public double getAverageEnqueueTime() { - return destination.getDestinationStatistics().getProcessTime().getAverageTime(); - } - - /** - * @return the maximum time it takes to store a message on this destination (ms) - */ - public long getMaxEnqueueTime() { - return destination.getDestinationStatistics().getProcessTime().getMaxTime(); - } - - /** - * @return the minimum time it takes to store a message on this destination (ms) - */ - - public long getMinEnqueueTime() { - return destination.getDestinationStatistics().getProcessTime().getMinTime(); - } - - /** - * @return the average size of a message (bytes) - */ - public double getAverageMessageSize() { - return destination.getDestinationStatistics().getMessageSize().getAverageSize(); - } - - /** - * @return the max size of a message (bytes) - */ - public long getMaxMessageSize() { - return destination.getDestinationStatistics().getMessageSize().getMaxSize(); - } - - /** - * @return the min size of a message (bytes) - */ - public long getMinMessageSize() { - return destination.getDestinationStatistics().getMessageSize().getMinSize(); - } - - - /** - * @return true if the destination is a Dead Letter Queue - */ - public boolean isDLQ() { - return destination.isDLQ(); - } - - - /** - * @return the number of messages blocked waiting for dispatch (indication of slow consumption if greater than zero) - */ - public long getBlockedSends() { - return destination.getDestinationStatistics().getBlockedSends().getCount(); - } - - /** - * @return the average time(ms) messages are blocked waiting for dispatch (indication of slow consumption if greater than zero) - */ - - public double getAverageBlockedTime() { - return destination.getDestinationStatistics().getBlockedTime().getAverageTime(); - } - - /** - * @return the total time(ms) messages are blocked waiting for dispatch (indication of slow consumption if greater than zero) - */ - - public long getTotalBlockedTime() { - return destination.getDestinationStatistics().getBlockedTime().getTotalTime(); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/ConnectionDotFileInterceptor.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/ConnectionDotFileInterceptor.class deleted file mode 100644 index 3fbe854d2..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/ConnectionDotFileInterceptor.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/ConnectionDotFileInterceptor.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/ConnectionDotFileInterceptor.java deleted file mode 100644 index 75f1c1e36..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/ConnectionDotFileInterceptor.java +++ /dev/null @@ -1,334 +0,0 @@ -/** - * 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.broker.view; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.ProducerBrokerExchange; -import org.apache.activemq.broker.jmx.BrokerViewMBean; -import org.apache.activemq.broker.jmx.SubscriptionViewMBean; -import org.apache.activemq.broker.region.Subscription; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ConsumerInfo; -import org.apache.activemq.command.Message; -import org.apache.activemq.command.ProducerId; -import org.apache.activemq.command.ProducerInfo; -import org.apache.activemq.filter.DestinationMapNode; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; -import javax.management.ObjectName; - -/** - * - */ -public class ConnectionDotFileInterceptor extends DotFileInterceptorSupport { - - protected static final String ID_SEPARATOR = "_"; - - private final boolean redrawOnRemove; - private boolean clearProducerCacheAfterRender; - private String domain = "org.apache.activemq"; - private BrokerViewMBean brokerView; - - // until we have some MBeans for producers, lets do it all ourselves - private Map producers = new HashMap(); - private Map> producerDestinations = new HashMap>(); - private Object lock = new Object(); - - public ConnectionDotFileInterceptor(Broker next, String file, boolean redrawOnRemove) throws IOException { - super(next, file); - this.redrawOnRemove = redrawOnRemove; - - } - - public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { - Subscription answer = super.addConsumer(context, info); - generateFile(); - return answer; - } - - public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception { - super.addProducer(context, info); - ProducerId producerId = info.getProducerId(); - synchronized (lock) { - producers.put(producerId, info); - } - generateFile(); - } - - public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { - super.removeConsumer(context, info); - if (redrawOnRemove) { - generateFile(); - } - } - - public void removeProducer(ConnectionContext context, ProducerInfo info) throws Exception { - super.removeProducer(context, info); - ProducerId producerId = info.getProducerId(); - if (redrawOnRemove) { - synchronized (lock) { - producerDestinations.remove(producerId); - producers.remove(producerId); - } - generateFile(); - } - } - - public void send(ProducerBrokerExchange producerExchange, Message messageSend) throws Exception { - super.send(producerExchange, messageSend); - ProducerId producerId = messageSend.getProducerId(); - ActiveMQDestination destination = messageSend.getDestination(); - synchronized (lock) { - Set destinations = producerDestinations.get(producerId); - if (destinations == null) { - destinations = new HashSet(); - } - producerDestinations.put(producerId, destinations); - destinations.add(destination); - } - } - - protected void generateFile(PrintWriter writer) throws Exception { - - writer.println("digraph \"ActiveMQ Connections\" {"); - writer.println(); - writer.println("label=\"ActiveMQ Broker: " + getBrokerView().getBrokerId() + "\"];"); - writer.println(); - writer.println("node [style = \"rounded,filled\", fillcolor = yellow, fontname=\"Helvetica-Oblique\"];"); - writer.println(); - - Map clients = new HashMap(); - Map queues = new HashMap(); - Map topics = new HashMap(); - - printSubscribers(writer, clients, queues, "queue_", getBrokerView().getQueueSubscribers()); - writer.println(); - - printSubscribers(writer, clients, topics, "topic_", getBrokerView().getTopicSubscribers()); - writer.println(); - - printProducers(writer, clients, queues, topics); - writer.println(); - - writeLabels(writer, "green", "Client: ", clients); - writer.println(); - - writeLabels(writer, "red", "Queue: ", queues); - writeLabels(writer, "blue", "Topic: ", topics); - writer.println("}"); - - if (clearProducerCacheAfterRender) { - producerDestinations.clear(); - } - } - - protected void printProducers(PrintWriter writer, Map clients, Map queues, Map topics) { - synchronized (lock) { - for (Iterator iter = producerDestinations.entrySet().iterator(); iter.hasNext();) { - Map.Entry entry = (Map.Entry)iter.next(); - ProducerId producerId = (ProducerId)entry.getKey(); - Set destinationSet = (Set)entry.getValue(); - printProducers(writer, clients, queues, topics, producerId, destinationSet); - } - } - } - - protected void printProducers(PrintWriter writer, Map clients, Map queues, Map topics, ProducerId producerId, Set destinationSet) { - for (Iterator iter = destinationSet.iterator(); iter.hasNext();) { - ActiveMQDestination destination = (ActiveMQDestination)iter.next(); - - // TODO use clientId one day - String clientId = producerId.getConnectionId(); - String safeClientId = asID(clientId); - clients.put(safeClientId, clientId); - - String physicalName = destination.getPhysicalName(); - String safeDestinationId = asID(physicalName); - if (destination.isTopic()) { - safeDestinationId = "topic_" + safeDestinationId; - topics.put(safeDestinationId, physicalName); - } else { - safeDestinationId = "queue_" + safeDestinationId; - queues.put(safeDestinationId, physicalName); - } - - String safeProducerId = asID(producerId.toString()); - - // lets write out the links - - writer.print(safeClientId); - writer.print(" -> "); - writer.print(safeProducerId); - writer.println(";"); - - writer.print(safeProducerId); - writer.print(" -> "); - writer.print(safeDestinationId); - writer.println(";"); - - // now lets write out the label - writer.print(safeProducerId); - writer.print(" [label = \""); - String label = "Producer: " + producerId.getSessionId() + "-" + producerId.getValue(); - writer.print(label); - writer.println("\"];"); - - } - } - - protected void printSubscribers(PrintWriter writer, Map clients, Map destinations, String type, ObjectName[] subscribers) { - for (int i = 0; i < subscribers.length; i++) { - ObjectName name = subscribers[i]; - SubscriptionViewMBean subscriber = (SubscriptionViewMBean)getBrokerService().getManagementContext().newProxyInstance(name, SubscriptionViewMBean.class, true); - - String clientId = subscriber.getClientId(); - String safeClientId = asID(clientId); - clients.put(safeClientId, clientId); - - String destination = subscriber.getDestinationName(); - String safeDestinationId = type + asID(destination); - destinations.put(safeDestinationId, destination); - - String selector = subscriber.getSelector(); - - // lets write out the links - String subscriberId = safeClientId + "_" + subscriber.getSessionId() + "_" + subscriber.getSubcriptionId(); - - writer.print(subscriberId); - writer.print(" -> "); - writer.print(safeClientId); - writer.println(";"); - - writer.print(safeDestinationId); - writer.print(" -> "); - writer.print(subscriberId); - writer.println(";"); - - // now lets write out the label - writer.print(subscriberId); - writer.print(" [label = \""); - String label = "Subscription: " + subscriber.getSessionId() + "-" + subscriber.getSubcriptionId(); - if (selector != null && selector.length() > 0) { - label = label + "\\nSelector: " + selector; - } - writer.print(label); - writer.println("\"];"); - } - } - - protected void writeLabels(PrintWriter writer, String color, String prefix, Map map) { - for (Iterator iter = map.entrySet().iterator(); iter.hasNext();) { - Map.Entry entry = (Map.Entry)iter.next(); - String id = (String)entry.getKey(); - String label = (String)entry.getValue(); - - writer.print(id); - writer.print(" [ fillcolor = "); - writer.print(color); - writer.print(", label = \""); - writer.print(prefix); - writer.print(label); - writer.println("\"];"); - } - } - - /** - * Lets strip out any non supported characters - */ - protected String asID(String name) { - StringBuffer buffer = new StringBuffer(); - int size = name.length(); - for (int i = 0; i < size; i++) { - char ch = name.charAt(i); - if (Character.isLetterOrDigit(ch) || ch == '_') { - buffer.append(ch); - } else { - buffer.append('_'); - } - } - return buffer.toString(); - } - - protected void printNodes(PrintWriter writer, DestinationMapNode node, String prefix) { - String path = getPath(node); - writer.print(" "); - writer.print(prefix); - writer.print(ID_SEPARATOR); - writer.print(path); - String label = path; - if (prefix.equals("topic")) { - label = "Topics"; - } else if (prefix.equals("queue")) { - label = "Queues"; - } - writer.print("[ label = \""); - writer.print(label); - writer.println("\" ];"); - - Collection children = node.getChildren(); - for (Iterator iter = children.iterator(); iter.hasNext();) { - DestinationMapNode child = (DestinationMapNode)iter.next(); - printNodes(writer, child, prefix + ID_SEPARATOR + path); - } - } - - protected void printNodeLinks(PrintWriter writer, DestinationMapNode node, String prefix) { - String path = getPath(node); - Collection children = node.getChildren(); - for (Iterator iter = children.iterator(); iter.hasNext();) { - DestinationMapNode child = (DestinationMapNode)iter.next(); - - writer.print(" "); - writer.print(prefix); - writer.print(ID_SEPARATOR); - writer.print(path); - writer.print(" -> "); - writer.print(prefix); - writer.print(ID_SEPARATOR); - writer.print(path); - writer.print(ID_SEPARATOR); - writer.print(getPath(child)); - writer.println(";"); - - printNodeLinks(writer, child, prefix + ID_SEPARATOR + path); - } - } - - protected String getPath(DestinationMapNode node) { - String path = node.getPath(); - if (path.equals("*")) { - return "root"; - } - return path; - } - - BrokerViewMBean getBrokerView() throws Exception { - if (this.brokerView == null) { - ObjectName brokerName = getBrokerService().getBrokerObjectName(); - this.brokerView = (BrokerViewMBean) getBrokerService().getManagementContext().newProxyInstance(brokerName, - BrokerViewMBean.class, true); - } - return this.brokerView; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/ConnectionDotFilePlugin.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/ConnectionDotFilePlugin.class deleted file mode 100644 index 43969a661..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/ConnectionDotFilePlugin.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/ConnectionDotFilePlugin.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/ConnectionDotFilePlugin.java deleted file mode 100644 index 5693c0052..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/ConnectionDotFilePlugin.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * 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.broker.view; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.BrokerPlugin; - -/** - * A DOT file creator plugin which - * creates a DOT file showing the current connections - * - * @org.apache.xbean.XBean - * - * - */ -public class ConnectionDotFilePlugin implements BrokerPlugin { - private String file = "ActiveMQConnections.dot"; - private boolean redrawOnRemove; - - public Broker installPlugin(Broker broker) throws Exception { - return new ConnectionDotFileInterceptor(broker, file, redrawOnRemove); - } - - public String getFile() { - return file; - } - - /** - * Sets the destination file name to create the destination diagram - */ - public void setFile(String file) { - this.file = file; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/DestinationDotFileInterceptor.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/DestinationDotFileInterceptor.class deleted file mode 100644 index 9b8c718e0..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/DestinationDotFileInterceptor.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/DestinationDotFileInterceptor.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/DestinationDotFileInterceptor.java deleted file mode 100644 index edf3c2c48..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/DestinationDotFileInterceptor.java +++ /dev/null @@ -1,173 +0,0 @@ -/** - * 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.broker.view; - -import java.io.PrintWriter; -import java.util.Collection; -import java.util.Iterator; -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.ConnectionContext; -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.filter.DestinationMap; -import org.apache.activemq.filter.DestinationMapNode; - -/** - * - */ -public class DestinationDotFileInterceptor extends DotFileInterceptorSupport { - - protected static final String ID_SEPARATOR = "_"; - - public DestinationDotFileInterceptor(Broker next, String file) { - super(next, file); - } - - @Override - public Destination addDestination(ConnectionContext context, ActiveMQDestination destination,boolean create) throws Exception { - Destination answer = super.addDestination(context, destination,create); - generateFile(); - return answer; - } - - @Override - public void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout) throws Exception { - super.removeDestination(context, destination, timeout); - generateFile(); - } - - @Override - protected void generateFile(PrintWriter writer) throws Exception { - ActiveMQDestination[] destinations = getDestinations(); - - // lets split into a tree - DestinationMap map = new DestinationMap(); - - for (int i = 0; i < destinations.length; i++) { - ActiveMQDestination destination = destinations[i]; - map.put(destination, destination); - } - - // now lets navigate the tree - writer.println("digraph \"ActiveMQ Destinations\" {"); - writer.println(); - writer.println("node [style = \"rounded,filled\", fontname=\"Helvetica-Oblique\"];"); - writer.println(); - writer.println("topic_root [fillcolor = deepskyblue, label = \"Topics\" ];"); - writer.println("queue_root [fillcolor = deepskyblue, label = \"Queues\" ];"); - writer.println(); - - writer.println("subgraph queues {"); - writer.println(" node [fillcolor=red]; "); - writer.println(" label = \"Queues\""); - writer.println(); - printNodeLinks(writer, map.getQueueRootNode(), "queue"); - writer.println("}"); - writer.println(); - - writer.println("subgraph temp queues {"); - writer.println(" node [fillcolor=red]; "); - writer.println(" label = \"TempQueues\""); - writer.println(); - printNodeLinks(writer, map.getTempQueueRootNode(), "tempqueue"); - writer.println("}"); - writer.println(); - - writer.println("subgraph topics {"); - writer.println(" node [fillcolor=green]; "); - writer.println(" label = \"Topics\""); - writer.println(); - printNodeLinks(writer, map.getTopicRootNode(), "topic"); - writer.println("}"); - writer.println(); - - writer.println("subgraph temp topics {"); - writer.println(" node [fillcolor=green]; "); - writer.println(" label = \"TempTopics\""); - writer.println(); - printNodeLinks(writer, map.getTempTopicRootNode(), "temptopic"); - writer.println("}"); - writer.println(); - - printNodes(writer, map.getQueueRootNode(), "queue"); - writer.println(); - - printNodes(writer, map.getTempQueueRootNode(), "tempqueue"); - writer.println(); - - printNodes(writer, map.getTopicRootNode(), "topic"); - writer.println(); - - printNodes(writer, map.getTempTopicRootNode(), "temptopic"); - writer.println(); - - writer.println("}"); - } - - protected void printNodes(PrintWriter writer, DestinationMapNode node, String prefix) { - String path = getPath(node); - writer.print(" "); - writer.print(prefix); - writer.print(ID_SEPARATOR); - writer.print(path); - String label = path; - if (prefix.equals("topic")) { - label = "Topics"; - } else if (prefix.equals("queue")) { - label = "Queues"; - } - writer.print("[ label = \""); - writer.print(label); - writer.println("\" ];"); - - Collection children = node.getChildren(); - for (Iterator iter = children.iterator(); iter.hasNext();) { - DestinationMapNode child = (DestinationMapNode)iter.next(); - printNodes(writer, child, prefix + ID_SEPARATOR + path); - } - } - - protected void printNodeLinks(PrintWriter writer, DestinationMapNode node, String prefix) { - String path = getPath(node); - Collection children = node.getChildren(); - for (Iterator iter = children.iterator(); iter.hasNext();) { - DestinationMapNode child = (DestinationMapNode)iter.next(); - - writer.print(" "); - writer.print(prefix); - writer.print(ID_SEPARATOR); - writer.print(path); - writer.print(" -> "); - writer.print(prefix); - writer.print(ID_SEPARATOR); - writer.print(path); - writer.print(ID_SEPARATOR); - writer.print(getPath(child)); - writer.println(";"); - - printNodeLinks(writer, child, prefix + ID_SEPARATOR + path); - } - } - - protected String getPath(DestinationMapNode node) { - String path = node.getPath(); - if (path.equals("*")) { - return "root"; - } - return path; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/DestinationDotFilePlugin.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/DestinationDotFilePlugin.class deleted file mode 100644 index 3b2c54cba..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/DestinationDotFilePlugin.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/DestinationDotFilePlugin.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/DestinationDotFilePlugin.java deleted file mode 100644 index c37ea5be9..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/DestinationDotFilePlugin.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * 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.broker.view; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.BrokerPlugin; - -/** - * A DOT - * file creator plugin which creates a DOT file showing the current topic & queue hierarchies. - * - * @org.apache.xbean.XBean - * - * - */ -public class DestinationDotFilePlugin implements BrokerPlugin { - private String file = "ActiveMQDestinations.dot"; - - public Broker installPlugin(Broker broker) { - return new DestinationDotFileInterceptor(broker, file); - } - - public String getFile() { - return file; - } - - /** - * Sets the destination file name to create the destination diagram - */ - public void setFile(String file) { - this.file = file; - } - - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/DotFileInterceptorSupport.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/DotFileInterceptorSupport.class deleted file mode 100644 index c3c9e2cce..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/DotFileInterceptorSupport.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/DotFileInterceptorSupport.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/DotFileInterceptorSupport.java deleted file mode 100644 index 83613b3c2..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/DotFileInterceptorSupport.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * 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.broker.view; - -import java.io.FileWriter; -import java.io.PrintWriter; - -import org.apache.activemq.broker.Broker; -import org.apache.activemq.broker.BrokerFilter; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Useful base class - * - * - */ -public abstract class DotFileInterceptorSupport extends BrokerFilter { - private final Logger log = LoggerFactory.getLogger(DotFileInterceptorSupport.class); - - private String file; - - public DotFileInterceptorSupport(Broker next, String file) { - super(next); - this.file = file; - } - - protected void generateFile() throws Exception { - log.debug("Creating DOT file at: {}", file); - PrintWriter writer = new PrintWriter(new FileWriter(file)); - try { - generateFile(writer); - } finally { - writer.close(); - } - } - - protected abstract void generateFile(PrintWriter writer) throws Exception; -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/MessageBrokerView.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/MessageBrokerView.class deleted file mode 100644 index f415467a1..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/MessageBrokerView.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/MessageBrokerView.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/MessageBrokerView.java deleted file mode 100644 index 5ed00f113..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/MessageBrokerView.java +++ /dev/null @@ -1,286 +0,0 @@ -/** - * 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.broker.view; - -import java.util.Collections; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -import org.apache.activemq.broker.BrokerRegistry; -import org.apache.activemq.broker.BrokerService; -import org.apache.activemq.broker.region.Destination; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ActiveMQQueue; -import org.apache.activemq.command.ActiveMQTempQueue; -import org.apache.activemq.command.ActiveMQTempTopic; -import org.apache.activemq.command.ActiveMQTopic; -import org.apache.activemq.util.LRUCache; - -/** - * A view into the running Broker - */ -public class MessageBrokerView { - private final BrokerService brokerService; - private Map destinationViewMap = new LRUCache(); - - - /** - * Create a view of a running Broker - * @param brokerService - */ - public MessageBrokerView(BrokerService brokerService){ - this.brokerService = brokerService; - if (brokerService == null){ - throw new NullPointerException("BrokerService is null"); - } - if (!brokerService.isStarted()){ - throw new IllegalStateException("BrokerService " + brokerService.getBrokerName() + " is not started"); - } - } - - /** - * Create a view of a running Broker - * @param brokerName - */ - public MessageBrokerView(String brokerName){ - this.brokerService = BrokerRegistry.getInstance().lookup(brokerName); - if (brokerService == null){ - throw new NullPointerException("BrokerService is null"); - } - if (!brokerService.isStarted()){ - throw new IllegalStateException("BrokerService " + brokerService.getBrokerName() + " is not started"); - } - } - - - - /** - * @return the brokerName - */ - public String getBrokerName(){ - return brokerService.getBrokerName(); - } - - /** - * @return the unique id of the Broker - */ - public String getBrokerId(){ - try { - return brokerService.getBroker().getBrokerId().toString(); - } catch (Exception e) { - return ""; - } - } - - - /** - * @return the memory used by the Broker as a percentage - */ - public int getMemoryPercentUsage() { - return brokerService.getSystemUsage().getMemoryUsage().getPercentUsage(); - } - - - /** - * @return the space used by the Message Store as a percentage - */ - - public int getStorePercentUsage() { - return brokerService.getSystemUsage().getStoreUsage().getPercentUsage(); - } - - /** - * @return the space used by the store for temporary messages as a percentage - */ - public int getTempPercentUsage() { - return brokerService.getSystemUsage().getTempUsage().getPercentUsage(); - } - - /** - * @return the space used by the store of scheduled messages - */ - public int getJobSchedulerStorePercentUsage() { - return brokerService.getSystemUsage().getJobSchedulerUsage().getPercentUsage(); - } - - /** - * @return true if the Broker isn't using an in-memory store only for messages - */ - public boolean isPersistent() { - return brokerService.isPersistent(); - } - - public BrokerService getBrokerService(){ - return brokerService; - } - - /** - * Retrieve a set of all Destinations be used by the Broker - * @return all Destinations - */ - public Set getDestinations(){ - Set result; - - try { - ActiveMQDestination[] destinations = brokerService.getBroker().getDestinations(); - result = new HashSet(); - Collections.addAll(result, destinations); - }catch (Exception e){ - result = Collections.emptySet(); - } - return result; - } - - /** - * Retrieve a set of all Topics be used by the Broker - * @return all Topics - */ - - public Set getTopics(){ - Set result = new HashSet(); - for (ActiveMQDestination destination:getDestinations()){ - if (destination.isTopic() && !destination.isTemporary()){ - result.add((ActiveMQTopic) destination); - } - } - return result; - } - - /** - * Retrieve a set of all Queues be used by the Broker - * @return all Queues - */ - - public Set getQueues(){ - Set result = new HashSet(); - for (ActiveMQDestination destination:getDestinations()){ - if (destination.isQueue() && !destination.isTemporary()){ - result.add((ActiveMQQueue) destination); - } - } - return result; - } - - /** - * Retrieve a set of all TemporaryTopics be used by the Broker - * @return all TemporaryTopics - */ - public Set getTempTopics(){ - Set result = new HashSet(); - for (ActiveMQDestination destination:getDestinations()){ - if (destination.isTopic() && destination.isTemporary()){ - result.add((ActiveMQTempTopic) destination); - } - } - return result; - } - - - /** - * Retrieve a set of all TemporaryQueues be used by the Broker - * @return all TemporaryQueues - */ - public Set getTempQueues(){ - Set result = new HashSet(); - for (ActiveMQDestination destination:getDestinations()){ - if (destination.isTopic() && destination.isTemporary()){ - result.add((ActiveMQTempQueue) destination); - } - } - return result; - } - - - /** - * It will be assumed the destinationName is prepended with topic:// or queue:// - but - * will default to a Queue - * @param destinationName - * @return the BrokerDestinationView associated with the destinationName - * @throws Exception - */ - - public BrokerDestinationView getDestinationView(String destinationName) throws Exception{ - return getDestinationView(destinationName,ActiveMQDestination.QUEUE_TYPE); - } - - /** - * Get the BrokerDestinationView associated with the topic - * @param destinationName - * @return BrokerDestinationView - * @throws Exception - */ - - public BrokerDestinationView getTopicDestinationView(String destinationName) throws Exception{ - return getDestinationView(destinationName,ActiveMQDestination.TOPIC_TYPE); - } - - /** - * Get the BrokerDestinationView associated with the queue - * @param destinationName - * @return BrokerDestinationView - * @throws Exception - */ - - public BrokerDestinationView getQueueDestinationView(String destinationName) throws Exception{ - return getDestinationView(destinationName,ActiveMQDestination.QUEUE_TYPE); - } - - - /** - * Get the BrokerDestinationView associated with destination - * @param destinationName - * @param type expects either ActiveMQDestination.QUEUE_TYPE, ActiveMQDestination.TOPIC_TYPE etc - * @return BrokerDestinationView - * @throws Exception - */ - public BrokerDestinationView getDestinationView (String destinationName, byte type) throws Exception { - ActiveMQDestination activeMQDestination = ActiveMQDestination.createDestination(destinationName,type); - return getDestinationView(activeMQDestination); - } - - /** - * Get the BrokerDestinationView associated with destination - * @param activeMQDestination - * @return BrokerDestinationView - * @throws Exception - */ - public BrokerDestinationView getDestinationView (ActiveMQDestination activeMQDestination) throws Exception { - BrokerDestinationView view = null; - synchronized(destinationViewMap){ - view = destinationViewMap.get(activeMQDestination); - if (view==null){ - - /** - * If auto destinatons are allowed (on by default) - this will create a Broker Destination - * if it doesn't exist. We could query the regionBroker first to check - but this affords more - * flexibility - e.g. you might want to set up a query on destination statistics before any - * messaging clients have started (and hence created the destination themselves - */ - Destination destination = brokerService.getDestination(activeMQDestination); - view = new BrokerDestinationView(destination); - destinationViewMap.put(activeMQDestination,view); - - } - } - return view; - } - - - - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/MessageBrokerViewRegistry.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/MessageBrokerViewRegistry.class deleted file mode 100644 index 7242037e9..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/MessageBrokerViewRegistry.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/MessageBrokerViewRegistry.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/MessageBrokerViewRegistry.java deleted file mode 100644 index 896b448a0..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/MessageBrokerViewRegistry.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * 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.broker.view; - -import java.util.HashMap; -import java.util.Map; - -import org.apache.activemq.broker.BrokerRegistry; -import org.apache.activemq.broker.BrokerService; - -public class MessageBrokerViewRegistry { - - private static final MessageBrokerViewRegistry INSTANCE = new MessageBrokerViewRegistry(); - - private final Object mutex = new Object(); - private final Map brokerViews = new HashMap(); - - public static MessageBrokerViewRegistry getInstance() { - return INSTANCE; - } - - /** - * @param brokerName - * @return the BrokerService - */ - public MessageBrokerView lookup(String brokerName) { - MessageBrokerView result = null; - synchronized (mutex) { - result = brokerViews.get(brokerName); - if (result==null){ - BrokerService brokerService = BrokerRegistry.getInstance().lookup(brokerName); - if (brokerService != null){ - result = new MessageBrokerView(brokerService); - brokerViews.put(brokerName,result); - } - } - - } - return result; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/package.html b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/package.html deleted file mode 100644 index 161212c6c..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/broker/view/package.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - -Broker Plugins for visualising the current system - - - diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelConnection.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelConnection.class deleted file mode 100644 index 6e79872fd..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelConnection.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelConnection.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelConnection.java deleted file mode 100644 index 7f39fd086..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelConnection.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * 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.camel; - -import org.apache.activemq.ActiveMQConnection; -import org.apache.activemq.management.JMSStatsImpl; -import org.apache.activemq.transport.Transport; -import org.apache.activemq.util.IdGenerator; -import org.apache.camel.CamelContext; -import org.apache.camel.CamelContextAware; - -/** - * - */ -public class CamelConnection extends ActiveMQConnection implements CamelContextAware { - - private CamelContext camelContext; - - protected CamelConnection(Transport transport, IdGenerator clientIdGenerator, - IdGenerator connectionIdGenerator, JMSStatsImpl factoryStats) throws Exception { - super(transport, clientIdGenerator, connectionIdGenerator, factoryStats); - } - - public CamelContext getCamelContext() { - return camelContext; - } - - public void setCamelContext(CamelContext camelContext) { - this.camelContext = camelContext; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelConnectionFactory.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelConnectionFactory.class deleted file mode 100644 index e8b612239..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelConnectionFactory.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelConnectionFactory.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelConnectionFactory.java deleted file mode 100644 index 0664504a3..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelConnectionFactory.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * 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.camel; - -import org.apache.activemq.management.JMSStatsImpl; -import org.apache.activemq.spring.ActiveMQConnectionFactory; -import org.apache.activemq.transport.Transport; -import org.apache.camel.CamelContext; -import org.apache.camel.CamelContextAware; - -/** - * A JMS ConnectionFactory which resolves non-JMS destinations or instances of - * {@link CamelDestination} to use the {@link CamelContext} to perform smart routing etc - * - * - */ -public class CamelConnectionFactory extends ActiveMQConnectionFactory implements CamelContextAware { - private CamelContext camelContext; - - public CamelConnectionFactory() { - } - - public CamelContext getCamelContext() { - return camelContext; - } - - public void setCamelContext(CamelContext camelContext) { - this.camelContext = camelContext; - } - - // Implementation methods - //----------------------------------------------------------------------- - protected CamelConnection createActiveMQConnection(Transport transport, JMSStatsImpl stats) throws Exception { - CamelConnection connection = new CamelConnection(transport, getClientIdGenerator(), getConnectionIdGenerator(), stats); - CamelContext context = getCamelContext(); - if (context != null) { - connection.setCamelContext(context); - } - return connection; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelDestination.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelDestination.class deleted file mode 100644 index df1c35d20..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelDestination.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelDestination.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelDestination.java deleted file mode 100644 index 76c2633a3..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelDestination.java +++ /dev/null @@ -1,162 +0,0 @@ -/** - * 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.camel; - -import javax.jms.JMSException; -import javax.jms.MessageConsumer; -import javax.jms.MessageProducer; -import javax.jms.QueueReceiver; -import javax.jms.QueueSender; -import javax.jms.TopicPublisher; -import javax.jms.TopicSubscriber; - -import org.apache.activemq.ActiveMQConnection; -import org.apache.activemq.ActiveMQSession; -import org.apache.activemq.CustomDestination; -import org.apache.camel.CamelContext; -import org.apache.camel.CamelContextAware; -import org.apache.camel.Endpoint; -import org.apache.camel.component.jms.JmsBinding; -import org.apache.camel.component.jms.JmsEndpoint; - -/** - * - */ -public class CamelDestination implements CustomDestination, CamelContextAware { - private String uri; - private Endpoint endpoint; - private CamelContext camelContext; - // add in dummy endpoint pending camel release with - // https://issues.apache.org/activemq/browse/CAMEL-1982 - private JmsBinding binding = new JmsBinding(new JmsEndpoint()); - - public CamelDestination() { - } - - public CamelDestination(String uri) { - this.uri = uri; - } - - public String toString() { - return uri.toString(); - } - - // CustomDestination interface - //----------------------------------------------------------------------- - public MessageConsumer createConsumer(ActiveMQSession session, String messageSelector) { - return createConsumer(session, messageSelector, false); - } - - public MessageConsumer createConsumer(ActiveMQSession session, String messageSelector, boolean noLocal) { - return new CamelMessageConsumer(this, resolveEndpoint(session), session, messageSelector, noLocal); - } - - public TopicSubscriber createSubscriber(ActiveMQSession session, String messageSelector, boolean noLocal) { - return createDurableSubscriber(session, null, messageSelector, noLocal); - } - - public TopicSubscriber createDurableSubscriber(ActiveMQSession session, String name, String messageSelector, boolean noLocal) { - throw new UnsupportedOperationException("This destination is not a Topic: " + this); - } - - public QueueReceiver createReceiver(ActiveMQSession session, String messageSelector) { - throw new UnsupportedOperationException("This destination is not a Queue: " + this); - } - - // Producers - //----------------------------------------------------------------------- - public MessageProducer createProducer(ActiveMQSession session) throws JMSException { - return new CamelMessageProducer(this, resolveEndpoint(session), session); - } - - public TopicPublisher createPublisher(ActiveMQSession session) throws JMSException { - throw new UnsupportedOperationException("This destination is not a Topic: " + this); - } - - public QueueSender createSender(ActiveMQSession session) throws JMSException { - throw new UnsupportedOperationException("This destination is not a Queue: " + this); - } - - // Properties - //----------------------------------------------------------------------- - - public String getUri() { - return uri; - } - - public void setUri(String uri) { - this.uri = uri; - } - - public Endpoint getEndpoint() { - return endpoint; - } - - public void setEndpoint(Endpoint endpoint) { - this.endpoint = endpoint; - } - - public CamelContext getCamelContext() { - return camelContext; - } - - public void setCamelContext(CamelContext camelContext) { - this.camelContext = camelContext; - } - - public JmsBinding getBinding() { - return binding; - } - - public void setBinding(JmsBinding binding) { - this.binding = binding; - } - - // Implementation methods - //----------------------------------------------------------------------- - - /** - * Resolves the Camel Endpoint for this destination - * - * @return - */ - protected Endpoint resolveEndpoint(ActiveMQSession session) { - Endpoint answer = getEndpoint(); - if (answer == null) { - answer = resolveCamelContext(session).getEndpoint(getUri()); - if (answer == null) { - throw new IllegalArgumentException("No endpoint could be found for URI: " + getUri()); - } - } - return answer; - } - - protected CamelContext resolveCamelContext(ActiveMQSession session) { - CamelContext answer = getCamelContext(); - if (answer == null) { - ActiveMQConnection connection = session.getConnection(); - if (connection instanceof CamelConnection) { - CamelConnection camelConnection = (CamelConnection) connection; - answer = camelConnection.getCamelContext(); - } - } - if (answer == null) { - throw new IllegalArgumentException("No CamelContext has been configured"); - } - return answer; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelMessageConsumer$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelMessageConsumer$1.class deleted file mode 100644 index c9da074e4..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelMessageConsumer$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelMessageConsumer.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelMessageConsumer.class deleted file mode 100644 index 16f4dc8c8..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelMessageConsumer.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelMessageConsumer.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelMessageConsumer.java deleted file mode 100644 index dbe211e56..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelMessageConsumer.java +++ /dev/null @@ -1,173 +0,0 @@ -/** - * 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.camel; - -import javax.jms.IllegalStateException; -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.MessageConsumer; -import javax.jms.MessageListener; - -import org.apache.activemq.ActiveMQSession; -import org.apache.activemq.util.JMSExceptionSupport; -import org.apache.camel.Consumer; -import org.apache.camel.Endpoint; -import org.apache.camel.Exchange; -import org.apache.camel.PollingConsumer; -import org.apache.camel.Processor; - -/** - * A JMS {@link javax.jms.MessageConsumer} which consumes message exchanges from - * a Camel {@link Endpoint} - * - * - */ -public class CamelMessageConsumer implements MessageConsumer { - private final CamelDestination destination; - private final Endpoint endpoint; - private final ActiveMQSession session; - private final String messageSelector; - private final boolean noLocal; - private MessageListener messageListener; - private Consumer consumer; - private PollingConsumer pollingConsumer; - private boolean closed; - - public CamelMessageConsumer(CamelDestination destination, Endpoint endpoint, ActiveMQSession session, String messageSelector, boolean noLocal) { - this.destination = destination; - this.endpoint = endpoint; - this.session = session; - this.messageSelector = messageSelector; - this.noLocal = noLocal; - } - - public void close() throws JMSException { - if (!closed) { - closed = true; - try { - if (consumer != null) { - consumer.stop(); - } - if (pollingConsumer != null) { - pollingConsumer.stop(); - } - } catch (JMSException e) { - throw e; - } catch (Exception e) { - throw JMSExceptionSupport.create(e); - } - } - } - - public MessageListener getMessageListener() throws JMSException { - return messageListener; - } - - public void setMessageListener(MessageListener messageListener) throws JMSException { - this.messageListener = messageListener; - if (messageListener != null && consumer == null) { - consumer = createConsumer(); - } - } - - public Message receive() throws JMSException { - Exchange exchange = getPollingConsumer().receive(); - return createMessage(exchange); - } - - public Message receive(long timeoutMillis) throws JMSException { - Exchange exchange = getPollingConsumer().receive(timeoutMillis); - return createMessage(exchange); - } - - public Message receiveNoWait() throws JMSException { - Exchange exchange = getPollingConsumer().receiveNoWait(); - return createMessage(exchange); - } - - // Properties - // ----------------------------------------------------------------------- - - public CamelDestination getDestination() { - return destination; - } - - public Endpoint getEndpoint() { - return endpoint; - } - - public String getMessageSelector() { - return messageSelector; - } - - public boolean isNoLocal() { - return noLocal; - } - - public ActiveMQSession getSession() { - return session; - } - - // Implementation methods - // ----------------------------------------------------------------------- - - protected PollingConsumer getPollingConsumer() throws JMSException { - try { - if (pollingConsumer == null) { - pollingConsumer = endpoint.createPollingConsumer(); - pollingConsumer.start(); - } - return pollingConsumer; - } catch (JMSException e) { - throw e; - } catch (Exception e) { - throw JMSExceptionSupport.create(e); - } - } - - protected Message createMessage(Exchange exchange) throws JMSException { - if (exchange != null) { - Message message = destination.getBinding().makeJmsMessage(exchange, session); - return message; - } else { - return null; - } - } - - protected Consumer createConsumer() throws JMSException { - try { - Consumer answer = endpoint.createConsumer(new Processor() { - public void process(Exchange exchange) throws Exception { - Message message = createMessage(exchange); - getMessageListener().onMessage(message); - } - }); - answer.start(); - return answer; - } catch (JMSException e) { - throw e; - } catch (Exception e) { - throw JMSExceptionSupport.create(e); - } - } - - protected void checkClosed() throws javax.jms.IllegalStateException { - if (closed) { - throw new IllegalStateException("The producer is closed"); - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelMessageProducer.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelMessageProducer.class deleted file mode 100644 index 98e9fe3d1..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelMessageProducer.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelMessageProducer.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelMessageProducer.java deleted file mode 100644 index 3e54b1f9a..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelMessageProducer.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * 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.camel; - -import javax.jms.Destination; -import javax.jms.IllegalStateException; -import javax.jms.JMSException; -import javax.jms.Message; - -import org.apache.activemq.ActiveMQMessageProducerSupport; -import org.apache.activemq.ActiveMQSession; -import org.apache.activemq.util.JMSExceptionSupport; -import org.apache.camel.Endpoint; -import org.apache.camel.Exchange; -import org.apache.camel.ExchangePattern; -import org.apache.camel.Producer; -import org.apache.camel.component.jms.JmsMessage; -import org.apache.camel.util.ObjectHelper; - -/** - * A JMS {@link javax.jms.MessageProducer} which sends message exchanges to a - * Camel {@link Endpoint} - * - * - */ -public class CamelMessageProducer extends ActiveMQMessageProducerSupport { - - protected Producer producer; - - private final CamelDestination destination; - private final Endpoint endpoint; - private boolean closed; - - public CamelMessageProducer(CamelDestination destination, Endpoint endpoint, ActiveMQSession session) throws JMSException { - super(session); - this.destination = destination; - this.endpoint = endpoint; - try { - this.producer = endpoint.createProducer(); - } catch (JMSException e) { - throw e; - } catch (Exception e) { - throw JMSExceptionSupport.create(e); - } - } - - public CamelDestination getDestination() throws JMSException { - return destination; - } - - public Endpoint getEndpoint() { - return endpoint; - } - - public void close() throws JMSException { - if (!closed) { - closed = true; - try { - producer.stop(); - } catch (JMSException e) { - throw e; - } catch (Exception e) { - throw JMSExceptionSupport.create(e); - } - } - } - - public void send(Destination destination, Message message, int deliveryMode, int priority, long timeToLive) throws JMSException { - CamelDestination camelDestination = null; - if (ObjectHelper.equal(destination, this.destination)) { - camelDestination = this.destination; - } else { - // TODO support any CamelDestination? - throw new IllegalArgumentException("Invalid destination setting: " + destination + " when expected: " + this.destination); - } - try { - Exchange exchange = endpoint.createExchange(ExchangePattern.InOnly); - exchange.setIn(new JmsMessage(message, camelDestination.getBinding())); - producer.process(exchange); - } catch (JMSException e) { - throw e; - } catch (Exception e) { - throw JMSExceptionSupport.create(e); - } - } - - protected void checkClosed() throws IllegalStateException { - if (closed) { - throw new IllegalStateException("The producer is closed"); - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelQueue.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelQueue.class deleted file mode 100644 index 9f6148c84..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelQueue.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelQueue.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelQueue.java deleted file mode 100644 index 6fd908a82..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelQueue.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * 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.camel; - -import javax.jms.JMSException; -import javax.jms.Queue; -import javax.jms.QueueReceiver; -import javax.jms.QueueSender; - -import org.apache.activemq.ActiveMQSession; - -/** - * A JMS {@link Queue} object which refers to a Camel endpoint - * - * - */ -public class CamelQueue extends CamelDestination implements Queue { - - public CamelQueue(String uri) { - super(uri); - } - - public String getQueueName() throws JMSException { - return getUri(); - } - - public QueueSender createSender(ActiveMQSession session) throws JMSException { - return new CamelQueueSender(this, resolveEndpoint(session), session); - } - public QueueReceiver createReceiver(ActiveMQSession session, String messageSelector) { - return new CamelQueueReceiver(this, resolveEndpoint(session), session, messageSelector); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelQueueReceiver.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelQueueReceiver.class deleted file mode 100644 index 8d4f38ce5..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelQueueReceiver.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelQueueReceiver.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelQueueReceiver.java deleted file mode 100644 index 54221d177..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelQueueReceiver.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * 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.camel; - -import javax.jms.JMSException; -import javax.jms.Queue; -import javax.jms.QueueReceiver; - -import org.apache.activemq.ActiveMQSession; -import org.apache.camel.Endpoint; - -/** - * A JMS {@link javax.jms.QueueReceiver} which consumes message exchanges from a - * Camel {@link org.apache.camel.Endpoint} - * - * - */ -public class CamelQueueReceiver extends CamelMessageConsumer implements QueueReceiver { - - public CamelQueueReceiver(CamelQueue destination, Endpoint endpoint, ActiveMQSession session, String name) { - super(destination, endpoint, session, null, false); - } - - /** - * Gets the Queue associated with this queue receiver. - * - * @return this receiver's Queue - * @throws JMSException if the JMS provider fails to get the queue for this queue - * receiver due to some internal error. - */ - - public Queue getQueue() throws JMSException { - checkClosed(); - return (Queue) super.getDestination(); - } -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelQueueSender.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelQueueSender.class deleted file mode 100644 index 4ecccb169..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelQueueSender.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelQueueSender.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelQueueSender.java deleted file mode 100644 index 9f961028d..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelQueueSender.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - * 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.camel; - -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.Queue; -import javax.jms.QueueSender; - -import org.apache.activemq.ActiveMQSession; -import org.apache.camel.Endpoint; - -/** - * A JMS {@link javax.jms.QueueSender} which sends message exchanges to a Camel - * {@link org.apache.camel.Endpoint} - * - * - */ -public class CamelQueueSender extends CamelMessageProducer implements QueueSender { - - public CamelQueueSender(CamelQueue destination, Endpoint endpoint, ActiveMQSession session) throws JMSException { - super(destination, endpoint, session); - } - - /** - * Gets the queue associated with this QueueSender. - * - * @return this sender's queue - * @throws JMSException if the JMS provider fails to get the queue for this - * QueueSender due to some internal error. - */ - - public Queue getQueue() throws JMSException { - return (Queue)super.getDestination(); - } - - /** - * Sends a message to a queue for an unidentified message producer. Uses the - * QueueSender's default delivery mode, priority, and time - * to live.

    Typically, a message producer is assigned a queue at - * creation time; however, the JMS API also supports unidentified message - * producers, which require that the queue be supplied every time a message - * is sent. - * - * @param queue the queue to send this message to - * @param message the message to send - * @throws JMSException if the JMS provider fails to send the message due to - * some internal error. - * @see javax.jms.MessageProducer#getDeliveryMode() - * @see javax.jms.MessageProducer#getTimeToLive() - * @see javax.jms.MessageProducer#getPriority() - */ - - public void send(Queue queue, Message message) throws JMSException { - super.send(queue, message); - } - - /** - * Sends a message to a queue for an unidentified message producer, - * specifying delivery mode, priority and time to live.

    Typically, - * a message producer is assigned a queue at creation time; however, the JMS - * API also supports unidentified message producers, which require that the - * queue be supplied every time a message is sent. - * - * @param queue the queue to send this message to - * @param message the message to send - * @param deliveryMode the delivery mode to use - * @param priority the priority for this message - * @param timeToLive the message's lifetime (in milliseconds) - * @throws JMSException if the JMS provider fails to send the message due to - * some internal error. - */ - - public void send(Queue queue, Message message, int deliveryMode, int priority, long timeToLive) throws JMSException { - super.send(queue, message, deliveryMode, priority, timeToLive); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelTopic.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelTopic.class deleted file mode 100644 index ca223fb32..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelTopic.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelTopic.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelTopic.java deleted file mode 100644 index 32b24ee2e..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelTopic.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * 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.camel; - -import javax.jms.JMSException; -import javax.jms.Topic; -import javax.jms.TopicPublisher; -import javax.jms.TopicSubscriber; - -import org.apache.activemq.ActiveMQSession; - -/** - * A JMS {@link javax.jms.Topic} object which refers to a Camel endpoint - * - * - */ -public class CamelTopic extends CamelDestination implements Topic { - - public CamelTopic(String uri) { - super(uri); - } - - public String getTopicName() throws JMSException { - return getUri(); - } - - public TopicPublisher createPublisher(ActiveMQSession session) throws JMSException { - return new CamelTopicPublisher(this, resolveEndpoint(session), session); - } - - public TopicSubscriber createDurableSubscriber(ActiveMQSession session, String name, String messageSelector, boolean noLocal) { - return new CamelTopicSubscriber(this, resolveEndpoint(session), session, name, messageSelector, noLocal); - } - - -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelTopicPublisher.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelTopicPublisher.class deleted file mode 100644 index 969b26380..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelTopicPublisher.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelTopicPublisher.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelTopicPublisher.java deleted file mode 100644 index 438067ab7..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelTopicPublisher.java +++ /dev/null @@ -1,146 +0,0 @@ -/** - * 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.camel; - -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.Topic; -import javax.jms.TopicPublisher; - -import org.apache.activemq.ActiveMQSession; -import org.apache.camel.Endpoint; - -/** - * A JMS {@link javax.jms.TopicPublisher} which sends message exchanges to a - * Camel {@link Endpoint} - * - * - */ -public class CamelTopicPublisher extends CamelMessageProducer implements TopicPublisher { - - public CamelTopicPublisher(CamelTopic destination, Endpoint endpoint, ActiveMQSession session) throws JMSException { - super(destination, endpoint, session); - } - - - /** - * Gets the topic associated with this TopicPublisher. - * - * @return this publisher's topic - * @throws JMSException if the JMS provider fails to get the topic for this - * TopicPublisher due to some internal error. - */ - - public Topic getTopic() throws JMSException { - return (Topic) super.getDestination(); - } - - /** - * Publishes a message to the topic. Uses the TopicPublisher's - * default delivery mode, priority, and time to live. - * - * @param message the message to publish - * @throws JMSException if the JMS provider fails to publish the message due to - * some internal error. - * @throws javax.jms.MessageFormatException if an invalid message is specified. - * @throws javax.jms.InvalidDestinationException if a client uses this method with a TopicPublisher - * with an invalid topic. - * @throws java.lang.UnsupportedOperationException - * if a client uses this method with a TopicPublisher - * that did not specify a topic at creation time. - * @see javax.jms.MessageProducer#getDeliveryMode() - * @see javax.jms.MessageProducer#getTimeToLive() - * @see javax.jms.MessageProducer#getPriority() - */ - - public void publish(Message message) throws JMSException { - super.send(message); - } - - /** - * Publishes a message to the topic, specifying delivery mode, priority, - * and time to live. - * - * @param message the message to publish - * @param deliveryMode the delivery mode to use - * @param priority the priority for this message - * @param timeToLive the message's lifetime (in milliseconds) - * @throws JMSException if the JMS provider fails to publish the message due to - * some internal error. - * @throws javax.jms.MessageFormatException if an invalid message is specified. - * @throws javax.jms.InvalidDestinationException if a client uses this method with a TopicPublisher - * with an invalid topic. - * @throws java.lang.UnsupportedOperationException - * if a client uses this method with a TopicPublisher - * that did not specify a topic at creation time. - */ - - public void publish(Message message, int deliveryMode, int priority, - long timeToLive) throws JMSException { - super.send(message, deliveryMode, priority, timeToLive); - } - - /** - * Publishes a message to a topic for an unidentified message producer. - * Uses the TopicPublisher's default delivery mode, - * priority, and time to live. - *

    - *

    - * Typically, a message producer is assigned a topic at creation time; - * however, the JMS API also supports unidentified message producers, which - * require that the topic be supplied every time a message is published. - * - * @param topic the topic to publish this message to - * @param message the message to publish - * @throws JMSException if the JMS provider fails to publish the message due to - * some internal error. - * @throws javax.jms.MessageFormatException if an invalid message is specified. - * @throws javax.jms.InvalidDestinationException if a client uses this method with an invalid topic. - * @see javax.jms.MessageProducer#getDeliveryMode() - * @see javax.jms.MessageProducer#getTimeToLive() - * @see javax.jms.MessageProducer#getPriority() - */ - - public void publish(Topic topic, Message message) throws JMSException { - super.send(topic, message); - } - - /** - * Publishes a message to a topic for an unidentified message producer, - * specifying delivery mode, priority and time to live. - *

    - *

    - * Typically, a message producer is assigned a topic at creation time; - * however, the JMS API also supports unidentified message producers, which - * require that the topic be supplied every time a message is published. - * - * @param topic the topic to publish this message to - * @param message the message to publish - * @param deliveryMode the delivery mode to use - * @param priority the priority for this message - * @param timeToLive the message's lifetime (in milliseconds) - * @throws JMSException if the JMS provider fails to publish the message due to - * some internal error. - * @throws javax.jms.MessageFormatException if an invalid message is specified. - * @throws javax.jms.InvalidDestinationException if a client uses this method with an invalid topic. - */ - - public void publish(Topic topic, Message message, int deliveryMode, - int priority, long timeToLive) throws JMSException { - super.send(topic, message, deliveryMode, priority, timeToLive); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelTopicSubscriber.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelTopicSubscriber.class deleted file mode 100644 index 5016a41b6..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelTopicSubscriber.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelTopicSubscriber.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelTopicSubscriber.java deleted file mode 100644 index 8e772ca35..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/CamelTopicSubscriber.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * 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.camel; - -import javax.jms.JMSException; -import javax.jms.Topic; -import javax.jms.TopicSubscriber; - -import org.apache.activemq.ActiveMQSession; -import org.apache.camel.Endpoint; - -/** - * A JMS {@link javax.jms.TopicSubscriber} which consumes message exchanges from a - * Camel {@link Endpoint} - * - * - */ -public class CamelTopicSubscriber extends CamelMessageConsumer implements TopicSubscriber { - - public CamelTopicSubscriber(CamelTopic destination, Endpoint endpoint, ActiveMQSession session, String name, String messageSelector, boolean noLocal) { - super(destination, endpoint, session, messageSelector, noLocal); - } - - /** - * Gets the Topic associated with this subscriber. - * - * @return this subscriber's Topic - * @throws javax.jms.JMSException if the JMS provider fails to get the topic for this topic - * subscriber due to some internal error. - */ - - public Topic getTopic() throws JMSException { - checkClosed(); - return (Topic) super.getDestination(); - } - - /** - * Gets the NoLocal attribute for this subscriber. The - * default value for this attribute is false. - * - * @return true if locally published messages are being inhibited - * @throws JMSException if the JMS provider fails to get the NoLocal - * attribute for this topic subscriber due to some - * internal error. - */ - - public boolean getNoLocal() throws JMSException { - checkClosed(); - return super.isNoLocal(); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/ActiveMQComponent.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/ActiveMQComponent.class deleted file mode 100644 index dbb43141c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/ActiveMQComponent.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/ActiveMQComponent.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/ActiveMQComponent.java deleted file mode 100644 index 478e4a9c0..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/ActiveMQComponent.java +++ /dev/null @@ -1,269 +0,0 @@ -/** - * 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.camel.component; - -import java.net.URISyntaxException; -import java.util.*; -import java.util.concurrent.CopyOnWriteArrayList; - -import org.apache.activemq.ActiveMQConnectionFactory; -import org.apache.activemq.EnhancedConnection; -import org.apache.activemq.Service; -import org.apache.activemq.advisory.DestinationSource; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.camel.CamelContext; -import org.apache.camel.ComponentConfiguration; -import org.apache.camel.component.jms.JmsComponent; -import org.apache.camel.component.jms.JmsConfiguration; -import org.apache.camel.spi.EndpointCompleter; -import org.apache.camel.util.IntrospectionSupport; -import org.apache.camel.util.ObjectHelper; -import org.apache.camel.util.URISupport; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.jms.connection.SingleConnectionFactory; - -import javax.jms.Connection; - -/** - * The ActiveMQ Component - * - * - */ -public class ActiveMQComponent extends JmsComponent implements EndpointCompleter { - private final CopyOnWriteArrayList singleConnectionFactoryList = - new CopyOnWriteArrayList(); - private final CopyOnWriteArrayList pooledConnectionFactoryServiceList = - new CopyOnWriteArrayList(); - private static final transient Logger LOG = LoggerFactory.getLogger(ActiveMQComponent.class); - private boolean exposeAllQueues; - private CamelEndpointLoader endpointLoader; - - private EnhancedConnection connection; - DestinationSource source; - boolean sourceInitialized = false; - - /** - * Creates an ActiveMQ Component - * - * @return the created component - */ - public static ActiveMQComponent activeMQComponent() { - return new ActiveMQComponent(); - } - - /** - * Creates an ActiveMQ Component - * connecting to the given broker URL - * - * @param brokerURL the URL to connect to - * @return the created component - */ - public static ActiveMQComponent activeMQComponent(String brokerURL) { - ActiveMQComponent answer = new ActiveMQComponent(); - if (answer.getConfiguration() instanceof ActiveMQConfiguration) { - ((ActiveMQConfiguration) answer.getConfiguration()) - .setBrokerURL(brokerURL); - } - - // set the connection factory with the provided broker url - answer.setConnectionFactory(new ActiveMQConnectionFactory(brokerURL)); - return answer; - } - - public ActiveMQComponent() { - } - - public ActiveMQComponent(CamelContext context) { - super(context); - } - - public ActiveMQComponent(ActiveMQConfiguration configuration) { - super(configuration); - } - - - public void setBrokerURL(String brokerURL) { - if (getConfiguration() instanceof ActiveMQConfiguration) { - ((ActiveMQConfiguration)getConfiguration()).setBrokerURL(brokerURL); - } - } - - public void setUserName(String userName) { - if (getConfiguration() instanceof ActiveMQConfiguration) { - ((ActiveMQConfiguration)getConfiguration()).setUserName(userName); - } - } - - public void setPassword(String password) { - if (getConfiguration() instanceof ActiveMQConfiguration) { - ((ActiveMQConfiguration)getConfiguration()).setPassword(password); - } - } - - public boolean isExposeAllQueues() { - return exposeAllQueues; - } - - /** - * If enabled this will cause all Queues in the ActiveMQ broker to be eagerly populated into the CamelContext - * so that they can be easily browsed by any Camel tooling. This option is disabled by default. - * - * @param exposeAllQueues - */ - public void setExposeAllQueues(boolean exposeAllQueues) { - this.exposeAllQueues = exposeAllQueues; - } - - public void setUsePooledConnection(boolean usePooledConnection) { - if (getConfiguration() instanceof ActiveMQConfiguration) { - ((ActiveMQConfiguration)getConfiguration()).setUsePooledConnection(usePooledConnection); - } - } - - public void setUseSingleConnection(boolean useSingleConnection) { - if (getConfiguration() instanceof ActiveMQConfiguration) { - ((ActiveMQConfiguration)getConfiguration()).setUseSingleConnection(useSingleConnection); - } - } - - protected void addPooledConnectionFactoryService(Service pooledConnectionFactoryService) { - pooledConnectionFactoryServiceList.add(pooledConnectionFactoryService); - } - - protected void addSingleConnectionFactory(SingleConnectionFactory singleConnectionFactory) { - singleConnectionFactoryList.add(singleConnectionFactory); - } - - @Override - @SuppressWarnings("unchecked") - protected String convertPathToActualDestination(String path, Map parameters) { - // support ActiveMQ destination options using the destination. prefix - // http://activemq.apache.org/destination-options.html - Map options = IntrospectionSupport.extractProperties(parameters, "destination."); - - String query; - try { - query = URISupport.createQueryString(options); - } catch (URISyntaxException e) { - throw ObjectHelper.wrapRuntimeCamelException(e); - } - - // if we have destination options then append them to the destination name - if (ObjectHelper.isNotEmpty(query)) { - return path + "?" + query; - } else { - return path; - } - } - - @Override - protected void doStart() throws Exception { - super.doStart(); - - if (isExposeAllQueues()) { - createDestinationSource(); - endpointLoader = new CamelEndpointLoader(getCamelContext(), source); - endpointLoader.afterPropertiesSet(); - } - } - - protected void createDestinationSource() { - try { - if (source == null) { - if (connection == null) { - Connection value = getConfiguration().getConnectionFactory().createConnection(); - if (value instanceof EnhancedConnection) { - connection = (EnhancedConnection) value; - } else { - throw new IllegalArgumentException("Created JMS Connection is not an EnhancedConnection: " + value); - } - connection.start(); - } - source = connection.getDestinationSource(); - } - } catch (Throwable t) { - LOG.info("Can't get destination source, endpoint completer will not work", t); - } - } - - @Override - protected void doStop() throws Exception { - if (source != null) { - source.stop(); - source = null; - } - if (connection != null) { - connection.close(); - connection = null; - } - for (Service s : pooledConnectionFactoryServiceList) { - s.stop(); - } - pooledConnectionFactoryServiceList.clear(); - for (SingleConnectionFactory s : singleConnectionFactoryList) { - s.destroy(); - } - singleConnectionFactoryList.clear(); - super.doStop(); - } - - @Override - public void setConfiguration(JmsConfiguration configuration) { - if (configuration instanceof ActiveMQConfiguration) { - ((ActiveMQConfiguration) configuration).setActiveMQComponent(this); - } - super.setConfiguration(configuration); - } - - @Override - protected JmsConfiguration createConfiguration() { - ActiveMQConfiguration answer = new ActiveMQConfiguration(); - answer.setActiveMQComponent(this); - return answer; - } - - @Override - public List completeEndpointPath(ComponentConfiguration componentConfiguration, String completionText) { - // try to initialize destination source only the first time - if (!sourceInitialized) { - createDestinationSource(); - sourceInitialized = true; - } - ArrayList answer = new ArrayList(); - if (source != null) { - Set candidates = source.getQueues(); - String destinationName = completionText; - if (completionText.startsWith("topic:")) { - candidates = source.getTopics(); - destinationName = completionText.substring(6); - } else if (completionText.startsWith("queue:")) { - destinationName = completionText.substring(6); - } - - Iterator it = candidates.iterator(); - - while (it.hasNext()) { - ActiveMQDestination destination = (ActiveMQDestination) it.next(); - if (destination.getPhysicalName().startsWith(destinationName)) { - answer.add(destination.getPhysicalName()); - } - } - } - return answer; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/ActiveMQConfiguration.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/ActiveMQConfiguration.class deleted file mode 100644 index ebd4ca305..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/ActiveMQConfiguration.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/ActiveMQConfiguration.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/ActiveMQConfiguration.java deleted file mode 100644 index 547f3c3f6..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/ActiveMQConfiguration.java +++ /dev/null @@ -1,194 +0,0 @@ -/** - * 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.camel.component; - -import java.lang.reflect.Constructor; - -import javax.jms.ConnectionFactory; - -import org.apache.activemq.Service; -import org.apache.activemq.spring.ActiveMQConnectionFactory; -import org.apache.camel.component.jms.JmsConfiguration; -import org.springframework.jms.connection.SingleConnectionFactory; -import org.springframework.jms.connection.JmsTransactionManager; -import org.springframework.jms.core.JmsTemplate; -import org.springframework.transaction.PlatformTransactionManager; - -/** - * - */ -public class ActiveMQConfiguration extends JmsConfiguration { - private String brokerURL = ActiveMQConnectionFactory.DEFAULT_BROKER_URL; - private boolean useSingleConnection = false; - private boolean usePooledConnection = true; - private String userName; - private String password; - private ActiveMQComponent activeMQComponent; - - public ActiveMQConfiguration() { - } - - public String getBrokerURL() { - return brokerURL; - } - - /** - * Sets the broker URL to use to connect to ActiveMQ using the - * ActiveMQ URI format - * - * @param brokerURL the URL of the broker. - */ - public void setBrokerURL(String brokerURL) { - this.brokerURL = brokerURL; - } - - public boolean isUseSingleConnection() { - return useSingleConnection; - } - - public String getUserName() { - return userName; - } - - /** - * Sets the username to be used to login to ActiveMQ - * @param userName - */ - public void setUserName(String userName) { - this.userName = userName; - } - - public String getPassword() { - return password; - } - - /** - * Sets the password/passcode used to login to ActiveMQ - * - * @param password - */ - public void setPassword(String password) { - this.password = password; - } - - /** - * Enables or disables whether a Spring {@link SingleConnectionFactory} will be used so that when - * messages are sent to ActiveMQ from outside of a message consuming thread, pooling will be used rather - * than the default with the Spring {@link JmsTemplate} which will create a new connection, session, producer - * for each message then close them all down again. - *

    - * The default value is true so that a single connection is used by default. - * - * @param useSingleConnection - */ - public void setUseSingleConnection(boolean useSingleConnection) { - this.useSingleConnection = useSingleConnection; - } - - public boolean isUsePooledConnection() { - return usePooledConnection; - } - - /** - * Enables or disables whether a PooledConnectionFactory will be used so that when - * messages are sent to ActiveMQ from outside of a message consuming thread, pooling will be used rather - * than the default with the Spring {@link JmsTemplate} which will create a new connection, session, producer - * for each message then close them all down again. - *

    - * The default value is false by default as it requires an extra dependency on commons-pool. - */ - public void setUsePooledConnection(boolean usePooledConnection) { - this.usePooledConnection = usePooledConnection; - } - - /** - * Factory method to create a default transaction manager if one is not specified - */ - protected PlatformTransactionManager createTransactionManager() { - JmsTransactionManager answer = new JmsTransactionManager(getConnectionFactory()); - answer.afterPropertiesSet(); - return answer; - } - - protected void setActiveMQComponent(ActiveMQComponent activeMQComponent) { - this.activeMQComponent = activeMQComponent; - } - - @Override - protected ConnectionFactory createConnectionFactory() { - ActiveMQConnectionFactory answer = new ActiveMQConnectionFactory(); - if (userName != null) { - answer.setUserName(userName); - } - if (password != null) { - answer.setPassword(password); - } - if (answer.getBeanName() == null) { - answer.setBeanName("Camel"); - } - answer.setBrokerURL(getBrokerURL()); - if (isUseSingleConnection()) { - SingleConnectionFactory scf = new SingleConnectionFactory(answer); - if (activeMQComponent != null) { - activeMQComponent.addSingleConnectionFactory(scf); - } - return scf; - } - else if (isUsePooledConnection()) { - ConnectionFactory pcf = createPooledConnectionFactory(answer); - if (activeMQComponent != null) { - activeMQComponent.addPooledConnectionFactoryService((Service) pcf); - } - return pcf; - } - else { - return answer; - } - } - - protected ConnectionFactory createPooledConnectionFactory(ActiveMQConnectionFactory connectionFactory) { - // lets not use classes directly to avoid a runtime dependency on commons-pool - // for folks not using this option - try { - Class type = loadClass("org.apache.activemq.pool.PooledConnectionFactory", getClass().getClassLoader()); - Constructor constructor = type.getConstructor(org.apache.activemq.ActiveMQConnectionFactory.class); - return (ConnectionFactory) constructor.newInstance(connectionFactory); - } - catch (Exception e) { - throw new RuntimeException("Failed to instantiate PooledConnectionFactory: " + e, e); - } - } - - public static Class loadClass(String name, ClassLoader loader) throws ClassNotFoundException { - ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); - if (contextClassLoader != null) { - try { - return contextClassLoader.loadClass(name); - } - catch (ClassNotFoundException e) { - try { - return loader.loadClass(name); - } - catch (ClassNotFoundException e1) { - throw e1; - } - } - } else { - return loader.loadClass(name); - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/CamelEndpointLoader$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/CamelEndpointLoader$1.class deleted file mode 100644 index 85759d11e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/CamelEndpointLoader$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/CamelEndpointLoader.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/CamelEndpointLoader.class deleted file mode 100644 index fda04d0d0..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/CamelEndpointLoader.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/CamelEndpointLoader.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/CamelEndpointLoader.java deleted file mode 100644 index f67b664a2..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/CamelEndpointLoader.java +++ /dev/null @@ -1,179 +0,0 @@ -/** - * - * 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.camel.component; - -import java.util.Set; - -import javax.annotation.PostConstruct; - -import org.apache.activemq.advisory.DestinationEvent; -import org.apache.activemq.advisory.DestinationListener; -import org.apache.activemq.advisory.DestinationSource; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ActiveMQQueue; -import org.apache.activemq.command.ActiveMQTopic; -import org.apache.camel.CamelContext; -import org.apache.camel.CamelContextAware; -import org.apache.camel.Endpoint; -import org.apache.camel.component.jms.JmsEndpoint; -import org.apache.camel.component.jms.JmsQueueEndpoint; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * A helper bean which populates a {@link CamelContext} with ActiveMQ Queue endpoints - * - * @org.apache.xbean.XBean - */ -public class CamelEndpointLoader implements CamelContextAware { - private static final transient Logger LOG = LoggerFactory.getLogger(CamelEndpointLoader.class); - private CamelContext camelContext; - private ActiveMQComponent component; - DestinationSource source; - - public CamelEndpointLoader() { - } - - public CamelEndpointLoader(CamelContext camelContext, DestinationSource source) { - this.camelContext = camelContext; - this.source = source; - } - - /** - * JSR-250 callback wrapper; converts checked exceptions to runtime exceptions - * - * delegates to afterPropertiesSet, done to prevent backwards incompatible signature change - * - * fix: AMQ-4676 - */ - @PostConstruct - private void postConstruct() { - try { - afterPropertiesSet(); - } catch (Exception ex) { - throw new RuntimeException(ex); - } - } - - /** - * - * @throws Exception - * @org.apache.xbean.InitMethod - */ - public void afterPropertiesSet() throws Exception { - if (source != null) { - source.setDestinationListener(new DestinationListener() { - @Override - public void onDestinationEvent(DestinationEvent event) { - try { - ActiveMQDestination destination = event.getDestination(); - if (destination instanceof ActiveMQQueue) { - ActiveMQQueue queue = (ActiveMQQueue) destination; - if (event.isAddOperation()) { - addQueue(queue); - } else { - removeQueue(queue); - } - } else if (destination instanceof ActiveMQTopic) { - ActiveMQTopic topic = (ActiveMQTopic) destination; - if (event.isAddOperation()) { - addTopic(topic); - } else { - removeTopic(topic); - } - } - } catch (Exception e) { - LOG.warn("Caught: " + e, e); - } - } - }); - - Set queues = source.getQueues(); - for (ActiveMQQueue queue : queues) { - addQueue(queue); - } - - Set topics = source.getTopics(); - for (ActiveMQTopic topic : topics) { - addTopic(topic); - } - } - } - - // Properties - //------------------------------------------------------------------------- - @Override - public CamelContext getCamelContext() { - return camelContext; - } - - @Override - public void setCamelContext(CamelContext camelContext) { - this.camelContext = camelContext; - } - - public ActiveMQComponent getComponent() { - if (component == null) { - component = camelContext.getComponent("activemq", ActiveMQComponent.class); - } - return component; - } - - public void setComponent(ActiveMQComponent component) { - this.component = component; - } - - // Implementation methods - //------------------------------------------------------------------------- - - protected void addQueue(ActiveMQQueue queue) throws Exception { - String queueUri = getQueueUri(queue); - ActiveMQComponent jmsComponent = getComponent(); - Endpoint endpoint = new JmsQueueEndpoint(queueUri, jmsComponent, queue.getPhysicalName(), jmsComponent.getConfiguration()); - camelContext.addEndpoint(queueUri, endpoint); - } - - protected String getQueueUri(ActiveMQQueue queue) { - return "activemq:" + queue.getPhysicalName(); - } - - protected void removeQueue(ActiveMQQueue queue) throws Exception { - String queueUri = getQueueUri(queue); - // lur cache of endpoints so they will disappear in time - // this feature needs a new component api - list available endpoints - camelContext.removeEndpoints(queueUri); - } - - protected void addTopic(ActiveMQTopic topic) throws Exception { - String topicUri = getTopicUri(topic); - ActiveMQComponent jmsComponent = getComponent(); - Endpoint endpoint = new JmsEndpoint(topicUri, jmsComponent, topic.getPhysicalName(), true, jmsComponent.getConfiguration()); - camelContext.addEndpoint(topicUri, endpoint); - } - - protected String getTopicUri(ActiveMQTopic topic) { - return "activemq:topic:" + topic.getPhysicalName(); - } - - protected void removeTopic(ActiveMQTopic topic) throws Exception { - String topicUri = getTopicUri(topic); - // lur cache of endpoints so they will disappear in time - // this feature needs a new component api - list available endpoints - camelContext.removeEndpoints(topicUri); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/broker/BrokerComponent.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/broker/BrokerComponent.class deleted file mode 100644 index fbd22b0fe..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/broker/BrokerComponent.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/broker/BrokerComponent.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/broker/BrokerComponent.java deleted file mode 100644 index 3fce9ae88..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/broker/BrokerComponent.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - * 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.camel.component.broker; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.apache.activemq.broker.view.MessageBrokerView; -import org.apache.activemq.broker.view.MessageBrokerViewRegistry; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.camel.ComponentConfiguration; -import org.apache.camel.Endpoint; -import org.apache.camel.component.jms.JmsConfiguration; -import org.apache.camel.impl.UriEndpointComponent; -import org.apache.camel.spi.EndpointCompleter; -import static org.apache.camel.util.ObjectHelper.removeStartingCharacters; - -public class BrokerComponent extends UriEndpointComponent implements EndpointCompleter { - - public BrokerComponent() { - super(BrokerEndpoint.class); - } - - @Override - protected Endpoint createEndpoint(String uri, String remaining, Map parameters) throws Exception { - BrokerConfiguration brokerConfiguration = new BrokerConfiguration(); - setProperties(brokerConfiguration, parameters); - - byte destinationType = ActiveMQDestination.QUEUE_TYPE; - - if (remaining.startsWith(JmsConfiguration.QUEUE_PREFIX)) { - remaining = removeStartingCharacters(remaining.substring(JmsConfiguration.QUEUE_PREFIX.length()), '/'); - } else if (remaining.startsWith(JmsConfiguration.TOPIC_PREFIX)) { - destinationType = ActiveMQDestination.TOPIC_TYPE; - remaining = removeStartingCharacters(remaining.substring(JmsConfiguration.TOPIC_PREFIX.length()), '/'); - } else if (remaining.startsWith(JmsConfiguration.TEMP_QUEUE_PREFIX)) { - destinationType = ActiveMQDestination.TEMP_QUEUE_TYPE; - remaining = removeStartingCharacters(remaining.substring(JmsConfiguration.TEMP_QUEUE_PREFIX.length()), '/'); - } else if (remaining.startsWith(JmsConfiguration.TEMP_TOPIC_PREFIX)) { - destinationType = ActiveMQDestination.TEMP_TOPIC_TYPE; - remaining = removeStartingCharacters(remaining.substring(JmsConfiguration.TEMP_TOPIC_PREFIX.length()), '/'); - } - - - ActiveMQDestination destination = ActiveMQDestination.createDestination(remaining, destinationType); - BrokerEndpoint brokerEndpoint = new BrokerEndpoint(uri, this, destination, brokerConfiguration); - return brokerEndpoint; - } - - - @Override - public List completeEndpointPath(ComponentConfiguration componentConfiguration, String completionText) { - String brokerName = String.valueOf(componentConfiguration.getParameter("brokerName")); - MessageBrokerView messageBrokerView = MessageBrokerViewRegistry.getInstance().lookup(brokerName); - if (messageBrokerView != null) { - String destinationName = completionText; - Set set = messageBrokerView.getQueues(); - if (completionText.startsWith("topic:")) { - set = messageBrokerView.getTopics(); - destinationName = completionText.substring(6); - } else if (completionText.startsWith("queue:")) { - destinationName = completionText.substring(6); - } - ArrayList answer = new ArrayList(); - for (ActiveMQDestination destination : set) { - if (destination.getPhysicalName().startsWith(destinationName)) { - answer.add(destination.getPhysicalName()); - } - } - return answer; - - } - return null; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/broker/BrokerConfiguration.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/broker/BrokerConfiguration.class deleted file mode 100644 index f2b0e5f04..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/broker/BrokerConfiguration.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/broker/BrokerConfiguration.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/broker/BrokerConfiguration.java deleted file mode 100644 index 583720ede..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/broker/BrokerConfiguration.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * 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.camel.component.broker; - -import org.apache.camel.spi.UriParam; - -public class BrokerConfiguration { - - @UriParam - private String brokerName = ""; - - - public String getBrokerName() { - return brokerName; - } - - public void setBrokerName(String brokerName) { - this.brokerName = brokerName; - } - - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/broker/BrokerConsumer.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/broker/BrokerConsumer.class deleted file mode 100644 index a9fa90d62..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/broker/BrokerConsumer.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/broker/BrokerConsumer.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/broker/BrokerConsumer.java deleted file mode 100644 index 39b25e240..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/broker/BrokerConsumer.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * 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.camel.component.broker; - -import org.apache.activemq.broker.ProducerBrokerExchange; -import org.apache.activemq.broker.inteceptor.MessageInterceptor; -import org.apache.activemq.command.Message; -import org.apache.camel.Endpoint; -import org.apache.camel.Exchange; -import org.apache.camel.ExchangePattern; -import org.apache.camel.Processor; -import org.apache.camel.component.jms.JmsBinding; -import org.apache.camel.impl.DefaultConsumer; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class BrokerConsumer extends DefaultConsumer implements MessageInterceptor { - protected final transient Logger logger = LoggerFactory.getLogger(BrokerConsumer.class); - private final JmsBinding jmsBinding = new JmsBinding(); - - public BrokerConsumer(Endpoint endpoint, Processor processor) { - super(endpoint, processor); - } - - @Override - protected void doStart() throws Exception { - super.doStart(); - ((BrokerEndpoint) getEndpoint()).addMessageInterceptor(this); - } - - @Override - protected void doStop() throws Exception { - ((BrokerEndpoint) getEndpoint()).removeMessageInterceptor(this); - super.doStop(); - } - - @Override - public void intercept(ProducerBrokerExchange producerExchange, Message message) { - Exchange exchange = getEndpoint().createExchange(ExchangePattern.InOnly); - - exchange.setIn(new BrokerJmsMessage((javax.jms.Message) message, jmsBinding)); - exchange.setProperty(Exchange.BINDING, jmsBinding); - exchange.setProperty(BrokerEndpoint.PRODUCER_BROKER_EXCHANGE, producerExchange); - try { - getProcessor().process(exchange); - } catch (Exception e) { - logger.error("Failed to process " + exchange, e); - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/broker/BrokerEndpoint.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/broker/BrokerEndpoint.class deleted file mode 100644 index 4e19e1a40..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/broker/BrokerEndpoint.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/broker/BrokerEndpoint.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/broker/BrokerEndpoint.java deleted file mode 100644 index e32766901..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/broker/BrokerEndpoint.java +++ /dev/null @@ -1,132 +0,0 @@ -/** - * 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.camel.component.broker; - -import java.util.List; -import java.util.concurrent.CopyOnWriteArrayList; - -import org.apache.activemq.broker.ProducerBrokerExchange; -import org.apache.activemq.broker.inteceptor.MessageInterceptor; -import org.apache.activemq.broker.inteceptor.MessageInterceptorRegistry; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.Message; -import org.apache.camel.Consumer; -import org.apache.camel.MultipleConsumersSupport; -import org.apache.camel.Processor; -import org.apache.camel.Producer; -import org.apache.camel.Service; -import org.apache.camel.api.management.ManagedResource; -import org.apache.camel.impl.DefaultEndpoint; -import org.apache.camel.spi.UriEndpoint; -import org.apache.camel.spi.UriParam; -import org.apache.camel.spi.UriPath; -import org.apache.camel.util.UnsafeUriCharactersEncoder; - -@ManagedResource(description = "Managed Camel Broker Endpoint") -@UriEndpoint(scheme = "broker", consumerClass = BrokerConsumer.class) - -public class BrokerEndpoint extends DefaultEndpoint implements MultipleConsumersSupport, Service { - static final String PRODUCER_BROKER_EXCHANGE = "producerBrokerExchange"; - - @UriParam - private final BrokerConfiguration configuration; - private MessageInterceptorRegistry messageInterceptorRegistry; - - - @UriPath - private final ActiveMQDestination destination; - private List messageInterceptorList = new CopyOnWriteArrayList(); - - public BrokerEndpoint(String uri, BrokerComponent component, ActiveMQDestination destination, BrokerConfiguration configuration) { - super(UnsafeUriCharactersEncoder.encode(uri), component); - this.destination = destination; - this.configuration = configuration; - } - - @Override - public Producer createProducer() throws Exception { - BrokerProducer producer = new BrokerProducer(this); - return producer; - } - - @Override - public Consumer createConsumer(Processor processor) throws Exception { - BrokerConsumer consumer = new BrokerConsumer(this, processor); - configureConsumer(consumer); - return consumer; - } - - - @Override - public boolean isSingleton() { - return false; - } - - @Override - public boolean isMultipleConsumersSupported() { - return true; - } - - public ActiveMQDestination getDestination() { - return destination; - } - - - @Override - protected void doStart() throws Exception { - super.doStart(); - messageInterceptorRegistry = MessageInterceptorRegistry.getInstance().get(configuration.getBrokerName()); - for (MessageInterceptor messageInterceptor : messageInterceptorList) { - addMessageInterceptor(messageInterceptor); - } - messageInterceptorList.clear(); - } - - @Override - protected void doStop() throws Exception { - super.doStop(); - } - - protected void addMessageInterceptor(MessageInterceptor messageInterceptor) { - if (isStarted()) { - messageInterceptorRegistry.addMessageInterceptor(destination, messageInterceptor); - } else { - messageInterceptorList.add(messageInterceptor); - } - } - - protected void removeMessageInterceptor(MessageInterceptor messageInterceptor) { - messageInterceptorRegistry.removeMessageInterceptor(destination, messageInterceptor); - - } - - protected void inject(ProducerBrokerExchange producerBrokerExchange, Message message) throws Exception { - ProducerBrokerExchange pbe = producerBrokerExchange; - if (message != null) { - message.setDestination(destination); - if (producerBrokerExchange != null && producerBrokerExchange.getRegionDestination() != null){ - if (!producerBrokerExchange.getRegionDestination().getActiveMQDestination().equals(destination)){ - //The message broker will create a new ProducerBrokerExchange with the - //correct region broker set - pbe = null; - } - } - - messageInterceptorRegistry.injectMessage(pbe, message); - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/broker/BrokerJmsMessage.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/broker/BrokerJmsMessage.class deleted file mode 100644 index fded22cf7..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/broker/BrokerJmsMessage.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/broker/BrokerJmsMessage.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/broker/BrokerJmsMessage.java deleted file mode 100644 index 02dcabefd..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/broker/BrokerJmsMessage.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * 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.camel.component.broker; - -import javax.jms.Message; -import org.apache.camel.component.jms.JmsBinding; -import org.apache.camel.component.jms.JmsMessage; -import org.apache.camel.util.ObjectHelper; - -public class BrokerJmsMessage extends JmsMessage { - public BrokerJmsMessage(Message jmsMessage, JmsBinding binding) { - super(jmsMessage, binding); - } - - @Override - public String toString() { - if (getJmsMessage() != null) { - try { - return "BrokerJmsMessage[JMSMessageID: " + getJmsMessage().getJMSMessageID(); - } catch (Exception e) { - } - } - return "BrokerJmsMessage@" + ObjectHelper.getIdentityHashCode(this); - } - - @Override - public void copyFrom(org.apache.camel.Message that) { - super.copyFrom(that); - if (that instanceof JmsMessage && getJmsMessage() == null) { - setJmsMessage(((JmsMessage) that).getJmsMessage()); - } - } - - - @Override - public BrokerJmsMessage newInstance() { - return new BrokerJmsMessage(null, getBinding()); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/broker/BrokerProducer.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/broker/BrokerProducer.class deleted file mode 100644 index f2f590514..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/broker/BrokerProducer.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/broker/BrokerProducer.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/broker/BrokerProducer.java deleted file mode 100644 index c12fbee6f..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/broker/BrokerProducer.java +++ /dev/null @@ -1,159 +0,0 @@ -/** - * 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.camel.component.broker; - -import java.util.Map; -import java.util.concurrent.RejectedExecutionException; - -import org.apache.activemq.broker.ProducerBrokerExchange; -import org.apache.activemq.camel.converter.ActiveMQMessageConverter; -import org.apache.activemq.command.ActiveMQMessage; -import org.apache.camel.AsyncCallback; -import org.apache.camel.Exchange; -import org.apache.camel.Message; -import org.apache.camel.component.jms.JmsMessage; -import org.apache.camel.converter.ObjectConverter; -import org.apache.camel.impl.DefaultAsyncProducer; - -public class BrokerProducer extends DefaultAsyncProducer { - private final ActiveMQMessageConverter activeMQConverter = new ActiveMQMessageConverter(); - private final BrokerEndpoint brokerEndpoint; - - public BrokerProducer(BrokerEndpoint endpoint) { - super(endpoint); - brokerEndpoint = endpoint; - } - - - @Override - public boolean process(Exchange exchange, AsyncCallback callback) { - // deny processing if we are not started - if (!isRunAllowed()) { - if (exchange.getException() == null) { - exchange.setException(new RejectedExecutionException()); - } - // we cannot process so invoke callback - callback.done(true); - return true; - } - - try { - //In the middle of the broker - InOut doesn't make any sense - //so we do in only - return processInOnly(exchange, callback); - - } catch (Throwable e) { - // must catch exception to ensure callback is invoked as expected - // to let Camel error handling deal with this - exchange.setException(e); - callback.done(true); - return true; - } - } - - protected boolean processInOnly(final Exchange exchange, final AsyncCallback callback) { - try { - ActiveMQMessage message = getMessage(exchange); - if (message != null) { - message.setDestination(brokerEndpoint.getDestination()); - //if the ProducerBrokerExchange is null the broker will create it - ProducerBrokerExchange producerBrokerExchange = (ProducerBrokerExchange) exchange.getProperty(BrokerEndpoint.PRODUCER_BROKER_EXCHANGE); - - brokerEndpoint.inject(producerBrokerExchange, message); - - - } - } catch (Exception e) { - exchange.setException(e); - } - callback.done(true); - return true; - } - - private ActiveMQMessage getMessage(Exchange exchange) throws Exception { - ActiveMQMessage result = null; - Message camelMesssage = null; - if (exchange.hasOut()) { - camelMesssage = exchange.getOut(); - } else { - camelMesssage = exchange.getIn(); - } - - Map headers = camelMesssage.getHeaders(); - - /** - * We purposely don't want to support injecting messages half-way through - * broker processing - use the activemq camel component for that - but - * we will support changing message headers and destinations - */ - if (camelMesssage instanceof JmsMessage) { - JmsMessage jmsMessage = (JmsMessage) camelMesssage; - if (jmsMessage.getJmsMessage() instanceof ActiveMQMessage) { - result = (ActiveMQMessage) jmsMessage.getJmsMessage(); - //lets apply any new message headers - setJmsHeaders(result, headers); - } else { - - throw new IllegalStateException("not the original message from the broker " + jmsMessage.getJmsMessage()); - } - } else { - throw new IllegalStateException("not the original message from the broker " + camelMesssage); - } - return result; - } - - private void setJmsHeaders(ActiveMQMessage message, Map headers) { - message.setReadOnlyProperties(false); - for (Map.Entry entry : headers.entrySet()) { - if (entry.getKey().equalsIgnoreCase("JMSDeliveryMode")) { - Object value = entry.getValue(); - if (value instanceof Number) { - Number number = (Number) value; - message.setJMSDeliveryMode(number.intValue()); - } - } - if (entry.getKey().equalsIgnoreCase("JmsPriority")) { - Integer value = ObjectConverter.toInteger(entry.getValue()); - if (value != null) { - message.setJMSPriority(value.intValue()); - } - } - if (entry.getKey().equalsIgnoreCase("JMSTimestamp")) { - Long value = ObjectConverter.toLong(entry.getValue()); - if (value != null) { - message.setJMSTimestamp(value.longValue()); - } - } - if (entry.getKey().equalsIgnoreCase("JMSExpiration")) { - Long value = ObjectConverter.toLong(entry.getValue()); - if (value != null) { - message.setJMSExpiration(value.longValue()); - } - } - if (entry.getKey().equalsIgnoreCase("JMSRedelivered")) { - message.setJMSRedelivered(ObjectConverter.toBool(entry.getValue())); - } - if (entry.getKey().equalsIgnoreCase("JMSType")) { - Object value = entry.getValue(); - if (value != null) { - message.setJMSType(value.toString()); - } - } - } - - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/package.html b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/package.html deleted file mode 100644 index 8dbba189e..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/component/package.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - -Defines the ActiveMQ Component for -Camel to provide great -Enterprise Integration Patterns -integration for ActiveMQ users. - - - - diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/converter/ActiveMQConverter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/converter/ActiveMQConverter.class deleted file mode 100644 index 97f7b1073..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/converter/ActiveMQConverter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/converter/ActiveMQConverter.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/converter/ActiveMQConverter.java deleted file mode 100644 index 4c568cfa4..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/converter/ActiveMQConverter.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * - * 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.camel.converter; - -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.camel.Converter; - -/** - * - */ -@Converter -public class ActiveMQConverter { - /** - * Converts a URL in ActiveMQ syntax to a destination such as to support - * "queue://foo.bar" or 'topic://bar.whatnot". Things default to queues if no scheme. - * - * This allows ActiveMQ destinations to be passed around as Strings and converted back again. - * - * @param name is the name of the queue or the full URI using prefixes queue:// or topic:// - * @return the ActiveMQ destination - */ - @Converter - public static ActiveMQDestination toDestination(String name) { - return ActiveMQDestination.createDestination(name, ActiveMQDestination.QUEUE_TYPE); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/converter/ActiveMQMessageConverter$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/converter/ActiveMQMessageConverter$1.class deleted file mode 100644 index 9a8f3a06e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/converter/ActiveMQMessageConverter$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/converter/ActiveMQMessageConverter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/converter/ActiveMQMessageConverter.class deleted file mode 100644 index 47e59cced..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/converter/ActiveMQMessageConverter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/converter/ActiveMQMessageConverter.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/converter/ActiveMQMessageConverter.java deleted file mode 100644 index 4dec6b364..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/converter/ActiveMQMessageConverter.java +++ /dev/null @@ -1,103 +0,0 @@ -/** - * - * 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.camel.converter; - -import java.io.Serializable; - -import javax.jms.JMSException; -import javax.jms.MessageListener; -import javax.jms.Message; - -import org.apache.activemq.command.ActiveMQMessage; -import org.apache.activemq.command.ActiveMQObjectMessage; -import org.apache.activemq.command.ActiveMQTextMessage; -import org.apache.camel.Converter; -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.camel.component.jms.JmsBinding; -import org.apache.camel.component.jms.JmsEndpoint; - -/** - * - */ -@Converter -public class ActiveMQMessageConverter { - private JmsBinding binding = new JmsBinding(); - - /** - * Converts the inbound message exchange to an ActiveMQ JMS message - * - * @return the ActiveMQ message - */ - @Converter - public ActiveMQMessage toMessage(Exchange exchange) throws JMSException { - ActiveMQMessage message = createActiveMQMessage(exchange); - getBinding().appendJmsProperties(message, exchange); - return message; - } - - /** - * Allows a JMS {@link MessageListener} to be converted to a Camel {@link Processor} - * so that we can provide better - * Bean Integration so that we can use any JMS MessageListener in - * in Camel as a bean - * @param listener the JMS message listener - * @return a newly created Camel Processor which when invoked will invoke - * {@link MessageListener#onMessage(Message)} - */ - @Converter - public Processor toProcessor(final MessageListener listener) { - return new Processor() { - public void process(Exchange exchange) throws Exception { - Message message = toMessage(exchange); - listener.onMessage(message); - } - - @Override - public String toString() { - return "Processor of MessageListener: " + listener; - } - }; - } - - private static ActiveMQMessage createActiveMQMessage(Exchange exchange) throws JMSException { - Object body = exchange.getIn().getBody(); - if (body instanceof String) { - ActiveMQTextMessage answer = new ActiveMQTextMessage(); - answer.setText((String) body); - return answer; - } else if (body instanceof Serializable) { - ActiveMQObjectMessage answer = new ActiveMQObjectMessage(); - answer.setObject((Serializable) body); - return answer; - } else { - return new ActiveMQMessage(); - } - - } - - // Properties - //------------------------------------------------------------------------- - public JmsBinding getBinding() { - return binding; - } - - public void setBinding(JmsBinding binding) { - this.binding = binding; - } -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/converter/IdentityMessageReuseConverter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/converter/IdentityMessageReuseConverter.class deleted file mode 100644 index 94d48db46..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/converter/IdentityMessageReuseConverter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/converter/IdentityMessageReuseConverter.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/converter/IdentityMessageReuseConverter.java deleted file mode 100644 index bb3194ccc..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/converter/IdentityMessageReuseConverter.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * - * 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.camel.converter; - -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.Session; - -import org.apache.activemq.command.ActiveMQMessage; -import org.springframework.jms.support.converter.MessageConversionException; -import org.springframework.jms.support.converter.MessageConverter; -import org.springframework.util.ObjectUtils; - -/** - * Identity conversion, return the original ActiveMQMessage as is, useful when camel does message - * redelivery routing. ReadOnlyPropertes flag inverted to allow - * additional properties to be appended or existing properties to be modified - */ -public class IdentityMessageReuseConverter implements MessageConverter { - - /* (non-Javadoc) - * @see org.springframework.jms.support.converter.MessageConverter#fromMessage(javax.jms.Message) - */ - public Object fromMessage(Message message) throws JMSException, MessageConversionException { - return message; - } - - /* (non-Javadoc) - * @see org.springframework.jms.support.converter.MessageConverter#toMessage(java.lang.Object, javax.jms.Session) - */ - public Message toMessage(Object object, Session session) throws JMSException, MessageConversionException { - if (object instanceof ActiveMQMessage) { - // allow setting additional properties - ((ActiveMQMessage)object).setReadOnlyProperties(false); - return (Message)object; - } else { - throw new MessageConversionException("Cannot reuse object of type [" + - ObjectUtils.nullSafeClassName(object) + "] as ActiveMQMessage message. Message must already be an ActiveMQMessage."); - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/converter/package.html b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/converter/package.html deleted file mode 100644 index 54661c4df..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/converter/package.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - -Defines the Type Converters for working -with JMS and ActiveMQ with Camel -Enterprise Integration Patterns - - - - diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/package.html b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/package.html deleted file mode 100644 index c6b8cd262..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/camel/package.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - -Defines a JMS client which is capable of sending and receiving messages to -Apache Camel -endpoints to provide -Enterprise Integration Patterns -integration in any JMS client application. - - - diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQBlobMessage.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQBlobMessage.class deleted file mode 100644 index 626400d89..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQBlobMessage.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQBlobMessage.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQBlobMessage.java deleted file mode 100644 index bc7a2ecaf..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQBlobMessage.java +++ /dev/null @@ -1,185 +0,0 @@ -/** - * 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.command; - -import java.io.IOException; -import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URL; - -import javax.jms.JMSException; - -import org.apache.activemq.BlobMessage; -import org.apache.activemq.blob.BlobDownloader; -import org.apache.activemq.blob.BlobUploader; -import org.apache.activemq.util.JMSExceptionSupport; - -/** - * An implementation of {@link BlobMessage} for out of band BLOB transfer - * - * - * @openwire:marshaller code="29" - */ -public class ActiveMQBlobMessage extends ActiveMQMessage implements BlobMessage { - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.ACTIVEMQ_BLOB_MESSAGE; - - public static final String BINARY_MIME_TYPE = "application/octet-stream"; - - private String remoteBlobUrl; - private String mimeType; - private String name; - private boolean deletedByBroker; - - private transient BlobUploader blobUploader; - private transient BlobDownloader blobDownloader; - private transient URL url; - - public Message copy() { - ActiveMQBlobMessage copy = new ActiveMQBlobMessage(); - copy(copy); - return copy; - } - - private void copy(ActiveMQBlobMessage copy) { - super.copy(copy); - copy.setRemoteBlobUrl(getRemoteBlobUrl()); - copy.setMimeType(getMimeType()); - copy.setDeletedByBroker(isDeletedByBroker()); - copy.setBlobUploader(getBlobUploader()); - copy.setName(getName()); - } - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - /** - * @openwire:property version=3 cache=false - */ - public String getRemoteBlobUrl() { - return remoteBlobUrl; - } - - public void setRemoteBlobUrl(String remoteBlobUrl) { - this.remoteBlobUrl = remoteBlobUrl; - url = null; - } - - /** - * The MIME type of the BLOB which can be used to apply different content - * types to messages. - * - * @openwire:property version=3 cache=true - */ - public String getMimeType() { - if (mimeType == null) { - return BINARY_MIME_TYPE; - } - return mimeType; - } - - public void setMimeType(String mimeType) { - this.mimeType = mimeType; - } - - public String getName() { - return name; - } - - /** - * The name of the attachment which can be useful information if - * transmitting files over ActiveMQ - * - * @openwire:property version=3 cache=false - */ - public void setName(String name) { - this.name = name; - } - - /** - * @openwire:property version=3 cache=false - */ - public boolean isDeletedByBroker() { - return deletedByBroker; - } - - public void setDeletedByBroker(boolean deletedByBroker) { - this.deletedByBroker = deletedByBroker; - } - - public String getJMSXMimeType() { - return getMimeType(); - } - - public InputStream getInputStream() throws IOException, JMSException { - if(blobDownloader == null) { - return null; - } - return blobDownloader.getInputStream(this); - } - - public URL getURL() throws JMSException { - if (url == null && remoteBlobUrl != null) { - try { - url = new URL(remoteBlobUrl); - } catch (MalformedURLException e) { - throw JMSExceptionSupport.create(e); - } - } - return url; - } - - public void setURL(URL url) { - this.url = url; - remoteBlobUrl = url != null ? url.toExternalForm() : null; - } - - public BlobUploader getBlobUploader() { - return blobUploader; - } - - public void setBlobUploader(BlobUploader blobUploader) { - this.blobUploader = blobUploader; - } - - public BlobDownloader getBlobDownloader() { - return blobDownloader; - } - - public void setBlobDownloader(BlobDownloader blobDownloader) { - this.blobDownloader = blobDownloader; - } - - public void onSend() throws JMSException { - super.onSend(); - - // lets ensure we upload the BLOB first out of band before we send the - // message - if (blobUploader != null) { - try { - URL value = blobUploader.upload(this); - setURL(value); - } catch (IOException e) { - throw JMSExceptionSupport.create(e); - } - } - } - - public void deleteFile() throws IOException, JMSException { - blobDownloader.deleteFile(this); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQBytesMessage$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQBytesMessage$1.class deleted file mode 100644 index dc25419c5..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQBytesMessage$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQBytesMessage.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQBytesMessage.class deleted file mode 100644 index ab66681a3..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQBytesMessage.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQBytesMessage.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQBytesMessage.java deleted file mode 100644 index 6de35aa78..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQBytesMessage.java +++ /dev/null @@ -1,933 +0,0 @@ -/** - * 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.command; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.EOFException; -import java.io.FilterOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.zip.Deflater; -import java.util.zip.DeflaterOutputStream; -import java.util.zip.InflaterInputStream; - -import javax.jms.BytesMessage; -import javax.jms.JMSException; -import javax.jms.MessageEOFException; -import javax.jms.MessageFormatException; -import javax.jms.MessageNotReadableException; -import javax.jms.MessageNotWriteableException; - -import org.apache.activemq.ActiveMQConnection; -import org.apache.activemq.util.ByteArrayInputStream; -import org.apache.activemq.util.ByteArrayOutputStream; -import org.apache.activemq.util.ByteSequence; -import org.apache.activemq.util.ByteSequenceData; -import org.apache.activemq.util.JMSExceptionSupport; - -/** - * A BytesMessage object is used to send a message containing a - * stream of uninterpreted bytes. It inherits from the Message - * interface and adds a bytes message body. The receiver of the message supplies - * the interpretation of the bytes. - *

    - * The BytesMessage methods are based largely on those found in - * java.io.DataInputStream and - * java.io.DataOutputStream. - *

    - * This message type is for client encoding of existing message formats. If - * possible, one of the other self-defining message types should be used - * instead. - *

    - * Although the JMS API allows the use of message properties with byte messages, - * they are typically not used, since the inclusion of properties may affect the - * format. - *

    - * The primitive types can be written explicitly using methods for each type. - * They may also be written generically as objects. For instance, a call to - * BytesMessage.writeInt(6) is equivalent to - * BytesMessage.writeObject(new Integer(6)). Both forms are - * provided, because the explicit form is convenient for static programming, and - * the object form is needed when types are not known at compile time. - *

    - * When the message is first created, and when clearBody is - * called, the body of the message is in write-only mode. After the first call - * to reset has been made, the message body is in read-only mode. - * After a message has been sent, the client that sent it can retain and modify - * it without affecting the message that has been sent. The same message object - * can be sent multiple times. When a message has been received, the provider - * has called reset so that the message body is in read-only mode - * for the client. - *

    - * If clearBody is called on a message in read-only mode, the - * message body is cleared and the message is in write-only mode. - *

    - * If a client attempts to read a message in write-only mode, a - * MessageNotReadableException is thrown. - *

    - * If a client attempts to write a message in read-only mode, a - * MessageNotWriteableException is thrown. - * - * @openwire:marshaller code=24 - * @see javax.jms.Session#createBytesMessage() - * @see javax.jms.MapMessage - * @see javax.jms.Message - * @see javax.jms.ObjectMessage - * @see javax.jms.StreamMessage - * @see javax.jms.TextMessage - */ -public class ActiveMQBytesMessage extends ActiveMQMessage implements BytesMessage { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.ACTIVEMQ_BYTES_MESSAGE; - - protected transient DataOutputStream dataOut; - protected transient ByteArrayOutputStream bytesOut; - protected transient DataInputStream dataIn; - protected transient int length; - - @Override - public Message copy() { - ActiveMQBytesMessage copy = new ActiveMQBytesMessage(); - copy(copy); - return copy; - } - - private void copy(ActiveMQBytesMessage copy) { - storeContent(); - super.copy(copy); - copy.dataOut = null; - copy.bytesOut = null; - copy.dataIn = null; - } - - @Override - public void onSend() throws JMSException { - super.onSend(); - storeContent(); - } - - @Override - public void storeContent() { - try { - if (dataOut != null) { - dataOut.close(); - ByteSequence bs = bytesOut.toByteSequence(); - if (compressed) { - int pos = bs.offset; - ByteSequenceData.writeIntBig(bs, length); - bs.offset = pos; - } - setContent(bs); - bytesOut = null; - dataOut = null; - } - } catch (IOException ioe) { - throw new RuntimeException(ioe.getMessage(), ioe); // TODO verify - // RuntimeException - } - } - - @Override - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - @Override - public String getJMSXMimeType() { - return "jms/bytes-message"; - } - - /** - * Clears out the message body. Clearing a message's body does not clear its - * header values or property entries. - *

    - * If this message body was read-only, calling this method leaves the - * message body in the same state as an empty body in a newly created - * message. - * - * @throws JMSException if the JMS provider fails to clear the message body - * due to some internal error. - */ - @Override - public void clearBody() throws JMSException { - super.clearBody(); - this.dataOut = null; - this.dataIn = null; - this.bytesOut = null; - } - - /** - * Gets the number of bytes of the message body when the message is in - * read-only mode. The value returned can be used to allocate a byte array. - * The value returned is the entire length of the message body, regardless - * of where the pointer for reading the message is currently located. - * - * @return number of bytes in the message - * @throws JMSException if the JMS provider fails to read the message due to - * some internal error. - * @throws MessageNotReadableException if the message is in write-only mode. - * @since 1.1 - */ - - @Override - public long getBodyLength() throws JMSException { - initializeReading(); - return length; - } - - /** - * Reads a boolean from the bytes message stream. - * - * @return the boolean value read - * @throws JMSException if the JMS provider fails to read the message due to - * some internal error. - * @throws MessageEOFException if unexpected end of bytes stream has been - * reached. - * @throws MessageNotReadableException if the message is in write-only mode. - */ - @Override - public boolean readBoolean() throws JMSException { - initializeReading(); - try { - return this.dataIn.readBoolean(); - } catch (EOFException e) { - throw JMSExceptionSupport.createMessageEOFException(e); - } catch (IOException e) { - throw JMSExceptionSupport.createMessageFormatException(e); - } - } - - /** - * Reads a signed 8-bit value from the bytes message stream. - * - * @return the next byte from the bytes message stream as a signed 8-bit - * byte - * @throws JMSException if the JMS provider fails to read the message due to - * some internal error. - * @throws MessageEOFException if unexpected end of bytes stream has been - * reached. - * @throws MessageNotReadableException if the message is in write-only mode. - */ - @Override - public byte readByte() throws JMSException { - initializeReading(); - try { - return this.dataIn.readByte(); - } catch (EOFException e) { - throw JMSExceptionSupport.createMessageEOFException(e); - } catch (IOException e) { - throw JMSExceptionSupport.createMessageFormatException(e); - } - } - - /** - * Reads an unsigned 8-bit number from the bytes message stream. - * - * @return the next byte from the bytes message stream, interpreted as an - * unsigned 8-bit number - * @throws JMSException if the JMS provider fails to read the message due to - * some internal error. - * @throws MessageEOFException if unexpected end of bytes stream has been - * reached. - * @throws MessageNotReadableException if the message is in write-only mode. - */ - @Override - public int readUnsignedByte() throws JMSException { - initializeReading(); - try { - return this.dataIn.readUnsignedByte(); - } catch (EOFException e) { - throw JMSExceptionSupport.createMessageEOFException(e); - } catch (IOException e) { - throw JMSExceptionSupport.createMessageFormatException(e); - } - } - - /** - * Reads a signed 16-bit number from the bytes message stream. - * - * @return the next two bytes from the bytes message stream, interpreted as - * a signed 16-bit number - * @throws JMSException if the JMS provider fails to read the message due to - * some internal error. - * @throws MessageEOFException if unexpected end of bytes stream has been - * reached. - * @throws MessageNotReadableException if the message is in write-only mode. - */ - @Override - public short readShort() throws JMSException { - initializeReading(); - try { - return this.dataIn.readShort(); - } catch (EOFException e) { - throw JMSExceptionSupport.createMessageEOFException(e); - } catch (IOException e) { - throw JMSExceptionSupport.createMessageFormatException(e); - } - } - - /** - * Reads an unsigned 16-bit number from the bytes message stream. - * - * @return the next two bytes from the bytes message stream, interpreted as - * an unsigned 16-bit integer - * @throws JMSException if the JMS provider fails to read the message due to - * some internal error. - * @throws MessageEOFException if unexpected end of bytes stream has been - * reached. - * @throws MessageNotReadableException if the message is in write-only mode. - */ - @Override - public int readUnsignedShort() throws JMSException { - initializeReading(); - try { - return this.dataIn.readUnsignedShort(); - } catch (EOFException e) { - throw JMSExceptionSupport.createMessageEOFException(e); - } catch (IOException e) { - throw JMSExceptionSupport.createMessageFormatException(e); - } - } - - /** - * Reads a Unicode character value from the bytes message stream. - * - * @return the next two bytes from the bytes message stream as a Unicode - * character - * @throws JMSException if the JMS provider fails to read the message due to - * some internal error. - * @throws MessageEOFException if unexpected end of bytes stream has been - * reached. - * @throws MessageNotReadableException if the message is in write-only mode. - */ - @Override - public char readChar() throws JMSException { - initializeReading(); - try { - return this.dataIn.readChar(); - } catch (EOFException e) { - throw JMSExceptionSupport.createMessageEOFException(e); - } catch (IOException e) { - throw JMSExceptionSupport.createMessageFormatException(e); - } - } - - /** - * Reads a signed 32-bit integer from the bytes message stream. - * - * @return the next four bytes from the bytes message stream, interpreted as - * an int - * @throws JMSException if the JMS provider fails to read the message due to - * some internal error. - * @throws MessageEOFException if unexpected end of bytes stream has been - * reached. - * @throws MessageNotReadableException if the message is in write-only mode. - */ - @Override - public int readInt() throws JMSException { - initializeReading(); - try { - return this.dataIn.readInt(); - } catch (EOFException e) { - throw JMSExceptionSupport.createMessageEOFException(e); - } catch (IOException e) { - throw JMSExceptionSupport.createMessageFormatException(e); - } - } - - /** - * Reads a signed 64-bit integer from the bytes message stream. - * - * @return the next eight bytes from the bytes message stream, interpreted - * as a long - * @throws JMSException if the JMS provider fails to read the message due to - * some internal error. - * @throws MessageEOFException if unexpected end of bytes stream has been - * reached. - * @throws MessageNotReadableException if the message is in write-only mode. - */ - @Override - public long readLong() throws JMSException { - initializeReading(); - try { - return this.dataIn.readLong(); - } catch (EOFException e) { - throw JMSExceptionSupport.createMessageEOFException(e); - } catch (IOException e) { - throw JMSExceptionSupport.createMessageFormatException(e); - } - } - - /** - * Reads a float from the bytes message stream. - * - * @return the next four bytes from the bytes message stream, interpreted as - * a float - * @throws JMSException if the JMS provider fails to read the message due to - * some internal error. - * @throws MessageEOFException if unexpected end of bytes stream has been - * reached. - * @throws MessageNotReadableException if the message is in write-only mode. - */ - @Override - public float readFloat() throws JMSException { - initializeReading(); - try { - return this.dataIn.readFloat(); - } catch (EOFException e) { - throw JMSExceptionSupport.createMessageEOFException(e); - } catch (IOException e) { - throw JMSExceptionSupport.createMessageFormatException(e); - } - } - - /** - * Reads a double from the bytes message stream. - * - * @return the next eight bytes from the bytes message stream, interpreted - * as a double - * @throws JMSException if the JMS provider fails to read the message due to - * some internal error. - * @throws MessageEOFException if unexpected end of bytes stream has been - * reached. - * @throws MessageNotReadableException if the message is in write-only mode. - */ - @Override - public double readDouble() throws JMSException { - initializeReading(); - try { - return this.dataIn.readDouble(); - } catch (EOFException e) { - throw JMSExceptionSupport.createMessageEOFException(e); - } catch (IOException e) { - throw JMSExceptionSupport.createMessageFormatException(e); - } - } - - /** - * Reads a string that has been encoded using a modified UTF-8 format from - * the bytes message stream. - *

    - * For more information on the UTF-8 format, see "File System Safe UCS - * Transformation Format (FSS_UTF)", X/Open Preliminary Specification, - * X/Open Company Ltd., Document Number: P316. This information also appears - * in ISO/IEC 10646, Annex P. - * - * @return a Unicode string from the bytes message stream - * @throws JMSException if the JMS provider fails to read the message due to - * some internal error. - * @throws MessageEOFException if unexpected end of bytes stream has been - * reached. - * @throws MessageNotReadableException if the message is in write-only mode. - */ - @Override - public String readUTF() throws JMSException { - initializeReading(); - try { - return this.dataIn.readUTF(); - } catch (EOFException e) { - throw JMSExceptionSupport.createMessageEOFException(e); - } catch (IOException e) { - throw JMSExceptionSupport.createMessageFormatException(e); - } - } - - /** - * Reads a byte array from the bytes message stream. - *

    - * If the length of array value is less than the number of - * bytes remaining to be read from the stream, the array should be filled. A - * subsequent call reads the next increment, and so on. - *

    - * If the number of bytes remaining in the stream is less than the length of - * array value, the bytes should be read into the array. The - * return value of the total number of bytes read will be less than the - * length of the array, indicating that there are no more bytes left to be - * read from the stream. The next read of the stream returns -1. - * - * @param value the buffer into which the data is read - * @return the total number of bytes read into the buffer, or -1 if there is - * no more data because the end of the stream has been reached - * @throws JMSException if the JMS provider fails to read the message due to - * some internal error. - * @throws MessageNotReadableException if the message is in write-only mode. - */ - @Override - public int readBytes(byte[] value) throws JMSException { - return readBytes(value, value.length); - } - - /** - * Reads a portion of the bytes message stream. - *

    - * If the length of array value is less than the number of - * bytes remaining to be read from the stream, the array should be filled. A - * subsequent call reads the next increment, and so on. - *

    - * If the number of bytes remaining in the stream is less than the length of - * array value, the bytes should be read into the array. The - * return value of the total number of bytes read will be less than the - * length of the array, indicating that there are no more bytes left to be - * read from the stream. The next read of the stream returns -1.

    If - * length is negative, or length is greater - * than the length of the array value, then an - * IndexOutOfBoundsException is thrown. No bytes will be read - * from the stream for this exception case. - * - * @param value the buffer into which the data is read - * @param length the number of bytes to read; must be less than or equal to - * value.length - * @return the total number of bytes read into the buffer, or -1 if there is - * no more data because the end of the stream has been reached - * @throws JMSException if the JMS provider fails to read the message due to - * some internal error. - * @throws MessageNotReadableException if the message is in write-only mode. - */ - @Override - public int readBytes(byte[] value, int length) throws JMSException { - initializeReading(); - try { - int n = 0; - while (n < length) { - int count = this.dataIn.read(value, n, length - n); - if (count < 0) { - break; - } - n += count; - } - if (n == 0 && length > 0) { - n = -1; - } - return n; - } catch (EOFException e) { - throw JMSExceptionSupport.createMessageEOFException(e); - } catch (IOException e) { - throw JMSExceptionSupport.createMessageFormatException(e); - } - } - - /** - * Writes a boolean to the bytes message stream as a 1-byte - * value. The value true is written as the value - * (byte)1; the value false is written as the - * value (byte)0. - * - * @param value the boolean value to be written - * @throws JMSException if the JMS provider fails to write the message due - * to some internal error. - * @throws MessageNotWriteableException if the message is in read-only mode. - */ - @Override - public void writeBoolean(boolean value) throws JMSException { - initializeWriting(); - try { - this.dataOut.writeBoolean(value); - } catch (IOException ioe) { - throw JMSExceptionSupport.create(ioe); - } - } - - /** - * Writes a byte to the bytes message stream as a 1-byte - * value. - * - * @param value the byte value to be written - * @throws JMSException if the JMS provider fails to write the message due - * to some internal error. - * @throws MessageNotWriteableException if the message is in read-only mode. - */ - @Override - public void writeByte(byte value) throws JMSException { - initializeWriting(); - try { - this.dataOut.writeByte(value); - } catch (IOException ioe) { - throw JMSExceptionSupport.create(ioe); - } - } - - /** - * Writes a short to the bytes message stream as two bytes, - * high byte first. - * - * @param value the short to be written - * @throws JMSException if the JMS provider fails to write the message due - * to some internal error. - * @throws MessageNotWriteableException if the message is in read-only mode. - */ - @Override - public void writeShort(short value) throws JMSException { - initializeWriting(); - try { - this.dataOut.writeShort(value); - } catch (IOException ioe) { - throw JMSExceptionSupport.create(ioe); - } - } - - /** - * Writes a char to the bytes message stream as a 2-byte - * value, high byte first. - * - * @param value the char value to be written - * @throws JMSException if the JMS provider fails to write the message due - * to some internal error. - * @throws MessageNotWriteableException if the message is in read-only mode. - */ - @Override - public void writeChar(char value) throws JMSException { - initializeWriting(); - try { - this.dataOut.writeChar(value); - } catch (IOException ioe) { - throw JMSExceptionSupport.create(ioe); - } - } - - /** - * Writes an int to the bytes message stream as four bytes, - * high byte first. - * - * @param value the int to be written - * @throws JMSException if the JMS provider fails to write the message due - * to some internal error. - * @throws MessageNotWriteableException if the message is in read-only mode. - */ - @Override - public void writeInt(int value) throws JMSException { - initializeWriting(); - try { - this.dataOut.writeInt(value); - } catch (IOException ioe) { - throw JMSExceptionSupport.create(ioe); - } - } - - /** - * Writes a long to the bytes message stream as eight bytes, - * high byte first. - * - * @param value the long to be written - * @throws JMSException if the JMS provider fails to write the message due - * to some internal error. - * @throws MessageNotWriteableException if the message is in read-only mode. - */ - @Override - public void writeLong(long value) throws JMSException { - initializeWriting(); - try { - this.dataOut.writeLong(value); - } catch (IOException ioe) { - throw JMSExceptionSupport.create(ioe); - } - } - - /** - * Converts the float argument to an int using - * the floatToIntBits method in class Float, - * and then writes that int value to the bytes message stream - * as a 4-byte quantity, high byte first. - * - * @param value the float value to be written - * @throws JMSException if the JMS provider fails to write the message due - * to some internal error. - * @throws MessageNotWriteableException if the message is in read-only mode. - */ - @Override - public void writeFloat(float value) throws JMSException { - initializeWriting(); - try { - this.dataOut.writeFloat(value); - } catch (IOException ioe) { - throw JMSExceptionSupport.create(ioe); - } - } - - /** - * Converts the double argument to a long - * using the doubleToLongBits method in class - * Double, and then writes that long value to - * the bytes message stream as an 8-byte quantity, high byte first. - * - * @param value the double value to be written - * @throws JMSException if the JMS provider fails to write the message due - * to some internal error. - * @throws MessageNotWriteableException if the message is in read-only mode. - */ - @Override - public void writeDouble(double value) throws JMSException { - initializeWriting(); - try { - this.dataOut.writeDouble(value); - } catch (IOException ioe) { - throw JMSExceptionSupport.create(ioe); - } - } - - /** - * Writes a string to the bytes message stream using UTF-8 encoding in a - * machine-independent manner. - *

    - * For more information on the UTF-8 format, see "File System Safe UCS - * Transformation Format (FSS_UTF)", X/Open Preliminary Specification, - * X/Open Company Ltd., Document Number: P316. This information also appears - * in ISO/IEC 10646, Annex P. - * - * @param value the String value to be written - * @throws JMSException if the JMS provider fails to write the message due - * to some internal error. - * @throws MessageNotWriteableException if the message is in read-only mode. - */ - @Override - public void writeUTF(String value) throws JMSException { - initializeWriting(); - try { - this.dataOut.writeUTF(value); - } catch (IOException ioe) { - throw JMSExceptionSupport.create(ioe); - } - } - - /** - * Writes a byte array to the bytes message stream. - * - * @param value the byte array to be written - * @throws JMSException if the JMS provider fails to write the message due - * to some internal error. - * @throws MessageNotWriteableException if the message is in read-only mode. - */ - @Override - public void writeBytes(byte[] value) throws JMSException { - initializeWriting(); - try { - this.dataOut.write(value); - } catch (IOException ioe) { - throw JMSExceptionSupport.create(ioe); - } - } - - /** - * Writes a portion of a byte array to the bytes message stream. - * - * @param value the byte array value to be written - * @param offset the initial offset within the byte array - * @param length the number of bytes to use - * @throws JMSException if the JMS provider fails to write the message due - * to some internal error. - * @throws MessageNotWriteableException if the message is in read-only mode. - */ - @Override - public void writeBytes(byte[] value, int offset, int length) throws JMSException { - initializeWriting(); - try { - this.dataOut.write(value, offset, length); - } catch (IOException ioe) { - throw JMSExceptionSupport.create(ioe); - } - } - - /** - * Writes an object to the bytes message stream. - *

    - * This method works only for the objectified primitive object types (Integer,Double, - * Long  ...), String objects, and byte - * arrays. - * - * @param value the object in the Java programming language ("Java object") - * to be written; it must not be null - * @throws JMSException if the JMS provider fails to write the message due - * to some internal error. - * @throws MessageFormatException if the object is of an invalid type. - * @throws MessageNotWriteableException if the message is in read-only mode. - * @throws java.lang.NullPointerException if the parameter - * value is null. - */ - @Override - public void writeObject(Object value) throws JMSException { - if (value == null) { - throw new NullPointerException(); - } - initializeWriting(); - if (value instanceof Boolean) { - writeBoolean(((Boolean)value).booleanValue()); - } else if (value instanceof Character) { - writeChar(((Character)value).charValue()); - } else if (value instanceof Byte) { - writeByte(((Byte)value).byteValue()); - } else if (value instanceof Short) { - writeShort(((Short)value).shortValue()); - } else if (value instanceof Integer) { - writeInt(((Integer)value).intValue()); - } else if (value instanceof Long) { - writeLong(((Long)value).longValue()); - } else if (value instanceof Float) { - writeFloat(((Float)value).floatValue()); - } else if (value instanceof Double) { - writeDouble(((Double)value).doubleValue()); - } else if (value instanceof String) { - writeUTF(value.toString()); - } else if (value instanceof byte[]) { - writeBytes((byte[])value); - } else { - throw new MessageFormatException("Cannot write non-primitive type:" + value.getClass()); - } - } - - /** - * Puts the message body in read-only mode and repositions the stream of - * bytes to the beginning. - * - * @throws JMSException if an internal error occurs - */ - @Override - public void reset() throws JMSException { - storeContent(); - this.bytesOut = null; - if (dataIn != null) { - try { - // Eagerly release potential Inflater memory buffers. - dataIn.close(); - } catch (Exception e) { - } - } - this.dataIn = null; - this.dataOut = null; - setReadOnlyBody(true); - } - - private void initializeWriting() throws JMSException { - checkReadOnlyBody(); - if (this.dataOut == null) { - this.bytesOut = new ByteArrayOutputStream(); - OutputStream os = bytesOut; - ActiveMQConnection connection = getConnection(); - if (connection != null && connection.isUseCompression()) { - // keep track of the real length of the content if - // we are compressed. - try { - os.write(new byte[4]); - } catch (IOException e) { - throw JMSExceptionSupport.create(e); - } - length = 0; - compressed = true; - final Deflater deflater = new Deflater(Deflater.BEST_SPEED); - os = new FilterOutputStream(new DeflaterOutputStream(os, deflater)) { - @Override - public void write(byte[] arg0) throws IOException { - length += arg0.length; - out.write(arg0); - } - - @Override - public void write(byte[] arg0, int arg1, int arg2) throws IOException { - length += arg2; - out.write(arg0, arg1, arg2); - } - - @Override - public void write(int arg0) throws IOException { - length++; - out.write(arg0); - } - - @Override - public void close() throws IOException { - super.close(); - deflater.end(); - } - }; - } - this.dataOut = new DataOutputStream(os); - } - } - - protected void checkWriteOnlyBody() throws MessageNotReadableException { - if (!readOnlyBody) { - throw new MessageNotReadableException("Message body is write-only"); - } - } - - private void initializeReading() throws JMSException { - checkWriteOnlyBody(); - if (dataIn == null) { - ByteSequence data = getContent(); - if (data == null) { - data = new ByteSequence(new byte[] {}, 0, 0); - } - InputStream is = new ByteArrayInputStream(data); - if (isCompressed()) { - // keep track of the real length of the content if - // we are compressed. - try { - DataInputStream dis = new DataInputStream(is); - length = dis.readInt(); - dis.close(); - } catch (IOException e) { - throw JMSExceptionSupport.create(e); - } - is = new InflaterInputStream(is); - } else { - length = data.getLength(); - } - dataIn = new DataInputStream(is); - } - } - - @Override - public void setObjectProperty(String name, Object value) throws JMSException { - initializeWriting(); - super.setObjectProperty(name, value); - } - - @Override - public String toString() { - return super.toString() + " ActiveMQBytesMessage{ " + "bytesOut = " + bytesOut + ", dataOut = " + dataOut + ", dataIn = " + dataIn + " }"; - } - - @Override - protected void doCompress() throws IOException { - compressed = true; - ByteSequence bytes = getContent(); - int length = bytes.getLength(); - ByteArrayOutputStream bytesOut = new ByteArrayOutputStream(); - bytesOut.write(new byte[4]); - DeflaterOutputStream os = new DeflaterOutputStream(bytesOut); - DataOutputStream dataOut = new DataOutputStream(os); - dataOut.write(bytes.data, bytes.offset, bytes.length); - dataOut.flush(); - dataOut.close(); - bytes = bytesOut.toByteSequence(); - ByteSequenceData.writeIntBig(bytes, length); - bytes.offset = 0; - setContent(bytes); - } - - @Override - protected void finalize() throws Throwable { - // Attempt to do eager close in case of compressed data which uses a - // wrapped InflaterInputStream. - if (dataIn != null) { - try { - dataIn.close(); - } catch(Exception e) { - } - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQDestination.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQDestination.class deleted file mode 100644 index 342471749..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQDestination.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQDestination.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQDestination.java deleted file mode 100644 index 3bd4f256a..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQDestination.java +++ /dev/null @@ -1,394 +0,0 @@ -/** - * 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.command; - -import java.io.Externalizable; -import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectOutput; -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.Set; -import java.util.StringTokenizer; - -import javax.jms.Destination; -import javax.jms.JMSException; -import javax.jms.Queue; -import javax.jms.TemporaryQueue; -import javax.jms.TemporaryTopic; -import javax.jms.Topic; - -import org.apache.activemq.jndi.JNDIBaseStorable; -import org.apache.activemq.util.IntrospectionSupport; -import org.apache.activemq.util.URISupport; - -/** - * @openwire:marshaller - * - */ -public abstract class ActiveMQDestination extends JNDIBaseStorable implements DataStructure, Destination, Externalizable, Comparable { - - public static final String PATH_SEPERATOR = "."; - public static final char COMPOSITE_SEPERATOR = ','; - - public static final byte QUEUE_TYPE = 0x01; - public static final byte TOPIC_TYPE = 0x02; - public static final byte TEMP_MASK = 0x04; - public static final byte TEMP_TOPIC_TYPE = TOPIC_TYPE | TEMP_MASK; - public static final byte TEMP_QUEUE_TYPE = QUEUE_TYPE | TEMP_MASK; - - public static final String QUEUE_QUALIFIED_PREFIX = "queue://"; - public static final String TOPIC_QUALIFIED_PREFIX = "topic://"; - public static final String TEMP_QUEUE_QUALIFED_PREFIX = "temp-queue://"; - public static final String TEMP_TOPIC_QUALIFED_PREFIX = "temp-topic://"; - - public static final String TEMP_DESTINATION_NAME_PREFIX = "ID:"; - - private static final long serialVersionUID = -3885260014960795889L; - - protected String physicalName; - - protected transient ActiveMQDestination[] compositeDestinations; - protected transient String[] destinationPaths; - protected transient boolean isPattern; - protected transient int hashValue; - protected Map options; - - protected static UnresolvedDestinationTransformer unresolvableDestinationTransformer = new DefaultUnresolvedDestinationTransformer(); - - public ActiveMQDestination() { - } - - protected ActiveMQDestination(String name) { - setPhysicalName(name); - } - - public ActiveMQDestination(ActiveMQDestination composites[]) { - setCompositeDestinations(composites); - } - - - // static helper methods for working with destinations - // ------------------------------------------------------------------------- - public static ActiveMQDestination createDestination(String name, byte defaultType) { - if (name.startsWith(QUEUE_QUALIFIED_PREFIX)) { - return new ActiveMQQueue(name.substring(QUEUE_QUALIFIED_PREFIX.length())); - } else if (name.startsWith(TOPIC_QUALIFIED_PREFIX)) { - return new ActiveMQTopic(name.substring(TOPIC_QUALIFIED_PREFIX.length())); - } else if (name.startsWith(TEMP_QUEUE_QUALIFED_PREFIX)) { - return new ActiveMQTempQueue(name.substring(TEMP_QUEUE_QUALIFED_PREFIX.length())); - } else if (name.startsWith(TEMP_TOPIC_QUALIFED_PREFIX)) { - return new ActiveMQTempTopic(name.substring(TEMP_TOPIC_QUALIFED_PREFIX.length())); - } - - switch (defaultType) { - case QUEUE_TYPE: - return new ActiveMQQueue(name); - case TOPIC_TYPE: - return new ActiveMQTopic(name); - case TEMP_QUEUE_TYPE: - return new ActiveMQTempQueue(name); - case TEMP_TOPIC_TYPE: - return new ActiveMQTempTopic(name); - default: - throw new IllegalArgumentException("Invalid default destination type: " + defaultType); - } - } - - public static ActiveMQDestination transform(Destination dest) throws JMSException { - if (dest == null) { - return null; - } - if (dest instanceof ActiveMQDestination) { - return (ActiveMQDestination)dest; - } - - if (dest instanceof Queue && dest instanceof Topic) { - String queueName = ((Queue) dest).getQueueName(); - String topicName = ((Topic) dest).getTopicName(); - if (queueName != null && topicName == null) { - return new ActiveMQQueue(queueName); - } else if (queueName == null && topicName != null) { - return new ActiveMQTopic(topicName); - } else { - return unresolvableDestinationTransformer.transform(dest); - } - } - if (dest instanceof TemporaryQueue) { - return new ActiveMQTempQueue(((TemporaryQueue)dest).getQueueName()); - } - if (dest instanceof TemporaryTopic) { - return new ActiveMQTempTopic(((TemporaryTopic)dest).getTopicName()); - } - if (dest instanceof Queue) { - return new ActiveMQQueue(((Queue)dest).getQueueName()); - } - if (dest instanceof Topic) { - return new ActiveMQTopic(((Topic)dest).getTopicName()); - } - throw new JMSException("Could not transform the destination into a ActiveMQ destination: " + dest); - } - - public static int compare(ActiveMQDestination destination, ActiveMQDestination destination2) { - if (destination == destination2) { - return 0; - } - if (destination == null) { - return -1; - } else if (destination2 == null) { - return 1; - } else { - if (destination.isQueue() == destination2.isQueue()) { - return destination.getPhysicalName().compareTo(destination2.getPhysicalName()); - } else { - return destination.isQueue() ? -1 : 1; - } - } - } - - @Override - public int compareTo(Object that) { - if (that instanceof ActiveMQDestination) { - return compare(this, (ActiveMQDestination)that); - } - if (that == null) { - return 1; - } else { - return getClass().getName().compareTo(that.getClass().getName()); - } - } - - public boolean isComposite() { - return compositeDestinations != null; - } - - public ActiveMQDestination[] getCompositeDestinations() { - return compositeDestinations; - } - - public void setCompositeDestinations(ActiveMQDestination[] destinations) { - this.compositeDestinations = destinations; - this.destinationPaths = null; - this.hashValue = 0; - this.isPattern = false; - - StringBuffer sb = new StringBuffer(); - for (int i = 0; i < destinations.length; i++) { - if (i != 0) { - sb.append(COMPOSITE_SEPERATOR); - } - if (getDestinationType() == destinations[i].getDestinationType()) { - sb.append(destinations[i].getPhysicalName()); - } else { - sb.append(destinations[i].getQualifiedName()); - } - } - physicalName = sb.toString(); - } - - public String getQualifiedName() { - if (isComposite()) { - return physicalName; - } - return getQualifiedPrefix() + physicalName; - } - - protected abstract String getQualifiedPrefix(); - - /** - * @openwire:property version=1 - */ - public String getPhysicalName() { - return physicalName; - } - - public void setPhysicalName(String physicalName) { - physicalName = physicalName.trim(); - final int len = physicalName.length(); - // options offset - int p = -1; - boolean composite = false; - for (int i = 0; i < len; i++) { - char c = physicalName.charAt(i); - if (c == '?') { - p = i; - break; - } - if (c == COMPOSITE_SEPERATOR) { - // won't be wild card - isPattern = false; - composite = true; - } else if (!composite && (c == '*' || c == '>')) { - isPattern = true; - } - } - // Strip off any options - if (p >= 0) { - String optstring = physicalName.substring(p + 1); - physicalName = physicalName.substring(0, p); - try { - options = URISupport.parseQuery(optstring); - } catch (URISyntaxException e) { - throw new IllegalArgumentException("Invalid destination name: " + physicalName + ", it's options are not encoded properly: " + e); - } - } - this.physicalName = physicalName; - this.destinationPaths = null; - this.hashValue = 0; - if (composite) { - // Check to see if it is a composite. - Set l = new HashSet(); - StringTokenizer iter = new StringTokenizer(physicalName, "" + COMPOSITE_SEPERATOR); - while (iter.hasMoreTokens()) { - String name = iter.nextToken().trim(); - if (name.length() == 0) { - continue; - } - l.add(name); - } - compositeDestinations = new ActiveMQDestination[l.size()]; - int counter = 0; - for (String dest : l) { - compositeDestinations[counter++] = createDestination(dest); - } - } - } - - public ActiveMQDestination createDestination(String name) { - return createDestination(name, getDestinationType()); - } - - public String[] getDestinationPaths() { - - if (destinationPaths != null) { - return destinationPaths; - } - - List l = new ArrayList(); - StringTokenizer iter = new StringTokenizer(physicalName, PATH_SEPERATOR); - while (iter.hasMoreTokens()) { - String name = iter.nextToken().trim(); - if (name.length() == 0) { - continue; - } - l.add(name); - } - - destinationPaths = new String[l.size()]; - l.toArray(destinationPaths); - return destinationPaths; - } - - public abstract byte getDestinationType(); - - public boolean isQueue() { - return false; - } - - public boolean isTopic() { - return false; - } - - public boolean isTemporary() { - return false; - } - - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - - ActiveMQDestination d = (ActiveMQDestination)o; - return physicalName.equals(d.physicalName); - } - - public int hashCode() { - if (hashValue == 0) { - hashValue = physicalName.hashCode(); - } - return hashValue; - } - - public String toString() { - return getQualifiedName(); - } - - public void writeExternal(ObjectOutput out) throws IOException { - out.writeUTF(this.getPhysicalName()); - out.writeObject(options); - } - - @SuppressWarnings("unchecked") - public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { - this.setPhysicalName(in.readUTF()); - this.options = (Map)in.readObject(); - } - - public String getDestinationTypeAsString() { - switch (getDestinationType()) { - case QUEUE_TYPE: - return "Queue"; - case TOPIC_TYPE: - return "Topic"; - case TEMP_QUEUE_TYPE: - return "TempQueue"; - case TEMP_TOPIC_TYPE: - return "TempTopic"; - default: - throw new IllegalArgumentException("Invalid destination type: " + getDestinationType()); - } - } - - public Map getOptions() { - return options; - } - - public boolean isMarshallAware() { - return false; - } - - public void buildFromProperties(Properties properties) { - if (properties == null) { - properties = new Properties(); - } - - IntrospectionSupport.setProperties(this, properties); - } - - public void populateProperties(Properties props) { - props.setProperty("physicalName", getPhysicalName()); - } - - public boolean isPattern() { - return isPattern; - } - - public static UnresolvedDestinationTransformer getUnresolvableDestinationTransformer() { - return unresolvableDestinationTransformer; - } - - public static void setUnresolvableDestinationTransformer(UnresolvedDestinationTransformer unresolvableDestinationTransformer) { - ActiveMQDestination.unresolvableDestinationTransformer = unresolvableDestinationTransformer; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMapMessage.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMapMessage.class deleted file mode 100644 index fc0523c32..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMapMessage.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMapMessage.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMapMessage.java deleted file mode 100644 index 9e544a978..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMapMessage.java +++ /dev/null @@ -1,824 +0,0 @@ -/** - * 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.command; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.ObjectStreamException; -import java.io.OutputStream; -import java.util.Collections; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.Map; -import java.util.zip.DeflaterOutputStream; -import java.util.zip.InflaterInputStream; - -import javax.jms.JMSException; -import javax.jms.MapMessage; -import javax.jms.MessageFormatException; -import javax.jms.MessageNotWriteableException; - -import org.apache.activemq.ActiveMQConnection; -import org.apache.activemq.util.ByteArrayInputStream; -import org.apache.activemq.util.ByteArrayOutputStream; -import org.apache.activemq.util.ByteSequence; -import org.apache.activemq.util.JMSExceptionSupport; -import org.apache.activemq.util.MarshallingSupport; -import org.apache.activemq.wireformat.WireFormat; -import org.fusesource.hawtbuf.UTF8Buffer; - -/** - * A MapMessage object is used to send a set of name-value pairs. - * The names are String objects, and the values are primitive - * data types in the Java programming language. The names must have a value that - * is not null, and not an empty string. The entries can be accessed - * sequentially or randomly by name. The order of the entries is undefined. - * MapMessage inherits from the Message interface - * and adds a message body that contains a Map. - *

    - * The primitive types can be read or written explicitly using methods for each - * type. They may also be read or written generically as objects. For instance, - * a call to MapMessage.setInt("foo", 6) is equivalent to - * MapMessage.setObject("foo", new Integer(6)). Both forms are - * provided, because the explicit form is convenient for static programming, and - * the object form is needed when types are not known at compile time. - *

    - * When a client receives a MapMessage, it is in read-only mode. - * If a client attempts to write to the message at this point, a - * MessageNotWriteableException is thrown. If - * clearBody is called, the message can now be both read from and - * written to. - *

    - * MapMessage objects support the following conversion table. The - * marked cases must be supported. The unmarked cases must throw a - * JMSException. The String -to-primitive - * conversions may throw a runtime exception if the primitive's - * valueOf() method does not accept it as a valid - * String representation of the primitive. - *

    - * A value written as the row type can be read as the column type.

    - * - *

    - * | | boolean byte short char int long float double String byte[] |----------------------------------------------------------------------
    - * |boolean | X X |byte | X X X X X |short | X X X X |char | X X |int | X X X |long | X X |float | X X X |double | X X
    - * |String | X X X X X X X X |byte[] | X |----------------------------------------------------------------------
    - * <p/>
    - * 
    - * - *

    - *

    - * Attempting to read a null value as a primitive type must be treated as - * calling the primitive's corresponding valueOf(String) - * conversion method with a null value. Since char does not - * support a String conversion, attempting to read a null value - * as a char must throw a NullPointerException. - * - * @openwire:marshaller code="25" - * @see javax.jms.Session#createMapMessage() - * @see javax.jms.BytesMessage - * @see javax.jms.Message - * @see javax.jms.ObjectMessage - * @see javax.jms.StreamMessage - * @see javax.jms.TextMessage - */ -public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.ACTIVEMQ_MAP_MESSAGE; - - protected transient Map map = new HashMap(); - - private Object readResolve() throws ObjectStreamException { - if (this.map == null) { - this.map = new HashMap(); - } - return this; - } - - @Override - public Message copy() { - ActiveMQMapMessage copy = new ActiveMQMapMessage(); - copy(copy); - return copy; - } - - private void copy(ActiveMQMapMessage copy) { - storeContent(); - super.copy(copy); - } - - // We only need to marshal the content if we are hitting the wire. - @Override - public void beforeMarshall(WireFormat wireFormat) throws IOException { - super.beforeMarshall(wireFormat); - storeContent(); - } - - @Override - public void clearMarshalledState() throws JMSException { - super.clearMarshalledState(); - map.clear(); - } - - @Override - public void storeContentAndClear() { - storeContent(); - map.clear(); - } - - @Override - public void storeContent() { - try { - if (getContent() == null && !map.isEmpty()) { - ByteArrayOutputStream bytesOut = new ByteArrayOutputStream(); - OutputStream os = bytesOut; - ActiveMQConnection connection = getConnection(); - if (connection != null && connection.isUseCompression()) { - compressed = true; - os = new DeflaterOutputStream(os); - } - DataOutputStream dataOut = new DataOutputStream(os); - MarshallingSupport.marshalPrimitiveMap(map, dataOut); - dataOut.close(); - setContent(bytesOut.toByteSequence()); - } - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - /** - * Builds the message body from data - * - * @throws JMSException - * @throws IOException - */ - private void loadContent() throws JMSException { - try { - if (getContent() != null && map.isEmpty()) { - ByteSequence content = getContent(); - InputStream is = new ByteArrayInputStream(content); - if (isCompressed()) { - is = new InflaterInputStream(is); - } - DataInputStream dataIn = new DataInputStream(is); - map = MarshallingSupport.unmarshalPrimitiveMap(dataIn); - dataIn.close(); - } - } catch (IOException e) { - throw JMSExceptionSupport.create(e); - } - } - - @Override - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - @Override - public String getJMSXMimeType() { - return "jms/map-message"; - } - - /** - * Clears out the message body. Clearing a message's body does not clear its - * header values or property entries. - *

    - * If this message body was read-only, calling this method leaves the - * message body in the same state as an empty body in a newly created - * message. - */ - @Override - public void clearBody() throws JMSException { - super.clearBody(); - map.clear(); - } - - /** - * Returns the boolean value with the specified name. - * - * @param name the name of the boolean - * @return the boolean value with the specified name - * @throws JMSException if the JMS provider fails to read the message due to - * some internal error. - * @throws MessageFormatException if this type conversion is invalid. - */ - @Override - public boolean getBoolean(String name) throws JMSException { - initializeReading(); - Object value = map.get(name); - if (value == null) { - return false; - } - if (value instanceof Boolean) { - return ((Boolean)value).booleanValue(); - } - if (value instanceof UTF8Buffer) { - return Boolean.valueOf(value.toString()).booleanValue(); - } - if (value instanceof String) { - return Boolean.valueOf(value.toString()).booleanValue(); - } else { - throw new MessageFormatException(" cannot read a boolean from " + value.getClass().getName()); - } - } - - /** - * Returns the byte value with the specified name. - * - * @param name the name of the byte - * @return the byte value with the specified name - * @throws JMSException if the JMS provider fails to read the message due to - * some internal error. - * @throws MessageFormatException if this type conversion is invalid. - */ - @Override - public byte getByte(String name) throws JMSException { - initializeReading(); - Object value = map.get(name); - if (value == null) { - return 0; - } - if (value instanceof Byte) { - return ((Byte)value).byteValue(); - } - if (value instanceof UTF8Buffer) { - return Byte.valueOf(value.toString()).byteValue(); - } - if (value instanceof String) { - return Byte.valueOf(value.toString()).byteValue(); - } else { - throw new MessageFormatException(" cannot read a byte from " + value.getClass().getName()); - } - } - - /** - * Returns the short value with the specified name. - * - * @param name the name of the short - * @return the short value with the specified name - * @throws JMSException if the JMS provider fails to read the message due to - * some internal error. - * @throws MessageFormatException if this type conversion is invalid. - */ - @Override - public short getShort(String name) throws JMSException { - initializeReading(); - Object value = map.get(name); - if (value == null) { - return 0; - } - if (value instanceof Short) { - return ((Short)value).shortValue(); - } - if (value instanceof Byte) { - return ((Byte)value).shortValue(); - } - if (value instanceof UTF8Buffer) { - return Short.valueOf(value.toString()).shortValue(); - } - if (value instanceof String) { - return Short.valueOf(value.toString()).shortValue(); - } else { - throw new MessageFormatException(" cannot read a short from " + value.getClass().getName()); - } - } - - /** - * Returns the Unicode character value with the specified name. - * - * @param name the name of the Unicode character - * @return the Unicode character value with the specified name - * @throws JMSException if the JMS provider fails to read the message due to - * some internal error. - * @throws MessageFormatException if this type conversion is invalid. - */ - @Override - public char getChar(String name) throws JMSException { - initializeReading(); - Object value = map.get(name); - if (value == null) { - throw new NullPointerException(); - } - if (value instanceof Character) { - return ((Character)value).charValue(); - } else { - throw new MessageFormatException(" cannot read a short from " + value.getClass().getName()); - } - } - - /** - * Returns the int value with the specified name. - * - * @param name the name of the int - * @return the int value with the specified name - * @throws JMSException if the JMS provider fails to read the message due to - * some internal error. - * @throws MessageFormatException if this type conversion is invalid. - */ - @Override - public int getInt(String name) throws JMSException { - initializeReading(); - Object value = map.get(name); - if (value == null) { - return 0; - } - if (value instanceof Integer) { - return ((Integer)value).intValue(); - } - if (value instanceof Short) { - return ((Short)value).intValue(); - } - if (value instanceof Byte) { - return ((Byte)value).intValue(); - } - if (value instanceof UTF8Buffer) { - return Integer.valueOf(value.toString()).intValue(); - } - if (value instanceof String) { - return Integer.valueOf(value.toString()).intValue(); - } else { - throw new MessageFormatException(" cannot read an int from " + value.getClass().getName()); - } - } - - /** - * Returns the long value with the specified name. - * - * @param name the name of the long - * @return the long value with the specified name - * @throws JMSException if the JMS provider fails to read the message due to - * some internal error. - * @throws MessageFormatException if this type conversion is invalid. - */ - @Override - public long getLong(String name) throws JMSException { - initializeReading(); - Object value = map.get(name); - if (value == null) { - return 0; - } - if (value instanceof Long) { - return ((Long)value).longValue(); - } - if (value instanceof Integer) { - return ((Integer)value).longValue(); - } - if (value instanceof Short) { - return ((Short)value).longValue(); - } - if (value instanceof Byte) { - return ((Byte)value).longValue(); - } - if (value instanceof UTF8Buffer) { - return Long.valueOf(value.toString()).longValue(); - } - if (value instanceof String) { - return Long.valueOf(value.toString()).longValue(); - } else { - throw new MessageFormatException(" cannot read a long from " + value.getClass().getName()); - } - } - - /** - * Returns the float value with the specified name. - * - * @param name the name of the float - * @return the float value with the specified name - * @throws JMSException if the JMS provider fails to read the message due to - * some internal error. - * @throws MessageFormatException if this type conversion is invalid. - */ - @Override - public float getFloat(String name) throws JMSException { - initializeReading(); - Object value = map.get(name); - if (value == null) { - return 0; - } - if (value instanceof Float) { - return ((Float)value).floatValue(); - } - if (value instanceof UTF8Buffer) { - return Float.valueOf(value.toString()).floatValue(); - } - if (value instanceof String) { - return Float.valueOf(value.toString()).floatValue(); - } else { - throw new MessageFormatException(" cannot read a float from " + value.getClass().getName()); - } - } - - /** - * Returns the double value with the specified name. - * - * @param name the name of the double - * @return the double value with the specified name - * @throws JMSException if the JMS provider fails to read the message due to - * some internal error. - * @throws MessageFormatException if this type conversion is invalid. - */ - @Override - public double getDouble(String name) throws JMSException { - initializeReading(); - Object value = map.get(name); - if (value == null) { - return 0; - } - if (value instanceof Double) { - return ((Double)value).doubleValue(); - } - if (value instanceof Float) { - return ((Float)value).floatValue(); - } - if (value instanceof UTF8Buffer) { - return Float.valueOf(value.toString()).floatValue(); - } - if (value instanceof String) { - return Float.valueOf(value.toString()).floatValue(); - } else { - throw new MessageFormatException(" cannot read a double from " + value.getClass().getName()); - } - } - - /** - * Returns the String value with the specified name. - * - * @param name the name of the String - * @return the String value with the specified name; if there - * is no item by this name, a null value is returned - * @throws JMSException if the JMS provider fails to read the message due to - * some internal error. - * @throws MessageFormatException if this type conversion is invalid. - */ - @Override - public String getString(String name) throws JMSException { - initializeReading(); - Object value = map.get(name); - if (value == null) { - return null; - } - if (value instanceof byte[]) { - throw new MessageFormatException("Use getBytes to read a byte array"); - } else { - return value.toString(); - } - } - - /** - * Returns the byte array value with the specified name. - * - * @param name the name of the byte array - * @return a copy of the byte array value with the specified name; if there - * is no item by this name, a null value is returned. - * @throws JMSException if the JMS provider fails to read the message due to - * some internal error. - * @throws MessageFormatException if this type conversion is invalid. - */ - @Override - public byte[] getBytes(String name) throws JMSException { - initializeReading(); - Object value = map.get(name); - if (value instanceof byte[]) { - return (byte[])value; - } else { - throw new MessageFormatException(" cannot read a byte[] from " + value.getClass().getName()); - } - } - - /** - * Returns the value of the object with the specified name. - *

    - * This method can be used to return, in objectified format, an object in - * the Java programming language ("Java object") that had been stored in the - * Map with the equivalent setObject method call, or its - * equivalent primitive set type method. - *

    - * Note that byte values are returned as byte[], not - * Byte[]. - * - * @param name the name of the Java object - * @return a copy of the Java object value with the specified name, in - * objectified format (for example, if the object was set as an - * int, an Integer is returned); if - * there is no item by this name, a null value is returned - * @throws JMSException if the JMS provider fails to read the message due to - * some internal error. - */ - @Override - public Object getObject(String name) throws JMSException { - initializeReading(); - Object result = map.get(name); - if (result instanceof UTF8Buffer) { - result = result.toString(); - } - - return result; - } - - /** - * Returns an Enumeration of all the names in the - * MapMessage object. - * - * @return an enumeration of all the names in this MapMessage - * @throws JMSException - */ - @Override - public Enumeration getMapNames() throws JMSException { - initializeReading(); - return Collections.enumeration(map.keySet()); - } - - protected void put(String name, Object value) throws JMSException { - if (name == null) { - throw new IllegalArgumentException("The name of the property cannot be null."); - } - if (name.length() == 0) { - throw new IllegalArgumentException("The name of the property cannot be an emprty string."); - } - map.put(name, value); - } - - /** - * Sets a boolean value with the specified name into the Map. - * - * @param name the name of the boolean - * @param value the boolean value to set in the Map - * @throws JMSException if the JMS provider fails to write the message due - * to some internal error. - * @throws IllegalArgumentException if the name is null or if the name is an - * empty string. - * @throws MessageNotWriteableException if the message is in read-only mode. - */ - @Override - public void setBoolean(String name, boolean value) throws JMSException { - initializeWriting(); - put(name, value ? Boolean.TRUE : Boolean.FALSE); - } - - /** - * Sets a byte value with the specified name into the Map. - * - * @param name the name of the byte - * @param value the byte value to set in the Map - * @throws JMSException if the JMS provider fails to write the message due - * to some internal error. - * @throws IllegalArgumentException if the name is null or if the name is an - * empty string. - * @throws MessageNotWriteableException if the message is in read-only mode. - */ - @Override - public void setByte(String name, byte value) throws JMSException { - initializeWriting(); - put(name, Byte.valueOf(value)); - } - - /** - * Sets a short value with the specified name into the Map. - * - * @param name the name of the short - * @param value the short value to set in the Map - * @throws JMSException if the JMS provider fails to write the message due - * to some internal error. - * @throws IllegalArgumentException if the name is null or if the name is an - * empty string. - * @throws MessageNotWriteableException if the message is in read-only mode. - */ - @Override - public void setShort(String name, short value) throws JMSException { - initializeWriting(); - put(name, Short.valueOf(value)); - } - - /** - * Sets a Unicode character value with the specified name into the Map. - * - * @param name the name of the Unicode character - * @param value the Unicode character value to set in the Map - * @throws JMSException if the JMS provider fails to write the message due - * to some internal error. - * @throws IllegalArgumentException if the name is null or if the name is an - * empty string. - * @throws MessageNotWriteableException if the message is in read-only mode. - */ - @Override - public void setChar(String name, char value) throws JMSException { - initializeWriting(); - put(name, Character.valueOf(value)); - } - - /** - * Sets an int value with the specified name into the Map. - * - * @param name the name of the int - * @param value the int value to set in the Map - * @throws JMSException if the JMS provider fails to write the message due - * to some internal error. - * @throws IllegalArgumentException if the name is null or if the name is an - * empty string. - * @throws MessageNotWriteableException if the message is in read-only mode. - */ - @Override - public void setInt(String name, int value) throws JMSException { - initializeWriting(); - put(name, Integer.valueOf(value)); - } - - /** - * Sets a long value with the specified name into the Map. - * - * @param name the name of the long - * @param value the long value to set in the Map - * @throws JMSException if the JMS provider fails to write the message due - * to some internal error. - * @throws IllegalArgumentException if the name is null or if the name is an - * empty string. - * @throws MessageNotWriteableException if the message is in read-only mode. - */ - @Override - public void setLong(String name, long value) throws JMSException { - initializeWriting(); - put(name, Long.valueOf(value)); - } - - /** - * Sets a float value with the specified name into the Map. - * - * @param name the name of the float - * @param value the float value to set in the Map - * @throws JMSException if the JMS provider fails to write the message due - * to some internal error. - * @throws IllegalArgumentException if the name is null or if the name is an - * empty string. - * @throws MessageNotWriteableException if the message is in read-only mode. - */ - @Override - public void setFloat(String name, float value) throws JMSException { - initializeWriting(); - put(name, new Float(value)); - } - - /** - * Sets a double value with the specified name into the Map. - * - * @param name the name of the double - * @param value the double value to set in the Map - * @throws JMSException if the JMS provider fails to write the message due - * to some internal error. - * @throws IllegalArgumentException if the name is null or if the name is an - * empty string. - * @throws MessageNotWriteableException if the message is in read-only mode. - */ - @Override - public void setDouble(String name, double value) throws JMSException { - initializeWriting(); - put(name, new Double(value)); - } - - /** - * Sets a String value with the specified name into the Map. - * - * @param name the name of the String - * @param value the String value to set in the Map - * @throws JMSException if the JMS provider fails to write the message due - * to some internal error. - * @throws IllegalArgumentException if the name is null or if the name is an - * empty string. - * @throws MessageNotWriteableException if the message is in read-only mode. - */ - @Override - public void setString(String name, String value) throws JMSException { - initializeWriting(); - put(name, value); - } - - /** - * Sets a byte array value with the specified name into the Map. - * - * @param name the name of the byte array - * @param value the byte array value to set in the Map; the array is copied - * so that the value for name will not be - * altered by future modifications - * @throws JMSException if the JMS provider fails to write the message due - * to some internal error. - * @throws NullPointerException if the name is null, or if the name is an - * empty string. - * @throws MessageNotWriteableException if the message is in read-only mode. - */ - @Override - public void setBytes(String name, byte[] value) throws JMSException { - initializeWriting(); - if (value != null) { - put(name, value); - } else { - map.remove(name); - } - } - - /** - * Sets a portion of the byte array value with the specified name into the - * Map. - * - * @param name the name of the byte array - * @param value the byte array value to set in the Map - * @param offset the initial offset within the byte array - * @param length the number of bytes to use - * @throws JMSException if the JMS provider fails to write the message due - * to some internal error. - * @throws IllegalArgumentException if the name is null or if the name is an - * empty string. - * @throws MessageNotWriteableException if the message is in read-only mode. - */ - @Override - public void setBytes(String name, byte[] value, int offset, int length) throws JMSException { - initializeWriting(); - byte[] data = new byte[length]; - System.arraycopy(value, offset, data, 0, length); - put(name, data); - } - - /** - * Sets an object value with the specified name into the Map. - *

    - * This method works only for the objectified primitive object types (Integer,Double, - * Long  ...), String objects, and byte - * arrays. - * - * @param name the name of the Java object - * @param value the Java object value to set in the Map - * @throws JMSException if the JMS provider fails to write the message due - * to some internal error. - * @throws IllegalArgumentException if the name is null or if the name is an - * empty string. - * @throws MessageFormatException if the object is invalid. - * @throws MessageNotWriteableException if the message is in read-only mode. - */ - @Override - public void setObject(String name, Object value) throws JMSException { - initializeWriting(); - if (value != null) { - // byte[] not allowed on properties - if (!(value instanceof byte[])) { - checkValidObject(value); - } - put(name, value); - } else { - put(name, null); - } - } - - /** - * Indicates whether an item exists in this MapMessage - * object. - * - * @param name the name of the item to test - * @return true if the item exists - * @throws JMSException if the JMS provider fails to determine if the item - * exists due to some internal error. - */ - @Override - public boolean itemExists(String name) throws JMSException { - initializeReading(); - return map.containsKey(name); - } - - private void initializeReading() throws JMSException { - loadContent(); - } - - private void initializeWriting() throws MessageNotWriteableException { - checkReadOnlyBody(); - setContent(null); - } - - @Override - public void compress() throws IOException { - storeContent(); - super.compress(); - } - - @Override - public String toString() { - return super.toString() + " ActiveMQMapMessage{ " + "theTable = " + map + " }"; - } - - public Map getContentMap() throws JMSException { - initializeReading(); - return map; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage$1.class deleted file mode 100644 index a1123fcee..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage$10.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage$10.class deleted file mode 100644 index d91ad5f85..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage$10.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage$11.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage$11.class deleted file mode 100644 index 31b2b1629..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage$11.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage$2.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage$2.class deleted file mode 100644 index adc9dba6f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage$2.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage$3.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage$3.class deleted file mode 100644 index 8b2554534..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage$3.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage$4.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage$4.class deleted file mode 100644 index 4d19264e4..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage$4.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage$5.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage$5.class deleted file mode 100644 index 538da885c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage$5.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage$6.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage$6.class deleted file mode 100644 index 463051496..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage$6.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage$7.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage$7.class deleted file mode 100644 index cfc60ab85..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage$7.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage$8.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage$8.class deleted file mode 100644 index 01b81d401..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage$8.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage$9.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage$9.class deleted file mode 100644 index f9d9e4f76..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage$9.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage$PropertySetter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage$PropertySetter.class deleted file mode 100644 index e0883c155..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage$PropertySetter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage.class deleted file mode 100644 index c8fc882fb..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage.java deleted file mode 100644 index e673d96da..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQMessage.java +++ /dev/null @@ -1,762 +0,0 @@ -/** - * 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.command; - -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Vector; - -import javax.jms.DeliveryMode; -import javax.jms.Destination; -import javax.jms.JMSException; -import javax.jms.MessageFormatException; -import javax.jms.MessageNotWriteableException; - -import org.apache.activemq.ActiveMQConnection; -import org.apache.activemq.ScheduledMessage; -import org.apache.activemq.broker.scheduler.CronParser; -import org.apache.activemq.filter.PropertyExpression; -import org.apache.activemq.state.CommandVisitor; -import org.apache.activemq.util.Callback; -import org.apache.activemq.util.JMSExceptionSupport; -import org.apache.activemq.util.TypeConversionSupport; - -/** - * - * @openwire:marshaller code="23" - */ -public class ActiveMQMessage extends Message implements org.apache.activemq.Message, ScheduledMessage { - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.ACTIVEMQ_MESSAGE; - public static final String DLQ_DELIVERY_FAILURE_CAUSE_PROPERTY = "dlqDeliveryFailureCause"; - public static final String BROKER_PATH_PROPERTY = "JMSActiveMQBrokerPath"; - - private static final Map JMS_PROPERTY_SETERS = new HashMap(); - - protected transient Callback acknowledgeCallback; - - @Override - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - @Override - public Message copy() { - ActiveMQMessage copy = new ActiveMQMessage(); - copy(copy); - return copy; - } - - protected void copy(ActiveMQMessage copy) { - super.copy(copy); - copy.acknowledgeCallback = acknowledgeCallback; - } - - @Override - public int hashCode() { - MessageId id = getMessageId(); - if (id != null) { - return id.hashCode(); - } else { - return super.hashCode(); - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || o.getClass() != getClass()) { - return false; - } - - ActiveMQMessage msg = (ActiveMQMessage) o; - MessageId oMsg = msg.getMessageId(); - MessageId thisMsg = this.getMessageId(); - return thisMsg != null && oMsg != null && oMsg.equals(thisMsg); - } - - @Override - public void acknowledge() throws JMSException { - if (acknowledgeCallback != null) { - try { - acknowledgeCallback.execute(); - } catch (JMSException e) { - throw e; - } catch (Throwable e) { - throw JMSExceptionSupport.create(e); - } - } - } - - @Override - public void clearBody() throws JMSException { - setContent(null); - readOnlyBody = false; - } - - @Override - public String getJMSMessageID() { - MessageId messageId = this.getMessageId(); - if (messageId == null) { - return null; - } - return messageId.toString(); - } - - /** - * Seems to be invalid because the parameter doesn't initialize MessageId - * instance variables ProducerId and ProducerSequenceId - * - * @param value - * @throws JMSException - */ - @Override - public void setJMSMessageID(String value) throws JMSException { - if (value != null) { - try { - MessageId id = new MessageId(value); - this.setMessageId(id); - } catch (NumberFormatException e) { - // we must be some foreign JMS provider or strange user-supplied - // String - // so lets set the IDs to be 1 - MessageId id = new MessageId(); - id.setTextView(value); - this.setMessageId(id); - } - } else { - this.setMessageId(null); - } - } - - /** - * This will create an object of MessageId. For it to be valid, the instance - * variable ProducerId and producerSequenceId must be initialized. - * - * @param producerId - * @param producerSequenceId - * @throws JMSException - */ - public void setJMSMessageID(ProducerId producerId, long producerSequenceId) throws JMSException { - MessageId id = null; - try { - id = new MessageId(producerId, producerSequenceId); - this.setMessageId(id); - } catch (Throwable e) { - throw JMSExceptionSupport.create("Invalid message id '" + id + "', reason: " + e.getMessage(), e); - } - } - - @Override - public long getJMSTimestamp() { - return this.getTimestamp(); - } - - @Override - public void setJMSTimestamp(long timestamp) { - this.setTimestamp(timestamp); - } - - @Override - public String getJMSCorrelationID() { - return this.getCorrelationId(); - } - - @Override - public void setJMSCorrelationID(String correlationId) { - this.setCorrelationId(correlationId); - } - - @Override - public byte[] getJMSCorrelationIDAsBytes() throws JMSException { - return encodeString(this.getCorrelationId()); - } - - @Override - public void setJMSCorrelationIDAsBytes(byte[] correlationId) throws JMSException { - this.setCorrelationId(decodeString(correlationId)); - } - - @Override - public String getJMSXMimeType() { - return "jms/message"; - } - - protected static String decodeString(byte[] data) throws JMSException { - try { - if (data == null) { - return null; - } - return new String(data, "UTF-8"); - } catch (UnsupportedEncodingException e) { - throw new JMSException("Invalid UTF-8 encoding: " + e.getMessage()); - } - } - - protected static byte[] encodeString(String data) throws JMSException { - try { - if (data == null) { - return null; - } - return data.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - throw new JMSException("Invalid UTF-8 encoding: " + e.getMessage()); - } - } - - @Override - public Destination getJMSReplyTo() { - return this.getReplyTo(); - } - - @Override - public void setJMSReplyTo(Destination destination) throws JMSException { - this.setReplyTo(ActiveMQDestination.transform(destination)); - } - - @Override - public Destination getJMSDestination() { - return this.getDestination(); - } - - @Override - public void setJMSDestination(Destination destination) throws JMSException { - this.setDestination(ActiveMQDestination.transform(destination)); - } - - @Override - public int getJMSDeliveryMode() { - return this.isPersistent() ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT; - } - - @Override - public void setJMSDeliveryMode(int mode) { - this.setPersistent(mode == DeliveryMode.PERSISTENT); - } - - @Override - public boolean getJMSRedelivered() { - return this.isRedelivered(); - } - - @Override - public void setJMSRedelivered(boolean redelivered) { - this.setRedelivered(redelivered); - } - - @Override - public String getJMSType() { - return this.getType(); - } - - @Override - public void setJMSType(String type) { - this.setType(type); - } - - @Override - public long getJMSExpiration() { - return this.getExpiration(); - } - - @Override - public void setJMSExpiration(long expiration) { - this.setExpiration(expiration); - } - - @Override - public int getJMSPriority() { - return this.getPriority(); - } - - @Override - public void setJMSPriority(int priority) { - this.setPriority((byte) priority); - } - - @Override - public void clearProperties() { - super.clearProperties(); - readOnlyProperties = false; - } - - @Override - public boolean propertyExists(String name) throws JMSException { - try { - return (this.getProperties().containsKey(name) || getObjectProperty(name)!= null); - } catch (IOException e) { - throw JMSExceptionSupport.create(e); - } - } - - @Override - @SuppressWarnings("rawtypes") - public Enumeration getPropertyNames() throws JMSException { - try { - Vector result = new Vector(this.getProperties().keySet()); - if( getRedeliveryCounter()!=0 ) { - result.add("JMSXDeliveryCount"); - } - if( getGroupID()!=null ) { - result.add("JMSXGroupID"); - } - if( getGroupID()!=null ) { - result.add("JMSXGroupSeq"); - } - if( getUserID()!=null ) { - result.add("JMSXUserID"); - } - return result.elements(); - } catch (IOException e) { - throw JMSExceptionSupport.create(e); - } - } - - /** - * return all property names, including standard JMS properties and JMSX properties - * @return Enumeration of all property names on this message - * @throws JMSException - */ - @SuppressWarnings("rawtypes") - public Enumeration getAllPropertyNames() throws JMSException { - try { - Vector result = new Vector(this.getProperties().keySet()); - result.addAll(JMS_PROPERTY_SETERS.keySet()); - return result.elements(); - } catch (IOException e) { - throw JMSExceptionSupport.create(e); - } - } - - interface PropertySetter { - void set(Message message, Object value) throws MessageFormatException; - } - - static { - JMS_PROPERTY_SETERS.put("JMSXDeliveryCount", new PropertySetter() { - @Override - public void set(Message message, Object value) throws MessageFormatException { - Integer rc = (Integer) TypeConversionSupport.convert(value, Integer.class); - if (rc == null) { - throw new MessageFormatException("Property JMSXDeliveryCount cannot be set from a " + value.getClass().getName() + "."); - } - message.setRedeliveryCounter(rc.intValue() - 1); - } - }); - JMS_PROPERTY_SETERS.put("JMSXGroupID", new PropertySetter() { - @Override - public void set(Message message, Object value) throws MessageFormatException { - String rc = (String) TypeConversionSupport.convert(value, String.class); - if (rc == null) { - throw new MessageFormatException("Property JMSXGroupID cannot be set from a " + value.getClass().getName() + "."); - } - message.setGroupID(rc); - } - }); - JMS_PROPERTY_SETERS.put("JMSXGroupSeq", new PropertySetter() { - @Override - public void set(Message message, Object value) throws MessageFormatException { - Integer rc = (Integer) TypeConversionSupport.convert(value, Integer.class); - if (rc == null) { - throw new MessageFormatException("Property JMSXGroupSeq cannot be set from a " + value.getClass().getName() + "."); - } - message.setGroupSequence(rc.intValue()); - } - }); - JMS_PROPERTY_SETERS.put("JMSCorrelationID", new PropertySetter() { - @Override - public void set(Message message, Object value) throws MessageFormatException { - String rc = (String) TypeConversionSupport.convert(value, String.class); - if (rc == null) { - throw new MessageFormatException("Property JMSCorrelationID cannot be set from a " + value.getClass().getName() + "."); - } - ((ActiveMQMessage) message).setJMSCorrelationID(rc); - } - }); - JMS_PROPERTY_SETERS.put("JMSDeliveryMode", new PropertySetter() { - @Override - public void set(Message message, Object value) throws MessageFormatException { - Integer rc = (Integer) TypeConversionSupport.convert(value, Integer.class); - if (rc == null) { - Boolean bool = (Boolean) TypeConversionSupport.convert(value, Boolean.class); - if (bool == null) { - throw new MessageFormatException("Property JMSDeliveryMode cannot be set from a " + value.getClass().getName() + "."); - } - else { - rc = bool.booleanValue() ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT; - } - } - ((ActiveMQMessage) message).setJMSDeliveryMode(rc); - } - }); - JMS_PROPERTY_SETERS.put("JMSExpiration", new PropertySetter() { - @Override - public void set(Message message, Object value) throws MessageFormatException { - Long rc = (Long) TypeConversionSupport.convert(value, Long.class); - if (rc == null) { - throw new MessageFormatException("Property JMSExpiration cannot be set from a " + value.getClass().getName() + "."); - } - ((ActiveMQMessage) message).setJMSExpiration(rc.longValue()); - } - }); - JMS_PROPERTY_SETERS.put("JMSPriority", new PropertySetter() { - @Override - public void set(Message message, Object value) throws MessageFormatException { - Integer rc = (Integer) TypeConversionSupport.convert(value, Integer.class); - if (rc == null) { - throw new MessageFormatException("Property JMSPriority cannot be set from a " + value.getClass().getName() + "."); - } - ((ActiveMQMessage) message).setJMSPriority(rc.intValue()); - } - }); - JMS_PROPERTY_SETERS.put("JMSRedelivered", new PropertySetter() { - @Override - public void set(Message message, Object value) throws MessageFormatException { - Boolean rc = (Boolean) TypeConversionSupport.convert(value, Boolean.class); - if (rc == null) { - throw new MessageFormatException("Property JMSRedelivered cannot be set from a " + value.getClass().getName() + "."); - } - ((ActiveMQMessage) message).setJMSRedelivered(rc.booleanValue()); - } - }); - JMS_PROPERTY_SETERS.put("JMSReplyTo", new PropertySetter() { - @Override - public void set(Message message, Object value) throws MessageFormatException { - ActiveMQDestination rc = (ActiveMQDestination) TypeConversionSupport.convert(value, ActiveMQDestination.class); - if (rc == null) { - throw new MessageFormatException("Property JMSReplyTo cannot be set from a " + value.getClass().getName() + "."); - } - ((ActiveMQMessage) message).setReplyTo(rc); - } - }); - JMS_PROPERTY_SETERS.put("JMSTimestamp", new PropertySetter() { - @Override - public void set(Message message, Object value) throws MessageFormatException { - Long rc = (Long) TypeConversionSupport.convert(value, Long.class); - if (rc == null) { - throw new MessageFormatException("Property JMSTimestamp cannot be set from a " + value.getClass().getName() + "."); - } - ((ActiveMQMessage) message).setJMSTimestamp(rc.longValue()); - } - }); - JMS_PROPERTY_SETERS.put("JMSType", new PropertySetter() { - @Override - public void set(Message message, Object value) throws MessageFormatException { - String rc = (String) TypeConversionSupport.convert(value, String.class); - if (rc == null) { - throw new MessageFormatException("Property JMSType cannot be set from a " + value.getClass().getName() + "."); - } - ((ActiveMQMessage) message).setJMSType(rc); - } - }); - } - - @Override - public void setObjectProperty(String name, Object value) throws JMSException { - setObjectProperty(name, value, true); - } - - public void setObjectProperty(String name, Object value, boolean checkReadOnly) throws JMSException { - - if (checkReadOnly) { - checkReadOnlyProperties(); - } - if (name == null || name.equals("")) { - throw new IllegalArgumentException("Property name cannot be empty or null"); - } - - checkValidObject(value); - value = convertScheduled(name, value); - PropertySetter setter = JMS_PROPERTY_SETERS.get(name); - - if (setter != null && value != null) { - setter.set(this, value); - } else { - try { - this.setProperty(name, value); - } catch (IOException e) { - throw JMSExceptionSupport.create(e); - } - } - } - - public void setProperties(Map properties) throws JMSException { - for (Map.Entry entry : properties.entrySet()) { - // Lets use the object property method as we may contain standard - // extension headers like JMSXGroupID - setObjectProperty(entry.getKey(), entry.getValue()); - } - } - - protected void checkValidObject(Object value) throws MessageFormatException { - - boolean valid = value instanceof Boolean || value instanceof Byte || value instanceof Short || value instanceof Integer || value instanceof Long; - valid = valid || value instanceof Float || value instanceof Double || value instanceof Character || value instanceof String || value == null; - - if (!valid) { - - ActiveMQConnection conn = getConnection(); - // conn is null if we are in the broker rather than a JMS client - if (conn == null || conn.isNestedMapAndListEnabled()) { - if (!(value instanceof Map || value instanceof List)) { - throw new MessageFormatException("Only objectified primitive objects, String, Map and List types are allowed but was: " + value + " type: " + value.getClass()); - } - } else { - throw new MessageFormatException("Only objectified primitive objects and String types are allowed but was: " + value + " type: " + value.getClass()); - } - } - } - - protected void checkValidScheduled(String name, Object value) throws MessageFormatException { - if (AMQ_SCHEDULED_DELAY.equals(name) || AMQ_SCHEDULED_PERIOD.equals(name) || AMQ_SCHEDULED_REPEAT.equals(name)) { - if (value instanceof Long == false && value instanceof Integer == false) { - throw new MessageFormatException(name + " should be long or int value"); - } - } - if (AMQ_SCHEDULED_CRON.equals(name)) { - CronParser.validate(value.toString()); - } - } - - protected Object convertScheduled(String name, Object value) throws MessageFormatException { - Object result = value; - if (AMQ_SCHEDULED_DELAY.equals(name)){ - result = TypeConversionSupport.convert(value, Long.class); - } - else if (AMQ_SCHEDULED_PERIOD.equals(name)){ - result = TypeConversionSupport.convert(value, Long.class); - } - else if (AMQ_SCHEDULED_REPEAT.equals(name)){ - result = TypeConversionSupport.convert(value, Integer.class); - } - return result; - } - - @Override - public Object getObjectProperty(String name) throws JMSException { - if (name == null) { - throw new NullPointerException("Property name cannot be null"); - } - - // PropertyExpression handles converting message headers to properties. - PropertyExpression expression = new PropertyExpression(name); - return expression.evaluate(this); - } - - @Override - public boolean getBooleanProperty(String name) throws JMSException { - Object value = getObjectProperty(name); - if (value == null) { - return false; - } - Boolean rc = (Boolean) TypeConversionSupport.convert(value, Boolean.class); - if (rc == null) { - throw new MessageFormatException("Property " + name + " was a " + value.getClass().getName() + " and cannot be read as a boolean"); - } - return rc.booleanValue(); - } - - @Override - public byte getByteProperty(String name) throws JMSException { - Object value = getObjectProperty(name); - if (value == null) { - throw new NumberFormatException("property " + name + " was null"); - } - Byte rc = (Byte) TypeConversionSupport.convert(value, Byte.class); - if (rc == null) { - throw new MessageFormatException("Property " + name + " was a " + value.getClass().getName() + " and cannot be read as a byte"); - } - return rc.byteValue(); - } - - @Override - public short getShortProperty(String name) throws JMSException { - Object value = getObjectProperty(name); - if (value == null) { - throw new NumberFormatException("property " + name + " was null"); - } - Short rc = (Short) TypeConversionSupport.convert(value, Short.class); - if (rc == null) { - throw new MessageFormatException("Property " + name + " was a " + value.getClass().getName() + " and cannot be read as a short"); - } - return rc.shortValue(); - } - - @Override - public int getIntProperty(String name) throws JMSException { - Object value = getObjectProperty(name); - if (value == null) { - throw new NumberFormatException("property " + name + " was null"); - } - Integer rc = (Integer) TypeConversionSupport.convert(value, Integer.class); - if (rc == null) { - throw new MessageFormatException("Property " + name + " was a " + value.getClass().getName() + " and cannot be read as an integer"); - } - return rc.intValue(); - } - - @Override - public long getLongProperty(String name) throws JMSException { - Object value = getObjectProperty(name); - if (value == null) { - throw new NumberFormatException("property " + name + " was null"); - } - Long rc = (Long) TypeConversionSupport.convert(value, Long.class); - if (rc == null) { - throw new MessageFormatException("Property " + name + " was a " + value.getClass().getName() + " and cannot be read as a long"); - } - return rc.longValue(); - } - - @Override - public float getFloatProperty(String name) throws JMSException { - Object value = getObjectProperty(name); - if (value == null) { - throw new NullPointerException("property " + name + " was null"); - } - Float rc = (Float) TypeConversionSupport.convert(value, Float.class); - if (rc == null) { - throw new MessageFormatException("Property " + name + " was a " + value.getClass().getName() + " and cannot be read as a float"); - } - return rc.floatValue(); - } - - @Override - public double getDoubleProperty(String name) throws JMSException { - Object value = getObjectProperty(name); - if (value == null) { - throw new NullPointerException("property " + name + " was null"); - } - Double rc = (Double) TypeConversionSupport.convert(value, Double.class); - if (rc == null) { - throw new MessageFormatException("Property " + name + " was a " + value.getClass().getName() + " and cannot be read as a double"); - } - return rc.doubleValue(); - } - - @Override - public String getStringProperty(String name) throws JMSException { - Object value = null; - if (name.equals("JMSXUserID")) { - value = getUserID(); - if (value == null) { - value = getObjectProperty(name); - } - } else { - value = getObjectProperty(name); - } - if (value == null) { - return null; - } - String rc = (String) TypeConversionSupport.convert(value, String.class); - if (rc == null) { - throw new MessageFormatException("Property " + name + " was a " + value.getClass().getName() + " and cannot be read as a String"); - } - return rc; - } - - @Override - public void setBooleanProperty(String name, boolean value) throws JMSException { - setBooleanProperty(name, value, true); - } - - public void setBooleanProperty(String name, boolean value, boolean checkReadOnly) throws JMSException { - setObjectProperty(name, Boolean.valueOf(value), checkReadOnly); - } - - @Override - public void setByteProperty(String name, byte value) throws JMSException { - setObjectProperty(name, Byte.valueOf(value)); - } - - @Override - public void setShortProperty(String name, short value) throws JMSException { - setObjectProperty(name, Short.valueOf(value)); - } - - @Override - public void setIntProperty(String name, int value) throws JMSException { - setObjectProperty(name, Integer.valueOf(value)); - } - - @Override - public void setLongProperty(String name, long value) throws JMSException { - setObjectProperty(name, Long.valueOf(value)); - } - - @Override - public void setFloatProperty(String name, float value) throws JMSException { - setObjectProperty(name, new Float(value)); - } - - @Override - public void setDoubleProperty(String name, double value) throws JMSException { - setObjectProperty(name, new Double(value)); - } - - @Override - public void setStringProperty(String name, String value) throws JMSException { - setObjectProperty(name, value); - } - - private void checkReadOnlyProperties() throws MessageNotWriteableException { - if (readOnlyProperties) { - throw new MessageNotWriteableException("Message properties are read-only"); - } - } - - protected void checkReadOnlyBody() throws MessageNotWriteableException { - if (readOnlyBody) { - throw new MessageNotWriteableException("Message body is read-only"); - } - } - - public Callback getAcknowledgeCallback() { - return acknowledgeCallback; - } - - public void setAcknowledgeCallback(Callback acknowledgeCallback) { - this.acknowledgeCallback = acknowledgeCallback; - } - - /** - * Send operation event listener. Used to get the message ready to be sent. - */ - public void onSend() throws JMSException { - setReadOnlyBody(true); - setReadOnlyProperties(true); - } - - @Override - public Response visit(CommandVisitor visitor) throws Exception { - return visitor.processMessage(this); - } - - @Override - public void storeContent() { - } - - @Override - public void storeContentAndClear() { - storeContent(); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQObjectMessage.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQObjectMessage.class deleted file mode 100644 index 6fc150537..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQObjectMessage.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQObjectMessage.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQObjectMessage.java deleted file mode 100644 index 283cc0012..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQObjectMessage.java +++ /dev/null @@ -1,237 +0,0 @@ -/** - * 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.command; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.ObjectOutputStream; -import java.io.OutputStream; -import java.io.Serializable; -import java.util.zip.DeflaterOutputStream; -import java.util.zip.InflaterInputStream; - -import javax.jms.JMSException; -import javax.jms.ObjectMessage; - -import org.apache.activemq.ActiveMQConnection; -import org.apache.activemq.util.ByteArrayInputStream; -import org.apache.activemq.util.ByteArrayOutputStream; -import org.apache.activemq.util.ByteSequence; -import org.apache.activemq.util.ClassLoadingAwareObjectInputStream; -import org.apache.activemq.util.JMSExceptionSupport; -import org.apache.activemq.wireformat.WireFormat; - -/** - * An ObjectMessage object is used to send a message that - * contains a serializable object in the Java programming language ("Java - * object"). It inherits from the Message interface and adds a - * body containing a single reference to an object. Only - * Serializable Java objects can be used.

    - *

    - * If a collection of Java objects must be sent, one of the - * Collection classes provided since JDK 1.2 can be used.

    - *

    - * When a client receives an ObjectMessage, it is in read-only - * mode. If a client attempts to write to the message at this point, a - * MessageNotWriteableException is thrown. If - * clearBody is called, the message can now be both read from and - * written to. - * - * @openwire:marshaller code="26" - * @see javax.jms.Session#createObjectMessage() - * @see javax.jms.Session#createObjectMessage(Serializable) - * @see javax.jms.BytesMessage - * @see javax.jms.MapMessage - * @see javax.jms.Message - * @see javax.jms.StreamMessage - * @see javax.jms.TextMessage - */ -public class ActiveMQObjectMessage extends ActiveMQMessage implements ObjectMessage { - - // TODO: verify classloader - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.ACTIVEMQ_OBJECT_MESSAGE; - static final ClassLoader ACTIVEMQ_CLASSLOADER = ActiveMQObjectMessage.class.getClassLoader(); - - protected transient Serializable object; - - public Message copy() { - ActiveMQObjectMessage copy = new ActiveMQObjectMessage(); - copy(copy); - return copy; - } - - private void copy(ActiveMQObjectMessage copy) { - ActiveMQConnection connection = getConnection(); - if (connection == null || !connection.isObjectMessageSerializationDefered()) { - storeContent(); - copy.object = null; - } else { - copy.object = object; - } - super.copy(copy); - - } - - @Override - public void storeContentAndClear() { - storeContent(); - object = null; - } - - @Override - public void storeContent() { - ByteSequence bodyAsBytes = getContent(); - if (bodyAsBytes == null && object != null) { - try { - ByteArrayOutputStream bytesOut = new ByteArrayOutputStream(); - OutputStream os = bytesOut; - ActiveMQConnection connection = getConnection(); - if (connection != null && connection.isUseCompression()) { - compressed = true; - os = new DeflaterOutputStream(os); - } - DataOutputStream dataOut = new DataOutputStream(os); - ObjectOutputStream objOut = new ObjectOutputStream(dataOut); - objOut.writeObject(object); - objOut.flush(); - objOut.reset(); - objOut.close(); - setContent(bytesOut.toByteSequence()); - } catch (IOException ioe) { - throw new RuntimeException(ioe.getMessage(), ioe); - } - } - } - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - public String getJMSXMimeType() { - return "jms/object-message"; - } - - /** - * Clears out the message body. Clearing a message's body does not clear its - * header values or property entries.

    - *

    - * If this message body was read-only, calling this method leaves the - * message body in the same state as an empty body in a newly created - * message. - * - * @throws JMSException if the JMS provider fails to clear the message body - * due to some internal error. - */ - - public void clearBody() throws JMSException { - super.clearBody(); - this.object = null; - } - - /** - * Sets the serializable object containing this message's data. It is - * important to note that an ObjectMessage contains a - * snapshot of the object at the time setObject() is called; - * subsequent modifications of the object will have no effect on the - * ObjectMessage body. - * - * @param newObject the message's data - * @throws JMSException if the JMS provider fails to set the object due to - * some internal error. - * @throws javax.jms.MessageFormatException if object serialization fails. - * @throws javax.jms.MessageNotWriteableException if the message is in - * read-only mode. - */ - - public void setObject(Serializable newObject) throws JMSException { - checkReadOnlyBody(); - this.object = newObject; - setContent(null); - ActiveMQConnection connection = getConnection(); - if (connection == null || !connection.isObjectMessageSerializationDefered()) { - storeContent(); - } - } - - /** - * Gets the serializable object containing this message's data. The default - * value is null. - * - * @return the serializable object containing this message's data - * @throws JMSException - */ - public Serializable getObject() throws JMSException { - if (object == null && getContent() != null) { - try { - ByteSequence content = getContent(); - InputStream is = new ByteArrayInputStream(content); - if (isCompressed()) { - is = new InflaterInputStream(is); - } - DataInputStream dataIn = new DataInputStream(is); - ClassLoadingAwareObjectInputStream objIn = new ClassLoadingAwareObjectInputStream(dataIn); - try { - object = (Serializable)objIn.readObject(); - } catch (ClassNotFoundException ce) { - throw JMSExceptionSupport.create("Failed to build body from content. Serializable class not available to broker. Reason: " + ce, ce); - } finally { - dataIn.close(); - } - } catch (IOException e) { - throw JMSExceptionSupport.create("Failed to build body from bytes. Reason: " + e, e); - } - } - return this.object; - } - - @Override - public void beforeMarshall(WireFormat wireFormat) throws IOException { - super.beforeMarshall(wireFormat); - // may have initiated on vm transport with deferred marshalling - storeContent(); - } - - public void clearMarshalledState() throws JMSException { - super.clearMarshalledState(); - this.object = null; - } - - public void onMessageRolledBack() { - super.onMessageRolledBack(); - - // lets force the object to be deserialized again - as we could have - // changed the object - object = null; - } - - @Override - public void compress() throws IOException { - storeContent(); - super.compress(); - } - - public String toString() { - try { - getObject(); - } catch (JMSException e) { - } - return super.toString(); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQQueue.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQQueue.class deleted file mode 100644 index 98754b2b8..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQQueue.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQQueue.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQQueue.java deleted file mode 100644 index 331450102..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQQueue.java +++ /dev/null @@ -1,62 +0,0 @@ -/** - * 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.command; - -import javax.jms.JMSException; -import javax.jms.Queue; - -/** - * - * @org.apache.xbean.XBean element="queue" description="An ActiveMQ Queue - * Destination" - * - * @openwire:marshaller code="100" - * - */ -public class ActiveMQQueue extends ActiveMQDestination implements Queue { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.ACTIVEMQ_QUEUE; - private static final long serialVersionUID = -3885260014960795889L; - - public ActiveMQQueue() { - } - - public ActiveMQQueue(String name) { - super(name); - } - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - public boolean isQueue() { - return true; - } - - public String getQueueName() throws JMSException { - return getPhysicalName(); - } - - public byte getDestinationType() { - return QUEUE_TYPE; - } - - protected String getQualifiedPrefix() { - return QUEUE_QUALIFIED_PREFIX; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQStreamMessage.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQStreamMessage.class deleted file mode 100644 index 8d5274bf2..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQStreamMessage.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQStreamMessage.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQStreamMessage.java deleted file mode 100644 index f9dda6c3d..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQStreamMessage.java +++ /dev/null @@ -1,1159 +0,0 @@ -/** - * 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.command; - -import java.io.BufferedInputStream; -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.EOFException; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.zip.DeflaterOutputStream; -import java.util.zip.InflaterInputStream; - -import javax.jms.JMSException; -import javax.jms.MessageEOFException; -import javax.jms.MessageFormatException; -import javax.jms.MessageNotReadableException; -import javax.jms.MessageNotWriteableException; -import javax.jms.StreamMessage; - -import org.apache.activemq.ActiveMQConnection; -import org.apache.activemq.util.ByteArrayInputStream; -import org.apache.activemq.util.ByteArrayOutputStream; -import org.apache.activemq.util.ByteSequence; -import org.apache.activemq.util.JMSExceptionSupport; -import org.apache.activemq.util.MarshallingSupport; - -/** - * A StreamMessage object is used to send a stream of primitive - * types in the Java programming language. It is filled and read sequentially. - * It inherits from the Message interface and adds a stream - * message body. Its methods are based largely on those found in - * java.io.DataInputStream and - * java.io.DataOutputStream.

    - *

    - * The primitive types can be read or written explicitly using methods for each - * type. They may also be read or written generically as objects. For instance, - * a call to StreamMessage.writeInt(6) is equivalent to - * StreamMessage.writeObject(new - * Integer(6)). Both forms are - * provided, because the explicit form is convenient for static programming, and - * the object form is needed when types are not known at compile time.

    - *

    - * When the message is first created, and when clearBody is - * called, the body of the message is in write-only mode. After the first call - * to reset has been made, the message body is in read-only mode. - * After a message has been sent, the client that sent it can retain and modify - * it without affecting the message that has been sent. The same message object - * can be sent multiple times. When a message has been received, the provider - * has called reset so that the message body is in read-only mode - * for the client.

    - *

    - * If clearBody is called on a message in read-only mode, the - * message body is cleared and the message body is in write-only mode.

    - *

    - * If a client attempts to read a message in write-only mode, a - * MessageNotReadableException is thrown.

    - *

    - * If a client attempts to write a message in read-only mode, a - * MessageNotWriteableException is thrown.

    - *

    - * StreamMessage objects support the following conversion table. - * The marked cases must be supported. The unmarked cases must throw a - * JMSException. The String-to-primitive - * conversions may throw a runtime exception if the primitive's - * valueOf() method does not accept it as a valid - * String representation of the primitive.

    - *

    - * A value written as the row type can be read as the column type.

    - * - *

    - *  | | boolean byte short char int long float double String byte[]
    - * |----------------------------------------------------------------------
    - * |boolean | X X |byte | X X X X X |short | X X X X |char | X X |int | X X X
    - * |long | X X |float | X X X |double | X X |String | X X X X X X X X |byte[] |
    - * X |----------------------------------------------------------------------
    - *
    - * 
    - * - *

    - *

    - * Attempting to read a null value as a primitive type must be treated as - * calling the primitive's corresponding valueOf(String) - * conversion method with a null value. Since char does not - * support a String conversion, attempting to read a null value - * as a char must throw a NullPointerException. - * - * @openwire:marshaller code="27" - * @see javax.jms.Session#createStreamMessage() - * @see javax.jms.BytesMessage - * @see javax.jms.MapMessage - * @see javax.jms.Message - * @see javax.jms.ObjectMessage - * @see javax.jms.TextMessage - */ -public class ActiveMQStreamMessage extends ActiveMQMessage implements StreamMessage { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.ACTIVEMQ_STREAM_MESSAGE; - - protected transient DataOutputStream dataOut; - protected transient ByteArrayOutputStream bytesOut; - protected transient DataInputStream dataIn; - protected transient int remainingBytes = -1; - - public Message copy() { - ActiveMQStreamMessage copy = new ActiveMQStreamMessage(); - copy(copy); - return copy; - } - - private void copy(ActiveMQStreamMessage copy) { - storeContent(); - super.copy(copy); - copy.dataOut = null; - copy.bytesOut = null; - copy.dataIn = null; - } - - public void onSend() throws JMSException { - super.onSend(); - storeContent(); - } - - @Override - public void storeContent() { - if (dataOut != null) { - try { - dataOut.close(); - setContent(bytesOut.toByteSequence()); - bytesOut = null; - dataOut = null; - } catch (IOException ioe) { - throw new RuntimeException(ioe); - } - } - } - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - public String getJMSXMimeType() { - return "jms/stream-message"; - } - - /** - * Clears out the message body. Clearing a message's body does not clear its - * header values or property entries.

    - *

    - * If this message body was read-only, calling this method leaves the - * message body in the same state as an empty body in a newly created - * message. - * - * @throws JMSException if the JMS provider fails to clear the message body - * due to some internal error. - */ - - public void clearBody() throws JMSException { - super.clearBody(); - this.dataOut = null; - this.dataIn = null; - this.bytesOut = null; - this.remainingBytes = -1; - } - - /** - * Reads a boolean from the stream message. - * - * @return the boolean value read - * @throws JMSException if the JMS provider fails to read the message due to - * some internal error. - * @throws MessageEOFException if unexpected end of message stream has been - * reached. - * @throws MessageFormatException if this type conversion is invalid. - * @throws MessageNotReadableException if the message is in write-only mode. - */ - - public boolean readBoolean() throws JMSException { - initializeReading(); - try { - - this.dataIn.mark(10); - int type = this.dataIn.read(); - if (type == -1) { - throw new MessageEOFException("reached end of data"); - } - if (type == MarshallingSupport.BOOLEAN_TYPE) { - return this.dataIn.readBoolean(); - } - if (type == MarshallingSupport.STRING_TYPE) { - return Boolean.valueOf(this.dataIn.readUTF()).booleanValue(); - } - if (type == MarshallingSupport.NULL) { - this.dataIn.reset(); - throw new NullPointerException("Cannot convert NULL value to boolean."); - } else { - this.dataIn.reset(); - throw new MessageFormatException(" not a boolean type"); - } - } catch (EOFException e) { - throw JMSExceptionSupport.createMessageEOFException(e); - } catch (IOException e) { - throw JMSExceptionSupport.createMessageFormatException(e); - } - } - - /** - * Reads a byte value from the stream message. - * - * @return the next byte from the stream message as a 8-bit - * byte - * @throws JMSException if the JMS provider fails to read the message due to - * some internal error. - * @throws MessageEOFException if unexpected end of message stream has been - * reached. - * @throws MessageFormatException if this type conversion is invalid. - * @throws MessageNotReadableException if the message is in write-only mode. - */ - - public byte readByte() throws JMSException { - initializeReading(); - try { - - this.dataIn.mark(10); - int type = this.dataIn.read(); - if (type == -1) { - throw new MessageEOFException("reached end of data"); - } - if (type == MarshallingSupport.BYTE_TYPE) { - return this.dataIn.readByte(); - } - if (type == MarshallingSupport.STRING_TYPE) { - return Byte.valueOf(this.dataIn.readUTF()).byteValue(); - } - if (type == MarshallingSupport.NULL) { - this.dataIn.reset(); - throw new NullPointerException("Cannot convert NULL value to byte."); - } else { - this.dataIn.reset(); - throw new MessageFormatException(" not a byte type"); - } - } catch (NumberFormatException mfe) { - try { - this.dataIn.reset(); - } catch (IOException ioe) { - throw JMSExceptionSupport.create(ioe); - } - throw mfe; - - } catch (EOFException e) { - throw JMSExceptionSupport.createMessageEOFException(e); - } catch (IOException e) { - throw JMSExceptionSupport.createMessageFormatException(e); - } - } - - /** - * Reads a 16-bit integer from the stream message. - * - * @return a 16-bit integer from the stream message - * @throws JMSException if the JMS provider fails to read the message due to - * some internal error. - * @throws MessageEOFException if unexpected end of message stream has been - * reached. - * @throws MessageFormatException if this type conversion is invalid. - * @throws MessageNotReadableException if the message is in write-only mode. - */ - - public short readShort() throws JMSException { - initializeReading(); - try { - - this.dataIn.mark(17); - int type = this.dataIn.read(); - if (type == -1) { - throw new MessageEOFException("reached end of data"); - } - if (type == MarshallingSupport.SHORT_TYPE) { - return this.dataIn.readShort(); - } - if (type == MarshallingSupport.BYTE_TYPE) { - return this.dataIn.readByte(); - } - if (type == MarshallingSupport.STRING_TYPE) { - return Short.valueOf(this.dataIn.readUTF()).shortValue(); - } - if (type == MarshallingSupport.NULL) { - this.dataIn.reset(); - throw new NullPointerException("Cannot convert NULL value to short."); - } else { - this.dataIn.reset(); - throw new MessageFormatException(" not a short type"); - } - } catch (NumberFormatException mfe) { - try { - this.dataIn.reset(); - } catch (IOException ioe) { - throw JMSExceptionSupport.create(ioe); - } - throw mfe; - - } catch (EOFException e) { - throw JMSExceptionSupport.createMessageEOFException(e); - } catch (IOException e) { - throw JMSExceptionSupport.createMessageFormatException(e); - } - - } - - /** - * Reads a Unicode character value from the stream message. - * - * @return a Unicode character from the stream message - * @throws JMSException if the JMS provider fails to read the message due to - * some internal error. - * @throws MessageEOFException if unexpected end of message stream has been - * reached. - * @throws MessageFormatException if this type conversion is invalid - * @throws MessageNotReadableException if the message is in write-only mode. - */ - - public char readChar() throws JMSException { - initializeReading(); - try { - - this.dataIn.mark(17); - int type = this.dataIn.read(); - if (type == -1) { - throw new MessageEOFException("reached end of data"); - } - if (type == MarshallingSupport.CHAR_TYPE) { - return this.dataIn.readChar(); - } - if (type == MarshallingSupport.NULL) { - this.dataIn.reset(); - throw new NullPointerException("Cannot convert NULL value to char."); - } else { - this.dataIn.reset(); - throw new MessageFormatException(" not a char type"); - } - } catch (NumberFormatException mfe) { - try { - this.dataIn.reset(); - } catch (IOException ioe) { - throw JMSExceptionSupport.create(ioe); - } - throw mfe; - - } catch (EOFException e) { - throw JMSExceptionSupport.createMessageEOFException(e); - } catch (IOException e) { - throw JMSExceptionSupport.createMessageFormatException(e); - } - } - - /** - * Reads a 32-bit integer from the stream message. - * - * @return a 32-bit integer value from the stream message, interpreted as an - * int - * @throws JMSException if the JMS provider fails to read the message due to - * some internal error. - * @throws MessageEOFException if unexpected end of message stream has been - * reached. - * @throws MessageFormatException if this type conversion is invalid. - * @throws MessageNotReadableException if the message is in write-only mode. - */ - - public int readInt() throws JMSException { - initializeReading(); - try { - - this.dataIn.mark(33); - int type = this.dataIn.read(); - if (type == -1) { - throw new MessageEOFException("reached end of data"); - } - if (type == MarshallingSupport.INTEGER_TYPE) { - return this.dataIn.readInt(); - } - if (type == MarshallingSupport.SHORT_TYPE) { - return this.dataIn.readShort(); - } - if (type == MarshallingSupport.BYTE_TYPE) { - return this.dataIn.readByte(); - } - if (type == MarshallingSupport.STRING_TYPE) { - return Integer.valueOf(this.dataIn.readUTF()).intValue(); - } - if (type == MarshallingSupport.NULL) { - this.dataIn.reset(); - throw new NullPointerException("Cannot convert NULL value to int."); - } else { - this.dataIn.reset(); - throw new MessageFormatException(" not an int type"); - } - } catch (NumberFormatException mfe) { - try { - this.dataIn.reset(); - } catch (IOException ioe) { - throw JMSExceptionSupport.create(ioe); - } - throw mfe; - - } catch (EOFException e) { - throw JMSExceptionSupport.createMessageEOFException(e); - } catch (IOException e) { - throw JMSExceptionSupport.createMessageFormatException(e); - } - } - - /** - * Reads a 64-bit integer from the stream message. - * - * @return a 64-bit integer value from the stream message, interpreted as a - * long - * @throws JMSException if the JMS provider fails to read the message due to - * some internal error. - * @throws MessageEOFException if unexpected end of message stream has been - * reached. - * @throws MessageFormatException if this type conversion is invalid. - * @throws MessageNotReadableException if the message is in write-only mode. - */ - - public long readLong() throws JMSException { - initializeReading(); - try { - - this.dataIn.mark(65); - int type = this.dataIn.read(); - if (type == -1) { - throw new MessageEOFException("reached end of data"); - } - if (type == MarshallingSupport.LONG_TYPE) { - return this.dataIn.readLong(); - } - if (type == MarshallingSupport.INTEGER_TYPE) { - return this.dataIn.readInt(); - } - if (type == MarshallingSupport.SHORT_TYPE) { - return this.dataIn.readShort(); - } - if (type == MarshallingSupport.BYTE_TYPE) { - return this.dataIn.readByte(); - } - if (type == MarshallingSupport.STRING_TYPE) { - return Long.valueOf(this.dataIn.readUTF()).longValue(); - } - if (type == MarshallingSupport.NULL) { - this.dataIn.reset(); - throw new NullPointerException("Cannot convert NULL value to long."); - } else { - this.dataIn.reset(); - throw new MessageFormatException(" not a long type"); - } - } catch (NumberFormatException mfe) { - try { - this.dataIn.reset(); - } catch (IOException ioe) { - throw JMSExceptionSupport.create(ioe); - } - throw mfe; - - } catch (EOFException e) { - throw JMSExceptionSupport.createMessageEOFException(e); - } catch (IOException e) { - throw JMSExceptionSupport.createMessageFormatException(e); - } - } - - /** - * Reads a float from the stream message. - * - * @return a float value from the stream message - * @throws JMSException if the JMS provider fails to read the message due to - * some internal error. - * @throws MessageEOFException if unexpected end of message stream has been - * reached. - * @throws MessageFormatException if this type conversion is invalid. - * @throws MessageNotReadableException if the message is in write-only mode. - */ - - public float readFloat() throws JMSException { - initializeReading(); - try { - this.dataIn.mark(33); - int type = this.dataIn.read(); - if (type == -1) { - throw new MessageEOFException("reached end of data"); - } - if (type == MarshallingSupport.FLOAT_TYPE) { - return this.dataIn.readFloat(); - } - if (type == MarshallingSupport.STRING_TYPE) { - return Float.valueOf(this.dataIn.readUTF()).floatValue(); - } - if (type == MarshallingSupport.NULL) { - this.dataIn.reset(); - throw new NullPointerException("Cannot convert NULL value to float."); - } else { - this.dataIn.reset(); - throw new MessageFormatException(" not a float type"); - } - } catch (NumberFormatException mfe) { - try { - this.dataIn.reset(); - } catch (IOException ioe) { - throw JMSExceptionSupport.create(ioe); - } - throw mfe; - - } catch (EOFException e) { - throw JMSExceptionSupport.createMessageEOFException(e); - } catch (IOException e) { - throw JMSExceptionSupport.createMessageFormatException(e); - } - } - - /** - * Reads a double from the stream message. - * - * @return a double value from the stream message - * @throws JMSException if the JMS provider fails to read the message due to - * some internal error. - * @throws MessageEOFException if unexpected end of message stream has been - * reached. - * @throws MessageFormatException if this type conversion is invalid. - * @throws MessageNotReadableException if the message is in write-only mode. - */ - - public double readDouble() throws JMSException { - initializeReading(); - try { - - this.dataIn.mark(65); - int type = this.dataIn.read(); - if (type == -1) { - throw new MessageEOFException("reached end of data"); - } - if (type == MarshallingSupport.DOUBLE_TYPE) { - return this.dataIn.readDouble(); - } - if (type == MarshallingSupport.FLOAT_TYPE) { - return this.dataIn.readFloat(); - } - if (type == MarshallingSupport.STRING_TYPE) { - return Double.valueOf(this.dataIn.readUTF()).doubleValue(); - } - if (type == MarshallingSupport.NULL) { - this.dataIn.reset(); - throw new NullPointerException("Cannot convert NULL value to double."); - } else { - this.dataIn.reset(); - throw new MessageFormatException(" not a double type"); - } - } catch (NumberFormatException mfe) { - try { - this.dataIn.reset(); - } catch (IOException ioe) { - throw JMSExceptionSupport.create(ioe); - } - throw mfe; - - } catch (EOFException e) { - throw JMSExceptionSupport.createMessageEOFException(e); - } catch (IOException e) { - throw JMSExceptionSupport.createMessageFormatException(e); - } - } - - /** - * Reads a String from the stream message. - * - * @return a Unicode string from the stream message - * @throws JMSException if the JMS provider fails to read the message due to - * some internal error. - * @throws MessageEOFException if unexpected end of message stream has been - * reached. - * @throws MessageFormatException if this type conversion is invalid. - * @throws MessageNotReadableException if the message is in write-only mode. - */ - - public String readString() throws JMSException { - initializeReading(); - try { - - this.dataIn.mark(65); - int type = this.dataIn.read(); - if (type == -1) { - throw new MessageEOFException("reached end of data"); - } - if (type == MarshallingSupport.NULL) { - return null; - } - if (type == MarshallingSupport.BIG_STRING_TYPE) { - return MarshallingSupport.readUTF8(dataIn); - } - if (type == MarshallingSupport.STRING_TYPE) { - return this.dataIn.readUTF(); - } - if (type == MarshallingSupport.LONG_TYPE) { - return new Long(this.dataIn.readLong()).toString(); - } - if (type == MarshallingSupport.INTEGER_TYPE) { - return new Integer(this.dataIn.readInt()).toString(); - } - if (type == MarshallingSupport.SHORT_TYPE) { - return new Short(this.dataIn.readShort()).toString(); - } - if (type == MarshallingSupport.BYTE_TYPE) { - return new Byte(this.dataIn.readByte()).toString(); - } - if (type == MarshallingSupport.FLOAT_TYPE) { - return new Float(this.dataIn.readFloat()).toString(); - } - if (type == MarshallingSupport.DOUBLE_TYPE) { - return new Double(this.dataIn.readDouble()).toString(); - } - if (type == MarshallingSupport.BOOLEAN_TYPE) { - return (this.dataIn.readBoolean() ? Boolean.TRUE : Boolean.FALSE).toString(); - } - if (type == MarshallingSupport.CHAR_TYPE) { - return new Character(this.dataIn.readChar()).toString(); - } else { - this.dataIn.reset(); - throw new MessageFormatException(" not a String type"); - } - } catch (NumberFormatException mfe) { - try { - this.dataIn.reset(); - } catch (IOException ioe) { - throw JMSExceptionSupport.create(ioe); - } - throw mfe; - - } catch (EOFException e) { - throw JMSExceptionSupport.createMessageEOFException(e); - } catch (IOException e) { - throw JMSExceptionSupport.createMessageFormatException(e); - } - } - - /** - * Reads a byte array field from the stream message into the specified - * byte[] object (the read buffer).

    - *

    - * To read the field value, readBytes should be successively - * called until it returns a value less than the length of the read buffer. - * The value of the bytes in the buffer following the last byte read is - * undefined.

    - *

    - * If readBytes returns a value equal to the length of the - * buffer, a subsequent readBytes call must be made. If there - * are no more bytes to be read, this call returns -1.

    - *

    - * If the byte array field value is null, readBytes returns - * -1.

    - *

    - * If the byte array field value is empty, readBytes returns - * 0.

    - *

    - * Once the first readBytes call on a byte[] - * field value has been made, the full value of the field must be read - * before it is valid to read the next field. An attempt to read the next - * field before that has been done will throw a - * MessageFormatException.

    - *

    - * To read the byte field value into a new byte[] object, use - * the readObject method. - * - * @param value the buffer into which the data is read - * @return the total number of bytes read into the buffer, or -1 if there is - * no more data because the end of the byte field has been reached - * @throws JMSException if the JMS provider fails to read the message due to - * some internal error. - * @throws MessageEOFException if unexpected end of message stream has been - * reached. - * @throws MessageFormatException if this type conversion is invalid. - * @throws MessageNotReadableException if the message is in write-only mode. - * @see #readObject() - */ - - public int readBytes(byte[] value) throws JMSException { - - initializeReading(); - try { - if (value == null) { - throw new NullPointerException(); - } - - if (remainingBytes == -1) { - this.dataIn.mark(value.length + 1); - int type = this.dataIn.read(); - if (type == -1) { - throw new MessageEOFException("reached end of data"); - } - if (type != MarshallingSupport.BYTE_ARRAY_TYPE) { - throw new MessageFormatException("Not a byte array"); - } - remainingBytes = this.dataIn.readInt(); - } else if (remainingBytes == 0) { - remainingBytes = -1; - return -1; - } - - if (value.length <= remainingBytes) { - // small buffer - remainingBytes -= value.length; - this.dataIn.readFully(value); - return value.length; - } else { - // big buffer - int rc = this.dataIn.read(value, 0, remainingBytes); - remainingBytes = 0; - return rc; - } - - } catch (EOFException e) { - JMSException jmsEx = new MessageEOFException(e.getMessage()); - jmsEx.setLinkedException(e); - throw jmsEx; - } catch (IOException e) { - JMSException jmsEx = new MessageFormatException(e.getMessage()); - jmsEx.setLinkedException(e); - throw jmsEx; - } - } - - /** - * Reads an object from the stream message.

    - *

    - * This method can be used to return, in objectified format, an object in - * the Java programming language ("Java object") that has been written to - * the stream with the equivalent writeObject method call, or - * its equivalent primitive writetype method.

    - *

    - * Note that byte values are returned as byte[], not - * Byte[].

    - *

    - * An attempt to call readObject to read a byte field value - * into a new byte[] object before the full value of the byte - * field has been read will throw a MessageFormatException. - * - * @return a Java object from the stream message, in objectified format (for - * example, if the object was written as an int, an - * Integer is returned) - * @throws JMSException if the JMS provider fails to read the message due to - * some internal error. - * @throws MessageEOFException if unexpected end of message stream has been - * reached. - * @throws MessageFormatException if this type conversion is invalid. - * @throws MessageNotReadableException if the message is in write-only mode. - * @see #readBytes(byte[] value) - */ - - public Object readObject() throws JMSException { - initializeReading(); - try { - this.dataIn.mark(65); - int type = this.dataIn.read(); - if (type == -1) { - throw new MessageEOFException("reached end of data"); - } - if (type == MarshallingSupport.NULL) { - return null; - } - if (type == MarshallingSupport.BIG_STRING_TYPE) { - return MarshallingSupport.readUTF8(dataIn); - } - if (type == MarshallingSupport.STRING_TYPE) { - return this.dataIn.readUTF(); - } - if (type == MarshallingSupport.LONG_TYPE) { - return Long.valueOf(this.dataIn.readLong()); - } - if (type == MarshallingSupport.INTEGER_TYPE) { - return Integer.valueOf(this.dataIn.readInt()); - } - if (type == MarshallingSupport.SHORT_TYPE) { - return Short.valueOf(this.dataIn.readShort()); - } - if (type == MarshallingSupport.BYTE_TYPE) { - return Byte.valueOf(this.dataIn.readByte()); - } - if (type == MarshallingSupport.FLOAT_TYPE) { - return new Float(this.dataIn.readFloat()); - } - if (type == MarshallingSupport.DOUBLE_TYPE) { - return new Double(this.dataIn.readDouble()); - } - if (type == MarshallingSupport.BOOLEAN_TYPE) { - return this.dataIn.readBoolean() ? Boolean.TRUE : Boolean.FALSE; - } - if (type == MarshallingSupport.CHAR_TYPE) { - return Character.valueOf(this.dataIn.readChar()); - } - if (type == MarshallingSupport.BYTE_ARRAY_TYPE) { - int len = this.dataIn.readInt(); - byte[] value = new byte[len]; - this.dataIn.readFully(value); - return value; - } else { - this.dataIn.reset(); - throw new MessageFormatException("unknown type"); - } - } catch (NumberFormatException mfe) { - try { - this.dataIn.reset(); - } catch (IOException ioe) { - throw JMSExceptionSupport.create(ioe); - } - throw mfe; - - } catch (EOFException e) { - JMSException jmsEx = new MessageEOFException(e.getMessage()); - jmsEx.setLinkedException(e); - throw jmsEx; - } catch (IOException e) { - JMSException jmsEx = new MessageFormatException(e.getMessage()); - jmsEx.setLinkedException(e); - throw jmsEx; - } - } - - /** - * Writes a boolean to the stream message. The value - * true is written as the value (byte)1; the - * value false is written as the value (byte)0. - * - * @param value the boolean value to be written - * @throws JMSException if the JMS provider fails to write the message due - * to some internal error. - * @throws MessageNotWriteableException if the message is in read-only mode. - */ - - public void writeBoolean(boolean value) throws JMSException { - initializeWriting(); - try { - MarshallingSupport.marshalBoolean(dataOut, value); - } catch (IOException ioe) { - throw JMSExceptionSupport.create(ioe); - } - } - - /** - * Writes a byte to the stream message. - * - * @param value the byte value to be written - * @throws JMSException if the JMS provider fails to write the message due - * to some internal error. - * @throws MessageNotWriteableException if the message is in read-only mode. - */ - - public void writeByte(byte value) throws JMSException { - initializeWriting(); - try { - MarshallingSupport.marshalByte(dataOut, value); - } catch (IOException ioe) { - throw JMSExceptionSupport.create(ioe); - } - } - - /** - * Writes a short to the stream message. - * - * @param value the short value to be written - * @throws JMSException if the JMS provider fails to write the message due - * to some internal error. - * @throws MessageNotWriteableException if the message is in read-only mode. - */ - - public void writeShort(short value) throws JMSException { - initializeWriting(); - try { - MarshallingSupport.marshalShort(dataOut, value); - } catch (IOException ioe) { - throw JMSExceptionSupport.create(ioe); - } - } - - /** - * Writes a char to the stream message. - * - * @param value the char value to be written - * @throws JMSException if the JMS provider fails to write the message due - * to some internal error. - * @throws MessageNotWriteableException if the message is in read-only mode. - */ - - public void writeChar(char value) throws JMSException { - initializeWriting(); - try { - MarshallingSupport.marshalChar(dataOut, value); - } catch (IOException ioe) { - throw JMSExceptionSupport.create(ioe); - } - } - - /** - * Writes an int to the stream message. - * - * @param value the int value to be written - * @throws JMSException if the JMS provider fails to write the message due - * to some internal error. - * @throws MessageNotWriteableException if the message is in read-only mode. - */ - - public void writeInt(int value) throws JMSException { - initializeWriting(); - try { - MarshallingSupport.marshalInt(dataOut, value); - } catch (IOException ioe) { - throw JMSExceptionSupport.create(ioe); - } - } - - /** - * Writes a long to the stream message. - * - * @param value the long value to be written - * @throws JMSException if the JMS provider fails to write the message due - * to some internal error. - * @throws MessageNotWriteableException if the message is in read-only mode. - */ - - public void writeLong(long value) throws JMSException { - initializeWriting(); - try { - MarshallingSupport.marshalLong(dataOut, value); - } catch (IOException ioe) { - throw JMSExceptionSupport.create(ioe); - } - } - - /** - * Writes a float to the stream message. - * - * @param value the float value to be written - * @throws JMSException if the JMS provider fails to write the message due - * to some internal error. - * @throws MessageNotWriteableException if the message is in read-only mode. - */ - - public void writeFloat(float value) throws JMSException { - initializeWriting(); - try { - MarshallingSupport.marshalFloat(dataOut, value); - } catch (IOException ioe) { - throw JMSExceptionSupport.create(ioe); - } - } - - /** - * Writes a double to the stream message. - * - * @param value the double value to be written - * @throws JMSException if the JMS provider fails to write the message due - * to some internal error. - * @throws MessageNotWriteableException if the message is in read-only mode. - */ - - public void writeDouble(double value) throws JMSException { - initializeWriting(); - try { - MarshallingSupport.marshalDouble(dataOut, value); - } catch (IOException ioe) { - throw JMSExceptionSupport.create(ioe); - } - } - - /** - * Writes a String to the stream message. - * - * @param value the String value to be written - * @throws JMSException if the JMS provider fails to write the message due - * to some internal error. - * @throws MessageNotWriteableException if the message is in read-only mode. - */ - - public void writeString(String value) throws JMSException { - initializeWriting(); - try { - if (value == null) { - MarshallingSupport.marshalNull(dataOut); - } else { - MarshallingSupport.marshalString(dataOut, value); - } - } catch (IOException ioe) { - throw JMSExceptionSupport.create(ioe); - } - } - - /** - * Writes a byte array field to the stream message.

    - *

    - * The byte array value is written to the message as a byte - * array field. Consecutively written byte array fields are treated as two - * distinct fields when the fields are read. - * - * @param value the byte array value to be written - * @throws JMSException if the JMS provider fails to write the message due - * to some internal error. - * @throws MessageNotWriteableException if the message is in read-only mode. - */ - - public void writeBytes(byte[] value) throws JMSException { - writeBytes(value, 0, value.length); - } - - /** - * Writes a portion of a byte array as a byte array field to the stream - * message.

    - *

    - * The a portion of the byte array value is written to the - * message as a byte array field. Consecutively written byte array fields - * are treated as two distinct fields when the fields are read. - * - * @param value the byte array value to be written - * @param offset the initial offset within the byte array - * @param length the number of bytes to use - * @throws JMSException if the JMS provider fails to write the message due - * to some internal error. - * @throws MessageNotWriteableException if the message is in read-only mode. - */ - - public void writeBytes(byte[] value, int offset, int length) throws JMSException { - initializeWriting(); - try { - MarshallingSupport.marshalByteArray(dataOut, value, offset, length); - } catch (IOException ioe) { - throw JMSExceptionSupport.create(ioe); - } - } - - /** - * Writes an object to the stream message.

    - *

    - * This method works only for the objectified primitive object types (Integer, - * Double, Long ...), - * String objects, and byte arrays. - * - * @param value the Java object to be written - * @throws JMSException if the JMS provider fails to write the message due - * to some internal error. - * @throws MessageFormatException if the object is invalid. - * @throws MessageNotWriteableException if the message is in read-only mode. - */ - - public void writeObject(Object value) throws JMSException { - initializeWriting(); - if (value == null) { - try { - MarshallingSupport.marshalNull(dataOut); - } catch (IOException ioe) { - throw JMSExceptionSupport.create(ioe); - } - } else if (value instanceof String) { - writeString(value.toString()); - } else if (value instanceof Character) { - writeChar(((Character)value).charValue()); - } else if (value instanceof Boolean) { - writeBoolean(((Boolean)value).booleanValue()); - } else if (value instanceof Byte) { - writeByte(((Byte)value).byteValue()); - } else if (value instanceof Short) { - writeShort(((Short)value).shortValue()); - } else if (value instanceof Integer) { - writeInt(((Integer)value).intValue()); - } else if (value instanceof Float) { - writeFloat(((Float)value).floatValue()); - } else if (value instanceof Double) { - writeDouble(((Double)value).doubleValue()); - } else if (value instanceof byte[]) { - writeBytes((byte[])value); - }else if (value instanceof Long) { - writeLong(((Long)value).longValue()); - }else { - throw new MessageFormatException("Unsupported Object type: " + value.getClass()); - } - } - - /** - * Puts the message body in read-only mode and repositions the stream of - * bytes to the beginning. - * - * @throws JMSException if an internal error occurs - */ - - public void reset() throws JMSException { - storeContent(); - this.bytesOut = null; - this.dataIn = null; - this.dataOut = null; - this.remainingBytes = -1; - setReadOnlyBody(true); - } - - private void initializeWriting() throws MessageNotWriteableException { - checkReadOnlyBody(); - if (this.dataOut == null) { - this.bytesOut = new ByteArrayOutputStream(); - OutputStream os = bytesOut; - ActiveMQConnection connection = getConnection(); - if (connection != null && connection.isUseCompression()) { - compressed = true; - os = new DeflaterOutputStream(os); - } - this.dataOut = new DataOutputStream(os); - } - } - - protected void checkWriteOnlyBody() throws MessageNotReadableException { - if (!readOnlyBody) { - throw new MessageNotReadableException("Message body is write-only"); - } - } - - private void initializeReading() throws MessageNotReadableException { - checkWriteOnlyBody(); - if (this.dataIn == null) { - ByteSequence data = getContent(); - if (data == null) { - data = new ByteSequence(new byte[] {}, 0, 0); - } - InputStream is = new ByteArrayInputStream(data); - if (isCompressed()) { - is = new InflaterInputStream(is); - is = new BufferedInputStream(is); - } - this.dataIn = new DataInputStream(is); - } - } - - @Override - public void compress() throws IOException { - storeContent(); - super.compress(); - } - - public String toString() { - return super.toString() + " ActiveMQStreamMessage{ " + "bytesOut = " + bytesOut + ", dataOut = " + dataOut + ", dataIn = " + dataIn + " }"; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQTempDestination.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQTempDestination.class deleted file mode 100644 index 50433ab2e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQTempDestination.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQTempDestination.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQTempDestination.java deleted file mode 100644 index 85fb95108..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQTempDestination.java +++ /dev/null @@ -1,97 +0,0 @@ -/** - * 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.command; - -import javax.jms.JMSException; -import org.apache.activemq.ActiveMQConnection; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @openwire:marshaller - * - */ -public abstract class ActiveMQTempDestination extends ActiveMQDestination { - - private static final Logger LOG = LoggerFactory.getLogger(ActiveMQTempDestination.class); - protected transient ActiveMQConnection connection; - protected transient String connectionId; - protected transient int sequenceId; - - public ActiveMQTempDestination() { - } - - public ActiveMQTempDestination(String name) { - super(name); - } - - public ActiveMQTempDestination(String connectionId, long sequenceId) { - super(connectionId + ":" + sequenceId); - } - - public boolean isTemporary() { - return true; - } - - public void delete() throws JMSException { - if (connection != null) { - connection.deleteTempDestination(this); - } - } - - public ActiveMQConnection getConnection() { - return connection; - } - - public void setConnection(ActiveMQConnection connection) { - this.connection = connection; - } - - public void setPhysicalName(String physicalName) { - super.setPhysicalName(physicalName); - if (!isComposite()) { - // Parse off the sequenceId off the end. - // this can fail if the temp destination is - // generated by another JMS system via the JMS<->JMS Bridge - int p = this.physicalName.lastIndexOf(":"); - if (p >= 0) { - String seqStr = this.physicalName.substring(p + 1).trim(); - if (seqStr != null && seqStr.length() > 0) { - try { - sequenceId = Integer.parseInt(seqStr); - } catch (NumberFormatException e) { - LOG.debug("Did not parse sequence Id from " + physicalName); - } - // The rest should be the connection id. - connectionId = this.physicalName.substring(0, p); - } - } - } - } - - public String getConnectionId() { - return connectionId; - } - - public void setConnectionId(String connectionId) { - this.connectionId = connectionId; - } - - public int getSequenceId() { - return sequenceId; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQTempQueue.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQTempQueue.class deleted file mode 100644 index 7f1d18a2b..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQTempQueue.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQTempQueue.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQTempQueue.java deleted file mode 100644 index 0f90a4bb0..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQTempQueue.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * 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.command; - -import javax.jms.JMSException; -import javax.jms.TemporaryQueue; - -/** - * @org.apache.xbean.XBean element="tempQueue" description="An ActiveMQ Temporary Queue Destination" - * @openwire:marshaller code="102" - * - */ -public class ActiveMQTempQueue extends ActiveMQTempDestination implements TemporaryQueue { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.ACTIVEMQ_TEMP_QUEUE; - private static final long serialVersionUID = 6683049467527633867L; - - public ActiveMQTempQueue() { - } - - public ActiveMQTempQueue(String name) { - super(name); - } - - public ActiveMQTempQueue(ConnectionId connectionId, long sequenceId) { - super(connectionId.getValue(), sequenceId); - } - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - public boolean isQueue() { - return true; - } - - public String getQueueName() throws JMSException { - return getPhysicalName(); - } - - public byte getDestinationType() { - return TEMP_QUEUE_TYPE; - } - - protected String getQualifiedPrefix() { - return TEMP_QUEUE_QUALIFED_PREFIX; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQTempTopic.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQTempTopic.class deleted file mode 100644 index ebaeaa984..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQTempTopic.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQTempTopic.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQTempTopic.java deleted file mode 100644 index 0d1a4931c..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQTempTopic.java +++ /dev/null @@ -1,62 +0,0 @@ -/** - * 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.command; - -import javax.jms.JMSException; -import javax.jms.TemporaryTopic; - -/** - * @org.apache.xbean.XBean element="tempTopic" description="An ActiveMQ Temporary Topic Destination" - * @openwire:marshaller code="103" - * - */ -public class ActiveMQTempTopic extends ActiveMQTempDestination implements TemporaryTopic { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.ACTIVEMQ_TEMP_TOPIC; - private static final long serialVersionUID = -4325596784597300253L; - - public ActiveMQTempTopic() { - } - - public ActiveMQTempTopic(String name) { - super(name); - } - - public ActiveMQTempTopic(ConnectionId connectionId, long sequenceId) { - super(connectionId.getValue(), sequenceId); - } - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - public boolean isTopic() { - return true; - } - - public String getTopicName() throws JMSException { - return getPhysicalName(); - } - - public byte getDestinationType() { - return TEMP_TOPIC_TYPE; - } - - protected String getQualifiedPrefix() { - return TEMP_TOPIC_QUALIFED_PREFIX; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQTextMessage.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQTextMessage.class deleted file mode 100644 index cec4bd6e5..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQTextMessage.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQTextMessage.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQTextMessage.java deleted file mode 100644 index 347db78da..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQTextMessage.java +++ /dev/null @@ -1,197 +0,0 @@ -/** - * 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.command; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.HashMap; -import java.util.zip.DeflaterOutputStream; -import java.util.zip.InflaterInputStream; - -import javax.jms.JMSException; -import javax.jms.MessageNotWriteableException; -import javax.jms.TextMessage; - -import org.apache.activemq.ActiveMQConnection; -import org.apache.activemq.util.ByteArrayInputStream; -import org.apache.activemq.util.ByteArrayOutputStream; -import org.apache.activemq.util.ByteSequence; -import org.apache.activemq.util.JMSExceptionSupport; -import org.apache.activemq.util.MarshallingSupport; -import org.apache.activemq.wireformat.WireFormat; - -/** - * @openwire:marshaller code="28" - * - */ -public class ActiveMQTextMessage extends ActiveMQMessage implements TextMessage { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.ACTIVEMQ_TEXT_MESSAGE; - - protected String text; - - public Message copy() { - ActiveMQTextMessage copy = new ActiveMQTextMessage(); - copy(copy); - return copy; - } - - private void copy(ActiveMQTextMessage copy) { - super.copy(copy); - copy.text = text; - } - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - public String getJMSXMimeType() { - return "jms/text-message"; - } - - public void setText(String text) throws MessageNotWriteableException { - checkReadOnlyBody(); - this.text = text; - setContent(null); - } - - public String getText() throws JMSException { - if (text == null && getContent() != null) { - text = decodeContent(); - setContent(null); - setCompressed(false); - } - return text; - } - - private String decodeContent() throws JMSException { - String text = null; - if (getContent() != null) { - InputStream is = null; - try { - ByteSequence bodyAsBytes = getContent(); - if (bodyAsBytes != null) { - is = new ByteArrayInputStream(bodyAsBytes); - if (isCompressed()) { - is = new InflaterInputStream(is); - } - DataInputStream dataIn = new DataInputStream(is); - text = MarshallingSupport.readUTF8(dataIn); - dataIn.close(); - } - } catch (IOException ioe) { - throw JMSExceptionSupport.create(ioe); - } finally { - if (is != null) { - try { - is.close(); - } catch (IOException e) { - // ignore - } - } - } - } - return text; - } - - public void beforeMarshall(WireFormat wireFormat) throws IOException { - super.beforeMarshall(wireFormat); - storeContent(); - } - - @Override - public void storeContentAndClear() { - storeContent(); - text=null; - } - - @Override - public void storeContent() { - try { - ByteSequence content = getContent(); - if (content == null && text != null) { - ByteArrayOutputStream bytesOut = new ByteArrayOutputStream(); - OutputStream os = bytesOut; - ActiveMQConnection connection = getConnection(); - if (connection != null && connection.isUseCompression()) { - compressed = true; - os = new DeflaterOutputStream(os); - } - DataOutputStream dataOut = new DataOutputStream(os); - MarshallingSupport.writeUTF8(dataOut, this.text); - dataOut.close(); - setContent(bytesOut.toByteSequence()); - } - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - // see https://issues.apache.org/activemq/browse/AMQ-2103 - // and https://issues.apache.org/activemq/browse/AMQ-2966 - public void clearMarshalledState() throws JMSException { - super.clearMarshalledState(); - this.text = null; - } - - /** - * Clears out the message body. Clearing a message's body does not clear its - * header values or property entries.

    - *

    - * If this message body was read-only, calling this method leaves the - * message body in the same state as an empty body in a newly created - * message. - * - * @throws JMSException if the JMS provider fails to clear the message body - * due to some internal error. - */ - public void clearBody() throws JMSException { - super.clearBody(); - this.text = null; - } - - public int getSize() { - if (size == 0 && content == null && text != null) { - size = getMinimumMessageSize(); - if (marshalledProperties != null) { - size += marshalledProperties.getLength(); - } - size += text.length() * 2; - } - return super.getSize(); - } - - public String toString() { - try { - String text = this.text; - if( text == null ) { - text = decodeContent(); - } - if (text != null) { - text = MarshallingSupport.truncate64(text); - HashMap overrideFields = new HashMap(); - overrideFields.put("text", text); - return super.toString(overrideFields); - } - } catch (JMSException e) { - } - return super.toString(); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQTopic.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQTopic.class deleted file mode 100644 index ec75dbaa2..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQTopic.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQTopic.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQTopic.java deleted file mode 100644 index 8ba51648d..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ActiveMQTopic.java +++ /dev/null @@ -1,60 +0,0 @@ -/** - * 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.command; - -import javax.jms.JMSException; -import javax.jms.Topic; - -/** - * @org.apache.xbean.XBean element="topic" description="An ActiveMQ Topic - * Destination" - * @openwire:marshaller code="101" - * - */ -public class ActiveMQTopic extends ActiveMQDestination implements Topic { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.ACTIVEMQ_TOPIC; - private static final long serialVersionUID = 7300307405896488588L; - - public ActiveMQTopic() { - } - - public ActiveMQTopic(String name) { - super(name); - } - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - public boolean isTopic() { - return true; - } - - public String getTopicName() throws JMSException { - return getPhysicalName(); - } - - public byte getDestinationType() { - return TOPIC_TYPE; - } - - protected String getQualifiedPrefix() { - return TOPIC_QUALIFIED_PREFIX; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/BaseCommand.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/BaseCommand.class deleted file mode 100644 index d44b0fa64..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/BaseCommand.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/BaseCommand.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/BaseCommand.java deleted file mode 100644 index 66243fa2a..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/BaseCommand.java +++ /dev/null @@ -1,135 +0,0 @@ -/** - * 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.command; - -import java.util.Map; -import org.apache.activemq.util.IntrospectionSupport; - - -/** - * - * @openwire:marshaller - * - */ -public abstract class BaseCommand implements Command { - - protected int commandId; - protected boolean responseRequired; - - private transient Endpoint from; - private transient Endpoint to; - - public void copy(BaseCommand copy) { - copy.commandId = commandId; - copy.responseRequired = responseRequired; - } - - /** - * @openwire:property version=1 - */ - public int getCommandId() { - return commandId; - } - - public void setCommandId(int commandId) { - this.commandId = commandId; - } - - /** - * @openwire:property version=1 - */ - public boolean isResponseRequired() { - return responseRequired; - } - - public void setResponseRequired(boolean responseRequired) { - this.responseRequired = responseRequired; - } - - @Override - public String toString() { - return toString(null); - } - - public String toString(MapoverrideFields) { - return IntrospectionSupport.toString(this, BaseCommand.class, overrideFields); - } - - public boolean isWireFormatInfo() { - return false; - } - - public boolean isBrokerInfo() { - return false; - } - - public boolean isResponse() { - return false; - } - - public boolean isMessageDispatch() { - return false; - } - - public boolean isMessage() { - return false; - } - - public boolean isMarshallAware() { - return false; - } - - public boolean isMessageAck() { - return false; - } - - public boolean isMessageDispatchNotification() { - return false; - } - - public boolean isShutdownInfo() { - return false; - } - - public boolean isConnectionControl() { - return false; - } - - /** - * The endpoint within the transport where this message came from. - */ - public Endpoint getFrom() { - return from; - } - - public void setFrom(Endpoint from) { - this.from = from; - } - - /** - * The endpoint within the transport where this message is going to - null means all endpoints. - */ - public Endpoint getTo() { - return to; - } - - public void setTo(Endpoint to) { - this.to = to; - } - - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/BaseEndpoint.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/BaseEndpoint.class deleted file mode 100644 index 167b29cfb..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/BaseEndpoint.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/BaseEndpoint.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/BaseEndpoint.java deleted file mode 100644 index fdc86d26a..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/BaseEndpoint.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * 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.command; - -/** - * A default endpoint. - * - * - */ -public class BaseEndpoint implements Endpoint { - - private String name; - private BrokerInfo brokerInfo; - - public BaseEndpoint(String name) { - this.name = name; - } - - public String getName() { - return name; - } - - public String toString() { - String brokerText = ""; - BrokerId brokerId = getBrokerId(); - if (brokerId != null) { - brokerText = " broker: " + brokerId; - } - return "Endpoint[name:" + name + brokerText + "]"; - } - - /** - * Returns the broker ID for this endpoint, if the endpoint is a broker or - * null - */ - public BrokerId getBrokerId() { - if (brokerInfo != null) { - return brokerInfo.getBrokerId(); - } - return null; - } - - /** - * Returns the broker information for this endpoint, if the endpoint is a - * broker or null - */ - public BrokerInfo getBrokerInfo() { - return brokerInfo; - } - - public void setBrokerInfo(BrokerInfo brokerInfo) { - this.brokerInfo = brokerInfo; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/BrokerId.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/BrokerId.class deleted file mode 100644 index 0363d6ea1..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/BrokerId.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/BrokerId.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/BrokerId.java deleted file mode 100644 index 7c3c8c350..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/BrokerId.java +++ /dev/null @@ -1,72 +0,0 @@ -/** - * 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.command; - -/** - * @openwire:marshaller code="124" - * - */ -public class BrokerId implements DataStructure { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.BROKER_ID; - protected String value; - - public BrokerId() { - } - - public BrokerId(String brokerId) { - this.value = brokerId; - } - - public int hashCode() { - return value.hashCode(); - } - - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || o.getClass() != BrokerId.class) { - return false; - } - BrokerId id = (BrokerId)o; - return value.equals(id.value); - } - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - public String toString() { - return value; - } - - /** - * @openwire:property version=1 - */ - public String getValue() { - return value; - } - - public void setValue(String brokerId) { - this.value = brokerId; - } - - public boolean isMarshallAware() { - return false; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/BrokerInfo.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/BrokerInfo.class deleted file mode 100644 index b79bba1a6..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/BrokerInfo.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/BrokerInfo.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/BrokerInfo.java deleted file mode 100644 index b542e61c6..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/BrokerInfo.java +++ /dev/null @@ -1,280 +0,0 @@ -/** - * 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.command; - -import java.io.IOException; -import java.util.Properties; -import org.apache.activemq.state.CommandVisitor; -import org.apache.activemq.util.MarshallingSupport; - -/** - * When a client connects to a broker, the broker send the client a BrokerInfo - * so that the client knows which broker node he's talking to and also any peers - * that the node has in his cluster. This is the broker helping the client out - * in discovering other nodes in the cluster. - * - * @openwire:marshaller code="2" - * - */ -public class BrokerInfo extends BaseCommand { - private static final String PASSIVE_SLAVE_KEY = "passiveSlave"; - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.BROKER_INFO; - BrokerId brokerId; - String brokerURL; - boolean slaveBroker; - boolean masterBroker; - boolean faultTolerantConfiguration; - boolean networkConnection; - boolean duplexConnection; - BrokerInfo peerBrokerInfos[]; - String brokerName; - long connectionId; - String brokerUploadUrl; - String networkProperties; - transient int refCount = 0; - - public BrokerInfo copy() { - BrokerInfo copy = new BrokerInfo(); - copy(copy); - return copy; - } - - private void copy(BrokerInfo copy) { - super.copy(copy); - copy.brokerId = this.brokerId; - copy.brokerURL = this.brokerURL; - copy.slaveBroker = this.slaveBroker; - copy.masterBroker = this.masterBroker; - copy.faultTolerantConfiguration = this.faultTolerantConfiguration; - copy.networkConnection = this.networkConnection; - copy.duplexConnection = this.duplexConnection; - copy.peerBrokerInfos = this.peerBrokerInfos; - copy.brokerName = this.brokerName; - copy.connectionId = this.connectionId; - copy.brokerUploadUrl = this.brokerUploadUrl; - copy.networkProperties = this.networkProperties; - } - - @Override - public boolean isBrokerInfo() { - return true; - } - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - /** - * @openwire:property version=1 cache=true - */ - public BrokerId getBrokerId() { - return brokerId; - } - - public void setBrokerId(BrokerId brokerId) { - this.brokerId = brokerId; - } - - /** - * @openwire:property version=1 - */ - public String getBrokerURL() { - return brokerURL; - } - - public void setBrokerURL(String brokerURL) { - this.brokerURL = brokerURL; - } - - /** - * @openwire:property version=1 testSize=0 - */ - public BrokerInfo[] getPeerBrokerInfos() { - return peerBrokerInfos; - } - - public void setPeerBrokerInfos(BrokerInfo[] peerBrokerInfos) { - this.peerBrokerInfos = peerBrokerInfos; - } - - /** - * @openwire:property version=1 - */ - public String getBrokerName() { - return brokerName; - } - - public void setBrokerName(String brokerName) { - this.brokerName = brokerName; - } - - public Response visit(CommandVisitor visitor) throws Exception { - return visitor.processBrokerInfo(this); - } - - /** - * @openwire:property version=1 - */ - public boolean isSlaveBroker() { - return slaveBroker; - } - - public void setSlaveBroker(boolean slaveBroker) { - this.slaveBroker = slaveBroker; - } - - /** - * @openwire:property version=1 - */ - public boolean isMasterBroker() { - return masterBroker; - } - - /** - * @param masterBroker The masterBroker to set. - */ - public void setMasterBroker(boolean masterBroker) { - this.masterBroker = masterBroker; - } - - /** - * @openwire:property version=1 - * @return Returns the faultTolerantConfiguration. - */ - public boolean isFaultTolerantConfiguration() { - return faultTolerantConfiguration; - } - - /** - * @param faultTolerantConfiguration The faultTolerantConfiguration to set. - */ - public void setFaultTolerantConfiguration(boolean faultTolerantConfiguration) { - this.faultTolerantConfiguration = faultTolerantConfiguration; - } - - /** - * @openwire:property version=2 - * @return the duplexConnection - */ - public boolean isDuplexConnection() { - return this.duplexConnection; - } - - /** - * @param duplexConnection the duplexConnection to set - */ - public void setDuplexConnection(boolean duplexConnection) { - this.duplexConnection = duplexConnection; - } - - /** - * @openwire:property version=2 - * @return the networkConnection - */ - public boolean isNetworkConnection() { - return this.networkConnection; - } - - /** - * @param networkConnection the networkConnection to set - */ - public void setNetworkConnection(boolean networkConnection) { - this.networkConnection = networkConnection; - } - - /** - * The broker assigns a each connection it accepts a connection id. - * - * @openwire:property version=2 - */ - public long getConnectionId() { - return connectionId; - } - - public void setConnectionId(long connectionId) { - this.connectionId = connectionId; - } - - /** - * The URL to use when uploading BLOBs to the broker or some other external - * file/http server - * - * @openwire:property version=3 - */ - public String getBrokerUploadUrl() { - return brokerUploadUrl; - } - - public void setBrokerUploadUrl(String brokerUploadUrl) { - this.brokerUploadUrl = brokerUploadUrl; - } - - /** - * @openwire:property version=3 cache=false - * @return the networkProperties - */ - public String getNetworkProperties() { - return this.networkProperties; - } - - /** - * @param networkProperties the networkProperties to set - */ - public void setNetworkProperties(String networkProperties) { - this.networkProperties = networkProperties; - } - - public boolean isPassiveSlave() { - boolean result = false; - Properties props = getProperties(); - if (props != null) { - result = Boolean.parseBoolean(props.getProperty(PASSIVE_SLAVE_KEY, "false")); - } - return result; - } - - public void setPassiveSlave(boolean value) { - Properties props = new Properties(); - props.put(PASSIVE_SLAVE_KEY, Boolean.toString(value)); - try { - this.networkProperties=MarshallingSupport.propertiesToString(props); - } catch (IOException e) { - e.printStackTrace(); - } - } - - public Properties getProperties() { - Properties result = null; - try { - result = MarshallingSupport.stringToProperties(getNetworkProperties()); - } catch (IOException e) { - e.printStackTrace(); - } - return result; - } - - public int getRefCount() { - return refCount; - } - - public void incrementRefCount() { - refCount++; - } - public int decrementRefCount() { - return --refCount; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/Command.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/Command.class deleted file mode 100644 index f2fedbb1e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/Command.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/Command.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/Command.java deleted file mode 100644 index 125f4acb5..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/Command.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * 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.command; - -import org.apache.activemq.state.CommandVisitor; - -/** - * The Command Pattern so that we can send and receive commands on the different - * transports - * - * - */ -public interface Command extends DataStructure { - - void setCommandId(int value); - - /** - * @return the unique ID of this request used to map responses to requests - */ - int getCommandId(); - - void setResponseRequired(boolean responseRequired); - - boolean isResponseRequired(); - - boolean isResponse(); - - boolean isMessageDispatch(); - - boolean isBrokerInfo(); - - boolean isWireFormatInfo(); - - boolean isMessage(); - - boolean isMessageAck(); - - boolean isMessageDispatchNotification(); - - boolean isShutdownInfo(); - - boolean isConnectionControl(); - - Response visit(CommandVisitor visitor) throws Exception; - - /** - * The endpoint within the transport where this message came from which - * could be null if the transport only supports a single endpoint. - */ - Endpoint getFrom(); - - void setFrom(Endpoint from); - - /** - * The endpoint within the transport where this message is going to - null - * means all endpoints. - */ - Endpoint getTo(); - - void setTo(Endpoint to); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/CommandTypes.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/CommandTypes.class deleted file mode 100644 index ce729635e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/CommandTypes.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/CommandTypes.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/CommandTypes.java deleted file mode 100644 index 00681fa42..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/CommandTypes.java +++ /dev/null @@ -1,163 +0,0 @@ -/** - * 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.command; - -/** - * Holds the command id constants used by the command objects. - * - * - */ -public interface CommandTypes { - - // What is the latest version of the openwire protocol - byte PROTOCOL_VERSION = 10; - - // What is the latest version of the openwire protocol used in the stores - byte PROTOCOL_STORE_VERSION = 6; - - - // A marshaling layer can use this type to specify a null object. - byte NULL = 0; - - // ///////////////////////////////////////////////// - // - // Info objects sent back and forth client/server when - // setting up a client connection. - // - // ///////////////////////////////////////////////// - byte WIREFORMAT_INFO = 1; - byte BROKER_INFO = 2; - byte CONNECTION_INFO = 3; - byte SESSION_INFO = 4; - byte CONSUMER_INFO = 5; - byte PRODUCER_INFO = 6; - byte TRANSACTION_INFO = 7; - byte DESTINATION_INFO = 8; - byte REMOVE_SUBSCRIPTION_INFO = 9; - byte KEEP_ALIVE_INFO = 10; - byte SHUTDOWN_INFO = 11; - byte REMOVE_INFO = 12; - byte CONTROL_COMMAND = 14; - byte FLUSH_COMMAND = 15; - byte CONNECTION_ERROR = 16; - byte CONSUMER_CONTROL = 17; - byte CONNECTION_CONTROL = 18; - - // ///////////////////////////////////////////////// - // - // Messages that go back and forth between the client - // and the server. - // - // ///////////////////////////////////////////////// - byte PRODUCER_ACK = 19; - byte MESSAGE_PULL = 20; - byte MESSAGE_DISPATCH = 21; - byte MESSAGE_ACK = 22; - - byte ACTIVEMQ_MESSAGE = 23; - byte ACTIVEMQ_BYTES_MESSAGE = 24; - byte ACTIVEMQ_MAP_MESSAGE = 25; - byte ACTIVEMQ_OBJECT_MESSAGE = 26; - byte ACTIVEMQ_STREAM_MESSAGE = 27; - byte ACTIVEMQ_TEXT_MESSAGE = 28; - byte ACTIVEMQ_BLOB_MESSAGE = 29; - - // ///////////////////////////////////////////////// - // - // Command Response messages - // - // ///////////////////////////////////////////////// - byte RESPONSE = 30; - byte EXCEPTION_RESPONSE = 31; - byte DATA_RESPONSE = 32; - byte DATA_ARRAY_RESPONSE = 33; - byte INTEGER_RESPONSE = 34; - - // ///////////////////////////////////////////////// - // - // Used by discovery - // - // ///////////////////////////////////////////////// - byte DISCOVERY_EVENT = 40; - - // ///////////////////////////////////////////////// - // - // Command object used by the Journal - // - // ///////////////////////////////////////////////// - byte JOURNAL_ACK = 50; - byte JOURNAL_REMOVE = 52; - byte JOURNAL_TRACE = 53; - byte JOURNAL_TRANSACTION = 54; - byte DURABLE_SUBSCRIPTION_INFO = 55; - - // ///////////////////////////////////////////////// - // - // Reliability and fragmentation - // - // ///////////////////////////////////////////////// - byte PARTIAL_COMMAND = 60; - byte PARTIAL_LAST_COMMAND = 61; - - byte REPLAY = 65; - - // ///////////////////////////////////////////////// - // - // Types used represent basic Java types. - // - // ///////////////////////////////////////////////// - byte BYTE_TYPE = 70; - byte CHAR_TYPE = 71; - byte SHORT_TYPE = 72; - byte INTEGER_TYPE = 73; - byte LONG_TYPE = 74; - byte DOUBLE_TYPE = 75; - byte FLOAT_TYPE = 76; - byte STRING_TYPE = 77; - byte BOOLEAN_TYPE = 78; - byte BYTE_ARRAY_TYPE = 79; - - // ///////////////////////////////////////////////// - // - // Broker to Broker command objects - // - // ///////////////////////////////////////////////// - - byte MESSAGE_DISPATCH_NOTIFICATION = 90; - byte NETWORK_BRIDGE_FILTER = 91; - - // ///////////////////////////////////////////////// - // - // Data structures contained in the command objects. - // - // ///////////////////////////////////////////////// - byte ACTIVEMQ_QUEUE = 100; - byte ACTIVEMQ_TOPIC = 101; - byte ACTIVEMQ_TEMP_QUEUE = 102; - byte ACTIVEMQ_TEMP_TOPIC = 103; - - byte MESSAGE_ID = 110; - byte ACTIVEMQ_LOCAL_TRANSACTION_ID = 111; - byte ACTIVEMQ_XA_TRANSACTION_ID = 112; - - byte CONNECTION_ID = 120; - byte SESSION_ID = 121; - byte CONSUMER_ID = 122; - byte PRODUCER_ID = 123; - byte BROKER_ID = 124; - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConnectionControl.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConnectionControl.class deleted file mode 100644 index 03179c7b2..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConnectionControl.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConnectionControl.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConnectionControl.java deleted file mode 100644 index 5b6392d04..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConnectionControl.java +++ /dev/null @@ -1,185 +0,0 @@ -/** - * 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.command; - -import org.apache.activemq.state.CommandVisitor; - -/** - * Used to start and stop transports as well as terminating clients. - * - * @openwire:marshaller code="18" - * - */ -public class ConnectionControl extends BaseCommand { - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.CONNECTION_CONTROL; - protected boolean suspend; - protected boolean resume; - protected boolean close; - protected boolean exit; - protected boolean faultTolerant; - protected String connectedBrokers=""; - protected String reconnectTo = ""; - protected byte[] token; - protected boolean rebalanceConnection; - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - public Response visit(CommandVisitor visitor) throws Exception { - return visitor.processConnectionControl(this); - } - @Override - public boolean isConnectionControl() { - return true; - } - - /** - * @openwire:property version=1 - * @return Returns the close. - */ - public boolean isClose() { - return close; - } - - /** - * @param close The close to set. - */ - public void setClose(boolean close) { - this.close = close; - } - - /** - * @openwire:property version=1 - * @return Returns the exit. - */ - public boolean isExit() { - return exit; - } - - /** - * @param exit The exit to set. - */ - public void setExit(boolean exit) { - this.exit = exit; - } - - /** - * @openwire:property version=1 - * @return Returns the faultTolerant. - */ - public boolean isFaultTolerant() { - return faultTolerant; - } - - /** - * @param faultTolerant The faultTolerant to set. - */ - public void setFaultTolerant(boolean faultTolerant) { - this.faultTolerant = faultTolerant; - } - - /** - * @openwire:property version=1 - * @return Returns the resume. - */ - public boolean isResume() { - return resume; - } - - /** - * @param resume The resume to set. - */ - public void setResume(boolean resume) { - this.resume = resume; - } - - /** - * @openwire:property version=1 - * @return Returns the suspend. - */ - public boolean isSuspend() { - return suspend; - } - - /** - * @param suspend The suspend to set. - */ - public void setSuspend(boolean suspend) { - this.suspend = suspend; - } - - /** - * @openwire:property version=6 cache=false - * @return connected brokers. - */ - public String getConnectedBrokers() { - return this.connectedBrokers; - } - - /** - * @param connectedBrokers the connectedBrokers to set - */ - public void setConnectedBrokers(String connectedBrokers) { - this.connectedBrokers = connectedBrokers; - } - - /** - * @openwire:property version=6 cache=false - * @return the reconnectTo - */ - public String getReconnectTo() { - return this.reconnectTo; - } - - /** - * @param reconnectTo the reconnectTo to set - */ - public void setReconnectTo(String reconnectTo) { - this.reconnectTo = reconnectTo; - } - - /** - * @return the rebalanceConnection - * @openwire:property version=6 cache=false - */ - public boolean isRebalanceConnection() { - return this.rebalanceConnection; - } - - /** - * @param rebalanceConnection the rebalanceConnection to set - */ - public void setRebalanceConnection(boolean rebalanceConnection) { - this.rebalanceConnection = rebalanceConnection; - } - - /** - * @openwire:property version=8 - * @return the token - */ - public byte[] getToken() { - return this.token; - } - - /** - * @param token the token to set - */ - public void setToken(byte[] token) { - this.token = token; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConnectionError.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConnectionError.class deleted file mode 100644 index cc9821bba..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConnectionError.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConnectionError.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConnectionError.java deleted file mode 100644 index 97bb607da..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConnectionError.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * 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.command; - -import org.apache.activemq.state.CommandVisitor; - -/** - * - * @openwire:marshaller code="16" - * - */ -public class ConnectionError extends BaseCommand { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.CONNECTION_ERROR; - - private ConnectionId connectionId; - private Throwable exception; - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - public Response visit(CommandVisitor visitor) throws Exception { - return visitor.processConnectionError(this); - } - - /** - * @openwire:property version=1 - */ - public Throwable getException() { - return exception; - } - - public void setException(Throwable exception) { - this.exception = exception; - } - - /** - * @openwire:property version=1 - */ - public ConnectionId getConnectionId() { - return connectionId; - } - - public void setConnectionId(ConnectionId connectionId) { - this.connectionId = connectionId; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConnectionId.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConnectionId.class deleted file mode 100644 index 4e75273ce..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConnectionId.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConnectionId.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConnectionId.java deleted file mode 100644 index eb1d7975f..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConnectionId.java +++ /dev/null @@ -1,93 +0,0 @@ -/** - * 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.command; - -/** - * @openwire:marshaller code="120" - * - */ -public class ConnectionId implements DataStructure, Comparable { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.CONNECTION_ID; - - protected String value; - - public ConnectionId() { - } - - public ConnectionId(String connectionId) { - this.value = connectionId; - } - - public ConnectionId(ConnectionId id) { - this.value = id.getValue(); - } - - public ConnectionId(SessionId id) { - this.value = id.getConnectionId(); - } - - public ConnectionId(ProducerId id) { - this.value = id.getConnectionId(); - } - - public ConnectionId(ConsumerId id) { - this.value = id.getConnectionId(); - } - - public int hashCode() { - return value.hashCode(); - } - - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || o.getClass() != ConnectionId.class) { - return false; - } - ConnectionId id = (ConnectionId)o; - return value.equals(id.value); - } - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - public String toString() { - return value; - } - - /** - * @openwire:property version=1 - */ - public String getValue() { - return value; - } - - public void setValue(String connectionId) { - this.value = connectionId; - } - - public boolean isMarshallAware() { - return false; - } - - public int compareTo(ConnectionId o) { - return value.compareTo(o.value); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConnectionInfo.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConnectionInfo.class deleted file mode 100644 index 899c3f980..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConnectionInfo.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConnectionInfo.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConnectionInfo.java deleted file mode 100644 index 5b0ac82c2..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConnectionInfo.java +++ /dev/null @@ -1,244 +0,0 @@ -/** - * 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.command; - -import org.apache.activemq.state.CommandVisitor; - -/** - * - * @openwire:marshaller code="3" - * - */ -public class ConnectionInfo extends BaseCommand { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.CONNECTION_INFO; - - protected ConnectionId connectionId; - protected String clientId; - protected String clientIp; - protected String userName; - protected String password; - protected BrokerId[] brokerPath; - protected boolean brokerMasterConnector; - protected boolean manageable; - protected boolean clientMaster = true; - protected boolean faultTolerant = false; - protected boolean failoverReconnect; - protected transient Object transportContext; - - public ConnectionInfo() { - } - - public ConnectionInfo(ConnectionId connectionId) { - this.connectionId = connectionId; - } - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - public ConnectionInfo copy() { - ConnectionInfo copy = new ConnectionInfo(); - copy(copy); - return copy; - } - - private void copy(ConnectionInfo copy) { - super.copy(copy); - copy.connectionId = connectionId; - copy.clientId = clientId; - copy.userName = userName; - copy.password = password; - copy.brokerPath = brokerPath; - copy.brokerMasterConnector = brokerMasterConnector; - copy.manageable = manageable; - copy.clientMaster = clientMaster; - copy.transportContext = transportContext; - copy.faultTolerant= faultTolerant; - copy.clientIp = clientIp; - } - - /** - * @openwire:property version=1 cache=true - */ - public ConnectionId getConnectionId() { - return connectionId; - } - - public void setConnectionId(ConnectionId connectionId) { - this.connectionId = connectionId; - } - - /** - * @openwire:property version=1 - */ - public String getClientId() { - return clientId; - } - - public void setClientId(String clientId) { - this.clientId = clientId; - } - - public RemoveInfo createRemoveCommand() { - RemoveInfo command = new RemoveInfo(getConnectionId()); - command.setResponseRequired(isResponseRequired()); - return command; - } - - /** - * @openwire:property version=1 - */ - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - /** - * @openwire:property version=1 - */ - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName = userName; - } - - /** - * The route of brokers the command has moved through. - * - * @openwire:property version=1 cache=true - */ - public BrokerId[] getBrokerPath() { - return brokerPath; - } - - public void setBrokerPath(BrokerId[] brokerPath) { - this.brokerPath = brokerPath; - } - - public Response visit(CommandVisitor visitor) throws Exception { - return visitor.processAddConnection(this); - } - - /** - * @openwire:property version=1 - */ - public boolean isBrokerMasterConnector() { - return brokerMasterConnector; - } - - /** - * @param slaveBroker The brokerMasterConnector to set. - */ - public void setBrokerMasterConnector(boolean slaveBroker) { - this.brokerMasterConnector = slaveBroker; - } - - /** - * @openwire:property version=1 - */ - public boolean isManageable() { - return manageable; - } - - /** - * @param manageable The manageable to set. - */ - public void setManageable(boolean manageable) { - this.manageable = manageable; - } - - /** - * Transports may wish to associate additional data with the connection. For - * example, an SSL transport may use this field to attach the client - * certificates used when the connection was established. - * - * @return the transport context. - */ - public Object getTransportContext() { - return transportContext; - } - - /** - * Transports may wish to associate additional data with the connection. For - * example, an SSL transport may use this field to attach the client - * certificates used when the connection was established. - * - * @param transportContext value used to set the transport context - */ - public void setTransportContext(Object transportContext) { - this.transportContext = transportContext; - } - - /** - * @openwire:property version=2 - * @return the clientMaster - */ - public boolean isClientMaster() { - return this.clientMaster; - } - - /** - * @param clientMaster the clientMaster to set - */ - public void setClientMaster(boolean clientMaster) { - this.clientMaster = clientMaster; - } - - /** - * @openwire:property version=6 cache=false - * @return the faultTolerant - */ - public boolean isFaultTolerant() { - return this.faultTolerant; - } - - /** - * @param faultTolerant the faultTolerant to set - */ - public void setFaultTolerant(boolean faultTolerant) { - this.faultTolerant = faultTolerant; - } - - /** - * @openwire:property version=6 cache=false - * @return failoverReconnect true if this is a reconnect - */ - public boolean isFailoverReconnect() { - return this.failoverReconnect; - } - - public void setFailoverReconnect(boolean failoverReconnect) { - this.failoverReconnect = failoverReconnect; - } - - /** - * @openwire:property version=8 - */ - public String getClientIp() { - return clientIp; - } - - public void setClientIp(String clientIp) { - this.clientIp = clientIp; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConsumerControl.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConsumerControl.class deleted file mode 100644 index e83d4f935..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConsumerControl.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConsumerControl.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConsumerControl.java deleted file mode 100644 index 6e7bc1705..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConsumerControl.java +++ /dev/null @@ -1,148 +0,0 @@ -/** - * 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.command; - -import org.apache.activemq.state.CommandVisitor; - -/** - * Used to start and stop transports as well as terminating clients. - * - * @openwire:marshaller code="17" - * - */ -public class ConsumerControl extends BaseCommand { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.CONSUMER_CONTROL; - - protected ConsumerId consumerId; - protected boolean close; - protected boolean stop; - protected boolean start; - protected boolean flush; - protected int prefetch; - protected ActiveMQDestination destination; - - /** - * @openwire:property version=6 - * @return Returns the destination. - */ - public ActiveMQDestination getDestination() { - return destination; - } - - public void setDestination(ActiveMQDestination destination) { - this.destination = destination; - } - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - public Response visit(CommandVisitor visitor) throws Exception { - return visitor.processConsumerControl(this); - } - - /** - * @openwire:property version=1 - * @return Returns the close. - */ - public boolean isClose() { - return close; - } - - /** - * @param close The close to set. - */ - public void setClose(boolean close) { - this.close = close; - } - - /** - * @openwire:property version=1 - * @return Returns the consumerId. - */ - public ConsumerId getConsumerId() { - return consumerId; - } - - /** - * @param consumerId The consumerId to set. - */ - public void setConsumerId(ConsumerId consumerId) { - this.consumerId = consumerId; - } - - /** - * @openwire:property version=1 - * @return Returns the prefetch. - */ - public int getPrefetch() { - return prefetch; - } - - /** - * @param prefetch The prefetch to set. - */ - public void setPrefetch(int prefetch) { - this.prefetch = prefetch; - } - - /** - * @openwire:property version=2 - * @return the flush - */ - public boolean isFlush() { - return this.flush; - } - - /** - * @param flush the flush to set - */ - public void setFlush(boolean flush) { - this.flush = flush; - } - - /** - * @openwire:property version=2 - * @return the start - */ - public boolean isStart() { - return this.start; - } - - /** - * @param start the start to set - */ - public void setStart(boolean start) { - this.start = start; - } - - /** - * @openwire:property version=2 - * @return the stop - */ - public boolean isStop() { - return this.stop; - } - - /** - * @param stop the stop to set - */ - public void setStop(boolean stop) { - this.stop = stop; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConsumerId.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConsumerId.class deleted file mode 100644 index f610e2e38..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConsumerId.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConsumerId.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConsumerId.java deleted file mode 100644 index 29a42ee09..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConsumerId.java +++ /dev/null @@ -1,133 +0,0 @@ -/** - * 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.command; - -/** - * @openwire:marshaller code="122" - * - */ -public class ConsumerId implements DataStructure { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.CONSUMER_ID; - - protected String connectionId; - protected long sessionId; - protected long value; - - protected transient int hashCode; - protected transient String key; - protected transient SessionId parentId; - - public ConsumerId() { - } - - public ConsumerId(String str){ - if (str != null){ - String[] splits = str.split(":"); - if (splits != null && splits.length >= 3){ - this.connectionId = splits[0]; - this.sessionId = Long.parseLong(splits[1]); - this.value = Long.parseLong(splits[2]); - } - } - } - - public ConsumerId(SessionId sessionId, long consumerId) { - this.connectionId = sessionId.getConnectionId(); - this.sessionId = sessionId.getValue(); - this.value = consumerId; - } - - public ConsumerId(ConsumerId id) { - this.connectionId = id.getConnectionId(); - this.sessionId = id.getSessionId(); - this.value = id.getValue(); - } - - public SessionId getParentId() { - if (parentId == null) { - parentId = new SessionId(this); - } - return parentId; - } - - public int hashCode() { - if (hashCode == 0) { - hashCode = connectionId.hashCode() ^ (int)sessionId ^ (int)value; - } - return hashCode; - } - - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || o.getClass() != ConsumerId.class) { - return false; - } - ConsumerId id = (ConsumerId)o; - return sessionId == id.sessionId && value == id.value && connectionId.equals(id.connectionId); - } - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - public String toString() { - if (key == null) { - key = connectionId + ":" + sessionId + ":" + value; - } - return key; - } - - /** - * @openwire:property version=1 - */ - public String getConnectionId() { - return connectionId; - } - - public void setConnectionId(String connectionId) { - this.connectionId = connectionId; - } - - /** - * @openwire:property version=1 - */ - public long getSessionId() { - return sessionId; - } - - public void setSessionId(long sessionId) { - this.sessionId = sessionId; - } - - /** - * @openwire:property version=1 - */ - public long getValue() { - return value; - } - - public void setValue(long consumerId) { - this.value = consumerId; - } - - public boolean isMarshallAware() { - return false; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConsumerInfo.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConsumerInfo.class deleted file mode 100644 index 53f319379..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConsumerInfo.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConsumerInfo.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConsumerInfo.java deleted file mode 100644 index 3e8ec54bd..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ConsumerInfo.java +++ /dev/null @@ -1,469 +0,0 @@ -/** - * 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.command; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.activemq.filter.BooleanExpression; -import org.apache.activemq.state.CommandVisitor; - -/** - * @openwire:marshaller code="5" - * - */ -public class ConsumerInfo extends BaseCommand { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.CONSUMER_INFO; - - public static final byte HIGH_PRIORITY = 10; - public static final byte NORMAL_PRIORITY = 0; - public static final byte NETWORK_CONSUMER_PRIORITY = -5; - public static final byte LOW_PRIORITY = -10; - - protected ConsumerId consumerId; - protected ActiveMQDestination destination; - protected int prefetchSize; - protected int maximumPendingMessageLimit; - protected boolean browser; - protected boolean dispatchAsync; - protected String selector; - protected String clientId; - protected String subscriptionName; - protected boolean noLocal; - protected boolean exclusive; - protected boolean retroactive; - protected byte priority; - protected BrokerId[] brokerPath; - protected boolean optimizedAcknowledge; - // used by the broker - protected transient int currentPrefetchSize; - // if true, the consumer will not send range - protected boolean noRangeAcks; - // acks. - - protected BooleanExpression additionalPredicate; - protected transient boolean networkSubscription; // this subscription - protected transient List networkConsumerIds; // the original consumerId - - // not marshalled, populated from RemoveInfo, the last message delivered, used - // to suppress redelivery on prefetched messages after close - // overload; also used at runtime to track assignment of message groups - private transient long lastDeliveredSequenceId; - - // originated from a - // network connection - - public ConsumerInfo() { - } - - public ConsumerInfo(ConsumerId consumerId) { - this.consumerId = consumerId; - } - - public ConsumerInfo(SessionInfo sessionInfo, long consumerId) { - this.consumerId = new ConsumerId(sessionInfo.getSessionId(), consumerId); - } - - public ConsumerInfo copy() { - ConsumerInfo info = new ConsumerInfo(); - copy(info); - return info; - } - - public void copy(ConsumerInfo info) { - super.copy(info); - info.consumerId = consumerId; - info.destination = destination; - info.prefetchSize = prefetchSize; - info.maximumPendingMessageLimit = maximumPendingMessageLimit; - info.browser = browser; - info.dispatchAsync = dispatchAsync; - info.selector = selector; - info.clientId = clientId; - info.subscriptionName = subscriptionName; - info.noLocal = noLocal; - info.exclusive = exclusive; - info.retroactive = retroactive; - info.priority = priority; - info.brokerPath = brokerPath; - info.networkSubscription = networkSubscription; - if (networkConsumerIds != null) { - if (info.networkConsumerIds==null){ - info.networkConsumerIds=new ArrayList(); - } - info.networkConsumerIds.addAll(networkConsumerIds); - } - } - - public boolean isDurable() { - return subscriptionName != null; - } - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - /** - * Is used to uniquely identify the consumer to the broker. - * - * @openwire:property version=1 cache=true - */ - public ConsumerId getConsumerId() { - return consumerId; - } - - public void setConsumerId(ConsumerId consumerId) { - this.consumerId = consumerId; - } - - /** - * Is this consumer a queue browser? - * - * @openwire:property version=1 - */ - public boolean isBrowser() { - return browser; - } - - public void setBrowser(boolean browser) { - this.browser = browser; - } - - /** - * The destination that the consumer is interested in receiving messages - * from. This destination could be a composite destination. - * - * @openwire:property version=1 cache=true - */ - public ActiveMQDestination getDestination() { - return destination; - } - - public void setDestination(ActiveMQDestination destination) { - this.destination = destination; - } - - /** - * How many messages a broker will send to the client without receiving an - * ack before he stops dispatching messages to the client. - * - * @openwire:property version=1 - */ - public int getPrefetchSize() { - return prefetchSize; - } - - public void setPrefetchSize(int prefetchSize) { - this.prefetchSize = prefetchSize; - this.currentPrefetchSize = prefetchSize; - } - - /** - * How many messages a broker will keep around, above the prefetch limit, - * for non-durable topics before starting to discard older messages. - * - * @openwire:property version=1 - */ - public int getMaximumPendingMessageLimit() { - return maximumPendingMessageLimit; - } - - public void setMaximumPendingMessageLimit(int maximumPendingMessageLimit) { - this.maximumPendingMessageLimit = maximumPendingMessageLimit; - } - - /** - * Should the broker dispatch a message to the consumer async? If he does it - * async, then he uses a more SEDA style of processing while if it is not - * done async, then he broker use a STP style of processing. STP is more - * appropriate in high bandwidth situations or when being used by and in vm - * transport. - * - * @openwire:property version=1 - */ - public boolean isDispatchAsync() { - return dispatchAsync; - } - - public void setDispatchAsync(boolean dispatchAsync) { - this.dispatchAsync = dispatchAsync; - } - - /** - * The JMS selector used to filter out messages that this consumer is - * interested in. - * - * @openwire:property version=1 - */ - public String getSelector() { - return selector; - } - - public void setSelector(String selector) { - this.selector = selector; - } - - /** - * Used to identify the id of a client connection. - * - * @openwire:property version=10 - */ - public String getClientId() { - return clientId; - } - - public void setClientId(String clientId) { - this.clientId = clientId; - } - - /** - * Used to identify the name of a durable subscription. - * - * @openwire:property version=1 - */ - public String getSubscriptionName() { - return subscriptionName; - } - - public void setSubscriptionName(String durableSubscriptionId) { - this.subscriptionName = durableSubscriptionId; - } - - /** - * Set noLocal to true to avoid receiving messages that were published - * locally on the same connection. - * - * @openwire:property version=1 - */ - public boolean isNoLocal() { - return noLocal; - } - - public void setNoLocal(boolean noLocal) { - this.noLocal = noLocal; - } - - /** - * An exclusive consumer locks out other consumers from being able to - * receive messages from the destination. If there are multiple exclusive - * consumers for a destination, the first one created will be the exclusive - * consumer of the destination. - * - * @openwire:property version=1 - */ - public boolean isExclusive() { - return exclusive; - } - - public void setExclusive(boolean exclusive) { - this.exclusive = exclusive; - } - - /** - * A retroactive consumer only has meaning for Topics. It allows a consumer - * to retroactively see messages sent prior to the consumer being created. - * If the consumer is not durable, it will be delivered the last message - * published to the topic. If the consumer is durable then it will receive - * all persistent messages that are still stored in persistent storage for - * that topic. - * - * @openwire:property version=1 - */ - public boolean isRetroactive() { - return retroactive; - } - - public void setRetroactive(boolean retroactive) { - this.retroactive = retroactive; - } - - public RemoveInfo createRemoveCommand() { - RemoveInfo command = new RemoveInfo(getConsumerId()); - command.setResponseRequired(isResponseRequired()); - return command; - } - - /** - * The broker will avoid dispatching to a lower priority consumer if there - * are other higher priority consumers available to dispatch to. This allows - * letting the broker to have an affinity to higher priority consumers. - * Default priority is 0. - * - * @openwire:property version=1 - */ - public byte getPriority() { - return priority; - } - - public void setPriority(byte priority) { - this.priority = priority; - } - - /** - * The route of brokers the command has moved through. - * - * @openwire:property version=1 cache=true - */ - public BrokerId[] getBrokerPath() { - return brokerPath; - } - - public void setBrokerPath(BrokerId[] brokerPath) { - this.brokerPath = brokerPath; - } - - /** - * A transient additional predicate that can be used it inject additional - * predicates into the selector on the fly. Handy if if say a Security - * Broker interceptor wants to filter out messages based on security level - * of the consumer. - * - * @openwire:property version=1 - */ - public BooleanExpression getAdditionalPredicate() { - return additionalPredicate; - } - - public void setAdditionalPredicate(BooleanExpression additionalPredicate) { - this.additionalPredicate = additionalPredicate; - } - - public Response visit(CommandVisitor visitor) throws Exception { - return visitor.processAddConsumer(this); - } - - /** - * @openwire:property version=1 - * @return Returns the networkSubscription. - */ - public boolean isNetworkSubscription() { - return networkSubscription; - } - - /** - * @param networkSubscription The networkSubscription to set. - */ - public void setNetworkSubscription(boolean networkSubscription) { - this.networkSubscription = networkSubscription; - } - - /** - * @openwire:property version=1 - * @return Returns the optimizedAcknowledge. - */ - public boolean isOptimizedAcknowledge() { - return optimizedAcknowledge; - } - - /** - * @param optimizedAcknowledge The optimizedAcknowledge to set. - */ - public void setOptimizedAcknowledge(boolean optimizedAcknowledge) { - this.optimizedAcknowledge = optimizedAcknowledge; - } - - /** - * @return Returns the currentPrefetchSize. - */ - public int getCurrentPrefetchSize() { - return currentPrefetchSize; - } - - /** - * @param currentPrefetchSize The currentPrefetchSize to set. - */ - public void setCurrentPrefetchSize(int currentPrefetchSize) { - this.currentPrefetchSize = currentPrefetchSize; - } - - /** - * The broker may be able to optimize it's processing or provides better QOS - * if it knows the consumer will not be sending ranged acks. - * - * @return true if the consumer will not send range acks. - * @openwire:property version=1 - */ - public boolean isNoRangeAcks() { - return noRangeAcks; - } - - public void setNoRangeAcks(boolean noRangeAcks) { - this.noRangeAcks = noRangeAcks; - } - - public synchronized void addNetworkConsumerId(ConsumerId networkConsumerId) { - if (networkConsumerIds == null) { - networkConsumerIds = new ArrayList(); - } - networkConsumerIds.add(networkConsumerId); - } - - public synchronized void removeNetworkConsumerId(ConsumerId networkConsumerId) { - if (networkConsumerIds != null) { - networkConsumerIds.remove(networkConsumerId); - if (networkConsumerIds.isEmpty()) { - networkConsumerIds=null; - } - } - } - - public synchronized boolean isNetworkConsumersEmpty() { - return networkConsumerIds == null || networkConsumerIds.isEmpty(); - } - - public synchronized List getNetworkConsumerIds(){ - List result = new ArrayList(); - if (networkConsumerIds != null) { - result.addAll(networkConsumerIds); - } - return result; - } - - /** - * Tracks the original subscription id that causes a subscription to - * percolate through a network when networkTTL > 1. Tracking the original - * subscription allows duplicate suppression. - * - * @return array of the current subscription path - * @openwire:property version=4 - */ - public ConsumerId[] getNetworkConsumerPath() { - ConsumerId[] result = null; - if (networkConsumerIds != null) { - result = networkConsumerIds.toArray(new ConsumerId[0]); - } - return result; - } - - public void setNetworkConsumerPath(ConsumerId[] consumerPath) { - if (consumerPath != null) { - for (int i=0; i { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.ACTIVEMQ_LOCAL_TRANSACTION_ID; - - protected ConnectionId connectionId; - protected long value; - - private transient String transactionKey; - private transient int hashCode; - - public LocalTransactionId() { - } - - public LocalTransactionId(ConnectionId connectionId, long transactionId) { - this.connectionId = connectionId; - this.value = transactionId; - } - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - public boolean isXATransaction() { - return false; - } - - public boolean isLocalTransaction() { - return true; - } - - public String getTransactionKey() { - if (transactionKey == null) { - transactionKey = "TX:" + connectionId + ":" + value; - } - return transactionKey; - } - - public String toString() { - return getTransactionKey(); - } - - public int hashCode() { - if (hashCode == 0) { - hashCode = connectionId.hashCode() ^ (int)value; - } - return hashCode; - } - - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || o.getClass() != LocalTransactionId.class) { - return false; - } - LocalTransactionId tx = (LocalTransactionId)o; - return value == tx.value && connectionId.equals(tx.connectionId); - } - - /** - * @param o - * @return - * @see java.lang.Comparable#compareTo(java.lang.Object) - */ - public int compareTo(LocalTransactionId o) { - int result = connectionId.compareTo(o.connectionId); - if (result == 0) { - result = (int)(value - o.value); - } - return result; - } - - /** - * @openwire:property version=1 - */ - public long getValue() { - return value; - } - - public void setValue(long transactionId) { - this.value = transactionId; - } - - /** - * @openwire:property version=1 cache=true - */ - public ConnectionId getConnectionId() { - return connectionId; - } - - public void setConnectionId(ConnectionId connectionId) { - this.connectionId = connectionId; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/MarshallAware.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/MarshallAware.class deleted file mode 100644 index ce138ca88..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/MarshallAware.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/MarshallAware.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/MarshallAware.java deleted file mode 100644 index 154a11d1c..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/MarshallAware.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * 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.command; - -import java.io.IOException; - -import org.apache.activemq.wireformat.WireFormat; - -public interface MarshallAware { - - void beforeMarshall(WireFormat wireFormat) throws IOException; - - void afterMarshall(WireFormat wireFormat) throws IOException; - - void beforeUnmarshall(WireFormat wireFormat) throws IOException; - - void afterUnmarshall(WireFormat wireFormat) throws IOException; - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/Message$MessageDestination.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/Message$MessageDestination.class deleted file mode 100644 index bcc5413a6..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/Message$MessageDestination.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/Message.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/Message.class deleted file mode 100644 index d054ea918..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/Message.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/Message.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/Message.java deleted file mode 100644 index e0f0b21f1..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/Message.java +++ /dev/null @@ -1,829 +0,0 @@ -/** - * 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.command; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.zip.DeflaterOutputStream; - -import javax.jms.JMSException; - -import org.apache.activemq.ActiveMQConnection; -import org.apache.activemq.advisory.AdvisorySupport; -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.usage.MemoryUsage; -import org.apache.activemq.util.ByteArrayInputStream; -import org.apache.activemq.util.ByteArrayOutputStream; -import org.apache.activemq.util.ByteSequence; -import org.apache.activemq.util.MarshallingSupport; -import org.apache.activemq.wireformat.WireFormat; -import org.fusesource.hawtbuf.UTF8Buffer; - -/** - * Represents an ActiveMQ message - * - * @openwire:marshaller - * - */ -public abstract class Message extends BaseCommand implements MarshallAware, MessageReference { - public static final String ORIGINAL_EXPIRATION = "originalExpiration"; - - /** - * The default minimum amount of memory a message is assumed to use - */ - public static final int DEFAULT_MINIMUM_MESSAGE_SIZE = 1024; - - protected MessageId messageId; - protected ActiveMQDestination originalDestination; - protected TransactionId originalTransactionId; - - protected ProducerId producerId; - protected ActiveMQDestination destination; - protected TransactionId transactionId; - - protected long expiration; - protected long timestamp; - protected long arrival; - protected long brokerInTime; - protected long brokerOutTime; - protected String correlationId; - protected ActiveMQDestination replyTo; - protected boolean persistent; - protected String type; - protected byte priority; - protected String groupID; - protected int groupSequence; - protected ConsumerId targetConsumerId; - protected boolean compressed; - protected String userID; - - protected ByteSequence content; - protected ByteSequence marshalledProperties; - protected DataStructure dataStructure; - protected int redeliveryCounter; - - protected int size; - protected Map properties; - protected boolean readOnlyProperties; - protected boolean readOnlyBody; - protected transient boolean recievedByDFBridge; - protected boolean droppable; - protected boolean jmsXGroupFirstForConsumer; - - private transient short referenceCount; - private transient ActiveMQConnection connection; - transient MessageDestination regionDestination; - transient MemoryUsage memoryUsage; - - private BrokerId[] brokerPath; - private BrokerId[] cluster; - - public static interface MessageDestination { - int getMinimumMessageSize(); - MemoryUsage getMemoryUsage(); - } - - public abstract Message copy(); - public abstract void clearBody() throws JMSException; - public abstract void storeContent(); - public abstract void storeContentAndClear(); - - // useful to reduce the memory footprint of a persisted message - public void clearMarshalledState() throws JMSException { - properties = null; - } - - protected void copy(Message copy) { - super.copy(copy); - copy.producerId = producerId; - copy.transactionId = transactionId; - copy.destination = destination; - copy.messageId = messageId != null ? messageId.copy() : null; - copy.originalDestination = originalDestination; - copy.originalTransactionId = originalTransactionId; - copy.expiration = expiration; - copy.timestamp = timestamp; - copy.correlationId = correlationId; - copy.replyTo = replyTo; - copy.persistent = persistent; - copy.redeliveryCounter = redeliveryCounter; - copy.type = type; - copy.priority = priority; - copy.size = size; - copy.groupID = groupID; - copy.userID = userID; - copy.groupSequence = groupSequence; - - if (properties != null) { - copy.properties = new HashMap(properties); - - // The new message hasn't expired, so remove this feild. - copy.properties.remove(ORIGINAL_EXPIRATION); - } else { - copy.properties = properties; - } - - copy.content = content; - copy.marshalledProperties = marshalledProperties; - copy.dataStructure = dataStructure; - copy.readOnlyProperties = readOnlyProperties; - copy.readOnlyBody = readOnlyBody; - copy.compressed = compressed; - copy.recievedByDFBridge = recievedByDFBridge; - - copy.arrival = arrival; - copy.connection = connection; - copy.regionDestination = regionDestination; - copy.brokerInTime = brokerInTime; - copy.brokerOutTime = brokerOutTime; - copy.memoryUsage=this.memoryUsage; - copy.brokerPath = brokerPath; - copy.jmsXGroupFirstForConsumer = jmsXGroupFirstForConsumer; - - // lets not copy the following fields - // copy.targetConsumerId = targetConsumerId; - // copy.referenceCount = referenceCount; - } - - public Object getProperty(String name) throws IOException { - if (properties == null) { - if (marshalledProperties == null) { - return null; - } - properties = unmarsallProperties(marshalledProperties); - } - Object result = properties.get(name); - if (result instanceof UTF8Buffer) { - result = result.toString(); - } - - return result; - } - - @SuppressWarnings("unchecked") - public Map getProperties() throws IOException { - if (properties == null) { - if (marshalledProperties == null) { - return Collections.EMPTY_MAP; - } - properties = unmarsallProperties(marshalledProperties); - } - return Collections.unmodifiableMap(properties); - } - - public void clearProperties() { - marshalledProperties = null; - properties = null; - } - - public void setProperty(String name, Object value) throws IOException { - lazyCreateProperties(); - properties.put(name, value); - } - - public void removeProperty(String name) throws IOException { - lazyCreateProperties(); - properties.remove(name); - } - - protected void lazyCreateProperties() throws IOException { - if (properties == null) { - if (marshalledProperties == null) { - properties = new HashMap(); - } else { - properties = unmarsallProperties(marshalledProperties); - marshalledProperties = null; - } - } - } - - private Map unmarsallProperties(ByteSequence marshalledProperties) throws IOException { - return MarshallingSupport.unmarshalPrimitiveMap(new DataInputStream(new ByteArrayInputStream(marshalledProperties))); - } - - @Override - public void beforeMarshall(WireFormat wireFormat) throws IOException { - // Need to marshal the properties. - if (marshalledProperties == null && properties != null) { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - DataOutputStream os = new DataOutputStream(baos); - MarshallingSupport.marshalPrimitiveMap(properties, os); - os.close(); - marshalledProperties = baos.toByteSequence(); - } - } - - @Override - public void afterMarshall(WireFormat wireFormat) throws IOException { - } - - @Override - public void beforeUnmarshall(WireFormat wireFormat) throws IOException { - } - - @Override - public void afterUnmarshall(WireFormat wireFormat) throws IOException { - } - - // ///////////////////////////////////////////////////////////////// - // - // Simple Field accessors - // - // ///////////////////////////////////////////////////////////////// - - /** - * @openwire:property version=1 cache=true - */ - public ProducerId getProducerId() { - return producerId; - } - - public void setProducerId(ProducerId producerId) { - this.producerId = producerId; - } - - /** - * @openwire:property version=1 cache=true - */ - public ActiveMQDestination getDestination() { - return destination; - } - - public void setDestination(ActiveMQDestination destination) { - this.destination = destination; - } - - /** - * @openwire:property version=1 cache=true - */ - public TransactionId getTransactionId() { - return transactionId; - } - - public void setTransactionId(TransactionId transactionId) { - this.transactionId = transactionId; - } - - public boolean isInTransaction() { - return transactionId != null; - } - - /** - * @openwire:property version=1 cache=true - */ - public ActiveMQDestination getOriginalDestination() { - return originalDestination; - } - - public void setOriginalDestination(ActiveMQDestination destination) { - this.originalDestination = destination; - } - - /** - * @openwire:property version=1 - */ - @Override - public MessageId getMessageId() { - return messageId; - } - - public void setMessageId(MessageId messageId) { - this.messageId = messageId; - } - - /** - * @openwire:property version=1 cache=true - */ - public TransactionId getOriginalTransactionId() { - return originalTransactionId; - } - - public void setOriginalTransactionId(TransactionId transactionId) { - this.originalTransactionId = transactionId; - } - - /** - * @openwire:property version=1 - */ - @Override - public String getGroupID() { - return groupID; - } - - public void setGroupID(String groupID) { - this.groupID = groupID; - } - - /** - * @openwire:property version=1 - */ - @Override - public int getGroupSequence() { - return groupSequence; - } - - public void setGroupSequence(int groupSequence) { - this.groupSequence = groupSequence; - } - - /** - * @openwire:property version=1 - */ - public String getCorrelationId() { - return correlationId; - } - - public void setCorrelationId(String correlationId) { - this.correlationId = correlationId; - } - - /** - * @openwire:property version=1 - */ - @Override - public boolean isPersistent() { - return persistent; - } - - public void setPersistent(boolean deliveryMode) { - this.persistent = deliveryMode; - } - - /** - * @openwire:property version=1 - */ - @Override - public long getExpiration() { - return expiration; - } - - public void setExpiration(long expiration) { - this.expiration = expiration; - } - - /** - * @openwire:property version=1 - */ - public byte getPriority() { - return priority; - } - - public void setPriority(byte priority) { - if (priority < 0) { - this.priority = 0; - } else if (priority > 9) { - this.priority = 9; - } else { - this.priority = priority; - } - } - - /** - * @openwire:property version=1 - */ - public ActiveMQDestination getReplyTo() { - return replyTo; - } - - public void setReplyTo(ActiveMQDestination replyTo) { - this.replyTo = replyTo; - } - - /** - * @openwire:property version=1 - */ - public long getTimestamp() { - return timestamp; - } - - public void setTimestamp(long timestamp) { - this.timestamp = timestamp; - } - - /** - * @openwire:property version=1 - */ - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - /** - * @openwire:property version=1 - */ - public ByteSequence getContent() { - return content; - } - - public void setContent(ByteSequence content) { - this.content = content; - } - - /** - * @openwire:property version=1 - */ - public ByteSequence getMarshalledProperties() { - return marshalledProperties; - } - - public void setMarshalledProperties(ByteSequence marshalledProperties) { - this.marshalledProperties = marshalledProperties; - } - - /** - * @openwire:property version=1 - */ - public DataStructure getDataStructure() { - return dataStructure; - } - - public void setDataStructure(DataStructure data) { - this.dataStructure = data; - } - - /** - * Can be used to route the message to a specific consumer. Should be null - * to allow the broker use normal JMS routing semantics. If the target - * consumer id is an active consumer on the broker, the message is dropped. - * Used by the AdvisoryBroker to replay advisory messages to a specific - * consumer. - * - * @openwire:property version=1 cache=true - */ - @Override - public ConsumerId getTargetConsumerId() { - return targetConsumerId; - } - - public void setTargetConsumerId(ConsumerId targetConsumerId) { - this.targetConsumerId = targetConsumerId; - } - - @Override - public boolean isExpired() { - long expireTime = getExpiration(); - return expireTime > 0 && System.currentTimeMillis() > expireTime; - } - - @Override - public boolean isAdvisory() { - return type != null && type.equals(AdvisorySupport.ADIVSORY_MESSAGE_TYPE); - } - - /** - * @openwire:property version=1 - */ - public boolean isCompressed() { - return compressed; - } - - public void setCompressed(boolean compressed) { - this.compressed = compressed; - } - - public boolean isRedelivered() { - return redeliveryCounter > 0; - } - - public void setRedelivered(boolean redelivered) { - if (redelivered) { - if (!isRedelivered()) { - setRedeliveryCounter(1); - } - } else { - if (isRedelivered()) { - setRedeliveryCounter(0); - } - } - } - - @Override - public void incrementRedeliveryCounter() { - redeliveryCounter++; - } - - /** - * @openwire:property version=1 - */ - @Override - public int getRedeliveryCounter() { - return redeliveryCounter; - } - - public void setRedeliveryCounter(int deliveryCounter) { - this.redeliveryCounter = deliveryCounter; - } - - /** - * The route of brokers the command has moved through. - * - * @openwire:property version=1 cache=true - */ - public BrokerId[] getBrokerPath() { - return brokerPath; - } - - public void setBrokerPath(BrokerId[] brokerPath) { - this.brokerPath = brokerPath; - } - - public boolean isReadOnlyProperties() { - return readOnlyProperties; - } - - public void setReadOnlyProperties(boolean readOnlyProperties) { - this.readOnlyProperties = readOnlyProperties; - } - - public boolean isReadOnlyBody() { - return readOnlyBody; - } - - public void setReadOnlyBody(boolean readOnlyBody) { - this.readOnlyBody = readOnlyBody; - } - - public ActiveMQConnection getConnection() { - return this.connection; - } - - public void setConnection(ActiveMQConnection connection) { - this.connection = connection; - } - - /** - * Used to schedule the arrival time of a message to a broker. The broker - * will not dispatch a message to a consumer until it's arrival time has - * elapsed. - * - * @openwire:property version=1 - */ - public long getArrival() { - return arrival; - } - - public void setArrival(long arrival) { - this.arrival = arrival; - } - - /** - * Only set by the broker and defines the userID of the producer connection - * who sent this message. This is an optional field, it needs to be enabled - * on the broker to have this field populated. - * - * @openwire:property version=1 - */ - public String getUserID() { - return userID; - } - - public void setUserID(String jmsxUserID) { - this.userID = jmsxUserID; - } - - @Override - public int getReferenceCount() { - return referenceCount; - } - - @Override - public Message getMessageHardRef() { - return this; - } - - @Override - public Message getMessage() { - return this; - } - - public void setRegionDestination(MessageDestination destination) { - this.regionDestination = destination; - if(this.memoryUsage==null) { - this.memoryUsage=destination.getMemoryUsage(); - } - } - - @Override - public MessageDestination getRegionDestination() { - return regionDestination; - } - - public MemoryUsage getMemoryUsage() { - return this.memoryUsage; - } - - public void setMemoryUsage(MemoryUsage usage) { - this.memoryUsage=usage; - } - - @Override - public boolean isMarshallAware() { - return true; - } - - @Override - public int incrementReferenceCount() { - int rc; - int size; - synchronized (this) { - rc = ++referenceCount; - size = getSize(); - } - - if (rc == 1 && getMemoryUsage() != null) { - getMemoryUsage().increaseUsage(size); - //System.err.println("INCREASE USAGE " + System.identityHashCode(getMemoryUsage()) + " PERCENT = " + getMemoryUsage().getPercentUsage()); - - } - - //System.out.println(" + "+getMemoryUsage().getName()+" :::: "+getMessageId()+"rc="+rc); - return rc; - } - - @Override - public int decrementReferenceCount() { - int rc; - int size; - synchronized (this) { - rc = --referenceCount; - size = getSize(); - } - - if (rc == 0 && getMemoryUsage() != null) { - getMemoryUsage().decreaseUsage(size); - //Thread.dumpStack(); - //System.err.println("DECREADED USAGE " + System.identityHashCode(getMemoryUsage()) + " PERCENT = " + getMemoryUsage().getPercentUsage()); - } - - //System.out.println(" - "+getMemoryUsage().getName()+" :::: "+getMessageId()+"rc="+rc); - - return rc; - } - - @Override - public int getSize() { - int minimumMessageSize = getMinimumMessageSize(); - if (size < minimumMessageSize || size == 0) { - size = minimumMessageSize; - if (marshalledProperties != null) { - size += marshalledProperties.getLength(); - } - if (content != null) { - size += content.getLength(); - } - } - return size; - } - - protected int getMinimumMessageSize() { - int result = DEFAULT_MINIMUM_MESSAGE_SIZE; - //let destination override - MessageDestination dest = regionDestination; - if (dest != null) { - result=dest.getMinimumMessageSize(); - } - return result; - } - - /** - * @openwire:property version=1 - * @return Returns the recievedByDFBridge. - */ - public boolean isRecievedByDFBridge() { - return recievedByDFBridge; - } - - /** - * @param recievedByDFBridge The recievedByDFBridge to set. - */ - public void setRecievedByDFBridge(boolean recievedByDFBridge) { - this.recievedByDFBridge = recievedByDFBridge; - } - - public void onMessageRolledBack() { - incrementRedeliveryCounter(); - } - - /** - * @openwire:property version=2 cache=true - */ - public boolean isDroppable() { - return droppable; - } - - public void setDroppable(boolean droppable) { - this.droppable = droppable; - } - - /** - * If a message is stored in multiple nodes on a cluster, all the cluster - * members will be listed here. Otherwise, it will be null. - * - * @openwire:property version=3 cache=true - */ - public BrokerId[] getCluster() { - return cluster; - } - - public void setCluster(BrokerId[] cluster) { - this.cluster = cluster; - } - - @Override - public boolean isMessage() { - return true; - } - - /** - * @openwire:property version=3 - */ - public long getBrokerInTime() { - return this.brokerInTime; - } - - public void setBrokerInTime(long brokerInTime) { - this.brokerInTime = brokerInTime; - } - - /** - * @openwire:property version=3 - */ - public long getBrokerOutTime() { - return this.brokerOutTime; - } - - public void setBrokerOutTime(long brokerOutTime) { - this.brokerOutTime = brokerOutTime; - } - - @Override - public boolean isDropped() { - return false; - } - - /** - * @openwire:property version=10 - */ - public boolean isJMSXGroupFirstForConsumer() { - return jmsXGroupFirstForConsumer; - } - - public void setJMSXGroupFirstForConsumer(boolean val) { - jmsXGroupFirstForConsumer = val; - } - - public void compress() throws IOException { - if (!isCompressed()) { - storeContent(); - if (!isCompressed() && getContent() != null) { - doCompress(); - } - } - } - - protected void doCompress() throws IOException { - compressed = true; - ByteSequence bytes = getContent(); - ByteArrayOutputStream bytesOut = new ByteArrayOutputStream(); - OutputStream os = new DeflaterOutputStream(bytesOut); - os.write(bytes.data, bytes.offset, bytes.length); - os.close(); - setContent(bytesOut.toByteSequence()); - } - - @Override - public String toString() { - return toString(null); - } - - @Override - public String toString(MapoverrideFields) { - try { - getProperties(); - } catch (IOException e) { - } - return super.toString(overrideFields); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/MessageAck.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/MessageAck.class deleted file mode 100644 index 3739e222c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/MessageAck.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/MessageAck.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/MessageAck.java deleted file mode 100644 index 1fc6c10d6..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/MessageAck.java +++ /dev/null @@ -1,248 +0,0 @@ -/** - * 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.command; - -import org.apache.activemq.state.CommandVisitor; - -/** - * @openwire:marshaller code="22" - * - */ -public class MessageAck extends BaseCommand { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.MESSAGE_ACK; - - /** - * Used to let the broker know that the message has been delivered to the - * client. Message will still be retained until an standard ack is received. - * This is used get the broker to send more messages past prefetch limits - * when an standard ack has not been sent. - */ - public static final byte DELIVERED_ACK_TYPE = 0; - - /** - * The standard ack case where a client wants the message to be discarded. - */ - public static final byte STANDARD_ACK_TYPE = 2; - - /** - * In case the client want's to explicitly let the broker know that a - * message was not processed and the message was considered a poison - * message. - */ - public static final byte POSION_ACK_TYPE = 1; - - /** - * In case the client want's to explicitly let the broker know that a - * message was not processed and it was re-delivered to the consumer - * but it was not yet considered to be a poison message. The messageCount - * field will hold the number of times the message was re-delivered. - */ - public static final byte REDELIVERED_ACK_TYPE = 3; - - /** - * The ack case where a client wants only an individual message to be discarded. - */ - public static final byte INDIVIDUAL_ACK_TYPE = 4; - -/** - * The ack case where a durable topic subscription does not match a selector. - */ - public static final byte UNMATCHED_ACK_TYPE = 5; - - protected byte ackType; - protected ConsumerId consumerId; - protected MessageId firstMessageId; - protected MessageId lastMessageId; - protected ActiveMQDestination destination; - protected TransactionId transactionId; - protected int messageCount; - protected Throwable poisonCause; - - protected transient String consumerKey; - - public MessageAck() { - } - - public MessageAck(MessageDispatch md, byte ackType, int messageCount) { - this.ackType = ackType; - this.consumerId = md.getConsumerId(); - this.destination = md.getDestination(); - this.lastMessageId = md.getMessage().getMessageId(); - this.messageCount = messageCount; - } - - public MessageAck(Message message, byte ackType, int messageCount) { - this.ackType = ackType; - this.destination = message.getDestination(); - this.lastMessageId = message.getMessageId(); - this.messageCount = messageCount; - } - - public void copy(MessageAck copy) { - super.copy(copy); - copy.firstMessageId = firstMessageId; - copy.lastMessageId = lastMessageId; - copy.destination = destination; - copy.transactionId = transactionId; - copy.ackType = ackType; - copy.consumerId = consumerId; - } - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - public boolean isMessageAck() { - return true; - } - - public boolean isPoisonAck() { - return ackType == POSION_ACK_TYPE; - } - - public boolean isStandardAck() { - return ackType == STANDARD_ACK_TYPE; - } - - public boolean isDeliveredAck() { - return ackType == DELIVERED_ACK_TYPE; - } - - public boolean isRedeliveredAck() { - return ackType == REDELIVERED_ACK_TYPE; - } - - public boolean isIndividualAck() { - return ackType == INDIVIDUAL_ACK_TYPE; - } - - public boolean isUnmatchedAck() { - return ackType == UNMATCHED_ACK_TYPE; - } - - /** - * @openwire:property version=1 cache=true - */ - public ActiveMQDestination getDestination() { - return destination; - } - - public void setDestination(ActiveMQDestination destination) { - this.destination = destination; - } - - /** - * @openwire:property version=1 cache=true - */ - public TransactionId getTransactionId() { - return transactionId; - } - - public void setTransactionId(TransactionId transactionId) { - this.transactionId = transactionId; - } - - public boolean isInTransaction() { - return transactionId != null; - } - - /** - * @openwire:property version=1 cache=true - */ - public ConsumerId getConsumerId() { - return consumerId; - } - - public void setConsumerId(ConsumerId consumerId) { - this.consumerId = consumerId; - } - - /** - * @openwire:property version=1 - */ - public byte getAckType() { - return ackType; - } - - public void setAckType(byte ackType) { - this.ackType = ackType; - } - - /** - * @openwire:property version=1 - */ - public MessageId getFirstMessageId() { - return firstMessageId; - } - - public void setFirstMessageId(MessageId firstMessageId) { - this.firstMessageId = firstMessageId; - } - - /** - * @openwire:property version=1 - */ - public MessageId getLastMessageId() { - return lastMessageId; - } - - public void setLastMessageId(MessageId lastMessageId) { - this.lastMessageId = lastMessageId; - } - - /** - * The number of messages being acknowledged in the range. - * - * @openwire:property version=1 - */ - public int getMessageCount() { - return messageCount; - } - - public void setMessageCount(int messageCount) { - this.messageCount = messageCount; - } - - /** - * The cause of a poison ack, if a message listener - * throws an exception it will be recorded here - * - * @openwire:property version=7 - */ - public Throwable getPoisonCause() { - return poisonCause; - } - - public void setPoisonCause(Throwable poisonCause) { - this.poisonCause = poisonCause; - } - - public Response visit(CommandVisitor visitor) throws Exception { - return visitor.processMessageAck(this); - } - - /** - * A helper method to allow a single message ID to be acknowledged - */ - public void setMessageID(MessageId messageID) { - setFirstMessageId(messageID); - setLastMessageId(messageID); - setMessageCount(1); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/MessageDispatch.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/MessageDispatch.class deleted file mode 100644 index b1962920c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/MessageDispatch.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/MessageDispatch.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/MessageDispatch.java deleted file mode 100644 index da2c0bfcc..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/MessageDispatch.java +++ /dev/null @@ -1,131 +0,0 @@ -/** - * 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.command; - -import org.apache.activemq.state.CommandVisitor; -import org.apache.activemq.transport.TransmitCallback; - -/** - * - * @openwire:marshaller code="21" - * - */ -public class MessageDispatch extends BaseCommand { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.MESSAGE_DISPATCH; - - protected ConsumerId consumerId; - protected ActiveMQDestination destination; - protected Message message; - protected int redeliveryCounter; - - protected transient long deliverySequenceId; - protected transient Object consumer; - protected transient TransmitCallback transmitCallback; - protected transient Throwable rollbackCause; - - @Override - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - @Override - public boolean isMessageDispatch() { - return true; - } - - /** - * @openwire:property version=1 cache=true - */ - public ConsumerId getConsumerId() { - return consumerId; - } - - public void setConsumerId(ConsumerId consumerId) { - this.consumerId = consumerId; - } - - /** - * @openwire:property version=1 cache=true - */ - public ActiveMQDestination getDestination() { - return destination; - } - - public void setDestination(ActiveMQDestination destination) { - this.destination = destination; - } - - /** - * @openwire:property version=1 - */ - public Message getMessage() { - return message; - } - - public void setMessage(Message message) { - this.message = message; - } - - public long getDeliverySequenceId() { - return deliverySequenceId; - } - - public void setDeliverySequenceId(long deliverySequenceId) { - this.deliverySequenceId = deliverySequenceId; - } - - /** - * @openwire:property version=1 - */ - public int getRedeliveryCounter() { - return redeliveryCounter; - } - - public void setRedeliveryCounter(int deliveryCounter) { - this.redeliveryCounter = deliveryCounter; - } - - public Object getConsumer() { - return consumer; - } - - public void setConsumer(Object consumer) { - this.consumer = consumer; - } - - @Override - public Response visit(CommandVisitor visitor) throws Exception { - return visitor.processMessageDispatch(this); - } - - public TransmitCallback getTransmitCallback() { - return transmitCallback; - } - - public void setTransmitCallback(TransmitCallback transmitCallback) { - this.transmitCallback = transmitCallback; - } - - public Throwable getRollbackCause() { - return rollbackCause; - } - - public void setRollbackCause(Throwable rollbackCause) { - this.rollbackCause = rollbackCause; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/MessageDispatchNotification.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/MessageDispatchNotification.class deleted file mode 100644 index 0e3ea2c2f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/MessageDispatchNotification.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/MessageDispatchNotification.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/MessageDispatchNotification.java deleted file mode 100644 index b618f3d27..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/MessageDispatchNotification.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - * 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.command; - -import org.apache.activemq.state.CommandVisitor; - -/** - * @openwire:marshaller code="90" - * - */ -public class MessageDispatchNotification extends BaseCommand { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.MESSAGE_DISPATCH_NOTIFICATION; - - protected ConsumerId consumerId; - protected ActiveMQDestination destination; - protected MessageId messageId; - protected long deliverySequenceId; - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - public boolean isMessageDispatchNotification() { - return true; - } - - /** - * @openwire:property version=1 cache=true - */ - public ConsumerId getConsumerId() { - return consumerId; - } - - public void setConsumerId(ConsumerId consumerId) { - this.consumerId = consumerId; - } - - /** - * @openwire:property version=1 cache=true - */ - public ActiveMQDestination getDestination() { - return destination; - } - - public void setDestination(ActiveMQDestination destination) { - this.destination = destination; - } - - /** - * @openwire:property version=1 - */ - - public long getDeliverySequenceId() { - return deliverySequenceId; - } - - public void setDeliverySequenceId(long deliverySequenceId) { - this.deliverySequenceId = deliverySequenceId; - } - - public Response visit(CommandVisitor visitor) throws Exception { - return visitor.processMessageDispatchNotification(this); - } - - /** - * @openwire:property version=1 - */ - public MessageId getMessageId() { - return messageId; - } - - public void setMessageId(MessageId messageId) { - this.messageId = messageId; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/MessageId.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/MessageId.class deleted file mode 100644 index 479ce3649..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/MessageId.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/MessageId.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/MessageId.java deleted file mode 100644 index 5c3069f9d..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/MessageId.java +++ /dev/null @@ -1,237 +0,0 @@ -/** - * 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.command; - -import java.util.concurrent.atomic.AtomicReference; - -/** - * @openwire:marshaller code="110" - * - */ -public class MessageId implements DataStructure, Comparable { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.MESSAGE_ID; - - protected String textView; - protected ProducerId producerId; - protected long producerSequenceId; - protected long brokerSequenceId; - - private transient String key; - private transient int hashCode; - - private transient AtomicReference dataLocator = new AtomicReference(); - private transient Object entryLocator; - private transient Object plistLocator; - - public MessageId() { - this.producerId = new ProducerId(); - } - - public MessageId(ProducerInfo producerInfo, long producerSequenceId) { - this.producerId = producerInfo.getProducerId(); - this.producerSequenceId = producerSequenceId; - } - - public MessageId(String messageKey) { - setValue(messageKey); - } - - public MessageId(String producerId, long producerSequenceId) { - this(new ProducerId(producerId), producerSequenceId); - } - - public MessageId(ProducerId producerId, long producerSequenceId) { - this.producerId = producerId; - this.producerSequenceId = producerSequenceId; - } - - /** - * Sets the value as a String - */ - public void setValue(String messageKey) { - key = messageKey; - // Parse off the sequenceId - int p = messageKey.lastIndexOf(":"); - if (p >= 0) { - producerSequenceId = Long.parseLong(messageKey.substring(p + 1)); - messageKey = messageKey.substring(0, p); - } else { - throw new NumberFormatException(); - } - producerId = new ProducerId(messageKey); - } - - /** - * Sets the transient text view of the message which will be ignored if the message is marshaled on a transport; so - * is only for in-JVM changes to accommodate foreign JMS message IDs - */ - public void setTextView(String key) { - this.textView = key; - } - - /** - * @openwire:property version=10 - * @return - */ - public String getTextView() { - return textView; - } - - @Override - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || o.getClass() != getClass()) { - return false; - } - - MessageId id = (MessageId) o; - return producerSequenceId == id.producerSequenceId && producerId.equals(id.producerId); - } - - @Override - public int hashCode() { - if (hashCode == 0) { - hashCode = producerId.hashCode() ^ (int) producerSequenceId; - } - return hashCode; - } - - public String toProducerKey() { - if (textView == null) { - return toString(); - } else { - return producerId.toString() + ":" + producerSequenceId; - } - } - - @Override - public String toString() { - if (key == null) { - if (textView != null) { - if (textView.startsWith("ID:")) { - key = textView; - } else { - key = "ID:" + textView; - } - } else { - key = producerId.toString() + ":" + producerSequenceId; - } - } - return key; - } - - /** - * @openwire:property version=1 cache=true - */ - public ProducerId getProducerId() { - return producerId; - } - - public void setProducerId(ProducerId producerId) { - this.producerId = producerId; - } - - /** - * @openwire:property version=1 - */ - public long getProducerSequenceId() { - return producerSequenceId; - } - - public void setProducerSequenceId(long producerSequenceId) { - this.producerSequenceId = producerSequenceId; - } - - /** - * @openwire:property version=1 - */ - public long getBrokerSequenceId() { - return brokerSequenceId; - } - - public void setBrokerSequenceId(long brokerSequenceId) { - this.brokerSequenceId = brokerSequenceId; - } - - @Override - public boolean isMarshallAware() { - return false; - } - - public MessageId copy() { - MessageId copy = new MessageId(producerId, producerSequenceId); - copy.key = key; - copy.brokerSequenceId = brokerSequenceId; - copy.dataLocator = dataLocator; - copy.entryLocator = entryLocator; - copy.plistLocator = plistLocator; - copy.textView = textView; - return copy; - } - - /** - * @param - * @return - * @see java.lang.Comparable#compareTo(java.lang.Object) - */ - @Override - public int compareTo(MessageId other) { - int result = -1; - if (other != null) { - result = this.toString().compareTo(other.toString()); - } - return result; - } - - /** - * @return a locator which aids a message store in loading a message faster. Only used by the message stores. - */ - public Object getDataLocator() { - return dataLocator.get(); - } - - /** - * Sets a locator which aids a message store in loading a message faster. Only used by the message stores. - */ - public void setDataLocator(Object value) { - this.dataLocator.set(value); - } - - public Object getEntryLocator() { - return entryLocator; - } - - public void setEntryLocator(Object entryLocator) { - this.entryLocator = entryLocator; - } - - public Object getPlistLocator() { - return plistLocator; - } - - public void setPlistLocator(Object plistLocator) { - this.plistLocator = plistLocator; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/MessagePull.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/MessagePull.class deleted file mode 100644 index dd28ad444..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/MessagePull.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/MessagePull.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/MessagePull.java deleted file mode 100644 index 0ae58c466..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/MessagePull.java +++ /dev/null @@ -1,115 +0,0 @@ -/** - * 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.command; - -import org.apache.activemq.state.CommandVisitor; - -/** - * Used to pull messages on demand. - * - * @openwire:marshaller code="20" - * - * - */ -public class MessagePull extends BaseCommand { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.MESSAGE_PULL; - - protected ConsumerId consumerId; - protected ActiveMQDestination destination; - protected long timeout; - private MessageId messageId; - private String correlationId; - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - public Response visit(CommandVisitor visitor) throws Exception { - return visitor.processMessagePull(this); - } - - /** - * Configures a message pull from the consumer information - */ - public void configure(ConsumerInfo info) { - setConsumerId(info.getConsumerId()); - setDestination(info.getDestination()); - } - - /** - * @openwire:property version=1 cache=true - */ - public ConsumerId getConsumerId() { - return consumerId; - } - - public void setConsumerId(ConsumerId consumerId) { - this.consumerId = consumerId; - } - - /** - * @openwire:property version=1 cache=true - */ - public ActiveMQDestination getDestination() { - return destination; - } - - public void setDestination(ActiveMQDestination destination) { - this.destination = destination; - } - - /** - * @openwire:property version=1 - */ - public long getTimeout() { - return timeout; - } - - public void setTimeout(long timeout) { - this.timeout = timeout; - } - - /** - * An optional correlation ID which could be used by a broker to decide which messages are pulled - * on demand from a queue for a consumer - * - * @openwire:property version=3 - */ - public String getCorrelationId() { - return correlationId; - } - - public void setCorrelationId(String correlationId) { - this.correlationId = correlationId; - } - - - /** - * An optional message ID which could be used by a broker to decide which messages are pulled - * on demand from a queue for a consumer - * - * @openwire:property version=3 - */ - public MessageId getMessageId() { - return messageId; - } - - public void setMessageId(MessageId messageId) { - this.messageId = messageId; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/NetworkBridgeFilter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/NetworkBridgeFilter.class deleted file mode 100644 index c14b30d23..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/NetworkBridgeFilter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/NetworkBridgeFilter.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/NetworkBridgeFilter.java deleted file mode 100644 index 85440719b..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/NetworkBridgeFilter.java +++ /dev/null @@ -1,180 +0,0 @@ -/** - * 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.command; - -import org.apache.activemq.filter.BooleanExpression; -import org.apache.activemq.filter.MessageEvaluationContext; -import org.apache.activemq.util.JMSExceptionSupport; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.jms.JMSException; -import java.io.IOException; -import java.util.Arrays; - -/** - * @openwire:marshaller code="91" - * - */ -public class NetworkBridgeFilter implements DataStructure, BooleanExpression { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.NETWORK_BRIDGE_FILTER; - static final Logger LOG = LoggerFactory.getLogger(NetworkBridgeFilter.class); - - protected BrokerId networkBrokerId; - protected int messageTTL; - protected int consumerTTL; - transient ConsumerInfo consumerInfo; - - public NetworkBridgeFilter() { - } - - public NetworkBridgeFilter(ConsumerInfo consumerInfo, BrokerId networkBrokerId, int messageTTL, int consumerTTL) { - this.networkBrokerId = networkBrokerId; - this.messageTTL = messageTTL; - this.consumerTTL = consumerTTL; - this.consumerInfo = consumerInfo; - } - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - public boolean isMarshallAware() { - return false; - } - - public boolean matches(MessageEvaluationContext mec) throws JMSException { - try { - // for Queues - the message can be acknowledged and dropped whilst - // still - // in the dispatch loop - // so need to get the reference to it - Message message = mec.getMessage(); - return message != null && matchesForwardingFilter(message, mec); - } catch (IOException e) { - throw JMSExceptionSupport.create(e); - } - } - - public Object evaluate(MessageEvaluationContext message) throws JMSException { - return matches(message) ? Boolean.TRUE : Boolean.FALSE; - } - - protected boolean matchesForwardingFilter(Message message, MessageEvaluationContext mec) { - - if (contains(message.getBrokerPath(), networkBrokerId)) { - if (LOG.isTraceEnabled()) { - LOG.trace("Message all ready routed once through target broker (" - + networkBrokerId + "), path: " - + Arrays.toString(message.getBrokerPath()) + " - ignoring: " + message); - } - return false; - } - - int hops = message.getBrokerPath() == null ? 0 : message.getBrokerPath().length; - - if (messageTTL > -1 && hops >= messageTTL) { - if (LOG.isTraceEnabled()) { - LOG.trace("Message restricted to " + messageTTL + " network hops ignoring: " + message); - } - return false; - } - - if (message.isAdvisory()) { - if (consumerInfo != null && consumerInfo.isNetworkSubscription()) { - // they will be interpreted by the bridge leading to dup commands - if (LOG.isTraceEnabled()) { - LOG.trace("not propagating advisory to network sub: " + consumerInfo.getConsumerId() + ", message: "+ message); - } - return false; - } else if ( message.getDataStructure() != null && message.getDataStructure().getDataStructureType() == CommandTypes.CONSUMER_INFO) { - ConsumerInfo info = (ConsumerInfo)message.getDataStructure(); - hops = info.getBrokerPath() == null ? 0 : info.getBrokerPath().length; - if (consumerTTL > -1 && hops >= consumerTTL) { - if (LOG.isTraceEnabled()) { - LOG.trace("ConsumerInfo advisory restricted to " + consumerTTL + " network hops ignoring: " + message); - } - return false; - } - - if (contains(info.getBrokerPath(), networkBrokerId)) { - LOG.trace("ConsumerInfo advisory all ready routed once through target broker (" - + networkBrokerId + "), path: " - + Arrays.toString(info.getBrokerPath()) + " - ignoring: " + message); - return false; - } - } - } - return true; - } - - public static boolean contains(BrokerId[] brokerPath, BrokerId brokerId) { - if (brokerPath != null && brokerId != null) { - for (int i = 0; i < brokerPath.length; i++) { - if (brokerId.equals(brokerPath[i])) { - return true; - } - } - } - return false; - } - - // keep for backward compat with older - // wire formats - public int getNetworkTTL() { - return messageTTL; - } - - public void setNetworkTTL(int networkTTL) { - messageTTL = networkTTL; - consumerTTL = networkTTL; - } - - /** - * @openwire:property version=1 cache=true - */ - public BrokerId getNetworkBrokerId() { - return networkBrokerId; - } - - public void setNetworkBrokerId(BrokerId remoteBrokerPath) { - this.networkBrokerId = remoteBrokerPath; - } - - public void setMessageTTL(int messageTTL) { - this.messageTTL = messageTTL; - } - - /** - * @openwire:property version=10 - */ - public int getMessageTTL() { - return this.messageTTL; - } - - public void setConsumerTTL(int consumerTTL) { - this.consumerTTL = consumerTTL; - } - - /** - * @openwire:property version=10 - */ - public int getConsumerTTL() { - return this.consumerTTL; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/PartialCommand.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/PartialCommand.class deleted file mode 100644 index 298590274..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/PartialCommand.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/PartialCommand.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/PartialCommand.java deleted file mode 100644 index 40691974b..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/PartialCommand.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * 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.command; - -import org.apache.activemq.state.CommandVisitor; - -/** - * Represents a partial command; a large command that has been split up into - * pieces. - * - * @openwire:marshaller code="60" - * - */ -public class PartialCommand implements Command { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.PARTIAL_COMMAND; - - private int commandId; - private byte[] data; - - private transient Endpoint from; - private transient Endpoint to; - - public PartialCommand() { - } - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - /** - * @openwire:property version=1 - */ - public int getCommandId() { - return commandId; - } - - public void setCommandId(int commandId) { - this.commandId = commandId; - } - - /** - * The data for this part of the command - * - * @openwire:property version=1 mandatory=true - */ - public byte[] getData() { - return data; - } - - public void setData(byte[] data) { - this.data = data; - } - - public Endpoint getFrom() { - return from; - } - - public void setFrom(Endpoint from) { - this.from = from; - } - - public Endpoint getTo() { - return to; - } - - public void setTo(Endpoint to) { - this.to = to; - } - - public Response visit(CommandVisitor visitor) throws Exception { - throw new IllegalStateException("The transport layer should filter out PartialCommand instances but received: " + this); - } - - public boolean isResponseRequired() { - return false; - } - - public boolean isResponse() { - return false; - } - - public boolean isBrokerInfo() { - return false; - } - - public boolean isMessageDispatch() { - return false; - } - - public boolean isMessage() { - return false; - } - - public boolean isMessageAck() { - return false; - } - - public boolean isMessageDispatchNotification() { - return false; - } - - public boolean isShutdownInfo() { - return false; - } - - public boolean isConnectionControl() { - return false; - } - - public void setResponseRequired(boolean responseRequired) { - } - - public boolean isWireFormatInfo() { - return false; - } - - public boolean isMarshallAware() { - return false; - } - - public String toString() { - int size = 0; - if (data != null) { - size = data.length; - } - return "PartialCommand[id: " + commandId + " data: " + size + " byte(s)]"; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ProducerAck.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ProducerAck.class deleted file mode 100644 index f975579ea..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ProducerAck.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ProducerAck.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ProducerAck.java deleted file mode 100644 index 0c4e7ad16..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ProducerAck.java +++ /dev/null @@ -1,85 +0,0 @@ -/** - * 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.command; - -import org.apache.activemq.state.CommandVisitor; - -/** - * A ProducerAck command is sent by a broker to a producer to let it know it has - * received and processed messages that it has produced. The producer will be - * flow controlled if it does not receive ProducerAck commands back from the - * broker. - * - * @openwire:marshaller code="19" version="3" - * - */ -public class ProducerAck extends BaseCommand { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.PRODUCER_ACK; - - protected ProducerId producerId; - protected int size; - - public ProducerAck() { - } - - public ProducerAck(ProducerId producerId, int size) { - this.producerId = producerId; - this.size = size; - } - - public void copy(ProducerAck copy) { - super.copy(copy); - copy.producerId = producerId; - copy.size = size; - } - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - public Response visit(CommandVisitor visitor) throws Exception { - return visitor.processProducerAck(this); - } - - /** - * The producer id that this ack message is destined for. - * - * @openwire:property version=3 - */ - public ProducerId getProducerId() { - return producerId; - } - - public void setProducerId(ProducerId producerId) { - this.producerId = producerId; - } - - /** - * The number of bytes that are being acked. - * - * @openwire:property version=3 - */ - public int getSize() { - return size; - } - - public void setSize(int size) { - this.size = size; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ProducerId.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ProducerId.class deleted file mode 100644 index 546b4cb6f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ProducerId.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ProducerId.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ProducerId.java deleted file mode 100644 index 1375e1a6e..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ProducerId.java +++ /dev/null @@ -1,146 +0,0 @@ -/** - * 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.command; - -/** - * @openwire:marshaller code="123" - * - */ -public class ProducerId implements DataStructure { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.PRODUCER_ID; - - protected String connectionId; - protected long sessionId; - protected long value; - - protected transient int hashCode; - protected transient String key; - protected transient SessionId parentId; - - public ProducerId() { - } - - public ProducerId(SessionId sessionId, long producerId) { - this.connectionId = sessionId.getConnectionId(); - this.sessionId = sessionId.getValue(); - this.value = producerId; - } - - public ProducerId(ProducerId id) { - this.connectionId = id.getConnectionId(); - this.sessionId = id.getSessionId(); - this.value = id.getValue(); - } - - public ProducerId(String producerKey) { - // Parse off the producerId - int p = producerKey.lastIndexOf(":"); - if (p >= 0) { - value = Long.parseLong(producerKey.substring(p + 1)); - producerKey = producerKey.substring(0, p); - } - setProducerSessionKey(producerKey); - } - - public SessionId getParentId() { - if (parentId == null) { - parentId = new SessionId(this); - } - return parentId; - } - - public int hashCode() { - if (hashCode == 0) { - hashCode = connectionId.hashCode() ^ (int)sessionId ^ (int)value; - } - return hashCode; - } - - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || o.getClass() != ProducerId.class) { - return false; - } - ProducerId id = (ProducerId)o; - return sessionId == id.sessionId && value == id.value && connectionId.equals(id.connectionId); - } - - /** - * @param sessionKey - */ - private void setProducerSessionKey(String sessionKey) { - // Parse off the value - int p = sessionKey.lastIndexOf(":"); - if (p >= 0) { - sessionId = Long.parseLong(sessionKey.substring(p + 1)); - sessionKey = sessionKey.substring(0, p); - } - // The rest is the value - connectionId = sessionKey; - } - - public String toString() { - if (key == null) { - key = connectionId + ":" + sessionId + ":" + value; - } - return key; - } - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - /** - * @openwire:property version=1 cache=true - */ - public String getConnectionId() { - return connectionId; - } - - public void setConnectionId(String connectionId) { - this.connectionId = connectionId; - } - - /** - * @openwire:property version=1 - */ - public long getValue() { - return value; - } - - public void setValue(long producerId) { - this.value = producerId; - } - - /** - * @openwire:property version=1 - */ - public long getSessionId() { - return sessionId; - } - - public void setSessionId(long sessionId) { - this.sessionId = sessionId; - } - - public boolean isMarshallAware() { - return false; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ProducerInfo.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ProducerInfo.class deleted file mode 100644 index 4e2bded32..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ProducerInfo.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ProducerInfo.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ProducerInfo.java deleted file mode 100644 index 9854c5e2a..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ProducerInfo.java +++ /dev/null @@ -1,138 +0,0 @@ -/** - * 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.command; - -import org.apache.activemq.state.CommandVisitor; - -/** - * - * @openwire:marshaller code="6" - * - */ -public class ProducerInfo extends BaseCommand { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.PRODUCER_INFO; - - protected ProducerId producerId; - protected ActiveMQDestination destination; - protected BrokerId[] brokerPath; - protected boolean dispatchAsync; - protected int windowSize; - - public ProducerInfo() { - } - - public ProducerInfo(ProducerId producerId) { - this.producerId = producerId; - } - - public ProducerInfo(SessionInfo sessionInfo, long producerId) { - this.producerId = new ProducerId(sessionInfo.getSessionId(), producerId); - } - - public ProducerInfo copy() { - ProducerInfo info = new ProducerInfo(); - copy(info); - return info; - } - - public void copy(ProducerInfo info) { - super.copy(info); - info.producerId = producerId; - info.destination = destination; - } - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - /** - * @openwire:property version=1 cache=true - */ - public ProducerId getProducerId() { - return producerId; - } - - public void setProducerId(ProducerId producerId) { - this.producerId = producerId; - } - - /** - * @openwire:property version=1 cache=true - */ - public ActiveMQDestination getDestination() { - return destination; - } - - public void setDestination(ActiveMQDestination destination) { - this.destination = destination; - } - - public RemoveInfo createRemoveCommand() { - RemoveInfo command = new RemoveInfo(getProducerId()); - command.setResponseRequired(isResponseRequired()); - return command; - } - - /** - * The route of brokers the command has moved through. - * - * @openwire:property version=1 cache=true - */ - public BrokerId[] getBrokerPath() { - return brokerPath; - } - - public void setBrokerPath(BrokerId[] brokerPath) { - this.brokerPath = brokerPath; - } - - public Response visit(CommandVisitor visitor) throws Exception { - return visitor.processAddProducer(this); - } - - /** - * If the broker should dispatch messages from this producer async. Since - * sync dispatch could potentally block the producer thread, this could be - * an important setting for the producer. - * - * @openwire:property version=2 - */ - public boolean isDispatchAsync() { - return dispatchAsync; - } - - public void setDispatchAsync(boolean dispatchAsync) { - this.dispatchAsync = dispatchAsync; - } - - /** - * Used to configure the producer window size. A producer will send up to - * the configured window size worth of payload data to the broker before - * waiting for an Ack that allows him to send more. - * - * @openwire:property version=3 - */ - public int getWindowSize() { - return windowSize; - } - - public void setWindowSize(int windowSize) { - this.windowSize = windowSize; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/RemoveInfo.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/RemoveInfo.class deleted file mode 100644 index 3ed2b5229..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/RemoveInfo.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/RemoveInfo.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/RemoveInfo.java deleted file mode 100644 index 3452104c3..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/RemoveInfo.java +++ /dev/null @@ -1,112 +0,0 @@ -/** - * 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.command; - -import java.io.IOException; - -import org.apache.activemq.state.CommandVisitor; - -/** - * Removes a consumer, producer, session or connection. - * - * @openwire:marshaller code="12" - * - */ -public class RemoveInfo extends BaseCommand { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.REMOVE_INFO; - - protected DataStructure objectId; - protected long lastDeliveredSequenceId; - - public RemoveInfo() { - } - - public RemoveInfo(DataStructure objectId) { - this.objectId = objectId; - } - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - /** - * @openwire:property version=1 cache=true - */ - public DataStructure getObjectId() { - return objectId; - } - - public void setObjectId(DataStructure objectId) { - this.objectId = objectId; - } - - /** - * @openwire:property version=5 cache=false - */ - public long getLastDeliveredSequenceId() { - return lastDeliveredSequenceId; - } - - public void setLastDeliveredSequenceId(long lastDeliveredSequenceId) { - this.lastDeliveredSequenceId = lastDeliveredSequenceId; - } - - public Response visit(CommandVisitor visitor) throws Exception { - switch (objectId.getDataStructureType()) { - case ConnectionId.DATA_STRUCTURE_TYPE: - return visitor.processRemoveConnection((ConnectionId)objectId, lastDeliveredSequenceId); - case SessionId.DATA_STRUCTURE_TYPE: - return visitor.processRemoveSession((SessionId)objectId, lastDeliveredSequenceId); - case ConsumerId.DATA_STRUCTURE_TYPE: - return visitor.processRemoveConsumer((ConsumerId)objectId, lastDeliveredSequenceId); - case ProducerId.DATA_STRUCTURE_TYPE: - return visitor.processRemoveProducer((ProducerId)objectId); - default: - throw new IOException("Unknown remove command type: " + objectId.getDataStructureType()); - } - } - - /** - * Returns true if this event is for a removed connection - */ - public boolean isConnectionRemove() { - return objectId.getDataStructureType() == ConnectionId.DATA_STRUCTURE_TYPE; - } - - /** - * Returns true if this event is for a removed session - */ - public boolean isSessionRemove() { - return objectId.getDataStructureType() == SessionId.DATA_STRUCTURE_TYPE; - } - - /** - * Returns true if this event is for a removed consumer - */ - public boolean isConsumerRemove() { - return objectId.getDataStructureType() == ConsumerId.DATA_STRUCTURE_TYPE; - } - - /** - * Returns true if this event is for a removed producer - */ - public boolean isProducerRemove() { - return objectId.getDataStructureType() == ProducerId.DATA_STRUCTURE_TYPE; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/RemoveSubscriptionInfo.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/RemoveSubscriptionInfo.class deleted file mode 100644 index 8e890375c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/RemoveSubscriptionInfo.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/RemoveSubscriptionInfo.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/RemoveSubscriptionInfo.java deleted file mode 100644 index d805b788d..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/RemoveSubscriptionInfo.java +++ /dev/null @@ -1,84 +0,0 @@ -/** - * 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.command; - -import org.apache.activemq.state.CommandVisitor; - -/** - * @openwire:marshaller code="9" - * - */ -public class RemoveSubscriptionInfo extends BaseCommand { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.REMOVE_SUBSCRIPTION_INFO; - - protected ConnectionId connectionId; - protected String clientId; - protected String subscriptionName; - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - /** - * @openwire:property version=1 cache=true - */ - public ConnectionId getConnectionId() { - return connectionId; - } - - public void setConnectionId(ConnectionId connectionId) { - this.connectionId = connectionId; - } - - /** - * @openwire:property version=1 - */ - public String getSubcriptionName() { - return subscriptionName; - } - - /** - */ - public void setSubcriptionName(String subscriptionName) { - this.subscriptionName = subscriptionName; - } - - public String getSubscriptionName() { - return subscriptionName; - } - - public void setSubscriptionName(String subscriptionName) { - this.subscriptionName = subscriptionName; - } - - /** - * @openwire:property version=1 - */ - public String getClientId() { - return clientId; - } - - public void setClientId(String clientId) { - this.clientId = clientId; - } - - public Response visit(CommandVisitor visitor) throws Exception { - return visitor.processRemoveSubscription(this); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ReplayCommand.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ReplayCommand.class deleted file mode 100644 index cdcbf3ac3..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ReplayCommand.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ReplayCommand.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ReplayCommand.java deleted file mode 100644 index c5da7bba0..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ReplayCommand.java +++ /dev/null @@ -1,122 +0,0 @@ -/** - * 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.command; - -import org.apache.activemq.state.CommandVisitor; - -/** - * A general purpose replay command for some kind of producer where ranges of - * messages are asked to be replayed. This command is typically used over a - * non-reliable transport such as UDP or multicast but could also be used on - * TCP/IP if a socket has been re-established. - * - * @openwire:marshaller code="65" - * - */ -public class ReplayCommand extends BaseCommand { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.REPLAY; - - private String producerId; - private int firstAckNumber; - private int lastAckNumber; - private int firstNakNumber; - private int lastNakNumber; - - public ReplayCommand() { - } - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - public String getProducerId() { - return producerId; - } - - /** - * Is used to uniquely identify the producer of the sequence - * - * @openwire:property version=1 cache=false - */ - public void setProducerId(String producerId) { - this.producerId = producerId; - } - - public int getFirstAckNumber() { - return firstAckNumber; - } - - /** - * Is used to specify the first sequence number being acknowledged as delivered on the transport - * so that it can be removed from cache - * - * @openwire:property version=1 - */ - public void setFirstAckNumber(int firstSequenceNumber) { - this.firstAckNumber = firstSequenceNumber; - } - - public int getLastAckNumber() { - return lastAckNumber; - } - - /** - * Is used to specify the last sequence number being acknowledged as delivered on the transport - * so that it can be removed from cache - * - * @openwire:property version=1 - */ - public void setLastAckNumber(int lastSequenceNumber) { - this.lastAckNumber = lastSequenceNumber; - } - - public Response visit(CommandVisitor visitor) throws Exception { - return null; - } - - /** - * Is used to specify the first sequence number to be replayed - * - * @openwire:property version=1 - */ - public int getFirstNakNumber() { - return firstNakNumber; - } - - public void setFirstNakNumber(int firstNakNumber) { - this.firstNakNumber = firstNakNumber; - } - - /** - * Is used to specify the last sequence number to be replayed - * - * @openwire:property version=1 - */ - public int getLastNakNumber() { - return lastNakNumber; - } - - public void setLastNakNumber(int lastNakNumber) { - this.lastNakNumber = lastNakNumber; - } - - public String toString() { - return "ReplayCommand {commandId = " + getCommandId() + ", firstNakNumber = " + getFirstNakNumber() + ", lastNakNumber = " + getLastNakNumber() + "}"; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/Response.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/Response.class deleted file mode 100644 index 79abbd6f4..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/Response.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/Response.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/Response.java deleted file mode 100644 index d1ae37edb..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/Response.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * 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.command; - -import org.apache.activemq.state.CommandVisitor; - -/** - * @openwire:marshaller code="30" - * - */ -public class Response extends BaseCommand { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.RESPONSE; - int correlationId; - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - /** - * @openwire:property version=1 - */ - public int getCorrelationId() { - return correlationId; - } - - public void setCorrelationId(int responseId) { - this.correlationId = responseId; - } - - public boolean isResponse() { - return true; - } - - public boolean isException() { - return false; - } - - public Response visit(CommandVisitor visitor) throws Exception { - return null; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/SessionId.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/SessionId.class deleted file mode 100644 index 2d6423a67..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/SessionId.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/SessionId.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/SessionId.java deleted file mode 100644 index afcf0db3e..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/SessionId.java +++ /dev/null @@ -1,119 +0,0 @@ -/** - * 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.command; - -/** - * - * @openwire:marshaller code="121" - * - */ -public class SessionId implements DataStructure { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.SESSION_ID; - - protected String connectionId; - protected long value; - - protected transient int hashCode; - protected transient String key; - protected transient ConnectionId parentId; - - public SessionId() { - } - - public SessionId(ConnectionId connectionId, long sessionId) { - this.connectionId = connectionId.getValue(); - this.value = sessionId; - } - - public SessionId(SessionId id) { - this.connectionId = id.getConnectionId(); - this.value = id.getValue(); - } - - public SessionId(ProducerId id) { - this.connectionId = id.getConnectionId(); - this.value = id.getSessionId(); - } - - public SessionId(ConsumerId id) { - this.connectionId = id.getConnectionId(); - this.value = id.getSessionId(); - } - - public ConnectionId getParentId() { - if (parentId == null) { - parentId = new ConnectionId(this); - } - return parentId; - } - - public int hashCode() { - if (hashCode == 0) { - hashCode = connectionId.hashCode() ^ (int)value; - } - return hashCode; - } - - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || o.getClass() != SessionId.class) { - return false; - } - SessionId id = (SessionId)o; - return value == id.value && connectionId.equals(id.connectionId); - } - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - /** - * @openwire:property version=1 cache=true - */ - public String getConnectionId() { - return connectionId; - } - - public void setConnectionId(String connectionId) { - this.connectionId = connectionId; - } - - /** - * @openwire:property version=1 - */ - public long getValue() { - return value; - } - - public void setValue(long sessionId) { - this.value = sessionId; - } - - public String toString() { - if (key == null) { - key = connectionId + ":" + value; - } - return key; - } - - public boolean isMarshallAware() { - return false; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/SessionInfo.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/SessionInfo.class deleted file mode 100644 index b4addaee0..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/SessionInfo.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/SessionInfo.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/SessionInfo.java deleted file mode 100644 index 2c34f8729..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/SessionInfo.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * 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.command; - -import org.apache.activemq.state.CommandVisitor; - -/** - * - * @openwire:marshaller code="4" - * - */ -public class SessionInfo extends BaseCommand { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.SESSION_INFO; - - protected SessionId sessionId; - - public SessionInfo() { - sessionId = new SessionId(); - } - - public SessionInfo(ConnectionInfo connectionInfo, long sessionId) { - this.sessionId = new SessionId(connectionInfo.getConnectionId(), sessionId); - } - - public SessionInfo(SessionId sessionId) { - this.sessionId = sessionId; - } - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - /** - * @openwire:property version=1 cache=true - */ - public SessionId getSessionId() { - return sessionId; - } - - public void setSessionId(SessionId sessionId) { - this.sessionId = sessionId; - } - - public RemoveInfo createRemoveCommand() { - RemoveInfo command = new RemoveInfo(getSessionId()); - command.setResponseRequired(isResponseRequired()); - return command; - } - - public Response visit(CommandVisitor visitor) throws Exception { - return visitor.processAddSession(this); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ShutdownInfo.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ShutdownInfo.class deleted file mode 100644 index 8ea74bc97..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ShutdownInfo.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ShutdownInfo.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ShutdownInfo.java deleted file mode 100644 index 1a74317c2..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/ShutdownInfo.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * 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.command; - -import org.apache.activemq.state.CommandVisitor; - -/** - * - * @openwire:marshaller code="11" - * - */ -public class ShutdownInfo extends BaseCommand { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.SHUTDOWN_INFO; - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - public Response visit(CommandVisitor visitor) throws Exception { - return visitor.processShutdown(this); - } - - public boolean isShutdownInfo() { - return true; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/SubscriptionInfo.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/SubscriptionInfo.class deleted file mode 100644 index 5e6cc222f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/SubscriptionInfo.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/SubscriptionInfo.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/SubscriptionInfo.java deleted file mode 100644 index 7776b5351..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/SubscriptionInfo.java +++ /dev/null @@ -1,159 +0,0 @@ -/** - * 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.command; - -import org.apache.activemq.util.IntrospectionSupport; - -/** - * Used to represent a durable subscription. - * - * @openwire:marshaller code="55" - * - */ -public class SubscriptionInfo implements DataStructure { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.DURABLE_SUBSCRIPTION_INFO; - - protected ActiveMQDestination subscribedDestination; - protected ActiveMQDestination destination; - protected String clientId; - protected String subscriptionName; - protected String selector; - - public SubscriptionInfo() {} - - public SubscriptionInfo(String clientId, String subscriptionName) { - this.clientId = clientId; - this.subscriptionName = subscriptionName; - } - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - /** - * @openwire:property version=1 - */ - public String getClientId() { - return clientId; - } - - public void setClientId(String clientId) { - this.clientId = clientId; - } - - /** - * This is the a resolved destination that the subscription is receiving - * messages from. This will never be a pattern or a composite destination. - * - * @openwire:property version=1 cache=true - */ - public ActiveMQDestination getDestination() { - return destination; - } - - public void setDestination(ActiveMQDestination destination) { - this.destination = destination; - } - - /** - * @openwire:property version=1 - */ - public String getSelector() { - return selector; - } - - public void setSelector(String selector) { - this.selector = selector; - } - - /** - * @openwire:property version=1 - */ - public String getSubcriptionName() { - return subscriptionName; - } - - /** - * @param subscriptionName * - */ - public void setSubcriptionName(String subscriptionName) { - this.subscriptionName = subscriptionName; - } - - public String getSubscriptionName() { - return subscriptionName; - } - - public void setSubscriptionName(String subscriptionName) { - this.subscriptionName = subscriptionName; - } - - public boolean isMarshallAware() { - return false; - } - - @Override - public String toString() { - return IntrospectionSupport.toString(this); - } - - @Override - public int hashCode() { - int h1 = clientId != null ? clientId.hashCode() : -1; - int h2 = subscriptionName != null ? subscriptionName.hashCode() : -1; - return h1 ^ h2; - } - - @Override - public boolean equals(Object obj) { - boolean result = false; - if (obj instanceof SubscriptionInfo) { - SubscriptionInfo other = (SubscriptionInfo)obj; - result = (clientId == null && other.clientId == null || clientId != null - && other.clientId != null - && clientId.equals(other.clientId)) - && (subscriptionName == null && other.subscriptionName == null || subscriptionName != null - && other.subscriptionName != null - && subscriptionName - .equals(other.subscriptionName)); - } - return result; - } - - /** - * The destination the client originally subscribed to.. This may not match - * the {@see getDestination} method if the subscribed destination uses - * patterns or composites. - * - * If the subscribed destinationis not set, this just ruturns the - * desitination. - * - * @openwire:property version=3 - */ - public ActiveMQDestination getSubscribedDestination() { - if (subscribedDestination == null) { - return getDestination(); - } - return subscribedDestination; - } - - public void setSubscribedDestination(ActiveMQDestination subscribedDestination) { - this.subscribedDestination = subscribedDestination; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/TransactionId.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/TransactionId.class deleted file mode 100644 index 5a712cacc..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/TransactionId.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/TransactionId.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/TransactionId.java deleted file mode 100644 index b9ecc53ab..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/TransactionId.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * 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.command; - -/** - * @openwire:marshaller - * - */ -public abstract class TransactionId implements DataStructure { - - public abstract boolean isXATransaction(); - public abstract boolean isLocalTransaction(); - public abstract String getTransactionKey(); - - public boolean isMarshallAware() { - return false; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/TransactionInfo.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/TransactionInfo.class deleted file mode 100644 index e068baef3..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/TransactionInfo.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/TransactionInfo.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/TransactionInfo.java deleted file mode 100644 index f5b31c3d8..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/TransactionInfo.java +++ /dev/null @@ -1,114 +0,0 @@ -/** - * 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.command; - -import java.io.IOException; - -import org.apache.activemq.state.CommandVisitor; - -/** - * - * @openwire:marshaller code="7" - * - */ -public class TransactionInfo extends BaseCommand { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.TRANSACTION_INFO; - - public static final byte BEGIN = 0; - public static final byte PREPARE = 1; - public static final byte COMMIT_ONE_PHASE = 2; - public static final byte COMMIT_TWO_PHASE = 3; - public static final byte ROLLBACK = 4; - public static final byte RECOVER = 5; - public static final byte FORGET = 6; - public static final byte END = 7; - - protected byte type; - protected ConnectionId connectionId; - protected TransactionId transactionId; - - public TransactionInfo() { - } - - public TransactionInfo(ConnectionId connectionId, TransactionId transactionId, byte type) { - this.connectionId = connectionId; - this.transactionId = transactionId; - this.type = type; - } - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - /** - * @openwire:property version=1 cache=true - */ - public ConnectionId getConnectionId() { - return connectionId; - } - - public void setConnectionId(ConnectionId connectionId) { - this.connectionId = connectionId; - } - - /** - * @openwire:property version=1 cache=true - */ - public TransactionId getTransactionId() { - return transactionId; - } - - public void setTransactionId(TransactionId transactionId) { - this.transactionId = transactionId; - } - - /** - * @openwire:property version=1 - */ - public byte getType() { - return type; - } - - public void setType(byte type) { - this.type = type; - } - - public Response visit(CommandVisitor visitor) throws Exception { - switch (type) { - case TransactionInfo.BEGIN: - return visitor.processBeginTransaction(this); - case TransactionInfo.END: - return visitor.processEndTransaction(this); - case TransactionInfo.PREPARE: - return visitor.processPrepareTransaction(this); - case TransactionInfo.COMMIT_ONE_PHASE: - return visitor.processCommitTransactionOnePhase(this); - case TransactionInfo.COMMIT_TWO_PHASE: - return visitor.processCommitTransactionTwoPhase(this); - case TransactionInfo.ROLLBACK: - return visitor.processRollbackTransaction(this); - case TransactionInfo.RECOVER: - return visitor.processRecoverTransactions(this); - case TransactionInfo.FORGET: - return visitor.processForgetTransaction(this); - default: - throw new IOException("Transaction info type unknown: " + type); - } - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/UnresolvedDestinationTransformer.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/UnresolvedDestinationTransformer.class deleted file mode 100644 index 5dc18bb6c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/UnresolvedDestinationTransformer.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/UnresolvedDestinationTransformer.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/UnresolvedDestinationTransformer.java deleted file mode 100644 index 8f3f16e4d..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/UnresolvedDestinationTransformer.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * 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.command; - -import javax.jms.Destination; -import javax.jms.JMSException; - -public interface UnresolvedDestinationTransformer { - - public ActiveMQDestination transform(Destination dest) throws JMSException; - public ActiveMQDestination transform(String dest) throws JMSException; -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/WireFormatInfo.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/WireFormatInfo.class deleted file mode 100644 index 7052cf934..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/WireFormatInfo.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/WireFormatInfo.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/WireFormatInfo.java deleted file mode 100644 index 8084660e4..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/WireFormatInfo.java +++ /dev/null @@ -1,380 +0,0 @@ -/** - * 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.command; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import org.apache.activemq.state.CommandVisitor; -import org.apache.activemq.util.ByteArrayInputStream; -import org.apache.activemq.util.ByteArrayOutputStream; -import org.apache.activemq.util.ByteSequence; -import org.apache.activemq.util.MarshallingSupport; -import org.apache.activemq.wireformat.WireFormat; - -/** - * @openwire:marshaller code="1" - * - */ -public class WireFormatInfo implements Command, MarshallAware { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.WIREFORMAT_INFO; - private static final int MAX_PROPERTY_SIZE = 1024 * 4; - private static final byte MAGIC[] = new byte[] {'A', 'c', 't', 'i', 'v', 'e', 'M', 'Q'}; - - protected byte magic[] = MAGIC; - protected int version; - protected ByteSequence marshalledProperties; - - protected transient Map properties; - private transient Endpoint from; - private transient Endpoint to; - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - public boolean isWireFormatInfo() { - return true; - } - - public boolean isMarshallAware() { - return true; - } - - /** - * @openwire:property version=1 size=8 testSize=-1 - */ - public byte[] getMagic() { - return magic; - } - - public void setMagic(byte[] magic) { - this.magic = magic; - } - - /** - * @openwire:property version=1 - */ - public int getVersion() { - return version; - } - - public void setVersion(int version) { - this.version = version; - } - - /** - * @openwire:property version=1 - */ - public ByteSequence getMarshalledProperties() { - return marshalledProperties; - } - - public void setMarshalledProperties(ByteSequence marshalledProperties) { - this.marshalledProperties = marshalledProperties; - } - - /** - * The endpoint within the transport where this message came from. - */ - public Endpoint getFrom() { - return from; - } - - public void setFrom(Endpoint from) { - this.from = from; - } - - /** - * The endpoint within the transport where this message is going to - null - * means all endpoints. - */ - public Endpoint getTo() { - return to; - } - - public void setTo(Endpoint to) { - this.to = to; - } - - // //////////////////// - // - // Implementation Methods. - // - // //////////////////// - - public Object getProperty(String name) throws IOException { - if (properties == null) { - if (marshalledProperties == null) { - return null; - } - properties = unmarsallProperties(marshalledProperties); - } - return properties.get(name); - } - - @SuppressWarnings("unchecked") - public Map getProperties() throws IOException { - if (properties == null) { - if (marshalledProperties == null) { - return Collections.EMPTY_MAP; - } - properties = unmarsallProperties(marshalledProperties); - } - return Collections.unmodifiableMap(properties); - } - - public void clearProperties() { - marshalledProperties = null; - properties = null; - } - - public void setProperty(String name, Object value) throws IOException { - lazyCreateProperties(); - properties.put(name, value); - } - - protected void lazyCreateProperties() throws IOException { - if (properties == null) { - if (marshalledProperties == null) { - properties = new HashMap(); - } else { - properties = unmarsallProperties(marshalledProperties); - marshalledProperties = null; - } - } - } - - private Map unmarsallProperties(ByteSequence marshalledProperties) throws IOException { - return MarshallingSupport.unmarshalPrimitiveMap(new DataInputStream(new ByteArrayInputStream(marshalledProperties)), MAX_PROPERTY_SIZE); - } - - public void beforeMarshall(WireFormat wireFormat) throws IOException { - // Need to marshal the properties. - if (marshalledProperties == null && properties != null) { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - DataOutputStream os = new DataOutputStream(baos); - MarshallingSupport.marshalPrimitiveMap(properties, os); - os.close(); - marshalledProperties = baos.toByteSequence(); - } - } - - public void afterMarshall(WireFormat wireFormat) throws IOException { - } - - public void beforeUnmarshall(WireFormat wireFormat) throws IOException { - } - - public void afterUnmarshall(WireFormat wireFormat) throws IOException { - } - - public boolean isValid() { - return magic != null && Arrays.equals(magic, MAGIC); - } - - public void setResponseRequired(boolean responseRequired) { - } - - /** - * @throws IOException - */ - public boolean isCacheEnabled() throws IOException { - return Boolean.TRUE == getProperty("CacheEnabled"); - } - - public void setCacheEnabled(boolean cacheEnabled) throws IOException { - setProperty("CacheEnabled", cacheEnabled ? Boolean.TRUE : Boolean.FALSE); - } - - /** - * @throws IOException - */ - public boolean isStackTraceEnabled() throws IOException { - return Boolean.TRUE == getProperty("StackTraceEnabled"); - } - - public void setStackTraceEnabled(boolean stackTraceEnabled) throws IOException { - setProperty("StackTraceEnabled", stackTraceEnabled ? Boolean.TRUE : Boolean.FALSE); - } - - /** - * @throws IOException - */ - public boolean isTcpNoDelayEnabled() throws IOException { - return Boolean.TRUE == getProperty("TcpNoDelayEnabled"); - } - - public void setTcpNoDelayEnabled(boolean tcpNoDelayEnabled) throws IOException { - setProperty("TcpNoDelayEnabled", tcpNoDelayEnabled ? Boolean.TRUE : Boolean.FALSE); - } - - /** - * @throws IOException - */ - public boolean isSizePrefixDisabled() throws IOException { - return Boolean.TRUE == getProperty("SizePrefixDisabled"); - } - - public void setSizePrefixDisabled(boolean prefixPacketSize) throws IOException { - setProperty("SizePrefixDisabled", prefixPacketSize ? Boolean.TRUE : Boolean.FALSE); - } - - /** - * @throws IOException - */ - public boolean isTightEncodingEnabled() throws IOException { - return Boolean.TRUE == getProperty("TightEncodingEnabled"); - } - - public void setTightEncodingEnabled(boolean tightEncodingEnabled) throws IOException { - setProperty("TightEncodingEnabled", tightEncodingEnabled ? Boolean.TRUE : Boolean.FALSE); - } - - /** - * @throws IOException - */ - public long getMaxInactivityDuration() throws IOException { - Long l = (Long)getProperty("MaxInactivityDuration"); - return l == null ? 0 : l.longValue(); - } - - public void setMaxInactivityDuration(long maxInactivityDuration) throws IOException { - setProperty("MaxInactivityDuration", new Long(maxInactivityDuration)); - } - - public long getMaxInactivityDurationInitalDelay() throws IOException { - Long l = (Long)getProperty("MaxInactivityDurationInitalDelay"); - return l == null ? 0 : l.longValue(); - } - - public void setMaxInactivityDurationInitalDelay(long maxInactivityDurationInitalDelay) throws IOException { - setProperty("MaxInactivityDurationInitalDelay", new Long(maxInactivityDurationInitalDelay)); - } - - public long getMaxFrameSize() throws IOException { - Long l = (Long)getProperty("MaxFrameSize"); - return l == null ? 0 : l.longValue(); - } - - public void setMaxFrameSize(long maxFrameSize) throws IOException { - setProperty("MaxFrameSize", new Long(maxFrameSize)); - } - - - - /** - * @throws IOException - */ - public int getCacheSize() throws IOException { - Integer i = (Integer)getProperty("CacheSize"); - return i == null ? 0 : i.intValue(); - } - - public void setCacheSize(int cacheSize) throws IOException { - setProperty("CacheSize", new Integer(cacheSize)); - } - - public Response visit(CommandVisitor visitor) throws Exception { - return visitor.processWireFormat(this); - } - - @Override - public String toString() { - Map p = null; - try { - p = getProperties(); - } catch (IOException ignore) { - } - return "WireFormatInfo { version=" + version + ", properties=" + p + ", magic=" + toString(magic) + "}"; - } - - private String toString(byte[] data) { - StringBuffer sb = new StringBuffer(); - sb.append('['); - for (int i = 0; i < data.length; i++) { - if (i != 0) { - sb.append(','); - } - sb.append((char)data[i]); - } - sb.append(']'); - return sb.toString(); - } - - // ///////////////////////////////////////////////////////////// - // - // This are not implemented. - // - // ///////////////////////////////////////////////////////////// - - public void setCommandId(int value) { - } - - public int getCommandId() { - return 0; - } - - public boolean isResponseRequired() { - return false; - } - - public boolean isResponse() { - return false; - } - - public boolean isBrokerInfo() { - return false; - } - - public boolean isMessageDispatch() { - return false; - } - - public boolean isMessage() { - return false; - } - - public boolean isMessageAck() { - return false; - } - - public boolean isMessageDispatchNotification() { - return false; - } - - public boolean isShutdownInfo() { - return false; - } - - public boolean isConnectionControl() { - return false; - } - - public void setCachedMarshalledForm(WireFormat wireFormat, ByteSequence data) { - } - - public ByteSequence getCachedMarshalledForm(WireFormat wireFormat) { - return null; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/XATransactionId.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/XATransactionId.class deleted file mode 100644 index 43fda2686..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/XATransactionId.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/XATransactionId.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/XATransactionId.java deleted file mode 100644 index e963c8725..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/XATransactionId.java +++ /dev/null @@ -1,210 +0,0 @@ -/** - * 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.command; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import javax.transaction.xa.Xid; -import org.apache.activemq.util.DataByteArrayInputStream; -import org.apache.activemq.util.DataByteArrayOutputStream; - -/** - * @openwire:marshaller code="112" - * - */ -public class XATransactionId extends TransactionId implements Xid, Comparable { - - public static final byte DATA_STRUCTURE_TYPE = CommandTypes.ACTIVEMQ_XA_TRANSACTION_ID; - - private int formatId; - private byte[] branchQualifier; - private byte[] globalTransactionId; - private transient DataByteArrayOutputStream outputStream; - private transient byte[] encodedXidBytes; - - private transient int hash; - private transient String transactionKey; - private transient ArrayList preparedAcks; - - public XATransactionId() { - } - - public XATransactionId(Xid xid) { - this.formatId = xid.getFormatId(); - this.globalTransactionId = xid.getGlobalTransactionId(); - this.branchQualifier = xid.getBranchQualifier(); - } - - public XATransactionId(byte[] encodedBytes) { - encodedXidBytes = encodedBytes; - initFromEncodedBytes(); - } - - public byte getDataStructureType() { - return DATA_STRUCTURE_TYPE; - } - - final int XID_PREFIX_SIZE = 16; - //+|-,(long)lastAck,(byte)priority,(int)formatid,(short)globalLength.... - private void initFromEncodedBytes() { - DataByteArrayInputStream inputStream = new DataByteArrayInputStream(encodedXidBytes); - inputStream.skipBytes(10); - formatId = inputStream.readInt(); - int globalLength = inputStream.readShort(); - globalTransactionId = new byte[globalLength]; - try { - inputStream.read(globalTransactionId); - branchQualifier = new byte[inputStream.available()]; - inputStream.read(branchQualifier); - } catch (IOException fatal) { - throw new RuntimeException(this + ", failed to decode:", fatal); - } - } - - public synchronized byte[] getEncodedXidBytes() { - if (encodedXidBytes == null) { - outputStream = new DataByteArrayOutputStream(XID_PREFIX_SIZE + globalTransactionId.length + branchQualifier.length); - outputStream.position(10); - outputStream.writeInt(formatId); - // global length - outputStream.writeShort(globalTransactionId.length); - try { - outputStream.write(globalTransactionId); - outputStream.write(branchQualifier); - } catch (IOException fatal) { - throw new RuntimeException(this + ", failed to encode:", fatal); - } - encodedXidBytes = outputStream.getData(); - } - return encodedXidBytes; - } - - public DataByteArrayOutputStream internalOutputStream() { - return outputStream; - } - - public synchronized String getTransactionKey() { - if (transactionKey == null) { - StringBuffer s = new StringBuffer(); - s.append("XID:[" + formatId + ",globalId="); - for (int i = 0; i < globalTransactionId.length; i++) { - s.append(Integer.toHexString(globalTransactionId[i])); - } - s.append(",branchId="); - for (int i = 0; i < branchQualifier.length; i++) { - s.append(Integer.toHexString(branchQualifier[i])); - } - s.append("]"); - transactionKey = s.toString(); - } - return transactionKey; - } - - public String toString() { - return getTransactionKey(); - } - - public boolean isXATransaction() { - return true; - } - - public boolean isLocalTransaction() { - return false; - } - - /** - * @openwire:property version=1 - */ - public int getFormatId() { - return formatId; - } - - /** - * @openwire:property version=1 - */ - public byte[] getGlobalTransactionId() { - return globalTransactionId; - } - - /** - * @openwire:property version=1 - */ - public byte[] getBranchQualifier() { - return branchQualifier; - } - - public void setBranchQualifier(byte[] branchQualifier) { - this.branchQualifier = branchQualifier; - this.hash = 0; - } - - public void setFormatId(int formatId) { - this.formatId = formatId; - this.hash = 0; - } - - public void setGlobalTransactionId(byte[] globalTransactionId) { - this.globalTransactionId = globalTransactionId; - this.hash = 0; - } - - public int hashCode() { - if (hash == 0) { - hash = formatId; - hash = hash(globalTransactionId, hash); - hash = hash(branchQualifier, hash); - if (hash == 0) { - hash = 0xaceace; - } - } - return hash; - } - - private static int hash(byte[] bytes, int hash) { - int size = bytes.length; - for (int i = 0; i < size; i++) { - hash ^= bytes[i] << ((i % 4) * 8); - } - return hash; - } - - public boolean equals(Object o) { - if (o == null || o.getClass() != XATransactionId.class) { - return false; - } - XATransactionId xid = (XATransactionId)o; - return xid.formatId == formatId && Arrays.equals(xid.globalTransactionId, globalTransactionId) - && Arrays.equals(xid.branchQualifier, branchQualifier); - } - - public int compareTo(Object o) { - if (o == null || o.getClass() != XATransactionId.class) { - return -1; - } - XATransactionId xid = (XATransactionId)o; - return getTransactionKey().compareTo(xid.getTransactionKey()); - } - - public void setPreparedAcks(ArrayList preparedAcks) { - this.preparedAcks = preparedAcks; - } - - public ArrayList getPreparedAcks() { - return preparedAcks; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/package.html b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/package.html deleted file mode 100644 index 3b806fcf0..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/command/package.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - -

    -Command objects used via the Command Pattern to communicate among nodes -

    - - - diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/ActiveMQLauncher.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/ActiveMQLauncher.class deleted file mode 100644 index ab80627d3..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/ActiveMQLauncher.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/ActiveMQLauncher.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/ActiveMQLauncher.java deleted file mode 100644 index 0af0dda06..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/ActiveMQLauncher.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * 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.console; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.apache.activemq.console.command.Command; -import org.apache.activemq.console.command.ShutdownCommand; -import org.apache.activemq.console.command.StartCommand; -import org.apache.activemq.console.CommandContext; -import org.apache.activemq.console.formatter.CommandShellOutputFormatter; -import org.apache.commons.daemon.Daemon; -import org.apache.commons.daemon.DaemonContext; - -/** - * This class launches ActiveMQ under Apache JSVC - * - * @author areese - * - */ -public class ActiveMQLauncher implements Daemon { - private List args; - - /** - * - */ - public ActiveMQLauncher() { - } - - /* - * (non-Javadoc) - * - * @see org.apache.commons.daemon.Daemon#destroy() - */ - public void destroy() { - } - - /* - * (non-Javadoc) - * - * @see - * org.apache.commons.daemon.Daemon#init(org.apache.commons.daemon.DaemonContext - * ) - */ - public void init(DaemonContext arg0) throws Exception { - // we need to save the args we started with. - args = Arrays.asList(arg0.getArguments()); - } - - /* - * (non-Javadoc) - * - * @see org.apache.commons.daemon.Daemon#start() - */ - public void start() throws Exception { - CommandContext context = new CommandContext(); - context.setFormatter(new CommandShellOutputFormatter(System.out)); - - Command command = new StartCommand(); - command.setCommandContext(context); - - command.execute(args); - } - - /* - * (non-Javadoc) - * - * @see org.apache.commons.daemon.Daemon#stop() - */ - public void stop() throws Exception { - CommandContext context = new CommandContext(); - context.setFormatter(new CommandShellOutputFormatter(System.out)); - - Command command = new ShutdownCommand(); - command.setCommandContext(context); - - List tokens = new ArrayList(Arrays.asList(new String[] { - "--jmxlocal", "--all", })); - - command.execute(tokens); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/CommandContext.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/CommandContext.class deleted file mode 100644 index e54e4989e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/CommandContext.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/CommandContext.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/CommandContext.java deleted file mode 100644 index 02cbb647c..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/CommandContext.java +++ /dev/null @@ -1,250 +0,0 @@ -/** - * 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.console; - -import java.io.OutputStream; -import java.util.Collection; -import java.util.Map; - -import javax.jms.Message; -import javax.management.AttributeList; -import javax.management.ObjectInstance; -import javax.management.ObjectName; - -import org.apache.activemq.console.formatter.OutputFormatter; - -public final class CommandContext { - private OutputFormatter formatter; - - /** - * Retrieve the output stream being used by the global formatter - * - * @return formatter's output stream - */ - public OutputStream getOutputStream() { - if (formatter == null) { - throw new IllegalStateException("No OutputFormatter specified. Use GlobalWriter.instantiate(OutputFormatter)."); - } - return formatter.getOutputStream(); - } - - /** - * Print an ObjectInstance format of an mbean - * - * @param mbean - mbean to print - */ - public void printMBean(ObjectInstance mbean) { - if (formatter == null) { - throw new IllegalStateException("No OutputFormatter specified. Use GlobalWriter.instantiate(OutputFormatter)."); - } - formatter.printMBean(mbean); - } - - /** - * Print an ObjectName format of an mbean - * - * @param mbean - mbean to print - */ - public void printMBean(ObjectName mbean) { - if (formatter == null) { - throw new IllegalStateException("No OutputFormatter specified. Use GlobalWriter.instantiate(OutputFormatter)."); - } - formatter.printMBean(mbean); - } - - /** - * Print an AttributeList format of an mbean - * - * @param mbean - mbean to print - */ - public void printMBean(AttributeList mbean) { - if (formatter == null) { - throw new IllegalStateException("No OutputFormatter specified. Use GlobalWriter.instantiate(OutputFormatter)."); - } - formatter.printMBean(mbean); - } - - /** - * Print a Map format of an mbean - * - * @param mbean - */ - @SuppressWarnings("rawtypes") - public void printMBean(Map mbean) { - if (formatter == null) { - throw new IllegalStateException("No OutputFormatter specified. Use GlobalWriter.instantiate(OutputFormatter)."); - } - formatter.printMBean(mbean); - } - - /** - * Print a Collection format of mbeans - * - * @param mbean - collection of mbeans - */ - @SuppressWarnings("rawtypes") - public void printMBean(Collection mbean) { - if (formatter == null) { - throw new IllegalStateException("No OutputFormatter specified. Use GlobalWriter.instantiate(OutputFormatter)."); - } - formatter.printMBean(mbean); - } - - /** - * Print a Map format of a JMS message - * - * @param msg - */ - @SuppressWarnings("rawtypes") - public void printMessage(Map msg) { - if (formatter == null) { - throw new IllegalStateException("No OutputFormatter specified. Use GlobalWriter.instantiate(OutputFormatter)."); - } - formatter.printMessage(msg); - } - - /** - * Print a Message format of a JMS message - * - * @param msg - JMS message to print - */ - public void printMessage(Message msg) { - if (formatter == null) { - throw new IllegalStateException("No OutputFormatter specified. Use GlobalWriter.instantiate(OutputFormatter)."); - } - formatter.printMessage(msg); - } - - /** - * Print a collection of JMS messages - * - * @param msg - collection of JMS messages - */ - @SuppressWarnings("rawtypes") - public void printMessage(Collection msg) { - if (formatter == null) { - throw new IllegalStateException("No OutputFormatter specified. Use GlobalWriter.instantiate(OutputFormatter)."); - } - formatter.printMessage(msg); - } - - /** - * Print help messages - * - * @param helpMsgs - help messages to print - */ - public void printHelp(String[] helpMsgs) { - if (formatter == null) { - throw new IllegalStateException("No OutputFormatter specified. Use GlobalWriter.instantiate(OutputFormatter)."); - } - formatter.printHelp(helpMsgs); - } - - /** - * Print an information message - * - * @param info - information message to print - */ - public void printInfo(String info) { - if (formatter == null) { - throw new IllegalStateException("No OutputFormatter specified. Use GlobalWriter.instantiate(OutputFormatter)."); - } - formatter.printInfo(info); - } - - /** - * Print an exception message - * - * @param e - exception to print - */ - public void printException(Exception e) { - if (formatter == null) { - throw new IllegalStateException("No OutputFormatter specified. Use GlobalWriter.instantiate(OutputFormatter)."); - } - formatter.printException(e); - } - - /** - * Print a version information - * - * @param version - version info to print - */ - public void printVersion(String version) { - if (formatter == null) { - throw new IllegalStateException("No OutputFormatter specified. Use GlobalWriter.instantiate(OutputFormatter)."); - } - formatter.printVersion(version); - } - - /** - * Print a generic key value mapping - * - * @param map to print - */ - @SuppressWarnings("rawtypes") - public void print(Map map) { - if (formatter == null) { - throw new IllegalStateException("No OutputFormatter specified. Use GlobalWriter.instantiate(OutputFormatter)."); - } - formatter.print(map); - } - - /** - * Print a generic array of strings - * - * @param strings - string array to print - */ - public void print(String[] strings) { - if (formatter == null) { - throw new IllegalStateException("No OutputFormatter specified. Use GlobalWriter.instantiate(OutputFormatter)."); - } - formatter.print(strings); - } - - /** - * Print a collection of objects - * - * @param collection - collection to print - */ - @SuppressWarnings("rawtypes") - public void print(Collection collection) { - if (formatter == null) { - throw new IllegalStateException("No OutputFormatter specified. Use GlobalWriter.instantiate(OutputFormatter)."); - } - formatter.print(collection); - } - - /** - * Print a java string - * - * @param string - string to print - */ - public void print(String string) { - if (formatter == null) { - throw new IllegalStateException("No OutputFormatter specified. Use GlobalWriter.instantiate(OutputFormatter)."); - } - formatter.print(string); - } - - public OutputFormatter getFormatter() { - return formatter; - } - - public void setFormatter(OutputFormatter formatter) { - this.formatter = formatter; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/Main$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/Main$1.class deleted file mode 100644 index ca3c5bf63..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/Main$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/Main.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/Main.class deleted file mode 100644 index eaa4dc821..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/Main.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/Main.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/Main.java deleted file mode 100644 index 7923b1405..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/Main.java +++ /dev/null @@ -1,429 +0,0 @@ -/** - * 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.console; - -import java.io.File; -import java.io.InputStream; -import java.io.PrintStream; -import java.lang.management.ManagementFactory; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.JarURLConnection; -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URL; -import java.net.URLClassLoader; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Comparator; -import java.util.Iterator; -import java.util.LinkedHashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Set; -import java.util.StringTokenizer; - -/** - * Main class that can bootstrap an ActiveMQ broker console. Handles command - * line argument parsing to set up and run broker tasks. - */ -public class Main { - - public static final String TASK_DEFAULT_CLASS = "org.apache.activemq.console.command.ShellCommand"; - private static boolean useDefExt = true; - - private File activeMQHome; - private File activeMQBase; - private ClassLoader classLoader; - private final Set extensions = new LinkedHashSet(); - private final Set activeMQClassPath = new LinkedHashSet(); - - public static void main(String[] args) { - - // Create the tmpdir if it does not exist yet.. - File tmpdir = new File(System.getProperty("java.io.tmpdir")); - if(!tmpdir.exists()) { - tmpdir.mkdirs(); - } - - Main app = new Main(); - - // Convert arguments to collection for easier management - List tokens = new LinkedList(Arrays.asList(args)); - // Parse for extension directory option - app.parseExtensions(tokens); - - // lets add the conf directory first, to find the log4j.properties just in case its not - // in the activemq.classpath system property or some jar incorrectly includes one - File confDir = app.getActiveMQConfig(); - app.addClassPath(confDir); - - // Add the following to the classpath: - // - // ${activemq.base}/conf - // ${activemq.base}/lib/* (only if activemq.base != activemq.home) - // ${activemq.home}/lib/* - // ${activemq.base}/lib/optional/* (only if activemq.base != - // activemq.home) - // ${activemq.home}/lib/optional/* - // ${activemq.base}/lib/web/* (only if activemq.base != activemq.home) - // ${activemq.home}/lib/web/* - // - if (useDefExt && app.canUseExtdir()) { - - boolean baseIsHome = app.getActiveMQBase().equals(app.getActiveMQHome()); - - File baseLibDir = new File(app.getActiveMQBase(), "lib"); - File homeLibDir = new File(app.getActiveMQHome(), "lib"); - - if (!baseIsHome) { - app.addExtensionDirectory(baseLibDir); - } - app.addExtensionDirectory(homeLibDir); - - if (!baseIsHome) { - app.addExtensionDirectory(new File(baseLibDir, "camel")); - app.addExtensionDirectory(new File(baseLibDir, "optional")); - app.addExtensionDirectory(new File(baseLibDir, "web")); - app.addExtensionDirectory(new File(baseLibDir, "extra")); - } - app.addExtensionDirectory(new File(homeLibDir, "camel")); - app.addExtensionDirectory(new File(homeLibDir, "optional")); - app.addExtensionDirectory(new File(homeLibDir, "web")); - app.addExtensionDirectory(new File(homeLibDir, "extra")); - } - - // Add any custom classpath specified from the system property - // activemq.classpath - app.addClassPathList(System.getProperty("activemq.classpath")); - - try { - app.runTaskClass(tokens); - System.exit(0); - } catch (ClassNotFoundException e) { - System.out.println("Could not load class: " + e.getMessage()); - try { - ClassLoader cl = app.getClassLoader(); - if (cl != null) { - System.out.println("Class loader setup: "); - printClassLoaderTree(cl); - } - } catch (MalformedURLException e1) { - } - System.exit(1); - } catch (Throwable e) { - System.out.println("Failed to execute main task. Reason: " + e); - System.exit(1); - } - } - - /** - * Print out what's in the classloader tree being used. - * - * @param cl - * @return depth - */ - private static int printClassLoaderTree(ClassLoader cl) { - int depth = 0; - if (cl.getParent() != null) { - depth = printClassLoaderTree(cl.getParent()) + 1; - } - - StringBuffer indent = new StringBuffer(); - for (int i = 0; i < depth; i++) { - indent.append(" "); - } - - if (cl instanceof URLClassLoader) { - URLClassLoader ucl = (URLClassLoader)cl; - System.out.println(indent + cl.getClass().getName() + " {"); - URL[] urls = ucl.getURLs(); - for (int i = 0; i < urls.length; i++) { - System.out.println(indent + " " + urls[i]); - } - System.out.println(indent + "}"); - } else { - System.out.println(indent + cl.getClass().getName()); - } - return depth; - } - - public void parseExtensions(List tokens) { - if (tokens.isEmpty()) { - return; - } - - int count = tokens.size(); - int i = 0; - - // Parse for all --extdir and --noDefExt options - while (i < count) { - String token = tokens.get(i); - // If token is an extension dir option - if (token.equals("--extdir")) { - // Process token - count--; - tokens.remove(i); - - // If no extension directory is specified, or next token is - // another option - if (i >= count || tokens.get(i).startsWith("-")) { - System.out.println("Extension directory not specified."); - System.out.println("Ignoring extension directory option."); - continue; - } - - // Process extension dir token - count--; - File extDir = new File(tokens.remove(i)); - - if (!canUseExtdir()) { - System.out.println("Extension directory feature not available due to the system classpath being able to load: " + TASK_DEFAULT_CLASS); - System.out.println("Ignoring extension directory option."); - continue; - } - - if (!extDir.isDirectory()) { - System.out.println("Extension directory specified is not valid directory: " + extDir); - System.out.println("Ignoring extension directory option."); - continue; - } - - addExtensionDirectory(extDir); - } else if (token.equals("--noDefExt")) { // If token is - // --noDefExt option - count--; - tokens.remove(i); - useDefExt = false; - } else { - i++; - } - } - - } - - public void runTaskClass(List tokens) throws Throwable { - - StringBuilder buffer = new StringBuilder(); - buffer.append(System.getProperty("java.vendor")); - buffer.append(" "); - buffer.append(System.getProperty("java.version")); - buffer.append(" "); - buffer.append(System.getProperty("java.home")); - System.out.println("Java Runtime: " + buffer.toString()); - - buffer = new StringBuilder(); - buffer.append("current="); - buffer.append(Runtime.getRuntime().totalMemory()/1024L); - buffer.append("k free="); - buffer.append(Runtime.getRuntime().freeMemory()/1024L); - buffer.append("k max="); - buffer.append(Runtime.getRuntime().maxMemory()/1024L); - buffer.append("k"); - System.out.println(" Heap sizes: " + buffer.toString()); - - List jvmArgs = ManagementFactory.getRuntimeMXBean().getInputArguments(); - buffer = new StringBuilder(); - for (Object arg : jvmArgs) { - buffer.append(" ").append(arg); - } - System.out.println(" JVM args:" + buffer.toString()); - System.out.println("Extensions classpath:\n " + getExtensionDirForLogging()); - - System.out.println("ACTIVEMQ_HOME: " + getActiveMQHome()); - System.out.println("ACTIVEMQ_BASE: " + getActiveMQBase()); - System.out.println("ACTIVEMQ_CONF: " + getActiveMQConfig()); - System.out.println("ACTIVEMQ_DATA: " + getActiveMQDataDir()); - - ClassLoader cl = getClassLoader(); - Thread.currentThread().setContextClassLoader(cl); - - // Use reflection to run the task. - try { - String[] args = tokens.toArray(new String[tokens.size()]); - Class task = cl.loadClass(TASK_DEFAULT_CLASS); - Method runTask = task.getMethod("main", new Class[] { - String[].class, InputStream.class, PrintStream.class - }); - runTask.invoke(task.newInstance(), args, System.in, System.out); - } catch (InvocationTargetException e) { - throw e.getCause(); - } - } - - public void addExtensionDirectory(File directory) { - extensions.add(directory); - } - - public void addClassPathList(String fileList) { - if (fileList != null && fileList.length() > 0) { - StringTokenizer tokenizer = new StringTokenizer(fileList, ";"); - while (tokenizer.hasMoreTokens()) { - addClassPath(new File(tokenizer.nextToken())); - } - } - } - - public void addClassPath(File classpath) { - activeMQClassPath.add(classpath); - } - - /** - * The extension directory feature will not work if the broker factory is - * already in the classpath since we have to load him from a child - * ClassLoader we build for it to work correctly. - * - * @return true, if extension dir can be used. false otherwise. - */ - public boolean canUseExtdir() { - try { - Main.class.getClassLoader().loadClass(TASK_DEFAULT_CLASS); - return false; - } catch (ClassNotFoundException e) { - return true; - } - } - - public ClassLoader getClassLoader() throws MalformedURLException { - if (classLoader == null) { - // Setup the ClassLoader - classLoader = Main.class.getClassLoader(); - if (!extensions.isEmpty() || !activeMQClassPath.isEmpty()) { - - ArrayList urls = new ArrayList(); - - for (Iterator iter = activeMQClassPath.iterator(); iter.hasNext();) { - File dir = iter.next(); - urls.add(dir.toURI().toURL()); - } - - for (Iterator iter = extensions.iterator(); iter.hasNext();) { - File dir = iter.next(); - if (dir.isDirectory()) { - File[] files = dir.listFiles(); - if (files != null) { - - // Sort the jars so that classpath built is consistently in the same - // order. Also allows us to use jar names to control classpath order. - Arrays.sort(files, new Comparator() { - public int compare(File f1, File f2) { - return f1.getName().compareTo(f2.getName()); - } - }); - - for (int j = 0; j < files.length; j++) { - if (files[j].getName().endsWith(".zip") || files[j].getName().endsWith(".jar")) { - urls.add(files[j].toURI().toURL()); - } - } - } - } - } - - URL u[] = new URL[urls.size()]; - urls.toArray(u); - classLoader = new URLClassLoader(u, classLoader); - } - Thread.currentThread().setContextClassLoader(classLoader); - } - return classLoader; - } - - public void setActiveMQHome(File activeMQHome) { - this.activeMQHome = activeMQHome; - } - - public File getActiveMQHome() { - if (activeMQHome == null) { - if (System.getProperty("activemq.home") != null) { - activeMQHome = new File(System.getProperty("activemq.home")); - } - - if (activeMQHome == null) { - // guess from the location of the jar - URL url = Main.class.getClassLoader().getResource("org/apache/activemq/console/Main.class"); - if (url != null) { - try { - JarURLConnection jarConnection = (JarURLConnection)url.openConnection(); - url = jarConnection.getJarFileURL(); - URI baseURI = new URI(url.toString()).resolve(".."); - activeMQHome = new File(baseURI).getCanonicalFile(); - System.setProperty("activemq.home", activeMQHome.getAbsolutePath()); - } catch (Exception ignored) { - } - } - } - - if (activeMQHome == null) { - activeMQHome = new File("../."); - System.setProperty("activemq.home", activeMQHome.getAbsolutePath()); - } - } - - return activeMQHome; - } - - public File getActiveMQBase() { - if (activeMQBase == null) { - if (System.getProperty("activemq.base") != null) { - activeMQBase = new File(System.getProperty("activemq.base")); - } - - if (activeMQBase == null) { - activeMQBase = getActiveMQHome(); - System.setProperty("activemq.base", activeMQBase.getAbsolutePath()); - } - } - - return activeMQBase; - } - - public File getActiveMQConfig() { - File activeMQConfig = null; - - if (System.getProperty("activemq.conf") != null) { - activeMQConfig = new File(System.getProperty("activemq.conf")); - } else { - activeMQConfig = new File(getActiveMQBase() + "/conf"); - } - return activeMQConfig; - } - - public File getActiveMQDataDir() { - File activeMQDataDir = null; - - if (System.getProperty("activemq.data") != null) { - activeMQDataDir = new File(System.getProperty("activemq.data")); - } else { - activeMQDataDir = new File(getActiveMQBase() + "/data"); - } - return activeMQDataDir; - } - - public String getExtensionDirForLogging() { - StringBuilder sb = new StringBuilder("["); - for (Iterator it = extensions.iterator(); it.hasNext();) { - File file = it.next(); - sb.append(file.getPath()); - if (it.hasNext()) { - sb.append(","); - } - } - sb.append("]"); - return sb.toString(); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/AbstractAmqCommand.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/AbstractAmqCommand.class deleted file mode 100644 index e65158ea2..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/AbstractAmqCommand.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/AbstractAmqCommand.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/AbstractAmqCommand.java deleted file mode 100644 index 42d055204..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/AbstractAmqCommand.java +++ /dev/null @@ -1,273 +0,0 @@ -/** - * 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.console.command; - -import java.net.URI; -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import javax.jms.Connection; -import javax.jms.ConnectionFactory; -import javax.jms.JMSException; - -import org.apache.activemq.ActiveMQConnectionFactory; - -public abstract class AbstractAmqCommand extends AbstractCommand { - private URI brokerUrl; - private ConnectionFactory factory; - private String factoryClassString; - private String username; - private String password; - private PasswordFactory passwordFactory; - private final List connections = new ArrayList(); - private String passwordFactoryClassString; - - /** - * Establishes a connection to the remote broker specified by the broker - * url. - * - * @return - connection to the broker - * @throws JMSException - */ - protected Connection createConnection() throws JMSException { - return createConnection(getUsername(), getPassword()); - } - - /** - * Establishes a connection to the remote broker specified by the broker - * url. - * - * @param username - username for the connection - * @param password - password for the connection - * @return - connection to the broker - * @throws JMSException - */ - protected Connection createConnection(String username, String password) throws JMSException { - if (getBrokerUrl() == null) { - context - .printException(new IllegalStateException( - "You must specify a broker URL to connect to using the --amqurl option.")); - return null; - } - - ConnectionFactory factory = getConnectionFactory(); - Connection conn; - - if (null == username && null == password) - conn = factory.createConnection(); - else - conn = factory.createConnection(username, password); - - connections.add(conn); - conn.start(); - - return conn; - } - - /** - * Close all created connections. - */ - protected void closeAllConnections() { - for (Iterator i = connections.iterator(); i.hasNext();) { - try { - i.next().close(); - } catch (Exception e) { - } - } - - connections.clear(); - } - - /** - * Handle the --amqurl option. - * - * @param token - current option - * @param tokens - succeeding list of arguments - * @throws Exception - */ - protected void handleOption(String token, List tokens) throws Exception { - // Try to handle the options first - if (token.equals("--amqurl")) { - // If no broker url specified, or next token is a new option - if (tokens.isEmpty() || ((String)tokens.get(0)).startsWith("-")) { - context.printException(new IllegalArgumentException("Broker URL not specified.")); - tokens.clear(); - return; - } - - // If broker url already specified - if (getBrokerUrl() != null) { - context - .printException(new IllegalArgumentException("Multiple broker URL cannot be specified.")); - tokens.clear(); - return; - } - - String strBrokerUrl = (String)tokens.remove(0); - - try { - setBrokerUrl(new URI(strBrokerUrl)); - } catch (URISyntaxException e) { - context.printException(e); - tokens.clear(); - return; - } - } else if (token.equals("--factory")) { - factoryClassString = (String) tokens.remove(0); - } else if (token.equals("--passwordFactory")) { - passwordFactoryClassString = (String) tokens.remove(0); - } else if (token.equals("--password")) { - password = (String) tokens.remove(0); - } else if (token.equals("--user")) { - username = (String) tokens.remove(0); - } else { - // Let the super class handle the option - super.handleOption(token, tokens); - } - } - - /** - * Set the broker url. - * - * @param brokerUrl - new broker url - */ - protected void setBrokerUrl(URI brokerUrl) { - this.brokerUrl = brokerUrl; - } - - /** - * Set the broker url. - * - * @param address - address of the new broker url - * @throws URISyntaxException - */ - protected void setBrokerUrl(String address) throws URISyntaxException { - this.brokerUrl = new URI(address); - } - - /** - * Get the current broker url. - * - * @return current broker url - */ - protected URI getBrokerUrl() { - return brokerUrl; - } - - /** - * @return the factory - */ - @SuppressWarnings("unchecked") - public ConnectionFactory getConnectionFactory() { - if (factory == null && factoryClassString != null) { - try { - Class klass = Class.forName(factoryClassString); - - if (getUsername() != null || getPassword() != null) { - factory = (ConnectionFactory) klass.getConstructor( - String.class, String.class, URI.class).newInstance( - getUsername(), getPassword(), getBrokerUrl()); - } else { - factory = (ConnectionFactory) klass.getConstructor( - URI.class).newInstance(getBrokerUrl()); - } - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - if (factory == null) { - if (getUsername() != null || getPassword() != null) { - factory = new ActiveMQConnectionFactory(getUsername(), - getPassword(), getBrokerUrl()); - } else { - factory = new ActiveMQConnectionFactory(getBrokerUrl()); - } - } - - return factory; - } - - /** - * @return the username - */ - public String getUsername() { - return username; - } - - /** - * @param factory the factory to set - */ - public void setFactory(ConnectionFactory factory) { - this.factory = factory; - } - - /** - * @param username the username to set - */ - public void setUsername(String username) { - this.username = username; - } - - /** - * @return the password - */ - public String getPassword() { - if (null == password) - return null; - - return getPasswordFactory().getPassword(password); - } - - /** - * @param password the password to set - */ - public void setPassword(String password) { - this.password = password; - } - - /** - * @return the passwordFactory - */ - @SuppressWarnings("unchecked") - public PasswordFactory getPasswordFactory() { - if (passwordFactory == null && passwordFactoryClassString != null) { - try { - Class klass = Class.forName(passwordFactoryClassString); - passwordFactory = (PasswordFactory) klass.newInstance(); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - // Preserve the fallback case, if someone did specify a bad class, let them realize when things don't work. - if (passwordFactory == null) { - passwordFactory = DefaultPasswordFactory.factory; - } - - return passwordFactory; - } - - /** - * @param passwordFactory the passwordFactory to set - */ - public void setPasswordFactory(PasswordFactory passwordFactory) { - this.passwordFactory = passwordFactory; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/AbstractCommand.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/AbstractCommand.class deleted file mode 100644 index 2eb8200aa..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/AbstractCommand.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/AbstractCommand.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/AbstractCommand.java deleted file mode 100644 index de633474d..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/AbstractCommand.java +++ /dev/null @@ -1,131 +0,0 @@ -/** - * 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.console.command; - -import java.util.List; - -import org.apache.activemq.ActiveMQConnectionMetaData; -import org.apache.activemq.console.CommandContext; - -public abstract class AbstractCommand implements Command { - public static final String COMMAND_OPTION_DELIMETER = ","; - - private boolean isPrintHelp; - private boolean isPrintVersion; - - protected CommandContext context; - - public void setCommandContext(CommandContext context) { - this.context = context; - } - - /** - * Execute a generic command, which includes parsing the options for the - * command and running the specific task. - * - * @param tokens - command arguments - * @throws Exception - */ - public void execute(List tokens) throws Exception { - // Parse the options specified by "-" - parseOptions(tokens); - - // Print the help file of the task - if (isPrintHelp) { - printHelp(); - - // Print the AMQ version - } else if (isPrintVersion) { - context.printVersion(ActiveMQConnectionMetaData.PROVIDER_VERSION); - - // Run the specified task - } else { - runTask(tokens); - } - } - - /** - * Parse any option parameters in the command arguments specified by a '-' - * as the first character of the token. - * - * @param tokens - command arguments - * @throws Exception - */ - protected void parseOptions(List tokens) throws Exception { - while (!tokens.isEmpty()) { - String token = tokens.remove(0); - if (token.startsWith("-")) { - // Token is an option - handleOption(token, tokens); - } else { - // Push back to list of tokens - tokens.add(0, token); - return; - } - } - } - - /** - * Handle the general options for each command, which includes -h, -?, - * --help, -D, --version. - * - * @param token - option token to handle - * @param tokens - succeeding command arguments - * @throws Exception - */ - protected void handleOption(String token, List tokens) throws Exception { - isPrintHelp = false; - isPrintVersion = false; - // If token is a help option - if (token.equals("-h") || token.equals("-?") || token.equals("--help")) { - isPrintHelp = true; - tokens.clear(); - - // If token is a version option - } else if (token.equals("--version")) { - isPrintVersion = true; - tokens.clear(); - } else if (token.startsWith("-D")) { - // If token is a system property define option - String key = token.substring(2); - String value = ""; - int pos = key.indexOf("="); - if (pos >= 0) { - value = key.substring(pos + 1); - key = key.substring(0, pos); - } - System.setProperty(key, value); - } else { - // Token is unrecognized - context.printInfo("Unrecognized option: " + token); - isPrintHelp = true; - } - } - - /** - * Run the specific task. - * - * @param tokens - command arguments - * @throws Exception - */ - protected abstract void runTask(List tokens) throws Exception; - - /** - * Print the help messages for the specific task - */ - protected abstract void printHelp(); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/AbstractJmxCommand.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/AbstractJmxCommand.class deleted file mode 100644 index 99b4c4a65..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/AbstractJmxCommand.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/AbstractJmxCommand.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/AbstractJmxCommand.java deleted file mode 100644 index 90b7abee0..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/AbstractJmxCommand.java +++ /dev/null @@ -1,392 +0,0 @@ -/** - * 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.console.command; - -import java.io.File; -import java.io.IOException; -import java.lang.management.ManagementFactory; -import java.lang.reflect.Method; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLClassLoader; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Properties; - -import javax.management.MBeanServerConnection; -import javax.management.remote.JMXConnector; -import javax.management.remote.JMXConnectorFactory; -import javax.management.remote.JMXServiceURL; - -public abstract class AbstractJmxCommand extends AbstractCommand { - public static String DEFAULT_JMX_URL; - private static String jmxUser; - private static String jmxPassword; - private static final String CONNECTOR_ADDRESS = - "com.sun.management.jmxremote.localConnectorAddress"; - - private JMXServiceURL jmxServiceUrl; - private boolean jmxUseLocal; - private JMXConnector jmxConnector; - private MBeanServerConnection jmxConnection; - - static { - DEFAULT_JMX_URL = System.getProperty("activemq.jmx.url", "service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi"); - jmxUser = System.getProperty("activemq.jmx.user"); - jmxPassword = System.getProperty("activemq.jmx.password"); - } - - /** - * Get the current specified JMX service url. - * @return JMX service url - */ - protected JMXServiceURL getJmxServiceUrl() { - return jmxServiceUrl; - } - - public static String getJVM() { - return System.getProperty("java.vm.specification.vendor"); - } - - public static boolean isSunJVM() { - // need to check for Oracle as that is the name for Java7 onwards. - return getJVM().equals("Sun Microsystems Inc.") || getJVM().startsWith("Oracle"); - } - - /** - * Finds the JMX Url for a VM by its process id - * - * @param pid - * The process id value of the VM to search for. - * - * @return the JMX Url of the VM with the given pid or null if not found. - */ - @SuppressWarnings({ "rawtypes", "unchecked" }) - protected String findJMXUrlByProcessId(int pid) { - - if (isSunJVM()) { - try { - // Classes are all dynamically loaded, since they are specific to Sun VM - // if it fails for any reason default jmx url will be used - - // tools.jar are not always included used by default class loader, so we - // will try to use custom loader that will try to load tools.jar - - String javaHome = System.getProperty("java.home"); - String tools = javaHome + File.separator + - ".." + File.separator + "lib" + File.separator + "tools.jar"; - URLClassLoader loader = new URLClassLoader(new URL[]{new File(tools).toURI().toURL()}); - - Class virtualMachine = Class.forName("com.sun.tools.attach.VirtualMachine", true, loader); - Class virtualMachineDescriptor = Class.forName("com.sun.tools.attach.VirtualMachineDescriptor", true, loader); - - Method getVMList = virtualMachine.getMethod("list", (Class[])null); - Method attachToVM = virtualMachine.getMethod("attach", String.class); - Method getAgentProperties = virtualMachine.getMethod("getAgentProperties", (Class[])null); - Method getVMId = virtualMachineDescriptor.getMethod("id", (Class[])null); - - List allVMs = (List)getVMList.invoke(null, (Object[])null); - - for(Object vmInstance : allVMs) { - String id = (String)getVMId.invoke(vmInstance, (Object[])null); - if (id.equals(Integer.toString(pid))) { - - Object vm = attachToVM.invoke(null, id); - - Properties agentProperties = (Properties)getAgentProperties.invoke(vm, (Object[])null); - String connectorAddress = agentProperties.getProperty(CONNECTOR_ADDRESS); - - if (connectorAddress != null) { - return connectorAddress; - } else { - break; - } - } - } - } catch (Exception ignore) { - } - } - - return null; - } - - /** - * Get the current JMX service url being used, or create a default one if no JMX service url has been specified. - * @return JMX service url - * @throws MalformedURLException - */ - @SuppressWarnings({ "rawtypes", "unchecked" }) - protected JMXServiceURL useJmxServiceUrl() throws MalformedURLException { - if (getJmxServiceUrl() == null) { - String jmxUrl = DEFAULT_JMX_URL; - int connectingPid = -1; - if (isSunJVM()) { - try { - // Classes are all dynamically loaded, since they are specific to Sun VM - // if it fails for any reason default jmx url will be used - - // tools.jar are not always included used by default class loader, so we - // will try to use custom loader that will try to load tools.jar - - String javaHome = System.getProperty("java.home"); - String tools = javaHome + File.separator + - ".." + File.separator + "lib" + File.separator + "tools.jar"; - URLClassLoader loader = new URLClassLoader(new URL[]{new File(tools).toURI().toURL()}); - - Class virtualMachine = Class.forName("com.sun.tools.attach.VirtualMachine", true, loader); - Class virtualMachineDescriptor = Class.forName("com.sun.tools.attach.VirtualMachineDescriptor", true, loader); - - Method getVMList = virtualMachine.getMethod("list", (Class[])null); - Method attachToVM = virtualMachine.getMethod("attach", String.class); - Method getAgentProperties = virtualMachine.getMethod("getAgentProperties", (Class[])null); - Method getVMDescriptor = virtualMachineDescriptor.getMethod("displayName", (Class[])null); - Method getVMId = virtualMachineDescriptor.getMethod("id", (Class[])null); - - List allVMs = (List)getVMList.invoke(null, (Object[])null); - - for(Object vmInstance : allVMs) { - String displayName = (String)getVMDescriptor.invoke(vmInstance, (Object[])null); - if (displayName.contains("activemq.jar start")) { - String id = (String)getVMId.invoke(vmInstance, (Object[])null); - - Object vm = attachToVM.invoke(null, id); - - Properties agentProperties = (Properties)getAgentProperties.invoke(vm, (Object[])null); - String connectorAddress = agentProperties.getProperty(CONNECTOR_ADDRESS); - - if (connectorAddress != null) { - jmxUrl = connectorAddress; - connectingPid = Integer.parseInt(id); - context.print("useJmxServiceUrl Found JMS Url: " + jmxUrl); - break; - } - } - } - } catch (Exception ignore) { - } - } - - if (connectingPid != -1) { - context.print("Connecting to pid: " + connectingPid); - } else { - context.print("Connecting to JMX URL: " + jmxUrl); - } - setJmxServiceUrl(jmxUrl); - } - - return getJmxServiceUrl(); - } - - /** - * Sets the JMX service url to use. - * @param jmxServiceUrl - new JMX service url to use - */ - protected void setJmxServiceUrl(JMXServiceURL jmxServiceUrl) { - this.jmxServiceUrl = jmxServiceUrl; - } - - /** - * Sets the JMX service url to use. - * @param jmxServiceUrl - new JMX service url to use - * @throws MalformedURLException - */ - protected void setJmxServiceUrl(String jmxServiceUrl) throws MalformedURLException { - setJmxServiceUrl(new JMXServiceURL(jmxServiceUrl)); - } - - /** - * Get the JMX user name to be used when authenticating. - * @return the JMX user name - */ - public String getJmxUser() { - return jmxUser; - } - - /** - * Sets the JMS user name to use - * @param jmxUser - the jmx - */ - public void setJmxUser(String jmxUser) { - AbstractJmxCommand.jmxUser = jmxUser; - } - - /** - * Get the password used when authenticating - * @return the password used for JMX authentication - */ - public String getJmxPassword() { - return jmxPassword; - } - - /** - * Sets the password to use when authenticating - * @param jmxPassword - the password used for JMX authentication - */ - public void setJmxPassword(String jmxPassword) { - AbstractJmxCommand.jmxPassword = jmxPassword; - } - - /** - * Get whether the default mbean server for this JVM should be used instead of the jmx url - * @return true if the mbean server from this JVM should be used, false if the jmx url should be used - */ - public boolean isJmxUseLocal() { - return jmxUseLocal; - } - - /** - * Sets whether the the default mbean server for this JVM should be used instead of the jmx url - * @param jmxUseLocal - true if the mbean server from this JVM should be used, false if the jmx url should be used - */ - public void setJmxUseLocal(boolean jmxUseLocal) { - this.jmxUseLocal = jmxUseLocal; - } - - /** - * Create a JMX connector using the current specified JMX service url. If there is an existing connection, - * it tries to reuse this connection. - * @return created JMX connector - * @throws IOException - */ - private JMXConnector createJmxConnector() throws IOException { - // Reuse the previous connection - if (jmxConnector != null) { - jmxConnector.connect(); - return jmxConnector; - } - - // Create a new JMX connector - if (jmxUser != null && jmxPassword != null) { - Map props = new HashMap(); - props.put(JMXConnector.CREDENTIALS, new String[] { jmxUser, jmxPassword }); - jmxConnector = JMXConnectorFactory.connect(useJmxServiceUrl(), props); - } else { - jmxConnector = JMXConnectorFactory.connect(useJmxServiceUrl()); - } - return jmxConnector; - } - - /** - * Close the current JMX connector - */ - protected void closeJmxConnection() { - try { - if (jmxConnector != null) { - jmxConnector.close(); - jmxConnector = null; - } - } catch (IOException e) { - } - } - - protected MBeanServerConnection createJmxConnection() throws IOException { - if (jmxConnection == null) { - if (isJmxUseLocal()) { - jmxConnection = ManagementFactory.getPlatformMBeanServer(); - } else { - jmxConnection = createJmxConnector().getMBeanServerConnection(); - } - } - return jmxConnection; - } - - /** - * Handle the --jmxurl option. - * @param token - option token to handle - * @param tokens - succeeding command arguments - * @throws Exception - */ - @Override - protected void handleOption(String token, List tokens) throws Exception { - // Try to handle the options first - if (token.equals("--jmxurl")) { - // If no jmx url specified, or next token is a new option - if (tokens.isEmpty() || tokens.get(0).startsWith("-")) { - context.printException(new IllegalArgumentException("JMX URL not specified.")); - } - - // If jmx url already specified - if (getJmxServiceUrl() != null) { - context.printException(new IllegalArgumentException("Multiple JMX URL cannot be specified.")); - tokens.clear(); - } - - String strJmxUrl = tokens.remove(0); - try { - this.setJmxServiceUrl(new JMXServiceURL(strJmxUrl)); - } catch (MalformedURLException e) { - context.printException(e); - tokens.clear(); - } - } else if(token.equals("--pid")) { - if (isSunJVM()) { - if (tokens.isEmpty() || tokens.get(0).startsWith("-")) { - context.printException(new IllegalArgumentException("pid not specified")); - return; - } - int pid = Integer.parseInt(tokens.remove(0)); - context.print("Connecting to pid: " + pid); - - String jmxUrl = findJMXUrlByProcessId(pid); - if (jmxUrl != null) { - // If jmx url already specified - if (getJmxServiceUrl() != null) { - context.printException(new IllegalArgumentException("JMX URL already specified.")); - tokens.clear(); - } - try { - this.setJmxServiceUrl(new JMXServiceURL(jmxUrl)); - } catch (MalformedURLException e) { - context.printException(e); - tokens.clear(); - } - } else { - context.printInfo("failed to resolve jmxUrl for pid:" + pid + ", using default JMX url"); - } - } else { - context.printInfo("--pid option is not available for this VM, using default JMX url"); - } - } else if (token.equals("--jmxuser")) { - // If no jmx user specified, or next token is a new option - if (tokens.isEmpty() || tokens.get(0).startsWith("-")) { - context.printException(new IllegalArgumentException("JMX user not specified.")); - } - this.setJmxUser(tokens.remove(0)); - } else if (token.equals("--jmxpassword")) { - // If no jmx password specified, or next token is a new option - if (tokens.isEmpty() || tokens.get(0).startsWith("-")) { - context.printException(new IllegalArgumentException("JMX password not specified.")); - } - this.setJmxPassword(tokens.remove(0)); - } else if (token.equals("--jmxlocal")) { - this.setJmxUseLocal(true); - } else { - // Let the super class handle the option - super.handleOption(token, tokens); - } - } - - @Override - public void execute(List tokens) throws Exception { - try { - super.execute(tokens); - } finally { - closeJmxConnection(); - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/AmqBrowseCommand.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/AmqBrowseCommand.class deleted file mode 100644 index e1a0b1316..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/AmqBrowseCommand.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/AmqBrowseCommand.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/AmqBrowseCommand.java deleted file mode 100644 index 725f743b1..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/AmqBrowseCommand.java +++ /dev/null @@ -1,264 +0,0 @@ -/** - * 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.console.command; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; -import java.util.StringTokenizer; - -import javax.jms.Destination; - -import org.apache.activemq.command.ActiveMQQueue; -import org.apache.activemq.command.ActiveMQTopic; -import org.apache.activemq.console.util.AmqMessagesUtil; - -public class AmqBrowseCommand extends AbstractAmqCommand { - - public static final String QUEUE_PREFIX = "queue:"; - public static final String TOPIC_PREFIX = "topic:"; - - public static final String VIEW_GROUP_HEADER = "header:"; - public static final String VIEW_GROUP_CUSTOM = "custom:"; - public static final String VIEW_GROUP_BODY = "body:"; - - protected String[] helpFile = new String[] { - "Task Usage: Main browse --amqurl [browse-options] ", - "Description: Display selected destination's messages.", - "", - "Browse Options:", - " --amqurl Set the broker URL to connect to.", - " --msgsel Add to the search list messages matched by the query similar to", - " the messages selector format.", - " --factory Load className as the javax.jms.ConnectionFactory to use for creating connections.", - " --passwordFactory Load className as the org.apache.activemq.console.command.PasswordFactory", - " for retrieving the password from a keystore.", - " --user Username to use for JMS connections.", - " --password Password to use for JMS connections.", - " -V Predefined view that allows you to view the message header, custom", - " message header, or the message body.", - " --view ,,... Select the specific attribute of the message to view.", - " --version Display the version information.", - " -h,-?,--help Display the browse broker help information.", - "", - "Examples:", - " Main browse --amqurl tcp://localhost:61616 FOO.BAR", - " - Print the message header, custom message header, and message body of all messages in the", - " queue FOO.BAR", - "", - " Main browse --amqurl tcp://localhost:61616 -Vheader,body queue:FOO.BAR", - " - Print only the message header and message body of all messages in the queue FOO.BAR", - "", - " Main browse --amqurl tcp://localhost:61616 -Vheader --view custom:MyField queue:FOO.BAR", - " - Print the message header and the custom field 'MyField' of all messages in the queue FOO.BAR", - "", - " Main browse --amqurl tcp://localhost:61616 --msgsel JMSMessageID='*:10',JMSPriority>5 FOO.BAR", - " - Print all the message fields that has a JMSMessageID in the header field that matches the", - " wildcard *:10, and has a JMSPriority field > 5 in the queue FOO.BAR", - " * To use wildcard queries, the field must be a string and the query enclosed in ''", - "", - " Main browse --amqurl tcp://localhost:61616 --user someUser --password somePass FOO.BAR", - " - Print the message header, custom message header, and message body of all messages in the", - " queue FOO.BAR, using someUser as the user name, and somePass as the password", - "", - " Main browse --amqurl tcp://localhost:61616 --user someUser --password somePass --factory org.apache.activemq.ActiveMQConnectionFactory --passwordFactory org.apache.activemq.AMQPasswordFactory FOO.BAR", - " - Print the message header, custom message header, and message body of all messages in the", - " queue FOO.BAR, using someUser as the user name, org.apache.activemq.AMQFactorySubClass to create JMS connections,", - " and org.apache.activemq.console.command.DefaultPasswordFactory to turn somePass into the password to be used.", - "", - }; - - private final List queryAddObjects = new ArrayList(10); - private final List querySubObjects = new ArrayList(10); - private final Set groupViews = new HashSet(10); - private final Set queryViews = new HashSet(10); - - @Override - public String getName() { - return "browse"; - } - - @Override - public String getOneLineDescription() { - return "Display selected messages in a specified destination."; - } - - /** - * Execute the browse command, which allows you to browse the messages in a - * given JMS destination - * - * @param tokens - command arguments - * @throws Exception - */ - protected void runTask(List tokens) throws Exception { - try { - // If no destination specified - if (tokens.isEmpty()) { - context.printException(new IllegalArgumentException("No JMS destination specified.")); - return; - } - - // If no broker url specified - if (getBrokerUrl() == null) { - context.printException(new IllegalStateException("No broker url specified. Use the --amqurl option to specify a broker url.")); - return; - } - - // Display the messages for each destination - for (Iterator i = tokens.iterator(); i.hasNext();) { - String destName = (String)i.next(); - Destination dest; - - // If destination has been explicitly specified as a queue - if (destName.startsWith(QUEUE_PREFIX)) { - dest = new ActiveMQQueue(destName.substring(QUEUE_PREFIX.length())); - - // If destination has been explicitly specified as a topic - } else if (destName.startsWith(TOPIC_PREFIX)) { - dest = new ActiveMQTopic(destName.substring(TOPIC_PREFIX.length())); - - // By default destination is assumed to be a queue - } else { - dest = new ActiveMQQueue(destName); - } - - // Query for the messages to view - List addMsgs = AmqMessagesUtil.getMessages(getConnectionFactory(), dest, queryAddObjects); - - // Query for the messages to remove from view - if (querySubObjects.size() > 0) { - List subMsgs = AmqMessagesUtil.getMessages(getConnectionFactory(), dest, querySubObjects); - addMsgs.removeAll(subMsgs); - } - - // Display the messages - context.printMessage(AmqMessagesUtil.filterMessagesView(addMsgs, groupViews, queryViews)); - } - - } catch (Exception e) { - context.printException(new RuntimeException("Failed to execute browse task. Reason: " + e)); - throw new Exception(e); - } - } - - /** - * Handle the --msgsel, --xmsgsel, --view, -V options. - * - * @param token - option token to handle - * @param tokens - succeeding command arguments - * @throws Exception - */ - protected void handleOption(String token, List tokens) throws Exception { - - // If token is an additive message selector option - if (token.startsWith("--msgsel")) { - - // If no message selector is specified, or next token is a new - // option - if (tokens.isEmpty() || ((String)tokens.get(0)).startsWith("-")) { - context.printException(new IllegalArgumentException("Message selector not specified")); - return; - } - - StringTokenizer queryTokens = new StringTokenizer((String)tokens.remove(0), COMMAND_OPTION_DELIMETER); - while (queryTokens.hasMoreTokens()) { - queryAddObjects.add(queryTokens.nextToken()); - } - } else if (token.startsWith("--xmsgsel")) { - // If token is a substractive message selector option - - // If no message selector is specified, or next token is a new option - if (tokens.isEmpty() || ((String)tokens.get(0)).startsWith("-")) { - context.printException(new IllegalArgumentException("Message selector not specified")); - return; - } - - StringTokenizer queryTokens = new StringTokenizer((String)tokens.remove(0), COMMAND_OPTION_DELIMETER); - while (queryTokens.hasMoreTokens()) { - querySubObjects.add(queryTokens.nextToken()); - } - - } else if (token.startsWith("--view")) { - // If token is a view option - - // If no view specified, or next token is a new option - if (tokens.isEmpty() || ((String)tokens.get(0)).startsWith("-")) { - context.printException(new IllegalArgumentException("Attributes to view not specified")); - return; - } - - // Add the attributes to view - StringTokenizer viewTokens = new StringTokenizer((String)tokens.remove(0), COMMAND_OPTION_DELIMETER); - while (viewTokens.hasMoreTokens()) { - String viewToken = viewTokens.nextToken(); - - // If view is explicitly specified to belong to the JMS header - if (viewToken.equals(VIEW_GROUP_HEADER)) { - queryViews.add(AmqMessagesUtil.JMS_MESSAGE_HEADER_PREFIX + viewToken.substring(VIEW_GROUP_HEADER.length())); - - // If view is explicitly specified to belong to the JMS - // custom header - } else if (viewToken.equals(VIEW_GROUP_CUSTOM)) { - queryViews.add(AmqMessagesUtil.JMS_MESSAGE_CUSTOM_PREFIX + viewToken.substring(VIEW_GROUP_CUSTOM.length())); - - // If view is explicitly specified to belong to the JMS body - } else if (viewToken.equals(VIEW_GROUP_BODY)) { - queryViews.add(AmqMessagesUtil.JMS_MESSAGE_BODY_PREFIX + viewToken.substring(VIEW_GROUP_BODY.length())); - - // If no view explicitly specified, let's check the view for - // each group - } else { - queryViews.add(AmqMessagesUtil.JMS_MESSAGE_HEADER_PREFIX + viewToken); - queryViews.add(AmqMessagesUtil.JMS_MESSAGE_CUSTOM_PREFIX + viewToken); - queryViews.add(AmqMessagesUtil.JMS_MESSAGE_BODY_PREFIX + viewToken); - } - } - } else if (token.startsWith("-V")) { - // If token is a predefined group view option - String viewGroup = token.substring(2); - // If option is a header group view - if (viewGroup.equals("header")) { - groupViews.add(AmqMessagesUtil.JMS_MESSAGE_HEADER_PREFIX); - - // If option is a custom header group view - } else if (viewGroup.equals("custom")) { - groupViews.add(AmqMessagesUtil.JMS_MESSAGE_CUSTOM_PREFIX); - - // If option is a body group view - } else if (viewGroup.equals("body")) { - groupViews.add(AmqMessagesUtil.JMS_MESSAGE_BODY_PREFIX); - - // Unknown group view - } else { - context.printInfo("Unknown group view: " + viewGroup + ". Ignoring group view option."); - } - } else { - // Let super class handle unknown option - super.handleOption(token, tokens); - } - } - - /** - * Print the help messages for the browse command - */ - protected void printHelp() { - context.printHelp(helpFile); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/BrowseCommand.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/BrowseCommand.class deleted file mode 100644 index cfb0c4a93..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/BrowseCommand.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/BrowseCommand.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/BrowseCommand.java deleted file mode 100644 index aca0405ed..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/BrowseCommand.java +++ /dev/null @@ -1,227 +0,0 @@ -/** - * 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.console.command; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; -import java.util.StringTokenizer; - -import javax.management.ObjectInstance; - -import org.apache.activemq.console.util.AmqMessagesUtil; -import org.apache.activemq.console.util.JmxMBeansUtil; - -public class BrowseCommand extends AbstractJmxCommand { - - public static final String QUEUE_PREFIX = "queue:"; - public static final String TOPIC_PREFIX = "topic:"; - - public static final String VIEW_GROUP_HEADER = "header:"; - public static final String VIEW_GROUP_CUSTOM = "custom:"; - public static final String VIEW_GROUP_BODY = "body:"; - - protected String[] helpFile = new String[] { - "Task Usage: Main browse [browse-options] ", "Description: Display selected destination's messages.", - "", - "Browse Options:", - " --msgsel Add to the search list messages matched by the query similar to", - " the messages selector format.", - " -V Predefined view that allows you to view the message header, custom", - " message header, or the message body.", - " --view ,,... Select the specific attribute of the message to view.", - " --jmxurl Set the JMX URL to connect to.", - " --pid Set the pid to connect to (only on Sun JVM).", - " --jmxuser Set the JMX user used for authenticating.", - " --jmxpassword Set the JMX password used for authenticating.", - " --jmxlocal Use the local JMX server instead of a remote one.", - " --version Display the version information.", - " -h,-?,--help Display the browse broker help information.", - "", - "Examples:", - " Main browse FOO.BAR", - " - Print the message header, custom message header, and message body of all messages in the", - " queue FOO.BAR", - "", - " Main browse -Vheader,body queue:FOO.BAR", - " - Print only the message header and message body of all messages in the queue FOO.BAR", - "", - " Main browse -Vheader --view custom:MyField queue:FOO.BAR", - " - Print the message header and the custom field 'MyField' of all messages in the queue FOO.BAR", - "", - " Main browse --msgsel \"JMSMessageID='*:10',JMSPriority>5\" FOO.BAR", - " - Print all the message fields that has a JMSMessageID in the header field that matches the", - " wildcard *:10, and has a JMSPriority field > 5 in the queue FOO.BAR.", - " SLQ92 syntax is also supported.", - " * To use wildcard queries, the field must be a string and the query enclosed in ''", - " Use double quotes \"\" around the entire message selector string.", - "" - }; - - private final List queryAddObjects = new ArrayList(10); - private final List querySubObjects = new ArrayList(10); - private final Set groupViews = new HashSet(10); - private final Set queryViews = new HashSet(10); - - @Override - public String getName() { - return "browse"; - } - - @Override - public String getOneLineDescription() { - return "Used to browse a destination"; - } - - /** - * Execute the browse command, which allows you to browse the messages in a - * given JMS destination - * - * @param tokens - command arguments - * @throws Exception - */ - protected void runTask(List tokens) throws Exception { - try { - // If there is no queue name specified, let's select all - if (tokens.isEmpty()) { - tokens.add("*"); - } - - // Iterate through the queue names - for (Iterator i = tokens.iterator(); i.hasNext();) { - List queueList = JmxMBeansUtil.queryMBeans(createJmxConnection(), "Type=Queue,Destination=" + i.next() + ",*"); - - // Iterate through the queue result - for (Iterator j = queueList.iterator(); j.hasNext();) { - List messages = JmxMBeansUtil.createMessageQueryFilter(createJmxConnection(), ((ObjectInstance)j.next()).getObjectName()).query(queryAddObjects); - context.printMessage(JmxMBeansUtil.filterMessagesView(messages, groupViews, queryViews)); - } - } - } catch (Exception e) { - context.printException(new RuntimeException("Failed to execute browse task. Reason: " + e)); - throw new Exception(e); - } - } - - /** - * Handle the --msgsel, --xmsgsel, --view, -V options. - * - * @param token - option token to handle - * @param tokens - succeeding command arguments - * @throws Exception - */ - protected void handleOption(String token, List tokens) throws Exception { - - // If token is an additive message selector option - if (token.startsWith("--msgsel")) { - - // If no message selector is specified, or next token is a new - // option - if (tokens.isEmpty() || ((String)tokens.get(0)).startsWith("-")) { - context.printException(new IllegalArgumentException("Message selector not specified")); - return; - } - - StringTokenizer queryTokens = new StringTokenizer((String)tokens.remove(0), COMMAND_OPTION_DELIMETER); - while (queryTokens.hasMoreTokens()) { - queryAddObjects.add(queryTokens.nextToken()); - } - } else if (token.startsWith("--xmsgsel")) { - // If token is a substractive message selector option - - // If no message selector is specified, or next token is a new - // option - if (tokens.isEmpty() || ((String)tokens.get(0)).startsWith("-")) { - context.printException(new IllegalArgumentException("Message selector not specified")); - return; - } - - StringTokenizer queryTokens = new StringTokenizer((String)tokens.remove(0), COMMAND_OPTION_DELIMETER); - while (queryTokens.hasMoreTokens()) { - querySubObjects.add(queryTokens.nextToken()); - } - - } else if (token.startsWith("--view")) { - // If token is a view option - - // If no view specified, or next token is a new option - if (tokens.isEmpty() || ((String)tokens.get(0)).startsWith("-")) { - context.printException(new IllegalArgumentException("Attributes to view not specified")); - return; - } - - // Add the attributes to view - StringTokenizer viewTokens = new StringTokenizer((String)tokens.remove(0), COMMAND_OPTION_DELIMETER); - while (viewTokens.hasMoreTokens()) { - String viewToken = viewTokens.nextToken(); - - // If view is explicitly specified to belong to the JMS header - if (viewToken.equals(VIEW_GROUP_HEADER)) { - queryViews.add(AmqMessagesUtil.JMS_MESSAGE_HEADER_PREFIX + viewToken.substring(VIEW_GROUP_HEADER.length())); - - // If view is explicitly specified to belong to the JMS - // custom header - } else if (viewToken.equals(VIEW_GROUP_CUSTOM)) { - queryViews.add(AmqMessagesUtil.JMS_MESSAGE_CUSTOM_PREFIX + viewToken.substring(VIEW_GROUP_CUSTOM.length())); - - // If view is explicitly specified to belong to the JMS body - } else if (viewToken.equals(VIEW_GROUP_BODY)) { - queryViews.add(AmqMessagesUtil.JMS_MESSAGE_BODY_PREFIX + viewToken.substring(VIEW_GROUP_BODY.length())); - - // If no view explicitly specified, let's check the view for - // each group - } else { - queryViews.add(AmqMessagesUtil.JMS_MESSAGE_HEADER_PREFIX + viewToken); - queryViews.add(AmqMessagesUtil.JMS_MESSAGE_CUSTOM_PREFIX + viewToken); - queryViews.add(AmqMessagesUtil.JMS_MESSAGE_BODY_PREFIX + viewToken); - } - } - } else if (token.startsWith("-V")) { - // If token is a predefined group view option - String viewGroup = token.substring(2); - // If option is a header group view - if (viewGroup.equals("header")) { - groupViews.add(AmqMessagesUtil.JMS_MESSAGE_HEADER_PREFIX); - - // If option is a custom header group view - } else if (viewGroup.equals("custom")) { - groupViews.add(AmqMessagesUtil.JMS_MESSAGE_CUSTOM_PREFIX); - - // If option is a body group view - } else if (viewGroup.equals("body")) { - groupViews.add(AmqMessagesUtil.JMS_MESSAGE_BODY_PREFIX); - - // Unknown group view - } else { - context.printInfo("Unknown group view: " + viewGroup + ". Ignoring group view option."); - } - } else { - // Let super class handle unknown option - super.handleOption(token, tokens); - } - } - - /** - * Print the help messages for the browse command - */ - protected void printHelp() { - context.printHelp(helpFile); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/BstatCommand.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/BstatCommand.class deleted file mode 100644 index 400da36e3..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/BstatCommand.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/BstatCommand.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/BstatCommand.java deleted file mode 100644 index c99eb54d2..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/BstatCommand.java +++ /dev/null @@ -1,97 +0,0 @@ -/** - * 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.console.command; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -public class BstatCommand extends QueryCommand { - - protected String[] helpFile = new String[] { - "Task Usage: activemq-admin bstat [bstat-options] [broker-name]", - "Description: Performs a predefined query that displays useful statistics regarding the specified broker.", - " If no broker name is specified, it will try and select from all registered brokers.", - "", - "Bstat Options:", - " --jmxurl Set the JMX URL to connect to.", - " --pid Set the pid to connect to (only on Sun JVM).", - " --jmxuser Set the JMX user used for authenticating.", - " --jmxpassword Set the JMX password used for authenticating.", - " --jmxlocal Use the local JMX server instead of a remote one.", - " --version Display the version information.", - " -h,-?,--help Display the query broker help information.", - "", - "Examples:", - " activemq-admin bstat localhost", - " - Display a summary of statistics for the broker 'localhost'" - }; - - @Override - public String getName() { - return "bstat"; - } - - @Override - public String getOneLineDescription() { - return "Performs a predefined query that displays useful statistics regarding the specified broker"; - } - - /** - * Performs a predefiend query option - * @param tokens - command arguments - * @throws Exception - */ - @Override - protected void runTask(List tokens) throws Exception { - List queryTokens = new ArrayList(); - // Find the first non-option token - String brokerName = "*"; - for (Iterator i = tokens.iterator(); i.hasNext();) { - String token = i.next(); - if (!token.startsWith("-")) { - brokerName = token; - break; - } else { - // Re-insert options - queryTokens.add(token); - } - } - - // Build the predefined option - queryTokens.add("--objname"); - queryTokens.add("type=*,brokerName=" + brokerName + ",*"); - queryTokens.add("-xQTopic=ActiveMQ.Advisory.*"); - queryTokens.add("--view"); - queryTokens.add("BrokerName,Name,connectorName,networkConnectorName,destinationName,destinationType,EnqueueCount," - + "DequeueCount,TotalEnqueueCount,TotalDequeueCount,Messages," - + "TotalMessageCount,ConsumerCount,TotalConsumerCount,DispatchCount,Duplex,NetworkTTL,Uptime"); - - // Call the query command - super.parseOptions(queryTokens); - super.runTask(queryTokens); - } - - /** - * Print the help messages for the browse command - */ - @Override - protected void printHelp() { - context.printHelp(helpFile); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/Command.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/Command.class deleted file mode 100644 index 6894a5781..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/Command.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/Command.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/Command.java deleted file mode 100644 index c65682a5c..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/Command.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * 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.console.command; - -import java.util.List; - -import org.apache.activemq.console.CommandContext; - -public interface Command { - - String getName(); - - String getOneLineDescription(); - - void setCommandContext( CommandContext context ); - - /** - * Execute the specified command - * @param tokens - arguments to the command - * @throws Exception - */ - void execute(List tokens) throws Exception; -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/CreateCommand.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/CreateCommand.class deleted file mode 100644 index f1661241a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/CreateCommand.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/CreateCommand.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/CreateCommand.java deleted file mode 100644 index c2e6a099d..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/CreateCommand.java +++ /dev/null @@ -1,296 +0,0 @@ -/* - * 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.console.command; - -import org.w3c.dom.Attr; -import org.w3c.dom.Element; -import org.xml.sax.SAXException; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.*; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; -import javax.xml.xpath.XPath; -import javax.xml.xpath.XPathConstants; -import javax.xml.xpath.XPathExpressionException; -import javax.xml.xpath.XPathFactory; -import java.io.*; -import java.nio.ByteBuffer; -import java.nio.channels.FileChannel; -import java.util.List; - -public class CreateCommand extends AbstractCommand { - - protected final String[] helpFile = new String[] { - "Task Usage: Main create path/to/brokerA [create-options]", - "Description: Creates a runnable broker instance in the specified path.", - "", - "List Options:", - " --amqconf Path to ActiveMQ conf file that will be used in the broker instance. Default is: conf/activemq.xml", - " --version Display the version information.", - " -h,-?,--help Display the create broker help information.", - "" - }; - - protected final String DEFAULT_TARGET_ACTIVEMQ_CONF = "conf/activemq.xml"; // default activemq conf to create in the new broker instance - protected final String DEFAULT_BROKERNAME_XPATH = "/beans/broker/@brokerName"; // default broker name xpath to change the broker name - - protected final String[] BASE_SUB_DIRS = { "bin", "conf" }; // default sub directories that will be created - protected final String BROKER_NAME_REGEX = "[$][{]brokerName[}]"; // use to replace broker name property holders - - protected String amqConf = "conf/activemq.xml"; // default conf if no conf is specified via --amqconf - - // default files to create - protected String[][] fileWriteMap = { - { "winActivemq", "bin/${brokerName}.bat" }, - { "unixActivemq", "bin/${brokerName}" } - }; - - - protected String brokerName; - protected File amqHome; - protected File targetAmqBase; - - @Override - public String getName() { - return "create"; - } - - @Override - public String getOneLineDescription() { - return "Creates a runnable broker instance in the specified path."; - } - - protected void runTask(List tokens) throws Exception { - context.print("Running create broker task..."); - amqHome = new File(System.getProperty("activemq.home")); - for (String token : tokens) { - - targetAmqBase = new File(token); - brokerName = targetAmqBase.getName(); - - - if (targetAmqBase.exists()) { - BufferedReader console = new BufferedReader(new InputStreamReader(System.in)); - String resp; - while (true) { - context.print("Target directory (" + targetAmqBase.getCanonicalPath() + ") already exists. Overwrite (y/n): "); - resp = console.readLine(); - if (resp.equalsIgnoreCase("y") || resp.equalsIgnoreCase("yes")) { - break; - } else if (resp.equalsIgnoreCase("n") || resp.equalsIgnoreCase("no")) { - return; - } - } - } - - context.print("Creating directory: " + targetAmqBase.getCanonicalPath()); - targetAmqBase.mkdirs(); - createSubDirs(targetAmqBase, BASE_SUB_DIRS); - writeFileMapping(targetAmqBase, fileWriteMap); - copyActivemqConf(amqHome, targetAmqBase, amqConf); - copyConfDirectory(new File(amqHome, "conf"), new File(targetAmqBase, "conf")); - } - } - - /** - * Handle the --amqconf options. - * - * @param token - option token to handle - * @param tokens - succeeding command arguments - * @throws Exception - */ - protected void handleOption(String token, List tokens) throws Exception { - if (token.startsWith("--amqconf")) { - // If no amqconf specified, or next token is a new option - if (tokens.isEmpty() || tokens.get(0).startsWith("-")) { - context.printException(new IllegalArgumentException("Attributes to amqconf not specified")); - return; - } - - amqConf = tokens.remove(0); - } else { - // Let super class handle unknown option - super.handleOption(token, tokens); - } - } - - protected void createSubDirs(File target, String[] subDirs) throws IOException { - File subDirFile; - for (String subDir : BASE_SUB_DIRS) { - subDirFile = new File(target, subDir); - context.print("Creating directory: " + subDirFile.getCanonicalPath()); - subDirFile.mkdirs(); - } - } - - protected void writeFileMapping(File targetBase, String[][] fileWriteMapping) throws IOException { - for (String[] fileWrite : fileWriteMapping) { - File dest = new File(targetBase, resolveParam(BROKER_NAME_REGEX, brokerName, fileWrite[1])); - context.print("Creating new file: " + dest.getCanonicalPath()); - writeFile(fileWrite[0], dest); - } - } - - protected void copyActivemqConf(File srcBase, File targetBase, String activemqConf) throws IOException, ParserConfigurationException, SAXException, TransformerException, XPathExpressionException { - File src = new File(srcBase, activemqConf); - - if (!src.exists()) { - throw new FileNotFoundException("File: " + src.getCanonicalPath() + " not found."); - } - - File dest = new File(targetBase, DEFAULT_TARGET_ACTIVEMQ_CONF); - context.print("Copying from: " + src.getCanonicalPath() + "\n to: " + dest.getCanonicalPath()); - - DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - Element docElem = builder.parse(src).getDocumentElement(); - - XPath xpath = XPathFactory.newInstance().newXPath(); - Attr brokerNameAttr = (Attr) xpath.evaluate(DEFAULT_BROKERNAME_XPATH, docElem, XPathConstants.NODE); - brokerNameAttr.setValue(brokerName); - - writeToFile(new DOMSource(docElem), dest); - } - - protected void printHelp() { - context.printHelp(helpFile); - } - - // write the default files to create (i.e. script files) - private void writeFile(String typeName, File dest) throws IOException { - String data; - if (typeName.equals("winActivemq")) { - data = winActivemqData; - data = resolveParam("[$][{]activemq.home[}]", amqHome.getCanonicalPath().replaceAll("[\\\\]", "/"), data); - data = resolveParam("[$][{]activemq.base[}]", targetAmqBase.getCanonicalPath().replaceAll("[\\\\]", "/"), data); - } else if (typeName.equals("unixActivemq")) { - data = getUnixActivemqData(); - data = resolveParam("[$][{]activemq.home[}]", amqHome.getCanonicalPath().replaceAll("[\\\\]", "/"), data); - data = resolveParam("[$][{]activemq.base[}]", targetAmqBase.getCanonicalPath().replaceAll("[\\\\]", "/"), data); - } else { - throw new IllegalStateException("Unknown file type: " + typeName); - } - - ByteBuffer buf = ByteBuffer.allocate(data.length()); - buf.put(data.getBytes()); - buf.flip(); - - FileChannel destinationChannel = new FileOutputStream(dest).getChannel(); - destinationChannel.write(buf); - destinationChannel.close(); - - // Set file permissions available for Java 6.0 only - dest.setExecutable(true); - dest.setReadable(true); - dest.setWritable(true); - } - - // utlity method to write an xml source to file - private void writeToFile(Source src, File file) throws TransformerException { - TransformerFactory tFactory = TransformerFactory.newInstance(); - Transformer fileTransformer = tFactory.newTransformer(); - - Result res = new StreamResult(file); - fileTransformer.transform(src, res); - } - - // utility method to copy one file to another - private void copyFile(File from, File dest) throws IOException { - if (!from.exists()) { - return; - } - FileChannel sourceChannel = new FileInputStream(from).getChannel(); - FileChannel destinationChannel = new FileOutputStream(dest).getChannel(); - sourceChannel.transferTo(0, sourceChannel.size(), destinationChannel); - sourceChannel.close(); - destinationChannel.close(); - } - - private void copyConfDirectory(File from, File dest) throws IOException { - if (from.isDirectory()) { - String files[] = from.list(); - - for (String file : files) { - File srcFile = new File(from, file); - if (srcFile.isFile() && !srcFile.getName().equals("activemq.xml")) { - File destFile = new File(dest, file); - context.print("Copying from: " + srcFile.getCanonicalPath() + "\n to: " + destFile.getCanonicalPath()); - copyFile(srcFile, destFile); - } - } - } else { - throw new IOException(from + " is not a directory"); - } - } - - // replace a property place holder (paramName) with the paramValue - private String resolveParam(String paramName, String paramValue, String target) { - return target.replaceAll(paramName, paramValue); - } - - // Embedded windows script data - private static final String winActivemqData = - "@echo off\n" - + "set ACTIVEMQ_HOME=\"${activemq.home}\"\n" - + "set ACTIVEMQ_BASE=\"${activemq.base}\"\n" - + "\n" - + "set PARAM=%1\n" - + ":getParam\n" - + "shift\n" - + "if \"%1\"==\"\" goto end\n" - + "set PARAM=%PARAM% %1\n" - + "goto getParam\n" - + ":end\n" - + "\n" - + "%ACTIVEMQ_HOME%/bin/activemq %PARAM%"; - - - private String getUnixActivemqData() { - StringBuffer res = new StringBuffer(); - res.append("## Figure out the ACTIVEMQ_BASE from the directory this script was run from\n"); - res.append("PRG=\"$0\"\n"); - res.append("progname=`basename \"$0\"`\n"); - res.append("saveddir=`pwd`\n"); - res.append("# need this for relative symlinks\n"); - res.append("dirname_prg=`dirname \"$PRG\"`\n"); - res.append("cd \"$dirname_prg\"\n"); - res.append("while [ -h \"$PRG\" ] ; do\n"); - res.append(" ls=`ls -ld \"$PRG\"`\n"); - res.append(" link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n"); - res.append(" if expr \"$link\" : '.*/.*' > /dev/null; then\n"); - res.append(" PRG=\"$link\"\n"); - res.append(" else\n"); - res.append(" PRG=`dirname \"$PRG\"`\"/$link\"\n"); - res.append(" fi\n"); - res.append("done\n"); - res.append("ACTIVEMQ_BASE=`dirname \"$PRG\"`/..\n"); - res.append("cd \"$saveddir\"\n\n"); - res.append("ACTIVEMQ_BASE=`cd \"$ACTIVEMQ_BASE\" && pwd`\n\n"); - res.append("## Enable remote debugging\n"); - res.append("#export ACTIVEMQ_DEBUG_OPTS=\"-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005\"\n\n"); - res.append("## Add system properties for this instance here (if needed), e.g\n"); - res.append("#export ACTIVEMQ_OPTS_MEMORY=\"-Xms256M -Xmx1G\"\n"); - res.append("#export ACTIVEMQ_OPTS=\"$ACTIVEMQ_OPTS_MEMORY -Dorg.apache.activemq.UseDedicatedTaskRunner=true -Djava.util.logging.config.file=logging.properties\"\n\n"); - res.append("export ACTIVEMQ_HOME=${activemq.home}\n"); - res.append("export ACTIVEMQ_BASE=$ACTIVEMQ_BASE\n\n"); - res.append("${ACTIVEMQ_HOME}/bin/activemq \"$@\""); - return res.toString(); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/DecryptCommand.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/DecryptCommand.class deleted file mode 100644 index b0e42ad40..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/DecryptCommand.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/DecryptCommand.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/DecryptCommand.java deleted file mode 100644 index 6ba22d3f1..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/DecryptCommand.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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.console.command; - -import java.util.List; - -import org.jasypt.exceptions.EncryptionOperationNotPossibleException; - -public class DecryptCommand extends EncryptCommand { - - protected String[] helpFile = new String[] { - "Task Usage: Main decrypt --password --input ", - "Description: Decrypts given text.", - "", - "Encrypt Options:", - " --password Password to be used by the encryptor.", - " --input Text to be encrypted.", - " --version Display the version information.", - " -h,-?,--help Display the stop broker help information.", - "" - }; - - @Override - public String getName() { - return "decrypt"; - } - - @Override - public String getOneLineDescription() { - return "Decrypts given text"; - } - - @Override - protected void runTask(List tokens) throws Exception { - if (password == null || input == null) { - context.printException(new IllegalArgumentException("input and password parameters are mandatory")); - return; - } - encryptor.setPassword(password); - try { - context.print("Decrypted text: " + encryptor.decrypt(input)); - } catch (EncryptionOperationNotPossibleException e) { - context.print("ERROR: Text cannot be decrypted, check your input and password and try again!"); - } - } - - - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/DefaultPasswordFactory.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/DefaultPasswordFactory.class deleted file mode 100644 index 80da55cdd..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/DefaultPasswordFactory.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/DefaultPasswordFactory.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/DefaultPasswordFactory.java deleted file mode 100644 index fe881adcd..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/DefaultPasswordFactory.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * 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.console.command; - -/** - * This is a simple dummy implementation that can be used for people who aren't in need of a keystore. - */ -public class DefaultPasswordFactory implements PasswordFactory{ - // everyone can share this, since it has no state at all. - public static PasswordFactory factory = new DefaultPasswordFactory(); - - public String getPassword(String password) { - return password; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/DstatCommand.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/DstatCommand.class deleted file mode 100644 index 0b39a94d1..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/DstatCommand.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/DstatCommand.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/DstatCommand.java deleted file mode 100644 index a64e190e2..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/DstatCommand.java +++ /dev/null @@ -1,182 +0,0 @@ -/** - * 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.console.command; - -import java.util.List; -import java.util.Locale; - -import javax.management.MBeanServerInvocationHandler; -import javax.management.ObjectInstance; -import javax.management.ObjectName; - -import org.apache.activemq.broker.jmx.QueueViewMBean; -import org.apache.activemq.broker.jmx.TopicViewMBean; -import org.apache.activemq.console.util.JmxMBeansUtil; - -public class DstatCommand extends AbstractJmxCommand { - - private static final String queryString = - "type=Broker,brokerName=*,destinationType=%1,destinationName=*,*"; - - protected String[] helpFile = new String[] { - "Task Usage: activemq-admin dstat [dstat-options] [destination-type]", - "Description: Performs a predefined query that displays useful statistics regarding the specified .", - " destination type (Queues or Topics) and displays those results in a tabular format.", - " If no broker name is specified, it will try and select from all registered brokers.", - "", - "dstat Options:", - " --jmxurl Set the JMX URL to connect to.", - " --pid Set the pid to connect to (only on Sun JVM).", - " --jmxuser Set the JMX user used for authenticating.", - " --jmxpassword Set the JMX password used for authenticating.", - " --jmxlocal Use the local JMX server instead of a remote one.", - " --version Display the version information.", - " -h,-?,--help Display the query broker help information.", - "", - "Examples:", - " activemq-admin dstat queues", - " - Display a tabular summary of statistics for the queues on the broker.", - " activemq-admin dstat topics", - " - Display a tabular summary of statistics for the queues on the broker." - }; - - /** - * Execute the dstat command, which allows you to display information for topics or queue in - * a tabular format. - * - * @param tokens - command arguments - * @throws Exception - */ - @Override - protected void runTask(List tokens) throws Exception { - try { - - if (tokens.contains("topics")) { - displayTopicStats(); - } else if (tokens.contains("queues")) { - displayQueueStats(); - } else { - displayAllDestinations(); - } - - // Iterate through the queue names - } catch (Exception e) { - context.printException(new RuntimeException("Failed to execute dstat task. Reason: " + e)); - throw new Exception(e); - } - } - - private void displayAllDestinations() throws Exception { - - String query = JmxMBeansUtil.createQueryString(queryString, "*"); - List queueList = JmxMBeansUtil.queryMBeans(createJmxConnection(), query); - - final String header = "%-50s %10s %10s %10s %10s %10s %10s"; - final String tableRow = "%-50s %10d %10d %10d %10d %10d %10d"; - - context.print(String.format(Locale.US, header, "Name", "Queue Size", "Producer #", "Consumer #", "Enqueue #", "Dequeue #", "Memory %")); - - // Iterate through the queue result - for (Object view : queueList) { - ObjectName queueName = ((ObjectInstance)view).getObjectName(); - QueueViewMBean queueView = MBeanServerInvocationHandler. - newProxyInstance(createJmxConnection(), queueName, QueueViewMBean.class, true); - - context.print(String.format(Locale.US, tableRow, - queueView.getName(), - queueView.getQueueSize(), - queueView.getProducerCount(), - queueView.getConsumerCount(), - queueView.getEnqueueCount(), - queueView.getDequeueCount(), - queueView.getMemoryPercentUsage())); - } - } - - private void displayQueueStats() throws Exception { - - String query = JmxMBeansUtil.createQueryString(queryString, "Queue"); - List queueList = JmxMBeansUtil.queryMBeans(createJmxConnection(), query); - - final String header = "%-50s %10s %10s %10s %10s %10s %10s"; - final String tableRow = "%-50s %10d %10d %10d %10d %10d %10d"; - - context.print(String.format(Locale.US, header, "Name", "Queue Size", "Producer #", "Consumer #", "Enqueue #", "Dequeue #", "Memory %")); - - // Iterate through the queue result - for (Object view : queueList) { - ObjectName queueName = ((ObjectInstance)view).getObjectName(); - QueueViewMBean queueView = MBeanServerInvocationHandler. - newProxyInstance(createJmxConnection(), queueName, QueueViewMBean.class, true); - - context.print(String.format(Locale.US, tableRow, - queueView.getName(), - queueView.getQueueSize(), - queueView.getProducerCount(), - queueView.getConsumerCount(), - queueView.getEnqueueCount(), - queueView.getDequeueCount(), - queueView.getMemoryPercentUsage())); - } - } - - private void displayTopicStats() throws Exception { - - String query = JmxMBeansUtil.createQueryString(queryString, "Topic"); - List topicsList = JmxMBeansUtil.queryMBeans(createJmxConnection(), query); - - final String header = "%-50s %10s %10s %10s %10s %10s %10s"; - final String tableRow = "%-50s %10d %10d %10d %10d %10d %10d"; - - context.print(String.format(Locale.US, header, "Name", "Queue Size", "Producer #", "Consumer #", "Enqueue #", "Dequeue #", "Memory %")); - - // Iterate through the topics result - for (Object view : topicsList) { - ObjectName topicName = ((ObjectInstance)view).getObjectName(); - TopicViewMBean topicView = MBeanServerInvocationHandler. - newProxyInstance(createJmxConnection(), topicName, TopicViewMBean.class, true); - - context.print(String.format(Locale.US, tableRow, - topicView.getName(), - topicView.getQueueSize(), - topicView.getProducerCount(), - topicView.getConsumerCount(), - topicView.getEnqueueCount(), - topicView.getDequeueCount(), - topicView.getMemoryPercentUsage())); - } - } - - @Override - public String getName() { - return "dstat"; - } - - @Override - public String getOneLineDescription() { - return "Performs a predefined query that displays useful tabular statistics regarding the specified destination type"; - } - - /** - * Print the help messages for this command - */ - @Override - protected void printHelp() { - context.printHelp(helpFile); - } - -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/EncryptCommand.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/EncryptCommand.class deleted file mode 100644 index 8a877e692..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/EncryptCommand.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/EncryptCommand.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/EncryptCommand.java deleted file mode 100644 index 6d8172dcb..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/EncryptCommand.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * 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.console.command; - -import java.util.List; - -import org.jasypt.encryption.pbe.StandardPBEStringEncryptor; - -public class EncryptCommand extends AbstractCommand { - - protected String[] helpFile = new String[] { - "Task Usage: Main encrypt --password --input ", - "Description: Encrypts given text.", - "", - "Encrypt Options:", - " --password Password to be used by the encryptor.", - " --input Text to be encrypted.", - " --version Display the version information.", - " -h,-?,--help Display the stop broker help information.", - "" - }; - - StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor(); - String input; - String password; - - @Override - public String getName() { - return "encrypt"; - } - - @Override - public String getOneLineDescription() { - return "Encrypts given text"; - } - - @Override - protected void printHelp() { - context.printHelp(helpFile); - } - - @Override - protected void runTask(List tokens) throws Exception { - if (password == null || input == null) { - context.printException(new IllegalArgumentException("input and password parameters are mandatory")); - return; - } - encryptor.setPassword(password); - context.print("Encrypted text: " + encryptor.encrypt(input)); - } - - @Override - protected void handleOption(String token, List tokens) throws Exception { - if (token.startsWith("--input")) { - if (tokens.isEmpty() || ((String)tokens.get(0)).startsWith("-")) { - context.printException(new IllegalArgumentException("input not specified")); - return; - } - - input=(String)tokens.remove(0); - } else if (token.startsWith("--password")) { - if (tokens.isEmpty() || ((String)tokens.get(0)).startsWith("-")) { - context.printException(new IllegalArgumentException("password not specified")); - return; - } - - password=(String)tokens.remove(0); - } else { - super.handleOption(token, tokens); - } - } - - - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/ListCommand.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/ListCommand.class deleted file mode 100644 index d72bca6fb..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/ListCommand.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/ListCommand.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/ListCommand.java deleted file mode 100644 index 12295e678..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/ListCommand.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * 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.console.command; - -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import org.apache.activemq.console.util.JmxMBeansUtil; - -public class ListCommand extends AbstractJmxCommand { - - protected String[] helpFile = new String[] { - "Task Usage: Main list [list-options]", - "Description: Lists all available broker in the specified JMX context.", - "", - "List Options:", - " --jmxurl Set the JMX URL to connect to.", - " --pid Set the pid to connect to (only on Sun JVM).", - " --jmxuser Set the JMX user used for authenticating.", - " --jmxpassword Set the JMX password used for authenticating.", - " --jmxlocal Use the local JMX server instead of a remote one.", - " --version Display the version information.", - " -h,-?,--help Display the stop broker help information.", - "" - }; - - @Override - public String getName() { - return "list"; - } - - @Override - public String getOneLineDescription() { - return "Lists all available brokers in the specified JMX context"; - } - - /** - * List all running brokers registered in the specified JMX context - * @param tokens - command arguments - * @throws Exception - */ - protected void runTask(List tokens) throws Exception { - try { - Set propsView = new HashSet(); - propsView.add("brokerName"); - context.printMBean(JmxMBeansUtil.filterMBeansView(JmxMBeansUtil.getAllBrokers(createJmxConnection()), propsView)); - } catch (Exception e) { - context.printException(new RuntimeException("Failed to execute list task. Reason: " + e)); - throw new Exception(e); - } - } - - /** - * Print the help messages for the browse command - */ - protected void printHelp() { - context.printHelp(helpFile); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/PasswordFactory.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/PasswordFactory.class deleted file mode 100644 index 35a169652..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/PasswordFactory.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/PasswordFactory.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/PasswordFactory.java deleted file mode 100644 index 00021354f..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/PasswordFactory.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * 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.console.command; - -/** - * This interface is used to allow people to provide a mechanism to override where the password comes from. - * Implementors of this interface will typically use the specified password to look up the real password in a - * keystore of some sort. - * @author areese@yahoo-inc.com - * - */ -public interface PasswordFactory { - String getPassword(String password); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/PurgeCommand.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/PurgeCommand.class deleted file mode 100644 index 407e2f937..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/PurgeCommand.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/PurgeCommand.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/PurgeCommand.java deleted file mode 100644 index 803c30ce1..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/PurgeCommand.java +++ /dev/null @@ -1,235 +0,0 @@ -/** - * 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.console.command; - -import java.net.URI; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.StringTokenizer; - -import javax.jms.Destination; -import javax.jms.Message; -import javax.management.MBeanServerConnection; -import javax.management.MBeanServerInvocationHandler; -import javax.management.ObjectInstance; -import javax.management.ObjectName; -import javax.management.openmbean.CompositeData; -import javax.management.remote.JMXConnector; - -import org.apache.activemq.broker.jmx.QueueViewMBean; -import org.apache.activemq.command.ActiveMQQueue; -import org.apache.activemq.console.util.AmqMessagesUtil; -import org.apache.activemq.console.util.JmxMBeansUtil; - -public class PurgeCommand extends AbstractJmxCommand { - - protected String[] helpFile = new String[] { - "Task Usage: Main purge [browse-options] ", - "Description: Delete selected destination's messages that matches the message selector.", - "", - "Purge Options:", - " --msgsel Add to the search list messages matched by the query similar to", - " the messages selector format.", - " --jmxurl Set the JMX URL to connect to.", - " --pid Set the pid to connect to (only on Sun JVM).", - " --jmxuser Set the JMX user used for authenticating.", - " --jmxpassword Set the JMX password used for authenticating.", - " --jmxlocal Use the local JMX server instead of a remote one.", - " --version Display the version information.", - " -h,-?,--help Display the browse broker help information.", - "", - "Examples:", - " Main purge FOO.BAR", - " - Delete all the messages in queue FOO.BAR", - - " Main purge --msgsel \"JMSMessageID='*:10',JMSPriority>5\" FOO.*", - " - Delete all the messages in the destinations that matches FOO.* and has a JMSMessageID in", - " the header field that matches the wildcard *:10, and has a JMSPriority field > 5 in the", - " queue FOO.BAR.", - " SLQ92 syntax is also supported.", - " * To use wildcard queries, the field must be a string and the query enclosed in ''", - " Use double quotes \"\" around the entire message selector string.", - "" - }; - - private final List queryAddObjects = new ArrayList(10); - private final List querySubObjects = new ArrayList(10); - - @Override - public String getName() { - return "purge"; - } - - @Override - public String getOneLineDescription() { - return "Delete selected destination's messages that matches the message selector"; - } - - /** - * Execute the purge command, which allows you to purge the messages in a - * given JMS destination - * - * @param tokens - command arguments - * @throws Exception - */ - protected void runTask(List tokens) throws Exception { - try { - // If there is no queue name specified, let's select all - if (tokens.isEmpty()) { - tokens.add("*"); - } - - // Iterate through the queue names - for (Iterator i = tokens.iterator(); i.hasNext();) { - List queueList = JmxMBeansUtil.queryMBeans(createJmxConnection(), "type=Broker,brokerName=*,destinationType=Queue,destinationName=" + i.next()); - - for (Iterator j = queueList.iterator(); j.hasNext();) { - ObjectName queueName = ((ObjectInstance)j.next()).getObjectName(); - if (queryAddObjects.isEmpty()) { - purgeQueue(queueName); - } else { - - QueueViewMBean proxy = (QueueViewMBean) MBeanServerInvocationHandler. - newProxyInstance(createJmxConnection(), - queueName, - QueueViewMBean.class, - true); - int removed = 0; - - // AMQ-3404: We support two syntaxes for the message - // selector query: - // 1) AMQ specific: - // "JMSPriority>2,MyHeader='Foo'" - // - // 2) SQL-92 syntax: - // "(JMSPriority>2) AND (MyHeader='Foo')" - // - // If syntax style 1) is used, the comma separated - // criterias are broken into List elements. - // We then need to construct the SQL-92 query out of - // this list. - - String sqlQuery = null; - if (queryAddObjects.size() > 1) { - sqlQuery = convertToSQL92(queryAddObjects); - } else { - sqlQuery = queryAddObjects.get(0); - } - removed = proxy.removeMatchingMessages(sqlQuery); - context.printInfo("Removed: " + removed - + " messages for message selector " + sqlQuery.toString()); - } - } - } - } catch (Exception e) { - context.printException(new RuntimeException("Failed to execute purge task. Reason: " + e)); - throw new Exception(e); - } - } - - - /** - * Purge all the messages in the queue - * - * @param queue - ObjectName of the queue to purge - * @throws Exception - */ - public void purgeQueue(ObjectName queue) throws Exception { - context.printInfo("Purging all messages in queue: " + queue.getKeyProperty("destinationName")); - createJmxConnection().invoke(queue, "purge", new Object[] {}, new String[] {}); - } - - /** - * Handle the --msgsel, --xmsgsel. - * - * @param token - option token to handle - * @param tokens - succeeding command arguments - * @throws Exception - */ - protected void handleOption(String token, List tokens) throws Exception { - // If token is an additive message selector option - if (token.startsWith("--msgsel")) { - - // If no message selector is specified, or next token is a new - // option - if (tokens.isEmpty() || ((String)tokens.get(0)).startsWith("-")) { - context.printException(new IllegalArgumentException("Message selector not specified")); - return; - } - - StringTokenizer queryTokens = new StringTokenizer((String)tokens.remove(0), COMMAND_OPTION_DELIMETER); - while (queryTokens.hasMoreTokens()) { - queryAddObjects.add(queryTokens.nextToken()); - } - } else if (token.startsWith("--xmsgsel")) { - // If token is a substractive message selector option - - // If no message selector is specified, or next token is a new - // option - if (tokens.isEmpty() || ((String)tokens.get(0)).startsWith("-")) { - context.printException(new IllegalArgumentException("Message selector not specified")); - return; - } - - StringTokenizer queryTokens = new StringTokenizer((String)tokens.remove(0), COMMAND_OPTION_DELIMETER); - while (queryTokens.hasMoreTokens()) { - querySubObjects.add(queryTokens.nextToken()); - } - - } else { - // Let super class handle unknown option - super.handleOption(token, tokens); - } - } - - /** - * Converts the message selector as provided on command line - * argument to activem-admin into an SQL-92 conform string. - * E.g. - * "JMSMessageID='*:10',JMSPriority>5" - * gets converted into - * "(JMSMessageID='%:10') AND (JMSPriority>5)" - * - * @param tokens - List of message selector query parameters - * @return SQL-92 string of that query. - */ - public String convertToSQL92(List tokens) { - String selector = ""; - - // Convert to message selector - for (Iterator i = tokens.iterator(); i.hasNext(); ) { - selector = selector + "(" + i.next().toString() + ") AND "; - } - - // Remove last AND and replace '*' with '%' - if (!selector.equals("")) { - selector = selector.substring(0, selector.length() - 5); - selector = selector.replace('*', '%'); - } - return selector; - } - - - /** - * Print the help messages for the browse command - */ - protected void printHelp() { - context.printHelp(helpFile); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/QueryCommand.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/QueryCommand.class deleted file mode 100644 index 399b05132..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/QueryCommand.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/QueryCommand.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/QueryCommand.java deleted file mode 100644 index b11ebdeeb..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/QueryCommand.java +++ /dev/null @@ -1,241 +0,0 @@ -/** - * 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.console.command; - -import java.util.ArrayList; -import java.util.Enumeration; -import java.util.HashSet; -import java.util.List; -import java.util.Properties; -import java.util.Set; -import java.util.StringTokenizer; - -import org.apache.activemq.console.util.JmxMBeansUtil; - -public class QueryCommand extends AbstractJmxCommand { - // Predefined type=identifier query - private static final Properties PREDEFINED_OBJNAME_QUERY = new Properties(); - - static { - PREDEFINED_OBJNAME_QUERY.setProperty("Broker", "type=Broker,brokerName=%1"); - PREDEFINED_OBJNAME_QUERY.setProperty("Connection", "type=Broker,connector=clientConnectors,connectionName=%1,*"); - PREDEFINED_OBJNAME_QUERY.setProperty("Connector", "type=Broker,brokerName=*,connector=clientConnectors,connectorName=%1"); - PREDEFINED_OBJNAME_QUERY.setProperty("NetworkConnector", "type=Broker,brokerName=%1,connector=networkConnectors,networkConnectorName=*"); - PREDEFINED_OBJNAME_QUERY.setProperty("Queue", "type=Broker,brokerName=*,destinationType=Queue,destinationName=%1"); - PREDEFINED_OBJNAME_QUERY.setProperty("Topic", "type=Broker,brokerName=*,destinationType=Topic,destinationName=%1,*"); - }; - - protected String[] helpFile = new String[] { - "Task Usage: Main query [query-options]", - "Description: Display selected broker component's attributes and statistics.", - "", - "Query Options:", - " -Q= Add to the search list the specific object type matched", - " by the defined object identifier.", - " -xQ= Remove from the search list the specific object type", - " matched by the object identifier.", - " --objname Add to the search list objects matched by the query similar", - " to the JMX object name format.", - " --xobjname Remove from the search list objects matched by the query", - " similar to the JMX object name format.", - " --view ,,... Select the specific attribute of the object to view.", - " By default all attributes will be displayed.", - " --jmxurl Set the JMX URL to connect to.", - " --pid Set the pid to connect to (only on Sun JVM).", - " --jmxuser Set the JMX user used for authenticating.", - " --jmxpassword Set the JMX password used for authenticating.", - " --jmxlocal Use the local JMX server instead of a remote one.", - " --version Display the version information.", - " -h,-?,--help Display the query broker help information.", - "", "Examples:", - " query", - " - Print all the attributes of all registered objects queues, topics, connections, etc).", - "", - " query -QQueue=TEST.FOO", - " - Print all the attributes of the queue with destination name TEST.FOO.", - "", - " query -QTopic=*", - " - Print all the attributes of all registered topics.", - "", - " query --view EnqueueCount,DequeueCount", - " - Print the attributes EnqueueCount and DequeueCount of all registered objects.", - "", - " query -QTopic=* --view EnqueueCount,DequeueCount", - " - Print the attributes EnqueueCount and DequeueCount of all registered topics.", - "", - " query -QTopic=* -QQueue=* --view EnqueueCount,DequeueCount", - " - Print the attributes EnqueueCount and DequeueCount of all registered topics and", - " queues.", - "", - " query -QTopic=* -xQTopic=ActiveMQ.Advisory.*", - " - Print all attributes of all topics except those that has a name that begins", - " with \"ActiveMQ.Advisory\".", - "", - " query --objname Type=*Connect*,BrokerName=local* -xQNetworkConnector=*", - " - Print all attributes of all connectors, connections excluding network connectors", - " that belongs to the broker that begins with local.", - "", - " query -QQueue=* -xQQueue=????", - " - Print all attributes of all queues except those that are 4 letters long.", - "", - }; - - private final List queryAddObjects = new ArrayList(10); - private final List querySubObjects = new ArrayList(10); - private final Set queryViews = new HashSet(10); - - @Override - public String getName() { - return "query"; - } - - @Override - public String getOneLineDescription() { - return "Display selected broker component's attributes and statistics."; - } - - /** - * Queries the mbeans registered in the specified JMX context - * - * @param tokens - command arguments - * @throws Exception - */ - protected void runTask(List tokens) throws Exception { - try { - // Query for the mbeans to add - List addMBeans = JmxMBeansUtil.queryMBeans(createJmxConnection(), queryAddObjects, queryViews); - - // Query for the mbeans to sub - if (querySubObjects.size() > 0) { - List subMBeans = JmxMBeansUtil.queryMBeans(createJmxConnection(), querySubObjects, queryViews); - addMBeans.removeAll(subMBeans); - } - - context.printMBean(JmxMBeansUtil.filterMBeansView(addMBeans, queryViews)); - - } catch (Exception e) { - context.printException(new RuntimeException("Failed to execute query task. Reason: " + e)); - throw new Exception(e); - } - } - - /** - * Handle the -Q, -xQ, --objname, --xobjname, --view options. - * - * @param token - option token to handle - * @param tokens - succeeding command arguments - * @throws Exception - */ - protected void handleOption(String token, List tokens) throws Exception { - // If token is a additive predefined query define option - if (token.startsWith("-Q")) { - String key = token.substring(2); - String value = ""; - int pos = key.indexOf("="); - if (pos >= 0) { - value = key.substring(pos + 1); - key = key.substring(0, pos); - } - - // If additive query - String predefQuery = PREDEFINED_OBJNAME_QUERY.getProperty(key); - if (predefQuery == null) { - context.printException(new IllegalArgumentException("Unknown query object type: " + key)); - return; - } - String queryStr = JmxMBeansUtil.createQueryString(predefQuery, value); - StringTokenizer queryTokens = new StringTokenizer(queryStr, COMMAND_OPTION_DELIMETER); - while (queryTokens.hasMoreTokens()) { - queryAddObjects.add(queryTokens.nextToken()); - } - } else if (token.startsWith("-xQ")) { - // If token is a substractive predefined query define option - String key = token.substring(3); - String value = ""; - int pos = key.indexOf("="); - if (pos >= 0) { - value = key.substring(pos + 1); - key = key.substring(0, pos); - } - - // If subtractive query - String predefQuery = PREDEFINED_OBJNAME_QUERY.getProperty(key); - if (predefQuery == null) { - context.printException(new IllegalArgumentException("Unknown query object type: " + key)); - return; - } - String queryStr = JmxMBeansUtil.createQueryString(predefQuery, value); - StringTokenizer queryTokens = new StringTokenizer(queryStr, COMMAND_OPTION_DELIMETER); - while (queryTokens.hasMoreTokens()) { - querySubObjects.add(queryTokens.nextToken()); - } - } else if (token.startsWith("--objname")) { - // If token is an additive object name query option - - // If no object name query is specified, or next token is a new - // option - if (tokens.isEmpty() || ((String)tokens.get(0)).startsWith("-")) { - context.printException(new IllegalArgumentException("Object name query not specified")); - return; - } - - StringTokenizer queryTokens = new StringTokenizer((String)tokens.remove(0), COMMAND_OPTION_DELIMETER); - while (queryTokens.hasMoreTokens()) { - queryAddObjects.add(queryTokens.nextToken()); - } - } else if (token.startsWith("--xobjname")) { - // If token is a substractive object name query option - - // If no object name query is specified, or next token is a new - // option - if (tokens.isEmpty() || ((String)tokens.get(0)).startsWith("-")) { - context.printException(new IllegalArgumentException("Object name query not specified")); - return; - } - - StringTokenizer queryTokens = new StringTokenizer((String)tokens.remove(0), COMMAND_OPTION_DELIMETER); - while (queryTokens.hasMoreTokens()) { - querySubObjects.add(queryTokens.nextToken()); - } - } else if (token.startsWith("--view")) { - // If token is a view option - - // If no view specified, or next token is a new option - if (tokens.isEmpty() || ((String)tokens.get(0)).startsWith("-")) { - context.printException(new IllegalArgumentException("Attributes to view not specified")); - return; - } - - // Add the attributes to view - Enumeration viewTokens = new StringTokenizer((String)tokens.remove(0), COMMAND_OPTION_DELIMETER); - while (viewTokens.hasMoreElements()) { - queryViews.add(viewTokens.nextElement()); - } - } else { - // Let super class handle unknown option - super.handleOption(token, tokens); - } - } - - /** - * Print the help messages for the browse command - */ - protected void printHelp() { - context.printHelp(helpFile); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/ShellCommand$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/ShellCommand$1.class deleted file mode 100644 index a244d3f40..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/ShellCommand$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/ShellCommand.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/ShellCommand.class deleted file mode 100644 index 45aa1a3b9..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/ShellCommand.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/ShellCommand.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/ShellCommand.java deleted file mode 100644 index 6c5ccd996..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/ShellCommand.java +++ /dev/null @@ -1,173 +0,0 @@ -/** - * 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.console.command; - -import org.apache.activemq.console.CommandContext; -import org.apache.activemq.console.formatter.CommandShellOutputFormatter; - -import java.io.InputStream; -import java.io.PrintStream; -import java.util.*; - -public class ShellCommand extends AbstractCommand { - - private boolean interactive; - private String[] helpFile; - - public ShellCommand() { - this(false); - } - - public ShellCommand(boolean interactive) { - this.interactive = interactive; - ArrayList help = new ArrayList(); - help.addAll(Arrays.asList(new String[] { - interactive ? "Usage: [task] [task-options] [task data]" : "Usage: Main [--extdir ] [task] [task-options] [task data]", - "", - "Tasks:"})); - - ArrayList commands = getCommands(); - Collections.sort(commands, new Comparator() { - @Override - public int compare(Command command, Command command1) { - return command.getName().compareTo(command1.getName()); - } - }); - - for( Command command: commands) { - help.add(String.format(" %-24s - %s", command.getName(), command.getOneLineDescription())); - } - - help.addAll(Arrays.asList(new String[] { - "", - "Task Options (Options specific to each task):", - " --extdir - Add the jar files in the directory to the classpath.", - " --version - Display the version information.", - " -h,-?,--help - Display this help information. To display task specific help, use " + (interactive ? "" : "Main ") + "[task] -h,-?,--help", - "", - "Task Data:", - " - Information needed by each specific task.", - "", - "JMX system property options:", - " -Dactivemq.jmx.url= (default is: 'service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi')", - " -Dactivemq.jmx.user=", - " -Dactivemq.jmx.password=", - "" - })); - - this.helpFile = help.toArray(new String[help.size()]); - } - - @Override - public String getName() { - return "shell"; - } - - @Override - public String getOneLineDescription() { - return "Runs the activemq sub shell"; - } - - /** - * Main method to run a command shell client. - * - * @param args - command line arguments - * @param in - input stream to use - * @param out - output stream to use - * @return 0 for a successful run, -1 if there are any exception - */ - public static int main(String[] args, InputStream in, PrintStream out) { - - CommandContext context = new CommandContext(); - context.setFormatter(new CommandShellOutputFormatter(out)); - - // Convert arguments to list for easier management - List tokens = new ArrayList(Arrays.asList(args)); - - ShellCommand main = new ShellCommand(); - try { - main.setCommandContext(context); - main.execute(tokens); - return 0; - } catch (Exception e) { - context.printException(e); - return -1; - } - } - - public boolean isInteractive() { - return interactive; - } - - public void setInteractive(boolean interactive) { - this.interactive = interactive; - } - - /** - * Parses for specific command task. - * - * @param tokens - command arguments - * @throws Exception - */ - protected void runTask(List tokens) throws Exception { - - // Process task token - if (tokens.size() > 0) { - Command command=null; - String taskToken = (String)tokens.remove(0); - - - for( Command c: getCommands() ) { - if( taskToken.equals(c.getName()) ) { - command = c; - break; - } - } - if( command == null ) { - if (taskToken.equals("help")) { - printHelp(); - } else { - printHelp(); - } - } - - if( command!=null ) { - command.setCommandContext(context); - command.execute(tokens); - } - } else { - printHelp(); - } - - } - - ArrayList getCommands() { - ServiceLoader loader = ServiceLoader.load(Command.class); - ArrayList rc = new ArrayList(); - for( Command command: loader ) { - rc.add(command); - } - return rc; - } - - /** - * Print the help messages for the browse command - */ - protected void printHelp() { - context.printHelp(helpFile); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/ShutdownCommand.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/ShutdownCommand.class deleted file mode 100644 index b889cc80d..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/ShutdownCommand.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/ShutdownCommand.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/ShutdownCommand.java deleted file mode 100644 index aafa187a1..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/ShutdownCommand.java +++ /dev/null @@ -1,176 +0,0 @@ -/** - * 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.console.command; - -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; - -import javax.management.MBeanServerConnection; -import javax.management.ObjectInstance; -import javax.management.ObjectName; - -import org.apache.activemq.console.util.JmxMBeansUtil; - -public class ShutdownCommand extends AbstractJmxCommand { - - protected String[] helpFile = new String[] { - "Task Usage: Main stop [stop-options] [broker-name1] [broker-name2] ...", - "Description: Stops a running broker.", - "", - "Stop Options:", - " --jmxurl Set the JMX URL to connect to.", - " --pid Set the pid to connect to (only on Sun JVM).", - " --jmxuser Set the JMX user used for authenticating.", - " --jmxpassword Set the JMX password used for authenticating.", - " --jmxlocal Use the local JMX server instead of a remote one.", - " --all Stop all brokers.", - " --version Display the version information.", - " -h,-?,--help Display the stop broker help information.", - "", - "Broker Names:", - " Name of the brokers that will be stopped.", - " If omitted, it is assumed that there is only one broker running, and it will be stopped.", - " Use -all to stop all running brokers.", - "" - }; - - private boolean isStopAllBrokers; - - @Override - public String getName() { - return "stop"; - } - - @Override - public String getOneLineDescription() { - return "Stops a running broker specified by the broker name."; - } - - /** - * Shuts down the specified broker or brokers - * - * @param brokerNames - names of brokers to shutdown - * @throws Exception - */ - protected void runTask(List brokerNames) throws Exception { - try { - Collection mbeans; - - // Stop all brokers - if (isStopAllBrokers) { - mbeans = JmxMBeansUtil.getAllBrokers(createJmxConnection()); - brokerNames.clear(); - } else if (brokerNames.isEmpty()) { - // Stop the default broker - mbeans = JmxMBeansUtil.getAllBrokers(createJmxConnection()); - // If there is no broker to stop - if (mbeans.isEmpty()) { - context.printInfo("There are no brokers to stop."); - return; - - // There should only be one broker to stop - } else if (mbeans.size() > 1) { - context.printInfo("There are multiple brokers to stop. Please select the broker(s) to stop or use --all to stop all brokers."); - return; - - // Get the first broker only - } else { - Object firstBroker = mbeans.iterator().next(); - mbeans.clear(); - mbeans.add(firstBroker); - } - } else { - // Stop each specified broker - String brokerName; - mbeans = new HashSet(); - while (!brokerNames.isEmpty()) { - brokerName = (String)brokerNames.remove(0); - Collection matchedBrokers = JmxMBeansUtil.getBrokersByName(createJmxConnection(), brokerName); - if (matchedBrokers.isEmpty()) { - context.printInfo(brokerName + " did not match any running brokers."); - } else { - mbeans.addAll(matchedBrokers); - } - } - } - - // Stop all brokers in set - stopBrokers(createJmxConnection(), mbeans); - } catch (Exception e) { - context.printException(new RuntimeException("Failed to execute stop task. Reason: " + e)); - throw new Exception(e); - } - } - - /** - * Stops the list of brokers. - * - * @param jmxConnection - connection to the mbean server - * @param brokerBeans - broker mbeans to stop @throws Exception - */ - protected void stopBrokers(MBeanServerConnection jmxConnection, Collection brokerBeans) throws Exception { - ObjectName brokerObjName; - for (Iterator i = brokerBeans.iterator(); i.hasNext();) { - brokerObjName = ((ObjectInstance)i.next()).getObjectName(); - - String brokerName = brokerObjName.getKeyProperty("brokerName"); - context.print("Stopping broker: " + brokerName); - - try { - jmxConnection.invoke(brokerObjName, "terminateJVM", new Object[] { - Integer.valueOf(0) - }, new String[] { - "int" - }); - context.print("Succesfully stopped broker: " + brokerName); - } catch (Exception e) { - // TODO: Check exceptions throwned - // System.out.println("Failed to stop broker: [ " + brokerName + - // " ]. Reason: " + e.getMessage()); - } - } - - closeJmxConnection(); - } - - /** - * Handle the --all option. - * - * @param token - option token to handle - * @param tokens - succeeding command arguments - * @throws Exception - */ - protected void handleOption(String token, List tokens) throws Exception { - // Try to handle the options first - if (token.equals("--all")) { - isStopAllBrokers = true; - } else { - // Let the super class handle the option - super.handleOption(token, tokens); - } - } - - /** - * Print the help messages for the browse command - */ - protected void printHelp() { - context.printHelp(helpFile); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/StartCommand$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/StartCommand$1.class deleted file mode 100644 index a225dd02f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/StartCommand$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/StartCommand$2.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/StartCommand$2.class deleted file mode 100644 index 9227ce678..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/StartCommand$2.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/StartCommand.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/StartCommand.class deleted file mode 100644 index ced88a7e3..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/StartCommand.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/StartCommand.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/StartCommand.java deleted file mode 100644 index be3ffc3b1..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/StartCommand.java +++ /dev/null @@ -1,139 +0,0 @@ -/** - * 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.console.command; - -import java.net.URI; -import java.util.List; -import java.util.concurrent.CountDownLatch; - -import org.apache.activemq.broker.BrokerFactory; -import org.apache.activemq.broker.BrokerService; - -public class StartCommand extends AbstractCommand { - - public static final String DEFAULT_CONFIG_URI = "xbean:activemq.xml"; - - protected String[] helpFile = new String[] { - "Task Usage: Main start [start-options] [uri]", - "Description: Creates and starts a broker using a configuration file, or a broker URI.", - "", - "Start Options:", - " -D= Define a system property.", - " --version Display the version information.", - " -h,-?,--help Display the start broker help information.", - "", - "URI:", - "", - " XBean based broker configuration:", - "", - " Example: Main xbean:file:activemq.xml", - " Loads the xbean configuration file from the current working directory", - " Example: Main xbean:activemq.xml", - " Loads the xbean configuration file from the classpath", - "", - " URI Parameter based broker configuration:", - "", - " Example: Main broker:(tcp://localhost:61616, tcp://localhost:5000)?useJmx=true", - " Configures the broker with 2 transport connectors and jmx enabled", - " Example: Main broker:(tcp://localhost:61616, network:tcp://localhost:5000)?persistent=false", - " Configures the broker with 1 transport connector, and 1 network connector and persistence disabled", - "" - }; - - @Override - public String getName() { - return "start"; - } - - @Override - public String getOneLineDescription() { - return "Creates and starts a broker using a configuration file, or a broker URI."; - } - - /** - * The default task to start a broker or a group of brokers - * - * @param brokerURIs - */ - protected void runTask(List brokerURIs) throws Exception { - URI configURI; - - while( true ) { - final BrokerService broker; - try { - // If no config uri, use default setting - if (brokerURIs.isEmpty()) { - configURI = new URI(DEFAULT_CONFIG_URI); - } else { - configURI = new URI(brokerURIs.get(0)); - } - - System.out.println("Loading message broker from: " + configURI); - broker = BrokerFactory.createBroker(configURI); - broker.start(); - - } catch (Exception e) { - context.printException(new RuntimeException("Failed to execute start task. Reason: " + e, e)); - throw e; - } - - if (!broker.waitUntilStarted()) { - throw new Exception(broker.getStartException()); - } - - // The broker started up fine. Now lets wait for it to stop... - final CountDownLatch shutdownLatch = new CountDownLatch(1); - final Thread jvmShutdownHook = new Thread() { - public void run() { - try { - broker.stop(); - } catch (Exception e) { - } - } - }; - - Runtime.getRuntime().addShutdownHook(jvmShutdownHook); - broker.addShutdownHook(new Runnable() { - public void run() { - shutdownLatch.countDown(); - } - }); - - // The broker has stopped.. - shutdownLatch.await(); - try { - Runtime.getRuntime().removeShutdownHook(jvmShutdownHook); - } catch (Throwable e) { - // may already be shutdown in progress so ignore - } - - if( !broker.isRestartRequested() ) { - break; - } - System.out.println("Restarting broker"); - } - } - - /** - * Print the help messages for the browse command - */ - protected void printHelp() { - context.printHelp(helpFile); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/StopGracefullyCommand.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/StopGracefullyCommand.class deleted file mode 100644 index a72f27388..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/StopGracefullyCommand.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/StopGracefullyCommand.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/StopGracefullyCommand.java deleted file mode 100644 index 56e3b482e..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/StopGracefullyCommand.java +++ /dev/null @@ -1,147 +0,0 @@ -/** - * 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.console.command; - - -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import javax.management.MBeanServerConnection; -import javax.management.ObjectInstance; -import javax.management.ObjectName; - - -/** - * A StopGracefullyCommand - * - */ -public class StopGracefullyCommand extends ShutdownCommand { - - @Override - public String getName() { - return "stop-gracefully"; - } - - @Override - public String getOneLineDescription() { - return "Stops a running broker gracefully."; - } - - protected String connectorName, queueName; - protected long timeout; - protected long pollInterval; - /** - * Constructor - */ - public StopGracefullyCommand(){ - super(); - this.helpFile = new String[] { - "Task Usage: Main stopGracefully [stop-options] [broker-name1] [broker-name2] ...", - "Description: Stops a running broker if there is no pending messages in the queues. It first stops the connector for client connection, then check queuesize until it becomes 0 before stop the broker.", - "", - "Stop Options:", - " --connectorName connectorName to stop", - " --queueName check the queuesize of the queueName for pending message", - " --timeout periodically check the queuesize before the timeout expires", - " --pollInterval the time interval it checks the queuesize", - " --jmxurl Set the JMX URL to connect to.", - " --jmxuser Set the JMX user used for authenticating.", - " --jmxpassword Set the JMX password used for authenticating.", - " --jmxlocal Use the local JMX server instead of a remote one.", - " --localProcessId Use the local process id to connect( ignore jmxurl, jmxuser, jmxpassword), need to be root to use this option", - " --all Stop all brokers.", - " --version Display the version information.", - " -h,-?,--help Display the stop broker help information.", - "", - "Broker Names:", - " Name of the brokers that will be stopped.", - " If omitted, it is assumed that there is only one broker running, and it will be stopped.", - " Use -all to stop all running brokers.", - "" - }; - } - - /** - * Stops the list of brokers. - * - * @param jmxConnection - connection to the mbean server - * @param brokerBeans - broker mbeans to stop @throws Exception - */ - protected void stopBrokers(MBeanServerConnection jmxConnection, Collection brokerBeans) throws Exception { - ObjectName brokerObjName; - for (Iterator i = brokerBeans.iterator(); i.hasNext();) { - brokerObjName = ((ObjectInstance)i.next()).getObjectName(); - - String brokerName = brokerObjName.getKeyProperty("BrokerName"); - context.print("Stopping broker: " + brokerName); - - try { - jmxConnection.invoke(brokerObjName, "stopGracefully", new Object[] { - connectorName, queueName, timeout, pollInterval - }, new String[] { - "java.lang.String", "java.lang.String", "long", "long" - }); - context.print("Succesfully stopped broker: " + brokerName); - } catch (Exception e) { - if(!(e.getMessage().startsWith("Error unmarshaling return header"))){ - context.print("Exception:"+e.getMessage()); - } - } - } - - closeJmxConnection(); - } - /** - * @param token - option token to handle - * @param tokens - succeeding command arguments - * @throws Exception - */ - protected void handleOption(String token, List tokens) throws Exception { - // Try to handle the options first - if (token.equals("--connectorName")) { - if (tokens.isEmpty() || ((String)tokens.get(0)).startsWith("-")) { - context.printException(new IllegalArgumentException("connectorName not specified")); - return; - } - - connectorName=(String)tokens.remove(0); - } else if (token.equals("--timeout")) { - if (tokens.isEmpty() || ((String)tokens.get(0)).startsWith("-")) { - context.printException(new IllegalArgumentException("timeout not specified")); - return; - } - timeout=Long.parseLong(tokens.remove(0)); - } else if (token.equals("--pollInterval")) { - if (tokens.isEmpty() || ((String)tokens.get(0)).startsWith("-")) { - context.printException(new IllegalArgumentException("pollInterval not specified")); - return; - } - pollInterval=Long.parseLong(tokens.remove(0)); - }else if(token.equals("--queueName")) { - if (tokens.isEmpty() || ((String)tokens.get(0)).startsWith("-")) { - context.printException(new IllegalArgumentException("queueName not specified")); - return; - } - queueName=(String)tokens.remove(0); - }else { - // Let the super class handle the option - super.handleOption(token, tokens); - } - } - -} \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/StoreExportCommand.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/StoreExportCommand.class deleted file mode 100644 index 07f89589f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/StoreExportCommand.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/StoreExportCommand.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/StoreExportCommand.java deleted file mode 100644 index c53add703..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/StoreExportCommand.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * 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.console.command; - -import org.apache.activemq.console.CommandContext; -import org.apache.activemq.console.command.store.StoreExporter; -import org.apache.activemq.console.command.store.amq.CommandLineSupport; - -import java.util.Arrays; -import java.util.List; - -/** - * @author Hiram Chirino - */ -public class StoreExportCommand implements Command { - - private CommandContext context; - - @Override - public void setCommandContext(CommandContext context) { - this.context = context; - } - - @Override - public String getName() { - return "export"; - } - - @Override - public String getOneLineDescription() { - return "Exports a stopped brokers data files to an archive file"; - } - - @Override - public void execute(List tokens) throws Exception { - StoreExporter exporter = new StoreExporter(); - String[] remaining = CommandLineSupport.setOptions(exporter, tokens.toArray(new String[tokens.size()])); - if (remaining.length > 0) { - throw new Exception("Unexpected arguments: " + Arrays.asList(remaining)); - } - exporter.execute(); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/ExportStreamManager.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/ExportStreamManager.class deleted file mode 100644 index 2a0910fba..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/ExportStreamManager.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/ExportStreamManager.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/ExportStreamManager.java deleted file mode 100644 index d419317d9..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/ExportStreamManager.java +++ /dev/null @@ -1,85 +0,0 @@ -/** - * 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.console.command.store; - -import org.apache.activemq.console.command.store.proto.*; -import org.apache.activemq.console.command.store.tar.TarEntry; -import org.apache.activemq.console.command.store.tar.TarOutputStream; -import org.fusesource.hawtbuf.AsciiBuffer; -import org.fusesource.hawtbuf.Buffer; -import org.fusesource.hawtbuf.proto.MessageBuffer; - -import java.io.IOException; -import java.io.OutputStream; -import java.util.zip.GZIPOutputStream; - -/** - * @author Hiram Chirino - */ -public class ExportStreamManager { - - private final OutputStream target; - private final int version; - TarOutputStream stream; - - ExportStreamManager(OutputStream target, int version) throws IOException { - this.target = target; - this.version = version; - stream = new TarOutputStream(new GZIPOutputStream(target)); - store("ver", new AsciiBuffer(""+version)); - } - - - long seq = 0; - - public void finish() throws IOException { - stream.close(); - } - - private void store(String ext, Buffer value) throws IOException { - TarEntry entry = new TarEntry(seq + "." + ext); - seq += 1; - entry.setSize(value.length()); - stream.putNextEntry(entry); - value.writeTo(stream); - stream.closeEntry(); - } - - private void store(String ext, MessageBuffer value) throws IOException { - TarEntry entry = new TarEntry(seq + "." + ext); - seq += 1; - entry.setSize(value.serializedSizeFramed()); - stream.putNextEntry(entry); - value.writeFramed(stream); - stream.closeEntry(); - } - - - public void store_queue(QueuePB.Getter value) throws IOException { - store("que", value.freeze()); - } - public void store_queue_entry(QueueEntryPB.Getter value) throws IOException { - store("qen", value.freeze()); - } - public void store_message(MessagePB.Getter value) throws IOException { - store("msg", value.freeze()); - } - public void store_map_entry(MapEntryPB.Getter value) throws IOException { - store("map", value.freeze()); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/StoreExporter$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/StoreExporter$1.class deleted file mode 100644 index bc70a9a45..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/StoreExporter$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/StoreExporter$2.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/StoreExporter$2.class deleted file mode 100644 index fa9f51e8d..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/StoreExporter$2.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/StoreExporter$3.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/StoreExporter$3.class deleted file mode 100644 index f69540d74..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/StoreExporter$3.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/StoreExporter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/StoreExporter.class deleted file mode 100644 index 1ef190963..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/StoreExporter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/StoreExporter.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/StoreExporter.java deleted file mode 100644 index c6bc8bd6f..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/StoreExporter.java +++ /dev/null @@ -1,263 +0,0 @@ -/** - * 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.console.command.store; - -import org.apache.activemq.broker.BrokerFactory; -import org.apache.activemq.broker.BrokerService; -import org.apache.activemq.command.*; -import org.apache.activemq.console.command.store.proto.MessagePB; -import org.apache.activemq.console.command.store.proto.QueueEntryPB; -import org.apache.activemq.console.command.store.proto.QueuePB; -import org.apache.activemq.openwire.OpenWireFormat; -import org.apache.activemq.store.*; -import org.codehaus.jackson.map.ObjectMapper; -import org.fusesource.hawtbuf.AsciiBuffer; -import org.fusesource.hawtbuf.DataByteArrayOutputStream; -import org.fusesource.hawtbuf.UTF8Buffer; - -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.HashMap; - -/** - * @author Hiram Chirino - */ -public class StoreExporter { - - static final int OPENWIRE_VERSION = 8; - static final boolean TIGHT_ENCODING = false; - - URI config; - File file; - - private ObjectMapper mapper = new ObjectMapper(); - private final AsciiBuffer ds_kind = new AsciiBuffer("ds"); - private final AsciiBuffer ptp_kind = new AsciiBuffer("ptp"); - private final AsciiBuffer codec_id = new AsciiBuffer("openwire"); - private final OpenWireFormat wireformat = new OpenWireFormat(); - - public StoreExporter() throws URISyntaxException { - config = new URI("xbean:activemq.xml"); - wireformat.setCacheEnabled(false); - wireformat.setTightEncodingEnabled(TIGHT_ENCODING); - wireformat.setVersion(OPENWIRE_VERSION); - } - - public void execute() throws Exception { - if (config == null) { - throw new Exception("required --config option missing"); - } - if (file == null) { - throw new Exception("required --file option missing"); - } - System.out.println("Loading: " + config); - BrokerFactory.setStartDefault(false); // to avoid the broker auto-starting.. - BrokerService broker = BrokerFactory.createBroker(config); - BrokerFactory.resetStartDefault(); - PersistenceAdapter store = broker.getPersistenceAdapter(); - System.out.println("Starting: " + store); - store.start(); - try { - BufferedOutputStream fos = new BufferedOutputStream(new FileOutputStream(file)); - try { - export(store, fos); - } finally { - fos.close(); - } - } finally { - store.stop(); - } - } - - void export(PersistenceAdapter store, BufferedOutputStream fos) throws Exception { - - - final long[] messageKeyCounter = new long[]{0}; - final long[] containerKeyCounter = new long[]{0}; - final ExportStreamManager manager = new ExportStreamManager(fos, 1); - - - final int[] preparedTxs = new int[]{0}; - store.createTransactionStore().recover(new TransactionRecoveryListener() { - public void recover(XATransactionId xid, Message[] addedMessages, MessageAck[] aks) { - preparedTxs[0] += 1; - } - }); - - if (preparedTxs[0] > 0) { - throw new Exception("Cannot export a store with prepared XA transactions. Please commit or rollback those transactions before attempting to export."); - } - - for (ActiveMQDestination odest : store.getDestinations()) { - containerKeyCounter[0]++; - if (odest instanceof ActiveMQQueue) { - ActiveMQQueue dest = (ActiveMQQueue) odest; - MessageStore queue = store.createQueueMessageStore(dest); - - QueuePB.Bean destRecord = new QueuePB.Bean(); - destRecord.setKey(containerKeyCounter[0]); - destRecord.setBindingKind(ptp_kind); - - final long[] seqKeyCounter = new long[]{0}; - - HashMap jsonMap = new HashMap(); - jsonMap.put("@class", "queue_destination"); - jsonMap.put("name", dest.getQueueName()); - String json = mapper.writeValueAsString(jsonMap); - System.out.println(json); - destRecord.setBindingData(new UTF8Buffer(json)); - manager.store_queue(destRecord); - - queue.recover(new MessageRecoveryListener() { - public boolean hasSpace() { - return true; - } - - public boolean recoverMessageReference(MessageId ref) throws Exception { - return true; - } - - public boolean isDuplicate(MessageId ref) { - return false; - } - - public boolean recoverMessage(Message message) throws IOException { - messageKeyCounter[0]++; - seqKeyCounter[0]++; - - MessagePB.Bean messageRecord = createMessagePB(message, messageKeyCounter[0]); - manager.store_message(messageRecord); - - QueueEntryPB.Bean entryRecord = createQueueEntryPB(message, containerKeyCounter[0], seqKeyCounter[0], messageKeyCounter[0]); - manager.store_queue_entry(entryRecord); - - return true; - } - }); - - } else if (odest instanceof ActiveMQTopic) { - ActiveMQTopic dest = (ActiveMQTopic) odest; - - TopicMessageStore topic = store.createTopicMessageStore(dest); - for (SubscriptionInfo sub : topic.getAllSubscriptions()) { - - QueuePB.Bean destRecord = new QueuePB.Bean(); - destRecord.setKey(containerKeyCounter[0]); - destRecord.setBindingKind(ds_kind); - - // TODO: use a real JSON encoder like jackson. - HashMap jsonMap = new HashMap(); - jsonMap.put("@class", "dsub_destination"); - jsonMap.put("name", sub.getClientId() + ":" + sub.getSubcriptionName()); - HashMap jsonTopic = new HashMap(); - jsonTopic.put("name", dest.getTopicName()); - jsonMap.put("topics", new Object[]{jsonTopic}); - if (sub.getSelector() != null) { - jsonMap.put("selector", sub.getSelector()); - } - String json = mapper.writeValueAsString(jsonMap); - System.out.println(json); - - destRecord.setBindingData(new UTF8Buffer(json)); - manager.store_queue(destRecord); - - final long seqKeyCounter[] = new long[]{0}; - topic.recoverSubscription(sub.getClientId(), sub.getSubcriptionName(), new MessageRecoveryListener() { - public boolean hasSpace() { - return true; - } - - public boolean recoverMessageReference(MessageId ref) throws Exception { - return true; - } - - public boolean isDuplicate(MessageId ref) { - return false; - } - - public boolean recoverMessage(Message message) throws IOException { - messageKeyCounter[0]++; - seqKeyCounter[0]++; - - MessagePB.Bean messageRecord = createMessagePB(message, messageKeyCounter[0]); - manager.store_message(messageRecord); - - QueueEntryPB.Bean entryRecord = createQueueEntryPB(message, containerKeyCounter[0], seqKeyCounter[0], messageKeyCounter[0]); - manager.store_queue_entry(entryRecord); - return true; - } - }); - - } - } - } - manager.finish(); - } - - private QueueEntryPB.Bean createQueueEntryPB(Message message, long queueKey, long queueSeq, long messageKey) { - QueueEntryPB.Bean entryRecord = new QueueEntryPB.Bean(); - entryRecord.setQueueKey(queueKey); - entryRecord.setQueueSeq(queueSeq); - entryRecord.setMessageKey(messageKey); - entryRecord.setSize(message.getSize()); - if (message.getExpiration() != 0) { - entryRecord.setExpiration(message.getExpiration()); - } - if (message.getRedeliveryCounter() != 0) { - entryRecord.setRedeliveries(message.getRedeliveryCounter()); - } - return entryRecord; - } - - private MessagePB.Bean createMessagePB(Message message, long messageKey) throws IOException { - DataByteArrayOutputStream mos = new DataByteArrayOutputStream(); - mos.writeBoolean(TIGHT_ENCODING); - mos.writeVarInt(OPENWIRE_VERSION); - wireformat.marshal(message, mos); - - MessagePB.Bean messageRecord = new MessagePB.Bean(); - messageRecord.setCodec(codec_id); - messageRecord.setMessageKey(messageKey); - messageRecord.setSize(message.getSize()); - messageRecord.setValue(mos.toBuffer()); - return messageRecord; - } - - public File getFile() { - return file; - } - - public void setFile(String file) { - setFile(new File(file)); - } - - public void setFile(File file) { - this.file = file; - } - - public URI getConfig() { - return config; - } - - public void setConfig(URI config) { - this.config = config; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/amq/CommandLineSupport.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/amq/CommandLineSupport.class deleted file mode 100644 index 665ea723f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/amq/CommandLineSupport.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/amq/CommandLineSupport.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/amq/CommandLineSupport.java deleted file mode 100644 index 4844945b3..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/amq/CommandLineSupport.java +++ /dev/null @@ -1,123 +0,0 @@ -/** - * 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.console.command.store.amq; - -import java.util.ArrayList; - -import org.apache.activemq.util.IntrospectionSupport; - -/** - * Helper utility that can be used to set the properties on any object using - * command line arguments. - * - * @author Hiram Chirino - */ -public final class CommandLineSupport { - - private CommandLineSupport() { - } - - /** - * Sets the properties of an object given the command line args. - * - * if args contains: --ack-mode=AUTO --url=tcp://localhost:61616 --persistent - * - * then it will try to call the following setters on the target object. - * - * target.setAckMode("AUTO"); - * target.setURL(new URI("tcp://localhost:61616") ); - * target.setPersistent(true); - * - * Notice the the proper conversion for the argument is determined by examining the - * setter arguement type. - * - * @param target the object that will have it's properties set - * @param args the commline options - * @return any arguments that are not valid options for the target - */ - public static String[] setOptions(Object target, String[] args) { - ArrayList rc = new ArrayList(); - - for (int i = 0; i < args.length; i++) { - if (args[i] == null) { - continue; - } - - if (args[i].startsWith("--")) { - - // --options without a specified value are considered boolean - // flags that are enabled. - String value = "true"; - String name = args[i].substring(2); - - // if --option=value case - int p = name.indexOf("="); - if (p > 0) { - value = name.substring(p + 1); - name = name.substring(0, p); - } - - // name not set, then it's an unrecognized option - if (name.length() == 0) { - rc.add(args[i]); - continue; - } - - String propName = convertOptionToPropertyName(name); - if (!IntrospectionSupport.setProperty(target, propName, value)) { - rc.add(args[i]); - continue; - } - } else { - rc.add(args[i]); - } - - } - - String r[] = new String[rc.size()]; - rc.toArray(r); - return r; - } - - /** - * converts strings like: test-enabled to testEnabled - * - * @param name - * @return - */ - private static String convertOptionToPropertyName(String name) { - String rc = ""; - - // Look for '-' and strip and then convert the subsequent char to - // uppercase - int p = name.indexOf("-"); - while (p > 0) { - // strip - rc += name.substring(0, p); - name = name.substring(p + 1); - - // can I convert the next char to upper? - if (name.length() > 0) { - rc += name.substring(0, 1).toUpperCase(); - name = name.substring(1); - } - - p = name.indexOf("-"); - } - return rc + name; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/amq/help.txt b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/amq/help.txt deleted file mode 100644 index afc70fb88..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/amq/help.txt +++ /dev/null @@ -1,52 +0,0 @@ -Usage: - java org.apache.activemq.console.command.store.amq.AMQJournalTool [options]* (directory) * - -Displays the records stored in the Journal log files used by ActiveMQ. This -tool supports loading the journal data files from multiple directories. Normally -it is run against the journal archive directory and the active journal directory. - -This tool supports controlling the output format using Velocity [1] templates. -It also supports filtering out records using a SQL like WHERE syntax implemented -using JoSQL. - -Options to control output format: - -Any valid Velocity Template Language (VTL) expression can be used to control the -display of the record. - - --message-format=VTL The format used to display message records. Message - records get created every time a producer sends a persistent message to the broker. - The message gets recorded in the journal even if it's transaction is rolled back. - Default VTL: ${location.dataFileId},${location.offset}|${type}|${record.destination}|${record.messageId}|${record.properties}|${body} - - --topic-ack-format=VTL The format used to display topic ack records. A topic - ack records that a durable subscription for a topic has acknowleged a set of messages. - Default VTL: ${location.dataFileId},${location.offset}|${type}|${record.destination}|${record.clientId}|${record.subscritionName}|${record.messageId} - - --queue-ack-format=VTL The format used to display queue ack records. A queue - ack records that a consumer for a quue has acknowleged a message. - Default VTL: ${location.dataFileId},${location.offset}|${type}|${record.destination}|${record.messageAck.lastMessageId} - - --transaction-format=VTL The format used to display transaction records. Transaction records - are used to record transaction related actions like commit and rollback. - Default VTL: ${location.dataFileId},${location.offset}|${type}|${record.transactionId} - - --trace-format=VTL The format used to display trace records. - Trace records are informational messages stored in the journal that assist in Auditing. - For example a trace message is recorded whenever the broker is restarted or when the - long term store is checkpointed. - Default VTL: ${location.dataFileId},${location.offset}|${type}|${record.message} - -Options to control the selection of records displayed: - --where=VALUE The where clause used to control the records selected - for display. It can select on all the fields available in the velocity context. - example: --where="type='ActiveMQTextMessage' and location.dataFileId > 2" - -Other Options: - --help Show this help screen. - -Example: - - java org.apache.activemq.console.command.store.amq.AMQJournalTool /path/to/archive /path/to/journal - - \ No newline at end of file diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/MapEntryPB$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/MapEntryPB$1.class deleted file mode 100644 index 9f4965634..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/MapEntryPB$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/MapEntryPB$Bean.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/MapEntryPB$Bean.class deleted file mode 100644 index b88f79a79..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/MapEntryPB$Bean.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/MapEntryPB$Buffer.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/MapEntryPB$Buffer.class deleted file mode 100644 index 862ca7b0c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/MapEntryPB$Buffer.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/MapEntryPB$Getter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/MapEntryPB$Getter.class deleted file mode 100644 index 5d4f78e23..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/MapEntryPB$Getter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/MapEntryPB.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/MapEntryPB.class deleted file mode 100644 index feea76bc9..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/MapEntryPB.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/MapEntryPB.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/MapEntryPB.java deleted file mode 100644 index 1357fdabf..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/MapEntryPB.java +++ /dev/null @@ -1,472 +0,0 @@ -// -// Generated by protoc, do not edit by hand. -// -package org.apache.activemq.console.command.store.proto; - - -public class MapEntryPB implements org.fusesource.hawtbuf.proto.PBMessageFactory { - - public static final MapEntryPB FACTORY = new MapEntryPB(); - public static final org.fusesource.hawtbuf.proto.PBMessageFramedCodec FRAMED_CODEC = new org.fusesource.hawtbuf.proto.PBMessageFramedCodec(FACTORY); - public static final org.fusesource.hawtbuf.proto.PBMessageUnframedCodec UNFRAMED_CODEC = new org.fusesource.hawtbuf.proto.PBMessageUnframedCodec(FACTORY); - - public Bean create() { - return new Bean(); - } - - public Bean parseUnframed(org.fusesource.hawtbuf.proto.CodedInputStream data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException, java.io.IOException { - return new Bean().mergeUnframed(data); - } - - public Bean parseUnframed(java.io.InputStream data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException, java.io.IOException { - return parseUnframed(new org.fusesource.hawtbuf.proto.CodedInputStream(data)); - } - - public Buffer parseUnframed(org.fusesource.hawtbuf.Buffer data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException { - return new Buffer(data); - } - - public Buffer parseUnframed(byte[] data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException { - return parseUnframed(new org.fusesource.hawtbuf.Buffer(data)); - } - - public Buffer parseFramed(org.fusesource.hawtbuf.proto.CodedInputStream data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException, java.io.IOException { - int length = data.readRawVarint32(); - int oldLimit = data.pushLimit(length); - Buffer rc = parseUnframed(data.readRawBytes(length)); - data.popLimit(oldLimit); - return rc; - } - - public Buffer parseFramed(org.fusesource.hawtbuf.Buffer data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException { - try { - org.fusesource.hawtbuf.proto.CodedInputStream input = new org.fusesource.hawtbuf.proto.CodedInputStream(data); - Buffer rc = parseFramed(input); - input.checkLastTagWas(0); - return rc; - } catch (org.fusesource.hawtbuf.proto.InvalidProtocolBufferException e) { - throw e; - } catch (java.io.IOException e) { - throw new RuntimeException("An IOException was thrown (should never happen in this method).", e); - } - } - - public Buffer parseFramed(byte[] data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException { - return parseFramed(new org.fusesource.hawtbuf.Buffer(data)); - } - - public Buffer parseFramed(java.io.InputStream data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException, java.io.IOException { - return parseUnframed(org.fusesource.hawtbuf.proto.MessageBufferSupport.readFrame(data)); - } - - public interface Getter extends org.fusesource.hawtbuf.proto.PBMessage { - - // required bytes key = 1; - public boolean hasKey(); - public org.fusesource.hawtbuf.Buffer getKey(); - // optional bytes value = 2; - public boolean hasValue(); - public org.fusesource.hawtbuf.Buffer getValue(); - public Bean copy(); - public Buffer freeze(); - public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix); - } - - static public final class Bean implements Getter { - - Buffer frozen; - Bean bean; - - public Bean() { - this.bean = this; - } - - public Bean(Bean copy) { - this.bean = copy; - } - - public Bean copy() { - return new Bean(bean); - } - - public boolean frozen() { - return frozen!=null; - } - - public Buffer freeze() { - if( frozen==null ) { - frozen = new Buffer(bean); - assert deepFreeze(); - } - return frozen; - } - - private boolean deepFreeze() { - frozen.serializedSizeUnframed(); - return true; - } - - private void copyCheck() { - assert frozen==null : org.fusesource.hawtbuf.proto.MessageBufferSupport.FORZEN_ERROR_MESSAGE; - if (bean != this) { - copy(bean); - } - } - - private void copy(Bean other) { - this.bean = this; - this.f_key = other.f_key; - this.f_value = other.f_value; - } - - // required bytes key = 1; - private org.fusesource.hawtbuf.Buffer f_key = null; - - public boolean hasKey() { - return bean.f_key!=null; - } - - public org.fusesource.hawtbuf.Buffer getKey() { - return bean.f_key; - } - - public Bean setKey(org.fusesource.hawtbuf.Buffer key) { - copyCheck(); - this.f_key = key; - return this; - } - - public void clearKey() { - copyCheck(); - this.f_key = null; - } - - // optional bytes value = 2; - private org.fusesource.hawtbuf.Buffer f_value = null; - - public boolean hasValue() { - return bean.f_value!=null; - } - - public org.fusesource.hawtbuf.Buffer getValue() { - return bean.f_value; - } - - public Bean setValue(org.fusesource.hawtbuf.Buffer value) { - copyCheck(); - this.f_value = value; - return this; - } - - public void clearValue() { - copyCheck(); - this.f_value = null; - } - - public String toString() { - return toString(new java.lang.StringBuilder(), "").toString(); - } - - public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix) { - if( hasKey() ) { - sb.append(prefix+"key: "); - sb.append(getKey()); - sb.append("\n"); - } - if( hasValue() ) { - sb.append(prefix+"value: "); - sb.append(getValue()); - sb.append("\n"); - } - return sb; - } - - public Bean mergeUnframed(java.io.InputStream input) throws java.io.IOException { - return mergeUnframed(new org.fusesource.hawtbuf.proto.CodedInputStream(input)); - } - - public Bean mergeUnframed(org.fusesource.hawtbuf.proto.CodedInputStream input) throws java.io.IOException { - copyCheck(); - while (true) { - int tag = input.readTag(); - if ((tag & 0x07) == 4) { - return this; - } - switch (tag) { - case 0: - return this; - default: { - break; - } - case 10: - setKey(input.readBytes()); - break; - case 18: - setValue(input.readBytes()); - break; - } - } - } - public boolean equals(Object obj) { - if( obj==this ) - return true; - - if( obj==null || obj.getClass()!=Bean.class ) - return false; - - return equals((Bean)obj); - } - - public boolean equals(Bean obj) { - if (hasKey() ^ obj.hasKey() ) - return false; - if (hasKey() && ( !getKey().equals(obj.getKey()) )) - return false; - if (hasValue() ^ obj.hasValue() ) - return false; - if (hasValue() && ( !getValue().equals(obj.getValue()) )) - return false; - return true; - } - - public int hashCode() { - int rc=2066384; - if (hasKey()) { - rc ^= ( 75327^getKey().hashCode() ); - } - if (hasValue()) { - rc ^= ( 82420049^getValue().hashCode() ); - } - return rc; - } - - public Bean mergeFrom(Getter other) { - copyCheck(); - if (other.hasKey()) { - setKey(other.getKey()); - } - if (other.hasValue()) { - setValue(other.getValue()); - } - return this; - } - - public void clear() { - clearKey(); - clearValue(); - } - - public void readExternal(java.io.DataInput in) throws java.io.IOException { - assert frozen==null : org.fusesource.hawtbuf.proto.MessageBufferSupport.FORZEN_ERROR_MESSAGE; - bean = this; - frozen = null; - { - int size = in.readInt(); - if( size>=0 ) { - byte b[] = new byte[size]; - in.readFully(b); - f_key = new org.fusesource.hawtbuf.Buffer(b); - } else { - f_key = null; - } - } - { - int size = in.readInt(); - if( size>=0 ) { - byte b[] = new byte[size]; - in.readFully(b); - f_value = new org.fusesource.hawtbuf.Buffer(b); - } else { - f_value = null; - } - } - } - - public void writeExternal(java.io.DataOutput out) throws java.io.IOException { - if( bean.f_key!=null ) { - out.writeInt(bean.f_key.getLength()); - out.write(bean.f_key.getData(), bean.f_key.getOffset(), bean.f_key.getLength()); - } else { - out.writeInt(-1); - } - if( bean.f_value!=null ) { - out.writeInt(bean.f_value.getLength()); - out.write(bean.f_value.getData(), bean.f_value.getOffset(), bean.f_value.getLength()); - } else { - out.writeInt(-1); - } - } - - } - - static public final class Buffer implements org.fusesource.hawtbuf.proto.MessageBuffer, Getter { - - private Bean bean; - private org.fusesource.hawtbuf.Buffer buffer; - private int size=-1; - private int hashCode; - - private Buffer(org.fusesource.hawtbuf.Buffer buffer) { - this.buffer = buffer; - } - - private Buffer(Bean bean) { - this.bean = bean; - } - - public Bean copy() { - return bean().copy(); - } - - public Buffer freeze() { - return this; - } - - private Bean bean() { - if (bean == null) { - try { - bean = new Bean().mergeUnframed(new org.fusesource.hawtbuf.proto.CodedInputStream(buffer)); - bean.frozen=this; - } catch (org.fusesource.hawtbuf.proto.InvalidProtocolBufferException e) { - throw new RuntimeException(e); - } catch (java.io.IOException e) { - throw new RuntimeException("An IOException was thrown (should never happen in this method).", e); - } - } - return bean; - } - - public String toString() { - return bean().toString(); - } - - public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix) { - return bean().toString(sb, prefix); - } - - // required bytes key = 1; - public boolean hasKey() { - return bean().hasKey(); - } - - public org.fusesource.hawtbuf.Buffer getKey() { - return bean().getKey(); - } - - // optional bytes value = 2; - public boolean hasValue() { - return bean().hasValue(); - } - - public org.fusesource.hawtbuf.Buffer getValue() { - return bean().getValue(); - } - - public org.fusesource.hawtbuf.Buffer toUnframedBuffer() { - if( buffer !=null ) { - return buffer; - } - return org.fusesource.hawtbuf.proto.MessageBufferSupport.toUnframedBuffer(this); - } - - public org.fusesource.hawtbuf.Buffer toFramedBuffer() { - return org.fusesource.hawtbuf.proto.MessageBufferSupport.toFramedBuffer(this); - } - - public byte[] toUnframedByteArray() { - return toUnframedBuffer().toByteArray(); - } - - public byte[] toFramedByteArray() { - return toFramedBuffer().toByteArray(); - } - - public void writeFramed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException { - output.writeRawVarint32(serializedSizeUnframed()); - writeUnframed(output); - } - - public void writeFramed(java.io.OutputStream output) throws java.io.IOException { - org.fusesource.hawtbuf.proto.CodedOutputStream codedOutput = new org.fusesource.hawtbuf.proto.CodedOutputStream(output); - writeFramed(codedOutput); - codedOutput.flush(); - } - - public void writeUnframed(java.io.OutputStream output) throws java.io.IOException { - org.fusesource.hawtbuf.proto.CodedOutputStream codedOutput = new org.fusesource.hawtbuf.proto.CodedOutputStream(output); - writeUnframed(codedOutput); - codedOutput.flush(); - } - - public void writeUnframed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException { - if (buffer == null) { - int size = serializedSizeUnframed(); - buffer = output.getNextBuffer(size); - org.fusesource.hawtbuf.proto.CodedOutputStream original=null; - if( buffer == null ) { - buffer = new org.fusesource.hawtbuf.Buffer(new byte[size]); - original = output; - output = new org.fusesource.hawtbuf.proto.CodedOutputStream(buffer); - } - output.writeBytes(1, bean.getKey()); - if (bean.hasValue()) { - output.writeBytes(2, bean.getValue()); - } - if( original !=null ) { - output.checkNoSpaceLeft(); - output = original; - output.writeRawBytes(buffer); - } - } else { - output.writeRawBytes(buffer); - } - } - - public int serializedSizeFramed() { - int t = serializedSizeUnframed(); - return org.fusesource.hawtbuf.proto.CodedOutputStream.computeRawVarint32Size(t) + t; - } - - public int serializedSizeUnframed() { - if (buffer != null) { - return buffer.length; - } - if (size != -1) - return size; - - size = 0; - size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(1, getKey()); - if (hasValue()) { - size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(2, getValue()); - } - return size; - } - - public boolean equals(Object obj) { - if( obj==this ) - return true; - - if( obj==null || obj.getClass()!=Buffer.class ) - return false; - - return equals((Buffer)obj); - } - - public boolean equals(Buffer obj) { - return toUnframedBuffer().equals(obj.toUnframedBuffer()); - } - - public int hashCode() { - if( hashCode==0 ) { - hashCode=2000715872 ^ toUnframedBuffer().hashCode(); - } - return hashCode; - } - - public boolean frozen() { - return true; - } - } - -} - diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/MessagePB$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/MessagePB$1.class deleted file mode 100644 index 08e7d9ae4..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/MessagePB$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/MessagePB$Bean.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/MessagePB$Bean.class deleted file mode 100644 index 326bb2343..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/MessagePB$Bean.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/MessagePB$Buffer.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/MessagePB$Buffer.class deleted file mode 100644 index fd476b685..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/MessagePB$Buffer.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/MessagePB$Getter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/MessagePB$Getter.class deleted file mode 100644 index 9d9521d79..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/MessagePB$Getter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/MessagePB.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/MessagePB.class deleted file mode 100644 index c00b8bf63..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/MessagePB.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/MessagePB.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/MessagePB.java deleted file mode 100644 index 7ef27d1e0..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/MessagePB.java +++ /dev/null @@ -1,1022 +0,0 @@ -// -// Generated by protoc, do not edit by hand. -// -package org.apache.activemq.console.command.store.proto; - - -public class MessagePB implements org.fusesource.hawtbuf.proto.PBMessageFactory { - - public static final MessagePB FACTORY = new MessagePB(); - public static final org.fusesource.hawtbuf.proto.PBMessageFramedCodec FRAMED_CODEC = new org.fusesource.hawtbuf.proto.PBMessageFramedCodec(FACTORY); - public static final org.fusesource.hawtbuf.proto.PBMessageUnframedCodec UNFRAMED_CODEC = new org.fusesource.hawtbuf.proto.PBMessageUnframedCodec(FACTORY); - - public Bean create() { - return new Bean(); - } - - public Bean parseUnframed(org.fusesource.hawtbuf.proto.CodedInputStream data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException, java.io.IOException { - return new Bean().mergeUnframed(data); - } - - public Bean parseUnframed(java.io.InputStream data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException, java.io.IOException { - return parseUnframed(new org.fusesource.hawtbuf.proto.CodedInputStream(data)); - } - - public Buffer parseUnframed(org.fusesource.hawtbuf.Buffer data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException { - return new Buffer(data); - } - - public Buffer parseUnframed(byte[] data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException { - return parseUnframed(new org.fusesource.hawtbuf.Buffer(data)); - } - - public Buffer parseFramed(org.fusesource.hawtbuf.proto.CodedInputStream data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException, java.io.IOException { - int length = data.readRawVarint32(); - int oldLimit = data.pushLimit(length); - Buffer rc = parseUnframed(data.readRawBytes(length)); - data.popLimit(oldLimit); - return rc; - } - - public Buffer parseFramed(org.fusesource.hawtbuf.Buffer data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException { - try { - org.fusesource.hawtbuf.proto.CodedInputStream input = new org.fusesource.hawtbuf.proto.CodedInputStream(data); - Buffer rc = parseFramed(input); - input.checkLastTagWas(0); - return rc; - } catch (org.fusesource.hawtbuf.proto.InvalidProtocolBufferException e) { - throw e; - } catch (java.io.IOException e) { - throw new RuntimeException("An IOException was thrown (should never happen in this method).", e); - } - } - - public Buffer parseFramed(byte[] data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException { - return parseFramed(new org.fusesource.hawtbuf.Buffer(data)); - } - - public Buffer parseFramed(java.io.InputStream data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException, java.io.IOException { - return parseUnframed(org.fusesource.hawtbuf.proto.MessageBufferSupport.readFrame(data)); - } - - public interface Getter extends org.fusesource.hawtbuf.proto.PBMessage { - - // required int64 messageKey = 1; - public boolean hasMessageKey(); - public long getMessageKey(); - // required bytes codec = 2; - public boolean hasCodec(); - public org.fusesource.hawtbuf.AsciiBuffer getCodec(); - // optional int32 size = 3; - public boolean hasSize(); - public int getSize(); - // optional bytes value = 4; - public boolean hasValue(); - public org.fusesource.hawtbuf.Buffer getValue(); - // optional sint64 expiration = 5; - public boolean hasExpiration(); - public long getExpiration(); - // optional int32 compression = 6; - public boolean hasCompression(); - public int getCompression(); - // optional bytes direct_data = 10; - public boolean hasDirectData(); - public org.fusesource.hawtbuf.Buffer getDirectData(); - // optional bytes direct_file = 12; - public boolean hasDirectFile(); - public org.fusesource.hawtbuf.Buffer getDirectFile(); - // optional int64 direct_offset = 13; - public boolean hasDirectOffset(); - public long getDirectOffset(); - // optional int32 direct_size = 14; - public boolean hasDirectSize(); - public int getDirectSize(); - public Bean copy(); - public Buffer freeze(); - public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix); - } - - static public final class Bean implements Getter { - - Buffer frozen; - Bean bean; - - public Bean() { - this.bean = this; - } - - public Bean(Bean copy) { - this.bean = copy; - } - - public Bean copy() { - return new Bean(bean); - } - - public boolean frozen() { - return frozen!=null; - } - - public Buffer freeze() { - if( frozen==null ) { - frozen = new Buffer(bean); - assert deepFreeze(); - } - return frozen; - } - - private boolean deepFreeze() { - frozen.serializedSizeUnframed(); - return true; - } - - private void copyCheck() { - assert frozen==null : org.fusesource.hawtbuf.proto.MessageBufferSupport.FORZEN_ERROR_MESSAGE; - if (bean != this) { - copy(bean); - } - } - - private void copy(Bean other) { - this.bean = this; - this.f_messageKey = other.f_messageKey; - this.b_messageKey = other.b_messageKey; - this.f_codec = other.f_codec; - this.f_size = other.f_size; - this.b_size = other.b_size; - this.f_value = other.f_value; - this.f_expiration = other.f_expiration; - this.b_expiration = other.b_expiration; - this.f_compression = other.f_compression; - this.b_compression = other.b_compression; - this.f_directData = other.f_directData; - this.f_directFile = other.f_directFile; - this.f_directOffset = other.f_directOffset; - this.b_directOffset = other.b_directOffset; - this.f_directSize = other.f_directSize; - this.b_directSize = other.b_directSize; - } - - // required int64 messageKey = 1; - private long f_messageKey = 0; - private boolean b_messageKey; - - public boolean hasMessageKey() { - return bean.b_messageKey; - } - - public long getMessageKey() { - return bean.f_messageKey; - } - - public Bean setMessageKey(long messageKey) { - copyCheck(); - this.b_messageKey = true; - this.f_messageKey = messageKey; - return this; - } - - public void clearMessageKey() { - copyCheck(); - this.b_messageKey = false; - this.f_messageKey = 0; - } - - // required bytes codec = 2; - private org.fusesource.hawtbuf.AsciiBuffer f_codec = null; - - public boolean hasCodec() { - return bean.f_codec!=null; - } - - public org.fusesource.hawtbuf.AsciiBuffer getCodec() { - return bean.f_codec; - } - - public Bean setCodec(org.fusesource.hawtbuf.AsciiBuffer codec) { - copyCheck(); - this.f_codec = codec; - return this; - } - - public void clearCodec() { - copyCheck(); - this.f_codec = null; - } - - // optional int32 size = 3; - private int f_size = 0; - private boolean b_size; - - public boolean hasSize() { - return bean.b_size; - } - - public int getSize() { - return bean.f_size; - } - - public Bean setSize(int size) { - copyCheck(); - this.b_size = true; - this.f_size = size; - return this; - } - - public void clearSize() { - copyCheck(); - this.b_size = false; - this.f_size = 0; - } - - // optional bytes value = 4; - private org.fusesource.hawtbuf.Buffer f_value = null; - - public boolean hasValue() { - return bean.f_value!=null; - } - - public org.fusesource.hawtbuf.Buffer getValue() { - return bean.f_value; - } - - public Bean setValue(org.fusesource.hawtbuf.Buffer value) { - copyCheck(); - this.f_value = value; - return this; - } - - public void clearValue() { - copyCheck(); - this.f_value = null; - } - - // optional sint64 expiration = 5; - private long f_expiration = 0; - private boolean b_expiration; - - public boolean hasExpiration() { - return bean.b_expiration; - } - - public long getExpiration() { - return bean.f_expiration; - } - - public Bean setExpiration(long expiration) { - copyCheck(); - this.b_expiration = true; - this.f_expiration = expiration; - return this; - } - - public void clearExpiration() { - copyCheck(); - this.b_expiration = false; - this.f_expiration = 0; - } - - // optional int32 compression = 6; - private int f_compression = 0; - private boolean b_compression; - - public boolean hasCompression() { - return bean.b_compression; - } - - public int getCompression() { - return bean.f_compression; - } - - public Bean setCompression(int compression) { - copyCheck(); - this.b_compression = true; - this.f_compression = compression; - return this; - } - - public void clearCompression() { - copyCheck(); - this.b_compression = false; - this.f_compression = 0; - } - - // optional bytes direct_data = 10; - private org.fusesource.hawtbuf.Buffer f_directData = null; - - public boolean hasDirectData() { - return bean.f_directData!=null; - } - - public org.fusesource.hawtbuf.Buffer getDirectData() { - return bean.f_directData; - } - - public Bean setDirectData(org.fusesource.hawtbuf.Buffer directData) { - copyCheck(); - this.f_directData = directData; - return this; - } - - public void clearDirectData() { - copyCheck(); - this.f_directData = null; - } - - // optional bytes direct_file = 12; - private org.fusesource.hawtbuf.Buffer f_directFile = null; - - public boolean hasDirectFile() { - return bean.f_directFile!=null; - } - - public org.fusesource.hawtbuf.Buffer getDirectFile() { - return bean.f_directFile; - } - - public Bean setDirectFile(org.fusesource.hawtbuf.Buffer directFile) { - copyCheck(); - this.f_directFile = directFile; - return this; - } - - public void clearDirectFile() { - copyCheck(); - this.f_directFile = null; - } - - // optional int64 direct_offset = 13; - private long f_directOffset = 0; - private boolean b_directOffset; - - public boolean hasDirectOffset() { - return bean.b_directOffset; - } - - public long getDirectOffset() { - return bean.f_directOffset; - } - - public Bean setDirectOffset(long directOffset) { - copyCheck(); - this.b_directOffset = true; - this.f_directOffset = directOffset; - return this; - } - - public void clearDirectOffset() { - copyCheck(); - this.b_directOffset = false; - this.f_directOffset = 0; - } - - // optional int32 direct_size = 14; - private int f_directSize = 0; - private boolean b_directSize; - - public boolean hasDirectSize() { - return bean.b_directSize; - } - - public int getDirectSize() { - return bean.f_directSize; - } - - public Bean setDirectSize(int directSize) { - copyCheck(); - this.b_directSize = true; - this.f_directSize = directSize; - return this; - } - - public void clearDirectSize() { - copyCheck(); - this.b_directSize = false; - this.f_directSize = 0; - } - - public String toString() { - return toString(new java.lang.StringBuilder(), "").toString(); - } - - public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix) { - if( hasMessageKey() ) { - sb.append(prefix+"messageKey: "); - sb.append(getMessageKey()); - sb.append("\n"); - } - if( hasCodec() ) { - sb.append(prefix+"codec: "); - sb.append(getCodec()); - sb.append("\n"); - } - if( hasSize() ) { - sb.append(prefix+"size: "); - sb.append(getSize()); - sb.append("\n"); - } - if( hasValue() ) { - sb.append(prefix+"value: "); - sb.append(getValue()); - sb.append("\n"); - } - if( hasExpiration() ) { - sb.append(prefix+"expiration: "); - sb.append(getExpiration()); - sb.append("\n"); - } - if( hasCompression() ) { - sb.append(prefix+"compression: "); - sb.append(getCompression()); - sb.append("\n"); - } - if( hasDirectData() ) { - sb.append(prefix+"direct_data: "); - sb.append(getDirectData()); - sb.append("\n"); - } - if( hasDirectFile() ) { - sb.append(prefix+"direct_file: "); - sb.append(getDirectFile()); - sb.append("\n"); - } - if( hasDirectOffset() ) { - sb.append(prefix+"direct_offset: "); - sb.append(getDirectOffset()); - sb.append("\n"); - } - if( hasDirectSize() ) { - sb.append(prefix+"direct_size: "); - sb.append(getDirectSize()); - sb.append("\n"); - } - return sb; - } - - public Bean mergeUnframed(java.io.InputStream input) throws java.io.IOException { - return mergeUnframed(new org.fusesource.hawtbuf.proto.CodedInputStream(input)); - } - - public Bean mergeUnframed(org.fusesource.hawtbuf.proto.CodedInputStream input) throws java.io.IOException { - copyCheck(); - while (true) { - int tag = input.readTag(); - if ((tag & 0x07) == 4) { - return this; - } - switch (tag) { - case 0: - return this; - default: { - break; - } - case 8: - setMessageKey(input.readInt64()); - break; - case 18: - setCodec(new org.fusesource.hawtbuf.AsciiBuffer(input.readBytes())); - break; - case 24: - setSize(input.readInt32()); - break; - case 34: - setValue(input.readBytes()); - break; - case 40: - setExpiration(input.readSInt64()); - break; - case 48: - setCompression(input.readInt32()); - break; - case 82: - setDirectData(input.readBytes()); - break; - case 98: - setDirectFile(input.readBytes()); - break; - case 104: - setDirectOffset(input.readInt64()); - break; - case 112: - setDirectSize(input.readInt32()); - break; - } - } - } - public boolean equals(Object obj) { - if( obj==this ) - return true; - - if( obj==null || obj.getClass()!=Bean.class ) - return false; - - return equals((Bean)obj); - } - - public boolean equals(Bean obj) { - if (hasMessageKey() ^ obj.hasMessageKey() ) - return false; - if (hasMessageKey() && ( getMessageKey()!=obj.getMessageKey() )) - return false; - if (hasCodec() ^ obj.hasCodec() ) - return false; - if (hasCodec() && ( !getCodec().equals(obj.getCodec()) )) - return false; - if (hasSize() ^ obj.hasSize() ) - return false; - if (hasSize() && ( getSize()!=obj.getSize() )) - return false; - if (hasValue() ^ obj.hasValue() ) - return false; - if (hasValue() && ( !getValue().equals(obj.getValue()) )) - return false; - if (hasExpiration() ^ obj.hasExpiration() ) - return false; - if (hasExpiration() && ( getExpiration()!=obj.getExpiration() )) - return false; - if (hasCompression() ^ obj.hasCompression() ) - return false; - if (hasCompression() && ( getCompression()!=obj.getCompression() )) - return false; - if (hasDirectData() ^ obj.hasDirectData() ) - return false; - if (hasDirectData() && ( !getDirectData().equals(obj.getDirectData()) )) - return false; - if (hasDirectFile() ^ obj.hasDirectFile() ) - return false; - if (hasDirectFile() && ( !getDirectFile().equals(obj.getDirectFile()) )) - return false; - if (hasDirectOffset() ^ obj.hasDirectOffset() ) - return false; - if (hasDirectOffset() && ( getDirectOffset()!=obj.getDirectOffset() )) - return false; - if (hasDirectSize() ^ obj.hasDirectSize() ) - return false; - if (hasDirectSize() && ( getDirectSize()!=obj.getDirectSize() )) - return false; - return true; - } - - public int hashCode() { - int rc=2066384; - if (hasMessageKey()) { - rc ^= ( 302723320^(new Long(getMessageKey())).hashCode() ); - } - if (hasCodec()) { - rc ^= ( 65282038^getCodec().hashCode() ); - } - if (hasSize()) { - rc ^= ( 2577441^getSize() ); - } - if (hasValue()) { - rc ^= ( 82420049^getValue().hashCode() ); - } - if (hasExpiration()) { - rc ^= ( 1155999439^(new Long(getExpiration())).hashCode() ); - } - if (hasCompression()) { - rc ^= ( -1195114170^getCompression() ); - } - if (hasDirectData()) { - rc ^= ( -2078163117^getDirectData().hashCode() ); - } - if (hasDirectFile()) { - rc ^= ( -2078096091^getDirectFile().hashCode() ); - } - if (hasDirectOffset()) { - rc ^= ( 364178940^(new Long(getDirectOffset())).hashCode() ); - } - if (hasDirectSize()) { - rc ^= ( -2077708374^getDirectSize() ); - } - return rc; - } - - public Bean mergeFrom(Getter other) { - copyCheck(); - if (other.hasMessageKey()) { - setMessageKey(other.getMessageKey()); - } - if (other.hasCodec()) { - setCodec(other.getCodec()); - } - if (other.hasSize()) { - setSize(other.getSize()); - } - if (other.hasValue()) { - setValue(other.getValue()); - } - if (other.hasExpiration()) { - setExpiration(other.getExpiration()); - } - if (other.hasCompression()) { - setCompression(other.getCompression()); - } - if (other.hasDirectData()) { - setDirectData(other.getDirectData()); - } - if (other.hasDirectFile()) { - setDirectFile(other.getDirectFile()); - } - if (other.hasDirectOffset()) { - setDirectOffset(other.getDirectOffset()); - } - if (other.hasDirectSize()) { - setDirectSize(other.getDirectSize()); - } - return this; - } - - public void clear() { - clearMessageKey(); - clearCodec(); - clearSize(); - clearValue(); - clearExpiration(); - clearCompression(); - clearDirectData(); - clearDirectFile(); - clearDirectOffset(); - clearDirectSize(); - } - - public void readExternal(java.io.DataInput in) throws java.io.IOException { - assert frozen==null : org.fusesource.hawtbuf.proto.MessageBufferSupport.FORZEN_ERROR_MESSAGE; - bean = this; - frozen = null; - f_messageKey = in.readLong(); - b_messageKey = true; - { - int size = in.readInt(); - if( size>=0 ) { - byte b[] = new byte[size]; - in.readFully(b); - f_codec = new org.fusesource.hawtbuf.AsciiBuffer(b); - } else { - f_codec = null; - } - } - f_size = in.readInt(); - b_size = true; - { - int size = in.readInt(); - if( size>=0 ) { - byte b[] = new byte[size]; - in.readFully(b); - f_value = new org.fusesource.hawtbuf.Buffer(b); - } else { - f_value = null; - } - } - f_expiration = in.readLong(); - b_expiration = true; - f_compression = in.readInt(); - b_compression = true; - { - int size = in.readInt(); - if( size>=0 ) { - byte b[] = new byte[size]; - in.readFully(b); - f_directData = new org.fusesource.hawtbuf.Buffer(b); - } else { - f_directData = null; - } - } - { - int size = in.readInt(); - if( size>=0 ) { - byte b[] = new byte[size]; - in.readFully(b); - f_directFile = new org.fusesource.hawtbuf.Buffer(b); - } else { - f_directFile = null; - } - } - f_directOffset = in.readLong(); - b_directOffset = true; - f_directSize = in.readInt(); - b_directSize = true; - } - - public void writeExternal(java.io.DataOutput out) throws java.io.IOException { - out.writeLong(bean.f_messageKey); - if( bean.f_codec!=null ) { - out.writeInt(bean.f_codec.getLength()); - out.write(bean.f_codec.getData(), bean.f_codec.getOffset(), bean.f_codec.getLength()); - } else { - out.writeInt(-1); - } - out.writeInt(bean.f_size); - if( bean.f_value!=null ) { - out.writeInt(bean.f_value.getLength()); - out.write(bean.f_value.getData(), bean.f_value.getOffset(), bean.f_value.getLength()); - } else { - out.writeInt(-1); - } - out.writeLong(bean.f_expiration); - out.writeInt(bean.f_compression); - if( bean.f_directData!=null ) { - out.writeInt(bean.f_directData.getLength()); - out.write(bean.f_directData.getData(), bean.f_directData.getOffset(), bean.f_directData.getLength()); - } else { - out.writeInt(-1); - } - if( bean.f_directFile!=null ) { - out.writeInt(bean.f_directFile.getLength()); - out.write(bean.f_directFile.getData(), bean.f_directFile.getOffset(), bean.f_directFile.getLength()); - } else { - out.writeInt(-1); - } - out.writeLong(bean.f_directOffset); - out.writeInt(bean.f_directSize); - } - - } - - static public final class Buffer implements org.fusesource.hawtbuf.proto.MessageBuffer, Getter { - - private Bean bean; - private org.fusesource.hawtbuf.Buffer buffer; - private int size=-1; - private int hashCode; - - private Buffer(org.fusesource.hawtbuf.Buffer buffer) { - this.buffer = buffer; - } - - private Buffer(Bean bean) { - this.bean = bean; - } - - public Bean copy() { - return bean().copy(); - } - - public Buffer freeze() { - return this; - } - - private Bean bean() { - if (bean == null) { - try { - bean = new Bean().mergeUnframed(new org.fusesource.hawtbuf.proto.CodedInputStream(buffer)); - bean.frozen=this; - } catch (org.fusesource.hawtbuf.proto.InvalidProtocolBufferException e) { - throw new RuntimeException(e); - } catch (java.io.IOException e) { - throw new RuntimeException("An IOException was thrown (should never happen in this method).", e); - } - } - return bean; - } - - public String toString() { - return bean().toString(); - } - - public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix) { - return bean().toString(sb, prefix); - } - - // required int64 messageKey = 1; - public boolean hasMessageKey() { - return bean().hasMessageKey(); - } - - public long getMessageKey() { - return bean().getMessageKey(); - } - - // required bytes codec = 2; - public boolean hasCodec() { - return bean().hasCodec(); - } - - public org.fusesource.hawtbuf.AsciiBuffer getCodec() { - return bean().getCodec(); - } - - // optional int32 size = 3; - public boolean hasSize() { - return bean().hasSize(); - } - - public int getSize() { - return bean().getSize(); - } - - // optional bytes value = 4; - public boolean hasValue() { - return bean().hasValue(); - } - - public org.fusesource.hawtbuf.Buffer getValue() { - return bean().getValue(); - } - - // optional sint64 expiration = 5; - public boolean hasExpiration() { - return bean().hasExpiration(); - } - - public long getExpiration() { - return bean().getExpiration(); - } - - // optional int32 compression = 6; - public boolean hasCompression() { - return bean().hasCompression(); - } - - public int getCompression() { - return bean().getCompression(); - } - - // optional bytes direct_data = 10; - public boolean hasDirectData() { - return bean().hasDirectData(); - } - - public org.fusesource.hawtbuf.Buffer getDirectData() { - return bean().getDirectData(); - } - - // optional bytes direct_file = 12; - public boolean hasDirectFile() { - return bean().hasDirectFile(); - } - - public org.fusesource.hawtbuf.Buffer getDirectFile() { - return bean().getDirectFile(); - } - - // optional int64 direct_offset = 13; - public boolean hasDirectOffset() { - return bean().hasDirectOffset(); - } - - public long getDirectOffset() { - return bean().getDirectOffset(); - } - - // optional int32 direct_size = 14; - public boolean hasDirectSize() { - return bean().hasDirectSize(); - } - - public int getDirectSize() { - return bean().getDirectSize(); - } - - public org.fusesource.hawtbuf.Buffer toUnframedBuffer() { - if( buffer !=null ) { - return buffer; - } - return org.fusesource.hawtbuf.proto.MessageBufferSupport.toUnframedBuffer(this); - } - - public org.fusesource.hawtbuf.Buffer toFramedBuffer() { - return org.fusesource.hawtbuf.proto.MessageBufferSupport.toFramedBuffer(this); - } - - public byte[] toUnframedByteArray() { - return toUnframedBuffer().toByteArray(); - } - - public byte[] toFramedByteArray() { - return toFramedBuffer().toByteArray(); - } - - public void writeFramed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException { - output.writeRawVarint32(serializedSizeUnframed()); - writeUnframed(output); - } - - public void writeFramed(java.io.OutputStream output) throws java.io.IOException { - org.fusesource.hawtbuf.proto.CodedOutputStream codedOutput = new org.fusesource.hawtbuf.proto.CodedOutputStream(output); - writeFramed(codedOutput); - codedOutput.flush(); - } - - public void writeUnframed(java.io.OutputStream output) throws java.io.IOException { - org.fusesource.hawtbuf.proto.CodedOutputStream codedOutput = new org.fusesource.hawtbuf.proto.CodedOutputStream(output); - writeUnframed(codedOutput); - codedOutput.flush(); - } - - public void writeUnframed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException { - if (buffer == null) { - int size = serializedSizeUnframed(); - buffer = output.getNextBuffer(size); - org.fusesource.hawtbuf.proto.CodedOutputStream original=null; - if( buffer == null ) { - buffer = new org.fusesource.hawtbuf.Buffer(new byte[size]); - original = output; - output = new org.fusesource.hawtbuf.proto.CodedOutputStream(buffer); - } - output.writeInt64(1, bean.getMessageKey()); - output.writeBytes(2, bean.getCodec()); - if (bean.hasSize()) { - output.writeInt32(3, bean.getSize()); - } - if (bean.hasValue()) { - output.writeBytes(4, bean.getValue()); - } - if (bean.hasExpiration()) { - output.writeSInt64(5, bean.getExpiration()); - } - if (bean.hasCompression()) { - output.writeInt32(6, bean.getCompression()); - } - if (bean.hasDirectData()) { - output.writeBytes(10, bean.getDirectData()); - } - if (bean.hasDirectFile()) { - output.writeBytes(12, bean.getDirectFile()); - } - if (bean.hasDirectOffset()) { - output.writeInt64(13, bean.getDirectOffset()); - } - if (bean.hasDirectSize()) { - output.writeInt32(14, bean.getDirectSize()); - } - if( original !=null ) { - output.checkNoSpaceLeft(); - output = original; - output.writeRawBytes(buffer); - } - } else { - output.writeRawBytes(buffer); - } - } - - public int serializedSizeFramed() { - int t = serializedSizeUnframed(); - return org.fusesource.hawtbuf.proto.CodedOutputStream.computeRawVarint32Size(t) + t; - } - - public int serializedSizeUnframed() { - if (buffer != null) { - return buffer.length; - } - if (size != -1) - return size; - - size = 0; - size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt64Size(1, getMessageKey()); - size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(2, getCodec()); - if (hasSize()) { - size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt32Size(3, getSize()); - } - if (hasValue()) { - size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(4, getValue()); - } - if (hasExpiration()) { - size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeSInt64Size(5, getExpiration()); - } - if (hasCompression()) { - size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt32Size(6, getCompression()); - } - if (hasDirectData()) { - size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(10, getDirectData()); - } - if (hasDirectFile()) { - size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(12, getDirectFile()); - } - if (hasDirectOffset()) { - size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt64Size(13, getDirectOffset()); - } - if (hasDirectSize()) { - size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt32Size(14, getDirectSize()); - } - return size; - } - - public boolean equals(Object obj) { - if( obj==this ) - return true; - - if( obj==null || obj.getClass()!=Buffer.class ) - return false; - - return equals((Buffer)obj); - } - - public boolean equals(Buffer obj) { - return toUnframedBuffer().equals(obj.toUnframedBuffer()); - } - - public int hashCode() { - if( hashCode==0 ) { - hashCode=2000715872 ^ toUnframedBuffer().hashCode(); - } - return hashCode; - } - - public boolean frozen() { - return true; - } - } - -} - diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/QueueEntryPB$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/QueueEntryPB$1.class deleted file mode 100644 index 3a843e258..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/QueueEntryPB$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/QueueEntryPB$Bean.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/QueueEntryPB$Bean.class deleted file mode 100644 index 3d5299259..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/QueueEntryPB$Bean.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/QueueEntryPB$Buffer.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/QueueEntryPB$Buffer.class deleted file mode 100644 index e835eb7e1..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/QueueEntryPB$Buffer.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/QueueEntryPB$Getter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/QueueEntryPB$Getter.class deleted file mode 100644 index fe382ced0..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/QueueEntryPB$Getter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/QueueEntryPB.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/QueueEntryPB.class deleted file mode 100644 index bc31622a5..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/QueueEntryPB.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/QueueEntryPB.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/QueueEntryPB.java deleted file mode 100644 index 78974d06a..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/QueueEntryPB.java +++ /dev/null @@ -1,1005 +0,0 @@ -// -// Generated by protoc, do not edit by hand. -// -package org.apache.activemq.console.command.store.proto; - - -public class QueueEntryPB implements org.fusesource.hawtbuf.proto.PBMessageFactory { - - public static final QueueEntryPB FACTORY = new QueueEntryPB(); - public static final org.fusesource.hawtbuf.proto.PBMessageFramedCodec FRAMED_CODEC = new org.fusesource.hawtbuf.proto.PBMessageFramedCodec(FACTORY); - public static final org.fusesource.hawtbuf.proto.PBMessageUnframedCodec UNFRAMED_CODEC = new org.fusesource.hawtbuf.proto.PBMessageUnframedCodec(FACTORY); - - public Bean create() { - return new Bean(); - } - - public Bean parseUnframed(org.fusesource.hawtbuf.proto.CodedInputStream data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException, java.io.IOException { - return new Bean().mergeUnframed(data); - } - - public Bean parseUnframed(java.io.InputStream data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException, java.io.IOException { - return parseUnframed(new org.fusesource.hawtbuf.proto.CodedInputStream(data)); - } - - public Buffer parseUnframed(org.fusesource.hawtbuf.Buffer data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException { - return new Buffer(data); - } - - public Buffer parseUnframed(byte[] data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException { - return parseUnframed(new org.fusesource.hawtbuf.Buffer(data)); - } - - public Buffer parseFramed(org.fusesource.hawtbuf.proto.CodedInputStream data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException, java.io.IOException { - int length = data.readRawVarint32(); - int oldLimit = data.pushLimit(length); - Buffer rc = parseUnframed(data.readRawBytes(length)); - data.popLimit(oldLimit); - return rc; - } - - public Buffer parseFramed(org.fusesource.hawtbuf.Buffer data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException { - try { - org.fusesource.hawtbuf.proto.CodedInputStream input = new org.fusesource.hawtbuf.proto.CodedInputStream(data); - Buffer rc = parseFramed(input); - input.checkLastTagWas(0); - return rc; - } catch (org.fusesource.hawtbuf.proto.InvalidProtocolBufferException e) { - throw e; - } catch (java.io.IOException e) { - throw new RuntimeException("An IOException was thrown (should never happen in this method).", e); - } - } - - public Buffer parseFramed(byte[] data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException { - return parseFramed(new org.fusesource.hawtbuf.Buffer(data)); - } - - public Buffer parseFramed(java.io.InputStream data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException, java.io.IOException { - return parseUnframed(org.fusesource.hawtbuf.proto.MessageBufferSupport.readFrame(data)); - } - - public interface Getter extends org.fusesource.hawtbuf.proto.PBMessage { - - // required int64 queueKey = 1; - public boolean hasQueueKey(); - public long getQueueKey(); - // required int64 queueSeq = 2; - public boolean hasQueueSeq(); - public long getQueueSeq(); - // required int64 messageKey = 3; - public boolean hasMessageKey(); - public long getMessageKey(); - // optional int32 size = 4; - public boolean hasSize(); - public int getSize(); - // optional bytes attachment = 5; - public boolean hasAttachment(); - public org.fusesource.hawtbuf.Buffer getAttachment(); - // optional int32 redeliveries = 6; - public boolean hasRedeliveries(); - public int getRedeliveries(); - // optional sint64 expiration = 7; - public boolean hasExpiration(); - public long getExpiration(); - // optional bytes messageLocator = 8; - public boolean hasMessageLocator(); - public org.fusesource.hawtbuf.Buffer getMessageLocator(); - // repeated bytes sender = 9; - public boolean hasSender(); - public java.util.List getSenderList(); - public int getSenderCount(); - public org.fusesource.hawtbuf.Buffer getSender(int index); - public Bean copy(); - public Buffer freeze(); - public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix); - } - - static public final class Bean implements Getter { - - Buffer frozen; - Bean bean; - - public Bean() { - this.bean = this; - } - - public Bean(Bean copy) { - this.bean = copy; - } - - public Bean copy() { - return new Bean(bean); - } - - public boolean frozen() { - return frozen!=null; - } - - public Buffer freeze() { - if( frozen==null ) { - frozen = new Buffer(bean); - assert deepFreeze(); - } - return frozen; - } - - private boolean deepFreeze() { - frozen.serializedSizeUnframed(); - return true; - } - - private void copyCheck() { - assert frozen==null : org.fusesource.hawtbuf.proto.MessageBufferSupport.FORZEN_ERROR_MESSAGE; - if (bean != this) { - copy(bean); - } - } - - private void copy(Bean other) { - this.bean = this; - this.f_queueKey = other.f_queueKey; - this.b_queueKey = other.b_queueKey; - this.f_queueSeq = other.f_queueSeq; - this.b_queueSeq = other.b_queueSeq; - this.f_messageKey = other.f_messageKey; - this.b_messageKey = other.b_messageKey; - this.f_size = other.f_size; - this.b_size = other.b_size; - this.f_attachment = other.f_attachment; - this.f_redeliveries = other.f_redeliveries; - this.b_redeliveries = other.b_redeliveries; - this.f_expiration = other.f_expiration; - this.b_expiration = other.b_expiration; - this.f_messageLocator = other.f_messageLocator; - this.f_sender = other.f_sender; - if( this.f_sender !=null && !other.frozen()) { - this.f_sender = new java.util.ArrayList(this.f_sender); - } - } - - // required int64 queueKey = 1; - private long f_queueKey = 0; - private boolean b_queueKey; - - public boolean hasQueueKey() { - return bean.b_queueKey; - } - - public long getQueueKey() { - return bean.f_queueKey; - } - - public Bean setQueueKey(long queueKey) { - copyCheck(); - this.b_queueKey = true; - this.f_queueKey = queueKey; - return this; - } - - public void clearQueueKey() { - copyCheck(); - this.b_queueKey = false; - this.f_queueKey = 0; - } - - // required int64 queueSeq = 2; - private long f_queueSeq = 0; - private boolean b_queueSeq; - - public boolean hasQueueSeq() { - return bean.b_queueSeq; - } - - public long getQueueSeq() { - return bean.f_queueSeq; - } - - public Bean setQueueSeq(long queueSeq) { - copyCheck(); - this.b_queueSeq = true; - this.f_queueSeq = queueSeq; - return this; - } - - public void clearQueueSeq() { - copyCheck(); - this.b_queueSeq = false; - this.f_queueSeq = 0; - } - - // required int64 messageKey = 3; - private long f_messageKey = 0; - private boolean b_messageKey; - - public boolean hasMessageKey() { - return bean.b_messageKey; - } - - public long getMessageKey() { - return bean.f_messageKey; - } - - public Bean setMessageKey(long messageKey) { - copyCheck(); - this.b_messageKey = true; - this.f_messageKey = messageKey; - return this; - } - - public void clearMessageKey() { - copyCheck(); - this.b_messageKey = false; - this.f_messageKey = 0; - } - - // optional int32 size = 4; - private int f_size = 0; - private boolean b_size; - - public boolean hasSize() { - return bean.b_size; - } - - public int getSize() { - return bean.f_size; - } - - public Bean setSize(int size) { - copyCheck(); - this.b_size = true; - this.f_size = size; - return this; - } - - public void clearSize() { - copyCheck(); - this.b_size = false; - this.f_size = 0; - } - - // optional bytes attachment = 5; - private org.fusesource.hawtbuf.Buffer f_attachment = null; - - public boolean hasAttachment() { - return bean.f_attachment!=null; - } - - public org.fusesource.hawtbuf.Buffer getAttachment() { - return bean.f_attachment; - } - - public Bean setAttachment(org.fusesource.hawtbuf.Buffer attachment) { - copyCheck(); - this.f_attachment = attachment; - return this; - } - - public void clearAttachment() { - copyCheck(); - this.f_attachment = null; - } - - // optional int32 redeliveries = 6; - private int f_redeliveries = 0; - private boolean b_redeliveries; - - public boolean hasRedeliveries() { - return bean.b_redeliveries; - } - - public int getRedeliveries() { - return bean.f_redeliveries; - } - - public Bean setRedeliveries(int redeliveries) { - copyCheck(); - this.b_redeliveries = true; - this.f_redeliveries = redeliveries; - return this; - } - - public void clearRedeliveries() { - copyCheck(); - this.b_redeliveries = false; - this.f_redeliveries = 0; - } - - // optional sint64 expiration = 7; - private long f_expiration = 0; - private boolean b_expiration; - - public boolean hasExpiration() { - return bean.b_expiration; - } - - public long getExpiration() { - return bean.f_expiration; - } - - public Bean setExpiration(long expiration) { - copyCheck(); - this.b_expiration = true; - this.f_expiration = expiration; - return this; - } - - public void clearExpiration() { - copyCheck(); - this.b_expiration = false; - this.f_expiration = 0; - } - - // optional bytes messageLocator = 8; - private org.fusesource.hawtbuf.Buffer f_messageLocator = null; - - public boolean hasMessageLocator() { - return bean.f_messageLocator!=null; - } - - public org.fusesource.hawtbuf.Buffer getMessageLocator() { - return bean.f_messageLocator; - } - - public Bean setMessageLocator(org.fusesource.hawtbuf.Buffer messageLocator) { - copyCheck(); - this.f_messageLocator = messageLocator; - return this; - } - - public void clearMessageLocator() { - copyCheck(); - this.f_messageLocator = null; - } - - // repeated bytes sender = 9; - private java.util.List f_sender; - - public boolean hasSender() { - return bean.f_sender!=null && !bean.f_sender.isEmpty(); - } - - public java.util.List getSenderList() { - return bean.f_sender; - } - - public java.util.List createSenderList() { - copyCheck(); - if( this.f_sender == null ) { - this.f_sender = new java.util.ArrayList(); - } - return bean.f_sender; - } - - public Bean setSenderList(java.util.List sender) { - copyCheck(); - this.f_sender = sender; - return this; - } - - public int getSenderCount() { - if( bean.f_sender == null ) { - return 0; - } - return bean.f_sender.size(); - } - - public org.fusesource.hawtbuf.Buffer getSender(int index) { - if( bean.f_sender == null ) { - return null; - } - return bean.f_sender.get(index); - } - - public Bean setSender(int index, org.fusesource.hawtbuf.Buffer value) { - this.createSenderList().set(index, value); - return this; - } - - public Bean addSender(org.fusesource.hawtbuf.Buffer value) { - this.createSenderList().add(value); - return this; - } - - public Bean addAllSender(java.lang.Iterable collection) { - org.fusesource.hawtbuf.proto.MessageBufferSupport.addAll(collection, this.createSenderList()); - return this; - } - - public void clearSender() { - copyCheck(); - this.f_sender = null; - } - - public String toString() { - return toString(new java.lang.StringBuilder(), "").toString(); - } - - public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix) { - if( hasQueueKey() ) { - sb.append(prefix+"queueKey: "); - sb.append(getQueueKey()); - sb.append("\n"); - } - if( hasQueueSeq() ) { - sb.append(prefix+"queueSeq: "); - sb.append(getQueueSeq()); - sb.append("\n"); - } - if( hasMessageKey() ) { - sb.append(prefix+"messageKey: "); - sb.append(getMessageKey()); - sb.append("\n"); - } - if( hasSize() ) { - sb.append(prefix+"size: "); - sb.append(getSize()); - sb.append("\n"); - } - if( hasAttachment() ) { - sb.append(prefix+"attachment: "); - sb.append(getAttachment()); - sb.append("\n"); - } - if( hasRedeliveries() ) { - sb.append(prefix+"redeliveries: "); - sb.append(getRedeliveries()); - sb.append("\n"); - } - if( hasExpiration() ) { - sb.append(prefix+"expiration: "); - sb.append(getExpiration()); - sb.append("\n"); - } - if( hasMessageLocator() ) { - sb.append(prefix+"messageLocator: "); - sb.append(getMessageLocator()); - sb.append("\n"); - } - if( hasSender() ) { - java.util.List l = getSenderList(); - for( int i=0; i < l.size(); i++ ) { - sb.append(prefix+"sender["+i+"]: "); - sb.append(l.get(i)); - sb.append("\n"); - } - } - return sb; - } - - public Bean mergeUnframed(java.io.InputStream input) throws java.io.IOException { - return mergeUnframed(new org.fusesource.hawtbuf.proto.CodedInputStream(input)); - } - - public Bean mergeUnframed(org.fusesource.hawtbuf.proto.CodedInputStream input) throws java.io.IOException { - copyCheck(); - while (true) { - int tag = input.readTag(); - if ((tag & 0x07) == 4) { - return this; - } - switch (tag) { - case 0: - return this; - default: { - break; - } - case 8: - setQueueKey(input.readInt64()); - break; - case 16: - setQueueSeq(input.readInt64()); - break; - case 24: - setMessageKey(input.readInt64()); - break; - case 32: - setSize(input.readInt32()); - break; - case 42: - setAttachment(input.readBytes()); - break; - case 48: - setRedeliveries(input.readInt32()); - break; - case 56: - setExpiration(input.readSInt64()); - break; - case 66: - setMessageLocator(input.readBytes()); - break; - case 74: - createSenderList().add(input.readBytes()); - break; - } - } - } - public boolean equals(Object obj) { - if( obj==this ) - return true; - - if( obj==null || obj.getClass()!=Bean.class ) - return false; - - return equals((Bean)obj); - } - - public boolean equals(Bean obj) { - if (hasQueueKey() ^ obj.hasQueueKey() ) - return false; - if (hasQueueKey() && ( getQueueKey()!=obj.getQueueKey() )) - return false; - if (hasQueueSeq() ^ obj.hasQueueSeq() ) - return false; - if (hasQueueSeq() && ( getQueueSeq()!=obj.getQueueSeq() )) - return false; - if (hasMessageKey() ^ obj.hasMessageKey() ) - return false; - if (hasMessageKey() && ( getMessageKey()!=obj.getMessageKey() )) - return false; - if (hasSize() ^ obj.hasSize() ) - return false; - if (hasSize() && ( getSize()!=obj.getSize() )) - return false; - if (hasAttachment() ^ obj.hasAttachment() ) - return false; - if (hasAttachment() && ( !getAttachment().equals(obj.getAttachment()) )) - return false; - if (hasRedeliveries() ^ obj.hasRedeliveries() ) - return false; - if (hasRedeliveries() && ( getRedeliveries()!=obj.getRedeliveries() )) - return false; - if (hasExpiration() ^ obj.hasExpiration() ) - return false; - if (hasExpiration() && ( getExpiration()!=obj.getExpiration() )) - return false; - if (hasMessageLocator() ^ obj.hasMessageLocator() ) - return false; - if (hasMessageLocator() && ( !getMessageLocator().equals(obj.getMessageLocator()) )) - return false; - if (hasSender() ^ obj.hasSender() ) - return false; - if (hasSender() && ( !getSenderList().equals(obj.getSenderList()) )) - return false; - return true; - } - - public int hashCode() { - int rc=2066384; - if (hasQueueKey()) { - rc ^= ( -1099854930^(new Long(getQueueKey())).hashCode() ); - } - if (hasQueueSeq()) { - rc ^= ( -1099847250^(new Long(getQueueSeq())).hashCode() ); - } - if (hasMessageKey()) { - rc ^= ( 302723320^(new Long(getMessageKey())).hashCode() ); - } - if (hasSize()) { - rc ^= ( 2577441^getSize() ); - } - if (hasAttachment()) { - rc ^= ( 29963587^getAttachment().hashCode() ); - } - if (hasRedeliveries()) { - rc ^= ( 1969176101^getRedeliveries() ); - } - if (hasExpiration()) { - rc ^= ( 1155999439^(new Long(getExpiration())).hashCode() ); - } - if (hasMessageLocator()) { - rc ^= ( 193493679^getMessageLocator().hashCode() ); - } - if (hasSender()) { - rc ^= ( -1822095787^getSenderList().hashCode() ); - } - return rc; - } - - public Bean mergeFrom(Getter other) { - copyCheck(); - if (other.hasQueueKey()) { - setQueueKey(other.getQueueKey()); - } - if (other.hasQueueSeq()) { - setQueueSeq(other.getQueueSeq()); - } - if (other.hasMessageKey()) { - setMessageKey(other.getMessageKey()); - } - if (other.hasSize()) { - setSize(other.getSize()); - } - if (other.hasAttachment()) { - setAttachment(other.getAttachment()); - } - if (other.hasRedeliveries()) { - setRedeliveries(other.getRedeliveries()); - } - if (other.hasExpiration()) { - setExpiration(other.getExpiration()); - } - if (other.hasMessageLocator()) { - setMessageLocator(other.getMessageLocator()); - } - if (other.hasSender()) { - getSenderList().addAll(other.getSenderList()); - } - return this; - } - - public void clear() { - clearQueueKey(); - clearQueueSeq(); - clearMessageKey(); - clearSize(); - clearAttachment(); - clearRedeliveries(); - clearExpiration(); - clearMessageLocator(); - clearSender(); - } - - public void readExternal(java.io.DataInput in) throws java.io.IOException { - assert frozen==null : org.fusesource.hawtbuf.proto.MessageBufferSupport.FORZEN_ERROR_MESSAGE; - bean = this; - frozen = null; - f_queueKey = in.readLong(); - b_queueKey = true; - f_queueSeq = in.readLong(); - b_queueSeq = true; - f_messageKey = in.readLong(); - b_messageKey = true; - f_size = in.readInt(); - b_size = true; - { - int size = in.readInt(); - if( size>=0 ) { - byte b[] = new byte[size]; - in.readFully(b); - f_attachment = new org.fusesource.hawtbuf.Buffer(b); - } else { - f_attachment = null; - } - } - f_redeliveries = in.readInt(); - b_redeliveries = true; - f_expiration = in.readLong(); - b_expiration = true; - { - int size = in.readInt(); - if( size>=0 ) { - byte b[] = new byte[size]; - in.readFully(b); - f_messageLocator = new org.fusesource.hawtbuf.Buffer(b); - } else { - f_messageLocator = null; - } - } - { - int size = in.readShort(); - if( size>=0 ) { - f_sender = new java.util.ArrayList(size); - for(int i=0; i, Getter { - - private Bean bean; - private org.fusesource.hawtbuf.Buffer buffer; - private int size=-1; - private int hashCode; - - private Buffer(org.fusesource.hawtbuf.Buffer buffer) { - this.buffer = buffer; - } - - private Buffer(Bean bean) { - this.bean = bean; - } - - public Bean copy() { - return bean().copy(); - } - - public Buffer freeze() { - return this; - } - - private Bean bean() { - if (bean == null) { - try { - bean = new Bean().mergeUnframed(new org.fusesource.hawtbuf.proto.CodedInputStream(buffer)); - bean.frozen=this; - } catch (org.fusesource.hawtbuf.proto.InvalidProtocolBufferException e) { - throw new RuntimeException(e); - } catch (java.io.IOException e) { - throw new RuntimeException("An IOException was thrown (should never happen in this method).", e); - } - } - return bean; - } - - public String toString() { - return bean().toString(); - } - - public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix) { - return bean().toString(sb, prefix); - } - - // required int64 queueKey = 1; - public boolean hasQueueKey() { - return bean().hasQueueKey(); - } - - public long getQueueKey() { - return bean().getQueueKey(); - } - - // required int64 queueSeq = 2; - public boolean hasQueueSeq() { - return bean().hasQueueSeq(); - } - - public long getQueueSeq() { - return bean().getQueueSeq(); - } - - // required int64 messageKey = 3; - public boolean hasMessageKey() { - return bean().hasMessageKey(); - } - - public long getMessageKey() { - return bean().getMessageKey(); - } - - // optional int32 size = 4; - public boolean hasSize() { - return bean().hasSize(); - } - - public int getSize() { - return bean().getSize(); - } - - // optional bytes attachment = 5; - public boolean hasAttachment() { - return bean().hasAttachment(); - } - - public org.fusesource.hawtbuf.Buffer getAttachment() { - return bean().getAttachment(); - } - - // optional int32 redeliveries = 6; - public boolean hasRedeliveries() { - return bean().hasRedeliveries(); - } - - public int getRedeliveries() { - return bean().getRedeliveries(); - } - - // optional sint64 expiration = 7; - public boolean hasExpiration() { - return bean().hasExpiration(); - } - - public long getExpiration() { - return bean().getExpiration(); - } - - // optional bytes messageLocator = 8; - public boolean hasMessageLocator() { - return bean().hasMessageLocator(); - } - - public org.fusesource.hawtbuf.Buffer getMessageLocator() { - return bean().getMessageLocator(); - } - - // repeated bytes sender = 9; - public boolean hasSender() { - return bean().hasSender(); - } - - public java.util.List getSenderList() { - return bean().getSenderList(); - } - - public int getSenderCount() { - return bean().getSenderCount(); - } - - public org.fusesource.hawtbuf.Buffer getSender(int index) { - return bean().getSender(index); - } - - public org.fusesource.hawtbuf.Buffer toUnframedBuffer() { - if( buffer !=null ) { - return buffer; - } - return org.fusesource.hawtbuf.proto.MessageBufferSupport.toUnframedBuffer(this); - } - - public org.fusesource.hawtbuf.Buffer toFramedBuffer() { - return org.fusesource.hawtbuf.proto.MessageBufferSupport.toFramedBuffer(this); - } - - public byte[] toUnframedByteArray() { - return toUnframedBuffer().toByteArray(); - } - - public byte[] toFramedByteArray() { - return toFramedBuffer().toByteArray(); - } - - public void writeFramed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException { - output.writeRawVarint32(serializedSizeUnframed()); - writeUnframed(output); - } - - public void writeFramed(java.io.OutputStream output) throws java.io.IOException { - org.fusesource.hawtbuf.proto.CodedOutputStream codedOutput = new org.fusesource.hawtbuf.proto.CodedOutputStream(output); - writeFramed(codedOutput); - codedOutput.flush(); - } - - public void writeUnframed(java.io.OutputStream output) throws java.io.IOException { - org.fusesource.hawtbuf.proto.CodedOutputStream codedOutput = new org.fusesource.hawtbuf.proto.CodedOutputStream(output); - writeUnframed(codedOutput); - codedOutput.flush(); - } - - public void writeUnframed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException { - if (buffer == null) { - int size = serializedSizeUnframed(); - buffer = output.getNextBuffer(size); - org.fusesource.hawtbuf.proto.CodedOutputStream original=null; - if( buffer == null ) { - buffer = new org.fusesource.hawtbuf.Buffer(new byte[size]); - original = output; - output = new org.fusesource.hawtbuf.proto.CodedOutputStream(buffer); - } - output.writeInt64(1, bean.getQueueKey()); - output.writeInt64(2, bean.getQueueSeq()); - output.writeInt64(3, bean.getMessageKey()); - if (bean.hasSize()) { - output.writeInt32(4, bean.getSize()); - } - if (bean.hasAttachment()) { - output.writeBytes(5, bean.getAttachment()); - } - if (bean.hasRedeliveries()) { - output.writeInt32(6, bean.getRedeliveries()); - } - if (bean.hasExpiration()) { - output.writeSInt64(7, bean.getExpiration()); - } - if (bean.hasMessageLocator()) { - output.writeBytes(8, bean.getMessageLocator()); - } - if (bean.hasSender()) { - for (org.fusesource.hawtbuf.Buffer i : bean.getSenderList()) { - output.writeBytes(9, i); - } - } - if( original !=null ) { - output.checkNoSpaceLeft(); - output = original; - output.writeRawBytes(buffer); - } - } else { - output.writeRawBytes(buffer); - } - } - - public int serializedSizeFramed() { - int t = serializedSizeUnframed(); - return org.fusesource.hawtbuf.proto.CodedOutputStream.computeRawVarint32Size(t) + t; - } - - public int serializedSizeUnframed() { - if (buffer != null) { - return buffer.length; - } - if (size != -1) - return size; - - size = 0; - size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt64Size(1, getQueueKey()); - size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt64Size(2, getQueueSeq()); - size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt64Size(3, getMessageKey()); - if (hasSize()) { - size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt32Size(4, getSize()); - } - if (hasAttachment()) { - size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(5, getAttachment()); - } - if (hasRedeliveries()) { - size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt32Size(6, getRedeliveries()); - } - if (hasExpiration()) { - size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeSInt64Size(7, getExpiration()); - } - if (hasMessageLocator()) { - size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(8, getMessageLocator()); - } - if (hasSender()) { - for (org.fusesource.hawtbuf.Buffer i : getSenderList()) { - size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(9, i); - } - } - return size; - } - - public boolean equals(Object obj) { - if( obj==this ) - return true; - - if( obj==null || obj.getClass()!=Buffer.class ) - return false; - - return equals((Buffer)obj); - } - - public boolean equals(Buffer obj) { - return toUnframedBuffer().equals(obj.toUnframedBuffer()); - } - - public int hashCode() { - if( hashCode==0 ) { - hashCode=2000715872 ^ toUnframedBuffer().hashCode(); - } - return hashCode; - } - - public boolean frozen() { - return true; - } - } - -} - diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/QueuePB$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/QueuePB$1.class deleted file mode 100644 index 774830d96..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/QueuePB$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/QueuePB$Bean.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/QueuePB$Bean.class deleted file mode 100644 index 23e6d3faf..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/QueuePB$Bean.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/QueuePB$Buffer.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/QueuePB$Buffer.class deleted file mode 100644 index bb571d9b8..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/QueuePB$Buffer.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/QueuePB$Getter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/QueuePB$Getter.class deleted file mode 100644 index a287f574b..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/QueuePB$Getter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/QueuePB.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/QueuePB.class deleted file mode 100644 index 773e3fc27..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/QueuePB.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/QueuePB.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/QueuePB.java deleted file mode 100644 index 34b1f5d1a..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/proto/QueuePB.java +++ /dev/null @@ -1,539 +0,0 @@ -// -// Generated by protoc, do not edit by hand. -// -package org.apache.activemq.console.command.store.proto; - - -public class QueuePB implements org.fusesource.hawtbuf.proto.PBMessageFactory { - - public static final QueuePB FACTORY = new QueuePB(); - public static final org.fusesource.hawtbuf.proto.PBMessageFramedCodec FRAMED_CODEC = new org.fusesource.hawtbuf.proto.PBMessageFramedCodec(FACTORY); - public static final org.fusesource.hawtbuf.proto.PBMessageUnframedCodec UNFRAMED_CODEC = new org.fusesource.hawtbuf.proto.PBMessageUnframedCodec(FACTORY); - - public Bean create() { - return new Bean(); - } - - public Bean parseUnframed(org.fusesource.hawtbuf.proto.CodedInputStream data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException, java.io.IOException { - return new Bean().mergeUnframed(data); - } - - public Bean parseUnframed(java.io.InputStream data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException, java.io.IOException { - return parseUnframed(new org.fusesource.hawtbuf.proto.CodedInputStream(data)); - } - - public Buffer parseUnframed(org.fusesource.hawtbuf.Buffer data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException { - return new Buffer(data); - } - - public Buffer parseUnframed(byte[] data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException { - return parseUnframed(new org.fusesource.hawtbuf.Buffer(data)); - } - - public Buffer parseFramed(org.fusesource.hawtbuf.proto.CodedInputStream data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException, java.io.IOException { - int length = data.readRawVarint32(); - int oldLimit = data.pushLimit(length); - Buffer rc = parseUnframed(data.readRawBytes(length)); - data.popLimit(oldLimit); - return rc; - } - - public Buffer parseFramed(org.fusesource.hawtbuf.Buffer data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException { - try { - org.fusesource.hawtbuf.proto.CodedInputStream input = new org.fusesource.hawtbuf.proto.CodedInputStream(data); - Buffer rc = parseFramed(input); - input.checkLastTagWas(0); - return rc; - } catch (org.fusesource.hawtbuf.proto.InvalidProtocolBufferException e) { - throw e; - } catch (java.io.IOException e) { - throw new RuntimeException("An IOException was thrown (should never happen in this method).", e); - } - } - - public Buffer parseFramed(byte[] data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException { - return parseFramed(new org.fusesource.hawtbuf.Buffer(data)); - } - - public Buffer parseFramed(java.io.InputStream data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException, java.io.IOException { - return parseUnframed(org.fusesource.hawtbuf.proto.MessageBufferSupport.readFrame(data)); - } - - public interface Getter extends org.fusesource.hawtbuf.proto.PBMessage { - - // required int64 key = 1; - public boolean hasKey(); - public long getKey(); - // optional bytes binding_kind = 2; - public boolean hasBindingKind(); - public org.fusesource.hawtbuf.AsciiBuffer getBindingKind(); - // optional bytes binding_data = 3; - public boolean hasBindingData(); - public org.fusesource.hawtbuf.Buffer getBindingData(); - public Bean copy(); - public Buffer freeze(); - public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix); - } - - static public final class Bean implements Getter { - - Buffer frozen; - Bean bean; - - public Bean() { - this.bean = this; - } - - public Bean(Bean copy) { - this.bean = copy; - } - - public Bean copy() { - return new Bean(bean); - } - - public boolean frozen() { - return frozen!=null; - } - - public Buffer freeze() { - if( frozen==null ) { - frozen = new Buffer(bean); - assert deepFreeze(); - } - return frozen; - } - - private boolean deepFreeze() { - frozen.serializedSizeUnframed(); - return true; - } - - private void copyCheck() { - assert frozen==null : org.fusesource.hawtbuf.proto.MessageBufferSupport.FORZEN_ERROR_MESSAGE; - if (bean != this) { - copy(bean); - } - } - - private void copy(Bean other) { - this.bean = this; - this.f_key = other.f_key; - this.b_key = other.b_key; - this.f_bindingKind = other.f_bindingKind; - this.f_bindingData = other.f_bindingData; - } - - // required int64 key = 1; - private long f_key = 0; - private boolean b_key; - - public boolean hasKey() { - return bean.b_key; - } - - public long getKey() { - return bean.f_key; - } - - public Bean setKey(long key) { - copyCheck(); - this.b_key = true; - this.f_key = key; - return this; - } - - public void clearKey() { - copyCheck(); - this.b_key = false; - this.f_key = 0; - } - - // optional bytes binding_kind = 2; - private org.fusesource.hawtbuf.AsciiBuffer f_bindingKind = null; - - public boolean hasBindingKind() { - return bean.f_bindingKind!=null; - } - - public org.fusesource.hawtbuf.AsciiBuffer getBindingKind() { - return bean.f_bindingKind; - } - - public Bean setBindingKind(org.fusesource.hawtbuf.AsciiBuffer bindingKind) { - copyCheck(); - this.f_bindingKind = bindingKind; - return this; - } - - public void clearBindingKind() { - copyCheck(); - this.f_bindingKind = null; - } - - // optional bytes binding_data = 3; - private org.fusesource.hawtbuf.Buffer f_bindingData = null; - - public boolean hasBindingData() { - return bean.f_bindingData!=null; - } - - public org.fusesource.hawtbuf.Buffer getBindingData() { - return bean.f_bindingData; - } - - public Bean setBindingData(org.fusesource.hawtbuf.Buffer bindingData) { - copyCheck(); - this.f_bindingData = bindingData; - return this; - } - - public void clearBindingData() { - copyCheck(); - this.f_bindingData = null; - } - - public String toString() { - return toString(new java.lang.StringBuilder(), "").toString(); - } - - public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix) { - if( hasKey() ) { - sb.append(prefix+"key: "); - sb.append(getKey()); - sb.append("\n"); - } - if( hasBindingKind() ) { - sb.append(prefix+"binding_kind: "); - sb.append(getBindingKind()); - sb.append("\n"); - } - if( hasBindingData() ) { - sb.append(prefix+"binding_data: "); - sb.append(getBindingData()); - sb.append("\n"); - } - return sb; - } - - public Bean mergeUnframed(java.io.InputStream input) throws java.io.IOException { - return mergeUnframed(new org.fusesource.hawtbuf.proto.CodedInputStream(input)); - } - - public Bean mergeUnframed(org.fusesource.hawtbuf.proto.CodedInputStream input) throws java.io.IOException { - copyCheck(); - while (true) { - int tag = input.readTag(); - if ((tag & 0x07) == 4) { - return this; - } - switch (tag) { - case 0: - return this; - default: { - break; - } - case 8: - setKey(input.readInt64()); - break; - case 18: - setBindingKind(new org.fusesource.hawtbuf.AsciiBuffer(input.readBytes())); - break; - case 26: - setBindingData(input.readBytes()); - break; - } - } - } - public boolean equals(Object obj) { - if( obj==this ) - return true; - - if( obj==null || obj.getClass()!=Bean.class ) - return false; - - return equals((Bean)obj); - } - - public boolean equals(Bean obj) { - if (hasKey() ^ obj.hasKey() ) - return false; - if (hasKey() && ( getKey()!=obj.getKey() )) - return false; - if (hasBindingKind() ^ obj.hasBindingKind() ) - return false; - if (hasBindingKind() && ( !getBindingKind().equals(obj.getBindingKind()) )) - return false; - if (hasBindingData() ^ obj.hasBindingData() ) - return false; - if (hasBindingData() && ( !getBindingData().equals(obj.getBindingData()) )) - return false; - return true; - } - - public int hashCode() { - int rc=2066384; - if (hasKey()) { - rc ^= ( 75327^(new Long(getKey())).hashCode() ); - } - if (hasBindingKind()) { - rc ^= ( 1382366105^getBindingKind().hashCode() ); - } - if (hasBindingData()) { - rc ^= ( 1382150063^getBindingData().hashCode() ); - } - return rc; - } - - public Bean mergeFrom(Getter other) { - copyCheck(); - if (other.hasKey()) { - setKey(other.getKey()); - } - if (other.hasBindingKind()) { - setBindingKind(other.getBindingKind()); - } - if (other.hasBindingData()) { - setBindingData(other.getBindingData()); - } - return this; - } - - public void clear() { - clearKey(); - clearBindingKind(); - clearBindingData(); - } - - public void readExternal(java.io.DataInput in) throws java.io.IOException { - assert frozen==null : org.fusesource.hawtbuf.proto.MessageBufferSupport.FORZEN_ERROR_MESSAGE; - bean = this; - frozen = null; - f_key = in.readLong(); - b_key = true; - { - int size = in.readInt(); - if( size>=0 ) { - byte b[] = new byte[size]; - in.readFully(b); - f_bindingKind = new org.fusesource.hawtbuf.AsciiBuffer(b); - } else { - f_bindingKind = null; - } - } - { - int size = in.readInt(); - if( size>=0 ) { - byte b[] = new byte[size]; - in.readFully(b); - f_bindingData = new org.fusesource.hawtbuf.Buffer(b); - } else { - f_bindingData = null; - } - } - } - - public void writeExternal(java.io.DataOutput out) throws java.io.IOException { - out.writeLong(bean.f_key); - if( bean.f_bindingKind!=null ) { - out.writeInt(bean.f_bindingKind.getLength()); - out.write(bean.f_bindingKind.getData(), bean.f_bindingKind.getOffset(), bean.f_bindingKind.getLength()); - } else { - out.writeInt(-1); - } - if( bean.f_bindingData!=null ) { - out.writeInt(bean.f_bindingData.getLength()); - out.write(bean.f_bindingData.getData(), bean.f_bindingData.getOffset(), bean.f_bindingData.getLength()); - } else { - out.writeInt(-1); - } - } - - } - - static public final class Buffer implements org.fusesource.hawtbuf.proto.MessageBuffer, Getter { - - private Bean bean; - private org.fusesource.hawtbuf.Buffer buffer; - private int size=-1; - private int hashCode; - - private Buffer(org.fusesource.hawtbuf.Buffer buffer) { - this.buffer = buffer; - } - - private Buffer(Bean bean) { - this.bean = bean; - } - - public Bean copy() { - return bean().copy(); - } - - public Buffer freeze() { - return this; - } - - private Bean bean() { - if (bean == null) { - try { - bean = new Bean().mergeUnframed(new org.fusesource.hawtbuf.proto.CodedInputStream(buffer)); - bean.frozen=this; - } catch (org.fusesource.hawtbuf.proto.InvalidProtocolBufferException e) { - throw new RuntimeException(e); - } catch (java.io.IOException e) { - throw new RuntimeException("An IOException was thrown (should never happen in this method).", e); - } - } - return bean; - } - - public String toString() { - return bean().toString(); - } - - public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix) { - return bean().toString(sb, prefix); - } - - // required int64 key = 1; - public boolean hasKey() { - return bean().hasKey(); - } - - public long getKey() { - return bean().getKey(); - } - - // optional bytes binding_kind = 2; - public boolean hasBindingKind() { - return bean().hasBindingKind(); - } - - public org.fusesource.hawtbuf.AsciiBuffer getBindingKind() { - return bean().getBindingKind(); - } - - // optional bytes binding_data = 3; - public boolean hasBindingData() { - return bean().hasBindingData(); - } - - public org.fusesource.hawtbuf.Buffer getBindingData() { - return bean().getBindingData(); - } - - public org.fusesource.hawtbuf.Buffer toUnframedBuffer() { - if( buffer !=null ) { - return buffer; - } - return org.fusesource.hawtbuf.proto.MessageBufferSupport.toUnframedBuffer(this); - } - - public org.fusesource.hawtbuf.Buffer toFramedBuffer() { - return org.fusesource.hawtbuf.proto.MessageBufferSupport.toFramedBuffer(this); - } - - public byte[] toUnframedByteArray() { - return toUnframedBuffer().toByteArray(); - } - - public byte[] toFramedByteArray() { - return toFramedBuffer().toByteArray(); - } - - public void writeFramed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException { - output.writeRawVarint32(serializedSizeUnframed()); - writeUnframed(output); - } - - public void writeFramed(java.io.OutputStream output) throws java.io.IOException { - org.fusesource.hawtbuf.proto.CodedOutputStream codedOutput = new org.fusesource.hawtbuf.proto.CodedOutputStream(output); - writeFramed(codedOutput); - codedOutput.flush(); - } - - public void writeUnframed(java.io.OutputStream output) throws java.io.IOException { - org.fusesource.hawtbuf.proto.CodedOutputStream codedOutput = new org.fusesource.hawtbuf.proto.CodedOutputStream(output); - writeUnframed(codedOutput); - codedOutput.flush(); - } - - public void writeUnframed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException { - if (buffer == null) { - int size = serializedSizeUnframed(); - buffer = output.getNextBuffer(size); - org.fusesource.hawtbuf.proto.CodedOutputStream original=null; - if( buffer == null ) { - buffer = new org.fusesource.hawtbuf.Buffer(new byte[size]); - original = output; - output = new org.fusesource.hawtbuf.proto.CodedOutputStream(buffer); - } - output.writeInt64(1, bean.getKey()); - if (bean.hasBindingKind()) { - output.writeBytes(2, bean.getBindingKind()); - } - if (bean.hasBindingData()) { - output.writeBytes(3, bean.getBindingData()); - } - if( original !=null ) { - output.checkNoSpaceLeft(); - output = original; - output.writeRawBytes(buffer); - } - } else { - output.writeRawBytes(buffer); - } - } - - public int serializedSizeFramed() { - int t = serializedSizeUnframed(); - return org.fusesource.hawtbuf.proto.CodedOutputStream.computeRawVarint32Size(t) + t; - } - - public int serializedSizeUnframed() { - if (buffer != null) { - return buffer.length; - } - if (size != -1) - return size; - - size = 0; - size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt64Size(1, getKey()); - if (hasBindingKind()) { - size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(2, getBindingKind()); - } - if (hasBindingData()) { - size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(3, getBindingData()); - } - return size; - } - - public boolean equals(Object obj) { - if( obj==this ) - return true; - - if( obj==null || obj.getClass()!=Buffer.class ) - return false; - - return equals((Buffer)obj); - } - - public boolean equals(Buffer obj) { - return toUnframedBuffer().equals(obj.toUnframedBuffer()); - } - - public int hashCode() { - if( hashCode==0 ) { - hashCode=2000715872 ^ toUnframedBuffer().hashCode(); - } - return hashCode; - } - - public boolean frozen() { - return true; - } - } - -} - diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/tar/TarBuffer.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/tar/TarBuffer.class deleted file mode 100644 index 2f6849f90..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/tar/TarBuffer.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/tar/TarBuffer.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/tar/TarBuffer.java deleted file mode 100644 index 6bde68fa5..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/tar/TarBuffer.java +++ /dev/null @@ -1,462 +0,0 @@ -/* - * 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. - * - */ - -/* - * This package is based on the work done by Timothy Gerard Endres - * (time@ice.com) to whom the Ant project is very grateful for his great code. - */ - -package org.apache.activemq.console.command.store.tar; - -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; -import java.util.Arrays; - -/** - * The TarBuffer class implements the tar archive concept - * of a buffered input stream. This concept goes back to the - * days of blocked tape drives and special io devices. In the - * Java universe, the only real function that this class - * performs is to ensure that files have the correct "block" - * size, or other tars will complain. - *

    - * You should never have a need to access this class directly. - * TarBuffers are created by Tar IO Streams. - * - */ - -public class TarBuffer { - - /** Default record size */ - public static final int DEFAULT_RCDSIZE = (512); - - /** Default block size */ - public static final int DEFAULT_BLKSIZE = (DEFAULT_RCDSIZE * 20); - - private InputStream inStream; - private OutputStream outStream; - private byte[] blockBuffer; - private int currBlkIdx; - private int currRecIdx; - private int blockSize; - private int recordSize; - private int recsPerBlock; - private boolean debug; - - /** - * Constructor for a TarBuffer on an input stream. - * @param inStream the input stream to use - */ - public TarBuffer(InputStream inStream) { - this(inStream, TarBuffer.DEFAULT_BLKSIZE); - } - - /** - * Constructor for a TarBuffer on an input stream. - * @param inStream the input stream to use - * @param blockSize the block size to use - */ - public TarBuffer(InputStream inStream, int blockSize) { - this(inStream, blockSize, TarBuffer.DEFAULT_RCDSIZE); - } - - /** - * Constructor for a TarBuffer on an input stream. - * @param inStream the input stream to use - * @param blockSize the block size to use - * @param recordSize the record size to use - */ - public TarBuffer(InputStream inStream, int blockSize, int recordSize) { - this.inStream = inStream; - this.outStream = null; - - this.initialize(blockSize, recordSize); - } - - /** - * Constructor for a TarBuffer on an output stream. - * @param outStream the output stream to use - */ - public TarBuffer(OutputStream outStream) { - this(outStream, TarBuffer.DEFAULT_BLKSIZE); - } - - /** - * Constructor for a TarBuffer on an output stream. - * @param outStream the output stream to use - * @param blockSize the block size to use - */ - public TarBuffer(OutputStream outStream, int blockSize) { - this(outStream, blockSize, TarBuffer.DEFAULT_RCDSIZE); - } - - /** - * Constructor for a TarBuffer on an output stream. - * @param outStream the output stream to use - * @param blockSize the block size to use - * @param recordSize the record size to use - */ - public TarBuffer(OutputStream outStream, int blockSize, int recordSize) { - this.inStream = null; - this.outStream = outStream; - - this.initialize(blockSize, recordSize); - } - - /** - * Initialization common to all constructors. - */ - private void initialize(int blockSize, int recordSize) { - this.debug = false; - this.blockSize = blockSize; - this.recordSize = recordSize; - this.recsPerBlock = (this.blockSize / this.recordSize); - this.blockBuffer = new byte[this.blockSize]; - - if (this.inStream != null) { - this.currBlkIdx = -1; - this.currRecIdx = this.recsPerBlock; - } else { - this.currBlkIdx = 0; - this.currRecIdx = 0; - } - } - - /** - * Get the TAR Buffer's block size. Blocks consist of multiple records. - * @return the block size - */ - public int getBlockSize() { - return this.blockSize; - } - - /** - * Get the TAR Buffer's record size. - * @return the record size - */ - public int getRecordSize() { - return this.recordSize; - } - - /** - * Set the debugging flag for the buffer. - * - * @param debug If true, print debugging output. - */ - public void setDebug(boolean debug) { - this.debug = debug; - } - - /** - * Determine if an archive record indicate End of Archive. End of - * archive is indicated by a record that consists entirely of null bytes. - * - * @param record The record data to check. - * @return true if the record data is an End of Archive - */ - public boolean isEOFRecord(byte[] record) { - for (int i = 0, sz = getRecordSize(); i < sz; ++i) { - if (record[i] != 0) { - return false; - } - } - - return true; - } - - /** - * Skip over a record on the input stream. - * @throws IOException on error - */ - public void skipRecord() throws IOException { - if (debug) { - System.err.println("SkipRecord: recIdx = " + currRecIdx - + " blkIdx = " + currBlkIdx); - } - - if (inStream == null) { - throw new IOException("reading (via skip) from an output buffer"); - } - - if (currRecIdx >= recsPerBlock) { - if (!readBlock()) { - return; // UNDONE - } - } - - currRecIdx++; - } - - /** - * Read a record from the input stream and return the data. - * - * @return The record data. - * @throws IOException on error - */ - public byte[] readRecord() throws IOException { - if (debug) { - System.err.println("ReadRecord: recIdx = " + currRecIdx - + " blkIdx = " + currBlkIdx); - } - - if (inStream == null) { - throw new IOException("reading from an output buffer"); - } - - if (currRecIdx >= recsPerBlock) { - if (!readBlock()) { - return null; - } - } - - byte[] result = new byte[recordSize]; - - System.arraycopy(blockBuffer, - (currRecIdx * recordSize), result, 0, - recordSize); - - currRecIdx++; - - return result; - } - - /** - * @return false if End-Of-File, else true - */ - private boolean readBlock() throws IOException { - if (debug) { - System.err.println("ReadBlock: blkIdx = " + currBlkIdx); - } - - if (inStream == null) { - throw new IOException("reading from an output buffer"); - } - - currRecIdx = 0; - - int offset = 0; - int bytesNeeded = blockSize; - - while (bytesNeeded > 0) { - long numBytes = inStream.read(blockBuffer, offset, - bytesNeeded); - - // - // NOTE - // We have fit EOF, and the block is not full! - // - // This is a broken archive. It does not follow the standard - // blocking algorithm. However, because we are generous, and - // it requires little effort, we will simply ignore the error - // and continue as if the entire block were read. This does - // not appear to break anything upstream. We used to return - // false in this case. - // - // Thanks to 'Yohann.Roussel@alcatel.fr' for this fix. - // - if (numBytes == -1) { - if (offset == 0) { - // Ensure that we do not read gigabytes of zeros - // for a corrupt tar file. - // See http://issues.apache.org/bugzilla/show_bug.cgi?id=39924 - return false; - } - // However, just leaving the unread portion of the buffer dirty does - // cause problems in some cases. This problem is described in - // http://issues.apache.org/bugzilla/show_bug.cgi?id=29877 - // - // The solution is to fill the unused portion of the buffer with zeros. - - Arrays.fill(blockBuffer, offset, offset + bytesNeeded, (byte) 0); - - break; - } - - offset += numBytes; - bytesNeeded -= numBytes; - - if (numBytes != blockSize) { - if (debug) { - System.err.println("ReadBlock: INCOMPLETE READ " - + numBytes + " of " + blockSize - + " bytes read."); - } - } - } - - currBlkIdx++; - - return true; - } - - /** - * Get the current block number, zero based. - * - * @return The current zero based block number. - */ - public int getCurrentBlockNum() { - return currBlkIdx; - } - - /** - * Get the current record number, within the current block, zero based. - * Thus, current offset = (currentBlockNum * recsPerBlk) + currentRecNum. - * - * @return The current zero based record number. - */ - public int getCurrentRecordNum() { - return currRecIdx - 1; - } - - /** - * Write an archive record to the archive. - * - * @param record The record data to write to the archive. - * @throws IOException on error - */ - public void writeRecord(byte[] record) throws IOException { - if (debug) { - System.err.println("WriteRecord: recIdx = " + currRecIdx - + " blkIdx = " + currBlkIdx); - } - - if (outStream == null) { - throw new IOException("writing to an input buffer"); - } - - if (record.length != recordSize) { - throw new IOException("record to write has length '" - + record.length - + "' which is not the record size of '" - + recordSize + "'"); - } - - if (currRecIdx >= recsPerBlock) { - writeBlock(); - } - - System.arraycopy(record, 0, blockBuffer, - (currRecIdx * recordSize), - recordSize); - - currRecIdx++; - } - - /** - * Write an archive record to the archive, where the record may be - * inside of a larger array buffer. The buffer must be "offset plus - * record size" long. - * - * @param buf The buffer containing the record data to write. - * @param offset The offset of the record data within buf. - * @throws IOException on error - */ - public void writeRecord(byte[] buf, int offset) throws IOException { - if (debug) { - System.err.println("WriteRecord: recIdx = " + currRecIdx - + " blkIdx = " + currBlkIdx); - } - - if (outStream == null) { - throw new IOException("writing to an input buffer"); - } - - if ((offset + recordSize) > buf.length) { - throw new IOException("record has length '" + buf.length - + "' with offset '" + offset - + "' which is less than the record size of '" - + recordSize + "'"); - } - - if (currRecIdx >= recsPerBlock) { - writeBlock(); - } - - System.arraycopy(buf, offset, blockBuffer, - (currRecIdx * recordSize), - recordSize); - - currRecIdx++; - } - - /** - * Write a TarBuffer block to the archive. - */ - private void writeBlock() throws IOException { - if (debug) { - System.err.println("WriteBlock: blkIdx = " + currBlkIdx); - } - - if (outStream == null) { - throw new IOException("writing to an input buffer"); - } - - outStream.write(blockBuffer, 0, blockSize); - outStream.flush(); - - currRecIdx = 0; - currBlkIdx++; - Arrays.fill(blockBuffer, (byte) 0); - } - - /** - * Flush the current data block if it has any data in it. - */ - void flushBlock() throws IOException { - if (debug) { - System.err.println("TarBuffer.flushBlock() called."); - } - - if (outStream == null) { - throw new IOException("writing to an input buffer"); - } - - if (currRecIdx > 0) { - writeBlock(); - } - } - - /** - * Close the TarBuffer. If this is an output buffer, also flush the - * current block before closing. - * @throws IOException on error - */ - public void close() throws IOException { - if (debug) { - System.err.println("TarBuffer.closeBuffer()."); - } - - if (outStream != null) { - flushBlock(); - - if (outStream != System.out - && outStream != System.err) { - outStream.close(); - - outStream = null; - } - } else if (inStream != null) { - if (inStream != System.in) { - inStream.close(); - - inStream = null; - } - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/tar/TarConstants.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/tar/TarConstants.class deleted file mode 100644 index 57f49a714..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/tar/TarConstants.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/tar/TarConstants.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/tar/TarConstants.java deleted file mode 100644 index 940dc4665..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/tar/TarConstants.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * 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. - * - */ - -/* - * This package is based on the work done by Timothy Gerard Endres - * (time@ice.com) to whom the Ant project is very grateful for his great code. - */ - -package org.apache.activemq.console.command.store.tar; - -/** - * This interface contains all the definitions used in the package. - * - */ -// CheckStyle:InterfaceIsTypeCheck OFF (bc) -public interface TarConstants { - - /** - * The length of the name field in a header buffer. - */ - int NAMELEN = 100; - - /** - * The length of the mode field in a header buffer. - */ - int MODELEN = 8; - - /** - * The length of the user id field in a header buffer. - */ - int UIDLEN = 8; - - /** - * The length of the group id field in a header buffer. - */ - int GIDLEN = 8; - - /** - * The length of the checksum field in a header buffer. - */ - int CHKSUMLEN = 8; - - /** - * The length of the size field in a header buffer. - */ - int SIZELEN = 12; - - /** - * The maximum size of a file in a tar archive (That's 11 sevens, octal). - */ - long MAXSIZE = 077777777777L; - - /** - * The length of the magic field in a header buffer. - */ - int MAGICLEN = 8; - - /** - * The length of the modification time field in a header buffer. - */ - int MODTIMELEN = 12; - - /** - * The length of the user name field in a header buffer. - */ - int UNAMELEN = 32; - - /** - * The length of the group name field in a header buffer. - */ - int GNAMELEN = 32; - - /** - * The length of the devices field in a header buffer. - */ - int DEVLEN = 8; - - /** - * LF_ constants represent the "link flag" of an entry, or more commonly, - * the "entry type". This is the "old way" of indicating a normal file. - */ - byte LF_OLDNORM = 0; - - /** - * Normal file type. - */ - byte LF_NORMAL = (byte) '0'; - - /** - * Link file type. - */ - byte LF_LINK = (byte) '1'; - - /** - * Symbolic link file type. - */ - byte LF_SYMLINK = (byte) '2'; - - /** - * Character device file type. - */ - byte LF_CHR = (byte) '3'; - - /** - * Block device file type. - */ - byte LF_BLK = (byte) '4'; - - /** - * Directory file type. - */ - byte LF_DIR = (byte) '5'; - - /** - * FIFO (pipe) file type. - */ - byte LF_FIFO = (byte) '6'; - - /** - * Contiguous file type. - */ - byte LF_CONTIG = (byte) '7'; - - /** - * The magic tag representing a POSIX tar archive. - */ - String TMAGIC = "ustar"; - - /** - * The magic tag representing a GNU tar archive. - */ - String GNU_TMAGIC = "ustar "; - - /** - * The namr of the GNU tar entry which contains a long name. - */ - String GNU_LONGLINK = "././@LongLink"; - - /** - * Identifies the *next* file on the tape as having a long name. - */ - byte LF_GNUTYPE_LONGNAME = (byte) 'L'; -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/tar/TarEntry.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/tar/TarEntry.class deleted file mode 100644 index 0b969e2d7..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/tar/TarEntry.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/tar/TarEntry.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/tar/TarEntry.java deleted file mode 100644 index 5c7afa9fb..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/tar/TarEntry.java +++ /dev/null @@ -1,664 +0,0 @@ -/* - * 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. - * - */ - -/* - * This package is based on the work done by Timothy Gerard Endres - * (time@ice.com) to whom the Ant project is very grateful for his great code. - */ - -package org.apache.activemq.console.command.store.tar; - -import java.io.File; -import java.util.Date; -import java.util.Locale; - -/** - * This class represents an entry in a Tar archive. It consists - * of the entry's header, as well as the entry's File. Entries - * can be instantiated in one of three ways, depending on how - * they are to be used. - *

    - * TarEntries that are created from the header bytes read from - * an archive are instantiated with the TarEntry( byte[] ) - * constructor. These entries will be used when extracting from - * or listing the contents of an archive. These entries have their - * header filled in using the header bytes. They also set the File - * to null, since they reference an archive entry not a file. - *

    - * TarEntries that are created from Files that are to be written - * into an archive are instantiated with the TarEntry( File ) - * constructor. These entries have their header filled in using - * the File's information. They also keep a reference to the File - * for convenience when writing entries. - *

    - * Finally, TarEntries can be constructed from nothing but a name. - * This allows the programmer to construct the entry by hand, for - * instance when only an InputStream is available for writing to - * the archive, and the header information is constructed from - * other information. In this case the header fields are set to - * defaults and the File is set to null. - * - *

    - * The C structure for a Tar Entry's header is: - *

    - * struct header {
    - * char name[NAMSIZ];
    - * char mode[8];
    - * char uid[8];
    - * char gid[8];
    - * char size[12];
    - * char mtime[12];
    - * char chksum[8];
    - * char linkflag;
    - * char linkname[NAMSIZ];
    - * char magic[8];
    - * char uname[TUNMLEN];
    - * char gname[TGNMLEN];
    - * char devmajor[8];
    - * char devminor[8];
    - * } header;
    - * 
    - * - */ - -public class TarEntry implements TarConstants { - /** The entry's name. */ - private StringBuffer name; - - /** The entry's permission mode. */ - private int mode; - - /** The entry's user id. */ - private int userId; - - /** The entry's group id. */ - private int groupId; - - /** The entry's size. */ - private long size; - - /** The entry's modification time. */ - private long modTime; - - /** The entry's link flag. */ - private byte linkFlag; - - /** The entry's link name. */ - private StringBuffer linkName; - - /** The entry's magic tag. */ - private StringBuffer magic; - - /** The entry's user name. */ - private StringBuffer userName; - - /** The entry's group name. */ - private StringBuffer groupName; - - /** The entry's major device number. */ - private int devMajor; - - /** The entry's minor device number. */ - private int devMinor; - - /** The entry's file reference */ - private File file; - - /** Maximum length of a user's name in the tar file */ - public static final int MAX_NAMELEN = 31; - - /** Default permissions bits for directories */ - public static final int DEFAULT_DIR_MODE = 040755; - - /** Default permissions bits for files */ - public static final int DEFAULT_FILE_MODE = 0100644; - - /** Convert millis to seconds */ - public static final int MILLIS_PER_SECOND = 1000; - - /** - * Construct an empty entry and prepares the header values. - */ - private TarEntry () { - this.magic = new StringBuffer(TMAGIC); - this.name = new StringBuffer(); - this.linkName = new StringBuffer(); - - String user = System.getProperty("user.name", ""); - - if (user.length() > MAX_NAMELEN) { - user = user.substring(0, MAX_NAMELEN); - } - - this.userId = 0; - this.groupId = 0; - this.userName = new StringBuffer(user); - this.groupName = new StringBuffer(""); - this.file = null; - } - - /** - * Construct an entry with only a name. This allows the programmer - * to construct the entry's header "by hand". File is set to null. - * - * @param name the entry name - */ - public TarEntry(String name) { - this(name, false); - } - - /** - * Construct an entry with only a name. This allows the programmer - * to construct the entry's header "by hand". File is set to null. - * - * @param name the entry name - * @param preserveLeadingSlashes whether to allow leading slashes - * in the name. - */ - public TarEntry(String name, boolean preserveLeadingSlashes) { - this(); - - name = normalizeFileName(name, preserveLeadingSlashes); - boolean isDir = name.endsWith("/"); - - this.devMajor = 0; - this.devMinor = 0; - this.name = new StringBuffer(name); - this.mode = isDir ? DEFAULT_DIR_MODE : DEFAULT_FILE_MODE; - this.linkFlag = isDir ? LF_DIR : LF_NORMAL; - this.userId = 0; - this.groupId = 0; - this.size = 0; - this.modTime = (new Date()).getTime() / MILLIS_PER_SECOND; - this.linkName = new StringBuffer(""); - this.userName = new StringBuffer(""); - this.groupName = new StringBuffer(""); - this.devMajor = 0; - this.devMinor = 0; - - } - - /** - * Construct an entry with a name and a link flag. - * - * @param name the entry name - * @param linkFlag the entry link flag. - */ - public TarEntry(String name, byte linkFlag) { - this(name); - this.linkFlag = linkFlag; - if (linkFlag == LF_GNUTYPE_LONGNAME) { - magic = new StringBuffer(GNU_TMAGIC); - } - } - - /** - * Construct an entry for a file. File is set to file, and the - * header is constructed from information from the file. - * - * @param file The file that the entry represents. - */ - public TarEntry(File file) { - this(); - - this.file = file; - - String fileName = normalizeFileName(file.getPath(), false); - this.linkName = new StringBuffer(""); - this.name = new StringBuffer(fileName); - - if (file.isDirectory()) { - this.mode = DEFAULT_DIR_MODE; - this.linkFlag = LF_DIR; - - int nameLength = name.length(); - if (nameLength == 0 || name.charAt(nameLength - 1) != '/') { - this.name.append("/"); - } - this.size = 0; - } else { - this.mode = DEFAULT_FILE_MODE; - this.linkFlag = LF_NORMAL; - this.size = file.length(); - } - - this.modTime = file.lastModified() / MILLIS_PER_SECOND; - this.devMajor = 0; - this.devMinor = 0; - } - - /** - * Construct an entry from an archive's header bytes. File is set - * to null. - * - * @param headerBuf The header bytes from a tar archive entry. - */ - public TarEntry(byte[] headerBuf) { - this(); - parseTarHeader(headerBuf); - } - - /** - * Determine if the two entries are equal. Equality is determined - * by the header names being equal. - * - * @param it Entry to be checked for equality. - * @return True if the entries are equal. - */ - public boolean equals(TarEntry it) { - return getName().equals(it.getName()); - } - - /** - * Determine if the two entries are equal. Equality is determined - * by the header names being equal. - * - * @param it Entry to be checked for equality. - * @return True if the entries are equal. - */ - public boolean equals(Object it) { - if (it == null || getClass() != it.getClass()) { - return false; - } - return equals((TarEntry) it); - } - - /** - * Hashcodes are based on entry names. - * - * @return the entry hashcode - */ - public int hashCode() { - return getName().hashCode(); - } - - /** - * Determine if the given entry is a descendant of this entry. - * Descendancy is determined by the name of the descendant - * starting with this entry's name. - * - * @param desc Entry to be checked as a descendent of this. - * @return True if entry is a descendant of this. - */ - public boolean isDescendent(TarEntry desc) { - return desc.getName().startsWith(getName()); - } - - /** - * Get this entry's name. - * - * @return This entry's name. - */ - public String getName() { - return name.toString(); - } - - /** - * Set this entry's name. - * - * @param name This entry's new name. - */ - public void setName(String name) { - this.name = new StringBuffer(normalizeFileName(name, false)); - } - - /** - * Set the mode for this entry - * - * @param mode the mode for this entry - */ - public void setMode(int mode) { - this.mode = mode; - } - - /** - * Get this entry's link name. - * - * @return This entry's link name. - */ - public String getLinkName() { - return linkName.toString(); - } - - /** - * Get this entry's user id. - * - * @return This entry's user id. - */ - public int getUserId() { - return userId; - } - - /** - * Set this entry's user id. - * - * @param userId This entry's new user id. - */ - public void setUserId(int userId) { - this.userId = userId; - } - - /** - * Get this entry's group id. - * - * @return This entry's group id. - */ - public int getGroupId() { - return groupId; - } - - /** - * Set this entry's group id. - * - * @param groupId This entry's new group id. - */ - public void setGroupId(int groupId) { - this.groupId = groupId; - } - - /** - * Get this entry's user name. - * - * @return This entry's user name. - */ - public String getUserName() { - return userName.toString(); - } - - /** - * Set this entry's user name. - * - * @param userName This entry's new user name. - */ - public void setUserName(String userName) { - this.userName = new StringBuffer(userName); - } - - /** - * Get this entry's group name. - * - * @return This entry's group name. - */ - public String getGroupName() { - return groupName.toString(); - } - - /** - * Set this entry's group name. - * - * @param groupName This entry's new group name. - */ - public void setGroupName(String groupName) { - this.groupName = new StringBuffer(groupName); - } - - /** - * Convenience method to set this entry's group and user ids. - * - * @param userId This entry's new user id. - * @param groupId This entry's new group id. - */ - public void setIds(int userId, int groupId) { - setUserId(userId); - setGroupId(groupId); - } - - /** - * Convenience method to set this entry's group and user names. - * - * @param userName This entry's new user name. - * @param groupName This entry's new group name. - */ - public void setNames(String userName, String groupName) { - setUserName(userName); - setGroupName(groupName); - } - - /** - * Set this entry's modification time. The parameter passed - * to this method is in "Java time". - * - * @param time This entry's new modification time. - */ - public void setModTime(long time) { - modTime = time / MILLIS_PER_SECOND; - } - - /** - * Set this entry's modification time. - * - * @param time This entry's new modification time. - */ - public void setModTime(Date time) { - modTime = time.getTime() / MILLIS_PER_SECOND; - } - - /** - * Set this entry's modification time. - * - * @return time This entry's new modification time. - */ - public Date getModTime() { - return new Date(modTime * MILLIS_PER_SECOND); - } - - /** - * Get this entry's file. - * - * @return This entry's file. - */ - public File getFile() { - return file; - } - - /** - * Get this entry's mode. - * - * @return This entry's mode. - */ - public int getMode() { - return mode; - } - - /** - * Get this entry's file size. - * - * @return This entry's file size. - */ - public long getSize() { - return size; - } - - /** - * Set this entry's file size. - * - * @param size This entry's new file size. - */ - public void setSize(long size) { - this.size = size; - } - - - /** - * Indicate if this entry is a GNU long name block - * - * @return true if this is a long name extension provided by GNU tar - */ - public boolean isGNULongNameEntry() { - return linkFlag == LF_GNUTYPE_LONGNAME - && name.toString().equals(GNU_LONGLINK); - } - - /** - * Return whether or not this entry represents a directory. - * - * @return True if this entry is a directory. - */ - public boolean isDirectory() { - if (file != null) { - return file.isDirectory(); - } - - if (linkFlag == LF_DIR) { - return true; - } - - if (getName().endsWith("/")) { - return true; - } - - return false; - } - - /** - * If this entry represents a file, and the file is a directory, return - * an array of TarEntries for this entry's children. - * - * @return An array of TarEntry's for this entry's children. - */ - public TarEntry[] getDirectoryEntries() { - if (file == null || !file.isDirectory()) { - return new TarEntry[0]; - } - - String[] list = file.list(); - TarEntry[] result = new TarEntry[list.length]; - - for (int i = 0; i < list.length; ++i) { - result[i] = new TarEntry(new File(file, list[i])); - } - - return result; - } - - /** - * Write an entry's header information to a header buffer. - * - * @param outbuf The tar entry header buffer to fill in. - */ - public void writeEntryHeader(byte[] outbuf) { - int offset = 0; - - offset = TarUtils.getNameBytes(name, outbuf, offset, NAMELEN); - offset = TarUtils.getOctalBytes(mode, outbuf, offset, MODELEN); - offset = TarUtils.getOctalBytes(userId, outbuf, offset, UIDLEN); - offset = TarUtils.getOctalBytes(groupId, outbuf, offset, GIDLEN); - offset = TarUtils.getLongOctalBytes(size, outbuf, offset, SIZELEN); - offset = TarUtils.getLongOctalBytes(modTime, outbuf, offset, MODTIMELEN); - - int csOffset = offset; - - for (int c = 0; c < CHKSUMLEN; ++c) { - outbuf[offset++] = (byte) ' '; - } - - outbuf[offset++] = linkFlag; - offset = TarUtils.getNameBytes(linkName, outbuf, offset, NAMELEN); - offset = TarUtils.getNameBytes(magic, outbuf, offset, MAGICLEN); - offset = TarUtils.getNameBytes(userName, outbuf, offset, UNAMELEN); - offset = TarUtils.getNameBytes(groupName, outbuf, offset, GNAMELEN); - offset = TarUtils.getOctalBytes(devMajor, outbuf, offset, DEVLEN); - offset = TarUtils.getOctalBytes(devMinor, outbuf, offset, DEVLEN); - - while (offset < outbuf.length) { - outbuf[offset++] = 0; - } - - long chk = TarUtils.computeCheckSum(outbuf); - - TarUtils.getCheckSumOctalBytes(chk, outbuf, csOffset, CHKSUMLEN); - } - - /** - * Parse an entry's header information from a header buffer. - * - * @param header The tar entry header buffer to get information from. - */ - public void parseTarHeader(byte[] header) { - int offset = 0; - - name = TarUtils.parseName(header, offset, NAMELEN); - offset += NAMELEN; - mode = (int) TarUtils.parseOctal(header, offset, MODELEN); - offset += MODELEN; - userId = (int) TarUtils.parseOctal(header, offset, UIDLEN); - offset += UIDLEN; - groupId = (int) TarUtils.parseOctal(header, offset, GIDLEN); - offset += GIDLEN; - size = TarUtils.parseOctal(header, offset, SIZELEN); - offset += SIZELEN; - modTime = TarUtils.parseOctal(header, offset, MODTIMELEN); - offset += MODTIMELEN; - offset += CHKSUMLEN; - linkFlag = header[offset++]; - linkName = TarUtils.parseName(header, offset, NAMELEN); - offset += NAMELEN; - magic = TarUtils.parseName(header, offset, MAGICLEN); - offset += MAGICLEN; - userName = TarUtils.parseName(header, offset, UNAMELEN); - offset += UNAMELEN; - groupName = TarUtils.parseName(header, offset, GNAMELEN); - offset += GNAMELEN; - devMajor = (int) TarUtils.parseOctal(header, offset, DEVLEN); - offset += DEVLEN; - devMinor = (int) TarUtils.parseOctal(header, offset, DEVLEN); - } - - /** - * Strips Windows' drive letter as well as any leading slashes, - * turns path separators into forward slahes. - */ - private static String normalizeFileName(String fileName, - boolean preserveLeadingSlashes) { - String osname = System.getProperty("os.name").toLowerCase(Locale.ENGLISH); - - if (osname != null) { - - // Strip off drive letters! - // REVIEW Would a better check be "(File.separator == '\')"? - - if (osname.startsWith("windows")) { - if (fileName.length() > 2) { - char ch1 = fileName.charAt(0); - char ch2 = fileName.charAt(1); - - if (ch2 == ':' - && ((ch1 >= 'a' && ch1 <= 'z') - || (ch1 >= 'A' && ch1 <= 'Z'))) { - fileName = fileName.substring(2); - } - } - } else if (osname.indexOf("netware") > -1) { - int colon = fileName.indexOf(':'); - if (colon != -1) { - fileName = fileName.substring(colon + 1); - } - } - } - - fileName = fileName.replace(File.separatorChar, '/'); - - // No absolute pathnames - // Windows (and Posix?) paths can start with "\\NetworkDrive\", - // so we loop on starting /'s. - while (!preserveLeadingSlashes && fileName.startsWith("/")) { - fileName = fileName.substring(1); - } - return fileName; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/tar/TarInputStream.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/tar/TarInputStream.class deleted file mode 100644 index ea8234b70..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/tar/TarInputStream.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/tar/TarInputStream.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/tar/TarInputStream.java deleted file mode 100644 index 53c114de6..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/tar/TarInputStream.java +++ /dev/null @@ -1,402 +0,0 @@ -/* - * 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. - * - */ - -/* - * This package is based on the work done by Timothy Gerard Endres - * (time@ice.com) to whom the Ant project is very grateful for his great code. - */ - -package org.apache.activemq.console.command.store.tar; - -import java.io.FilterInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - -/** - * The TarInputStream reads a UNIX tar archive as an InputStream. - * methods are provided to position at each successive entry in - * the archive, and the read each entry as a normal input stream - * using read(). - * - */ -public class TarInputStream extends FilterInputStream { - private static final int SMALL_BUFFER_SIZE = 256; - private static final int BUFFER_SIZE = 8 * 1024; - private static final int LARGE_BUFFER_SIZE = 32 * 1024; - private static final int BYTE_MASK = 0xFF; - - // CheckStyle:VisibilityModifier OFF - bc - protected boolean debug; - protected boolean hasHitEOF; - protected long entrySize; - protected long entryOffset; - protected byte[] readBuf; - protected TarBuffer buffer; - protected TarEntry currEntry; - - /** - * This contents of this array is not used at all in this class, - * it is only here to avoid repreated object creation during calls - * to the no-arg read method. - */ - protected byte[] oneBuf; - - // CheckStyle:VisibilityModifier ON - - /** - * Constructor for TarInputStream. - * @param is the input stream to use - */ - public TarInputStream(InputStream is) { - this(is, TarBuffer.DEFAULT_BLKSIZE, TarBuffer.DEFAULT_RCDSIZE); - } - - /** - * Constructor for TarInputStream. - * @param is the input stream to use - * @param blockSize the block size to use - */ - public TarInputStream(InputStream is, int blockSize) { - this(is, blockSize, TarBuffer.DEFAULT_RCDSIZE); - } - - /** - * Constructor for TarInputStream. - * @param is the input stream to use - * @param blockSize the block size to use - * @param recordSize the record size to use - */ - public TarInputStream(InputStream is, int blockSize, int recordSize) { - super(is); - - this.buffer = new TarBuffer(is, blockSize, recordSize); - this.readBuf = null; - this.oneBuf = new byte[1]; - this.debug = false; - this.hasHitEOF = false; - } - - /** - * Sets the debugging flag. - * - * @param debug True to turn on debugging. - */ - public void setDebug(boolean debug) { - this.debug = debug; - buffer.setDebug(debug); - } - - /** - * Closes this stream. Calls the TarBuffer's close() method. - * @throws IOException on error - */ - public void close() throws IOException { - buffer.close(); - } - - /** - * Get the record size being used by this stream's TarBuffer. - * - * @return The TarBuffer record size. - */ - public int getRecordSize() { - return buffer.getRecordSize(); - } - - /** - * Get the available data that can be read from the current - * entry in the archive. This does not indicate how much data - * is left in the entire archive, only in the current entry. - * This value is determined from the entry's size header field - * and the amount of data already read from the current entry. - * Integer.MAX_VALUE is returen in case more than Integer.MAX_VALUE - * bytes are left in the current entry in the archive. - * - * @return The number of available bytes for the current entry. - * @throws IOException for signature - */ - public int available() throws IOException { - if (entrySize - entryOffset > Integer.MAX_VALUE) { - return Integer.MAX_VALUE; - } - return (int) (entrySize - entryOffset); - } - - /** - * Skip bytes in the input buffer. This skips bytes in the - * current entry's data, not the entire archive, and will - * stop at the end of the current entry's data if the number - * to skip extends beyond that point. - * - * @param numToSkip The number of bytes to skip. - * @return the number actually skipped - * @throws IOException on error - */ - public long skip(long numToSkip) throws IOException { - // REVIEW - // This is horribly inefficient, but it ensures that we - // properly skip over bytes via the TarBuffer... - // - byte[] skipBuf = new byte[BUFFER_SIZE]; - long skip = numToSkip; - while (skip > 0) { - int realSkip = (int) (skip > skipBuf.length ? skipBuf.length : skip); - int numRead = read(skipBuf, 0, realSkip); - if (numRead == -1) { - break; - } - skip -= numRead; - } - return (numToSkip - skip); - } - - /** - * Since we do not support marking just yet, we return false. - * - * @return False. - */ - public boolean markSupported() { - return false; - } - - /** - * Since we do not support marking just yet, we do nothing. - * - * @param markLimit The limit to mark. - */ - public void mark(int markLimit) { - } - - /** - * Since we do not support marking just yet, we do nothing. - */ - public void reset() { - } - - /** - * Get the next entry in this tar archive. This will skip - * over any remaining data in the current entry, if there - * is one, and place the input stream at the header of the - * next entry, and read the header and instantiate a new - * TarEntry from the header bytes and return that entry. - * If there are no more entries in the archive, null will - * be returned to indicate that the end of the archive has - * been reached. - * - * @return The next TarEntry in the archive, or null. - * @throws IOException on error - */ - public TarEntry getNextEntry() throws IOException { - if (hasHitEOF) { - return null; - } - - if (currEntry != null) { - long numToSkip = entrySize - entryOffset; - - if (debug) { - System.err.println("TarInputStream: SKIP currENTRY '" - + currEntry.getName() + "' SZ " - + entrySize + " OFF " - + entryOffset + " skipping " - + numToSkip + " bytes"); - } - - while (numToSkip > 0) { - long skipped = skip(numToSkip); - if (skipped <= 0) { - throw new RuntimeException("failed to skip current tar" - + " entry"); - } - numToSkip -= skipped; - } - - readBuf = null; - } - - byte[] headerBuf = buffer.readRecord(); - - if (headerBuf == null) { - if (debug) { - System.err.println("READ NULL RECORD"); - } - hasHitEOF = true; - } else if (buffer.isEOFRecord(headerBuf)) { - if (debug) { - System.err.println("READ EOF RECORD"); - } - hasHitEOF = true; - } - - if (hasHitEOF) { - currEntry = null; - } else { - currEntry = new TarEntry(headerBuf); - - if (debug) { - System.err.println("TarInputStream: SET CURRENTRY '" - + currEntry.getName() - + "' size = " - + currEntry.getSize()); - } - - entryOffset = 0; - - entrySize = currEntry.getSize(); - } - - if (currEntry != null && currEntry.isGNULongNameEntry()) { - // read in the name - StringBuffer longName = new StringBuffer(); - byte[] buf = new byte[SMALL_BUFFER_SIZE]; - int length = 0; - while ((length = read(buf)) >= 0) { - longName.append(new String(buf, 0, length)); - } - getNextEntry(); - if (currEntry == null) { - // Bugzilla: 40334 - // Malformed tar file - long entry name not followed by entry - return null; - } - // remove trailing null terminator - if (longName.length() > 0 - && longName.charAt(longName.length() - 1) == 0) { - longName.deleteCharAt(longName.length() - 1); - } - currEntry.setName(longName.toString()); - } - - return currEntry; - } - - /** - * Reads a byte from the current tar archive entry. - * - * This method simply calls read( byte[], int, int ). - * - * @return The byte read, or -1 at EOF. - * @throws IOException on error - */ - public int read() throws IOException { - int num = read(oneBuf, 0, 1); - return num == -1 ? -1 : ((int) oneBuf[0]) & BYTE_MASK; - } - - /** - * Reads bytes from the current tar archive entry. - * - * This method is aware of the boundaries of the current - * entry in the archive and will deal with them as if they - * were this stream's start and EOF. - * - * @param buf The buffer into which to place bytes read. - * @param offset The offset at which to place bytes read. - * @param numToRead The number of bytes to read. - * @return The number of bytes read, or -1 at EOF. - * @throws IOException on error - */ - public int read(byte[] buf, int offset, int numToRead) throws IOException { - int totalRead = 0; - - if (entryOffset >= entrySize) { - return -1; - } - - if ((numToRead + entryOffset) > entrySize) { - numToRead = (int) (entrySize - entryOffset); - } - - if (readBuf != null) { - int sz = (numToRead > readBuf.length) ? readBuf.length - : numToRead; - - System.arraycopy(readBuf, 0, buf, offset, sz); - - if (sz >= readBuf.length) { - readBuf = null; - } else { - int newLen = readBuf.length - sz; - byte[] newBuf = new byte[newLen]; - - System.arraycopy(readBuf, sz, newBuf, 0, newLen); - - readBuf = newBuf; - } - - totalRead += sz; - numToRead -= sz; - offset += sz; - } - - while (numToRead > 0) { - byte[] rec = buffer.readRecord(); - - if (rec == null) { - // Unexpected EOF! - throw new IOException("unexpected EOF with " + numToRead - + " bytes unread"); - } - - int sz = numToRead; - int recLen = rec.length; - - if (recLen > sz) { - System.arraycopy(rec, 0, buf, offset, sz); - - readBuf = new byte[recLen - sz]; - - System.arraycopy(rec, sz, readBuf, 0, recLen - sz); - } else { - sz = recLen; - - System.arraycopy(rec, 0, buf, offset, recLen); - } - - totalRead += sz; - numToRead -= sz; - offset += sz; - } - - entryOffset += totalRead; - - return totalRead; - } - - /** - * Copies the contents of the current tar archive entry directly into - * an output stream. - * - * @param out The OutputStream into which to write the entry's data. - * @throws IOException on error - */ - public void copyEntryContents(OutputStream out) throws IOException { - byte[] buf = new byte[LARGE_BUFFER_SIZE]; - - while (true) { - int numRead = read(buf, 0, buf.length); - - if (numRead == -1) { - break; - } - - out.write(buf, 0, numRead); - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/tar/TarOutputStream.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/tar/TarOutputStream.class deleted file mode 100644 index 1a60e0c72..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/tar/TarOutputStream.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/tar/TarOutputStream.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/tar/TarOutputStream.java deleted file mode 100644 index 26de93f7b..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/tar/TarOutputStream.java +++ /dev/null @@ -1,356 +0,0 @@ -/* - * 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. - * - */ - -/* - * This package is based on the work done by Timothy Gerard Endres - * (time@ice.com) to whom the Ant project is very grateful for his great code. - */ - -package org.apache.activemq.console.command.store.tar; - -import java.io.FilterOutputStream; -import java.io.OutputStream; -import java.io.IOException; - -/** - * The TarOutputStream writes a UNIX tar archive as an OutputStream. - * Methods are provided to put entries, and then write their contents - * by writing to this stream using write(). - * - */ -public class TarOutputStream extends FilterOutputStream { - /** Fail if a long file name is required in the archive. */ - public static final int LONGFILE_ERROR = 0; - - /** Long paths will be truncated in the archive. */ - public static final int LONGFILE_TRUNCATE = 1; - - /** GNU tar extensions are used to store long file names in the archive. */ - public static final int LONGFILE_GNU = 2; - - // CheckStyle:VisibilityModifier OFF - bc - protected boolean debug; - protected long currSize; - protected String currName; - protected long currBytes; - protected byte[] oneBuf; - protected byte[] recordBuf; - protected int assemLen; - protected byte[] assemBuf; - protected TarBuffer buffer; - protected int longFileMode = LONGFILE_ERROR; - // CheckStyle:VisibilityModifier ON - - private boolean closed = false; - - /** - * Constructor for TarInputStream. - * @param os the output stream to use - */ - public TarOutputStream(OutputStream os) { - this(os, TarBuffer.DEFAULT_BLKSIZE, TarBuffer.DEFAULT_RCDSIZE); - } - - /** - * Constructor for TarInputStream. - * @param os the output stream to use - * @param blockSize the block size to use - */ - public TarOutputStream(OutputStream os, int blockSize) { - this(os, blockSize, TarBuffer.DEFAULT_RCDSIZE); - } - - /** - * Constructor for TarInputStream. - * @param os the output stream to use - * @param blockSize the block size to use - * @param recordSize the record size to use - */ - public TarOutputStream(OutputStream os, int blockSize, int recordSize) { - super(os); - - this.buffer = new TarBuffer(os, blockSize, recordSize); - this.debug = false; - this.assemLen = 0; - this.assemBuf = new byte[recordSize]; - this.recordBuf = new byte[recordSize]; - this.oneBuf = new byte[1]; - } - - /** - * Set the long file mode. - * This can be LONGFILE_ERROR(0), LONGFILE_TRUNCATE(1) or LONGFILE_GNU(2). - * This specifies the treatment of long file names (names >= TarConstants.NAMELEN). - * Default is LONGFILE_ERROR. - * @param longFileMode the mode to use - */ - public void setLongFileMode(int longFileMode) { - this.longFileMode = longFileMode; - } - - - /** - * Sets the debugging flag. - * - * @param debugF True to turn on debugging. - */ - public void setDebug(boolean debugF) { - this.debug = debugF; - } - - /** - * Sets the debugging flag in this stream's TarBuffer. - * - * @param debug True to turn on debugging. - */ - public void setBufferDebug(boolean debug) { - buffer.setDebug(debug); - } - - /** - * Ends the TAR archive without closing the underlying OutputStream. - * The result is that the two EOF records of nulls are written. - * @throws IOException on error - */ - public void finish() throws IOException { - // See Bugzilla 28776 for a discussion on this - // http://issues.apache.org/bugzilla/show_bug.cgi?id=28776 - writeEOFRecord(); - writeEOFRecord(); - buffer.flushBlock(); - } - - /** - * Ends the TAR archive and closes the underlying OutputStream. - * This means that finish() is called followed by calling the - * TarBuffer's close(). - * @throws IOException on error - */ - public void close() throws IOException { - if (!closed) { - finish(); - buffer.close(); - out.close(); - closed = true; - } - } - - /** - * Get the record size being used by this stream's TarBuffer. - * - * @return The TarBuffer record size. - */ - public int getRecordSize() { - return buffer.getRecordSize(); - } - - /** - * Put an entry on the output stream. This writes the entry's - * header record and positions the output stream for writing - * the contents of the entry. Once this method is called, the - * stream is ready for calls to write() to write the entry's - * contents. Once the contents are written, closeEntry() - * MUST be called to ensure that all buffered data - * is completely written to the output stream. - * - * @param entry The TarEntry to be written to the archive. - * @throws IOException on error - */ - public void putNextEntry(TarEntry entry) throws IOException { - if (entry.getName().length() >= TarConstants.NAMELEN) { - - if (longFileMode == LONGFILE_GNU) { - // create a TarEntry for the LongLink, the contents - // of which are the entry's name - TarEntry longLinkEntry = new TarEntry(TarConstants.GNU_LONGLINK, - TarConstants.LF_GNUTYPE_LONGNAME); - - longLinkEntry.setSize(entry.getName().length() + 1); - putNextEntry(longLinkEntry); - write(entry.getName().getBytes()); - write(0); - closeEntry(); - } else if (longFileMode != LONGFILE_TRUNCATE) { - throw new RuntimeException("file name '" + entry.getName() - + "' is too long ( > " - + TarConstants.NAMELEN + " bytes)"); - } - } - - entry.writeEntryHeader(recordBuf); - buffer.writeRecord(recordBuf); - - currBytes = 0; - - if (entry.isDirectory()) { - currSize = 0; - } else { - currSize = entry.getSize(); - } - currName = entry.getName(); - } - - /** - * Close an entry. This method MUST be called for all file - * entries that contain data. The reason is that we must - * buffer data written to the stream in order to satisfy - * the buffer's record based writes. Thus, there may be - * data fragments still being assembled that must be written - * to the output stream before this entry is closed and the - * next entry written. - * @throws IOException on error - */ - public void closeEntry() throws IOException { - if (assemLen > 0) { - for (int i = assemLen; i < assemBuf.length; ++i) { - assemBuf[i] = 0; - } - - buffer.writeRecord(assemBuf); - - currBytes += assemLen; - assemLen = 0; - } - - if (currBytes < currSize) { - throw new IOException("entry '" + currName + "' closed at '" - + currBytes - + "' before the '" + currSize - + "' bytes specified in the header were written"); - } - } - - /** - * Writes a byte to the current tar archive entry. - * - * This method simply calls read( byte[], int, int ). - * - * @param b The byte written. - * @throws IOException on error - */ - public void write(int b) throws IOException { - oneBuf[0] = (byte) b; - - write(oneBuf, 0, 1); - } - - /** - * Writes bytes to the current tar archive entry. - * - * This method simply calls write( byte[], int, int ). - * - * @param wBuf The buffer to write to the archive. - * @throws IOException on error - */ - public void write(byte[] wBuf) throws IOException { - write(wBuf, 0, wBuf.length); - } - - /** - * Writes bytes to the current tar archive entry. This method - * is aware of the current entry and will throw an exception if - * you attempt to write bytes past the length specified for the - * current entry. The method is also (painfully) aware of the - * record buffering required by TarBuffer, and manages buffers - * that are not a multiple of recordsize in length, including - * assembling records from small buffers. - * - * @param wBuf The buffer to write to the archive. - * @param wOffset The offset in the buffer from which to get bytes. - * @param numToWrite The number of bytes to write. - * @throws IOException on error - */ - public void write(byte[] wBuf, int wOffset, int numToWrite) throws IOException { - if ((currBytes + numToWrite) > currSize) { - throw new IOException("request to write '" + numToWrite - + "' bytes exceeds size in header of '" - + currSize + "' bytes for entry '" - + currName + "'"); - - // - // We have to deal with assembly!!! - // The programmer can be writing little 32 byte chunks for all - // we know, and we must assemble complete records for writing. - // REVIEW Maybe this should be in TarBuffer? Could that help to - // eliminate some of the buffer copying. - // - } - - if (assemLen > 0) { - if ((assemLen + numToWrite) >= recordBuf.length) { - int aLen = recordBuf.length - assemLen; - - System.arraycopy(assemBuf, 0, recordBuf, 0, - assemLen); - System.arraycopy(wBuf, wOffset, recordBuf, - assemLen, aLen); - buffer.writeRecord(recordBuf); - - currBytes += recordBuf.length; - wOffset += aLen; - numToWrite -= aLen; - assemLen = 0; - } else { - System.arraycopy(wBuf, wOffset, assemBuf, assemLen, - numToWrite); - - wOffset += numToWrite; - assemLen += numToWrite; - numToWrite = 0; - } - } - - // - // When we get here we have EITHER: - // o An empty "assemble" buffer. - // o No bytes to write (numToWrite == 0) - // - while (numToWrite > 0) { - if (numToWrite < recordBuf.length) { - System.arraycopy(wBuf, wOffset, assemBuf, assemLen, - numToWrite); - - assemLen += numToWrite; - - break; - } - - buffer.writeRecord(wBuf, wOffset); - - int num = recordBuf.length; - - currBytes += num; - numToWrite -= num; - wOffset += num; - } - } - - /** - * Write an EOF (end of archive) record to the tar archive. - * An EOF record consists of a record of all zeros. - */ - private void writeEOFRecord() throws IOException { - for (int i = 0; i < recordBuf.length; ++i) { - recordBuf[i] = 0; - } - - buffer.writeRecord(recordBuf); - } -} - - diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/tar/TarUtils.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/tar/TarUtils.class deleted file mode 100644 index cb964875c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/tar/TarUtils.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/tar/TarUtils.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/tar/TarUtils.java deleted file mode 100644 index a89caec55..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/command/store/tar/TarUtils.java +++ /dev/null @@ -1,206 +0,0 @@ -/* - * 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. - * - */ - -/* - * This package is based on the work done by Timothy Gerard Endres - * (time@ice.com) to whom the Ant project is very grateful for his great code. - */ - -package org.apache.activemq.console.command.store.tar; - -/** - * This class provides static utility methods to work with byte streams. - * - */ -// CheckStyle:HideUtilityClassConstructorCheck OFF (bc) -public class TarUtils { - - private static final int BYTE_MASK = 255; - - /** - * Parse an octal string from a header buffer. This is used for the - * file permission mode value. - * - * @param header The header buffer from which to parse. - * @param offset The offset into the buffer from which to parse. - * @param length The number of header bytes to parse. - * @return The long value of the octal string. - */ - public static long parseOctal(byte[] header, int offset, int length) { - long result = 0; - boolean stillPadding = true; - int end = offset + length; - - for (int i = offset; i < end; ++i) { - if (header[i] == 0) { - break; - } - - if (header[i] == (byte) ' ' || header[i] == '0') { - if (stillPadding) { - continue; - } - - if (header[i] == (byte) ' ') { - break; - } - } - - stillPadding = false; - // CheckStyle:MagicNumber OFF - result = (result << 3) + (header[i] - '0'); - // CheckStyle:MagicNumber ON - } - - return result; - } - - /** - * Parse an entry name from a header buffer. - * - * @param header The header buffer from which to parse. - * @param offset The offset into the buffer from which to parse. - * @param length The number of header bytes to parse. - * @return The header's entry name. - */ - public static StringBuffer parseName(byte[] header, int offset, int length) { - StringBuffer result = new StringBuffer(length); - int end = offset + length; - - for (int i = offset; i < end; ++i) { - if (header[i] == 0) { - break; - } - - result.append((char) header[i]); - } - - return result; - } - - /** - * Determine the number of bytes in an entry name. - * - * @param name The header name from which to parse. - * @param buf The buffer from which to parse. - * @param offset The offset into the buffer from which to parse. - * @param length The number of header bytes to parse. - * @return The number of bytes in a header's entry name. - */ - public static int getNameBytes(StringBuffer name, byte[] buf, int offset, int length) { - int i; - - for (i = 0; i < length && i < name.length(); ++i) { - buf[offset + i] = (byte) name.charAt(i); - } - - for (; i < length; ++i) { - buf[offset + i] = 0; - } - - return offset + length; - } - - /** - * Parse an octal integer from a header buffer. - * - * @param value The header value - * @param buf The buffer from which to parse. - * @param offset The offset into the buffer from which to parse. - * @param length The number of header bytes to parse. - * @return The integer value of the octal bytes. - */ - public static int getOctalBytes(long value, byte[] buf, int offset, int length) { - int idx = length - 1; - - buf[offset + idx] = 0; - --idx; - buf[offset + idx] = (byte) ' '; - --idx; - - if (value == 0) { - buf[offset + idx] = (byte) '0'; - --idx; - } else { - for (long val = value; idx >= 0 && val > 0; --idx) { - // CheckStyle:MagicNumber OFF - buf[offset + idx] = (byte) ((byte) '0' + (byte) (val & 7)); - val = val >> 3; - // CheckStyle:MagicNumber ON - } - } - - for (; idx >= 0; --idx) { - buf[offset + idx] = (byte) ' '; - } - - return offset + length; - } - - /** - * Parse an octal long integer from a header buffer. - * - * @param value The header value - * @param buf The buffer from which to parse. - * @param offset The offset into the buffer from which to parse. - * @param length The number of header bytes to parse. - * @return The long value of the octal bytes. - */ - public static int getLongOctalBytes(long value, byte[] buf, int offset, int length) { - byte[] temp = new byte[length + 1]; - - getOctalBytes(value, temp, 0, length + 1); - System.arraycopy(temp, 0, buf, offset, length); - - return offset + length; - } - - /** - * Parse the checksum octal integer from a header buffer. - * - * @param value The header value - * @param buf The buffer from which to parse. - * @param offset The offset into the buffer from which to parse. - * @param length The number of header bytes to parse. - * @return The integer value of the entry's checksum. - */ - public static int getCheckSumOctalBytes(long value, byte[] buf, int offset, int length) { - getOctalBytes(value, buf, offset, length); - - buf[offset + length - 1] = (byte) ' '; - buf[offset + length - 2] = 0; - - return offset + length; - } - - /** - * Compute the checksum of a tar entry header. - * - * @param buf The tar entry's header buffer. - * @return The computed checksum. - */ - public static long computeCheckSum(byte[] buf) { - long sum = 0; - - for (int i = 0; i < buf.length; ++i) { - sum += BYTE_MASK & buf[i]; - } - - return sum; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/AbstractQueryFilter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/AbstractQueryFilter.class deleted file mode 100644 index 05a048a7e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/AbstractQueryFilter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/AbstractQueryFilter.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/AbstractQueryFilter.java deleted file mode 100644 index fc989d592..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/AbstractQueryFilter.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * 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.console.filter; - -import java.util.Collections; -import java.util.List; -import java.util.StringTokenizer; - -public abstract class AbstractQueryFilter implements QueryFilter { - protected QueryFilter next; - - /** - * Creates a query filter, with the next filter specified by next. - * @param next - the next query filter - */ - protected AbstractQueryFilter(QueryFilter next) { - this.next = next; - } - - /** - * Performs a query given the query string - * @param query - query string - * @return objects that matches the query - * @throws Exception - */ - public List query(String query) throws Exception { - // Converts string query to map query - StringTokenizer tokens = new StringTokenizer(query, QUERY_DELIMETER); - return query(Collections.list(tokens)); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/AmqMessagesQueryFilter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/AmqMessagesQueryFilter.class deleted file mode 100644 index 4580e78e9..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/AmqMessagesQueryFilter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/AmqMessagesQueryFilter.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/AmqMessagesQueryFilter.java deleted file mode 100644 index 4f6a8adbe..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/AmqMessagesQueryFilter.java +++ /dev/null @@ -1,180 +0,0 @@ -/** - * 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.console.filter; - -import java.net.URI; -import java.util.Collections; -import java.util.List; - -import javax.jms.Connection; -import javax.jms.ConnectionFactory; -import javax.jms.Destination; -import javax.jms.JMSException; -import javax.jms.QueueBrowser; -import javax.jms.Session; - -import org.apache.activemq.ActiveMQConnectionFactory; -import org.apache.activemq.command.ActiveMQQueue; -import org.apache.activemq.command.ActiveMQTopic; - -public class AmqMessagesQueryFilter extends AbstractQueryFilter { - - private URI brokerUrl; - private Destination destination; - - private ConnectionFactory connectionFactory; - - /** - * Create a JMS message query filter - * - * @param brokerUrl - broker url to connect to - * @param destination - JMS destination to query - */ - public AmqMessagesQueryFilter(URI brokerUrl, Destination destination) { - super(null); - this.brokerUrl = brokerUrl; - this.destination = destination; - } - - /** - * Create a JMS message query filter - * - * @param brokerUrl - broker url to connect to - * @param destination - JMS destination to query - */ - public AmqMessagesQueryFilter(ConnectionFactory connectionFactory, Destination destination) { - super(null); - this.destination = destination; - this.connectionFactory = connectionFactory; - } - - /** - * Queries the specified destination using the message selector format query - * - * @param queries - message selector queries - * @return list messages that matches the selector - * @throws Exception - */ - public List query(List queries) throws Exception { - String selector = ""; - - // Convert to message selector - for (Object query : queries) { - selector = selector + "(" + query.toString() + ") AND "; - } - - // Remove last AND - if (!selector.equals("")) { - selector = selector.substring(0, selector.length() - 5); - } - - if (destination instanceof ActiveMQQueue) { - return queryMessages((ActiveMQQueue) destination, selector); - } else { - return queryMessages((ActiveMQTopic) destination, selector); - } - } - - /** - * Query the messages of a queue destination using a queue browser - * - * @param queue - queue destination - * @param selector - message selector - * @return list of messages that matches the selector - * @throws Exception - */ - protected List queryMessages(ActiveMQQueue queue, String selector) throws Exception { - Connection conn = createConnection(); - - Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE); - QueueBrowser browser = sess.createBrowser(queue, selector); - - List messages = Collections.list(browser.getEnumeration()); - - conn.close(); - - return messages; - } - - /** - * Query the messages of a topic destination using a message consumer - * - * @param topic - topic destination - * @param selector - message selector - * @return list of messages that matches the selector - * @throws Exception - */ - protected List queryMessages(ActiveMQTopic topic, String selector) throws Exception { - // TODO: should we use a durable subscriber or a retroactive non-durable - // subscriber? - // TODO: if a durable subscriber is used, how do we manage it? - // subscribe/unsubscribe tasks? - return null; - } - - /** - * Create and start a JMS connection - * - * @return JMS connection - * @throws JMSException - */ - protected Connection createConnection() throws JMSException { - // maintain old behaviour, when called either way. - if (null == connectionFactory) { - connectionFactory = (new ActiveMQConnectionFactory(getBrokerUrl())); - } - Connection conn = connectionFactory.createConnection(); - conn.start(); - return conn; - } - - /** - * Get the broker url being used. - * - * @return broker url - */ - public URI getBrokerUrl() { - return brokerUrl; - } - - /** - * Set the broker url to use. - * - * @param brokerUrl - broker url - */ - public void setBrokerUrl(URI brokerUrl) { - this.brokerUrl = brokerUrl; - } - - /** - * Get the destination being used. - * - * @return - JMS destination - */ - public Destination getDestination() { - return destination; - } - - /** - * Set the destination to use. - * - * @param destination - JMS destination - */ - public void setDestination(Destination destination) { - this.destination = destination; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/GroupPropertiesViewFilter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/GroupPropertiesViewFilter.class deleted file mode 100644 index cf1427f53..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/GroupPropertiesViewFilter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/GroupPropertiesViewFilter.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/GroupPropertiesViewFilter.java deleted file mode 100644 index adf8a895b..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/GroupPropertiesViewFilter.java +++ /dev/null @@ -1,84 +0,0 @@ -/** - * 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.console.filter; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; - -public class GroupPropertiesViewFilter extends PropertiesViewFilter { - - /** - * Creates a group properties filter that is able to filter the display - * result based on a group prefix - * - * @param next - the next query filter - */ - public GroupPropertiesViewFilter(QueryFilter next) { - super(next); - } - - /** - * Creates a group properties filter that is able to filter the display - * result based on a group prefix - * - * @param groupView - the group filter to use - * @param next - the next query filter - */ - public GroupPropertiesViewFilter(Set groupView, QueryFilter next) { - super(groupView, next); - } - - /** - * Filter the properties that matches the group prefix only. - * - * @param data - map data to filter - * @return - filtered map data - */ - protected Map filterView(Map data) { - // If no view specified, display all attributes - if (viewFilter == null || viewFilter.isEmpty()) { - return data; - } - - Map newData; - try { - // Lets try to use the same class as the original - newData = data.getClass().newInstance(); - } catch (Exception e) { - // Lets use a default HashMap - newData = new HashMap(); - } - - // Filter the keys to view - for (Iterator i = data.keySet().iterator(); i.hasNext();) { - String key = i.next(); - - // Checks if key matches any of the group filter - for (Iterator j = viewFilter.iterator(); j.hasNext();) { - String group = (String)j.next(); - if (key.startsWith(group)) { - newData.put(key, data.get(key)); - break; - } - } - } - - return newData; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/MBeansAttributeQueryFilter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/MBeansAttributeQueryFilter.class deleted file mode 100644 index c2fc35264..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/MBeansAttributeQueryFilter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/MBeansAttributeQueryFilter.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/MBeansAttributeQueryFilter.java deleted file mode 100644 index fd9d4ee79..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/MBeansAttributeQueryFilter.java +++ /dev/null @@ -1,156 +0,0 @@ -/** - * 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.console.filter; - -import javax.management.Attribute; -import javax.management.AttributeList; -import javax.management.InstanceNotFoundException; -import javax.management.IntrospectionException; -import javax.management.MBeanAttributeInfo; -import javax.management.MBeanServerConnection; -import javax.management.ObjectInstance; -import javax.management.ObjectName; -import javax.management.ReflectionException; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -public class MBeansAttributeQueryFilter extends AbstractQueryFilter { - public static final String KEY_OBJECT_NAME_ATTRIBUTE = "Attribute:ObjectName:"; - - private MBeanServerConnection jmxConnection; - private Set attribView; - - /** - * Create an mbean attributes query filter that is able to select specific - * mbean attributes based on the object name to get. - * - * @param jmxConnection - JMX connection to use. - * @param attribView - the attributes to extract - * @param next - the next query filter - */ - public MBeansAttributeQueryFilter(MBeanServerConnection jmxConnection, Set attribView, MBeansObjectNameQueryFilter next) { - super(next); - this.jmxConnection = jmxConnection; - this.attribView = attribView; - } - - /** - * Filter the query by retrieving the attributes specified, this will modify - * the collection to a list of AttributeList - * - * @param queries - query list - * @return List of AttributeList, which includes the ObjectName, which has a - * key of MBeansAttributeQueryFilter.KEY_OBJECT_NAME_ATTRIBUTE - * @throws Exception - */ - public List query(List queries) throws Exception { - return getMBeanAttributesCollection(next.query(queries)); - } - - /** - * Retrieve the specified attributes of the mbean - * - * @param result - collection of ObjectInstances and/or ObjectNames - * @return List of AttributeList - * @throws IOException - * @throws ReflectionException - * @throws InstanceNotFoundException - * @throws NoSuchMethodException - */ - protected List getMBeanAttributesCollection(Collection result) throws IOException, ReflectionException, InstanceNotFoundException, NoSuchMethodException, IntrospectionException { - List mbeansCollection = new ArrayList(); - - for (Iterator i = result.iterator(); i.hasNext();) { - Object mbean = i.next(); - if (mbean instanceof ObjectInstance) { - try { - mbeansCollection.add(getMBeanAttributes(((ObjectInstance)mbean).getObjectName(), attribView)); - } catch (InstanceNotFoundException ignore) { - // mbean could have been deleted in the meantime - } - } else if (mbean instanceof ObjectName) { - try { - mbeansCollection.add(getMBeanAttributes((ObjectName)mbean, attribView)); - } catch (InstanceNotFoundException ignore) { - // mbean could have been deleted in the meantime - } - } else { - throw new NoSuchMethodException("Cannot get the mbean attributes for class: " + mbean.getClass().getName()); - } - } - - return mbeansCollection; - } - - /** - * Retrieve the specified attributes of the mbean - * - * @param obj - mbean ObjectInstance - * @param attrView - list of attributes to retrieve - * @return AttributeList for the mbean - * @throws ReflectionException - * @throws InstanceNotFoundException - * @throws IOException - */ - protected AttributeList getMBeanAttributes(ObjectInstance obj, Set attrView) throws ReflectionException, InstanceNotFoundException, IOException, IntrospectionException { - return getMBeanAttributes(obj.getObjectName(), attrView); - } - - /** - * Retrieve the specified attributes of the mbean - * - * @param objName - mbean ObjectName - * @param attrView - list of attributes to retrieve - * @return AttributeList for the mbean - * @throws IOException - * @throws ReflectionException - * @throws InstanceNotFoundException - */ - protected AttributeList getMBeanAttributes(ObjectName objName, Set attrView) throws IOException, ReflectionException, InstanceNotFoundException, IntrospectionException { - // If no attribute view specified, get all attributes - String[] attribs; - if (attrView == null || attrView.isEmpty()) { - MBeanAttributeInfo[] infos = jmxConnection.getMBeanInfo(objName).getAttributes(); - attribs = new String[infos.length]; - - for (int i = 0; i < infos.length; i++) { - if (infos[i].isReadable()) { - attribs[i] = infos[i].getName(); - } - } - - // Get selected attributes - } else { - - attribs = new String[attrView.size()]; - int count = 0; - for (Iterator i = attrView.iterator(); i.hasNext();) { - attribs[count++] = (String)i.next(); - } - } - - AttributeList attribList = jmxConnection.getAttributes(objName, attribs); - - attribList.add(0, new Attribute(KEY_OBJECT_NAME_ATTRIBUTE, objName)); - - return attribList; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/MBeansObjectNameQueryFilter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/MBeansObjectNameQueryFilter.class deleted file mode 100644 index 40aa6a228..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/MBeansObjectNameQueryFilter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/MBeansObjectNameQueryFilter.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/MBeansObjectNameQueryFilter.java deleted file mode 100644 index ee7efa39e..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/MBeansObjectNameQueryFilter.java +++ /dev/null @@ -1,119 +0,0 @@ -/** - * 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.console.filter; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import javax.management.MBeanServerConnection; -import javax.management.MalformedObjectNameException; -import javax.management.ObjectName; -import javax.management.QueryExp; - -public class MBeansObjectNameQueryFilter extends AbstractQueryFilter { - - public static final String DEFAULT_JMX_DOMAIN = "org.apache.activemq"; - public static final String QUERY_EXP_PREFIX = "MBeans.QueryExp."; - - private MBeanServerConnection jmxConnection; - - /** - * Creates an mbeans object name query filter that will query on the given - * JMX connection - * - * @param jmxConnection - JMX connection to use - */ - public MBeansObjectNameQueryFilter(MBeanServerConnection jmxConnection) { - super(null); - this.jmxConnection = jmxConnection; - } - - /** - * Queries the JMX service using a mapping of keys and values to construct - * the object name - * - * @param queries - mapping of keys and values - * @return collection of ObjectInstance that matches the query - * @throws MalformedObjectNameException - if the given string is an invalid - * object name - * @throws IOException - if there is a problem querying the JMX context - */ - public List query(List queries) throws MalformedObjectNameException, IOException { - // Query all mbeans - if (queries == null || queries.isEmpty()) { - return queryMBeans(new ObjectName(DEFAULT_JMX_DOMAIN + ":*"), null); - } - - // Constructs object name query - String objNameQuery = ""; - String queryExp = ""; - String delimiter = ""; - for (Iterator i = queries.iterator(); i.hasNext();) { - String key = (String)i.next(); - String val = ""; - int pos = key.indexOf("="); - if (pos >= 0) { - val = key.substring(pos + 1); - key = key.substring(0, pos); - } else { - objNameQuery += delimiter + key; - } - - if (val.startsWith(QUERY_EXP_PREFIX)) { - // do nothing as of the moment - } else if (!key.equals("") && !val.equals("")) { - objNameQuery += delimiter + key + "=" + val; - delimiter = ","; - } - } - - return queryMBeans(new ObjectName(DEFAULT_JMX_DOMAIN + ":" + objNameQuery), queryExp); - } - - /** - * Advance query that enables you to specify both the object name and the - * query expression to use. Note: Query expression is currently unsupported. - * - * @param objName - object name to use for query - * @param queryExpStr - query expression string - * @return set of mbeans that matches the query - * @throws IOException - if there is a problem querying the JMX context - */ - protected List queryMBeans(ObjectName objName, String queryExpStr) throws IOException { - QueryExp queryExp = createQueryExp(queryExpStr); - - // Convert mbeans set to list to make it standard throughout the query - // filter - List mbeans = new ArrayList(jmxConnection.queryMBeans(objName, queryExp)); - - return mbeans; - } - - /** - * Creates a query expression based on the query expression string Note: - * currently unsupported - * - * @param queryExpStr - query expression string - * @return the created query expression - */ - protected QueryExp createQueryExp(String queryExpStr) { - // Currently unsupported - return null; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/MBeansRegExQueryFilter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/MBeansRegExQueryFilter.class deleted file mode 100644 index e1392ad84..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/MBeansRegExQueryFilter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/MBeansRegExQueryFilter.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/MBeansRegExQueryFilter.java deleted file mode 100644 index 0e83c367b..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/MBeansRegExQueryFilter.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * 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.console.filter; - -import java.lang.reflect.Method; -import java.util.Iterator; -import java.util.Map; -import java.util.regex.Pattern; - -import javax.management.Attribute; -import javax.management.AttributeList; -import javax.management.ObjectInstance; -import javax.management.ObjectName; - -public class MBeansRegExQueryFilter extends RegExQueryFilter { - /** - * Creates a regular expression query that is able to match the values of - * specific mbeans - * - * @param next - next query filter - */ - public MBeansRegExQueryFilter(QueryFilter next) { - super(next); - } - - /** - * Try to match the object data using the regular expression map. The regex - * map contains a key-value mapping of an attribute key to a regular - * expression the value of the key should match. The basic rule of matching - * is that the data must contain a property key that is included in the - * regex map, and that the value of the property key should match the regex - * specified. - * - * @param data - object data to match - * @param regex - regex map - * @return true if the data matches the regex map specified - * @throws Exception - */ - protected boolean matches(Object data, Map regex) throws Exception { - // TODO why not just use instanceof? - - // Use reflection to determine where the object should go - try { - Method method = this.getClass().getDeclaredMethod("matches", new Class[] { - data.getClass(), Map.class - }); - return ((Boolean)method.invoke(this, new Object[] { - data, regex - })).booleanValue(); - } catch (NoSuchMethodException e) { - return false; - } - } - - /** - * Try to match the object instance using the regular expression map - * - * @param data - object instance to match - * @param regex - regex map - * @return true if the object instance matches the regex map - */ - protected boolean matches(ObjectInstance data, Map regex) { - return matches(data.getObjectName(), regex); - } - - /** - * Try to match the object name instance using the regular expression map - * - * @param data - object name to match - * @param regex - regex map - * @return true if the object name matches the regex map - */ - protected boolean matches(ObjectName data, Map regex) { - for (Iterator i = regex.keySet().iterator(); i.hasNext();) { - String key = (String)i.next(); - String target = data.getKeyProperty(key); - - // Try to match the value of the property of the object name - if (target != null && !((Pattern)regex.get(key)).matcher(target).matches()) { - return false; - } - } - return true; - } - - /** - * Try to match the attribute list using the regular expression map - * - * @param data - attribute list to match - * @param regex - regex map - * @return true if the attribute list matches the regex map - */ - protected boolean matches(AttributeList data, Map regex) { - for (Iterator i = regex.keySet().iterator(); i.hasNext();) { - String key = (String)i.next(); - - // Try to match each regex to the attributes of the mbean including - // its ObjectName - for (Iterator j = data.iterator(); j.hasNext();) { - Attribute attrib = (Attribute)j.next(); - - // Try to match to the properties of the ObjectName - if (attrib.getName().equals(MBeansAttributeQueryFilter.KEY_OBJECT_NAME_ATTRIBUTE)) { - String target = ((ObjectName)attrib.getValue()).getKeyProperty(key); - - if (target == null || !((Pattern)regex.get(key)).matcher(target).matches()) { - return false; - } else { - // If match skip to the next regex - break; - } - - // Try to match to the mbean attributes - } else if (attrib.getName().equals(key)) { - if (!((Pattern)regex.get(key)).matcher(attrib.getValue().toString()).matches()) { - return false; - } else { - // If match skip to the next regex - break; - } - - // If mbean does not contain the specified attribute - } else { - return false; - } - } - } - return true; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/MapTransformFilter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/MapTransformFilter.class deleted file mode 100644 index 7b39dc03b..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/MapTransformFilter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/MapTransformFilter.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/MapTransformFilter.java deleted file mode 100644 index 99b978005..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/MapTransformFilter.java +++ /dev/null @@ -1,363 +0,0 @@ -/** - * 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.console.filter; - -import java.lang.reflect.Array; -import java.lang.reflect.Method; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.Properties; -import java.util.Arrays; - -import javax.jms.DeliveryMode; -import javax.jms.JMSException; -import javax.management.Attribute; -import javax.management.AttributeList; -import javax.management.ObjectInstance; -import javax.management.ObjectName; -import javax.management.openmbean.CompositeDataSupport; - -import org.apache.activemq.command.ActiveMQBytesMessage; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ActiveMQMapMessage; -import org.apache.activemq.command.ActiveMQMessage; -import org.apache.activemq.command.ActiveMQObjectMessage; -import org.apache.activemq.command.ActiveMQStreamMessage; -import org.apache.activemq.command.ActiveMQTextMessage; -import org.apache.activemq.console.util.AmqMessagesUtil; - -public class MapTransformFilter extends ResultTransformFilter { - /** - * Creates a Map transform filter that is able to transform a variety of - * objects to a properties map object - * - * @param next - the next query filter - */ - public MapTransformFilter(QueryFilter next) { - super(next); - } - - /** - * Transform the given object to a Map object - * - * @param object - object to transform - * @return map object - */ - protected Object transformElement(Object object) throws Exception { - // Use reflection to determine how the object should be transformed - try { - Method method = this.getClass().getDeclaredMethod("transformToMap", new Class[] { - object.getClass() - }); - return (Map)method.invoke(this, new Object[] { - object - }); - } catch (NoSuchMethodException e) { -// CommandContext.print("Unable to transform mbean of type: " + object.getClass().getName() + ". No corresponding transformToMap method found."); - return null; - } - } - - /** - * Transform an ObjectInstance mbean to a Map - * - * @param obj - ObjectInstance format of an mbean - * @return map object - */ - protected Map transformToMap(ObjectInstance obj) { - return transformToMap(obj.getObjectName()); - } - - /** - * Transform an ObjectName mbean to a Map - * - * @param objname - ObjectName format of an mbean - * @return map object - */ - protected Map transformToMap(ObjectName objname) { - Properties props = new Properties(); - - // Parse object properties - Map objProps = objname.getKeyPropertyList(); - for (Iterator i = objProps.keySet().iterator(); i.hasNext();) { - Object key = i.next(); - Object val = objProps.get(key); - if (val != null) { - props.setProperty(key.toString(), getDisplayString(val)); - } - } - - return props; - } - - /** - * Transform an Attribute List format of an mbean to a Map - * - * @param list - AttributeList format of an mbean - * @return map object - */ - protected Map transformToMap(AttributeList list) { - Properties props = new Properties(); - for (Iterator i = list.iterator(); i.hasNext();) { - Attribute attrib = (Attribute)i.next(); - - // If attribute is an ObjectName - if (attrib.getName().equals(MBeansAttributeQueryFilter.KEY_OBJECT_NAME_ATTRIBUTE)) { - props.putAll(transformToMap((ObjectName)attrib.getValue())); - } else { - if (attrib.getValue() != null) { - props.setProperty(attrib.getName(), getDisplayString(attrib.getValue())); - } - } - } - - return props; - } - - /** - * Transform an ActiveMQTextMessage to a Map - * - * @param msg - text message to trasnform - * @return map object - * @throws JMSException - */ - protected Map transformToMap(ActiveMQTextMessage msg) throws JMSException { - Properties props = new Properties(); - - props.putAll(transformToMap((ActiveMQMessage)msg)); - if (msg.getText() != null) { - props.setProperty(AmqMessagesUtil.JMS_MESSAGE_BODY_PREFIX + "JMSText", msg.getText()); - } - - return props; - } - - /** - * Transform an ActiveMQBytesMessage to a Map - * - * @param msg - bytes message to transform - * @return map object - * @throws JMSException - */ - protected Map transformToMap(ActiveMQBytesMessage msg) throws JMSException { - Properties props = new Properties(); - - props.putAll(transformToMap((ActiveMQMessage)msg)); - - long bodyLength = msg.getBodyLength(); - byte[] msgBody; - int i = 0; - // Create separate bytes messages - for (i = 0; i < (bodyLength / Integer.MAX_VALUE); i++) { - msgBody = new byte[Integer.MAX_VALUE]; - props.setProperty(AmqMessagesUtil.JMS_MESSAGE_BODY_PREFIX + "JMSBytes:" + (i + 1), new String(msgBody)); - } - msgBody = new byte[(int)(bodyLength % Integer.MAX_VALUE)]; - props.setProperty(AmqMessagesUtil.JMS_MESSAGE_BODY_PREFIX + "JMSBytes:" + (i + 1), new String(msgBody)); - - return props; - } - - /** - * Transform an ActiveMQMessage to a Map - * - * @param msg - object message to transform - * @return map object - * @throws JMSException - */ - protected Map transformToMap(ActiveMQObjectMessage msg) throws JMSException { - Properties props = new Properties(); - - props.putAll(transformToMap((ActiveMQMessage)msg)); - if (msg.getObject() != null) { - // Just add the class name and toString value of the object - props.setProperty(AmqMessagesUtil.JMS_MESSAGE_BODY_PREFIX + "JMSObjectClass", msg.getObject().getClass().getName()); - props.setProperty(AmqMessagesUtil.JMS_MESSAGE_BODY_PREFIX + "JMSObjectString", getDisplayString(msg.getObject())); - } - return props; - } - - /** - * Transform an ActiveMQMapMessage to a Map - * - * @param msg - map message to transform - * @return map object - * @throws JMSException - */ - protected Map transformToMap(ActiveMQMapMessage msg) throws JMSException { - Properties props = new Properties(); - - props.putAll(transformToMap((ActiveMQMessage)msg)); - - // Get map properties - Enumeration e = msg.getMapNames(); - while (e.hasMoreElements()) { - String key = (String)e.nextElement(); - Object val = msg.getObject(key); - if (val != null) { - props.setProperty(AmqMessagesUtil.JMS_MESSAGE_BODY_PREFIX + key, getDisplayString(val)); - } - } - - return props; - } - - /** - * Transform an ActiveMQStreamMessage to a Map - * - * @param msg - stream message to transform - * @return map object - * @throws JMSException - */ - protected Map transformToMap(ActiveMQStreamMessage msg) throws JMSException { - Properties props = new Properties(); - - props.putAll(transformToMap((ActiveMQMessage)msg)); - // Just set the toString of the message as the body of the stream - // message - props.setProperty(AmqMessagesUtil.JMS_MESSAGE_BODY_PREFIX + "JMSStreamMessage", getDisplayString(msg)); - - return props; - } - - /** - * Transform an ActiveMQMessage to a Map - * - * @param msg - message to transform - * @return map object - * @throws JMSException - */ - protected Map transformToMap(ActiveMQMessage msg) throws JMSException { - Map props = new HashMap(); - - // Get JMS properties - if (msg.getJMSCorrelationID() != null) { - props.put(AmqMessagesUtil.JMS_MESSAGE_HEADER_PREFIX + "JMSCorrelationID", msg.getJMSCorrelationID()); - } - props.put(AmqMessagesUtil.JMS_MESSAGE_HEADER_PREFIX + "JMSDeliveryMode", (msg.getJMSDeliveryMode() == DeliveryMode.PERSISTENT) ? "persistent" : "non-persistent"); - if (msg.getJMSDestination() != null) { - props.put(AmqMessagesUtil.JMS_MESSAGE_HEADER_PREFIX + "JMSDestination", ((ActiveMQDestination)msg.getJMSDestination()).getPhysicalName()); - } - props.put(AmqMessagesUtil.JMS_MESSAGE_HEADER_PREFIX + "JMSExpiration", Long.toString(msg.getJMSExpiration())); - props.put(AmqMessagesUtil.JMS_MESSAGE_HEADER_PREFIX + "JMSMessageID", msg.getJMSMessageID()); - props.put(AmqMessagesUtil.JMS_MESSAGE_HEADER_PREFIX + "JMSPriority", Integer.toString(msg.getJMSPriority())); - props.put(AmqMessagesUtil.JMS_MESSAGE_HEADER_PREFIX + "JMSRedelivered", Boolean.toString(msg.getJMSRedelivered())); - if (msg.getJMSReplyTo() != null) { - props.put(AmqMessagesUtil.JMS_MESSAGE_HEADER_PREFIX + "JMSReplyTo", ((ActiveMQDestination)msg.getJMSReplyTo()).getPhysicalName()); - } - props.put(AmqMessagesUtil.JMS_MESSAGE_HEADER_PREFIX + "JMSTimestamp", Long.toString(msg.getJMSTimestamp())); - if (msg.getJMSType() != null) { - props.put(AmqMessagesUtil.JMS_MESSAGE_HEADER_PREFIX + "JMSType", msg.getJMSType()); - } - - // Get custom properties - Enumeration e = msg.getPropertyNames(); - while (e.hasMoreElements()) { - String name = (String)e.nextElement(); - if (msg.getObjectProperty(name) != null) { - props.put(AmqMessagesUtil.JMS_MESSAGE_CUSTOM_PREFIX + name, getDisplayString(msg.getObjectProperty(name))); - } - } - - return props; - } - - /** - * Transform an openMBean composite data to a Map - * - * @param data - composite data to transform - * @return map object - */ - protected Map transformToMap(CompositeDataSupport data) { - Properties props = new Properties(); - - String typeName = data.getCompositeType().getTypeName(); - - // Retrieve text message - if (typeName.equals(ActiveMQTextMessage.class.getName())) { - props.setProperty(AmqMessagesUtil.JMS_MESSAGE_BODY_PREFIX + "Text", data.get("Text").toString()); - - // Retrieve byte preview - } else if (typeName.equals(ActiveMQBytesMessage.class.getName())) { - props.setProperty(AmqMessagesUtil.JMS_MESSAGE_BODY_PREFIX + "BodyLength", data.get("BodyLength").toString()); - props.setProperty(AmqMessagesUtil.JMS_MESSAGE_BODY_PREFIX + "BodyPreview", new String((byte[])data.get("BodyPreview"))); - - // Expand content map - } else if (typeName.equals(ActiveMQMapMessage.class.getName())) { - Map contentMap = (Map)data.get("ContentMap"); - for (Iterator i = contentMap.keySet().iterator(); i.hasNext();) { - String key = (String)i.next(); - props.setProperty(AmqMessagesUtil.JMS_MESSAGE_BODY_PREFIX + key, contentMap.get(key).toString()); - } - - // Do nothing - } else if (typeName.equals(ActiveMQObjectMessage.class.getName()) || typeName.equals(ActiveMQStreamMessage.class.getName()) || typeName.equals(ActiveMQMessage.class.getName())) { - - // Unrecognized composite data. Throw exception. - } else { - throw new IllegalArgumentException("Unrecognized composite data to transform. composite type: " + typeName); - } - - // Process the JMS message header values - props.setProperty(AmqMessagesUtil.JMS_MESSAGE_HEADER_PREFIX + "JMSCorrelationID", "" + data.get("JMSCorrelationID")); - props.setProperty(AmqMessagesUtil.JMS_MESSAGE_HEADER_PREFIX + "JMSDestination", "" + data.get("JMSDestination")); - props.setProperty(AmqMessagesUtil.JMS_MESSAGE_HEADER_PREFIX + "JMSMessageID", "" + data.get("JMSMessageID")); - props.setProperty(AmqMessagesUtil.JMS_MESSAGE_HEADER_PREFIX + "JMSReplyTo", "" + data.get("JMSReplyTo")); - props.setProperty(AmqMessagesUtil.JMS_MESSAGE_HEADER_PREFIX + "JMSType", "" + data.get("JMSType")); - props.setProperty(AmqMessagesUtil.JMS_MESSAGE_HEADER_PREFIX + "JMSDeliveryMode", "" + data.get("JMSDeliveryMode")); - props.setProperty(AmqMessagesUtil.JMS_MESSAGE_HEADER_PREFIX + "JMSExpiration", "" + data.get("JMSExpiration")); - props.setProperty(AmqMessagesUtil.JMS_MESSAGE_HEADER_PREFIX + "JMSPriority", "" + data.get("JMSPriority")); - props.setProperty(AmqMessagesUtil.JMS_MESSAGE_HEADER_PREFIX + "JMSRedelivered", "" + data.get("JMSRedelivered")); - props.setProperty(AmqMessagesUtil.JMS_MESSAGE_HEADER_PREFIX + "JMSTimestamp", "" + data.get("JMSTimestamp")); - - // Process the JMS custom message properties - props.setProperty(AmqMessagesUtil.JMS_MESSAGE_CUSTOM_PREFIX + "Properties", "" + data.get("Properties")); - - return props; - } - - @SuppressWarnings("unchecked") - protected String getDisplayString(Object obj) { - if (null == obj) - return "null"; - - if (obj != null && obj.getClass().isArray()) { - Class type = obj.getClass().getComponentType(); - if (!type.isPrimitive()) { - obj = Arrays.asList((Object[]) obj); - } else { - // for primitives, we can't use Arrays.toString(), so we have to roll something similar. - int len = Array.getLength(obj); - if (0 == len) - return "[]"; - StringBuilder bldr = new StringBuilder(); - bldr.append("["); - for (int i = 0; i <= len; i++) { - bldr.append(Array.get(obj, i)); - if (i + 1 >= len) - return bldr.append("]").toString(); - bldr.append(","); - } - } - - } - - return obj.toString(); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/MessagesQueryFilter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/MessagesQueryFilter.class deleted file mode 100644 index 87810d62d..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/MessagesQueryFilter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/MessagesQueryFilter.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/MessagesQueryFilter.java deleted file mode 100644 index ca1053edd..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/MessagesQueryFilter.java +++ /dev/null @@ -1,84 +0,0 @@ -/** - * 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.console.filter; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; - -import javax.management.MBeanServerConnection; -import javax.management.ObjectName; -import javax.management.openmbean.CompositeData; -import javax.management.remote.JMXConnector; -import javax.management.remote.JMXConnectorFactory; -import javax.management.remote.JMXServiceURL; - -public class MessagesQueryFilter extends AbstractQueryFilter { - - private MBeanServerConnection jmxConnection; - private ObjectName destName; - - /** - * Create a JMS message query filter - * - * @param jmxConnection - JMX connection to use - * @param destName - object name query to retrieve the destination - */ - public MessagesQueryFilter(MBeanServerConnection jmxConnection, ObjectName destName) { - super(null); - this.jmxConnection = jmxConnection; - this.destName = destName; - } - - /** - * Queries the specified destination using the message selector format query - * - * @param queries - message selector queries - * @return list messages that matches the selector - * @throws Exception - */ - public List query(List queries) throws Exception { - String selector = ""; - - // Convert to message selector - for (Iterator i = queries.iterator(); i.hasNext();) { - selector = selector + "(" + i.next().toString() + ") AND "; - } - - // Remove last AND - if (!selector.equals("")) { - selector = selector.substring(0, selector.length() - 5); - } - - return queryMessages(selector); - } - - /** - * Query the messages of a queue destination using JMX - * - * @param selector - message selector - * @return list of messages that matches the selector - * @throws Exception - */ - protected List queryMessages(String selector) throws Exception { - CompositeData[] messages = (CompositeData[]) jmxConnection.invoke(destName, "browse", new Object[] {selector}, new String[] {}); - return Arrays.asList(messages); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/PropertiesViewFilter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/PropertiesViewFilter.class deleted file mode 100644 index 464fb05be..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/PropertiesViewFilter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/PropertiesViewFilter.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/PropertiesViewFilter.java deleted file mode 100644 index c2bedd21f..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/PropertiesViewFilter.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * 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.console.filter; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - -public class PropertiesViewFilter implements QueryFilter { - protected QueryFilter next; - protected Set viewFilter; - - /** - * Creates a filter that will select the properties of a map object to view - * - * @param next - the next query filter that will return a collection of maps - */ - public PropertiesViewFilter(QueryFilter next) { - this(null, next); - } - - /** - * Creates a filter that will select the properties of a map object to view - * - * @param viewFilter - the properties to view - * @param next - the next query filter that will return a collection of maps - */ - public PropertiesViewFilter(Set viewFilter, QueryFilter next) { - this.next = next; - this.viewFilter = viewFilter; - } - - /** - * Filter the properties to view of the query result - * - * @param query - the query string - * @return list of objects that has been view filtered - */ - public List> query(String query) throws Exception { - return filterViewCollection(next.query(query), viewFilter); - } - - /** - * Filter the properties to view of the query result - * - * @param queries - the query map - * @return list of objects that has been view filtered - * @throws Exception - */ - public List> query(List queries) throws Exception { - return filterViewCollection(next.query(queries), viewFilter); - } - - /** - * Filter the view of each element in the collection - * - * @param result - the lists to filter the view from - * @param viewFilter - the views to select - * @return list of objects whose view has been filtered - */ - protected List> filterViewCollection(Collection> result, Set viewFilter) { - // Use a list to allow duplicate entries - List> newCollection = new ArrayList>(); - - for (Iterator> i = result.iterator(); i.hasNext();) { - newCollection.add(filterView(i.next())); - } - - return newCollection; - } - - /** - * Select only the attributes to view from the map data - * - * @param data - data to filter the view from - * @return - data with the view filtered - */ - protected Map filterView(Map data) { - // If no view specified, display all attributes - if (viewFilter == null || viewFilter.isEmpty()) { - return data; - } - - Map newData; - try { - // Lets try to use the same class as the original - newData = data.getClass().newInstance(); - } catch (Exception e) { - // Lets use a default HashMap - newData = new HashMap(); - } - - // Filter the keys to view - for (Iterator i = viewFilter.iterator(); i.hasNext();) { - Object key = i.next(); - Object val = data.get(key); - - if (val != null) { - newData.put(key, val); - } - } - - return newData; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/QueryFilter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/QueryFilter.class deleted file mode 100644 index 797b0fd2b..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/QueryFilter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/QueryFilter.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/QueryFilter.java deleted file mode 100644 index 11437cfc4..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/QueryFilter.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * 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.console.filter; - -import java.util.List; -import java.util.Map; - -public interface QueryFilter { - - String QUERY_DELIMETER = ","; - - /** - * Interface for querying - * @param queryStr - the query string - * @return collection of objects that satisfies the query - * @throws Exception - */ - List query(String queryStr) throws Exception; - - /** - * Interface for querying - * @param queries - list of individual queries - * @return collection of objects that satisfies the query - * @throws Exception - */ - List query(List queries) throws Exception; -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/RegExQueryFilter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/RegExQueryFilter.class deleted file mode 100644 index e3a177ac8..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/RegExQueryFilter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/RegExQueryFilter.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/RegExQueryFilter.java deleted file mode 100644 index 66cf5df09..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/RegExQueryFilter.java +++ /dev/null @@ -1,141 +0,0 @@ -/** - * 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.console.filter; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.regex.Pattern; - -public abstract class RegExQueryFilter extends AbstractQueryFilter { - public static final String REGEX_PREFIX = "REGEX:QUERY:"; - - /** - * Creates a regular expression query that is able to match an object using - * key-value pattern regex filtering - * - * @param next - */ - protected RegExQueryFilter(QueryFilter next) { - super(next); - } - - /** - * Separates the regular expressions queries from the usual queries. A query - * is a regex query, if it is key-value pair with the format =, - * and value is a pattern that satisfies the isRegularExpression method. - * - * @param queries - list of queries - * @return filtered objects that matches the regex query - * @throws Exception - */ - @SuppressWarnings({ "rawtypes", "unchecked" }) - public List query(List queries) throws Exception { - Map regex = new HashMap(); - List newQueries = new ArrayList(); - - // Lets parse for regular expression queries - for (Iterator i = queries.iterator(); i.hasNext();) { - // Get key-value pair - String token = (String)i.next(); - String key = ""; - String val = ""; - int pos = token.indexOf("="); - if (pos >= 0) { - val = token.substring(pos + 1); - key = token.substring(0, pos); - } - - // Add the regex query to list and make it a non-factor in the - // succeeding queries - if (isRegularExpression(val)) { - regex.put(key, compileQuery(val)); - - // Add the normal query to the query list - } else { - newQueries.add(token); - } - } - - // Filter the result using the regular expressions specified - return filterCollectionUsingRegEx(regex, next.query(newQueries)); - } - - /** - * Checks if a given string is a regular expression query. Currently, a - * pattern is a regex query, if it starts with the - * RegExQueryFilter.REGEX_PREFIX. - * - * @param query - * @return boolean result of query check - */ - protected boolean isRegularExpression(String query) { - return query.startsWith(REGEX_PREFIX); - } - - /** - * Compiles the regex query to a pattern. - * - * @param query - query string to compile - * @return regex pattern - */ - protected Pattern compileQuery(String query) { - return Pattern.compile(query.substring(REGEX_PREFIX.length())); - } - - /** - * Filter the specified colleciton using the regex patterns extracted. - * - * @param regex - regex map - * @param data - list of objects to filter - * @return filtered list of objects that matches the regex map - * @throws Exception - */ - @SuppressWarnings({ "rawtypes", "unchecked" }) - protected List filterCollectionUsingRegEx(Map regex, List data) throws Exception { - // No regular expressions filtering needed - if (regex == null || regex.isEmpty()) { - return data; - } - - List filteredElems = new ArrayList(); - - // Get each data object to filter - for (Iterator i = data.iterator(); i.hasNext();) { - Object dataElem = i.next(); - // If properties of data matches all the regex pattern, add it - if (matches(dataElem, regex)) { - filteredElems.add(dataElem); - } - } - - return filteredElems; - } - - /** - * Determines how the object is to be matched to the regex map. - * - * @param data - object to match - * @param regex - regex map - * @return true, if the object matches the regex map, false otherwise - * @throws Exception - */ - @SuppressWarnings("rawtypes") - protected abstract boolean matches(Object data, Map regex) throws Exception; -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/ResultTransformFilter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/ResultTransformFilter.class deleted file mode 100644 index 4e8e9e30f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/ResultTransformFilter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/ResultTransformFilter.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/ResultTransformFilter.java deleted file mode 100644 index fcb479aa7..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/ResultTransformFilter.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * 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.console.filter; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -public abstract class ResultTransformFilter implements QueryFilter { - private QueryFilter next; - - /** - * Constructs a query filter that transform the format of the query result - * - * @param next - the query filter to retrieve the results from - */ - protected ResultTransformFilter(QueryFilter next) { - this.next = next; - } - - /** - * Transforms the queried results to a collection of different objects - * - * @param query - the query string - * @return collections of transformed objects - * @throws Exception - */ - public List query(String query) throws Exception { - return transformList(next.query(query)); - } - - /** - * Transforms the queried results to a collection of different objects - * - * @param queries - the query map - * @return collections of transformed objects - * @throws Exception - */ - public List query(List queries) throws Exception { - return transformList(next.query(queries)); - } - - /** - * Transforms a collection to a collection of different objects. - * - * @param result - the collection to transform - * @return collection of properties objects - */ - protected List transformList(List result) throws Exception { - List props = new ArrayList(); - - for (Iterator i = result.iterator(); i.hasNext();) { - props.add(transformElement(i.next())); - } - - return props; - } - - /** - * Transform a result object - * - * @param obj - the object instance to transform - * @return the transformed object - */ - protected abstract Object transformElement(Object obj) throws Exception; - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/StubQueryFilter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/StubQueryFilter.class deleted file mode 100644 index 55171f13d..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/StubQueryFilter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/StubQueryFilter.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/StubQueryFilter.java deleted file mode 100644 index aa7081b8e..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/StubQueryFilter.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * 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.console.filter; - -import java.util.List; - -public class StubQueryFilter implements QueryFilter { - private List data; - - /** - * Creates a stub query that returns the given collections as the query - * result - * - * @param data - the stub query result - */ - public StubQueryFilter(List data) { - this.data = data; - } - - /** - * Returns the provided stub data as a stub query result - * - * @param queryStr - not use - * @return the stub query result - * @throws Exception - */ - public List query(String queryStr) throws Exception { - return data; - } - - /** - * Returns the provided stub data as a stub query result - * - * @param queries - not use - * @return the stub query result - * @throws Exception - */ - public List query(List queries) throws Exception { - return data; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/WildcardToMsgSelectorTransformFilter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/WildcardToMsgSelectorTransformFilter.class deleted file mode 100644 index 7ced220af..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/WildcardToMsgSelectorTransformFilter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/WildcardToMsgSelectorTransformFilter.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/WildcardToMsgSelectorTransformFilter.java deleted file mode 100644 index 465e25dca..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/WildcardToMsgSelectorTransformFilter.java +++ /dev/null @@ -1,72 +0,0 @@ -/** - * 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.console.filter; - -public class WildcardToMsgSelectorTransformFilter extends WildcardTransformFilter { - /** - * Creates a filter that is able to transform a wildcard query to a message - * selector format - * - * @param next - next query filter - */ - public WildcardToMsgSelectorTransformFilter(QueryFilter next) { - super(next); - } - - /** - * Use to determine if a query string is a wildcard query. A query string is - * a wildcard query if it is a key-value pair with the format = - * and the value is enclosed in '' and contains '*' and '?'. - * - * @param query - query string - * @return true, if the query string is a wildcard query, false otherwise - */ - protected boolean isWildcardQuery(String query) { - // If the query is a key=value pair - String key = query; - String val = ""; - int pos = key.indexOf("="); - if (pos >= 0) { - val = key.substring(pos + 1); - } - - // If the value contains wildcards and is enclose by ' - return val.startsWith("'") && val.endsWith("'") && ((val.indexOf("*") >= 0) || (val.indexOf("?") >= 0)); - } - - /** - * Transform a wildcard query to message selector format - * - * @param query - query string to transform - * @return message selector format string - */ - protected String transformWildcardQuery(String query) { - // If the query is a key=value pair - String key = query; - String val = ""; - int pos = key.indexOf("="); - if (pos >= 0) { - val = key.substring(pos + 1); - key = key.substring(0, pos); - } - - val = val.replaceAll("[?]", "_"); - val = val.replaceAll("[*]", "%"); - - return key + " LIKE " + val; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/WildcardToRegExTransformFilter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/WildcardToRegExTransformFilter.class deleted file mode 100644 index 176c80a17..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/WildcardToRegExTransformFilter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/WildcardToRegExTransformFilter.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/WildcardToRegExTransformFilter.java deleted file mode 100644 index 884010333..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/WildcardToRegExTransformFilter.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * 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.console.filter; - -public class WildcardToRegExTransformFilter extends WildcardTransformFilter { - /** - * Creates a filter that is able to transform a wildcard query to a regular - * expression query string - * - * @param next - next query filter - */ - public WildcardToRegExTransformFilter(RegExQueryFilter next) { - super(next); - } - - /** - * Use to determine if a query string is a wildcard query. A query string is - * a wildcard query if it is a key-value pair with the format = - * and the value contains '*' and '?'. - * - * @param query - query string - * @return true, if the query string is a wildcard query, false otherwise - */ - protected boolean isWildcardQuery(String query) { - // If the query is a key=value pair - String key = query; - String val = ""; - int pos = key.indexOf("="); - if (pos >= 0) { - val = key.substring(pos + 1); - } - - // If the value contains wildcards - return (val.indexOf("*") >= 0) || (val.indexOf("?") >= 0); - } - - /** - * Transform a wildcard query to regular expression format - * - * @param query - query string to transform - * @return regex query string - */ - protected String transformWildcardQuery(String query) { - // Get the key=value pair - String key = query; - String val = ""; - int pos = key.indexOf("="); - if (pos >= 0) { - val = key.substring(pos + 1); - key = key.substring(0, pos); - } - - val = val.replaceAll("[.]", "\\\\."); // Escape all dot characters. - // From (.) to (\.) - val = val.replaceAll("[?]", "."); // Match single characters - val = val.replaceAll("[*]", ".*?"); // Match all characters, use - // reluctant quantifier - val = "(" + val + ")"; // Let's group the query for clarity - val = RegExQueryFilter.REGEX_PREFIX + val; // Flag as a regular - // expression query - - return key + "=" + val; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/WildcardTransformFilter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/WildcardTransformFilter.class deleted file mode 100644 index b669618c7..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/WildcardTransformFilter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/WildcardTransformFilter.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/WildcardTransformFilter.java deleted file mode 100644 index da8f3fb79..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/filter/WildcardTransformFilter.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * 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.console.filter; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -public abstract class WildcardTransformFilter extends AbstractQueryFilter { - - /** - * Creates a wildcard transform filter that is able to convert a wildcard - * expression (determined by isWildcardQuery) to a another query type (use - * transformWildcardQuery). - * - * @param next - the next query filter - */ - protected WildcardTransformFilter(QueryFilter next) { - super(next); - } - - /** - * Converts the query list to set of different queries - * - * @param queries - query list to transform - * @return - result of the query - * @throws Exception - */ - public List query(List queries) throws Exception { - List newQueries = new ArrayList(); - - for (Iterator i = queries.iterator(); i.hasNext();) { - String queryToken = (String)i.next(); - - // Transform the wildcard query - if (isWildcardQuery(queryToken)) { - // Transform the value part only - newQueries.add(transformWildcardQuery(queryToken)); - - // Maintain the query as is - } else { - newQueries.add(queryToken); - } - } - - return next.query(newQueries); - } - - /** - * Use to determine is a query string is a wildcard query - * - * @param query - query string - * @return true, if the query string is a wildcard query, false otherwise - */ - protected abstract boolean isWildcardQuery(String query); - - /** - * Use to transform a wildcard query string to another query format - * - * @param query - query string to transform - * @return transformed query - */ - protected abstract String transformWildcardQuery(String query); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/formatter/CommandShellOutputFormatter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/formatter/CommandShellOutputFormatter.class deleted file mode 100644 index a1351da9c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/formatter/CommandShellOutputFormatter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/formatter/CommandShellOutputFormatter.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/formatter/CommandShellOutputFormatter.java deleted file mode 100644 index df6ea5516..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/formatter/CommandShellOutputFormatter.java +++ /dev/null @@ -1,263 +0,0 @@ -/** - * 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.console.formatter; - -import java.io.OutputStream; -import java.io.PrintStream; -import java.util.Collection; -import java.util.Iterator; -import java.util.Map; -import java.util.Arrays; - -import javax.jms.Message; -import javax.management.Attribute; -import javax.management.AttributeList; -import javax.management.ObjectInstance; -import javax.management.ObjectName; - -public class CommandShellOutputFormatter implements OutputFormatter { - private OutputStream outputStream; - private PrintStream out; - - public CommandShellOutputFormatter(OutputStream out) { - - this.outputStream = out; - if (out instanceof PrintStream) { - this.out = (PrintStream)out; - } else { - this.out = new PrintStream(out); - } - } - - /** - * Retrieve the output stream being used by the formatter - * - * @return - */ - public OutputStream getOutputStream() { - return outputStream; - } - - /** - * Print an ObjectInstance format of an mbean - * - * @param mbean - mbean to print - */ - public void printMBean(ObjectInstance mbean) { - printMBean(mbean.getObjectName()); - } - - /** - * Print an ObjectName format of an mbean - * - * @param mbean - mbean to print - */ - public void printMBean(ObjectName mbean) { - printMBean(mbean.getKeyPropertyList()); - } - - /** - * Print an AttributeList format of an mbean - * - * @param mbean - mbean to print - */ - public void printMBean(AttributeList mbean) { - for (Iterator i = mbean.iterator(); i.hasNext();) { - Attribute attrib = (Attribute)i.next(); - if (attrib.getValue() instanceof ObjectName) { - printMBean((ObjectName)attrib.getValue()); - } else if (attrib.getValue() instanceof ObjectInstance) { - printMBean((ObjectInstance)attrib.getValue()); - } else { - out.println(attrib.getName() + " = " + attrib.getValue().toString()); - out.println(); - } - } - } - - /** - * Print a Map format of an mbean - * - * @param mbean - mbean to print - */ - public void printMBean(Map mbean) { - for (Iterator i = mbean.keySet().iterator(); i.hasNext();) { - String key = (String)i.next(); - String val = mbean.get(key).toString(); - out.println(key + " = " + val); - } - out.println(); - } - - /** - * Print a collection of mbean - * - * @param mbean - collection of mbeans - */ - public void printMBean(Collection mbean) { - for (Iterator i = mbean.iterator(); i.hasNext();) { - Object obj = i.next(); - if (obj instanceof ObjectInstance) { - printMBean((ObjectInstance)obj); - } else if (obj instanceof ObjectName) { - printMBean((ObjectName)obj); - } else if (obj instanceof Map) { - printMBean((Map)obj); - } else if (obj instanceof AttributeList) { - printMBean((AttributeList)obj); - } else if (obj instanceof Collection) { - printMessage((Collection)obj); - } else { - printException(new UnsupportedOperationException("Unknown mbean type: " + obj.getClass().getName())); - } - } - } - - /** - * Print a Map format of a JMS message - * - * @param msg - */ - public void printMessage(Map msg) { - for (Iterator i = msg.keySet().iterator(); i.hasNext();) { - String key = (String)i.next(); - String val = msg.get(key).toString(); - out.println(key + " = " + val); - } - out.println(); - } - - /** - * Print a Message format of a JMS message - * - * @param msg - JMS message to print - */ - public void printMessage(Message msg) { - // TODO - } - - /** - * Print a collection of JMS messages - * - * @param msg - collection of JMS messages - */ - public void printMessage(Collection msg) { - for (Iterator i = msg.iterator(); i.hasNext();) { - Object obj = i.next(); - if (obj instanceof Message) { - printMessage((Message)obj); - } else if (obj instanceof Map) { - printMessage((Map)obj); - } else if (obj instanceof Collection) { - printMessage((Collection)obj); - } else { - printException(new UnsupportedOperationException("Unknown message type: " + obj.getClass().getName())); - } - } - } - - /** - * Print help messages - * - * @param helpMsgs - help messages to print - */ - public void printHelp(String[] helpMsgs) { - for (int i = 0; i < helpMsgs.length; i++) { - out.println(helpMsgs[i]); - } - out.println(); - } - - /** - * Print an information message - * - * @param info - information message to print - */ - public void printInfo(String info) { - out.println("INFO: " + info); - } - - /** - * Print an exception message - * - * @param e - exception to print - */ - public void printException(Exception e) { - out.println("ERROR: " + e); - e.printStackTrace(out); - } - - /** - * Print a version information - * - * @param version - version info to print - */ - public void printVersion(String version) { - out.println(""); - out.println("ActiveMQ " + version); - out.println("For help or more information please see: http://activemq.apache.org"); - out.println(""); - } - - /** - * Print a generic key value mapping - * - * @param map to print - */ - public void print(Map map) { - for (Iterator i = map.keySet().iterator(); i.hasNext();) { - String key = (String)i.next(); - String val = map.get(key).toString(); - out.println(key + " = " + val); - } - out.println(); - } - - /** - * Print a generic array of strings - * - * @param strings - string array to print - */ - public void print(String[] strings) { - for (int i = 0; i < strings.length; i++) { - out.println(strings[i]); - } - out.println(); - } - - /** - * Print a collection of objects - * - * @param collection - collection to print - */ - public void print(Collection collection) { - for (Iterator i = collection.iterator(); i.hasNext();) { - out.println(i.next().toString()); - } - out.println(); - } - - /** - * Print a java string - * - * @param string - string to print - */ - public void print(String string) { - out.println(string); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/formatter/OutputFormatter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/formatter/OutputFormatter.class deleted file mode 100644 index c6666e162..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/formatter/OutputFormatter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/formatter/OutputFormatter.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/formatter/OutputFormatter.java deleted file mode 100644 index 5d917629d..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/formatter/OutputFormatter.java +++ /dev/null @@ -1,136 +0,0 @@ -/** - * 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.console.formatter; - -import java.io.OutputStream; -import java.util.Collection; -import java.util.Map; - -import javax.jms.Message; -import javax.management.AttributeList; -import javax.management.ObjectInstance; -import javax.management.ObjectName; - -public interface OutputFormatter { - - /** - * Retrieve the output stream being used by the formatter - */ - OutputStream getOutputStream(); - - /** - * Print an ObjectInstance format of an mbean - * @param mbean - mbean to print - */ - void printMBean(ObjectInstance mbean); - - /** - * Print an ObjectName format of an mbean - * @param mbean - mbean to print - */ - void printMBean(ObjectName mbean); - - /** - * Print an AttributeList format of an mbean - * @param mbean - mbean to print - */ - void printMBean(AttributeList mbean); - - /** - * Print a Map format of an mbean - * @param mbean - mbean to print - */ - @SuppressWarnings("rawtypes") - void printMBean(Map mbean); - - /** - * Print a Collection format of mbeans - * @param mbean - collection of mbeans - */ - @SuppressWarnings("rawtypes") - void printMBean(Collection mbean); - - /** - * Print a Map format of a JMS message - * @param msg - */ - @SuppressWarnings("rawtypes") - void printMessage(Map msg); - - /** - * Print a Message format of a JMS message - * @param msg - JMS message to print - */ - void printMessage(Message msg); - - /** - * Print a Collection format of JMS messages - * @param msg - collection of JMS messages - */ - @SuppressWarnings("rawtypes") - void printMessage(Collection msg); - - /** - * Print help messages - * @param helpMsgs - help messages to print - */ - void printHelp(String[] helpMsgs); - - /** - * Print an information message - * @param info - information message to print - */ - void printInfo(String info); - - /** - * Print an exception message - * @param e - exception to print - */ - void printException(Exception e); - - /** - * Print a version information - * @param version - version info to print - */ - void printVersion(String version); - - /** - * Print a generic key value mapping - * @param map to print - */ - @SuppressWarnings("rawtypes") - void print(Map map); - - /** - * Print a generic array of strings - * @param strings - string array to print - */ - void print(String[] strings); - - /** - * Print a collection of objects - * @param collection - collection to print - */ - @SuppressWarnings("rawtypes") - void print(Collection collection); - - /** - * Print a java string - * @param string - string to print - */ - void print(String string); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/util/AmqMessagesUtil.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/util/AmqMessagesUtil.class deleted file mode 100644 index d5cc004fa..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/util/AmqMessagesUtil.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/util/AmqMessagesUtil.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/util/AmqMessagesUtil.java deleted file mode 100644 index 6a765c615..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/util/AmqMessagesUtil.java +++ /dev/null @@ -1,74 +0,0 @@ -/** - * 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.console.util; - -import java.net.URI; -import java.util.List; -import java.util.Set; - -import javax.jms.ConnectionFactory; -import javax.jms.Destination; - -import org.apache.activemq.console.filter.AmqMessagesQueryFilter; -import org.apache.activemq.console.filter.GroupPropertiesViewFilter; -import org.apache.activemq.console.filter.MapTransformFilter; -import org.apache.activemq.console.filter.PropertiesViewFilter; -import org.apache.activemq.console.filter.QueryFilter; -import org.apache.activemq.console.filter.StubQueryFilter; -import org.apache.activemq.console.filter.WildcardToMsgSelectorTransformFilter; - -public final class AmqMessagesUtil { - - public static final String JMS_MESSAGE_HEADER_PREFIX = "JMS_HEADER_FIELD:"; - public static final String JMS_MESSAGE_CUSTOM_PREFIX = "JMS_CUSTOM_FIELD:"; - public static final String JMS_MESSAGE_BODY_PREFIX = "JMS_BODY_FIELD:"; - - private AmqMessagesUtil() { - } - - public static List getAllMessages(URI brokerUrl, Destination dest) throws Exception { - return getMessages(brokerUrl, dest, ""); - } - - public static List getMessages(URI brokerUrl, Destination dest, String selector) throws Exception { - return createMessageQueryFilter(brokerUrl, dest).query(selector); - } - - public static List getMessages(ConnectionFactory connectionFactory, Destination dest, String selector) throws Exception { - return createMessageQueryFilter(connectionFactory, dest).query(selector); - } - - public static List getMessages(URI brokerUrl, Destination dest, List selectors) throws Exception { - return createMessageQueryFilter(brokerUrl, dest).query(selectors); - } - - public static List getMessages(ConnectionFactory connectionFactory, Destination dest, List selectors) throws Exception { - return createMessageQueryFilter(connectionFactory, dest).query(selectors); - } - - public static List filterMessagesView(List messages, Set groupViews, Set attributeViews) throws Exception { - return (new PropertiesViewFilter(attributeViews, new GroupPropertiesViewFilter(groupViews, new MapTransformFilter(new StubQueryFilter(messages))))).query(""); - } - - public static QueryFilter createMessageQueryFilter(URI brokerUrl, Destination dest) { - return new WildcardToMsgSelectorTransformFilter(new AmqMessagesQueryFilter(brokerUrl, dest)); - } - - public static QueryFilter createMessageQueryFilter(ConnectionFactory connectionFactory, Destination dest) { - return new WildcardToMsgSelectorTransformFilter(new AmqMessagesQueryFilter(connectionFactory, dest)); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/util/JmxMBeansUtil.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/util/JmxMBeansUtil.class deleted file mode 100644 index e7b5f4200..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/util/JmxMBeansUtil.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/util/JmxMBeansUtil.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/util/JmxMBeansUtil.java deleted file mode 100644 index 21ceb9be9..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/console/util/JmxMBeansUtil.java +++ /dev/null @@ -1,127 +0,0 @@ -/** - * 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.console.util; - -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import javax.management.ObjectName; -import javax.management.MBeanServerConnection; -import javax.management.remote.JMXServiceURL; - -import org.apache.activemq.console.filter.GroupPropertiesViewFilter; -import org.apache.activemq.console.filter.MBeansAttributeQueryFilter; -import org.apache.activemq.console.filter.MBeansObjectNameQueryFilter; -import org.apache.activemq.console.filter.MBeansRegExQueryFilter; -import org.apache.activemq.console.filter.MapTransformFilter; -import org.apache.activemq.console.filter.MessagesQueryFilter; -import org.apache.activemq.console.filter.PropertiesViewFilter; -import org.apache.activemq.console.filter.QueryFilter; -import org.apache.activemq.console.filter.StubQueryFilter; -import org.apache.activemq.console.filter.WildcardToMsgSelectorTransformFilter; -import org.apache.activemq.console.filter.WildcardToRegExTransformFilter; - -public final class JmxMBeansUtil { - - private JmxMBeansUtil() { - } - - public static List getAllBrokers(MBeanServerConnection jmxConnection) throws Exception { - return (new MBeansObjectNameQueryFilter(jmxConnection)).query("type=Broker,brokerName=*"); - } - - public static List getBrokersByName(MBeanServerConnection jmxConnection, String brokerName) throws Exception { - return (new MBeansObjectNameQueryFilter(jmxConnection)).query("type=Broker,brokerName=" + brokerName); - } - - public static List getAllBrokers(MBeanServerConnection jmxConnection, Set attributes) throws Exception { - return (new MBeansAttributeQueryFilter(jmxConnection, attributes, new MBeansObjectNameQueryFilter(jmxConnection))).query("type=Broker"); - } - - public static List getBrokersByName(MBeanServerConnection jmxConnection, String brokerName, Set attributes) throws Exception { - return (new MBeansAttributeQueryFilter(jmxConnection, attributes, new MBeansObjectNameQueryFilter(jmxConnection))).query("type=Broker,brokerName=" + brokerName); - } - - public static List x_queryMBeans(MBeanServerConnection jmxConnection, List queryList) throws Exception { - // If there is no query defined get all mbeans - if (queryList == null || queryList.size() == 0) { - return createMBeansObjectNameQuery(jmxConnection).query(""); - - // Parse through all the query strings - } else { - return createMBeansObjectNameQuery(jmxConnection).query(queryList); - } - } - - public static List queryMBeans(MBeanServerConnection jmxConnection, List queryList, Set attributes) throws Exception { - // If there is no query defined get all mbeans - if (queryList == null || queryList.size() == 0) { - return createMBeansAttributeQuery(jmxConnection, attributes).query(""); - - // Parse through all the query strings - } else { - return createMBeansAttributeQuery(jmxConnection, attributes).query(queryList); - } - } - - public static List queryMBeans(MBeanServerConnection jmxConnection, String queryString) throws Exception { - return createMBeansObjectNameQuery(jmxConnection).query(queryString); - } - - public static List queryMBeans(MBeanServerConnection jmxConnection, String queryString, Set attributes) throws Exception { - return createMBeansAttributeQuery(jmxConnection, attributes).query(queryString); - } - - public static List filterMBeansView(List mbeans, Set viewFilter) throws Exception { - return new PropertiesViewFilter(viewFilter, new MapTransformFilter(new StubQueryFilter(mbeans))).query(""); - } - - public static String createQueryString(String query, String param) { - return query.replaceAll("%1", param); - } - - public static String createQueryString(String query, List params) { - String output = query; - int count = 1; - for (Iterator i = params.iterator(); i.hasNext();) { - output = output.replaceAll("%" + count++, i.next().toString()); - } - - return output; - } - - public static QueryFilter createMBeansObjectNameQuery(MBeanServerConnection jmxConnection) { - return new MBeansObjectNameQueryFilter(jmxConnection); - } - - public static QueryFilter createMBeansAttributeQuery(MBeanServerConnection jmxConnection, Set attributes) { - // Let use be able to accept wildcard queries - // Use regular expressions to filter the query result - // Retrieve the attributes needed - // Retrieve the mbeans object name specified by the query - return new MBeansAttributeQueryFilter(jmxConnection, attributes, new MBeansObjectNameQueryFilter(jmxConnection)); - } - - public static QueryFilter createMessageQueryFilter(MBeanServerConnection jmxConnection, ObjectName destName) { - return new WildcardToMsgSelectorTransformFilter(new MessagesQueryFilter(jmxConnection, destName)); - } - - public static List filterMessagesView(List messages, Set groupViews, Set attributeViews) throws Exception { - return (new PropertiesViewFilter(attributeViews, new GroupPropertiesViewFilter(groupViews, new MapTransformFilter(new StubQueryFilter(messages))))).query(""); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/AnyChildDestinationNode$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/AnyChildDestinationNode$1.class deleted file mode 100644 index ab1e92f8e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/AnyChildDestinationNode$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/AnyChildDestinationNode.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/AnyChildDestinationNode.class deleted file mode 100644 index f609ef144..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/AnyChildDestinationNode.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/AnyChildDestinationNode.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/AnyChildDestinationNode.java deleted file mode 100644 index cf35ac8ef..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/AnyChildDestinationNode.java +++ /dev/null @@ -1,139 +0,0 @@ -/** - * 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.filter; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.Set; - -/** - * An implementation of {@link DestinationNode} which navigates all the children of the given node - * ignoring the name of the current path (so for navigating using * in a wildcard). - * - * - */ -public class AnyChildDestinationNode implements DestinationNode { - private DestinationNode node; - - public AnyChildDestinationNode(DestinationNode node) { - this.node = node; - } - - public void appendMatchingValues(Set answer, String[] paths, int startIndex) { - Iterator iter = getChildNodes().iterator(); - while (iter.hasNext()) { - DestinationNode child = (DestinationNode) iter.next(); - child.appendMatchingValues(answer, paths, startIndex); - } - } - - - public void appendMatchingWildcards(Set answer, String[] paths, int startIndex) { - Iterator iter = getChildNodes().iterator(); - while (iter.hasNext()) { - DestinationNode child = (DestinationNode) iter.next(); - child.appendMatchingWildcards(answer, paths, startIndex); - } - } - - - public void appendDescendantValues(Set answer) { - Iterator iter = getChildNodes().iterator(); - while (iter.hasNext()) { - DestinationNode child = (DestinationNode) iter.next(); - child.appendDescendantValues(answer); - } - } - - public DestinationNode getChild(String path) { - final Collection list = new ArrayList(); - Iterator iter = getChildNodes().iterator(); - while (iter.hasNext()) { - DestinationNode child = (DestinationNode) iter.next(); - DestinationNode answer = child.getChild(path); - if (answer != null) { - list.add(answer); - } - } - if (!list.isEmpty()) { - return new AnyChildDestinationNode(this) { - protected Collection getChildNodes() { - return list; - } - }; - } - return null; - } - - public Collection getDesendentValues() { - Collection answer = new ArrayList(); - Iterator iter = getChildNodes().iterator(); - while (iter.hasNext()) { - DestinationNode child = (DestinationNode) iter.next(); - answer.addAll(child.getDesendentValues()); - } - return answer; - } - - public Collection getValues() { - Collection answer = new ArrayList(); - Iterator iter = getChildNodes().iterator(); - while (iter.hasNext()) { - DestinationNode child = (DestinationNode) iter.next(); - answer.addAll(child.getValues()); - } - return answer; - } - - - public Collection getChildren() { - Collection answer = new ArrayList(); - Iterator iter = getChildNodes().iterator(); - while (iter.hasNext()) { - DestinationNode child = (DestinationNode) iter.next(); - answer.addAll(child.getChildren()); - } - return answer; - } - - public Collection removeDesendentValues() { - Collection answer = new ArrayList(); - Iterator iter = getChildNodes().iterator(); - while (iter.hasNext()) { - DestinationNode child = (DestinationNode) iter.next(); - answer.addAll(child.removeDesendentValues()); - } - return answer; - } - - public Collection removeValues() { - Collection answer = new ArrayList(); - Iterator iter = getChildNodes().iterator(); - while (iter.hasNext()) { - DestinationNode child = (DestinationNode) iter.next(); - answer.addAll(child.removeValues()); - } - return answer; - } - - protected Collection getChildNodes() { - return node.getChildren(); - } -} - - diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/AnyDestination.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/AnyDestination.class deleted file mode 100644 index 9c3d627c7..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/AnyDestination.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/AnyDestination.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/AnyDestination.java deleted file mode 100644 index f6c3653a8..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/AnyDestination.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * 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.filter; - -import java.lang.IllegalStateException; -import javax.jms.*; -import org.apache.activemq.command.ActiveMQDestination; - -/* - * allow match to any set of composite destinations, both queues and topics - */ -public class AnyDestination extends ActiveMQDestination { - - public AnyDestination(ActiveMQDestination[] destinations) { - super(destinations); - // ensure we are small when it comes to comparison in DestinationMap - physicalName = "0"; - } - - @Override - protected String getQualifiedPrefix() { - return "Any://"; - } - - @Override - public byte getDestinationType() { - return ActiveMQDestination.QUEUE_TYPE & ActiveMQDestination.TOPIC_TYPE; - } - - @Override - public byte getDataStructureType() { - throw new IllegalStateException("not for marshalling"); - } - - @Override - public boolean isQueue() { - return true; - } - - @Override - public boolean isTopic() { - return true; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ArithmeticExpression$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ArithmeticExpression$1.class deleted file mode 100644 index 03103b3f9..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ArithmeticExpression$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ArithmeticExpression$2.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ArithmeticExpression$2.class deleted file mode 100644 index 591a312c5..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ArithmeticExpression$2.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ArithmeticExpression$3.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ArithmeticExpression$3.class deleted file mode 100644 index 709bafa52..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ArithmeticExpression$3.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ArithmeticExpression$4.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ArithmeticExpression$4.class deleted file mode 100644 index 3a22ca14f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ArithmeticExpression$4.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ArithmeticExpression$5.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ArithmeticExpression$5.class deleted file mode 100644 index fe340444e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ArithmeticExpression$5.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ArithmeticExpression.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ArithmeticExpression.class deleted file mode 100644 index dffd584eb..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ArithmeticExpression.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ArithmeticExpression.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ArithmeticExpression.java deleted file mode 100644 index 918ebbbb4..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ArithmeticExpression.java +++ /dev/null @@ -1,204 +0,0 @@ -/** - * 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.filter; - -import javax.jms.JMSException; - -/** - * An expression which performs an operation on two expression values - * - * - */ -public abstract class ArithmeticExpression extends BinaryExpression { - - protected static final int INTEGER = 1; - protected static final int LONG = 2; - protected static final int DOUBLE = 3; - - /** - * @param left - * @param right - */ - public ArithmeticExpression(Expression left, Expression right) { - super(left, right); - } - - public static Expression createPlus(Expression left, Expression right) { - return new ArithmeticExpression(left, right) { - protected Object evaluate(Object lvalue, Object rvalue) { - if (lvalue instanceof String) { - String text = (String)lvalue; - String answer = text + rvalue; - return answer; - } else if (lvalue instanceof Number) { - return plus((Number)lvalue, asNumber(rvalue)); - } - throw new RuntimeException("Cannot call plus operation on: " + lvalue + " and: " + rvalue); - } - - public String getExpressionSymbol() { - return "+"; - } - }; - } - - public static Expression createMinus(Expression left, Expression right) { - return new ArithmeticExpression(left, right) { - protected Object evaluate(Object lvalue, Object rvalue) { - if (lvalue instanceof Number) { - return minus((Number)lvalue, asNumber(rvalue)); - } - throw new RuntimeException("Cannot call minus operation on: " + lvalue + " and: " + rvalue); - } - - public String getExpressionSymbol() { - return "-"; - } - }; - } - - public static Expression createMultiply(Expression left, Expression right) { - return new ArithmeticExpression(left, right) { - - protected Object evaluate(Object lvalue, Object rvalue) { - if (lvalue instanceof Number) { - return multiply((Number)lvalue, asNumber(rvalue)); - } - throw new RuntimeException("Cannot call multiply operation on: " + lvalue + " and: " + rvalue); - } - - public String getExpressionSymbol() { - return "*"; - } - }; - } - - public static Expression createDivide(Expression left, Expression right) { - return new ArithmeticExpression(left, right) { - - protected Object evaluate(Object lvalue, Object rvalue) { - if (lvalue instanceof Number) { - return divide((Number)lvalue, asNumber(rvalue)); - } - throw new RuntimeException("Cannot call divide operation on: " + lvalue + " and: " + rvalue); - } - - public String getExpressionSymbol() { - return "/"; - } - }; - } - - public static Expression createMod(Expression left, Expression right) { - return new ArithmeticExpression(left, right) { - - protected Object evaluate(Object lvalue, Object rvalue) { - if (lvalue instanceof Number) { - return mod((Number)lvalue, asNumber(rvalue)); - } - throw new RuntimeException("Cannot call mod operation on: " + lvalue + " and: " + rvalue); - } - - public String getExpressionSymbol() { - return "%"; - } - }; - } - - protected Number plus(Number left, Number right) { - switch (numberType(left, right)) { - case INTEGER: - return new Integer(left.intValue() + right.intValue()); - case LONG: - return new Long(left.longValue() + right.longValue()); - default: - return new Double(left.doubleValue() + right.doubleValue()); - } - } - - protected Number minus(Number left, Number right) { - switch (numberType(left, right)) { - case INTEGER: - return new Integer(left.intValue() - right.intValue()); - case LONG: - return new Long(left.longValue() - right.longValue()); - default: - return new Double(left.doubleValue() - right.doubleValue()); - } - } - - protected Number multiply(Number left, Number right) { - switch (numberType(left, right)) { - case INTEGER: - return new Integer(left.intValue() * right.intValue()); - case LONG: - return new Long(left.longValue() * right.longValue()); - default: - return new Double(left.doubleValue() * right.doubleValue()); - } - } - - protected Number divide(Number left, Number right) { - return new Double(left.doubleValue() / right.doubleValue()); - } - - protected Number mod(Number left, Number right) { - return new Double(left.doubleValue() % right.doubleValue()); - } - - private int numberType(Number left, Number right) { - if (isDouble(left) || isDouble(right)) { - return DOUBLE; - } else if (left instanceof Long || right instanceof Long) { - return LONG; - } else { - return INTEGER; - } - } - - private boolean isDouble(Number n) { - return n instanceof Float || n instanceof Double; - } - - protected Number asNumber(Object value) { - if (value instanceof Number) { - return (Number)value; - } else { - throw new RuntimeException("Cannot convert value: " + value + " into a number"); - } - } - - public Object evaluate(MessageEvaluationContext message) throws JMSException { - Object lvalue = left.evaluate(message); - if (lvalue == null) { - return null; - } - Object rvalue = right.evaluate(message); - if (rvalue == null) { - return null; - } - return evaluate(lvalue, rvalue); - } - - /** - * @param lvalue - * @param rvalue - * @return - */ - protected abstract Object evaluate(Object lvalue, Object rvalue); - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/BinaryExpression.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/BinaryExpression.class deleted file mode 100644 index dd7ed3f8c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/BinaryExpression.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/BinaryExpression.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/BinaryExpression.java deleted file mode 100644 index 99cc4460c..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/BinaryExpression.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * 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.filter; - - - -/** - * An expression which performs an operation on two expression values. - * - * - */ -public abstract class BinaryExpression implements Expression { - protected Expression left; - protected Expression right; - - public BinaryExpression(Expression left, Expression right) { - this.left = left; - this.right = right; - } - - public Expression getLeft() { - return left; - } - - public Expression getRight() { - return right; - } - - - /** - * @see java.lang.Object#toString() - */ - public String toString() { - return "(" + left.toString() + " " + getExpressionSymbol() + " " + right.toString() + ")"; - } - - /** - * TODO: more efficient hashCode() - * - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - return toString().hashCode(); - } - - /** - * TODO: more efficient hashCode() - * - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals(Object o) { - - if (o == null || !this.getClass().equals(o.getClass())) { - return false; - } - return toString().equals(o.toString()); - - } - - /** - * Returns the symbol that represents this binary expression. For example, addition is - * represented by "+" - * - * @return - */ - public abstract String getExpressionSymbol(); - - /** - * @param expression - */ - public void setRight(Expression expression) { - right = expression; - } - - /** - * @param expression - */ - public void setLeft(Expression expression) { - left = expression; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/BooleanExpression.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/BooleanExpression.class deleted file mode 100644 index 339f93d97..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/BooleanExpression.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/BooleanExpression.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/BooleanExpression.java deleted file mode 100644 index 42ca8ce19..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/BooleanExpression.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * 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.filter; - -import javax.jms.JMSException; - - -/** - * A BooleanExpression is an expression that always - * produces a Boolean result. - * - * - */ -public interface BooleanExpression extends Expression { - - /** - * @param message - * @return true if the expression evaluates to Boolean.TRUE. - * @throws JMSException - */ - boolean matches(MessageEvaluationContext message) throws JMSException; - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/BooleanFunctionCallExpr.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/BooleanFunctionCallExpr.class deleted file mode 100644 index dececdd5e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/BooleanFunctionCallExpr.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/BooleanFunctionCallExpr.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/BooleanFunctionCallExpr.java deleted file mode 100644 index dcd310228..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/BooleanFunctionCallExpr.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * 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.filter; - -import java.util.List; - -/** - * Function call expression that evaluates to a boolean value. Selector parsing requires BooleanExpression objects for - * Boolean expressions, such as operands to AND, and as the final result of a selector. This provides that interface - * for function call expressions that resolve to Boolean values. - *

    - * If a function can return different types at evaluation-time, the function implementation needs to decide whether it - * supports casting to Boolean at parse-time. - * - * @see FunctionCallExpression#createFunctionCall - */ - -public class BooleanFunctionCallExpr extends FunctionCallExpression implements BooleanExpression { - /** - * Constructs a function call expression with the named filter function and arguments, which returns a boolean - * result. - * - * @param func_name - Name of the filter function to be called when evaluated. - * @param args - List of argument expressions passed to the function. - */ - - public BooleanFunctionCallExpr(String func_name, List args) - throws invalidFunctionExpressionException { - super(func_name, args); - } - - - /** - * Evaluate the function call expression, in the given context, and return an indication of whether the - * expression "matches" (i.e. evaluates to true). - * - * @param message_ctx - message context against which the expression will be evaluated. - * @return the boolean evaluation of the function call expression. - */ - - public boolean matches(MessageEvaluationContext message_ctx) throws javax.jms.JMSException { - Boolean result; - - result = (Boolean) evaluate(message_ctx); - - if (result != null) - return result.booleanValue(); - - return false; - } -} - diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ComparisonExpression$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ComparisonExpression$1.class deleted file mode 100644 index 0c538da90..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ComparisonExpression$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ComparisonExpression$2.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ComparisonExpression$2.class deleted file mode 100644 index ca2482781..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ComparisonExpression$2.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ComparisonExpression$3.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ComparisonExpression$3.class deleted file mode 100644 index 7ac7e7c6c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ComparisonExpression$3.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ComparisonExpression$4.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ComparisonExpression$4.class deleted file mode 100644 index 8ec63ed04..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ComparisonExpression$4.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ComparisonExpression$5.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ComparisonExpression$5.class deleted file mode 100644 index 72d71a0c6..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ComparisonExpression$5.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ComparisonExpression$LikeExpression.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ComparisonExpression$LikeExpression.class deleted file mode 100644 index 70477acbd..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ComparisonExpression$LikeExpression.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ComparisonExpression.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ComparisonExpression.class deleted file mode 100644 index 404395b8d..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ComparisonExpression.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ComparisonExpression.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ComparisonExpression.java deleted file mode 100644 index 0f77399c8..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ComparisonExpression.java +++ /dev/null @@ -1,482 +0,0 @@ -/** - * 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.filter; - -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.regex.Pattern; - -import javax.jms.JMSException; - -/** - * A filter performing a comparison of two objects - * - * - */ -public abstract class ComparisonExpression extends BinaryExpression implements BooleanExpression { - - public static final ThreadLocal CONVERT_STRING_EXPRESSIONS = new ThreadLocal(); - - boolean convertStringExpressions = false; - private static final Set REGEXP_CONTROL_CHARS = new HashSet(); - - /** - * @param left - * @param right - */ - public ComparisonExpression(Expression left, Expression right) { - super(left, right); - convertStringExpressions = CONVERT_STRING_EXPRESSIONS.get()!=null; - } - - public static BooleanExpression createBetween(Expression value, Expression left, Expression right) { - return LogicExpression.createAND(createGreaterThanEqual(value, left), createLessThanEqual(value, right)); - } - - public static BooleanExpression createNotBetween(Expression value, Expression left, Expression right) { - return LogicExpression.createOR(createLessThan(value, left), createGreaterThan(value, right)); - } - - static { - REGEXP_CONTROL_CHARS.add(Character.valueOf('.')); - REGEXP_CONTROL_CHARS.add(Character.valueOf('\\')); - REGEXP_CONTROL_CHARS.add(Character.valueOf('[')); - REGEXP_CONTROL_CHARS.add(Character.valueOf(']')); - REGEXP_CONTROL_CHARS.add(Character.valueOf('^')); - REGEXP_CONTROL_CHARS.add(Character.valueOf('$')); - REGEXP_CONTROL_CHARS.add(Character.valueOf('?')); - REGEXP_CONTROL_CHARS.add(Character.valueOf('*')); - REGEXP_CONTROL_CHARS.add(Character.valueOf('+')); - REGEXP_CONTROL_CHARS.add(Character.valueOf('{')); - REGEXP_CONTROL_CHARS.add(Character.valueOf('}')); - REGEXP_CONTROL_CHARS.add(Character.valueOf('|')); - REGEXP_CONTROL_CHARS.add(Character.valueOf('(')); - REGEXP_CONTROL_CHARS.add(Character.valueOf(')')); - REGEXP_CONTROL_CHARS.add(Character.valueOf(':')); - REGEXP_CONTROL_CHARS.add(Character.valueOf('&')); - REGEXP_CONTROL_CHARS.add(Character.valueOf('<')); - REGEXP_CONTROL_CHARS.add(Character.valueOf('>')); - REGEXP_CONTROL_CHARS.add(Character.valueOf('=')); - REGEXP_CONTROL_CHARS.add(Character.valueOf('!')); - } - - static class LikeExpression extends UnaryExpression implements BooleanExpression { - - Pattern likePattern; - - /** - */ - public LikeExpression(Expression right, String like, int escape) { - super(right); - - StringBuffer regexp = new StringBuffer(like.length() * 2); - regexp.append("\\A"); // The beginning of the input - for (int i = 0; i < like.length(); i++) { - char c = like.charAt(i); - if (escape == (0xFFFF & c)) { - i++; - if (i >= like.length()) { - // nothing left to escape... - break; - } - - char t = like.charAt(i); - regexp.append("\\x"); - regexp.append(Integer.toHexString(0xFFFF & t)); - } else if (c == '%') { - regexp.append(".*?"); // Do a non-greedy match - } else if (c == '_') { - regexp.append("."); // match one - } else if (REGEXP_CONTROL_CHARS.contains(new Character(c))) { - regexp.append("\\x"); - regexp.append(Integer.toHexString(0xFFFF & c)); - } else { - regexp.append(c); - } - } - regexp.append("\\z"); // The end of the input - - likePattern = Pattern.compile(regexp.toString(), Pattern.DOTALL); - } - - /** - * @see org.apache.activemq.filter.UnaryExpression#getExpressionSymbol() - */ - public String getExpressionSymbol() { - return "LIKE"; - } - - /** - * @see org.apache.activemq.filter.Expression#evaluate(MessageEvaluationContext) - */ - public Object evaluate(MessageEvaluationContext message) throws JMSException { - - Object rv = this.getRight().evaluate(message); - - if (rv == null) { - return null; - } - - if (!(rv instanceof String)) { - return Boolean.FALSE; - // throw new RuntimeException("LIKE can only operate on String - // identifiers. LIKE attemped on: '" + rv.getClass()); - } - - return likePattern.matcher((String)rv).matches() ? Boolean.TRUE : Boolean.FALSE; - } - - public boolean matches(MessageEvaluationContext message) throws JMSException { - Object object = evaluate(message); - return object != null && object == Boolean.TRUE; - } - } - - public static BooleanExpression createLike(Expression left, String right, String escape) { - if (escape != null && escape.length() != 1) { - throw new RuntimeException("The ESCAPE string litteral is invalid. It can only be one character. Litteral used: " + escape); - } - int c = -1; - if (escape != null) { - c = 0xFFFF & escape.charAt(0); - } - - return new LikeExpression(left, right, c); - } - - public static BooleanExpression createNotLike(Expression left, String right, String escape) { - return UnaryExpression.createNOT(createLike(left, right, escape)); - } - - @SuppressWarnings({ "rawtypes", "unchecked" }) - public static BooleanExpression createInFilter(Expression left, List elements) { - - if (!(left instanceof PropertyExpression)) { - throw new RuntimeException("Expected a property for In expression, got: " + left); - } - return UnaryExpression.createInExpression((PropertyExpression)left, elements, false); - - } - - @SuppressWarnings({ "rawtypes", "unchecked" }) - public static BooleanExpression createNotInFilter(Expression left, List elements) { - - if (!(left instanceof PropertyExpression)) { - throw new RuntimeException("Expected a property for In expression, got: " + left); - } - return UnaryExpression.createInExpression((PropertyExpression)left, elements, true); - - } - - public static BooleanExpression createIsNull(Expression left) { - return doCreateEqual(left, ConstantExpression.NULL); - } - - public static BooleanExpression createIsNotNull(Expression left) { - return UnaryExpression.createNOT(doCreateEqual(left, ConstantExpression.NULL)); - } - - public static BooleanExpression createNotEqual(Expression left, Expression right) { - return UnaryExpression.createNOT(createEqual(left, right)); - } - - public static BooleanExpression createEqual(Expression left, Expression right) { - checkEqualOperand(left); - checkEqualOperand(right); - checkEqualOperandCompatability(left, right); - return doCreateEqual(left, right); - } - - @SuppressWarnings({ "rawtypes" }) - private static BooleanExpression doCreateEqual(Expression left, Expression right) { - return new ComparisonExpression(left, right) { - - public Object evaluate(MessageEvaluationContext message) throws JMSException { - Object lv = left.evaluate(message); - Object rv = right.evaluate(message); - - // If one of the values is null - if (lv == null ^ rv == null) { - return Boolean.FALSE; - } - if (lv == rv || lv.equals(rv)) { - return Boolean.TRUE; - } - if (lv instanceof Comparable && rv instanceof Comparable) { - return compare((Comparable)lv, (Comparable)rv); - } - return Boolean.FALSE; - } - - protected boolean asBoolean(int answer) { - return answer == 0; - } - - public String getExpressionSymbol() { - return "="; - } - }; - } - - public static BooleanExpression createGreaterThan(final Expression left, final Expression right) { - checkLessThanOperand(left); - checkLessThanOperand(right); - return new ComparisonExpression(left, right) { - protected boolean asBoolean(int answer) { - return answer > 0; - } - - public String getExpressionSymbol() { - return ">"; - } - }; - } - - public static BooleanExpression createGreaterThanEqual(final Expression left, final Expression right) { - checkLessThanOperand(left); - checkLessThanOperand(right); - return new ComparisonExpression(left, right) { - protected boolean asBoolean(int answer) { - return answer >= 0; - } - - public String getExpressionSymbol() { - return ">="; - } - }; - } - - public static BooleanExpression createLessThan(final Expression left, final Expression right) { - checkLessThanOperand(left); - checkLessThanOperand(right); - return new ComparisonExpression(left, right) { - - protected boolean asBoolean(int answer) { - return answer < 0; - } - - public String getExpressionSymbol() { - return "<"; - } - - }; - } - - public static BooleanExpression createLessThanEqual(final Expression left, final Expression right) { - checkLessThanOperand(left); - checkLessThanOperand(right); - return new ComparisonExpression(left, right) { - - protected boolean asBoolean(int answer) { - return answer <= 0; - } - - public String getExpressionSymbol() { - return "<="; - } - }; - } - - /** - * Only Numeric expressions can be used in >, >=, < or <= expressions.s - * - * @param expr - */ - public static void checkLessThanOperand(Expression expr) { - if (expr instanceof ConstantExpression) { - Object value = ((ConstantExpression)expr).getValue(); - if (value instanceof Number) { - return; - } - - // Else it's boolean or a String.. - throw new RuntimeException("Value '" + expr + "' cannot be compared."); - } - if (expr instanceof BooleanExpression) { - throw new RuntimeException("Value '" + expr + "' cannot be compared."); - } - } - - /** - * Validates that the expression can be used in == or <> expression. Cannot - * not be NULL TRUE or FALSE litterals. - * - * @param expr - */ - public static void checkEqualOperand(Expression expr) { - if (expr instanceof ConstantExpression) { - Object value = ((ConstantExpression)expr).getValue(); - if (value == null) { - throw new RuntimeException("'" + expr + "' cannot be compared."); - } - } - } - - /** - * @param left - * @param right - */ - private static void checkEqualOperandCompatability(Expression left, Expression right) { - if (left instanceof ConstantExpression && right instanceof ConstantExpression) { - if (left instanceof BooleanExpression && !(right instanceof BooleanExpression)) { - throw new RuntimeException("'" + left + "' cannot be compared with '" + right + "'"); - } - } - } - - @SuppressWarnings({ "rawtypes", "unchecked" }) - public Object evaluate(MessageEvaluationContext message) throws JMSException { - Comparable lv = (Comparable)left.evaluate(message); - if (lv == null) { - return null; - } - Comparable rv = (Comparable)right.evaluate(message); - if (rv == null) { - return null; - } - return compare(lv, rv); - } - - @SuppressWarnings({ "rawtypes", "unchecked" }) - protected Boolean compare(Comparable lv, Comparable rv) { - Class lc = lv.getClass(); - Class rc = rv.getClass(); - // If the the objects are not of the same type, - // try to convert up to allow the comparison. - if (lc != rc) { - try { - if (lc == Boolean.class) { - if (convertStringExpressions && rc == String.class) { - lv = Boolean.valueOf((String)lv).booleanValue(); - } else { - return Boolean.FALSE; - } - } else if (lc == Byte.class) { - if (rc == Short.class) { - lv = Short.valueOf(((Number)lv).shortValue()); - } else if (rc == Integer.class) { - lv = Integer.valueOf(((Number)lv).intValue()); - } else if (rc == Long.class) { - lv = Long.valueOf(((Number)lv).longValue()); - } else if (rc == Float.class) { - lv = new Float(((Number)lv).floatValue()); - } else if (rc == Double.class) { - lv = new Double(((Number)lv).doubleValue()); - } else if (convertStringExpressions && rc == String.class) { - rv = Byte.valueOf((String)rv); - } else { - return Boolean.FALSE; - } - } else if (lc == Short.class) { - if (rc == Integer.class) { - lv = Integer.valueOf(((Number)lv).intValue()); - } else if (rc == Long.class) { - lv = Long.valueOf(((Number)lv).longValue()); - } else if (rc == Float.class) { - lv = new Float(((Number)lv).floatValue()); - } else if (rc == Double.class) { - lv = new Double(((Number)lv).doubleValue()); - } else if (convertStringExpressions && rc == String.class) { - rv = Short.valueOf((String)rv); - } else { - return Boolean.FALSE; - } - } else if (lc == Integer.class) { - if (rc == Long.class) { - lv = Long.valueOf(((Number)lv).longValue()); - } else if (rc == Float.class) { - lv = new Float(((Number)lv).floatValue()); - } else if (rc == Double.class) { - lv = new Double(((Number)lv).doubleValue()); - } else if (convertStringExpressions && rc == String.class) { - rv = Integer.valueOf((String)rv); - } else { - return Boolean.FALSE; - } - } else if (lc == Long.class) { - if (rc == Integer.class) { - rv = Long.valueOf(((Number)rv).longValue()); - } else if (rc == Float.class) { - lv = new Float(((Number)lv).floatValue()); - } else if (rc == Double.class) { - lv = new Double(((Number)lv).doubleValue()); - } else if (convertStringExpressions && rc == String.class) { - rv = Long.valueOf((String)rv); - } else { - return Boolean.FALSE; - } - } else if (lc == Float.class) { - if (rc == Integer.class) { - rv = new Float(((Number)rv).floatValue()); - } else if (rc == Long.class) { - rv = new Float(((Number)rv).floatValue()); - } else if (rc == Double.class) { - lv = new Double(((Number)lv).doubleValue()); - } else if (convertStringExpressions && rc == String.class) { - rv = Float.valueOf((String)rv); - } else { - return Boolean.FALSE; - } - } else if (lc == Double.class) { - if (rc == Integer.class) { - rv = new Double(((Number)rv).doubleValue()); - } else if (rc == Long.class) { - rv = new Double(((Number)rv).doubleValue()); - } else if (rc == Float.class) { - rv = new Float(((Number)rv).doubleValue()); - } else if (convertStringExpressions && rc == String.class) { - rv = Double.valueOf((String)rv); - } else { - return Boolean.FALSE; - } - } else if (convertStringExpressions && lc == String.class) { - if (rc == Boolean.class) { - lv = Boolean.valueOf((String)lv); - } else if (rc == Byte.class) { - lv = Byte.valueOf((String)lv); - } else if (rc == Short.class) { - lv = Short.valueOf((String)lv); - } else if (rc == Integer.class) { - lv = Integer.valueOf((String)lv); - } else if (rc == Long.class) { - lv = Long.valueOf((String)lv); - } else if (rc == Float.class) { - lv = Float.valueOf((String)lv); - } else if (rc == Double.class) { - lv = Double.valueOf((String)lv); - } else { - return Boolean.FALSE; - } - } else { - return Boolean.FALSE; - } - } catch(NumberFormatException e) { - return Boolean.FALSE; - } - } - return asBoolean(lv.compareTo(rv)) ? Boolean.TRUE : Boolean.FALSE; - } - - protected abstract boolean asBoolean(int answer); - - public boolean matches(MessageEvaluationContext message) throws JMSException { - Object object = evaluate(message); - return object != null && object == Boolean.TRUE; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/CompositeDestinationFilter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/CompositeDestinationFilter.class deleted file mode 100644 index 92fa66eac..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/CompositeDestinationFilter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/CompositeDestinationFilter.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/CompositeDestinationFilter.java deleted file mode 100644 index 43ba696d0..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/CompositeDestinationFilter.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * 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.filter; - -import org.apache.activemq.command.ActiveMQDestination; - -/** - * A {@link DestinationFilter} used for composite destinations - * - * - */ -public class CompositeDestinationFilter extends DestinationFilter { - - private DestinationFilter filters[]; - - public CompositeDestinationFilter(ActiveMQDestination destination) { - ActiveMQDestination[] destinations = destination.getCompositeDestinations(); - filters = new DestinationFilter[destinations.length]; - for (int i = 0; i < destinations.length; i++) { - ActiveMQDestination childDestination = destinations[i]; - filters[i] = DestinationFilter.parseFilter(childDestination); - } - } - - public boolean matches(ActiveMQDestination destination) { - for (int i = 0; i < filters.length; i++) { - if (filters[i].matches(destination)) { - return true; - } - } - return false; - } - - public boolean isWildcard() { - return true; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ConstantExpression$BooleanConstantExpression.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ConstantExpression$BooleanConstantExpression.class deleted file mode 100644 index dd6438150..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ConstantExpression$BooleanConstantExpression.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ConstantExpression.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ConstantExpression.class deleted file mode 100644 index 7a38fc691..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ConstantExpression.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ConstantExpression.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ConstantExpression.java deleted file mode 100644 index 53e4a1300..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/ConstantExpression.java +++ /dev/null @@ -1,164 +0,0 @@ -/** - * 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.filter; - -import java.math.BigDecimal; - -import javax.jms.JMSException; - -/** - * Represents a constant expression - * - * - */ -public class ConstantExpression implements Expression { - - static class BooleanConstantExpression extends ConstantExpression implements BooleanExpression { - public BooleanConstantExpression(Object value) { - super(value); - } - - public boolean matches(MessageEvaluationContext message) throws JMSException { - Object object = evaluate(message); - return object != null && object == Boolean.TRUE; - } - } - - public static final BooleanConstantExpression NULL = new BooleanConstantExpression(null); - public static final BooleanConstantExpression TRUE = new BooleanConstantExpression(Boolean.TRUE); - public static final BooleanConstantExpression FALSE = new BooleanConstantExpression(Boolean.FALSE); - - private Object value; - - public ConstantExpression(Object value) { - this.value = value; - } - - public static ConstantExpression createFromDecimal(String text) { - - // Strip off the 'l' or 'L' if needed. - if (text.endsWith("l") || text.endsWith("L")) { - text = text.substring(0, text.length() - 1); - } - - Number value; - try { - value = new Long(text); - } catch (NumberFormatException e) { - // The number may be too big to fit in a long. - value = new BigDecimal(text); - } - - long l = value.longValue(); - if (Integer.MIN_VALUE <= l && l <= Integer.MAX_VALUE) { - value = Integer.valueOf(value.intValue()); - } - return new ConstantExpression(value); - } - - public static ConstantExpression createFromHex(String text) { - Number value = Long.valueOf(Long.parseLong(text.substring(2), 16)); - long l = value.longValue(); - if (Integer.MIN_VALUE <= l && l <= Integer.MAX_VALUE) { - value = Integer.valueOf(value.intValue()); - } - return new ConstantExpression(value); - } - - public static ConstantExpression createFromOctal(String text) { - Number value = Long.valueOf(Long.parseLong(text, 8)); - long l = value.longValue(); - if (Integer.MIN_VALUE <= l && l <= Integer.MAX_VALUE) { - value = Integer.valueOf(value.intValue()); - } - return new ConstantExpression(value); - } - - public static ConstantExpression createFloat(String text) { - Number value = new Double(text); - return new ConstantExpression(value); - } - - public Object evaluate(MessageEvaluationContext message) throws JMSException { - return value; - } - - public Object getValue() { - return value; - } - - /** - * @see java.lang.Object#toString() - */ - public String toString() { - if (value == null) { - return "NULL"; - } - if (value instanceof Boolean) { - return ((Boolean)value).booleanValue() ? "TRUE" : "FALSE"; - } - if (value instanceof String) { - return encodeString((String)value); - } - return value.toString(); - } - - /** - * TODO: more efficient hashCode() - * - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - return toString().hashCode(); - } - - /** - * TODO: more efficient hashCode() - * - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals(Object o) { - - if (o == null || !this.getClass().equals(o.getClass())) { - return false; - } - return toString().equals(o.toString()); - - } - - /** - * Encodes the value of string so that it looks like it would look like when - * it was provided in a selector. - * - * @param string - * @return - */ - public static String encodeString(String s) { - StringBuffer b = new StringBuffer(); - b.append('\''); - for (int i = 0; i < s.length(); i++) { - char c = s.charAt(i); - if (c == '\'') { - b.append(c); - } - b.append(c); - } - b.append('\''); - return b.toString(); - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DefaultDestinationMapEntry.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DefaultDestinationMapEntry.class deleted file mode 100644 index a4a710ce1..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DefaultDestinationMapEntry.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DefaultDestinationMapEntry.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DefaultDestinationMapEntry.java deleted file mode 100644 index 43892ffd3..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DefaultDestinationMapEntry.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * 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.filter; - -/** - * A default entry in a DestinationMap which holds a single value. - * - * @org.apache.xbean.XBean element="destinationEntry" - * - * - */ -@SuppressWarnings("rawtypes") -public class DefaultDestinationMapEntry extends DestinationMapEntry { - private DestinationMapEntry value; - - public DestinationMapEntry getValue() { - return value; - } - - public void setValue(DestinationMapEntry value) { - this.value = value; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DestinationFilter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DestinationFilter.class deleted file mode 100644 index 76d42e371..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DestinationFilter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DestinationFilter.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DestinationFilter.java deleted file mode 100644 index bb16fe6f8..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DestinationFilter.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - * 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.filter; - -import java.io.IOException; - -import javax.jms.JMSException; - -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.util.JMSExceptionSupport; - -/** - * Represents a filter which only operates on Destinations - * - * - */ -public abstract class DestinationFilter implements BooleanExpression { - - public static final String ANY_DESCENDENT = ">"; - public static final String ANY_CHILD = "*"; - - public Object evaluate(MessageEvaluationContext message) throws JMSException { - return matches(message) ? Boolean.TRUE : Boolean.FALSE; - } - - public boolean matches(MessageEvaluationContext message) throws JMSException { - try { - if (message.isDropped()) { - return false; - } - return matches(message.getMessage().getDestination()); - } catch (IOException e) { - throw JMSExceptionSupport.create(e); - } - } - - public abstract boolean matches(ActiveMQDestination destination); - - public static DestinationFilter parseFilter(ActiveMQDestination destination) { - if (destination.isComposite()) { - return new CompositeDestinationFilter(destination); - } - String[] paths = DestinationPath.getDestinationPaths(destination); - int idx = paths.length - 1; - if (idx >= 0) { - String lastPath = paths[idx]; - if (lastPath.equals(ANY_DESCENDENT)) { - return new PrefixDestinationFilter(paths, destination.getDestinationType()); - } else { - while (idx >= 0) { - lastPath = paths[idx--]; - if (lastPath.equals(ANY_CHILD)) { - return new WildcardDestinationFilter(paths, destination.getDestinationType()); - } - } - } - } - - // if none of the paths contain a wildcard then use equality - return new SimpleDestinationFilter(destination); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DestinationMap.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DestinationMap.class deleted file mode 100644 index 9e726ed6c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DestinationMap.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DestinationMap.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DestinationMap.java deleted file mode 100644 index 0ff894e2f..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DestinationMap.java +++ /dev/null @@ -1,257 +0,0 @@ -/** - * 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.filter; - -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; -import java.util.SortedSet; -import java.util.TreeSet; - -import org.apache.activemq.command.ActiveMQDestination; - -/** - * A Map-like data structure allowing values to be indexed by - * {@link ActiveMQDestination} and retrieved by destination - supporting both * - * and > style of wildcard as well as composite destinations.
    - * This class assumes that the index changes rarely but that fast lookup into - * the index is required. So this class maintains a pre-calculated index for - * destination steps. So looking up the values for "TEST.*" or "*.TEST" will be - * pretty fast.
    - * Looking up of a value could return a single value or a List of matching - * values if a wildcard or composite destination is used. - * - * - */ -public class DestinationMap { - protected static final String ANY_DESCENDENT = DestinationFilter.ANY_DESCENDENT; - protected static final String ANY_CHILD = DestinationFilter.ANY_CHILD; - - private DestinationMapNode queueRootNode = new DestinationMapNode(null); - private DestinationMapNode tempQueueRootNode = new DestinationMapNode(null); - private DestinationMapNode topicRootNode = new DestinationMapNode(null); - private DestinationMapNode tempTopicRootNode = new DestinationMapNode(null); - - /** - * Looks up the value(s) matching the given Destination key. For simple - * destinations this is typically a List of one single value, for wildcards - * or composite destinations this will typically be a List of matching - * values. - * - * @param key the destination to lookup - * @return a List of matching values or an empty list if there are no - * matching values. - */ - @SuppressWarnings({ "rawtypes", "unchecked" }) - public synchronized Set get(ActiveMQDestination key) { - if (key.isComposite()) { - ActiveMQDestination[] destinations = key.getCompositeDestinations(); - Set answer = new HashSet(destinations.length); - for (int i = 0; i < destinations.length; i++) { - ActiveMQDestination childDestination = destinations[i]; - Object value = get(childDestination); - if (value instanceof Set) { - answer.addAll((Set)value); - } else if (value != null) { - answer.add(value); - } - } - return answer; - } - return findWildcardMatches(key); - } - - public synchronized void put(ActiveMQDestination key, Object value) { - if (key.isComposite()) { - ActiveMQDestination[] destinations = key.getCompositeDestinations(); - for (int i = 0; i < destinations.length; i++) { - ActiveMQDestination childDestination = destinations[i]; - put(childDestination, value); - } - return; - } - String[] paths = key.getDestinationPaths(); - getRootNode(key).add(paths, 0, value); - } - - /** - * Removes the value from the associated destination - */ - public synchronized void remove(ActiveMQDestination key, Object value) { - if (key.isComposite()) { - ActiveMQDestination[] destinations = key.getCompositeDestinations(); - for (int i = 0; i < destinations.length; i++) { - ActiveMQDestination childDestination = destinations[i]; - remove(childDestination, value); - } - return; - } - String[] paths = key.getDestinationPaths(); - getRootNode(key).remove(paths, 0, value); - - } - - public int getTopicRootChildCount() { - return topicRootNode.getChildCount(); - } - - public int getQueueRootChildCount() { - return queueRootNode.getChildCount(); - } - - public DestinationMapNode getQueueRootNode() { - return queueRootNode; - } - - public DestinationMapNode getTopicRootNode() { - return topicRootNode; - } - - public DestinationMapNode getTempQueueRootNode() { - return tempQueueRootNode; - } - - public DestinationMapNode getTempTopicRootNode() { - return tempTopicRootNode; - } - - // Implementation methods - // ------------------------------------------------------------------------- - - /** - * A helper method to allow the destination map to be populated from a - * dependency injection framework such as Spring - */ - @SuppressWarnings({ "rawtypes" }) - protected void setEntries(List entries) { - for (Object element : entries) { - Class type = getEntryClass(); - if (type.isInstance(element)) { - DestinationMapEntry entry = (DestinationMapEntry)element; - put(entry.getDestination(), entry.getValue()); - } else { - throw new IllegalArgumentException("Each entry must be an instance of type: " + type.getName() + " but was: " + element); - } - } - } - - /** - * Returns the type of the allowed entries which can be set via the - * {@link #setEntries(List)} method. This allows derived classes to further - * restrict the type of allowed entries to make a type safe destination map - * for custom policies. - */ - @SuppressWarnings({ "rawtypes" }) - protected Class getEntryClass() { - return DestinationMapEntry.class; - } - - @SuppressWarnings({ "rawtypes", "unchecked" }) - protected Set findWildcardMatches(ActiveMQDestination key) { - String[] paths = key.getDestinationPaths(); - Set answer = new HashSet(); - getRootNode(key).appendMatchingValues(answer, paths, 0); - return answer; - } - - /** - * @param key - * @return - */ - @SuppressWarnings({ "rawtypes", "unchecked" }) - public Set removeAll(ActiveMQDestination key) { - Set rc = new HashSet(); - if (key.isComposite()) { - ActiveMQDestination[] destinations = key.getCompositeDestinations(); - for (int i = 0; i < destinations.length; i++) { - rc.add(removeAll(destinations[i])); - } - return rc; - } - String[] paths = key.getDestinationPaths(); - getRootNode(key).removeAll(rc, paths, 0); - return rc; - } - - /** - * Returns the value which matches the given destination or null if there is - * no matching value. If there are multiple values, the results are sorted - * and the last item (the biggest) is returned. - * - * @param destination the destination to find the value for - * @return the largest matching value or null if no value matches - */ - @SuppressWarnings({ "rawtypes", "unchecked" }) - public Object chooseValue(ActiveMQDestination destination) { - Set set = get(destination); - if (set == null || set.isEmpty()) { - return null; - } - SortedSet sortedSet = new TreeSet(set); - return sortedSet.last(); - } - - /** - * Returns the root node for the given destination type - */ - protected DestinationMapNode getRootNode(ActiveMQDestination key) { - if (key.isTemporary()){ - if (key.isQueue()) { - return tempQueueRootNode; - } else { - return tempTopicRootNode; - } - } else { - if (key.isQueue()) { - return queueRootNode; - } else { - return topicRootNode; - } - } - } - - public void reset() { - queueRootNode = new DestinationMapNode(null); - tempQueueRootNode = new DestinationMapNode(null); - topicRootNode = new DestinationMapNode(null); - tempTopicRootNode = new DestinationMapNode(null); - } - - public boolean isEmpty(){ - return queueRootNode.isEmpty() && topicRootNode.isEmpty() && tempQueueRootNode.isEmpty() && tempTopicRootNode.isEmpty(); - } - - public static Set union(Set existing, Set candidates) { - if ( candidates != null ) { - if (existing != null) { - for (Iterator iterator = existing.iterator(); iterator.hasNext();) { - Object toMatch = iterator.next(); - if (!candidates.contains(toMatch)) { - iterator.remove(); - } - } - } else { - existing = candidates; - } - } else if ( existing != null ) { - existing.clear(); - } - return existing; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DestinationMapEntry.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DestinationMapEntry.class deleted file mode 100644 index 71fcc04e5..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DestinationMapEntry.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DestinationMapEntry.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DestinationMapEntry.java deleted file mode 100644 index f1d78383f..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DestinationMapEntry.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * 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.filter; - -import javax.annotation.PostConstruct; - -import org.apache.activemq.command.*; - -/** - * A base class for entry objects used to construct a destination based policy - * map. - * - * - * @org.apache.xbean.XBean - */ -public abstract class DestinationMapEntry implements Comparable { - - protected ActiveMQDestination destination; - - public int compareTo(Object that) { - if (that instanceof DestinationMapEntry) { - DestinationMapEntry thatEntry = (DestinationMapEntry)that; - return ActiveMQDestination.compare(destination, thatEntry.destination); - } else if (that == null) { - return 1; - } else { - return getClass().getName().compareTo(that.getClass().getName()); - } - } - - /** - * A helper method to set the destination from a configuration file - */ - public void setQueue(String name) { - setDestination(new ActiveMQQueue(name)); - } - - /** - * A helper method to set the destination from a configuration file - */ - public void setTopic(String name) { - setDestination(new ActiveMQTopic(name)); - } - - public void setTempTopic(boolean flag){ - setDestination(new ActiveMQTempTopic(">")); - } - - public void setTempQueue(boolean flag){ - setDestination(new ActiveMQTempQueue(">")); - } - - public ActiveMQDestination getDestination() { - return destination; - } - - public void setDestination(ActiveMQDestination destination) { - this.destination = destination; - } - - public Comparable getValue() { - return this; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DestinationMapNode.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DestinationMapNode.class deleted file mode 100644 index 6637ab64a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DestinationMapNode.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DestinationMapNode.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DestinationMapNode.java deleted file mode 100644 index f9ca156db..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DestinationMapNode.java +++ /dev/null @@ -1,256 +0,0 @@ -/** - * 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.filter; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * An implementation class used to implement {@link DestinationMap} - * - * - */ -public class DestinationMapNode implements DestinationNode { - protected static final String ANY_CHILD = DestinationMap.ANY_CHILD; - protected static final String ANY_DESCENDENT = DestinationMap.ANY_DESCENDENT; - - // we synchronize at the DestinationMap level - private DestinationMapNode parent; - private List values = new ArrayList(); - private Map childNodes = new HashMap(); - private String path = "Root"; - // private DestinationMapNode anyChild; - private int pathLength; - - public DestinationMapNode(DestinationMapNode parent) { - this.parent = parent; - if (parent == null) { - pathLength = 0; - } else { - pathLength = parent.pathLength + 1; - } - } - - /** - * Returns the child node for the given named path or null if it does not - * exist - */ - public DestinationNode getChild(String path) { - return childNodes.get(path); - } - - /** - * Returns the child nodes - */ - public Collection getChildren() { - return childNodes.values(); - } - - public int getChildCount() { - return childNodes.size(); - } - - /** - * Returns the child node for the given named path, lazily creating one if - * it does not yet exist - */ - public DestinationMapNode getChildOrCreate(String path) { - DestinationMapNode answer = (DestinationMapNode)childNodes.get(path); - if (answer == null) { - answer = createChildNode(); - answer.path = path; - childNodes.put(path, answer); - } - return answer; - } - - /** - * Returns a mutable List of the values available at this node in the tree - */ - @SuppressWarnings({ "rawtypes", "unchecked" }) - public List getValues() { - return values; - } - - /** - * Returns a mutable List of the values available at this node in the tree - */ - @SuppressWarnings({ "rawtypes", "unchecked" }) - public List removeValues() { - ArrayList v = new ArrayList(values); - // parent.getAnyChildNode().getValues().removeAll(v); - values.clear(); - pruneIfEmpty(); - return v; - } - - @SuppressWarnings({ "rawtypes", "unchecked" }) - public Set removeDesendentValues() { - Set answer = new HashSet(); - removeDesendentValues(answer); - return answer; - } - - @SuppressWarnings({ "rawtypes", "unchecked" }) - protected void removeDesendentValues(Set answer) { - answer.addAll(removeValues()); - } - - /** - * Returns a list of all the values from this node down the tree - */ - @SuppressWarnings({ "rawtypes", "unchecked" }) - public Set getDesendentValues() { - Set answer = new HashSet(); - appendDescendantValues(answer); - return answer; - } - - public void add(String[] paths, int idx, Object value) { - if (idx >= paths.length) { - values.add(value); - } else { - getChildOrCreate(paths[idx]).add(paths, idx + 1, value); - } - } - - public void remove(String[] paths, int idx, Object value) { - if (idx >= paths.length) { - values.remove(value); - pruneIfEmpty(); - } else { - getChildOrCreate(paths[idx]).remove(paths, ++idx, value); - } - } - - public void removeAll(Set answer, String[] paths, int startIndex) { - DestinationNode node = this; - int size = paths.length; - for (int i = startIndex; i < size && node != null; i++) { - - String path = paths[i]; - if (path.equals(ANY_DESCENDENT)) { - answer.addAll(node.removeDesendentValues()); - break; - } - - node.appendMatchingWildcards(answer, paths, i); - if (path.equals(ANY_CHILD)) { - // node = node.getAnyChildNode(); - node = new AnyChildDestinationNode(node); - } else { - node = node.getChild(path); - } - } - - if (node != null) { - answer.addAll(node.removeValues()); - } - - } - - @SuppressWarnings({ "rawtypes", "unchecked" }) - public void appendDescendantValues(Set answer) { - answer.addAll(values); - - // lets add all the children too - for(DestinationNode child : childNodes.values()) { - child.appendDescendantValues(answer); - } - } - - /** - * Factory method to create a child node - */ - protected DestinationMapNode createChildNode() { - return new DestinationMapNode(this); - } - - /** - * Matches any entries in the map containing wildcards - */ - @SuppressWarnings({ "rawtypes", "unchecked" }) - public void appendMatchingWildcards(Set answer, String[] paths, int idx) { - if (idx - 1 > pathLength) { - return; - } - DestinationNode wildCardNode = getChild(ANY_CHILD); - if (wildCardNode != null) { - wildCardNode.appendMatchingValues(answer, paths, idx + 1); - } - wildCardNode = getChild(ANY_DESCENDENT); - if (wildCardNode != null) { - answer.addAll(wildCardNode.getDesendentValues()); - } - } - - public void appendMatchingValues(Set answer, String[] paths, int startIndex) { - DestinationNode node = this; - boolean couldMatchAny = true; - int size = paths.length; - for (int i = startIndex; i < size && node != null; i++) { - String path = paths[i]; - if (path.equals(ANY_DESCENDENT)) { - answer.addAll(node.getDesendentValues()); - couldMatchAny = false; - break; - } - - node.appendMatchingWildcards(answer, paths, i); - - if (path.equals(ANY_CHILD)) { - node = new AnyChildDestinationNode(node); - } else { - node = node.getChild(path); - } - } - if (node != null) { - answer.addAll(node.getValues()); - if (couldMatchAny) { - // lets allow FOO.BAR to match the FOO.BAR.> entry in the map - DestinationNode child = node.getChild(ANY_DESCENDENT); - if (child != null) { - answer.addAll(child.getValues()); - } - } - } - } - - public String getPath() { - return path; - } - - public boolean isEmpty(){ - return childNodes.isEmpty(); - } - - protected void pruneIfEmpty() { - if (parent != null && childNodes.isEmpty() && values.isEmpty()) { - parent.removeChild(this); - } - } - - protected void removeChild(DestinationMapNode node) { - childNodes.remove(node.getPath()); - pruneIfEmpty(); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DestinationNode.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DestinationNode.class deleted file mode 100644 index 68e68fc39..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DestinationNode.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DestinationNode.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DestinationNode.java deleted file mode 100644 index 10dba9d57..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DestinationNode.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * 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.filter; - -import java.util.Collection; -import java.util.Set; - -/** - * Represents a node in the {@link DestinationMap} tree - * - * - */ -public interface DestinationNode { - void appendMatchingValues(Set answer, String[] paths, int startIndex); - - void appendMatchingWildcards(Set answer, String[] paths, int startIndex); - - void appendDescendantValues(Set answer); - - Collection getDesendentValues(); - - DestinationNode getChild(String path); - - Collection getValues(); - - Collection getChildren(); - - Collection removeDesendentValues(); - - Collection removeValues(); -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DestinationPath.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DestinationPath.class deleted file mode 100644 index f4651fc09..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DestinationPath.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DestinationPath.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DestinationPath.java deleted file mode 100644 index 82a1e4d6e..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/DestinationPath.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * 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.filter; - -import java.util.ArrayList; -import java.util.List; - -import javax.jms.JMSException; - -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.Message; - -/** - * Helper class for decomposing a Destination into a number of paths - * - * - */ -public final class DestinationPath { - protected static final char SEPARATOR = '.'; - - private DestinationPath() { - } - - public static String[] getDestinationPaths(String subject) { - List list = new ArrayList(); - int previous = 0; - int lastIndex = subject.length() - 1; - while (true) { - int idx = subject.indexOf(SEPARATOR, previous); - if (idx < 0) { - list.add(subject.substring(previous, lastIndex + 1)); - break; - } - list.add(subject.substring(previous, idx)); - previous = idx + 1; - } - String[] answer = new String[list.size()]; - list.toArray(answer); - return answer; - } - - public static String[] getDestinationPaths(Message message) throws JMSException { - return getDestinationPaths(message.getDestination()); - } - - public static String[] getDestinationPaths(ActiveMQDestination destination) { - return getDestinationPaths(destination.getPhysicalName()); - } - - /** - * Converts the paths to a single String seperated by dots. - * - * @param paths - * @return - */ - public static String toString(String[] paths) { - StringBuffer buffer = new StringBuffer(); - for (int i = 0; i < paths.length; i++) { - if (i > 0) { - buffer.append(SEPARATOR); - } - String path = paths[i]; - if (path == null) { - buffer.append("*"); - } else { - buffer.append(path); - } - } - return buffer.toString(); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/Expression.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/Expression.class deleted file mode 100644 index b90980126..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/Expression.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/Expression.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/Expression.java deleted file mode 100644 index b4afe39c7..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/Expression.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * 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.filter; - -import javax.jms.JMSException; - - -/** - * Represents an expression - * - * - */ -public interface Expression { - - /** - * @return the value of this expression - */ - Object evaluate(MessageEvaluationContext message) throws JMSException; - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/FunctionCallExpression$functionRegistration.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/FunctionCallExpression$functionRegistration.class deleted file mode 100644 index 8f0d78abe..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/FunctionCallExpression$functionRegistration.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/FunctionCallExpression$invalidFunctionExpressionException.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/FunctionCallExpression$invalidFunctionExpressionException.class deleted file mode 100644 index 743d7ac35..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/FunctionCallExpression$invalidFunctionExpressionException.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/FunctionCallExpression.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/FunctionCallExpression.class deleted file mode 100644 index c6407616f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/FunctionCallExpression.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/FunctionCallExpression.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/FunctionCallExpression.java deleted file mode 100644 index ec4590fcd..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/FunctionCallExpression.java +++ /dev/null @@ -1,281 +0,0 @@ -/** - * 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.filter; - -import java.util.HashMap; -import java.util.List; -import org.apache.activemq.filter.function.FilterFunction; - -/** - * Function call expression for use in selector expressions. Includes an extensible interface to allow custom - * functions to be added without changes to the core. - *

    - * Use registerFunction() to register new function implementations for use in selectors. - */ - -public class FunctionCallExpression implements Expression { - protected static final HashMap functionRegistry = new HashMap(); - - protected String functionName; - protected java.util.ArrayList arguments; - protected FilterFunction filterFunc; - - static { - // Register the built-in functions. It would be nice to just have each function class register - // itself, but that only works when the classes are loaded, which may be never. - - org.apache.activemq.filter.function.BuiltinFunctionRegistry.register(); - } - - - /** - * Register the function with the specified name. - * - * @param name - the function name, as used in selector expressions. Case Sensitive. - * @param impl - class which implements the function interface, including parse-time and evaluation-time - * operations. - * @return true - if the function is successfully registered; false - if a function with the same name is - * already registered. - */ - - public static boolean registerFunction(String name, FilterFunction impl) { - boolean result; - - result = true; - - synchronized (functionRegistry) { - if (functionRegistry.containsKey(name)) - result = false; - else - functionRegistry.put(name, new functionRegistration(impl)); - } - - return result; - } - - /** - * Remove the registration of the function with the specified name. - *

    - * Note that parsed expressions using this function will still access its implementation after this call. - * - * @param name - name of the function to remove. - */ - - public static void deregisterFunction(String name) { - synchronized (functionRegistry) { - functionRegistry.remove(name); - } - } - - - /** - * Constructs a function call expression with the named function and argument list. - *

    - * Use createFunctionCall() to create instances. - * - * @exception invalidFunctionExpressionException - if the function name is not valid. - */ - - protected FunctionCallExpression(String func_name, List args) - throws invalidFunctionExpressionException { - functionRegistration func_reg; - - synchronized (functionRegistry) { - func_reg = functionRegistry.get(func_name); - } - - if (func_reg != null) { - this.arguments = new java.util.ArrayList(); - this.arguments.addAll(args); - this.functionName = func_name; - this.filterFunc = func_reg.getFilterFunction(); - } else { - throw new invalidFunctionExpressionException("invalid function name, \"" + func_name + "\""); - } - } - - - /** - * Create a function call expression for the named function and argument list, returning a Boolean function - * call expression if the function returns a boolean value so that it may be used in boolean contexts. - * Used by the parser when a function call is identified. Note that the function call is created after all - * argument expressions so that the function call can properly detect whether it evaluates to a Boolean value. - * - * @param func_name - name of the function, as used in selectors. - * @param args - list of argument expressions passed to the function. - * @return an instance of a BooleanFunctionCallExpr if the function returns a boolean value in this call, - * or a FunctionCallExpression otherwise. - * @exception invalidFunctionExpression - if the function name is not valid, or the given argument list is - * not valid for the function. - */ - - public static FunctionCallExpression createFunctionCall(String func_name, List args) - throws invalidFunctionExpressionException { - FunctionCallExpression result; - - // - // Create a function call expression by default to use with validating the function call - // expression and checking whether it returns a boolean result. - // - - result = new FunctionCallExpression(func_name, args); - - - // - // Check wether the function accepts this expression. I.E. are the arguments valid? - // - - if (result.filterFunc.isValid(result)) { - // - // If the result of the call is known to alwyas return a boolean value, wrap this - // expression as a valid BooleanExpression so it will be accepted as a boolean result - // by the selector grammar. - // - - if (result.filterFunc.returnsBoolean(result)) - result = new BooleanFunctionCallExpr(func_name, args); - } else { - // - // Function does not like this expression. - // - - throw new invalidFunctionExpressionException("invalid call of function " + func_name); - } - - return result; - } - - - /** - * Retrieve the number of arguments for the function call defined in this expression. - * - * @return the number of arguments being passed to the function. - */ - - public int getNumArguments() { - return arguments.size(); - } - - - /** - * Retrieve the argument at the specified index; the first argument is index 0. Used by implementations of - * FilterFunction objects to check arguments and evaluate them, as needed. - * - * @param which - number of the argument to retrieve; the first is 0. - */ - - public Expression getArgument(int which) { - return (Expression) arguments.get(which); - } - - - /** - * Evaluate the function call expression in the context given. - * - * @see Expression#evaluate - */ - - public Object evaluate(MessageEvaluationContext message_ctx) - throws javax.jms.JMSException { - return this.filterFunc.evaluate(this, message_ctx); - } - - - /** - * Translate the expression back into text in a form similar to the input to the selector parser. - */ - - @Override - public String toString() { - StringBuilder result; - boolean first_f; - - result = new StringBuilder(); - - result.append(functionName); - result.append("("); - first_f = true; - - for (Object arg : arguments) { - if (first_f) - first_f = false; - else - result.append(", "); - - result.append(arg.toString()); - } - - result.append(")"); - - return result.toString(); - } - - - //// //// - //// FUNCTION REGISTRATION //// - //// //// - - /** - * Maintain a single function registration. - */ - - protected static class functionRegistration { - protected FilterFunction filterFunction; - - /** - * Constructs a function registration for the given function implementation. - */ - - public functionRegistration(FilterFunction func) { - this.filterFunction = func; - } - - - /** - * Retrieve the filter function implementation. - */ - - public FilterFunction getFilterFunction() { - return filterFunction; - } - - - /** - * Set the filter function implementation for this registration. - */ - - public void setFilterFunction(FilterFunction func) { - filterFunction = func; - } - } - - - /** - * Exception indicating that an invalid function call expression was created, usually by the selector parser. - * Conditions include invalid function names and invalid function arguments. - */ - - public static class invalidFunctionExpressionException extends java.lang.Exception { - public invalidFunctionExpressionException(String msg) { - super(msg); - } - - public invalidFunctionExpressionException(String msg, java.lang.Throwable cause) { - super(msg, cause); - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/JAXPXPathEvaluator.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/JAXPXPathEvaluator.class deleted file mode 100644 index 4169da5ef..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/JAXPXPathEvaluator.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/JAXPXPathEvaluator.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/JAXPXPathEvaluator.java deleted file mode 100644 index 73098f5e9..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/JAXPXPathEvaluator.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * 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.filter; - -import java.io.StringReader; -import javax.jms.BytesMessage; -import javax.jms.JMSException; -import javax.jms.TextMessage; -import javax.xml.xpath.XPath; -import javax.xml.xpath.XPathConstants; -import javax.xml.xpath.XPathExpressionException; -import javax.xml.xpath.XPathFactory; - -import org.apache.activemq.command.Message; -import org.apache.activemq.util.ByteArrayInputStream; -import org.xml.sax.InputSource; - -public class JAXPXPathEvaluator implements XPathExpression.XPathEvaluator { - - private static final XPathFactory FACTORY = XPathFactory.newInstance(); - private javax.xml.xpath.XPathExpression expression; - - public JAXPXPathEvaluator(String xpathExpression) { - try { - XPath xpath = FACTORY.newXPath(); - expression = xpath.compile(xpathExpression); - } catch (XPathExpressionException e) { - throw new RuntimeException("Invalid XPath expression: " + xpathExpression); - } - } - - public boolean evaluate(Message message) throws JMSException { - if (message instanceof TextMessage) { - String text = ((TextMessage)message).getText(); - return evaluate(text); - } else if (message instanceof BytesMessage) { - BytesMessage bm = (BytesMessage)message; - byte data[] = new byte[(int)bm.getBodyLength()]; - bm.readBytes(data); - return evaluate(data); - } - return false; - } - - private boolean evaluate(byte[] data) { - try { - InputSource inputSource = new InputSource(new ByteArrayInputStream(data)); - return ((Boolean)expression.evaluate(inputSource, XPathConstants.BOOLEAN)).booleanValue(); - } catch (XPathExpressionException e) { - return false; - } - } - - private boolean evaluate(String text) { - try { - InputSource inputSource = new InputSource(new StringReader(text)); - return ((Boolean)expression.evaluate(inputSource, XPathConstants.BOOLEAN)).booleanValue(); - } catch (XPathExpressionException e) { - return false; - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/LogicExpression$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/LogicExpression$1.class deleted file mode 100644 index 2618f874c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/LogicExpression$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/LogicExpression$2.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/LogicExpression$2.class deleted file mode 100644 index 523cbc3f8..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/LogicExpression$2.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/LogicExpression.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/LogicExpression.class deleted file mode 100644 index 8fa99243b..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/LogicExpression.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/LogicExpression.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/LogicExpression.java deleted file mode 100644 index bddd3d786..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/LogicExpression.java +++ /dev/null @@ -1,89 +0,0 @@ -/** - * 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.filter; - -import javax.jms.JMSException; - -/** - * A filter performing a comparison of two objects - * - * - */ -public abstract class LogicExpression extends BinaryExpression implements BooleanExpression { - - /** - * @param left - * @param right - */ - public LogicExpression(BooleanExpression left, BooleanExpression right) { - super(left, right); - } - - public static BooleanExpression createOR(BooleanExpression lvalue, BooleanExpression rvalue) { - return new LogicExpression(lvalue, rvalue) { - - public Object evaluate(MessageEvaluationContext message) throws JMSException { - - Boolean lv = (Boolean)left.evaluate(message); - // Can we do an OR shortcut?? - if (lv != null && lv.booleanValue()) { - return Boolean.TRUE; - } - - Boolean rv = (Boolean)right.evaluate(message); - return rv == null ? null : rv; - } - - public String getExpressionSymbol() { - return "OR"; - } - }; - } - - public static BooleanExpression createAND(BooleanExpression lvalue, BooleanExpression rvalue) { - return new LogicExpression(lvalue, rvalue) { - - public Object evaluate(MessageEvaluationContext message) throws JMSException { - - Boolean lv = (Boolean)left.evaluate(message); - - // Can we do an AND shortcut?? - if (lv == null) { - return null; - } - if (!lv.booleanValue()) { - return Boolean.FALSE; - } - - Boolean rv = (Boolean)right.evaluate(message); - return rv == null ? null : rv; - } - - public String getExpressionSymbol() { - return "AND"; - } - }; - } - - public abstract Object evaluate(MessageEvaluationContext message) throws JMSException; - - public boolean matches(MessageEvaluationContext message) throws JMSException { - Object object = evaluate(message); - return object != null && object == Boolean.TRUE; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/MessageEvaluationContext.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/MessageEvaluationContext.class deleted file mode 100644 index 70143e1a7..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/MessageEvaluationContext.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/MessageEvaluationContext.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/MessageEvaluationContext.java deleted file mode 100644 index 5f85c9f14..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/MessageEvaluationContext.java +++ /dev/null @@ -1,99 +0,0 @@ -/** - * 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.filter; - -import java.io.IOException; - -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.Message; - -/** - * MessageEvaluationContext is used to cache selection results. A message - * usually has multiple selectors applied against it. Some selector have a high - * cost of evaluating against the message. Those selectors may whish to cache - * evaluation results associated with the message in the - * MessageEvaluationContext. - * - * - */ -public class MessageEvaluationContext { - - protected MessageReference messageReference; - protected boolean loaded; - protected boolean dropped; - protected Message message; - protected ActiveMQDestination destination; - - public MessageEvaluationContext() { - } - - public boolean isDropped() throws IOException { - getMessage(); - return dropped; - } - - public Message getMessage() throws IOException { - if (!dropped && !loaded) { - loaded = true; - messageReference.incrementReferenceCount(); - message = messageReference.getMessage(); - if (message == null) { - messageReference.decrementReferenceCount(); - dropped = true; - loaded = false; - } - } - return message; - } - - public void setMessageReference(MessageReference messageReference) { - if (this.messageReference != messageReference) { - clearMessageCache(); - } - this.messageReference = messageReference; - } - - public void clear() { - clearMessageCache(); - destination = null; - } - - public ActiveMQDestination getDestination() { - return destination; - } - - public void setDestination(ActiveMQDestination destination) { - this.destination = destination; - } - - /** - * A strategy hook to allow per-message caches to be cleared - */ - protected void clearMessageCache() { - if (loaded) { - messageReference.decrementReferenceCount(); - } - message = null; - dropped = false; - loaded = false; - } - - public MessageReference getMessageReference() { - return messageReference; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/MultiExpressionEvaluator$CacheExpression.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/MultiExpressionEvaluator$CacheExpression.class deleted file mode 100644 index 4388bc6e0..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/MultiExpressionEvaluator$CacheExpression.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/MultiExpressionEvaluator$ExpressionListener.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/MultiExpressionEvaluator$ExpressionListener.class deleted file mode 100644 index a5c6a4579..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/MultiExpressionEvaluator$ExpressionListener.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/MultiExpressionEvaluator$ExpressionListenerSet.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/MultiExpressionEvaluator$ExpressionListenerSet.class deleted file mode 100644 index 4463cbeac..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/MultiExpressionEvaluator$ExpressionListenerSet.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/MultiExpressionEvaluator.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/MultiExpressionEvaluator.class deleted file mode 100644 index dd7849a96..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/MultiExpressionEvaluator.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/MultiExpressionEvaluator.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/MultiExpressionEvaluator.java deleted file mode 100644 index 1bc041b66..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/MultiExpressionEvaluator.java +++ /dev/null @@ -1,259 +0,0 @@ -/** - * 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.filter; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.jms.JMSException; - -/** - * A MultiExpressionEvaluator is used to evaluate multiple expressions in single - * method call.

    Multiple Expression/ExpressionListener pairs can be added - * to a MultiExpressionEvaluator object. When the MultiExpressionEvaluator - * object is evaluated, all the registed Expressions are evaluated and then the - * associated ExpressionListener is invoked to inform it of the evaluation - * result.

    By evaluating multiple expressions at one time, some - * optimizations can be made to reduce the number of computations normally - * required to evaluate all the expressions.

    When this class adds an - * Expression it wrapps each node in the Expression's AST with a CacheExpression - * object. Then each CacheExpression object (one for each node) is placed in the - * cachedExpressions map. The cachedExpressions map allows us to find the sub - * expressions that are common across two different expressions. When adding an - * Expression in, if a sub Expression of the Expression is allready in the - * cachedExpressions map, then instead of wrapping the sub expression in a new - * CacheExpression object, we reuse the CacheExpression allready int the map. - *

    To help illustrate what going on, lets try to give an exmample: If we - * denote the AST of a Expression as follows: - * [AST-Node-Type,Left-Node,Right-Node], then A expression like: "3*5+6" would - * result in "[*,3,[+,5,6]]"

    If the [*,3,[+,5,6]] expression is added to - * the MultiExpressionEvaluator, it would really be converted to: - * [c0,[*,3,[c1,[+,5,6]]]] where c0 and c1 represent the CacheExpression - * expression objects that cache the results of the * and the + operation. - * Constants and Property nodes are not cached.

    If later on we add the - * following expression [=,11,[+,5,6]] ("11=5+6") to the - * MultiExpressionEvaluator it would be converted to: [c2,[=,11,[c1,[+,5,6]]]], - * where c2 is a new CacheExpression object but c1 is the same CacheExpression - * used in the previous expression.

    When the expressions are evaluated, the - * c1 CacheExpression object will only evaluate the [+,5,6] expression once and - * cache the resulting value. Hence evauating the second expression costs less - * because that [+,5,6] is not done 2 times.

    Problems: - cacheing the - * values introduces overhead. It may be possible to be smarter about WHICH - * nodes in the AST are cached and which are not. - Current implementation is - * not thread safe. This is because you need a way to invalidate all the cached - * values so that the next evaluation re-evaluates the nodes. By going single - * threaded, chache invalidation is done quickly by incrementing a 'view' - * counter. When a CacheExpressionnotices it's last cached value was generated - * in an old 'view', it invalidates its cached value. - * - * $Date: 2005/08/27 03:52:36 $ - */ -public class MultiExpressionEvaluator { - - Map rootExpressions = new HashMap(); - Map cachedExpressions = new HashMap(); - - int view; - - /** - * A UnaryExpression that caches the result of the nested expression. The - * cached value is valid if the - * CacheExpression.cview==MultiExpressionEvaluator.view - */ - public class CacheExpression extends UnaryExpression { - short refCount; - int cview = view - 1; - Object cachedValue; - int cachedHashCode; - - public CacheExpression(Expression realExpression) { - super(realExpression); - cachedHashCode = realExpression.hashCode(); - } - - /** - * @see org.apache.activemq.filter.Expression#evaluate(MessageEvaluationContext) - */ - public Object evaluate(MessageEvaluationContext message) throws JMSException { - if (view == cview) { - return cachedValue; - } - cachedValue = right.evaluate(message); - cview = view; - return cachedValue; - } - - public int hashCode() { - return cachedHashCode; - } - - public boolean equals(Object o) { - if (o == null) { - return false; - } - return ((CacheExpression)o).right.equals(right); - } - - public String getExpressionSymbol() { - return null; - } - - public String toString() { - return right.toString(); - } - - } - - /** - * Multiple listeners my be interested in the results of a single - * expression. - */ - static class ExpressionListenerSet { - Expression expression; - List listeners = new ArrayList(); - } - - /** - * Objects that are interested in the results of an expression should - * implement this interface. - */ - static interface ExpressionListener { - void evaluateResultEvent(Expression selector, MessageEvaluationContext message, Object result); - } - - /** - * Adds an ExpressionListener to a given expression. When evaluate is - * called, the ExpressionListener will be provided the results of the - * Expression applied to the evaluated message. - */ - public void addExpressionListner(Expression selector, ExpressionListener c) { - ExpressionListenerSet data = rootExpressions.get(selector.toString()); - if (data == null) { - data = new ExpressionListenerSet(); - data.expression = addToCache(selector); - rootExpressions.put(selector.toString(), data); - } - data.listeners.add(c); - } - - /** - * Removes an ExpressionListener from receiving the results of a given - * evaluation. - */ - public boolean removeEventListner(String selector, ExpressionListener c) { - String expKey = selector; - ExpressionListenerSet d = rootExpressions.get(expKey); - // that selector had not been added. - if (d == null) { - return false; - } - // that selector did not have that listeners.. - if (!d.listeners.remove(c)) { - return false; - } - - // If there are no more listeners for this expression.... - if (d.listeners.size() == 0) { - // Un-cache it... - removeFromCache((CacheExpression)d.expression); - rootExpressions.remove(expKey); - } - return true; - } - - /** - * Finds the CacheExpression that has been associated with an expression. If - * it is the first time the Expression is being added to the Cache, a new - * CacheExpression is created and associated with the expression.

    This - * method updates the reference counters on the CacheExpression to know when - * it is no longer needed. - */ - private CacheExpression addToCache(Expression expr) { - - CacheExpression n = cachedExpressions.get(expr); - if (n == null) { - n = new CacheExpression(expr); - cachedExpressions.put(expr, n); - if (expr instanceof UnaryExpression) { - - // Cache the sub expressions too - UnaryExpression un = (UnaryExpression)expr; - un.setRight(addToCache(un.getRight())); - - } else if (expr instanceof BinaryExpression) { - - // Cache the sub expressions too. - BinaryExpression bn = (BinaryExpression)expr; - bn.setRight(addToCache(bn.getRight())); - bn.setLeft(addToCache(bn.getLeft())); - - } - } - n.refCount++; - return n; - } - - /** - * Removes an expression from the cache. Updates the reference counters on - * the CacheExpression object. When the refernce counter goes to zero, the - * entry int the Expression to CacheExpression map is removed. - * - * @param cn - */ - private void removeFromCache(CacheExpression cn) { - cn.refCount--; - Expression realExpr = cn.getRight(); - if (cn.refCount == 0) { - cachedExpressions.remove(realExpr); - } - if (realExpr instanceof UnaryExpression) { - UnaryExpression un = (UnaryExpression)realExpr; - removeFromCache((CacheExpression)un.getRight()); - } - if (realExpr instanceof BinaryExpression) { - BinaryExpression bn = (BinaryExpression)realExpr; - removeFromCache((CacheExpression)bn.getRight()); - } - } - - /** - * Evaluates the message against all the Expressions added to this object. - * The added ExpressionListeners are notified of the result of the - * evaluation. - * - * @param message - */ - public void evaluate(MessageEvaluationContext message) { - Collection expressionListeners = rootExpressions.values(); - for (Iterator iter = expressionListeners.iterator(); iter.hasNext();) { - ExpressionListenerSet els = iter.next(); - try { - Object result = els.expression.evaluate(message); - for (Iterator iterator = els.listeners.iterator(); iterator.hasNext();) { - ExpressionListener l = iterator.next(); - l.evaluateResultEvent(els.expression, message, result); - } - } catch (Throwable e) { - e.printStackTrace(); - } - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/NoLocalExpression.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/NoLocalExpression.class deleted file mode 100644 index ff1849990..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/NoLocalExpression.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/NoLocalExpression.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/NoLocalExpression.java deleted file mode 100644 index deba0a3f2..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/NoLocalExpression.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * 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.filter; - -import java.io.IOException; - -import javax.jms.JMSException; - -import org.apache.activemq.util.JMSExceptionSupport; - -public class NoLocalExpression implements BooleanExpression { - - private final String connectionId; - - public NoLocalExpression(String connectionId) { - this.connectionId = connectionId; - } - - public boolean matches(MessageEvaluationContext message) throws JMSException { - try { - if (message.isDropped()) { - return false; - } - String messageConnectionId = message.getMessage().getProducerId().getConnectionId(); - return !connectionId.equals(messageConnectionId); - } catch (IOException e) { - throw JMSExceptionSupport.create(e); - } - } - - public Object evaluate(MessageEvaluationContext message) throws JMSException { - return matches(message) ? Boolean.TRUE : Boolean.FALSE; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/NonCachedMessageEvaluationContext.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/NonCachedMessageEvaluationContext.class deleted file mode 100644 index 2563b83b0..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/NonCachedMessageEvaluationContext.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/NonCachedMessageEvaluationContext.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/NonCachedMessageEvaluationContext.java deleted file mode 100644 index 46427b024..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/NonCachedMessageEvaluationContext.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.apache.activemq.filter; -/** - * 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. - */ -import java.io.IOException; - -import org.apache.activemq.broker.region.MessageReference; -import org.apache.activemq.command.Message; - -/** - * NonCached version of the MessageEvaluationContext - * - * - */ -public class NonCachedMessageEvaluationContext extends MessageEvaluationContext { - - - public Message getMessage() throws IOException { - return messageReference != null ? messageReference.getMessage():null; - } - - public void setMessageReference(MessageReference messageReference) { - this.messageReference = messageReference; - } - - - protected void clearMessageCache() { - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PrefixDestinationFilter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PrefixDestinationFilter.class deleted file mode 100644 index e737373de..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PrefixDestinationFilter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PrefixDestinationFilter.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PrefixDestinationFilter.java deleted file mode 100644 index abe7530f8..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PrefixDestinationFilter.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * 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.filter; - -import org.apache.activemq.command.ActiveMQDestination; - - -/** - * Matches messages which match a prefix like "A.B.>" - * - * - */ -public class PrefixDestinationFilter extends DestinationFilter { - - private String[] prefixes; - private byte destinationType; - - /** - * An array of paths, the last path is '>' - * - * @param prefixes - */ - public PrefixDestinationFilter(String[] prefixes, byte destinationType) { - this.prefixes = prefixes; - this.destinationType = destinationType; - } - - public boolean matches(ActiveMQDestination destination) { - if (destination.getDestinationType() != destinationType) return false; - String[] path = DestinationPath.getDestinationPaths(destination.getPhysicalName()); - int length = prefixes.length; - if (path.length >= length) { - int size = length - 1; - for (int i = 0; i < size; i++) { - if (!path[i].equals(ANY_CHILD) && !prefixes[i].equals(ANY_CHILD) && !prefixes[i].equals(path[i])) { - return false; - } - } - return true; - } - return false; - } - - public String getText() { - return DestinationPath.toString(prefixes); - } - - public String toString() { - return super.toString() + "[destination: " + getText() + "]"; - } - - public boolean isWildcard() { - return true; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$1.class deleted file mode 100644 index 04b9d21d5..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$10.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$10.class deleted file mode 100644 index 5f3a4473c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$10.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$11.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$11.class deleted file mode 100644 index ac70c9cfc..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$11.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$12.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$12.class deleted file mode 100644 index 7c735bf91..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$12.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$13.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$13.class deleted file mode 100644 index 954c0a1d1..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$13.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$14.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$14.class deleted file mode 100644 index f2e0cd997..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$14.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$15.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$15.class deleted file mode 100644 index 1d3ce4d84..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$15.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$16.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$16.class deleted file mode 100644 index 1a15e093a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$16.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$17.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$17.class deleted file mode 100644 index 54a0a58dd..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$17.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$18.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$18.class deleted file mode 100644 index 509395112..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$18.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$19.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$19.class deleted file mode 100644 index f006dd521..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$19.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$2.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$2.class deleted file mode 100644 index f35d1cc48..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$2.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$3.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$3.class deleted file mode 100644 index 027c30450..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$3.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$4.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$4.class deleted file mode 100644 index 8e7fcb53f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$4.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$5.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$5.class deleted file mode 100644 index aaddaed3f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$5.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$6.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$6.class deleted file mode 100644 index 0148445b6..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$6.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$7.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$7.class deleted file mode 100644 index 18c06430c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$7.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$8.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$8.class deleted file mode 100644 index a6ecd8b36..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$8.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$9.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$9.class deleted file mode 100644 index d1d38a2d1..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$9.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$SubExpression.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$SubExpression.class deleted file mode 100644 index 5b9b5be83..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression$SubExpression.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression.class deleted file mode 100644 index ec8c2a48a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression.java deleted file mode 100644 index 964a81d69..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/PropertyExpression.java +++ /dev/null @@ -1,278 +0,0 @@ -/** - * 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.filter; - -import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -import javax.jms.JMSException; - -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.Message; -import org.apache.activemq.command.TransactionId; -import org.apache.activemq.util.JMSExceptionSupport; - -/** - * Represents a property expression - */ -public class PropertyExpression implements Expression { - - private static final Map JMS_PROPERTY_EXPRESSIONS = new HashMap(); - - interface SubExpression { - Object evaluate(Message message); - } - - static { - JMS_PROPERTY_EXPRESSIONS.put("JMSDestination", new SubExpression() { - - @Override - public Object evaluate(Message message) { - ActiveMQDestination dest = message.getOriginalDestination(); - if (dest == null) { - dest = message.getDestination(); - } - if (dest == null) { - return null; - } - return dest.toString(); - } - }); - JMS_PROPERTY_EXPRESSIONS.put("JMSReplyTo", new SubExpression() { - - @Override - public Object evaluate(Message message) { - if (message.getReplyTo() == null) { - return null; - } - return message.getReplyTo().toString(); - } - }); - JMS_PROPERTY_EXPRESSIONS.put("JMSType", new SubExpression() { - - @Override - public Object evaluate(Message message) { - return message.getType(); - } - }); - JMS_PROPERTY_EXPRESSIONS.put("JMSDeliveryMode", new SubExpression() { - - @Override - public Object evaluate(Message message) { - return message.isPersistent() ? "PERSISTENT" : "NON_PERSISTENT"; - } - }); - JMS_PROPERTY_EXPRESSIONS.put("JMSPriority", new SubExpression() { - - @Override - public Object evaluate(Message message) { - return Integer.valueOf(message.getPriority()); - } - }); - JMS_PROPERTY_EXPRESSIONS.put("JMSMessageID", new SubExpression() { - - @Override - public Object evaluate(Message message) { - if (message.getMessageId() == null) { - return null; - } - return message.getMessageId().toString(); - } - }); - JMS_PROPERTY_EXPRESSIONS.put("JMSTimestamp", new SubExpression() { - - @Override - public Object evaluate(Message message) { - return Long.valueOf(message.getTimestamp()); - } - }); - JMS_PROPERTY_EXPRESSIONS.put("JMSCorrelationID", new SubExpression() { - - @Override - public Object evaluate(Message message) { - return message.getCorrelationId(); - } - }); - JMS_PROPERTY_EXPRESSIONS.put("JMSExpiration", new SubExpression() { - - @Override - public Object evaluate(Message message) { - return Long.valueOf(message.getExpiration()); - } - }); - JMS_PROPERTY_EXPRESSIONS.put("JMSRedelivered", new SubExpression() { - - @Override - public Object evaluate(Message message) { - return Boolean.valueOf(message.isRedelivered()); - } - }); - JMS_PROPERTY_EXPRESSIONS.put("JMSXDeliveryCount", new SubExpression() { - - @Override - public Object evaluate(Message message) { - return Integer.valueOf(message.getRedeliveryCounter() + 1); - } - }); - JMS_PROPERTY_EXPRESSIONS.put("JMSXGroupID", new SubExpression() { - - @Override - public Object evaluate(Message message) { - return message.getGroupID(); - } - }); - JMS_PROPERTY_EXPRESSIONS.put("JMSXUserID", new SubExpression() { - - @Override - public Object evaluate(Message message) { - Object userId = message.getUserID(); - if (userId == null) { - try { - userId = message.getProperty("JMSXUserID"); - } catch (IOException e) { - } - } - - return userId; - } - }); - JMS_PROPERTY_EXPRESSIONS.put("JMSXGroupSeq", new SubExpression() { - - @Override - public Object evaluate(Message message) { - return new Integer(message.getGroupSequence()); - } - }); - JMS_PROPERTY_EXPRESSIONS.put("JMSXProducerTXID", new SubExpression() { - - @Override - public Object evaluate(Message message) { - TransactionId txId = message.getOriginalTransactionId(); - if (txId == null) { - txId = message.getTransactionId(); - } - if (txId == null) { - return null; - } - return txId.toString(); - } - }); - JMS_PROPERTY_EXPRESSIONS.put("JMSActiveMQBrokerInTime", new SubExpression() { - - @Override - public Object evaluate(Message message) { - return Long.valueOf(message.getBrokerInTime()); - } - }); - JMS_PROPERTY_EXPRESSIONS.put("JMSActiveMQBrokerOutTime", new SubExpression() { - - @Override - public Object evaluate(Message message) { - return Long.valueOf(message.getBrokerOutTime()); - } - }); - JMS_PROPERTY_EXPRESSIONS.put("JMSActiveMQBrokerPath", new SubExpression() { - - @Override - public Object evaluate(Message message) { - return Arrays.toString(message.getBrokerPath()); - } - }); - JMS_PROPERTY_EXPRESSIONS.put("JMSXGroupFirstForConsumer", new SubExpression() { - - @Override - public Object evaluate(Message message) { - return Boolean.valueOf(message.isJMSXGroupFirstForConsumer()); - } - }); - } - - private final String name; - private final SubExpression jmsPropertyExpression; - - public PropertyExpression(String name) { - this.name = name; - jmsPropertyExpression = JMS_PROPERTY_EXPRESSIONS.get(name); - } - - @Override - public Object evaluate(MessageEvaluationContext message) throws JMSException { - try { - if (message.isDropped()) { - return null; - } - - if (jmsPropertyExpression != null) { - return jmsPropertyExpression.evaluate(message.getMessage()); - } - try { - return message.getMessage().getProperty(name); - } catch (IOException ioe) { - throw JMSExceptionSupport.create("Could not get property: " + name + " reason: " + ioe.getMessage(), ioe); - } - } catch (IOException e) { - throw JMSExceptionSupport.create(e); - } - - } - - public Object evaluate(Message message) throws JMSException { - if (jmsPropertyExpression != null) { - return jmsPropertyExpression.evaluate(message); - } - try { - return message.getProperty(name); - } catch (IOException ioe) { - throw JMSExceptionSupport.create(ioe); - } - } - - public String getName() { - return name; - } - - /** - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - return name; - } - - /** - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - return name.hashCode(); - } - - /** - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(Object o) { - - if (o == null || !this.getClass().equals(o.getClass())) { - return false; - } - return name.equals(((PropertyExpression) o).name); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/SimpleDestinationFilter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/SimpleDestinationFilter.class deleted file mode 100644 index 21def108e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/SimpleDestinationFilter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/SimpleDestinationFilter.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/SimpleDestinationFilter.java deleted file mode 100644 index 3195f4c1c..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/SimpleDestinationFilter.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * 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.filter; - -import org.apache.activemq.command.ActiveMQDestination; - - -/** - * Matches messages sent to an exact destination - * - * - */ -public class SimpleDestinationFilter extends DestinationFilter { - - private ActiveMQDestination destination; - - public SimpleDestinationFilter(ActiveMQDestination destination) { - this.destination = destination; - } - - public boolean matches(ActiveMQDestination destination) { - return this.destination.equals(destination); - } - - public boolean isWildcard() { - return false; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/UnaryExpression$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/UnaryExpression$1.class deleted file mode 100644 index 83649e250..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/UnaryExpression$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/UnaryExpression$2.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/UnaryExpression$2.class deleted file mode 100644 index 7c5a986a1..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/UnaryExpression$2.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/UnaryExpression$3.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/UnaryExpression$3.class deleted file mode 100644 index 6f9f6e32c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/UnaryExpression$3.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/UnaryExpression$4.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/UnaryExpression$4.class deleted file mode 100644 index 198c8c30e..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/UnaryExpression$4.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/UnaryExpression$BooleanUnaryExpression.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/UnaryExpression$BooleanUnaryExpression.class deleted file mode 100644 index 305a0a5f3..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/UnaryExpression$BooleanUnaryExpression.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/UnaryExpression.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/UnaryExpression.class deleted file mode 100644 index a67875acc..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/UnaryExpression.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/UnaryExpression.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/UnaryExpression.java deleted file mode 100644 index 9002a2cd1..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/UnaryExpression.java +++ /dev/null @@ -1,257 +0,0 @@ -/** - * 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.filter; - -import java.math.BigDecimal; -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; - -import javax.jms.JMSException; - -/** - * An expression which performs an operation on two expression values - * - * - */ -public abstract class UnaryExpression implements Expression { - - private static final BigDecimal BD_LONG_MIN_VALUE = BigDecimal.valueOf(Long.MIN_VALUE); - protected Expression right; - - public UnaryExpression(Expression left) { - this.right = left; - } - - public static Expression createNegate(Expression left) { - return new UnaryExpression(left) { - public Object evaluate(MessageEvaluationContext message) throws JMSException { - Object rvalue = right.evaluate(message); - if (rvalue == null) { - return null; - } - if (rvalue instanceof Number) { - return negate((Number)rvalue); - } - return null; - } - - public String getExpressionSymbol() { - return "-"; - } - }; - } - - public static BooleanExpression createInExpression(PropertyExpression right, List elements, final boolean not) { - - // Use a HashSet if there are many elements. - Collection t; - if (elements.size() == 0) { - t = null; - } else if (elements.size() < 5) { - t = elements; - } else { - t = new HashSet(elements); - } - final Collection inList = t; - - return new BooleanUnaryExpression(right) { - public Object evaluate(MessageEvaluationContext message) throws JMSException { - - Object rvalue = right.evaluate(message); - if (rvalue == null) { - return null; - } - if (rvalue.getClass() != String.class) { - return null; - } - - if ((inList != null && inList.contains(rvalue)) ^ not) { - return Boolean.TRUE; - } else { - return Boolean.FALSE; - } - - } - - public String toString() { - StringBuffer answer = new StringBuffer(); - answer.append(right); - answer.append(" "); - answer.append(getExpressionSymbol()); - answer.append(" ( "); - - int count = 0; - for (Iterator i = inList.iterator(); i.hasNext();) { - Object o = (Object)i.next(); - if (count != 0) { - answer.append(", "); - } - answer.append(o); - count++; - } - - answer.append(" )"); - return answer.toString(); - } - - public String getExpressionSymbol() { - if (not) { - return "NOT IN"; - } else { - return "IN"; - } - } - }; - } - - abstract static class BooleanUnaryExpression extends UnaryExpression implements BooleanExpression { - public BooleanUnaryExpression(Expression left) { - super(left); - } - - public boolean matches(MessageEvaluationContext message) throws JMSException { - Object object = evaluate(message); - return object != null && object == Boolean.TRUE; - } - }; - - public static BooleanExpression createNOT(BooleanExpression left) { - return new BooleanUnaryExpression(left) { - public Object evaluate(MessageEvaluationContext message) throws JMSException { - Boolean lvalue = (Boolean)right.evaluate(message); - if (lvalue == null) { - return null; - } - return lvalue.booleanValue() ? Boolean.FALSE : Boolean.TRUE; - } - - public String getExpressionSymbol() { - return "NOT"; - } - }; - } - - public static BooleanExpression createXPath(final String xpath) { - return new XPathExpression(xpath); - } - - public static BooleanExpression createXQuery(final String xpath) { - return new XQueryExpression(xpath); - } - - public static BooleanExpression createBooleanCast(Expression left) { - return new BooleanUnaryExpression(left) { - public Object evaluate(MessageEvaluationContext message) throws JMSException { - Object rvalue = right.evaluate(message); - if (rvalue == null) { - return null; - } - if (!rvalue.getClass().equals(Boolean.class)) { - return Boolean.FALSE; - } - return ((Boolean)rvalue).booleanValue() ? Boolean.TRUE : Boolean.FALSE; - } - - public String toString() { - return right.toString(); - } - - public String getExpressionSymbol() { - return ""; - } - }; - } - - private static Number negate(Number left) { - Class clazz = left.getClass(); - if (clazz == Integer.class) { - return new Integer(-left.intValue()); - } else if (clazz == Long.class) { - return new Long(-left.longValue()); - } else if (clazz == Float.class) { - return new Float(-left.floatValue()); - } else if (clazz == Double.class) { - return new Double(-left.doubleValue()); - } else if (clazz == BigDecimal.class) { - // We ussually get a big deciamal when we have Long.MIN_VALUE - // constant in the - // Selector. Long.MIN_VALUE is too big to store in a Long as a - // positive so we store it - // as a Big decimal. But it gets Negated right away.. to here we try - // to covert it back - // to a Long. - BigDecimal bd = (BigDecimal)left; - bd = bd.negate(); - - if (BD_LONG_MIN_VALUE.compareTo(bd) == 0) { - return Long.valueOf(Long.MIN_VALUE); - } - return bd; - } else { - throw new RuntimeException("Don't know how to negate: " + left); - } - } - - public Expression getRight() { - return right; - } - - public void setRight(Expression expression) { - right = expression; - } - - /** - * @see java.lang.Object#toString() - */ - public String toString() { - return "(" + getExpressionSymbol() + " " + right.toString() + ")"; - } - - /** - * TODO: more efficient hashCode() - * - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - return toString().hashCode(); - } - - /** - * TODO: more efficient hashCode() - * - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals(Object o) { - - if (o == null || !this.getClass().equals(o.getClass())) { - return false; - } - return toString().equals(o.toString()); - - } - - /** - * Returns the symbol that represents this binary expression. For example, - * addition is represented by "+" - * - * @return - */ - public abstract String getExpressionSymbol(); - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/WildcardDestinationFilter.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/WildcardDestinationFilter.class deleted file mode 100644 index 4e5100b23..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/WildcardDestinationFilter.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/WildcardDestinationFilter.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/WildcardDestinationFilter.java deleted file mode 100644 index f0439afec..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/WildcardDestinationFilter.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - * 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.filter; - -import org.apache.activemq.command.ActiveMQDestination; - - -/** - * Matches messages which contain wildcards like "A.B.*.*" - * - * - */ -public class WildcardDestinationFilter extends DestinationFilter { - - private String[] prefixes; - private byte destinationType; - - /** - * An array of paths containing * characters - * - * @param prefixes - */ - public WildcardDestinationFilter(String[] prefixes, byte destinationType) { - this.prefixes = new String[prefixes.length]; - for (int i = 0; i < prefixes.length; i++) { - String prefix = prefixes[i]; - if (!prefix.equals("*")) { - this.prefixes[i] = prefix; - } - } - this.destinationType = destinationType; - } - - public boolean matches(ActiveMQDestination destination) { - if (destination.getDestinationType() != destinationType) return false; - String[] path = DestinationPath.getDestinationPaths(destination); - int length = prefixes.length; - if (path.length == length) { - for (int i = 0; i < length; i++) { - String prefix = prefixes[i]; - if (prefix != null && !prefix.equals(path[i])) { - return false; - } - } - return true; - } - return false; - } - - - public String getText() { - return DestinationPath.toString(prefixes); - } - - public String toString() { - return super.toString() + "[destination: " + getText() + "]"; - } - - public boolean isWildcard() { - return true; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/XPathExpression$XPathEvaluator.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/XPathExpression$XPathEvaluator.class deleted file mode 100644 index 11856182c..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/XPathExpression$XPathEvaluator.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/XPathExpression.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/XPathExpression.class deleted file mode 100644 index 17ecddddc..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/XPathExpression.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/XPathExpression.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/XPathExpression.java deleted file mode 100644 index c29a31214..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/XPathExpression.java +++ /dev/null @@ -1,121 +0,0 @@ -/** - * 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.filter; - -import java.io.IOException; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; - -import javax.jms.JMSException; - -import org.apache.activemq.command.Message; -import org.apache.activemq.util.JMSExceptionSupport; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Used to evaluate an XPath Expression in a JMS selector. - */ -public final class XPathExpression implements BooleanExpression { - - private static final Logger LOG = LoggerFactory.getLogger(XPathExpression.class); - private static final String EVALUATOR_SYSTEM_PROPERTY = "org.apache.activemq.XPathEvaluatorClassName"; - private static final String DEFAULT_EVALUATOR_CLASS_NAME = "org.apache.activemq.filter.XalanXPathEvaluator"; - - private static final Constructor EVALUATOR_CONSTRUCTOR; - - static { - String cn = System.getProperty(EVALUATOR_SYSTEM_PROPERTY, DEFAULT_EVALUATOR_CLASS_NAME); - Constructor m = null; - try { - try { - m = getXPathEvaluatorConstructor(cn); - } catch (Throwable e) { - LOG.warn("Invalid " + XPathEvaluator.class.getName() + " implementation: " + cn + ", reason: " + e, e); - cn = DEFAULT_EVALUATOR_CLASS_NAME; - try { - m = getXPathEvaluatorConstructor(cn); - } catch (Throwable e2) { - LOG.error("Default XPath evaluator could not be loaded", e); - } - } - } finally { - EVALUATOR_CONSTRUCTOR = m; - } - } - - private final String xpath; - private final XPathEvaluator evaluator; - - public static interface XPathEvaluator { - boolean evaluate(Message message) throws JMSException; - } - - XPathExpression(String xpath) { - this.xpath = xpath; - this.evaluator = createEvaluator(xpath); - } - - private static Constructor getXPathEvaluatorConstructor(String cn) throws ClassNotFoundException, SecurityException, NoSuchMethodException { - Class c = XPathExpression.class.getClassLoader().loadClass(cn); - if (!XPathEvaluator.class.isAssignableFrom(c)) { - throw new ClassCastException("" + c + " is not an instance of " + XPathEvaluator.class); - } - return c.getConstructor(new Class[] {String.class}); - } - - private XPathEvaluator createEvaluator(String xpath2) { - try { - return (XPathEvaluator)EVALUATOR_CONSTRUCTOR.newInstance(new Object[] {xpath}); - } catch (InvocationTargetException e) { - Throwable cause = e.getCause(); - if (cause instanceof RuntimeException) { - throw (RuntimeException)cause; - } - throw new RuntimeException("Invalid XPath Expression: " + xpath + " reason: " + e.getMessage(), e); - } catch (Throwable e) { - throw new RuntimeException("Invalid XPath Expression: " + xpath + " reason: " + e.getMessage(), e); - } - } - - public Object evaluate(MessageEvaluationContext message) throws JMSException { - try { - if (message.isDropped()) { - return null; - } - return evaluator.evaluate(message.getMessage()) ? Boolean.TRUE : Boolean.FALSE; - } catch (IOException e) { - throw JMSExceptionSupport.create(e); - } - - } - - public String toString() { - return "XPATH " + ConstantExpression.encodeString(xpath); - } - - /** - * @param message - * @return true if the expression evaluates to Boolean.TRUE. - * @throws JMSException - */ - public boolean matches(MessageEvaluationContext message) throws JMSException { - Object object = evaluate(message); - return object != null && object == Boolean.TRUE; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/XQueryExpression.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/XQueryExpression.class deleted file mode 100644 index 1fdbac8d4..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/XQueryExpression.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/XQueryExpression.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/XQueryExpression.java deleted file mode 100644 index 5f18cbf2a..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/XQueryExpression.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * 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.filter; - -import javax.jms.JMSException; - -/** - * Used to evaluate an XQuery Expression in a JMS selector. - */ -public final class XQueryExpression implements BooleanExpression { - private final String xpath; - - XQueryExpression(String xpath) { - super(); - this.xpath = xpath; - } - - public Object evaluate(MessageEvaluationContext message) throws JMSException { - return Boolean.FALSE; - } - - public String toString() { - return "XQUERY " + ConstantExpression.encodeString(xpath); - } - - /** - * @param message - * @return true if the expression evaluates to Boolean.TRUE. - * @throws JMSException - */ - public boolean matches(MessageEvaluationContext message) throws JMSException { - Object object = evaluate(message); - return object != null && object == Boolean.TRUE; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/XalanXPathEvaluator.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/XalanXPathEvaluator.class deleted file mode 100644 index e0ccdbb2f..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/XalanXPathEvaluator.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/XalanXPathEvaluator.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/XalanXPathEvaluator.java deleted file mode 100644 index ffb96fa18..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/XalanXPathEvaluator.java +++ /dev/null @@ -1,110 +0,0 @@ -/** - * 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.filter; - -import java.io.StringReader; - -import javax.jms.BytesMessage; -import javax.jms.JMSException; -import javax.jms.TextMessage; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; - -import org.w3c.dom.Document; -import org.w3c.dom.traversal.NodeIterator; -import org.xml.sax.InputSource; - -import org.apache.activemq.command.Message; -import org.apache.activemq.util.ByteArrayInputStream; -import org.apache.xpath.CachedXPathAPI; -import org.apache.xpath.objects.XObject; - - -public class XalanXPathEvaluator implements XPathExpression.XPathEvaluator { - - private final String xpath; - - public XalanXPathEvaluator(String xpath) { - this.xpath = xpath; - } - - public boolean evaluate(Message m) throws JMSException { - if (m instanceof TextMessage) { - String text = ((TextMessage)m).getText(); - return evaluate(text); - } else if (m instanceof BytesMessage) { - BytesMessage bm = (BytesMessage)m; - byte data[] = new byte[(int)bm.getBodyLength()]; - bm.readBytes(data); - return evaluate(data); - } - return false; - } - - private boolean evaluate(byte[] data) { - try { - - InputSource inputSource = new InputSource(new ByteArrayInputStream(data)); - - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - factory.setNamespaceAware(true); - DocumentBuilder dbuilder = factory.newDocumentBuilder(); - Document doc = dbuilder.parse(inputSource); - - CachedXPathAPI cachedXPathAPI = new CachedXPathAPI(); - XObject result = cachedXPathAPI.eval(doc, xpath); - if (result.bool()) - return true; - else { - NodeIterator iterator = cachedXPathAPI.selectNodeIterator(doc, xpath); - return (iterator.nextNode() != null); - } - - } catch (Throwable e) { - return false; - } - } - - private boolean evaluate(String text) { - try { - InputSource inputSource = new InputSource(new StringReader(text)); - - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - factory.setNamespaceAware(true); - DocumentBuilder dbuilder = factory.newDocumentBuilder(); - Document doc = dbuilder.parse(inputSource); - - //An XPath expression could return a true or false value instead of a node. - //eval() is a better way to determine the boolean value of the exp. - //For compliance with legacy behavior where selecting an empty node returns true, - //selectNodeIterator is attempted in case of a failure. - - CachedXPathAPI cachedXPathAPI = new CachedXPathAPI(); - XObject result = cachedXPathAPI.eval(doc, xpath); - if (result.bool()) - return true; - else { - NodeIterator iterator = cachedXPathAPI.selectNodeIterator(doc, xpath); - return (iterator.nextNode() != null); - } - - } catch (Throwable e) { - return false; - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/BuiltinFunctionRegistry.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/BuiltinFunctionRegistry.class deleted file mode 100644 index 36a69207d..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/BuiltinFunctionRegistry.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/BuiltinFunctionRegistry.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/BuiltinFunctionRegistry.java deleted file mode 100644 index f114ca3b7..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/BuiltinFunctionRegistry.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * 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.filter.function; - -import org.apache.activemq.filter.FunctionCallExpression; - -/** - * Registry of built-in functions. Add built-in functions to this list to make sure they are registered at startup. - *

    - * Custom add-ons that are not built-in to the core ActiveMQ should not be listed here. - * Use FunctionCallExpression.registerFunction() directly. - */ - -public class BuiltinFunctionRegistry { - public static void register() { - FunctionCallExpression.registerFunction("INLIST", new inListFunction()); - FunctionCallExpression.registerFunction("MAKELIST", new makeListFunction()); - FunctionCallExpression.registerFunction("REGEX", new regexMatchFunction()); - FunctionCallExpression.registerFunction("REPLACE", new replaceFunction()); - FunctionCallExpression.registerFunction("SPLIT", new splitFunction()); - } -} - diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/FilterFunction.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/FilterFunction.class deleted file mode 100644 index 383cc2577..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/FilterFunction.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/FilterFunction.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/FilterFunction.java deleted file mode 100644 index fae0e3777..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/FilterFunction.java +++ /dev/null @@ -1,61 +0,0 @@ -/** - * 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.filter.function; - -import org.apache.activemq.filter.FunctionCallExpression; -import org.apache.activemq.filter.MessageEvaluationContext; - -/** - * Interface required for objects that will be registered as functions for use in selectors. Handles parse- - * time and evaluation-time operations. - */ - -public interface FilterFunction { - /** - * Check whether the function, as it is used, is valid. Checking arguments here will return errors - * to clients at the time invalid selectors are initially specified, rather than waiting until the selector is - * applied to a message. - * - * @param FunctionCallExpression expr - the full expression of the function call, as used. - * @return true - if the function call is valid; false - otherwise. - */ - public boolean isValid(FunctionCallExpression expr); - - /** - * Determine whether the function, as it will be called, returns a boolean value. Called during - * expression parsing after the full expression for the function call, including its arguments, has - * been parsed. This allows functions with variable return types to function as boolean expressions in - * selectors without sacrificing parse-time checking. - * - * @param FunctionCallExpression expr - the full expression of the function call, as used. - * @return true - if the function returns a boolean value for its use in the given expression; - * false - otherwise. - */ - public boolean returnsBoolean(FunctionCallExpression expr); - - - /** - * Evaluate the function call in the given context. The arguments must be evaluated, as-needed, by the - * function. Note that boolean expressions must return Boolean objects. - * - * @param FunctionCallExpression expr - the full expression of the function call, as used. - * @param MessageEvaluationContext message - the context within which to evaluate the call. - */ - public Object evaluate(FunctionCallExpression expr, MessageEvaluationContext message) - throws javax.jms.JMSException; -} - diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/inListFunction.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/inListFunction.class deleted file mode 100644 index 7a3dd473d..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/inListFunction.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/inListFunction.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/inListFunction.java deleted file mode 100644 index 7fa38abd3..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/inListFunction.java +++ /dev/null @@ -1,93 +0,0 @@ -/** - * 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.filter.function; - -import org.apache.activemq.filter.FunctionCallExpression; -import org.apache.activemq.filter.MessageEvaluationContext; - -/** - * Filter function that matches a value against a list of values and evaluates to an indicator of membership in the - * list. For example: - *

    - *

    - * INLIST( SPLIT('1,2,3', ',') , '2' ) - *

    - *

    - * Note that the first argument must be a List. Strings containing lists are not acceptable; for example, - * INLIST('1,2,3', '1'), will cause an exception to be thrown at evaluation-time. - */ - -public class inListFunction implements FilterFunction { - /** - * Check whether the given expression is a valid call of this function. Two arguments are required. Note that - * the evaluated results of the arguments will be compared with Object#equals(). - * - * @param expr - the expression consisting of a call to this function. - * @return true - if the expression is valid; false - otherwise. - */ - - public boolean isValid(FunctionCallExpression expr) { - if (expr.getNumArguments() != 2) - return false; - - return true; - } - - - /** - * Check whether the given expression, which consists of a call to this function, evaluates to a Boolean. - * If the function can return different more than one type of value at evaluation-time, it must decide whether - * to cast the result to a Boolean at this time. - * - * @param expr - the expression consisting of a call to this function. - * @return true - if the expression is valid; false - otherwise. - */ - - public boolean returnsBoolean(FunctionCallExpression expr) { - return true; - } - - - /** - * Evalutate the given expression, which consists of a call to this function, in the context given. Checks - * whether the second argument is a member of the list in the first argument. - * - * @param expr - the expression consisting of a call to this function. - * @param message_ctx - the context in which the call is being evaluated. - * @return Boolean - the result of the evaluation. - */ - - public Object evaluate(FunctionCallExpression expr, MessageEvaluationContext message_ctx) - throws javax.jms.JMSException { - java.util.List arr; - int cur; - Object cand; - boolean found_f; - - arr = (java.util.List) expr.getArgument(0).evaluate(message_ctx); - cand = expr.getArgument(1).evaluate(message_ctx); - - cur = 0; - found_f = false; - while ((cur < arr.size()) && (!found_f)) { - found_f = arr.get(cur).equals(cand); - cur++; - } - - return Boolean.valueOf(found_f); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/makeListFunction.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/makeListFunction.class deleted file mode 100644 index 47989960b..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/makeListFunction.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/makeListFunction.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/makeListFunction.java deleted file mode 100644 index 7fedd7bda..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/makeListFunction.java +++ /dev/null @@ -1,82 +0,0 @@ -/** - * 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.filter.function; - -import org.apache.activemq.filter.FunctionCallExpression; -import org.apache.activemq.filter.MessageEvaluationContext; - -/** - * Filter function that creates a list with each argument being one element in the list. - * For example: - *

    - *

    - * MAKELIST( '1', '2', '3' ) - *

    - */ - -public class makeListFunction implements FilterFunction { - /** - * Check whether the given expression is a valid call of this function. Any number of arguments is accepted. - * - * @param expr - the expression consisting of a call to this function. - * @return true - if the expression is valid; false - otherwise. - */ - - public boolean isValid(FunctionCallExpression expr) { - return true; - } - - - /** - * Indicate that this function never evaluates to a Boolean result. - * - * @param expr - the expression consisting of a call to this function. - * @return false - this Filter Function never evaluates to a Boolean. - */ - - public boolean returnsBoolean(FunctionCallExpression expr) { - return false; - } - - - /** - * Evalutate the given expression, which consists of a call to this function, in the context given. Creates - * a list containing the evaluated results of its argument expressions. - * - * @param expr - the expression consisting of a call to this function. - * @param message_ctx - the context in which the call is being evaluated. - * @return java.util.List - the result of the evaluation. - */ - - public Object evaluate(FunctionCallExpression expr, MessageEvaluationContext message) - throws javax.jms.JMSException { - java.util.ArrayList ele_arr; - int num_arg; - int cur; - - num_arg = expr.getNumArguments(); - ele_arr = new java.util.ArrayList(num_arg); - - cur = 0; - while (cur < num_arg) { - ele_arr.add(expr.getArgument(cur).evaluate(message)); - cur++; - } - - return (java.util.List) ele_arr; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/package.html b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/package.html deleted file mode 100644 index 3fa6fdec7..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/package.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - -

    - Filter Function implementations for JMS Selectors. -

    - - - diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/regexMatchFunction.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/regexMatchFunction.class deleted file mode 100644 index 459aa5cb3..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/regexMatchFunction.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/regexMatchFunction.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/regexMatchFunction.java deleted file mode 100644 index c9b32c9fd..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/regexMatchFunction.java +++ /dev/null @@ -1,166 +0,0 @@ -/** - * 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.filter.function; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import org.apache.activemq.filter.FunctionCallExpression; -import org.apache.activemq.filter.MessageEvaluationContext; -import org.apache.activemq.util.LRUCache; - -/** - * Filter function that matches a value against a regular expression. - *

    - *

    - * REGEX( 'A.B', 'A-B' ) - *

    - *

    - * Note that the regular expression is not anchored; use the anchor characters, ^ and $, as-needed. For example, - * REGEX( 'AA', 'XAAX' ) evaluates to true while REGEX( '^AA$' , 'XAAX' ) evaluates to false. - */ - -public class regexMatchFunction implements FilterFunction { - protected static final LRUCache compiledExprCache = new LRUCache(100); - - /** - * Check whether the given expression is a valid call of this function. Two arguments are required. When - * evaluated, the arguments are converted to strings if they are not already strings. - * - * @param expr - the expression consisting of a call to this function. - * @return true - if the expression is valid; false - otherwise. - */ - - public boolean isValid(FunctionCallExpression expr) { - if (expr.getNumArguments() == 2) - return true; - - return false; - } - - - /** - * Indicate that this Filter Function evaluates to a Boolean result. - * - * @param expr - the expression consisting of a call to this function. - * @return true - this function always evaluates to a Boolean result. - */ - - public boolean returnsBoolean(FunctionCallExpression expr) { - return true; - } - - /** - * Evalutate the given expression, which consists of a call to this function, in the context given. Returns - * an indication of whether the second argument matches the regular expression in the first argument. - * - * @param expr - the expression consisting of a call to this function. - * @param message_ctx - the context in which the call is being evaluated. - * @return true - if the value matches the regular expression; false - otherwise. - */ - - public Object evaluate(FunctionCallExpression expr, MessageEvaluationContext message) - throws javax.jms.JMSException { - Object reg; - Object cand; - String reg_str; - String cand_str; - Pattern pat; - Matcher match_eng; - - // - // Evaluate the first argument (the regular expression). - // - reg = expr.getArgument(0).evaluate(message); - - if (reg != null) { - // Convert to a string, if it's not already a string. - if (reg instanceof String) - reg_str = (String) reg; - else - reg_str = reg.toString(); - - - // - // Evaluate the second argument (the candidate to match against the regular - // expression). - // - cand = expr.getArgument(1).evaluate(message); - - if (cand != null) { - // Convert to a string, if it's not already a string. - if (cand instanceof String) - cand_str = (String) cand; - else - cand_str = cand.toString(); - - - // - // Obtain the compiled regular expression and match it. - // - - pat = getCompiledPattern(reg_str); - match_eng = pat.matcher(cand_str); - - - // - // Return an indication of whether the regular expression matches at any - // point in the candidate (see Matcher#find()). - // - - return Boolean.valueOf(match_eng.find()); - } - } - - return Boolean.FALSE; - } - - - /** - * Retrieve a compiled pattern for the given pattern string. A cache of recently used strings is maintained to - * improve performance. - * - * @param reg_ex_str - the string specifying the regular expression. - * @return Pattern - compiled form of the regular expression. - */ - - protected Pattern getCompiledPattern(String reg_ex_str) { - Pattern result; - - // - // Look for the compiled pattern in the cache. - // - - synchronized (compiledExprCache) { - result = compiledExprCache.get(reg_ex_str); - } - - - // - // If it was not found, compile it and add it to the cache. - // - - if (result == null) { - result = Pattern.compile(reg_ex_str); - - synchronized (compiledExprCache) { - compiledExprCache.put(reg_ex_str, result); - } - } - - return result; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/replaceFunction.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/replaceFunction.class deleted file mode 100644 index af0904658..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/replaceFunction.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/replaceFunction.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/replaceFunction.java deleted file mode 100644 index 503c8b60d..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/replaceFunction.java +++ /dev/null @@ -1,84 +0,0 @@ -/** - * 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.filter.function; - -import org.apache.activemq.filter.FunctionCallExpression; -import org.apache.activemq.filter.MessageEvaluationContext; - -/** - * Function which replaces regular expression matches in a source string to a replacement literal. - *

    - * For Example: - * REPLACE('1,2/3', '[,/]', ';') returns '1;2;3' - */ - -public class replaceFunction implements FilterFunction { - /** - * Check whether the given expression is valid for this function. - * - * @param expr - the expression consisting of a call to this function. - * @return true - if three arguments are passed to the function; false - otherwise. - */ - - public boolean isValid(FunctionCallExpression expr) { - if (expr.getNumArguments() == 3) - return true; - - return false; - } - - - /** - * Indicate that this function does not return a boolean value. - * - * @param expr - the expression consisting of a call to this function. - * @return false - this filter function always evaluates to a string. - */ - - public boolean returnsBoolean(FunctionCallExpression expr) { - return false; - } - - - /** - * Evaluate the given expression for this function in the given context. The result of the evaluation is a - * string with all matches of the regular expression, from the evaluation of the second argument, replaced by - * the string result from the evaluation of the third argument. Replacement is performed by - * String#replaceAll(). - *

    - * Note that all three arguments must be Strings. - * - * @param expr - the expression consisting of a call to this function. - * @return String - the result of the replacement. - */ - - public Object evaluate(FunctionCallExpression expr, MessageEvaluationContext message_ctx) - throws javax.jms.JMSException { - String src; - String match_regex; - String repl_lit; - String result; - - src = (String) expr.getArgument(0).evaluate(message_ctx); - match_regex = (String) expr.getArgument(1).evaluate(message_ctx); - repl_lit = (String) expr.getArgument(2).evaluate(message_ctx); - - result = src.replaceAll(match_regex, repl_lit); - - return result; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/splitFunction.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/splitFunction.class deleted file mode 100644 index 83f41edb4..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/splitFunction.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/splitFunction.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/splitFunction.java deleted file mode 100644 index c87105ed1..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/function/splitFunction.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * 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.filter.function; - -import org.apache.activemq.filter.FunctionCallExpression; -import org.apache.activemq.filter.MessageEvaluationContext; - -/** - * Function which splits a string into a list of strings given a regular expression for the separator. - */ - -public class splitFunction implements FilterFunction { - /** - * Check whether the given expression is valid for this function. - * - * @param expr - the expression consisting of a call to this function. - * @return true - if two or three arguments are passed to the function; false - otherwise. - */ - - public boolean isValid(FunctionCallExpression expr) { - if ((expr.getNumArguments() >= 2) && (expr.getNumArguments() <= 3)) - return true; - - return false; - } - - - /** - * Indicate that this function does not return a boolean value. - * - * @param expr - the expression consisting of a call to this function. - * @return false - indicating this filter function never evaluates to a boolean result. - */ - - public boolean returnsBoolean(FunctionCallExpression expr) { - return false; - } - - - /** - * Evaluate the given expression for this function in the given context. A list of zero or more strings - * results from the evaluation. The result of the evaluation of the first argument is split with the regular - * expression which results from the evaluation of the second argument. If a third argument is given, it - * is an integer which limits the split. String#split() performs the split. - *

    - * The first two arguments must be Strings. If a third is given, it must be an Integer. - * - * @param expr - the expression consisting of a call to this function. - * @return List - a list of Strings resulting from the split. - */ - - public Object evaluate(FunctionCallExpression expr, MessageEvaluationContext message_ctx) - throws javax.jms.JMSException { - String src; - String split_pat; - String[] result; - - src = (String) expr.getArgument(0).evaluate(message_ctx); - split_pat = (String) expr.getArgument(1).evaluate(message_ctx); - - if (expr.getNumArguments() > 2) { - Integer limit; - - limit = (Integer) expr.getArgument(2).evaluate(message_ctx); - - result = src.split(split_pat, limit.intValue()); - } else { - result = src.split(split_pat); - } - - return java.util.Arrays.asList(result); - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/package.html b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/package.html deleted file mode 100644 index 836ddd925..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/filter/package.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - -

    - Filter implementations for wildcards & JMS selectors -

    - - - diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/hooks/SpringContextHook.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/hooks/SpringContextHook.class deleted file mode 100644 index ffb9612cd..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/hooks/SpringContextHook.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/hooks/SpringContextHook.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/hooks/SpringContextHook.java deleted file mode 100644 index e22a3d82f..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/hooks/SpringContextHook.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * 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.hooks; - -import org.springframework.beans.BeansException; -import org.springframework.context.ApplicationContext; -import org.springframework.context.ApplicationContextAware; -import org.springframework.context.ConfigurableApplicationContext; - -public class SpringContextHook implements Runnable, ApplicationContextAware { - - ApplicationContext applicationContext; - - public void run() { - if (applicationContext instanceof ConfigurableApplicationContext) { - ((ConfigurableApplicationContext) applicationContext).close(); - } - } - - public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { - this.applicationContext = applicationContext; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/hooks/osgi/SpringOsgiContextHook.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/hooks/osgi/SpringOsgiContextHook.class deleted file mode 100644 index b6133b06a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/hooks/osgi/SpringOsgiContextHook.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/hooks/osgi/SpringOsgiContextHook.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/hooks/osgi/SpringOsgiContextHook.java deleted file mode 100644 index 45c7bec52..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/hooks/osgi/SpringOsgiContextHook.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * 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.hooks.osgi; - -import org.osgi.framework.BundleException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.BeansException; -import org.springframework.context.ApplicationContext; -import org.springframework.context.ApplicationContextAware; -import org.springframework.context.ConfigurableApplicationContext; -import org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext; - -public class SpringOsgiContextHook implements Runnable, ApplicationContextAware { - - private static final transient Logger LOG = LoggerFactory.getLogger(SpringOsgiContextHook.class); - ApplicationContext applicationContext; - - public void run() { - if (applicationContext instanceof ConfigurableApplicationContext) { - ((ConfigurableApplicationContext) applicationContext).close(); - } - if (applicationContext instanceof OsgiBundleXmlApplicationContext){ - try { - ((OsgiBundleXmlApplicationContext)applicationContext).getBundle().stop(); - } catch (BundleException e) { - LOG.info("Error stopping OSGi bundle " + e, e); - } - } - - } - - public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { - this.applicationContext = applicationContext; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jaas/CertificateCallback.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jaas/CertificateCallback.java deleted file mode 100644 index 692764af5..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jaas/CertificateCallback.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * 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.jaas; - -import java.security.cert.X509Certificate; - -import javax.security.auth.callback.Callback; - -/** - * A Callback for SSL certificates. - * - * Will return a certificate chain to its client. - * - * @author sepandm@gmail.com (Sepand) - * - */ -public class CertificateCallback implements Callback { - X509Certificate certificates[]; - - /** - * Setter for certificate chain. - * - * @param certs The certificates to be returned. - */ - public void setCertificates(X509Certificate certs[]) { - certificates = certs; - } - - /** - * Getter for certificate chain. - * - * @return The certificates being carried. - */ - public X509Certificate[] getCertificates() { - return certificates; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jaas/CertificateLoginModule.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jaas/CertificateLoginModule.java deleted file mode 100644 index 7f00ed017..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jaas/CertificateLoginModule.java +++ /dev/null @@ -1,188 +0,0 @@ -/** - * 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.jaas; - -import java.io.IOException; -import java.security.Principal; -import java.security.cert.X509Certificate; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; - -import javax.security.auth.Subject; -import javax.security.auth.callback.Callback; -import javax.security.auth.callback.CallbackHandler; -import javax.security.auth.callback.UnsupportedCallbackException; -import javax.security.auth.login.FailedLoginException; -import javax.security.auth.login.LoginException; -import javax.security.auth.spi.LoginModule; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * A LoginModule that allows for authentication based on SSL certificates. - * Allows for subclasses to define methods used to verify user certificates and - * find user groups. Uses CertificateCallbacks to retrieve certificates. - * - * @author sepandm@gmail.com (Sepand) - */ -public abstract class CertificateLoginModule implements LoginModule { - - private static final Logger LOG = LoggerFactory.getLogger(CertificateLoginModule.class); - - private CallbackHandler callbackHandler; - private Subject subject; - - private X509Certificate certificates[]; - private String username; - private Set groups; - private Set principals = new HashSet(); - private boolean debug; - - /** - * Overriding to allow for proper initialization. Standard JAAS. - */ - @Override - public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options) { - this.subject = subject; - this.callbackHandler = callbackHandler; - - debug = "true".equalsIgnoreCase((String)options.get("debug")); - - if (debug) { - LOG.debug("Initialized debug"); - } - } - - /** - * Overriding to allow for certificate-based login. Standard JAAS. - */ - @Override - public boolean login() throws LoginException { - Callback[] callbacks = new Callback[1]; - - callbacks[0] = new CertificateCallback(); - try { - callbackHandler.handle(callbacks); - } catch (IOException ioe) { - throw new LoginException(ioe.getMessage()); - } catch (UnsupportedCallbackException uce) { - throw new LoginException(uce.getMessage() + " Unable to obtain client certificates."); - } - certificates = ((CertificateCallback)callbacks[0]).getCertificates(); - - username = getUserNameForCertificates(certificates); - if (username == null) { - throw new FailedLoginException("No user for client certificate: " + getDistinguishedName(certificates)); - } - - groups = getUserGroups(username); - - if (debug) { - LOG.debug("Certificate for user: " + username); - } - return true; - } - - /** - * Overriding to complete login process. Standard JAAS. - */ - @Override - public boolean commit() throws LoginException { - principals.add(new UserPrincipal(username)); - - for (String group : groups) { - principals.add(new GroupPrincipal(group)); - } - - subject.getPrincipals().addAll(principals); - - clear(); - - if (debug) { - LOG.debug("commit"); - } - return true; - } - - /** - * Standard JAAS override. - */ - @Override - public boolean abort() throws LoginException { - clear(); - - if (debug) { - LOG.debug("abort"); - } - return true; - } - - /** - * Standard JAAS override. - */ - @Override - public boolean logout() { - subject.getPrincipals().removeAll(principals); - principals.clear(); - - if (debug) { - LOG.debug("logout"); - } - return true; - } - - /** - * Helper method. - */ - private void clear() { - groups.clear(); - certificates = null; - } - - /** - * Should return a unique name corresponding to the certificates given. The - * name returned will be used to look up access levels as well as group - * associations. - * - * @param certs The distinguished name. - * @return The unique name if the certificate is recognized, null otherwise. - */ - protected abstract String getUserNameForCertificates(final X509Certificate[] certs) throws LoginException; - - /** - * Should return a set of the groups this user belongs to. The groups - * returned will be added to the user's credentials. - * - * @param username The username of the client. This is the same name that - * getUserNameForDn returned for the user's DN. - * @return A Set of the names of the groups this user belongs to. - */ - protected abstract Set getUserGroups(final String username) throws LoginException; - - protected String getDistinguishedName(final X509Certificate[] certs) { - if (certs != null && certs.length > 0 && certs[0] != null) { - return certs[0].getSubjectDN().getName(); - } else { - return null; - } - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jaas/GroupPrincipal.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jaas/GroupPrincipal.java deleted file mode 100644 index 89b5971a4..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jaas/GroupPrincipal.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * 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.jaas; - -import java.security.Principal; - -/** - * @version $Rev: $ $Date: $ - */ -public class GroupPrincipal implements Principal { - - private final String name; - private transient int hash; - - public GroupPrincipal(String name) { - if (name == null) { - throw new IllegalArgumentException("name cannot be null"); - } - this.name = name; - } - - @Override - public String getName() { - return name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - - final GroupPrincipal that = (GroupPrincipal)o; - - if (!name.equals(that.name)) { - return false; - } - - return true; - } - - @Override - public int hashCode() { - if (hash == 0) { - hash = name.hashCode(); - } - return hash; - } - - @Override - public String toString() { - return name; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jaas/GuestLoginModule.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jaas/GuestLoginModule.java deleted file mode 100644 index 621083de1..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jaas/GuestLoginModule.java +++ /dev/null @@ -1,134 +0,0 @@ -/** - * 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.jaas; - -import java.io.IOException; -import java.security.Principal; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import javax.security.auth.Subject; -import javax.security.auth.callback.Callback; -import javax.security.auth.callback.CallbackHandler; -import javax.security.auth.callback.PasswordCallback; -import javax.security.auth.callback.UnsupportedCallbackException; -import javax.security.auth.login.LoginException; -import javax.security.auth.spi.LoginModule; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Always login the user with a default 'guest' identity. - * - * Useful for unauthenticated communication channels being used in the - * same broker as authenticated ones. - * - */ -public class GuestLoginModule implements LoginModule { - - private static final String GUEST_USER = "org.apache.activemq.jaas.guest.user"; - private static final String GUEST_GROUP = "org.apache.activemq.jaas.guest.group"; - - private static final Logger LOG = LoggerFactory.getLogger(GuestLoginModule.class); - - - private String userName = "guest"; - private String groupName = "guests"; - private Subject subject; - private boolean debug; - private boolean credentialsInvalidate; - private Set principals = new HashSet(); - private CallbackHandler callbackHandler; - private boolean loginSucceeded; - - @Override - public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options) { - this.subject = subject; - this.callbackHandler = callbackHandler; - debug = "true".equalsIgnoreCase((String)options.get("debug")); - credentialsInvalidate = "true".equalsIgnoreCase((String)options.get("credentialsInvalidate")); - if (options.get(GUEST_USER) != null) { - userName = (String)options.get(GUEST_USER); - } - if (options.get(GUEST_GROUP) != null) { - groupName = (String)options.get(GUEST_GROUP); - } - principals.add(new UserPrincipal(userName)); - principals.add(new GroupPrincipal(groupName)); - - if (debug) { - LOG.debug("Initialized debug=" + debug + " guestUser=" + userName + " guestGroup=" + groupName); - } - - } - - @Override - public boolean login() throws LoginException { - loginSucceeded = true; - if (credentialsInvalidate) { - PasswordCallback passwordCallback = new PasswordCallback("Password: ", false); - try { - callbackHandler.handle(new Callback[]{passwordCallback}); - if (passwordCallback.getPassword() != null) { - if (debug) { - LOG.debug("Guest login failing (credentialsInvalidate=true) on presence of a password"); - } - loginSucceeded = false; - passwordCallback.clearPassword(); - }; - } catch (IOException ioe) { - } catch (UnsupportedCallbackException uce) { - } - } - if (debug) { - LOG.debug("Guest login " + loginSucceeded); - } - return loginSucceeded; - } - - @Override - public boolean commit() throws LoginException { - if (loginSucceeded) { - subject.getPrincipals().addAll(principals); - } - - if (debug) { - LOG.debug("commit"); - } - return loginSucceeded; - } - - @Override - public boolean abort() throws LoginException { - - if (debug) { - LOG.debug("abort"); - } - return true; - } - - @Override - public boolean logout() throws LoginException { - subject.getPrincipals().removeAll(principals); - - if (debug) { - LOG.debug("logout"); - } - return true; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jaas/JaasCertificateCallbackHandler.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jaas/JaasCertificateCallbackHandler.java deleted file mode 100644 index 77c84b516..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jaas/JaasCertificateCallbackHandler.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * 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.jaas; - -import java.io.IOException; -import java.security.cert.X509Certificate; - -import javax.security.auth.callback.Callback; -import javax.security.auth.callback.CallbackHandler; -import javax.security.auth.callback.UnsupportedCallbackException; - -/** - * A Standard JAAS callback handler for SSL certificate requests. Will only - * handle callbacks of type CertificateCallback. - * - * @author sepandm@gmail.com (Sepand) - */ -public class JaasCertificateCallbackHandler implements CallbackHandler { - final X509Certificate certificates[]; - - /** - * Basic constructor. - * - * @param certs The certificate returned when calling back. - */ - public JaasCertificateCallbackHandler(X509Certificate certs[]) { - certificates = certs; - } - - /** - * Overriding handle method to handle certificates. - * - * @param callbacks The callbacks requested. - * @throws IOException - * @throws UnsupportedCallbackException Thrown if an unkown Callback type is - * encountered. - */ - @Override - public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { - for (int i = 0; i < callbacks.length; i++) { - Callback callback = callbacks[i]; - if (callback instanceof CertificateCallback) { - CertificateCallback certCallback = (CertificateCallback)callback; - - certCallback.setCertificates(certificates); - - } else { - throw new UnsupportedCallbackException(callback); - } - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jaas/JassCredentialCallbackHandler.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jaas/JassCredentialCallbackHandler.java deleted file mode 100644 index 3208d7749..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jaas/JassCredentialCallbackHandler.java +++ /dev/null @@ -1,61 +0,0 @@ -/** - * 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.jaas; - -import java.io.IOException; - -import javax.security.auth.callback.Callback; -import javax.security.auth.callback.CallbackHandler; -import javax.security.auth.callback.NameCallback; -import javax.security.auth.callback.PasswordCallback; -import javax.security.auth.callback.UnsupportedCallbackException; - -/** - * A JASS username password CallbackHandler. - */ -public class JassCredentialCallbackHandler implements CallbackHandler { - - private final String username; - private final String password; - - public JassCredentialCallbackHandler(String username, String password) { - this.username = username; - this.password = password; - } - - @Override - public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { - for (int i = 0; i < callbacks.length; i++) { - Callback callback = callbacks[i]; - if (callback instanceof PasswordCallback) { - PasswordCallback passwordCallback = (PasswordCallback)callback; - if (password == null) { - passwordCallback.setPassword(null); - } else { - passwordCallback.setPassword(password.toCharArray()); - } - } else if (callback instanceof NameCallback) { - NameCallback nameCallback = (NameCallback)callback; - if (username == null) { - nameCallback.setName(null); - } else { - nameCallback.setName(username); - } - } - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jaas/LDAPLoginModule.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jaas/LDAPLoginModule.java deleted file mode 100644 index 4bced6578..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jaas/LDAPLoginModule.java +++ /dev/null @@ -1,461 +0,0 @@ -/** - * 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.jaas; - -import java.io.IOException; -import java.security.Principal; -import java.text.MessageFormat; -import java.util.*; - -import javax.naming.*; -import javax.naming.directory.Attribute; -import javax.naming.directory.Attributes; -import javax.naming.directory.DirContext; -import javax.naming.directory.InitialDirContext; -import javax.naming.directory.SearchControls; -import javax.naming.directory.SearchResult; -import javax.security.auth.Subject; -import javax.security.auth.callback.Callback; -import javax.security.auth.callback.CallbackHandler; -import javax.security.auth.callback.NameCallback; -import javax.security.auth.callback.PasswordCallback; -import javax.security.auth.callback.UnsupportedCallbackException; -import javax.security.auth.login.FailedLoginException; -import javax.security.auth.login.LoginException; -import javax.security.auth.spi.LoginModule; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @version $Rev: $ $Date: $ - */ -public class LDAPLoginModule implements LoginModule { - - private static final String INITIAL_CONTEXT_FACTORY = "initialContextFactory"; - private static final String CONNECTION_URL = "connectionURL"; - private static final String CONNECTION_USERNAME = "connectionUsername"; - private static final String CONNECTION_PASSWORD = "connectionPassword"; - private static final String CONNECTION_PROTOCOL = "connectionProtocol"; - private static final String AUTHENTICATION = "authentication"; - private static final String USER_BASE = "userBase"; - private static final String USER_SEARCH_MATCHING = "userSearchMatching"; - private static final String USER_SEARCH_SUBTREE = "userSearchSubtree"; - private static final String ROLE_BASE = "roleBase"; - private static final String ROLE_NAME = "roleName"; - private static final String ROLE_SEARCH_MATCHING = "roleSearchMatching"; - private static final String ROLE_SEARCH_SUBTREE = "roleSearchSubtree"; - private static final String USER_ROLE_NAME = "userRoleName"; - private static final String EXPAND_ROLES = "expandRoles"; - private static final String EXPAND_ROLES_MATCHING = "expandRolesMatching"; - - private static Logger log = LoggerFactory.getLogger(LDAPLoginModule.class); - - protected DirContext context; - - private Subject subject; - private CallbackHandler handler; - private LDAPLoginProperty [] config; - private String username; - private Set groups = new HashSet(); - - @Override - public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options) { - this.subject = subject; - this.handler = callbackHandler; - - config = new LDAPLoginProperty [] { - new LDAPLoginProperty (INITIAL_CONTEXT_FACTORY, (String)options.get(INITIAL_CONTEXT_FACTORY)), - new LDAPLoginProperty (CONNECTION_URL, (String)options.get(CONNECTION_URL)), - new LDAPLoginProperty (CONNECTION_USERNAME, (String)options.get(CONNECTION_USERNAME)), - new LDAPLoginProperty (CONNECTION_PASSWORD, (String)options.get(CONNECTION_PASSWORD)), - new LDAPLoginProperty (CONNECTION_PROTOCOL, (String)options.get(CONNECTION_PROTOCOL)), - new LDAPLoginProperty (AUTHENTICATION, (String)options.get(AUTHENTICATION)), - new LDAPLoginProperty (USER_BASE, (String)options.get(USER_BASE)), - new LDAPLoginProperty (USER_SEARCH_MATCHING, (String)options.get(USER_SEARCH_MATCHING)), - new LDAPLoginProperty (USER_SEARCH_SUBTREE, (String)options.get(USER_SEARCH_SUBTREE)), - new LDAPLoginProperty (ROLE_BASE, (String)options.get(ROLE_BASE)), - new LDAPLoginProperty (ROLE_NAME, (String)options.get(ROLE_NAME)), - new LDAPLoginProperty (ROLE_SEARCH_MATCHING, (String)options.get(ROLE_SEARCH_MATCHING)), - new LDAPLoginProperty (ROLE_SEARCH_SUBTREE, (String)options.get(ROLE_SEARCH_SUBTREE)), - new LDAPLoginProperty (USER_ROLE_NAME, (String)options.get(USER_ROLE_NAME)), - new LDAPLoginProperty (EXPAND_ROLES, (String) options.get(EXPAND_ROLES)), - new LDAPLoginProperty (EXPAND_ROLES_MATCHING, (String) options.get(EXPAND_ROLES_MATCHING)), - - }; - } - - @Override - public boolean login() throws LoginException { - - Callback[] callbacks = new Callback[2]; - - callbacks[0] = new NameCallback("User name"); - callbacks[1] = new PasswordCallback("Password", false); - try { - handler.handle(callbacks); - } catch (IOException ioe) { - throw (LoginException)new LoginException().initCause(ioe); - } catch (UnsupportedCallbackException uce) { - throw (LoginException)new LoginException().initCause(uce); - } - - String password; - - username = ((NameCallback)callbacks[0]).getName(); - if (username == null) - return false; - - if (((PasswordCallback)callbacks[1]).getPassword() != null) - password = new String(((PasswordCallback)callbacks[1]).getPassword()); - else - password=""; - - // authenticate will throw LoginException - // in case of failed authentication - authenticate(username, password); - return true; - } - - @Override - public boolean logout() throws LoginException { - username = null; - return true; - } - - @Override - public boolean commit() throws LoginException { - Set principals = subject.getPrincipals(); - principals.add(new UserPrincipal(username)); - for (GroupPrincipal gp : groups) { - principals.add(gp); - } - return true; - } - - @Override - public boolean abort() throws LoginException { - username = null; - return true; - } - - protected void close(DirContext context) { - try { - context.close(); - } catch (Exception e) { - log.error(e.toString()); - } - } - - protected boolean authenticate(String username, String password) throws LoginException { - - MessageFormat userSearchMatchingFormat; - boolean userSearchSubtreeBool; - - DirContext context = null; - - if (log.isDebugEnabled()) { - log.debug("Create the LDAP initial context."); - } - try { - context = open(); - } catch (NamingException ne) { - FailedLoginException ex = new FailedLoginException("Error opening LDAP connection"); - ex.initCause(ne); - throw ex; - } - - if (!isLoginPropertySet(USER_SEARCH_MATCHING)) - return false; - - userSearchMatchingFormat = new MessageFormat(getLDAPPropertyValue(USER_SEARCH_MATCHING)); - userSearchSubtreeBool = Boolean.valueOf(getLDAPPropertyValue(USER_SEARCH_SUBTREE)).booleanValue(); - - try { - - String filter = userSearchMatchingFormat.format(new String[] { - username - }); - SearchControls constraints = new SearchControls(); - if (userSearchSubtreeBool) { - constraints.setSearchScope(SearchControls.SUBTREE_SCOPE); - } else { - constraints.setSearchScope(SearchControls.ONELEVEL_SCOPE); - } - - // setup attributes - List list = new ArrayList(); - if (isLoginPropertySet(USER_ROLE_NAME)) { - list.add(getLDAPPropertyValue(USER_ROLE_NAME)); - } - String[] attribs = new String[list.size()]; - list.toArray(attribs); - constraints.setReturningAttributes(attribs); - - if (log.isDebugEnabled()) { - log.debug("Get the user DN."); - log.debug("Looking for the user in LDAP with "); - log.debug(" base DN: " + getLDAPPropertyValue(USER_BASE)); - log.debug(" filter: " + filter); - } - - NamingEnumeration results = context.search(getLDAPPropertyValue(USER_BASE), filter, constraints); - - if (results == null || !results.hasMore()) { - log.warn("User " + username + " not found in LDAP."); - throw new FailedLoginException("User " + username + " not found in LDAP."); - } - - SearchResult result = results.next(); - - if (results.hasMore()) { - // ignore for now - } - NameParser parser = context.getNameParser(""); - Name contextName = parser.parse(context.getNameInNamespace()); - Name baseName = parser.parse(getLDAPPropertyValue(USER_BASE)); - Name entryName = parser.parse(result.getName()); - Name name = contextName.addAll(baseName); - name = name.addAll(entryName); - String dn = name.toString(); - - Attributes attrs = result.getAttributes(); - if (attrs == null) { - throw new FailedLoginException("User found, but LDAP entry malformed: " + username); - } - List roles = null; - if (isLoginPropertySet(USER_ROLE_NAME)) { - roles = addAttributeValues(getLDAPPropertyValue(USER_ROLE_NAME), attrs, roles); - } - - // check the credentials by binding to server - if (bindUser(context, dn, password)) { - // if authenticated add more roles - roles = getRoles(context, dn, username, roles); - if (log.isDebugEnabled()) { - log.debug("Roles " + roles + " for user " + username); - } - for (int i = 0; i < roles.size(); i++) { - groups.add(new GroupPrincipal(roles.get(i))); - } - } else { - throw new FailedLoginException("Password does not match for user: " + username); - } - } catch (CommunicationException e) { - FailedLoginException ex = new FailedLoginException("Error contacting LDAP"); - ex.initCause(e); - throw ex; - } catch (NamingException e) { - if (context != null) { - close(context); - } - FailedLoginException ex = new FailedLoginException("Error contacting LDAP"); - ex.initCause(e); - throw ex; - } - - return true; - } - - protected List getRoles(DirContext context, String dn, String username, List currentRoles) throws NamingException { - List list = currentRoles; - MessageFormat roleSearchMatchingFormat; - boolean roleSearchSubtreeBool; - boolean expandRolesBool; - roleSearchMatchingFormat = new MessageFormat(getLDAPPropertyValue(ROLE_SEARCH_MATCHING)); - roleSearchSubtreeBool = Boolean.valueOf(getLDAPPropertyValue(ROLE_SEARCH_SUBTREE)).booleanValue(); - expandRolesBool = Boolean.valueOf(getLDAPPropertyValue(EXPAND_ROLES)).booleanValue(); - - if (list == null) { - list = new ArrayList(); - } - if (!isLoginPropertySet(ROLE_NAME)) { - return list; - } - String filter = roleSearchMatchingFormat.format(new String[] { - doRFC2254Encoding(dn), username - }); - - SearchControls constraints = new SearchControls(); - if (roleSearchSubtreeBool) { - constraints.setSearchScope(SearchControls.SUBTREE_SCOPE); - } else { - constraints.setSearchScope(SearchControls.ONELEVEL_SCOPE); - } - if (log.isDebugEnabled()) { - log.debug("Get user roles."); - log.debug("Looking for the user roles in LDAP with "); - log.debug(" base DN: " + getLDAPPropertyValue(ROLE_BASE)); - log.debug(" filter: " + filter); - } - HashSet haveSeenNames = new HashSet(); - Queue pendingNameExpansion = new LinkedList(); - NamingEnumeration results = context.search(getLDAPPropertyValue(ROLE_BASE), filter, constraints); - while (results.hasMore()) { - SearchResult result = results.next(); - Attributes attrs = result.getAttributes(); - if (expandRolesBool) { - haveSeenNames.add(result.getNameInNamespace()); - pendingNameExpansion.add(result.getNameInNamespace()); - } - if (attrs == null) { - continue; - } - list = addAttributeValues(getLDAPPropertyValue(ROLE_NAME), attrs, list); - } - if (expandRolesBool) { - MessageFormat expandRolesMatchingFormat = new MessageFormat(getLDAPPropertyValue(EXPAND_ROLES_MATCHING)); - while (!pendingNameExpansion.isEmpty()) { - String name = pendingNameExpansion.remove(); - filter = expandRolesMatchingFormat.format(new String[]{name}); - results = context.search(getLDAPPropertyValue(ROLE_BASE), filter, constraints); - while (results.hasMore()) { - SearchResult result = results.next(); - name = result.getNameInNamespace(); - if (!haveSeenNames.contains(name)) { - Attributes attrs = result.getAttributes(); - list = addAttributeValues(getLDAPPropertyValue(ROLE_NAME), attrs, list); - haveSeenNames.add(name); - pendingNameExpansion.add(name); - } - } - } - } - return list; - } - - protected String doRFC2254Encoding(String inputString) { - StringBuffer buf = new StringBuffer(inputString.length()); - for (int i = 0; i < inputString.length(); i++) { - char c = inputString.charAt(i); - switch (c) { - case '\\': - buf.append("\\5c"); - break; - case '*': - buf.append("\\2a"); - break; - case '(': - buf.append("\\28"); - break; - case ')': - buf.append("\\29"); - break; - case '\0': - buf.append("\\00"); - break; - default: - buf.append(c); - break; - } - } - return buf.toString(); - } - - protected boolean bindUser(DirContext context, String dn, String password) throws NamingException { - boolean isValid = false; - - if (log.isDebugEnabled()) { - log.debug("Binding the user."); - } - context.addToEnvironment(Context.SECURITY_PRINCIPAL, dn); - context.addToEnvironment(Context.SECURITY_CREDENTIALS, password); - try { - context.getAttributes("", null); - isValid = true; - if (log.isDebugEnabled()) { - log.debug("User " + dn + " successfully bound."); - } - } catch (AuthenticationException e) { - isValid = false; - if (log.isDebugEnabled()) { - log.debug("Authentication failed for dn=" + dn); - } - } - - if (isLoginPropertySet(CONNECTION_USERNAME)) { - context.addToEnvironment(Context.SECURITY_PRINCIPAL, getLDAPPropertyValue(CONNECTION_USERNAME)); - } else { - context.removeFromEnvironment(Context.SECURITY_PRINCIPAL); - } - if (isLoginPropertySet(CONNECTION_PASSWORD)) { - context.addToEnvironment(Context.SECURITY_CREDENTIALS, getLDAPPropertyValue(CONNECTION_PASSWORD)); - } else { - context.removeFromEnvironment(Context.SECURITY_CREDENTIALS); - } - - return isValid; - } - - private List addAttributeValues(String attrId, Attributes attrs, List values) throws NamingException { - - if (attrId == null || attrs == null) { - return values; - } - if (values == null) { - values = new ArrayList(); - } - Attribute attr = attrs.get(attrId); - if (attr == null) { - return values; - } - NamingEnumeration e = attr.getAll(); - while (e.hasMore()) { - String value = (String)e.next(); - values.add(value); - } - return values; - } - - protected DirContext open() throws NamingException { - try { - Hashtable env = new Hashtable(); - env.put(Context.INITIAL_CONTEXT_FACTORY, getLDAPPropertyValue(INITIAL_CONTEXT_FACTORY)); - if (isLoginPropertySet(CONNECTION_USERNAME)) { - env.put(Context.SECURITY_PRINCIPAL, getLDAPPropertyValue(CONNECTION_USERNAME)); - } - if (isLoginPropertySet(CONNECTION_PASSWORD)) { - env.put(Context.SECURITY_CREDENTIALS, getLDAPPropertyValue(CONNECTION_PASSWORD)); - } - env.put(Context.SECURITY_PROTOCOL, getLDAPPropertyValue(CONNECTION_PROTOCOL)); - env.put(Context.PROVIDER_URL, getLDAPPropertyValue(CONNECTION_URL)); - env.put(Context.SECURITY_AUTHENTICATION, getLDAPPropertyValue(AUTHENTICATION)); - context = new InitialDirContext(env); - - } catch (NamingException e) { - log.error(e.toString()); - throw e; - } - return context; - } - - private String getLDAPPropertyValue (String propertyName){ - for (int i=0; i < config.length; i++ ) - if (config[i].getPropertyName() == propertyName) - return config[i].getPropertyValue(); - return null; - } - - private boolean isLoginPropertySet(String propertyName) { - for (int i=0; i < config.length; i++ ) { - if (config[i].getPropertyName() == propertyName && config[i].getPropertyValue() != null) - return true; - } - return false; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jaas/LDAPLoginProperty.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jaas/LDAPLoginProperty.java deleted file mode 100644 index 39c7397bf..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jaas/LDAPLoginProperty.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * 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.jaas; - -public class LDAPLoginProperty { - private String name; - private String value; - - public LDAPLoginProperty(String name) { - this.name = name; - } - - public LDAPLoginProperty(String name, String value) { - this.name = name; - this.value = value; - } - - public String getPropertyName() { - return this.name; - } - public String getPropertyValue() { - return this.value; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jaas/PrincipalProperties.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jaas/PrincipalProperties.java deleted file mode 100644 index 601d0ccca..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jaas/PrincipalProperties.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * 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.jaas; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.Map; -import java.util.Properties; -import java.util.Set; - -import org.slf4j.Logger; - -class PrincipalProperties { - private final Properties principals; - private final long reloadTime; - - PrincipalProperties(final String type, final File source, final Logger log) { - Properties props = new Properties(); - long reloadTime = 0; - try { - load(source, props); - reloadTime = System.currentTimeMillis(); - } catch (IOException ioe) { - log.warn("Unable to load " + type + " properties file " + source); - } - this.reloadTime = reloadTime; - this.principals = props; - } - - @SuppressWarnings({ "unchecked", "rawtypes" }) - Set> entries() { - return (Set) principals.entrySet(); - } - - String getProperty(String name) { - return principals.getProperty(name); - } - - long getReloadTime() { - return reloadTime; - } - - private void load(final File source, Properties props) throws FileNotFoundException, IOException { - FileInputStream in = new FileInputStream(source); - try { - props.load(in); - } finally { - in.close(); - } - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jaas/PropertiesLoginModule.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jaas/PropertiesLoginModule.java deleted file mode 100644 index cc0d84702..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jaas/PropertiesLoginModule.java +++ /dev/null @@ -1,204 +0,0 @@ -/** - * 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.jaas; - -import java.io.File; -import java.io.IOException; -import java.security.Principal; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -import javax.security.auth.Subject; -import javax.security.auth.callback.Callback; -import javax.security.auth.callback.CallbackHandler; -import javax.security.auth.callback.NameCallback; -import javax.security.auth.callback.PasswordCallback; -import javax.security.auth.callback.UnsupportedCallbackException; -import javax.security.auth.login.FailedLoginException; -import javax.security.auth.login.LoginException; -import javax.security.auth.spi.LoginModule; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class PropertiesLoginModule implements LoginModule { - - private static final String USER_FILE = "org.apache.activemq.jaas.properties.user"; - private static final String GROUP_FILE = "org.apache.activemq.jaas.properties.group"; - - private static final Logger LOG = LoggerFactory.getLogger(PropertiesLoginModule.class); - - private Subject subject; - private CallbackHandler callbackHandler; - - private boolean debug; - private boolean reload = false; - private static volatile PrincipalProperties users; - private static volatile PrincipalProperties groups; - private String user; - private final Set principals = new HashSet(); - private File baseDir; - private boolean loginSucceeded; - - @Override - public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options) { - this.subject = subject; - this.callbackHandler = callbackHandler; - loginSucceeded = false; - - debug = "true".equalsIgnoreCase((String) options.get("debug")); - if (options.get("reload") != null) { - reload = "true".equalsIgnoreCase((String) options.get("reload")); - } - - if (options.get("baseDir") != null) { - baseDir = new File((String) options.get("baseDir")); - } - - setBaseDir(); - String usersFile = (String) options.get(USER_FILE) + ""; - File uf = baseDir != null ? new File(baseDir, usersFile) : new File(usersFile); - - if (reload || users == null || uf.lastModified() > users.getReloadTime()) { - if (debug) { - LOG.debug("Reloading users from " + uf.getAbsolutePath()); - } - users = new PrincipalProperties("user", uf, LOG); - } - - String groupsFile = (String) options.get(GROUP_FILE) + ""; - File gf = baseDir != null ? new File(baseDir, groupsFile) : new File(groupsFile); - if (reload || groups == null || gf.lastModified() > groups.getReloadTime()) { - if (debug) { - LOG.debug("Reloading groups from " + gf.getAbsolutePath()); - } - groups = new PrincipalProperties("group", gf, LOG); - } - } - - private void setBaseDir() { - if (baseDir == null) { - if (System.getProperty("java.security.auth.login.config") != null) { - baseDir = new File(System.getProperty("java.security.auth.login.config")).getParentFile(); - if (debug) { - LOG.debug("Using basedir=" + baseDir.getAbsolutePath()); - } - } - } - } - - @Override - public boolean login() throws LoginException { - Callback[] callbacks = new Callback[2]; - - callbacks[0] = new NameCallback("Username: "); - callbacks[1] = new PasswordCallback("Password: ", false); - try { - callbackHandler.handle(callbacks); - } catch (IOException ioe) { - throw new LoginException(ioe.getMessage()); - } catch (UnsupportedCallbackException uce) { - throw new LoginException(uce.getMessage() + " not available to obtain information from user"); - } - user = ((NameCallback) callbacks[0]).getName(); - char[] tmpPassword = ((PasswordCallback) callbacks[1]).getPassword(); - if (tmpPassword == null) { - tmpPassword = new char[0]; - } - if (user == null) { - throw new FailedLoginException("user name is null"); - } - String password = users.getProperty(user); - - if (password == null) { - throw new FailedLoginException("User does exist"); - } - if (!password.equals(new String(tmpPassword))) { - throw new FailedLoginException("Password does not match"); - } - loginSucceeded = true; - - if (debug) { - LOG.debug("login " + user); - } - return loginSucceeded; - } - - @Override - public boolean commit() throws LoginException { - boolean result = loginSucceeded; - if (result) { - principals.add(new UserPrincipal(user)); - - for (Map.Entry entry : groups.entries()) { - String name = entry.getKey(); - String[] userList = entry.getValue().split(","); - for (int i = 0; i < userList.length; i++) { - if (user.equals(userList[i])) { - principals.add(new GroupPrincipal(name)); - break; - } - } - } - - subject.getPrincipals().addAll(principals); - } - - // will whack loginSucceeded - clear(); - - if (debug) { - LOG.debug("commit, result: " + result); - } - return result; - } - - @Override - public boolean abort() throws LoginException { - clear(); - - if (debug) { - LOG.debug("abort"); - } - return true; - } - - @Override - public boolean logout() throws LoginException { - subject.getPrincipals().removeAll(principals); - principals.clear(); - clear(); - if (debug) { - LOG.debug("logout"); - } - return true; - } - - private void clear() { - user = null; - loginSucceeded = false; - } - - /** - * For test-usage only. - */ - static void resetUsersAndGroupsCache() { - users = null; - groups = null; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jaas/TextFileCertificateLoginModule.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jaas/TextFileCertificateLoginModule.java deleted file mode 100644 index be00562a0..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jaas/TextFileCertificateLoginModule.java +++ /dev/null @@ -1,147 +0,0 @@ -/** - * 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.jaas; - -import java.io.File; -import java.io.IOException; -import java.security.cert.X509Certificate; -import java.util.Enumeration; -import java.util.HashSet; -import java.util.Map; -import java.util.Properties; -import java.util.Set; - -import javax.security.auth.Subject; -import javax.security.auth.callback.CallbackHandler; -import javax.security.auth.login.LoginException; - -/** - * A LoginModule allowing for SSL certificate based authentication based on - * Distinguished Names (DN) stored in text files. The DNs are parsed using a - * Properties class where each line is =. This class also - * uses a group definition file where each line is =,,etc. - * The user and group files' locations must be specified in the - * org.apache.activemq.jaas.textfiledn.user and - * org.apache.activemq.jaas.textfiledn.user properties respectively. NOTE: This - * class will re-read user and group files for every authentication (i.e it does - * live updates of allowed groups and users). - * - * @author sepandm@gmail.com (Sepand) - */ -public class TextFileCertificateLoginModule extends CertificateLoginModule { - - private static final String USER_FILE = "org.apache.activemq.jaas.textfiledn.user"; - private static final String GROUP_FILE = "org.apache.activemq.jaas.textfiledn.group"; - - private File baseDir; - private String usersFilePathname; - private String groupsFilePathname; - - /** - * Performs initialization of file paths. A standard JAAS override. - */ - @Override - public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options) { - super.initialize(subject, callbackHandler, sharedState, options); - if (System.getProperty("java.security.auth.login.config") != null) { - baseDir = new File(System.getProperty("java.security.auth.login.config")).getParentFile(); - } else { - baseDir = new File("."); - } - - usersFilePathname = (String)options.get(USER_FILE) + ""; - groupsFilePathname = (String)options.get(GROUP_FILE) + ""; - } - - /** - * Overriding to allow DN authorization based on DNs specified in text - * files. - * - * @param certs The certificate the incoming connection provided. - * @return The user's authenticated name or null if unable to authenticate - * the user. - * @throws LoginException Thrown if unable to find user file or connection - * certificate. - */ - @Override - protected String getUserNameForCertificates(final X509Certificate[] certs) throws LoginException { - if (certs == null) { - throw new LoginException("Client certificates not found. Cannot authenticate."); - } - - File usersFile = new File(baseDir, usersFilePathname); - - Properties users = new Properties(); - - try { - java.io.FileInputStream in = new java.io.FileInputStream(usersFile); - users.load(in); - in.close(); - } catch (IOException ioe) { - throw new LoginException("Unable to load user properties file " + usersFile); - } - - String dn = getDistinguishedName(certs); - - Enumeration keys = users.keys(); - for (Enumeration vals = users.elements(); vals.hasMoreElements();) { - if (((String)vals.nextElement()).equals(dn)) { - return (String)keys.nextElement(); - } else { - keys.nextElement(); - } - } - - return null; - } - - /** - * Overriding to allow for group discovery based on text files. - * - * @param username The name of the user being examined. This is the same - * name returned by getUserNameForCertificates. - * @return A Set of name Strings for groups this user belongs to. - * @throws LoginException Thrown if unable to find group definition file. - */ - @Override - protected Set getUserGroups(String username) throws LoginException { - File groupsFile = new File(baseDir, groupsFilePathname); - - Properties groups = new Properties(); - try { - java.io.FileInputStream in = new java.io.FileInputStream(groupsFile); - groups.load(in); - in.close(); - } catch (IOException ioe) { - throw new LoginException("Unable to load group properties file " + groupsFile); - } - Set userGroups = new HashSet(); - for (Enumeration enumeration = groups.keys(); enumeration.hasMoreElements();) { - String groupName = (String)enumeration.nextElement(); - String[] userList = (groups.getProperty(groupName) + "").split(","); - for (int i = 0; i < userList.length; i++) { - if (username.equals(userList[i])) { - userGroups.add(groupName); - break; - } - } - } - - return userGroups; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jaas/UserPrincipal.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jaas/UserPrincipal.java deleted file mode 100644 index 0be8fe171..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jaas/UserPrincipal.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * 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.jaas; - -import java.security.Principal; - -/** - * @version $Rev: $ $Date: $ - */ -public class UserPrincipal implements Principal { - - private final String name; - private transient int hash; - - public UserPrincipal(String name) { - if (name == null) { - throw new IllegalArgumentException("name cannot be null"); - } - this.name = name; - } - - @Override - public String getName() { - return name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - - final UserPrincipal that = (UserPrincipal)o; - - if (!name.equals(that.name)) { - return false; - } - - return true; - } - - @Override - public int hashCode() { - if (hash == 0) { - hash = name.hashCode(); - } - return hash; - } - - @Override - public String toString() { - return name; - } -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jndi/ActiveMQInitialContextFactory$1.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jndi/ActiveMQInitialContextFactory$1.class deleted file mode 100644 index 349ad08b2..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jndi/ActiveMQInitialContextFactory$1.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jndi/ActiveMQInitialContextFactory$2.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jndi/ActiveMQInitialContextFactory$2.class deleted file mode 100644 index 9e3381acb..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jndi/ActiveMQInitialContextFactory$2.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jndi/ActiveMQInitialContextFactory.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jndi/ActiveMQInitialContextFactory.class deleted file mode 100644 index e3b3b0c6a..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jndi/ActiveMQInitialContextFactory.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jndi/ActiveMQInitialContextFactory.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jndi/ActiveMQInitialContextFactory.java deleted file mode 100644 index a3b74194a..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jndi/ActiveMQInitialContextFactory.java +++ /dev/null @@ -1,228 +0,0 @@ -/** - * 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.jndi; - -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.StringTokenizer; -import java.util.concurrent.ConcurrentHashMap; - -import javax.jms.Queue; -import javax.jms.Topic; -import javax.naming.Context; -import javax.naming.NamingException; -import javax.naming.spi.InitialContextFactory; - -import org.apache.activemq.ActiveMQConnectionFactory; -import org.apache.activemq.ActiveMQXAConnectionFactory; -import org.apache.activemq.command.ActiveMQQueue; -import org.apache.activemq.command.ActiveMQTopic; - -/** - * A factory of the ActiveMQ InitialContext which contains - * {@link ConnectionFactory} instances as well as a child context called - * destinations which contain all of the current active destinations, in - * child context depending on the QoS such as transient or durable and queue or - * topic. - * - * - */ -public class ActiveMQInitialContextFactory implements InitialContextFactory { - - private static final String[] DEFAULT_CONNECTION_FACTORY_NAMES = {"ConnectionFactory", "XAConnectionFactory", "QueueConnectionFactory", "TopicConnectionFactory"}; - - private String connectionPrefix = "connection."; - private String queuePrefix = "queue."; - private String topicPrefix = "topic."; - - public Context getInitialContext(Hashtable environment) throws NamingException { - // lets create a factory - Map data = new ConcurrentHashMap(); - String[] names = getConnectionFactoryNames(environment); - for (int i = 0; i < names.length; i++) { - ActiveMQConnectionFactory factory = null; - String name = names[i]; - - try { - factory = createConnectionFactory(name, environment); - } catch (Exception e) { - throw new NamingException("Invalid broker URL"); - - } - /* - * if( broker==null ) { try { broker = factory.getEmbeddedBroker(); } - * catch (JMSException e) { log.warn("Failed to get embedded - * broker", e); } } - */ - data.put(name, factory); - } - - createQueues(data, environment); - createTopics(data, environment); - /* - * if (broker != null) { data.put("destinations", - * broker.getDestinationContext(environment)); } - */ - data.put("dynamicQueues", new LazyCreateContext() { - private static final long serialVersionUID = 6503881346214855588L; - - protected Object createEntry(String name) { - return new ActiveMQQueue(name); - } - }); - data.put("dynamicTopics", new LazyCreateContext() { - private static final long serialVersionUID = 2019166796234979615L; - - protected Object createEntry(String name) { - return new ActiveMQTopic(name); - } - }); - - return createContext(environment, data); - } - - // Properties - // ------------------------------------------------------------------------- - public String getTopicPrefix() { - return topicPrefix; - } - - public void setTopicPrefix(String topicPrefix) { - this.topicPrefix = topicPrefix; - } - - public String getQueuePrefix() { - return queuePrefix; - } - - public void setQueuePrefix(String queuePrefix) { - this.queuePrefix = queuePrefix; - } - - // Implementation methods - // ------------------------------------------------------------------------- - - protected ReadOnlyContext createContext(Hashtable environment, Map data) { - return new ReadOnlyContext(environment, data); - } - - protected ActiveMQConnectionFactory createConnectionFactory(String name, Hashtable environment) throws URISyntaxException { - Hashtable temp = new Hashtable(environment); - if (DEFAULT_CONNECTION_FACTORY_NAMES[1].equals(name)) { - // don't try to mod environment, it may be readonly - temp.put("xa", String.valueOf(true)); - } - String prefix = connectionPrefix + name + "."; - for (Iterator iter = environment.entrySet().iterator(); iter.hasNext();) { - Map.Entry entry = (Map.Entry)iter.next(); - String key = (String)entry.getKey(); - if (key.startsWith(prefix)) { - // Rename the key... - temp.remove(key); - key = key.substring(prefix.length()); - temp.put(key, entry.getValue()); - } - } - return createConnectionFactory(temp); - } - - protected String[] getConnectionFactoryNames(Map environment) { - String factoryNames = (String)environment.get("connectionFactoryNames"); - if (factoryNames != null) { - List list = new ArrayList(); - for (StringTokenizer enumeration = new StringTokenizer(factoryNames, ","); enumeration.hasMoreTokens();) { - list.add(enumeration.nextToken().trim()); - } - int size = list.size(); - if (size > 0) { - String[] answer = new String[size]; - list.toArray(answer); - return answer; - } - } - return DEFAULT_CONNECTION_FACTORY_NAMES; - } - - protected void createQueues(Map data, Hashtable environment) { - for (Iterator iter = environment.entrySet().iterator(); iter.hasNext();) { - Map.Entry entry = (Map.Entry)iter.next(); - String key = entry.getKey().toString(); - if (key.startsWith(queuePrefix)) { - String jndiName = key.substring(queuePrefix.length()); - data.put(jndiName, createQueue(entry.getValue().toString())); - } - } - } - - protected void createTopics(Map data, Hashtable environment) { - for (Iterator iter = environment.entrySet().iterator(); iter.hasNext();) { - Map.Entry entry = (Map.Entry)iter.next(); - String key = entry.getKey().toString(); - if (key.startsWith(topicPrefix)) { - String jndiName = key.substring(topicPrefix.length()); - data.put(jndiName, createTopic(entry.getValue().toString())); - } - } - } - - /** - * Factory method to create new Queue instances - */ - protected Queue createQueue(String name) { - return new ActiveMQQueue(name); - } - - /** - * Factory method to create new Topic instances - */ - protected Topic createTopic(String name) { - return new ActiveMQTopic(name); - } - - /** - * Factory method to create a new connection factory from the given - * environment - */ - protected ActiveMQConnectionFactory createConnectionFactory(Hashtable environment) throws URISyntaxException { - ActiveMQConnectionFactory answer = needsXA(environment) ? new ActiveMQXAConnectionFactory() : new ActiveMQConnectionFactory(); - Properties properties = new Properties(); - properties.putAll(environment); - answer.setProperties(properties); - return answer; - } - - private boolean needsXA(Hashtable environment) { - boolean isXA = Boolean.parseBoolean((String) environment.get("xa")); - // property not applicable to connectionfactory so remove - environment.remove("xa"); - return isXA; - } - - public String getConnectionPrefix() { - return connectionPrefix; - } - - public void setConnectionPrefix(String connectionPrefix) { - this.connectionPrefix = connectionPrefix; - } - -} diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jndi/ActiveMQWASInitialContextFactory.class b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jndi/ActiveMQWASInitialContextFactory.class deleted file mode 100644 index 265fee959..000000000 Binary files a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jndi/ActiveMQWASInitialContextFactory.class and /dev/null differ diff --git a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jndi/ActiveMQWASInitialContextFactory.java b/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jndi/ActiveMQWASInitialContextFactory.java deleted file mode 100644 index 5340ae286..000000000 --- a/uk.ac.diamond.org.apache.activemq/org/apache/activemq/jndi/ActiveMQWASInitialContextFactory.java +++ /dev/null @@ -1,97 +0,0 @@ -/** - * 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.jndi; - -import java.util.Hashtable; -import java.util.Iterator; -import java.util.Map; - -import javax.naming.Context; -import javax.naming.NamingException; - -/** - * This implementation of InitialContextFactory should be used - * when ActiveMQ is used as WebSphere Generic JMS Provider. It is proved that it - * works on WebSphere 5.1. The reason for using this class is that custom - * property defined for Generic JMS Provider are passed to InitialContextFactory - * only if it begins with java.naming or javax.naming prefix. Additionally - * provider url for the JMS provider can not contain ',' character that is - * necessary when the list of nodes is provided. So the role of this class is to - * transform properties before passing it to ActiveMQInitialContextFactory. - */ -public class ActiveMQWASInitialContextFactory extends ActiveMQInitialContextFactory { - - /** - * @see javax.naming.spi.InitialContextFactory#getInitialContext(java.util.Hashtable) - */ - public Context getInitialContext(Hashtable environment) throws NamingException { - return super.getInitialContext(transformEnvironment(environment)); - } - - /** - * Performs following transformation of properties: - *