activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r738496 - in /activemq/activemq-blaze/trunk/src: main/java/org/apache/activeblaze/ main/java/org/apache/activeblaze/group/ main/java/org/apache/activeblaze/jms/ main/java/org/apache/activeblaze/util/ main/proto/ test/java/org/apache/activeb...
Date Wed, 28 Jan 2009 14:25:25 GMT
Author: rajdavies
Date: Wed Jan 28 14:25:24 2009
New Revision: 738496

URL: http://svn.apache.org/viewvc?rev=738496&view=rev
Log:
re-align things so JMS support can be slotted in

Added:
    activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/Destination.java   (with props)
    activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/group/Subscription.java
      - copied, changed from r738097, activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/group/Destination.java
    activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/jms/
    activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/jms/BlazeJmsMessage.java   (with props)
    activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/Callback.java   (with props)
Removed:
    activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/group/Destination.java
Modified:
    activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/BlazeChannelImpl.java
    activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/BlazeMessage.java
    activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/group/BlazeGroupChannelImpl.java
    activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/group/Group.java
    activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/group/Member.java
    activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/group/MemberImpl.java
    activemq/activemq-blaze/trunk/src/main/proto/blaze.proto
    activemq/activemq-blaze/trunk/src/test/java/org/apache/activeblaze/BlazeMessageTest.java

Modified: activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/BlazeChannelImpl.java
URL: http://svn.apache.org/viewvc/activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/BlazeChannelImpl.java?rev=738496&r1=738495&r2=738496&view=diff
==============================================================================
--- activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/BlazeChannelImpl.java (original)
+++ activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/BlazeChannelImpl.java Wed Jan 28 14:25:24 2009
@@ -140,10 +140,9 @@
     }
 
     public synchronized void broadcast(String destination, BlazeMessage msg) throws Exception {
+        msg.setDestination(new Destination(destination));
         msg.storeContent();
         BlazeData blazeData = msg.getContent();
-        blazeData.setTopic(true);
-        blazeData.setDestination(new Buffer(destination));
         PacketData packetData = getPacketData(MessageType.BLAZE_DATA, blazeData);
         packetData.setReliable(true);
         Packet packet = new Packet(packetData);
@@ -176,8 +175,8 @@
     }
 
     /**
+     * Set the configuration
      * @param configuration
-     * @see org.apache.activeblaze.BlazeChannel#setConfiguration(org.apache.activeblaze.BlazeConfiguration)
      */
     public void setConfiguration(BlazeConfiguration configuration) {
         this.configuration = configuration;
@@ -208,7 +207,7 @@
                 fromId = data.getProducerId().toStringUtf8();
             }
             message = createMessage(fromId);
-            message.setDestination(blazeData.getDestination().toStringUtf8());
+            message.setDestination(blazeData.getDestinationData());
             message.setFromId(fromId);
             if (data.hasMessageId()) {
                 message.setMessageId(data.getMessageId().toStringUtf8());
@@ -228,7 +227,7 @@
 
     protected final void dispatch(BlazeMessage message) {
         if (message != null) {
-            Buffer destination = message.getContent().getDestination();
+            Buffer destination = message.getContent().getDestinationData().getName();
             for (Map.Entry<Buffer, BlazeTopicListener> entry : this.topicessageListenerMap.entrySet()) {
                 if (DestinationMatch.isMatch(destination, entry.getKey())) {
                     entry.getValue().onMessage(message);

Modified: activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/BlazeMessage.java
URL: http://svn.apache.org/viewvc/activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/BlazeMessage.java?rev=738496&r1=738495&r2=738496&view=diff
==============================================================================
--- activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/BlazeMessage.java (original)
+++ activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/BlazeMessage.java Wed Jan 28 14:25:24 2009
@@ -30,6 +30,7 @@
 import org.apache.activeblaze.wire.ByteType;
 import org.apache.activeblaze.wire.BytesType;
 import org.apache.activeblaze.wire.CharType;
+import org.apache.activeblaze.wire.DestinationData;
 import org.apache.activeblaze.wire.DoubleType;
 import org.apache.activeblaze.wire.FloatType;
 import org.apache.activeblaze.wire.IntType;
@@ -79,11 +80,16 @@
     private static final String DEFAULT_BYTES_PAYLOAD = "DEFAULT_BYTES_PAYLOAD";
     private static final String DEFAULT_OBJECT_PAYLOAD = "DEFAULT_OBJECT_PAYLOAD";
     private transient Map<String, Object> map = new ConcurrentHashMap<String, Object>();
-    private transient String destination;
+    private transient Destination destination;
+    private transient Destination replyTo;
     private transient String fromId;
     private transient String messageId;
     private transient String correlationId;
     private transient long timeStamp;
+    private transient long expiration;
+    private transient int redeliveryCounter;
+    private transient int priority;
+    private transient boolean persistent;
     private BlazeData content;
 
     /**
@@ -182,13 +188,182 @@
     }
 
     /**
-     * @param copy2
+     * @return the destination
+     */
+    public Destination getDestination() {
+        return this.destination;
+    }
+
+    /**
+     * @param destination
+     *            the destination to set
+     */
+    public void setDestination(Destination destination) {
+        this.destination = destination;
+    }
+    
+    /**
+     * @param destination
+     */
+    public void setDestination(DestinationData destination) {
+        this.destination = new Destination(destination);
+    }
+
+    /**
+     * The id of the channel that sent the message
+     * 
+     * @return the fromId
+     */
+    public String getFromId() {
+        return this.fromId;
+    }
+
+    /**
+     * @param fromId
+     *            the fromId to set
+     */
+    public void setFromId(String fromId) {
+        this.fromId = fromId;
+    }
+
+    /**
+     * @return the messageId
+     */
+    public String getMessageId() {
+        return this.messageId;
+    }
+
+    /**
+     * @param messageId
+     *            the messageId to set
+     */
+    public void setMessageId(String messageId) {
+        this.messageId = messageId;
+    }
+
+    /**
+     * @return the correlationId
+     */
+    public String getCorrelationId() {
+        return this.correlationId;
+    }
+
+    /**
+     * @param correlationId
+     *            the correlationId to set
+     */
+    public void setCorrelationId(String correlationId) {
+        this.correlationId = correlationId;
+    }
+
+    /**
+     * @return the timeStamp
+     */
+    public long getTimeStamp() {
+        return this.timeStamp;
+    }
+
+    /**
+     * @param timeStamp
+     *            the timeStamp to set
+     */
+    public void setTimeStamp(long timeStamp) {
+        this.timeStamp = timeStamp;
+    }
+
+    /**
+     * @return the replyTo
+     */
+    public Destination getReplyTo() {
+        return this.replyTo;
+    }
+
+    /**
+     * @param replyTo
+     *            the replyTo to set
+     */
+    public void setReplyTo(Destination replyTo) {
+        this.replyTo = replyTo;
+    }
+    
+    /**
+     * @param replyTo
+     *            the replyTo to set
+     */
+    public void setReplyTo(DestinationData replyTo) {
+        this.replyTo = new Destination(replyTo);
+    }
+
+    /**
+     * @return the expiration
+     */
+    public long getExpiration() {
+        return this.expiration;
+    }
+
+    /**
+     * @param expiration
+     *            the expiration to set
+     */
+    public void setExpiration(long expiration) {
+        this.expiration = expiration;
+    }
+
+    /**
+     * @return the redeliveryCounter
+     */
+    public int getRedeliveryCounter() {
+        return this.redeliveryCounter;
+    }
+
+    /**
+     * @param redeliveryCounter
+     *            the redeliveryCounter to set
+     */
+    public void setRedeliveryCounter(int redeliveryCounter) {
+        this.redeliveryCounter = redeliveryCounter;
+    }
+
+    /**
+     * @return the priority
+     */
+    public int getPriority() {
+        return this.priority;
+    }
+
+    /**
+     * @param priority
+     *            the priority to set
+     */
+    public void setPriority(int priority) {
+        this.priority = priority;
+    }
+
+    /**
+     * @return the persistent
+     */
+    public boolean isPersistent() {
+        return this.persistent;
+    }
+
+    /**
+     * @param persistent
+     *            the persistent to set
+     */
+    public void setPersistent(boolean persistent) {
+        this.persistent = persistent;
+    }
+
+    /**
      * @return a copy of this message
-     * @throws BlazeException
      */
-    public BlazeMessage copy() throws BlazeException {
+    public BlazeMessage clone() {
         BlazeMessage copy = new BlazeMessage();
-        copy(copy);
+        try {
+            copy(copy);
+        } catch (BlazeException e) {
+            throw new BlazeRuntimeException(e);
+        }
         return copy;
     }
 
@@ -219,9 +394,8 @@
         }
         if (value instanceof String) {
             return Boolean.valueOf(value.toString()).booleanValue();
-        } else {
-            throw new BlazeMessageFormatException(" cannot read a boolean from " + value.getClass().getName());
         }
+        throw new BlazeMessageFormatException(" cannot read a boolean from " + value.getClass().getName());
     }
 
     /**
@@ -244,9 +418,8 @@
         }
         if (value instanceof String) {
             return Byte.valueOf(value.toString()).byteValue();
-        } else {
-            throw new BlazeMessageFormatException(" cannot read a byte from " + value.getClass().getName());
         }
+        throw new BlazeMessageFormatException(" cannot read a byte from " + value.getClass().getName());
     }
 
     /**
@@ -272,9 +445,8 @@
         }
         if (value instanceof String) {
             return Short.valueOf(value.toString()).shortValue();
-        } else {
-            throw new BlazeMessageFormatException(" cannot read a short from " + value.getClass().getName());
         }
+        throw new BlazeMessageFormatException(" cannot read a short from " + value.getClass().getName());
     }
 
     /**
@@ -294,9 +466,8 @@
         }
         if (value instanceof Character) {
             return ((Character) value).charValue();
-        } else {
-            throw new BlazeMessageFormatException(" cannot read a short from " + value.getClass().getName());
         }
+        throw new BlazeMessageFormatException(" cannot read a short from " + value.getClass().getName());
     }
 
     /**
@@ -325,9 +496,8 @@
         }
         if (value instanceof String) {
             return Integer.valueOf(value.toString()).intValue();
-        } else {
-            throw new BlazeMessageFormatException(" cannot read an int from " + value.getClass().getName());
         }
+        throw new BlazeMessageFormatException(" cannot read an int from " + value.getClass().getName());
     }
 
     /**
@@ -359,9 +529,8 @@
         }
         if (value instanceof String) {
             return Long.valueOf(value.toString()).longValue();
-        } else {
-            throw new BlazeMessageFormatException(" cannot read a long from " + value.getClass().getName());
         }
+        throw new BlazeMessageFormatException(" cannot read a long from " + value.getClass().getName());
     }
 
     /**
@@ -384,9 +553,8 @@
         }
         if (value instanceof String) {
             return Float.valueOf(value.toString()).floatValue();
-        } else {
-            throw new BlazeMessageFormatException(" cannot read a float from " + value.getClass().getName());
         }
+        throw new BlazeMessageFormatException(" cannot read a float from " + value.getClass().getName());
     }
 
     /**
@@ -412,9 +580,8 @@
         }
         if (value instanceof String) {
             return Float.valueOf(value.toString()).floatValue();
-        } else {
-            throw new BlazeMessageFormatException(" cannot read a double from " + value.getClass().getName());
         }
+        throw new BlazeMessageFormatException(" cannot read a double from " + value.getClass().getName());
     }
 
     /**
@@ -435,9 +602,8 @@
         }
         if (value instanceof byte[]) {
             throw new BlazeMessageFormatException("Use getBytes to read a byte array");
-        } else {
-            return value.toString();
         }
+        return value.toString();
     }
 
     /**
@@ -454,9 +620,8 @@
         Object value = this.map.get(name);
         if (value instanceof byte[]) {
             return (byte[]) value;
-        } else {
-            throw new BlazeMessageFormatException(" cannot read a byte[] from " + value.getClass().getName());
         }
+        throw new BlazeMessageFormatException(" cannot read a byte[] from " + value.getClass().getName());
     }
 
     /**
@@ -473,9 +638,8 @@
         Object value = this.map.get(name);
         if (value instanceof Buffer) {
             return (Buffer) value;
-        } else {
-            throw new BlazeMessageFormatException(" cannot read a Buffer from " + value.getClass().getName());
         }
+        throw new BlazeMessageFormatException(" cannot read a Buffer from " + value.getClass().getName());
     }
 
     /**
@@ -848,6 +1012,7 @@
 
     /**
      * Set the content data
+     * 
      * @param content
      */
     public void setContent(BlazeData content) {
@@ -990,6 +1155,10 @@
         return result;
     }
 
+    /**
+     * Store content into a BlazeData object for serialization
+     * @throws BlazeMessageFormatException
+     */
     public void storeContent() throws BlazeMessageFormatException {
         if (getContent() == null && !this.map.isEmpty()) {
             BlazeData bd = new BlazeData();
@@ -998,6 +1167,26 @@
                 marshallMap(mapData, entry.getKey().toString(), entry.getValue());
             }
             bd.setMapData(mapData);
+            if (this.destination != null) {
+                bd.setDestinationData(this.destination.getData());
+            }
+            if (this.replyTo != null) {
+                bd.setReplyToData(this.replyTo.getData());
+            }
+            if (this.messageId != null) {
+                bd.setMessageId(new Buffer(this.messageId));
+            }
+            if (this.correlationId != null) {
+                bd.setCorrelationId(new Buffer(this.correlationId));
+            }
+            if (this.fromId != null) {
+                bd.setFromId(new Buffer(this.fromId));
+            }
+            bd.setTimestamp(getTimeStamp());
+            bd.setExpiration(getExpiration());
+            bd.setRedeliveryCounter(getRedeliveryCounter());
+            bd.setPriority(getPriority());
+            bd.setPersistent(isPersistent());
             this.content = bd;
         }
     }
@@ -1010,83 +1199,26 @@
         BlazeData data = getContent();
         if (data != null && this.map.isEmpty()) {
             this.map = unmarshall(data.getMapData());
+            if (data.hasDestinationData()) {
+                this.destination = new Destination(data.getDestinationData());
+            }
+            if (data.hasReplyToData()) {
+                this.replyTo = new Destination(data.getReplyToData());
+            }
+            if (data.hasFromId()) {
+                this.fromId = data.getFromId().toStringUtf8();
+            }
+            if (data.hasMessageId()) {
+                this.messageId = data.getMessageId().toStringUtf8();
+            }
+            if (data.hasCorrelationId()) {
+                this.correlationId = data.getCorrelationId().toStringUtf8();
+            }
+            this.timeStamp = data.getTimestamp();
+            this.expiration = data.getExpiration();
+            this.redeliveryCounter = data.getRedeliveryCounter();
+            this.priority = data.getPriority();
+            this.persistent = data.getPersistent();
         }
     }
-
-    /**
-     * @return the destination
-     */
-    public String getDestination() {
-        return this.destination;
-    }
-
-    /**
-     * @param destination
-     *            the destination to set
-     */
-    public void setDestination(String destination) {
-        this.destination = destination;
-    }
-
-    /**
-     * The id of the channel that sent the message
-     * 
-     * @return the fromId
-     */
-    public String getFromId() {
-        return this.fromId;
-    }
-
-    /**
-     * @param fromId
-     *            the fromId to set
-     */
-    public void setFromId(String fromId) {
-        this.fromId = fromId;
-    }
-
-    /**
-     * @return the messageId
-     */
-    public String getMessageId() {
-        return this.messageId;
-    }
-
-    /**
-     * @param messageId
-     *            the messageId to set
-     */
-    public void setMessageId(String messageId) {
-        this.messageId = messageId;
-    }
-
-    /**
-     * @return the correlationId
-     */
-    public String getCorrelationId() {
-        return this.correlationId;
-    }
-
-    /**
-     * @param correlationId
-     *            the correlationId to set
-     */
-    public void setCorrelationId(String correlationId) {
-        this.correlationId = correlationId;
-    }
-
-    /**
-     * @return the timeStamp
-     */
-    public long getTimeStamp() {
-        return this.timeStamp;
-    }
-
-    /**
-     * @param timeStamp
-     *            the timeStamp to set
-     */
-    public void setTimeStamp(long timeStamp) {
-        this.timeStamp = timeStamp;
-    }
 }
\ No newline at end of file

Added: activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/Destination.java
URL: http://svn.apache.org/viewvc/activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/Destination.java?rev=738496&view=auto
==============================================================================
--- activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/Destination.java (added)
+++ activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/Destination.java Wed Jan 28 14:25:24 2009
@@ -0,0 +1,174 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activeblaze;
+
+import org.apache.activeblaze.wire.DestinationData;
+import org.apache.activemq.protobuf.Buffer;
+
+/**
+ * Holds information about a Destination
+ *
+ */
+public class Destination {
+    private Buffer name;
+    private boolean topic=true;
+    private boolean temporary;
+    private DestinationData data;
+    
+    /**
+     * Default Constructor
+     */
+    public Destination() {
+    }
+    
+    /**
+     * Constructor
+     * @param name
+     */
+    public Destination(String name) {
+        this(name,true);
+    }
+    
+    /**
+     * Constructor
+     * @param name
+     * @param topic
+     */
+    public Destination(String name,boolean topic) {
+        this(name,topic,false);
+    }
+    
+    /**
+     * Constructor
+     * @param name
+     * @param topic
+     * @param temporary
+     */
+    public Destination(String name,boolean topic,boolean temporary) {
+        this.name=new Buffer(name);
+        this.topic=topic;
+        this.temporary=temporary;
+    }
+    
+    /**
+     * Constructor
+     * @param name
+     */
+    public Destination(Buffer name) {
+        this(name,true);
+    }
+    
+    /**
+     * Constructor
+     * @param name
+     * @param topic
+     */
+    public Destination(Buffer name,boolean topic) {
+        this(name,topic,false);
+    }
+    
+    /**
+     * Constructor
+     * @param name
+     * @param topic
+     * @param temporary
+     */
+    public Destination(Buffer name,boolean topic,boolean temporary) {
+        this.name=name;
+        this.topic=topic;
+        this.temporary=temporary;
+    }
+    
+    /**
+     * Constructor
+     * @param data
+     */
+    public Destination(DestinationData data){
+        setData(data);
+    }
+    /**
+     * @return the name
+     */
+    public Buffer getName() {
+        return this.name;
+    }
+    /**
+     * @param name the name to set
+     */
+    public void setName(Buffer name) {
+        this.name = name;
+    }
+    /**
+     * @return the topic
+     */
+    public boolean isTopic() {
+        return this.topic;
+    }
+    /**
+     * @param topic the topic to set
+     */
+    public void setTopic(boolean topic) {
+        this.topic = topic;
+    }
+    /**
+     * @return the temporary
+     */
+    public boolean isTemporary() {
+        return this.temporary;
+    }
+    /**
+     * @param temporary the temporary to set
+     */
+    public void setTemporary(boolean temporary) {
+        this.temporary = temporary;
+    }
+    
+    /**
+     * @return true if a Topic
+     */
+    public boolean isQueue() {
+        return !this.topic;
+    }
+    /**
+     * @return the data
+     */
+    public synchronized DestinationData getData() {
+        if (this.data==null) {
+            this.data = new DestinationData();
+            this.data.setName(getName());
+            this.data.setTopic(isTopic());
+            this.data.setTemporary(isTemporary());
+        }
+        return this.data;
+    }
+    /**
+     * @param data the data to set
+     */
+    public synchronized void setData(DestinationData data) {
+        this.data = data;
+        
+        this.name = data.getName();
+        this.topic = data.getTopic();
+        this.temporary=data.getTemporary();
+    }
+    
+    
+    public String toString() {
+        return "Destination{"+ (isTopic()?"Topic":"Queue") + ": "  +this.name.toStringUtf8()+"}";
+    }
+   
+}

Propchange: activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/Destination.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/group/BlazeGroupChannelImpl.java
URL: http://svn.apache.org/viewvc/activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/group/BlazeGroupChannelImpl.java?rev=738496&r1=738495&r2=738496&view=diff
==============================================================================
--- activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/group/BlazeGroupChannelImpl.java (original)
+++ activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/group/BlazeGroupChannelImpl.java Wed Jan 28 14:25:24 2009
@@ -27,6 +27,7 @@
 import org.apache.activeblaze.BlazeNoRouteException;
 import org.apache.activeblaze.BlazeRuntimeException;
 import org.apache.activeblaze.BlazeTopicListener;
+import org.apache.activeblaze.Destination;
 import org.apache.activeblaze.Processor;
 import org.apache.activeblaze.impl.destination.DestinationMatch;
 import org.apache.activeblaze.impl.processor.ChainedProcessor;
@@ -42,7 +43,6 @@
 import org.apache.activeblaze.util.PropertyUtil;
 import org.apache.activeblaze.util.SendRequest;
 import org.apache.activeblaze.wire.BlazeData;
-import org.apache.activeblaze.wire.DestinationData;
 import org.apache.activeblaze.wire.MemberData;
 import org.apache.activeblaze.wire.MessageType;
 import org.apache.activeblaze.wire.PacketData;
@@ -131,7 +131,6 @@
     }
 
     /**
-     * @return true if shutDown
      * @throws Exception
      * @see org.apache.activeblaze.Service#shutDown()
      */
@@ -142,7 +141,6 @@
     }
 
     /**
-     * @return true if started
      * @throws Exception
      * @see org.apache.activeblaze.Service#start()
      */
@@ -153,7 +151,6 @@
     }
 
     /**
-     * @return true if stopped
      * @throws Exception
      * @see org.apache.activeblaze.Service#stop()
      */
@@ -388,21 +385,21 @@
      * send Request
      * 
      * @param member
-     * @param destination
+     * @param destinationName
      * @param message
      * @param timeout
      * @return the response
      * @throws Exception
      */
-    public BlazeMessage sendRequest(MemberImpl member, Buffer destination, BlazeMessage message, int timeout)
+    public BlazeMessage sendRequest(MemberImpl member, Buffer destinationName, BlazeMessage message, int timeout)
             throws Exception {
         BlazeMessage result = null;
         if (member != null) {
             SendRequest request = new SendRequest();
             message.storeContent();
             BlazeData blazeData = message.getContent();
-            blazeData.setTopic(false);
-            blazeData.setDestination(destination);
+            Destination dest = new Destination(destinationName,false);
+            blazeData.setDestinationData(dest.getData());
             PacketData packetData = getPacketData(blazeData.type(), blazeData);
             synchronized (this.messageRequests) {
                 this.messageRequests.put(packetData.getMessageId(), request);
@@ -427,7 +424,6 @@
     public void sendReply(Member to, BlazeMessage response, String correlationId) throws Exception {
         response.storeContent();
         BlazeData blazeData = response.getContent();
-        blazeData.setTopic(false);
         PacketData data = getPacketData(blazeData.type(), blazeData);
         data.setCorrelationId(new Buffer(correlationId));
         data.setReliable(true);
@@ -442,9 +438,11 @@
         send(member, destination, blazeData);
     }
 
-    protected void send(MemberImpl member, Buffer destination, BlazeData blazeData) throws Exception {
-        blazeData.setTopic(false);
-        blazeData.setDestination(destination);
+    protected void send(MemberImpl member, Buffer destinationName, BlazeData blazeData) throws Exception {
+       Destination dest= new Destination(destinationName,false);
+       blazeData.clearDestinationData();
+        blazeData.setDestinationData(dest.getData());
+        
         PacketData data = getPacketData(MessageType.BLAZE_DATA, blazeData);
         data.setReliable(true);
         data.setResponseRequired(true);
@@ -567,15 +565,15 @@
 
     protected void doProcessBlazeData(PacketData data) throws Exception {
         BlazeMessage message = buildBlazeMessage(data);
-        if (message.getContent().getTopic()) {
+        if (message.getContent().getDestinationData().getTopic()) {
             dispatch(message);
         } else {
-            Buffer destination = message.getContent().getDestination();
-            if (this.inboxListener != null && this.producerId.equals(destination)) {
+            Buffer destinationName = message.getContent().getDestinationData().getName();
+            if (this.inboxListener != null && this.producerId.equals(destinationName)) {
                 this.inboxListener.onMessage(message);
             } else {
                 for (Map.Entry<Buffer, BlazeQueueListener> entry : this.queueMessageListenerMap.entrySet()) {
-                    if (DestinationMatch.isMatch(destination, entry.getKey())) {
+                    if (DestinationMatch.isMatch(destinationName, entry.getKey())) {
                         entry.getValue().onMessage(message);
                         break;
                     }
@@ -713,18 +711,17 @@
                     MemberImpl result = new MemberImpl(getLocalMember().getData().clone());
                     result.getData().clearDestination();
                     // add topic destinations
-                    for (Buffer destination : this.topicessageListenerMap.keySet()) {
-                        DestinationData data = new DestinationData();
-                        data.setDestination(destination);
-                        data.setTopic(true);
-                        result.getData().addDestination(data);
+                    for (Buffer name : this.topicessageListenerMap.keySet()) {
+                        
+                        Destination dest = new Destination(name);
+                        
+                        result.getData().addDestination(dest.getData());
                     }
                     // add Queue Destinations
-                    for (Buffer destination : this.queueMessageListenerMap.keySet()) {
-                        DestinationData data = new DestinationData();
-                        data.setDestination(destination);
-                        data.setTopic(false);
-                        result.getData().addDestination(data);
+                    for (Buffer name : this.queueMessageListenerMap.keySet()) {
+                        Destination dest = new Destination(name,false);
+                        
+                        result.getData().addDestination(dest.getData());
                     }
                     this.group.processMemberUpdate(this.local, result);
                     result.getData().setDestinationsChanged(true);

Modified: activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/group/Group.java
URL: http://svn.apache.org/viewvc/activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/group/Group.java?rev=738496&r1=738495&r2=738496&view=diff
==============================================================================
--- activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/group/Group.java (original)
+++ activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/group/Group.java Wed Jan 28 14:25:24 2009
@@ -351,7 +351,7 @@
     private void processDestinationsForStarted(MemberImpl member) {
         List<DestinationData> destList = member.getData().getDestinationList();
         for (DestinationData dest : destList) {
-            Buffer key = dest.getDestination();
+            Buffer key = dest.getName();
             Map<Buffer, List<MemberImpl>> map = null;
             if (dest.getTopic()) {
                 map = this.topicMap;
@@ -370,7 +370,7 @@
     private void processDestinationsForStopped(MemberImpl member) {
         List<DestinationData> destList = member.getData().getDestinationList();
         for (DestinationData dest : destList) {
-            Buffer key = dest.getDestination();
+            Buffer key = dest.getName();
             Map<Buffer, List<MemberImpl>> map = null;
             if (dest.getTopic()) {
                 map = this.topicMap;

Modified: activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/group/Member.java
URL: http://svn.apache.org/viewvc/activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/group/Member.java?rev=738496&r1=738495&r2=738496&view=diff
==============================================================================
--- activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/group/Member.java (original)
+++ activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/group/Member.java Wed Jan 28 14:25:24 2009
@@ -68,7 +68,7 @@
     /**
      * If there is two members have the same master weight, 
      * a secondary weight can be used
-     * @return
+     * @return refined weight
      */
     public long getRefinedMasterWeight();
     

Modified: activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/group/MemberImpl.java
URL: http://svn.apache.org/viewvc/activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/group/MemberImpl.java?rev=738496&r1=738495&r2=738496&view=diff
==============================================================================
--- activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/group/MemberImpl.java (original)
+++ activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/group/MemberImpl.java Wed Jan 28 14:25:24 2009
@@ -199,7 +199,6 @@
 
     /**
      * @param groupName
-     * @see org.apache.activeblaze.group.Member#addToGroup(java.lang.String)
      */
     public void addToGroup(String groupName) {
         {//synchronized (this.data) {
@@ -208,7 +207,7 @@
     }
 
     /**
-     * @return
+     * @return List<Dtring> of groups
      * @see org.apache.activeblaze.group.Member#getGroups()
      */
     public List<String> getGroups() {
@@ -225,7 +224,6 @@
 
     /**
      * @param groupName
-     * @see org.apache.activeblaze.group.Member#removeFromGroup(java.lang.String)
      */
     public void removeFromGroup(String groupName) {
         {//synchronized (this.data) {

Copied: activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/group/Subscription.java (from r738097, activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/group/Destination.java)
URL: http://svn.apache.org/viewvc/activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/group/Subscription.java?p2=activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/group/Subscription.java&p1=activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/group/Destination.java&r1=738097&r2=738496&rev=738496&view=diff
==============================================================================
--- activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/group/Destination.java (original)
+++ activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/group/Subscription.java Wed Jan 28 14:25:24 2009
@@ -23,15 +23,15 @@
  * Represents a Destination
  * 
  */
-class Destination {
+class Subscription {
     private final boolean topic;
-    private final Buffer destination;
+    private final Buffer name;
     private final MemberImpl member;
 
-    Destination(MemberImpl member, DestinationData data) {
+    Subscription(MemberImpl member, DestinationData data) {
         this.member = member;
         this.topic = data.getTopic();
-        this.destination = data.getDestination();
+        this.name = data.getName();
     }
 
     /**
@@ -44,8 +44,8 @@
     /**
      * @return the destination
      */
-    public Buffer getDestination() {
-        return this.destination;
+    public Buffer getName() {
+        return this.name;
     }
 
     /**
@@ -56,15 +56,15 @@
     }
 
     public int hashCode() {
-        return getMember().getId().hashCode() ^ getDestination().hashCode();
+        return getMember().getId().hashCode() ^ getName().hashCode();
     }
 
     public boolean equals(Object object) {
         boolean result = false;
-        if (object instanceof Destination) {
-            Destination other = (Destination) object;
+        if (object instanceof Subscription) {
+            Subscription other = (Subscription) object;
             result = other.getMember().getId().equals(this.member.getId())
-                    && other.destination.equals(this.destination);
+                    && other.name.equals(this.name);
         }
         return result;
     }

Added: activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/jms/BlazeJmsMessage.java
URL: http://svn.apache.org/viewvc/activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/jms/BlazeJmsMessage.java?rev=738496&view=auto
==============================================================================
--- activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/jms/BlazeJmsMessage.java (added)
+++ activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/jms/BlazeJmsMessage.java Wed Jan 28 14:25:24 2009
@@ -0,0 +1,530 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activeblaze.jms;
+
+import java.util.Enumeration;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import org.apache.activeblaze.BlazeException;
+import org.apache.activeblaze.BlazeMessage;
+import org.apache.activeblaze.BlazeRuntimeException;
+import org.apache.activeblaze.util.Callback;
+
+/**
+ * Implementation of a Jms Message
+ *
+ */
+public class BlazeJmsMessage extends BlazeMessage implements Message{
+    protected transient Callback acknowledgeCallback;
+    
+    
+    public BlazeJmsMessage clone() {
+        BlazeJmsMessage copy = new BlazeJmsMessage();
+        try {
+            copy(copy);
+        } catch (BlazeException e) {
+            throw new BlazeRuntimeException(e);
+        }
+        return copy;
+    } 
+    
+    protected void copy(BlazeJmsMessage copy) throws BlazeException {
+        super.copy(copy);
+        copy.acknowledgeCallback = this.acknowledgeCallback;
+    }
+    
+    /**
+     * @return the acknowledge <Code>Callback</Code>
+     */
+    public Callback getAcknowledgeCallback() {
+        return this.acknowledgeCallback;
+    }
+
+    /**
+     * @param acknowledgeCallback
+     */
+    public void setAcknowledgeCallback(Callback acknowledgeCallback) {
+        this.acknowledgeCallback = acknowledgeCallback;
+    }
+
+    /**
+     * @throws JMSException
+     * @see javax.jms.Message#acknowledge()
+     */
+    public void acknowledge() throws JMSException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /**
+     * @throws JMSException
+     * @see javax.jms.Message#clearBody()
+     */
+    public void clearBody() throws JMSException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /**
+     * @throws JMSException
+     * @see javax.jms.Message#clearProperties()
+     */
+    public void clearProperties() throws JMSException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /**
+     * @param name
+     * @return
+     * @throws JMSException
+     * @see javax.jms.Message#getBooleanProperty(java.lang.String)
+     */
+    public boolean getBooleanProperty(String name) throws JMSException {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    /**
+     * @param name
+     * @return
+     * @throws JMSException
+     * @see javax.jms.Message#getByteProperty(java.lang.String)
+     */
+    public byte getByteProperty(String name) throws JMSException {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    /**
+     * @param name
+     * @return
+     * @throws JMSException
+     * @see javax.jms.Message#getDoubleProperty(java.lang.String)
+     */
+    public double getDoubleProperty(String name) throws JMSException {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    /**
+     * @param name
+     * @return
+     * @throws JMSException
+     * @see javax.jms.Message#getFloatProperty(java.lang.String)
+     */
+    public float getFloatProperty(String name) throws JMSException {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    /**
+     * @param name
+     * @return
+     * @throws JMSException
+     * @see javax.jms.Message#getIntProperty(java.lang.String)
+     */
+    public int getIntProperty(String name) throws JMSException {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    /**
+     * @return
+     * @throws JMSException
+     * @see javax.jms.Message#getJMSCorrelationID()
+     */
+    public String getJMSCorrelationID() throws JMSException {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /**
+     * @return
+     * @throws JMSException
+     * @see javax.jms.Message#getJMSCorrelationIDAsBytes()
+     */
+    public byte[] getJMSCorrelationIDAsBytes() throws JMSException {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /**
+     * @return
+     * @throws JMSException
+     * @see javax.jms.Message#getJMSDeliveryMode()
+     */
+    public int getJMSDeliveryMode() throws JMSException {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    /**
+     * @return
+     * @throws JMSException
+     * @see javax.jms.Message#getJMSDestination()
+     */
+    public Destination getJMSDestination() throws JMSException {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /**
+     * @return
+     * @throws JMSException
+     * @see javax.jms.Message#getJMSExpiration()
+     */
+    public long getJMSExpiration() throws JMSException {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    /**
+     * @return
+     * @throws JMSException
+     * @see javax.jms.Message#getJMSMessageID()
+     */
+    public String getJMSMessageID() throws JMSException {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /**
+     * @return
+     * @throws JMSException
+     * @see javax.jms.Message#getJMSPriority()
+     */
+    public int getJMSPriority() throws JMSException {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    /**
+     * @return
+     * @throws JMSException
+     * @see javax.jms.Message#getJMSRedelivered()
+     */
+    public boolean getJMSRedelivered() throws JMSException {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    /**
+     * @return
+     * @throws JMSException
+     * @see javax.jms.Message#getJMSReplyTo()
+     */
+    public Destination getJMSReplyTo() throws JMSException {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /**
+     * @return
+     * @throws JMSException
+     * @see javax.jms.Message#getJMSTimestamp()
+     */
+    public long getJMSTimestamp() throws JMSException {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    /**
+     * @return
+     * @throws JMSException
+     * @see javax.jms.Message#getJMSType()
+     */
+    public String getJMSType() throws JMSException {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /**
+     * @param name
+     * @return
+     * @throws JMSException
+     * @see javax.jms.Message#getLongProperty(java.lang.String)
+     */
+    public long getLongProperty(String name) throws JMSException {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    /**
+     * @param name
+     * @return
+     * @throws JMSException
+     * @see javax.jms.Message#getObjectProperty(java.lang.String)
+     */
+    public Object getObjectProperty(String name) throws JMSException {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /**
+     * @return
+     * @throws JMSException
+     * @see javax.jms.Message#getPropertyNames()
+     */
+    public Enumeration getPropertyNames() throws JMSException {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /**
+     * @param name
+     * @return
+     * @throws JMSException
+     * @see javax.jms.Message#getShortProperty(java.lang.String)
+     */
+    public short getShortProperty(String name) throws JMSException {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    /**
+     * @param name
+     * @return
+     * @throws JMSException
+     * @see javax.jms.Message#getStringProperty(java.lang.String)
+     */
+    public String getStringProperty(String name) throws JMSException {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /**
+     * @param name
+     * @return
+     * @throws JMSException
+     * @see javax.jms.Message#propertyExists(java.lang.String)
+     */
+    public boolean propertyExists(String name) throws JMSException {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    /**
+     * @param name
+     * @param value
+     * @throws JMSException
+     * @see javax.jms.Message#setBooleanProperty(java.lang.String, boolean)
+     */
+    public void setBooleanProperty(String name, boolean value) throws JMSException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /**
+     * @param name
+     * @param value
+     * @throws JMSException
+     * @see javax.jms.Message#setByteProperty(java.lang.String, byte)
+     */
+    public void setByteProperty(String name, byte value) throws JMSException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /**
+     * @param name
+     * @param value
+     * @throws JMSException
+     * @see javax.jms.Message#setDoubleProperty(java.lang.String, double)
+     */
+    public void setDoubleProperty(String name, double value) throws JMSException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /**
+     * @param name
+     * @param value
+     * @throws JMSException
+     * @see javax.jms.Message#setFloatProperty(java.lang.String, float)
+     */
+    public void setFloatProperty(String name, float value) throws JMSException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /**
+     * @param name
+     * @param value
+     * @throws JMSException
+     * @see javax.jms.Message#setIntProperty(java.lang.String, int)
+     */
+    public void setIntProperty(String name, int value) throws JMSException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /**
+     * @param correlationID
+     * @throws JMSException
+     * @see javax.jms.Message#setJMSCorrelationID(java.lang.String)
+     */
+    public void setJMSCorrelationID(String correlationID) throws JMSException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /**
+     * @param correlationID
+     * @throws JMSException
+     * @see javax.jms.Message#setJMSCorrelationIDAsBytes(byte[])
+     */
+    public void setJMSCorrelationIDAsBytes(byte[] correlationID) throws JMSException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /**
+     * @param deliveryMode
+     * @throws JMSException
+     * @see javax.jms.Message#setJMSDeliveryMode(int)
+     */
+    public void setJMSDeliveryMode(int deliveryMode) throws JMSException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /**
+     * @param destination
+     * @throws JMSException
+     * @see javax.jms.Message#setJMSDestination(javax.jms.Destination)
+     */
+    public void setJMSDestination(Destination destination) throws JMSException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /**
+     * @param expiration
+     * @throws JMSException
+     * @see javax.jms.Message#setJMSExpiration(long)
+     */
+    public void setJMSExpiration(long expiration) throws JMSException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /**
+     * @param id
+     * @throws JMSException
+     * @see javax.jms.Message#setJMSMessageID(java.lang.String)
+     */
+    public void setJMSMessageID(String id) throws JMSException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /**
+     * @param priority
+     * @throws JMSException
+     * @see javax.jms.Message#setJMSPriority(int)
+     */
+    public void setJMSPriority(int priority) throws JMSException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /**
+     * @param redelivered
+     * @throws JMSException
+     * @see javax.jms.Message#setJMSRedelivered(boolean)
+     */
+    public void setJMSRedelivered(boolean redelivered) throws JMSException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /**
+     * @param replyTo
+     * @throws JMSException
+     * @see javax.jms.Message#setJMSReplyTo(javax.jms.Destination)
+     */
+    public void setJMSReplyTo(Destination replyTo) throws JMSException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /**
+     * @param timestamp
+     * @throws JMSException
+     * @see javax.jms.Message#setJMSTimestamp(long)
+     */
+    public void setJMSTimestamp(long timestamp) throws JMSException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /**
+     * @param type
+     * @throws JMSException
+     * @see javax.jms.Message#setJMSType(java.lang.String)
+     */
+    public void setJMSType(String type) throws JMSException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /**
+     * @param name
+     * @param value
+     * @throws JMSException
+     * @see javax.jms.Message#setLongProperty(java.lang.String, long)
+     */
+    public void setLongProperty(String name, long value) throws JMSException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /**
+     * @param name
+     * @param value
+     * @throws JMSException
+     * @see javax.jms.Message#setObjectProperty(java.lang.String, java.lang.Object)
+     */
+    public void setObjectProperty(String name, Object value) throws JMSException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /**
+     * @param name
+     * @param value
+     * @throws JMSException
+     * @see javax.jms.Message#setShortProperty(java.lang.String, short)
+     */
+    public void setShortProperty(String name, short value) throws JMSException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /**
+     * @param name
+     * @param value
+     * @throws JMSException
+     * @see javax.jms.Message#setStringProperty(java.lang.String, java.lang.String)
+     */
+    public void setStringProperty(String name, String value) throws JMSException {
+        // TODO Auto-generated method stub
+        
+    }
+}

Propchange: activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/jms/BlazeJmsMessage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/Callback.java
URL: http://svn.apache.org/viewvc/activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/Callback.java?rev=738496&view=auto
==============================================================================
--- activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/Callback.java (added)
+++ activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/Callback.java Wed Jan 28 14:25:24 2009
@@ -0,0 +1,32 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activeblaze.util;
+
+import org.apache.activeblaze.BlazeRuntimeException;
+
+/**
+ * A simple callback object 
+ * @version $Revision: 1.2 $
+ */
+public interface Callback {
+
+    /**
+     * Executes some piece of code 
+     * @throws BlazeRuntimeException 
+     */
+    void execute() throws BlazeRuntimeException;
+}

Propchange: activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/Callback.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/Callback.java
------------------------------------------------------------------------------
    svn:executable = *

Modified: activemq/activemq-blaze/trunk/src/main/proto/blaze.proto
URL: http://svn.apache.org/viewvc/activemq/activemq-blaze/trunk/src/main/proto/blaze.proto?rev=738496&r1=738495&r2=738496&view=diff
==============================================================================
--- activemq/activemq-blaze/trunk/src/main/proto/blaze.proto (original)
+++ activemq/activemq-blaze/trunk/src/main/proto/blaze.proto Wed Jan 28 14:25:24 2009
@@ -79,9 +79,11 @@
     }
     
     message DestinationData {
-      required bool topic = 1;
-      required bytes destination = 2;
+    optional bytes name =1;
+    optional bool topic =2;
+    optional bool temporary=3;
     }
+    
     message MemberData {
        //| option java_implments = "org.apache.activeblaze.impl.processor.PacketMessageType";
        //| option java_type_method = "MessageType";
@@ -222,13 +224,25 @@
       
     }
     
+    
+    
     message BlazeData {
       //| option java_implments = "org.apache.activeblaze.impl.processor.PacketMessageType";
     //| option java_type_method = "MessageType";
-      optional bool topic = 1 [default = true];
-      optional bytes Destination = 2[default = "test.topic"];    
-      optional int64 timestamp = 3;
-      optional MapData mapData = 4;
+     optional bool persistent = 1;
+     optional int32 priority = 2;
+     optional int32 redeliveryCounter = 3;
+     optional int64 timestamp = 4;
+     optional int64 expiration = 5;
+     optional bytes messageId = 6;
+     optional bytes correlationId = 7;
+     optional bytes fromId =8;
+     optional bytes type = 9;
+     optional bytes payload = 10;
+     optional DestinationData destinationData = 11;  
+     optional DestinationData replyToData = 12;  
+     optional MapData mapData = 14;
+      
     }
 
 	

Modified: activemq/activemq-blaze/trunk/src/test/java/org/apache/activeblaze/BlazeMessageTest.java
URL: http://svn.apache.org/viewvc/activemq/activemq-blaze/trunk/src/test/java/org/apache/activeblaze/BlazeMessageTest.java?rev=738496&r1=738495&r2=738496&view=diff
==============================================================================
--- activemq/activemq-blaze/trunk/src/test/java/org/apache/activeblaze/BlazeMessageTest.java (original)
+++ activemq/activemq-blaze/trunk/src/test/java/org/apache/activeblaze/BlazeMessageTest.java Wed Jan 28 14:25:24 2009
@@ -50,7 +50,7 @@
         }
         String bigString = bigSB.toString();
         msg.setString("bigString", bigString);
-        msg = msg.copy();
+        msg = msg.clone();
         assertEquals(msg.getBoolean("boolean"), true);
         assertEquals(msg.getByte("byte"), (byte) 1);
         assertEquals(msg.getBytes("bytes").length, 1);
@@ -71,56 +71,56 @@
         assertTrue(msg.getBoolean(NAME));
         msg.clear();
         msg.setString(NAME, "true");
-        msg = msg.copy();
+        msg = msg.clone();
         assertTrue(msg.getBoolean(NAME));
     }
 
     public void testGetByte() throws Exception {
         BlazeMessage msg = new BlazeMessage();
         msg.setByte(this.NAME, (byte) 1);
-        msg = msg.copy();
+        msg = msg.clone();
         assertTrue(msg.getByte(this.NAME) == (byte) 1);
     }
 
     public void testGetShort() throws Exception {
         BlazeMessage msg = new BlazeMessage();
         msg.setShort(this.NAME, (short) 1);
-        msg = msg.copy();
+        msg = msg.clone();
         assertTrue(msg.getShort(this.NAME) == (short) 1);
     }
 
     public void testGetChar() throws Exception {
         BlazeMessage msg = new BlazeMessage();
         msg.setChar(this.NAME, 'a');
-        msg = msg.copy();
+        msg = msg.clone();
         assertTrue(msg.getChar(this.NAME) == 'a');
     }
 
     public void testGetInt() throws Exception {
         BlazeMessage msg = new BlazeMessage();
         msg.setInt(this.NAME, 1);
-        msg = msg.copy();
+        msg = msg.clone();
         assertTrue(msg.getInt(this.NAME) == 1);
     }
 
     public void testGetLong() throws Exception {
         BlazeMessage msg = new BlazeMessage();
         msg.setLong(this.NAME, 1);
-        msg = msg.copy();
+        msg = msg.clone();
         assertTrue(msg.getLong(this.NAME) == 1);
     }
 
     public void testGetFloat() throws Exception {
         BlazeMessage msg = new BlazeMessage();
         msg.setFloat(this.NAME, 1.5f);
-        msg = msg.copy();
+        msg = msg.clone();
         assertTrue(msg.getFloat(this.NAME) == 1.5f);
     }
 
     public void testGetDouble() throws Exception {
         BlazeMessage msg = new BlazeMessage();
         msg.setDouble(this.NAME, 1.5);
-        msg = msg.copy();
+        msg = msg.clone();
         assertTrue(msg.getDouble(this.NAME) == 1.5);
     }
 
@@ -128,7 +128,7 @@
         BlazeMessage msg = new BlazeMessage();
         String str = "test";
         msg.setString(this.NAME, str);
-        msg = msg.copy();
+        msg = msg.clone();
         assertEquals(msg.getString(this.NAME), str);
     }
 
@@ -139,7 +139,7 @@
         System.arraycopy(bytes1, 0, bytes2, 0, 2);
         msg.setBytes(this.NAME, bytes1);
         msg.setBytes(this.NAME + "2", bytes1, 0, 2);
-        msg = msg.copy();
+        msg = msg.clone();
         assertTrue(Arrays.equals(msg.getBytes(this.NAME), bytes1));
         assertEquals(msg.getBytes(this.NAME + "2").length, bytes2.length);
     }
@@ -166,7 +166,7 @@
         msg.put("long", longValue);
         msg.put("short", shortValue);
         msg.put("string", stringValue);
-        msg = msg.copy();
+        msg = msg.clone();
         assertTrue(msg.getObject("boolean") instanceof Boolean);
         assertEquals(msg.getObject("boolean"), booleanValue);
         assertEquals(msg.getBoolean("boolean"), booleanValue.booleanValue());
@@ -214,7 +214,7 @@
         msg.put("object", "stringObj");
         msg.setShort("short", (short) 1);
         msg.setString("string", "string");
-        msg = msg.copy();
+        msg = msg.clone();
         Enumeration<String> mapNamesEnum = msg.getMapNames();
         List<String> mapNamesList = Collections.list(mapNamesEnum);
         assertEquals(mapNamesList.size(), 12);
@@ -235,7 +235,7 @@
     public void testItemExists() throws Exception {
         BlazeMessage msg = new BlazeMessage();
         msg.setString("exists", "test");
-        msg = msg.copy();
+        msg = msg.clone();
         assertTrue(msg.containsKey("exists"));
         assertFalse(msg.containsKey("doesntExist"));
     }



Mime
View raw message