You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2009/06/01 06:05:38 UTC

svn commit: r780558 [3/3] - in /activemq/sandbox/activemq-flow: ./ activemq-all/ activemq-all/.settings/ activemq-all/eclipse-classes/ activemq-all/target/ activemq-broker/ activemq-broker/src/main/java/org/apache/activemq/broker/ activemq-broker/src/m...

Added: activemq/sandbox/activemq-flow/activemq-selector/src/main/java/org/apache/activemq/filter/package.html
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-selector/src/main/java/org/apache/activemq/filter/package.html?rev=780558&view=auto
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-selector/src/main/java/org/apache/activemq/filter/package.html (added)
+++ activemq/sandbox/activemq-flow/activemq-selector/src/main/java/org/apache/activemq/filter/package.html Mon Jun  1 04:05:34 2009
@@ -0,0 +1,27 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+   
+    http://www.apache.org/licenses/LICENSE-2.0
+   
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<html>
+<head>
+</head>
+<body>
+
+<p>
+	Filter implementations for wildcards & JMS selectors
+</p>
+
+</body>
+</html>

Propchange: activemq/sandbox/activemq-flow/activemq-selector/src/main/java/org/apache/activemq/filter/package.html
------------------------------------------------------------------------------
    svn:executable = *

Modified: activemq/sandbox/activemq-flow/activemq-stomp/pom.xml
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-stomp/pom.xml?rev=780558&r1=780557&r2=780558&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-stomp/pom.xml (original)
+++ activemq/sandbox/activemq-flow/activemq-stomp/pom.xml Mon Jun  1 04:05:34 2009
@@ -46,6 +46,13 @@
     
     <!-- Testing Dependencies -->
     <dependency>
+      <groupId>org.apache.activemq</groupId>
+      <artifactId>activemq-broker</artifactId>
+      <version>${activemq-version}</version>
+      <type>test-jar</type>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       <scope>test</scope>

Modified: activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/broker/stomp/StompMessageDelivery.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/broker/stomp/StompMessageDelivery.java?rev=780558&r1=780557&r2=780558&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/broker/stomp/StompMessageDelivery.java (original)
+++ activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/broker/stomp/StompMessageDelivery.java Mon Jun  1 04:05:34 2009
@@ -19,6 +19,7 @@
 import org.apache.activemq.broker.BrokerMessageDelivery;
 import org.apache.activemq.broker.Destination;
 import org.apache.activemq.broker.store.Store.MessageRecord;
+import org.apache.activemq.filter.MessageEvaluationContext;
 import org.apache.activemq.protobuf.AsciiBuffer;
 import org.apache.activemq.protobuf.Buffer;
 import org.apache.activemq.transport.stomp.Stomp;
@@ -157,5 +158,9 @@
         return null;
     }
 
+    public MessageEvaluationContext createMessageEvaluationContext() {
+        return new StompMessageEvaluationContext();
+    }
+
     
 }

Added: activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/broker/stomp/StompMessageEvaluationContext.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/broker/stomp/StompMessageEvaluationContext.java?rev=780558&view=auto
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/broker/stomp/StompMessageEvaluationContext.java (added)
+++ activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/broker/stomp/StompMessageEvaluationContext.java Mon Jun  1 04:05:34 2009
@@ -0,0 +1,32 @@
+package org.apache.activemq.broker.stomp;
+
+import org.apache.activemq.filter.Expression;
+import org.apache.activemq.filter.FilterException;
+import org.apache.activemq.filter.MessageEvaluationContext;
+
+public class StompMessageEvaluationContext implements MessageEvaluationContext {
+
+    public <T> T getBodyAs(Class<T> type) throws FilterException {
+        return null;
+    }
+
+    public <T> T getDestination() {
+        return null;
+    }
+
+    public Object getLocalConnectionId() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public Expression getPropertyExpression(String name) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public void setDestination(Object destination) {
+        // TODO Auto-generated method stub
+
+    }
+
+}

Modified: activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/broker/stomp/StompProtocolHandler.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/broker/stomp/StompProtocolHandler.java?rev=780558&r1=780557&r2=780558&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/broker/stomp/StompProtocolHandler.java (original)
+++ activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/broker/stomp/StompProtocolHandler.java Mon Jun  1 04:05:34 2009
@@ -26,8 +26,6 @@
 import java.util.LinkedHashMap;
 import java.util.Map;
 
-import javax.jms.InvalidSelectorException;
-
 import org.apache.activemq.WindowLimiter;
 import org.apache.activemq.broker.BrokerConnection;
 import org.apache.activemq.broker.BrokerMessageDelivery;
@@ -39,6 +37,7 @@
 import org.apache.activemq.broker.store.Store.MessageRecord;
 import org.apache.activemq.command.ActiveMQDestination;
 import org.apache.activemq.filter.BooleanExpression;
+import org.apache.activemq.filter.FilterException;
 import org.apache.activemq.flow.AbstractLimitedFlowResource;
 import org.apache.activemq.flow.Flow;
 import org.apache.activemq.flow.FlowController;
@@ -550,7 +549,7 @@
         return new Destination.SingleDestination(domain, new AsciiBuffer(dest.getPhysicalName()));
     }
 
-    private static BooleanExpression parseSelector(String selector) throws InvalidSelectorException {
+    private static BooleanExpression parseSelector(String selector) throws FilterException {
         BooleanExpression rc = null;
         if (selector != null) {
             rc = SelectorParser.parse(selector);

Modified: activemq/sandbox/activemq-flow/activemq-store/src/main/java/org/apache/activemq/broker/store/Store.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-store/src/main/java/org/apache/activemq/broker/store/Store.java?rev=780558&r1=780557&r2=780558&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-store/src/main/java/org/apache/activemq/broker/store/Store.java (original)
+++ activemq/sandbox/activemq-flow/activemq-store/src/main/java/org/apache/activemq/broker/store/Store.java Mon Jun  1 04:05:34 2009
@@ -23,6 +23,7 @@
 import org.apache.activemq.Service;
 import org.apache.activemq.protobuf.AsciiBuffer;
 import org.apache.activemq.protobuf.Buffer;
+import org.apache.activemq.queue.QueueDescriptor;
 
 /**
  * Interface to persistently store and access data needed by the messaging

Modified: activemq/sandbox/activemq-flow/activemq-store/src/main/java/org/apache/activemq/broker/store/memory/MemoryStore.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-store/src/main/java/org/apache/activemq/broker/store/memory/MemoryStore.java?rev=780558&r1=780557&r2=780558&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-store/src/main/java/org/apache/activemq/broker/store/memory/MemoryStore.java (original)
+++ activemq/sandbox/activemq-flow/activemq-store/src/main/java/org/apache/activemq/broker/store/memory/MemoryStore.java Mon Jun  1 04:05:34 2009
@@ -26,10 +26,10 @@
 import java.util.TreeMap;
 import java.util.concurrent.atomic.AtomicLong;
 
-import org.apache.activemq.broker.store.QueueDescriptor;
 import org.apache.activemq.broker.store.Store;
 import org.apache.activemq.protobuf.AsciiBuffer;
 import org.apache.activemq.protobuf.Buffer;
+import org.apache.activemq.queue.QueueDescriptor;
 import org.apache.activemq.util.ByteArrayOutputStream;
 import org.apache.activemq.util.ByteSequence;
 import org.apache.activemq.util.Comparators;

Modified: activemq/sandbox/activemq-flow/activemq-store/src/test/java/org/apache/activemq/broker/store/StorePerformanceBase.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-store/src/test/java/org/apache/activemq/broker/store/StorePerformanceBase.java?rev=780558&r1=780557&r2=780558&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-store/src/test/java/org/apache/activemq/broker/store/StorePerformanceBase.java (original)
+++ activemq/sandbox/activemq-flow/activemq-store/src/test/java/org/apache/activemq/broker/store/StorePerformanceBase.java Mon Jun  1 04:05:34 2009
@@ -31,6 +31,7 @@
 import org.apache.activemq.metric.Period;
 import org.apache.activemq.protobuf.AsciiBuffer;
 import org.apache.activemq.protobuf.Buffer;
+import org.apache.activemq.queue.QueueDescriptor;
 
 public abstract class StorePerformanceBase extends TestCase {
 

Modified: activemq/sandbox/activemq-flow/activemq-store/src/test/java/org/apache/activemq/broker/store/StoreTestBase.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-store/src/test/java/org/apache/activemq/broker/store/StoreTestBase.java?rev=780558&r1=780557&r2=780558&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-store/src/test/java/org/apache/activemq/broker/store/StoreTestBase.java (original)
+++ activemq/sandbox/activemq-flow/activemq-store/src/test/java/org/apache/activemq/broker/store/StoreTestBase.java Mon Jun  1 04:05:34 2009
@@ -29,6 +29,7 @@
 import org.apache.activemq.broker.store.Store.VoidCallback;
 import org.apache.activemq.protobuf.AsciiBuffer;
 import org.apache.activemq.protobuf.Buffer;
+import org.apache.activemq.queue.QueueDescriptor;
 
 public abstract class StoreTestBase extends TestCase {
 

Modified: activemq/sandbox/activemq-flow/activemq-transport/pom.xml
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-transport/pom.xml?rev=780558&r1=780557&r2=780558&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-transport/pom.xml (original)
+++ activemq/sandbox/activemq-flow/activemq-transport/pom.xml Mon Jun  1 04:05:34 2009
@@ -42,10 +42,11 @@
       <artifactId>activemq-dispatcher</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.activemq</groupId>
-      <artifactId>activemq-flow</artifactId>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging</artifactId>
+      <version>1.1</version>
     </dependency>
-        
+    
     <!-- Testing Dependencies -->    
     <dependency>
       <groupId>junit</groupId>

Copied: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/TransportFactory.java (from r780474, activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/transport/TransportFactory.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/TransportFactory.java?p2=activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/TransportFactory.java&p1=activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/transport/TransportFactory.java&r1=780474&r2=780558&rev=780558&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/transport/TransportFactory.java (original)
+++ activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/TransportFactory.java Mon Jun  1 04:05:34 2009
@@ -243,7 +243,7 @@
         transport = compositeConfigure(transport, wf, options);
 
         transport = new MutexTransport(transport);
-        transport = new ResponseCorrelator(transport);
+//        transport = new ResponseCorrelator(transport);
 
         return transport;
     }

Copied: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/pipe/Pipe.java (from r780474, activemq/sandbox/activemq-flow/activemq-broker/src/test/java/org/apache/activemq/flow/Pipe.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/pipe/Pipe.java?p2=activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/pipe/Pipe.java&p1=activemq/sandbox/activemq-flow/activemq-broker/src/test/java/org/apache/activemq/flow/Pipe.java&r1=780474&r2=780558&rev=780558&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-broker/src/test/java/org/apache/activemq/flow/Pipe.java (original)
+++ activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/pipe/Pipe.java Mon Jun  1 04:05:34 2009
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.activemq.flow;
+package org.apache.activemq.transport.pipe;
 
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.TimeUnit;

Copied: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/pipe/PipeTransportFactory.java (from r780474, activemq/sandbox/activemq-flow/activemq-broker/src/test/java/org/apache/activemq/flow/PipeTransportFactory.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/pipe/PipeTransportFactory.java?p2=activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/pipe/PipeTransportFactory.java&p1=activemq/sandbox/activemq-flow/activemq-broker/src/test/java/org/apache/activemq/flow/PipeTransportFactory.java&r1=780474&r2=780558&rev=780558&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-broker/src/test/java/org/apache/activemq/flow/PipeTransportFactory.java (original)
+++ activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/pipe/PipeTransportFactory.java Mon Jun  1 04:05:34 2009
@@ -1,4 +1,4 @@
-package org.apache.activemq.flow;
+package org.apache.activemq.transport.pipe;
 
 import java.io.IOException;
 import java.io.InterruptedIOException;
@@ -11,11 +11,9 @@
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
 
-import org.apache.activemq.command.BrokerInfo;
 import org.apache.activemq.dispatch.IDispatcher;
 import org.apache.activemq.dispatch.IDispatcher.DispatchContext;
 import org.apache.activemq.dispatch.IDispatcher.Dispatchable;
-import org.apache.activemq.flow.Pipe.ReadReadyListener;
 import org.apache.activemq.transport.DispatchableTransport;
 import org.apache.activemq.transport.FutureResponse;
 import org.apache.activemq.transport.ResponseCallback;
@@ -24,6 +22,7 @@
 import org.apache.activemq.transport.TransportFactory;
 import org.apache.activemq.transport.TransportListener;
 import org.apache.activemq.transport.TransportServer;
+import org.apache.activemq.transport.pipe.Pipe.ReadReadyListener;
 import org.apache.activemq.util.ByteSequence;
 import org.apache.activemq.util.IOExceptionSupport;
 import org.apache.activemq.util.URISupport;
@@ -217,9 +216,6 @@
             this.listener = listener;
         }
 
-        public void setBrokerInfo(BrokerInfo brokerInfo) {
-        }
-
         public void start() throws Exception {
         }
 

Added: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/LRUCache.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/LRUCache.java?rev=780558&view=auto
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/LRUCache.java (added)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/LRUCache.java Mon Jun  1 04:05:34 2009
@@ -0,0 +1,85 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.util;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+/**
+ * A Simple LRU Cache
+ * 
+ * @version $Revision$
+ * @param <K>
+ * @param <V>
+ */
+
+public class LRUCache<K, V> extends LinkedHashMap<K, V> {
+    private static final long serialVersionUID = -342098639681884413L;
+    protected int maxCacheSize = 10000;
+
+    /**
+     * Default constructor for an LRU Cache The default capacity is 10000
+     */
+    public LRUCache() {
+        this(0,10000, 0.75f, true);
+    }
+
+    /**
+     * Constructs a LRUCache with a maximum capacity
+     * 
+     * @param maximumCacheSize
+     */
+    public LRUCache(int maximumCacheSize) {
+        this(0, maximumCacheSize, 0.75f, true);
+    }
+
+    /**
+     * Constructs an empty <tt>LRUCache</tt> instance with the specified
+     * initial capacity, maximumCacheSize,load factor and ordering mode.
+     * 
+     * @param initialCapacity the initial capacity.
+     * @param maximumCacheSize
+     * @param loadFactor the load factor.
+     * @param accessOrder the ordering mode - <tt>true</tt> for access-order,
+     *                <tt>false</tt> for insertion-order.
+     * @throws IllegalArgumentException if the initial capacity is negative or
+     *                 the load factor is non-positive.
+     */
+
+    public LRUCache(int initialCapacity, int maximumCacheSize, float loadFactor, boolean accessOrder) {
+        super(initialCapacity, loadFactor, accessOrder);
+        this.maxCacheSize = maximumCacheSize;
+    }
+
+    /**
+     * @return Returns the maxCacheSize.
+     */
+    public int getMaxCacheSize() {
+        return maxCacheSize;
+    }
+
+    /**
+     * @param maxCacheSize The maxCacheSize to set.
+     */
+    public void setMaxCacheSize(int maxCacheSize) {
+        this.maxCacheSize = maxCacheSize;
+    }
+
+    protected boolean removeEldestEntry(Map.Entry<K,V> eldest) {
+        return size() > maxCacheSize;
+    }
+}

Propchange: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/LRUCache.java
------------------------------------------------------------------------------
    svn:executable = *

Modified: activemq/sandbox/activemq-flow/kahadb/pom.xml
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/kahadb/pom.xml?rev=780558&r1=780557&r2=780558&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/kahadb/pom.xml (original)
+++ activemq/sandbox/activemq-flow/kahadb/pom.xml Mon Jun  1 04:05:34 2009
@@ -27,7 +27,7 @@
 
   <groupId>org.apache.activemq</groupId>
   <artifactId>kahadb</artifactId>
-  <packaging>bundle</packaging>
+  <packaging>jar</packaging>
   <name>ActiveMQ :: KahaDB</name>
   <description>An Embedded Lightweight Non-Relational Database</description>
 

Modified: activemq/sandbox/activemq-flow/pom.xml
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/pom.xml?rev=780558&r1=780557&r2=780558&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/pom.xml (original)
+++ activemq/sandbox/activemq-flow/pom.xml Mon Jun  1 04:05:34 2009
@@ -124,6 +124,7 @@
     <module>activemq-client</module>
     <module>activemq-network</module>
     <module>activemq-all</module>
+    <module>activemq-selector</module>
   </modules>
 
 <!--
@@ -164,6 +165,11 @@
       </dependency>
       <dependency>
         <groupId>org.apache.activemq</groupId>
+        <artifactId>activemq-selector</artifactId>
+        <version>${activemq-version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.activemq</groupId>
         <artifactId>activemq-network</artifactId>
         <version>${activemq-version}</version>
       </dependency>
@@ -883,7 +889,7 @@
         <plugin>
           <groupId>org.codehaus.mojo</groupId>
           <artifactId>javacc-maven-plugin</artifactId>
-          <version>2.0</version>
+          <version>2.4.1</version>
         </plugin>
         <plugin>
           <groupId>org.codehaus.mojo</groupId>