activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r511598 - in /activemq/trunk/activemq-core/src: main/java/org/apache/activemq/ main/java/org/apache/activemq/blob/ main/java/org/apache/activemq/command/ main/java/org/apache/activemq/openwire/v3/ test/eclipse-resources/ test/java/org/apach...
Date Sun, 25 Feb 2007 20:31:25 GMT
Author: jstrachan
Date: Sun Feb 25 12:31:23 2007
New Revision: 511598

URL: http://svn.apache.org/viewvc?view=rev&rev=511598
Log:
An improvement of AMQ-1075 so that the BLOB upload policy can be configured more easily together with a simple provider of the BlobUploadStrategy (with the actual implementation detail stubbed out). Also added brokerUploadUrl to BrokerInfo so that the broker can inform the clients where to upload out-of-band messages to. Finally added a JMSXMimeType helper method to the ActiveMQ extension API for doing selectors on MIME types

Added:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/Message.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/blob/BlobTransferPolicy.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/blob/DefaultBlobUploadStrategy.java
Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQSession.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/BlobMessage.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/blob/BlobUploader.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQBlobMessage.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQBytesMessage.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMapMessage.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMessage.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQObjectMessage.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQStreamMessage.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQTextMessage.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/BrokerInfo.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/BrokerInfoMarshaller.java
    activemq/trunk/activemq-core/src/test/eclipse-resources/log4j.properties
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTempDestinationTest.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ZeroPrefetchConsumerTest.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v3/BrokerInfoTest.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java?view=diff&rev=511598&r1=511597&r2=511598
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java Sun Feb 25 12:31:23 2007
@@ -82,6 +82,7 @@
 import org.apache.activemq.util.JMSExceptionSupport;
 import org.apache.activemq.util.LongSequenceGenerator;
 import org.apache.activemq.util.ServiceSupport;
+import org.apache.activemq.blob.BlobTransferPolicy;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -116,6 +117,7 @@
     
     // Configuration options variables
     private ActiveMQPrefetchPolicy prefetchPolicy = new ActiveMQPrefetchPolicy();
+    private BlobTransferPolicy blobTransferPolicy;
     private RedeliveryPolicy redeliveryPolicy;
     private MessageTransformer transformer;
 
@@ -1405,7 +1407,19 @@
     public void setRedeliveryPolicy(RedeliveryPolicy redeliveryPolicy) {
         this.redeliveryPolicy = redeliveryPolicy;
     }
-    
+
+    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;
+    }
+
     /**
      * @return Returns the alwaysSessionAsync.
      */
@@ -1490,6 +1504,7 @@
                 this.brokerInfo = (BrokerInfo)command;
                 brokerInfoReceived.countDown();
                 this.optimizeAcknowledge &= !this.brokerInfo.isFaultTolerantConfiguration();
+                getBlobTransferPolicy().setBrokerUploadUrl(brokerInfo.getBrokerUploadUrl());
             }
             else if (command instanceof ControlCommand) {
                 onControlCommand((ControlCommand) command);

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java?view=diff&rev=511598&r1=511597&r2=511598
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java Sun Feb 25 12:31:23 2007
@@ -17,20 +17,6 @@
  */
 package org.apache.activemq;
 
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-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.jndi.JNDIBaseStorable;
 import org.apache.activemq.management.JMSStatsImpl;
 import org.apache.activemq.management.StatsCapable;
@@ -42,7 +28,20 @@
 import org.apache.activemq.util.JMSExceptionSupport;
 import org.apache.activemq.util.URISupport;
 import org.apache.activemq.util.URISupport.CompositeData;
+import org.apache.activemq.blob.BlobTransferPolicy;
 
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+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 java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Map;
+import java.util.Properties;
 import java.util.concurrent.Executor;
 import java.util.concurrent.ScheduledThreadPoolExecutor;
 import java.util.concurrent.ThreadFactory;
@@ -69,9 +68,10 @@
     protected String password;
     protected String clientID;
 
-    // optimization flags
+    // client policies
     private ActiveMQPrefetchPolicy prefetchPolicy = new ActiveMQPrefetchPolicy();
     private RedeliveryPolicy redeliveryPolicy = new RedeliveryPolicy();
+    private BlobTransferPolicy blobTransferPolicy = new BlobTransferPolicy();
     private MessageTransformer transformer;
 
     private boolean disableTimeStampsByDefault = false;
@@ -258,6 +258,7 @@
             connection.setUseRetroactiveConsumer(isUseRetroactiveConsumer());
             connection.setRedeliveryPolicy(getRedeliveryPolicy());
             connection.setTransformer(getTransformer());
+            connection.setBlobTransferPolicy(getBlobTransferPolicy().copy());
 
             transport.start();
 
@@ -400,6 +401,18 @@
 
     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;
     }
 
     /**

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQSession.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQSession.java?view=diff&rev=511598&r1=511597&r2=511598
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQSession.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQSession.java Sun Feb 25 12:31:23 2007
@@ -26,7 +26,7 @@
 import org.apache.activemq.util.Callback;
 import org.apache.activemq.util.LongSequenceGenerator;
 import org.apache.activemq.blob.BlobUploader;
-import org.apache.activemq.blob.BlobUploadStrategy;
+import org.apache.activemq.blob.BlobTransferPolicy;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -130,7 +130,6 @@
  * @see javax.jms.XASession
  */
 public class ActiveMQSession implements Session, QueueSession, TopicSession, StatsCapable, ActiveMQDispatcher {
-    private BlobUploadStrategy blobUploadStrategy;
 
     public static interface DeliveryListener {
         public void beforeDelivery(ActiveMQSession session, Message msg);
@@ -146,6 +145,7 @@
     private TransactionContext transactionContext;
     private DeliveryListener deliveryListener;
     private MessageTransformer transformer;
+    private BlobTransferPolicy blobTransferPolicy;
 
     protected final ActiveMQConnection connection;
     protected final SessionInfo info;
@@ -190,6 +190,7 @@
         stats = new JMSSessionStatsImpl(producers, consumers);
         this.connection.asyncSendPacket(info);
         setTransformer(connection.getTransformer());
+        setBlobTransferPolicy(connection.getBlobTransferPolicy());
         
         if( connection.isStarted() )
             start();
@@ -408,8 +409,9 @@
     public BlobMessage createBlobMessage(File file) throws JMSException {
         ActiveMQBlobMessage message = new ActiveMQBlobMessage();
         configureMessage(message);
-        message.setBlobUploader(new BlobUploader(blobUploadStrategy, file));
+        message.setBlobUploader(new BlobUploader(getBlobTransferPolicy(), file));
         message.setDeletedByBroker(true);
+        message.setName(file.getName());
         return message;
     }
 
@@ -431,7 +433,7 @@
     public BlobMessage createBlobMessage(InputStream in) throws JMSException {
         ActiveMQBlobMessage message = new ActiveMQBlobMessage();
         configureMessage(message);
-        message.setBlobUploader(new BlobUploader(blobUploadStrategy, in));
+        message.setBlobUploader(new BlobUploader(getBlobTransferPolicy(), in));
         message.setDeletedByBroker(true);
         return message;
     }
@@ -1743,22 +1745,22 @@
         this.transformer = transformer;
     }
 
-    public List getUnconsumedMessages() {
-		return executor.getUnconsumedMessages();
-	}
-
-
-    public BlobUploadStrategy getBlobUploadStrategy() {
-        return blobUploadStrategy;
+    public BlobTransferPolicy getBlobTransferPolicy() {
+        return blobTransferPolicy;
     }
 
     /**
-     * Sets the upload strategy for BLOBs which are sent out-of-band by uploading them
-     * to some remote repository or the broker
+     * Sets the policy used to describe how out-of-band BLOBs (Binary Large OBjects)
+     * are transferred from producers to brokers to consumers
      */
-    public void setBlobUploadStrategy(BlobUploadStrategy blobUploadStrategy) {
-        this.blobUploadStrategy = blobUploadStrategy;
+    public void setBlobTransferPolicy(BlobTransferPolicy blobTransferPolicy) {
+        this.blobTransferPolicy = blobTransferPolicy;
     }
+
+    public List getUnconsumedMessages() {
+		return executor.getUnconsumedMessages();
+	}
+
 
     public String toString() {
         return "ActiveMQSession {id="+info.getSessionId()+",started="+started.get()+"}";

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/BlobMessage.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/BlobMessage.java?view=diff&rev=511598&r1=511597&r2=511598
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/BlobMessage.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/BlobMessage.java Sun Feb 25 12:31:23 2007
@@ -16,7 +16,6 @@
  */
 package org.apache.activemq;
 
-import javax.jms.Message;
 import javax.jms.JMSException;
 import java.net.URL;
 import java.net.MalformedURLException;
@@ -54,4 +53,11 @@
      */
     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);
 }

Added: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/Message.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/Message.java?view=auto&rev=511598
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/Message.java (added)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/Message.java Sun Feb 25 12:31:23 2007
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF 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
+ *
+ * @version $Revision: $
+ */
+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
+     */
+    public String getJMSXMimeType();
+
+}

Added: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/blob/BlobTransferPolicy.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/blob/BlobTransferPolicy.java?view=auto&rev=511598
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/blob/BlobTransferPolicy.java (added)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/blob/BlobTransferPolicy.java Sun Feb 25 12:31:23 2007
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF 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;
+
+/**
+ * The policy for configuring how BLOBs (Binary Large OBjects) are transferred
+ * out of band between producers, brokers and consumers.
+ *
+ * @version $Revision: $
+ */
+public class BlobTransferPolicy {
+    private String defaultUploadUrl = "http://localhost:8080";
+    private String brokerUploadUrl;
+    private String uploadUrl;
+    private BlobUploadStrategy uploadStrategy;
+
+    /**
+     * 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.uploadStrategy = this.uploadStrategy;
+        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;
+    }
+
+    /**
+     * Sets the upload strategy to use for uploading BLOBs to some URL
+     */
+    public void setUploadStrategy(BlobUploadStrategy uploadStrategy) {
+        this.uploadStrategy = uploadStrategy;
+    }
+
+    protected BlobUploadStrategy createUploadStrategy() {
+        return new DefaultBlobUploadStrategy(this);
+    }
+}

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/blob/BlobUploader.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/blob/BlobUploader.java?view=diff&rev=511598&r1=511597&r2=511598
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/blob/BlobUploader.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/blob/BlobUploader.java Sun Feb 25 12:31:23 2007
@@ -20,8 +20,8 @@
 
 import javax.jms.JMSException;
 import java.io.File;
-import java.io.*;
 import java.io.IOException;
+import java.io.InputStream;
 import java.net.URL;
 
 /**
@@ -31,27 +31,36 @@
  */
 public class BlobUploader {
 
-    private BlobUploadStrategy strategy;
+    private BlobTransferPolicy blobTransferPolicy;
     private File file;
     private InputStream in;
 
 
-    public BlobUploader(BlobUploadStrategy strategy, File file) {
-        this.strategy = strategy;
-        this.file = file;
+    public BlobUploader(BlobTransferPolicy blobTransferPolicy, InputStream in) {
+        this.blobTransferPolicy = blobTransferPolicy;
+        this.in = in;
     }
 
-    public BlobUploader(BlobUploadStrategy strategy, InputStream in) {
-        this.strategy = strategy;
-        this.in = in;
+    public BlobUploader(BlobTransferPolicy blobTransferPolicy, File file) {
+        this.blobTransferPolicy = blobTransferPolicy;
+        this.file = file;
     }
 
     public URL upload(ActiveMQBlobMessage message) throws JMSException, IOException {
         if (file != null) {
-            return strategy.uploadFile(message, file);
+            return getStrategy().uploadFile(message, file);
         }
         else {
-            return strategy.uploadStream(message, in);
+            return getStrategy().uploadStream(message, in);
         }
+    }
+
+
+    public BlobTransferPolicy getBlobTransferPolicy() {
+        return blobTransferPolicy;
+    }
+
+    public BlobUploadStrategy getStrategy() {
+        return getBlobTransferPolicy().getUploadStrategy();
     }
 }

Added: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/blob/DefaultBlobUploadStrategy.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/blob/DefaultBlobUploadStrategy.java?view=auto&rev=511598
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/blob/DefaultBlobUploadStrategy.java (added)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/blob/DefaultBlobUploadStrategy.java Sun Feb 25 12:31:23 2007
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF 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 org.apache.activemq.command.ActiveMQBlobMessage;
+
+import javax.jms.JMSException;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+/**
+ * A default implementation of {@link BlobUploadStrategy} which uses the URL class to upload
+ * files or streams to a remote URL
+ */
+public class DefaultBlobUploadStrategy implements BlobUploadStrategy {
+    private BlobTransferPolicy transferPolicy;
+
+    public DefaultBlobUploadStrategy(BlobTransferPolicy transferPolicy) {
+        this.transferPolicy = transferPolicy;
+    }
+
+    public URL uploadFile(ActiveMQBlobMessage message, File file) throws JMSException, IOException {
+        URL url = createUploadURL(message);
+        // TODO upload to URL
+        // return url;
+        throw new JMSException("Not implemented yet!");
+    }
+
+    public URL uploadStream(ActiveMQBlobMessage message, InputStream in) throws JMSException, IOException {
+        URL url = createUploadURL(message);
+        // TODO upload to URL
+        // return url;
+        throw new JMSException("Not implemented yet!");
+    }
+
+    protected URL createUploadURL(ActiveMQBlobMessage message) throws JMSException, MalformedURLException {
+        return new URL(transferPolicy.getUploadUrl() + message.getMessageId().toString());
+    }
+}

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQBlobMessage.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQBlobMessage.java?view=diff&rev=511598&r1=511597&r2=511598
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQBlobMessage.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQBlobMessage.java Sun Feb 25 12:31:23 2007
@@ -39,6 +39,7 @@
 
     private String remoteBlobUrl;
     private String mimeType;
+    private String name;
     private boolean deletedByBroker;
 
     private transient BlobUploader blobUploader;
@@ -90,6 +91,19 @@
         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
      */
@@ -99,6 +113,10 @@
 
     public void setDeletedByBroker(boolean deletedByBroker) {
         this.deletedByBroker = deletedByBroker;
+    }
+
+    public String getJMSXMimeType() {
+        return getMimeType();
     }
 
     public InputStream getInputStream() throws IOException, JMSException {

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQBytesMessage.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQBytesMessage.java?view=diff&rev=511598&r1=511597&r2=511598
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQBytesMessage.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQBytesMessage.java Sun Feb 25 12:31:23 2007
@@ -107,6 +107,11 @@
     public byte getDataStructureType() {
         return DATA_STRUCTURE_TYPE;
     }
+    
+    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. <P>

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMapMessage.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMapMessage.java?view=diff&rev=511598&r1=511597&r2=511598
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMapMessage.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMapMessage.java Sun Feb 25 12:31:23 2007
@@ -147,6 +147,11 @@
     public byte getDataStructureType() {
         return DATA_STRUCTURE_TYPE;
     }
+    
+    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. <P>

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMessage.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMessage.java?view=diff&rev=511598&r1=511597&r2=511598
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMessage.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMessage.java Sun Feb 25 12:31:23 2007
@@ -44,7 +44,7 @@
  * 
  * @version $Revision:$
  */
-public class ActiveMQMessage extends Message implements javax.jms.Message {
+public class ActiveMQMessage extends Message implements org.apache.activemq.Message {
 
     public static final byte DATA_STRUCTURE_TYPE = CommandTypes.ACTIVEMQ_MESSAGE;
 
@@ -180,7 +180,11 @@
     public void setJMSCorrelationIDAsBytes(byte[] correlationId) throws JMSException {
         this.setCorrelationId(decodeString(correlationId));
     }
-    
+
+    public String getJMSXMimeType() {
+        return "jms/message";
+    }
+
     static protected String decodeString(byte[] data) throws JMSException {
         try {
             if (data == null) {

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQObjectMessage.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQObjectMessage.java?view=diff&rev=511598&r1=511597&r2=511598
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQObjectMessage.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQObjectMessage.java Sun Feb 25 12:31:23 2007
@@ -21,6 +21,15 @@
 
 
 
+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 javax.jms.JMSException;
+import javax.jms.ObjectMessage;
 import java.io.DataInputStream;
 import java.io.DataOutputStream;
 import java.io.IOException;
@@ -31,16 +40,6 @@
 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;
-
 /**
  * An <CODE>ObjectMessage</CODE> object is used to send a message that contains a serializable object in the Java
  * programming language ("Java object"). It inherits from the <CODE>Message</CODE> interface and adds a body containing
@@ -107,6 +106,11 @@
     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.

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQStreamMessage.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQStreamMessage.java?view=diff&rev=511598&r1=511597&r2=511598
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQStreamMessage.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQStreamMessage.java Sun Feb 25 12:31:23 2007
@@ -151,6 +151,11 @@
         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. <p/>

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQTextMessage.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQTextMessage.java?view=diff&rev=511598&r1=511597&r2=511598
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQTextMessage.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQTextMessage.java Sun Feb 25 12:31:23 2007
@@ -17,18 +17,6 @@
  */
 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.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;
@@ -37,6 +25,17 @@
 import org.apache.activemq.util.MarshallingSupport;
 import org.apache.activemq.wireformat.WireFormat;
 
+import javax.jms.JMSException;
+import javax.jms.MessageNotWriteableException;
+import javax.jms.TextMessage;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.zip.DeflaterOutputStream;
+import java.util.zip.InflaterInputStream;
+
 /**
  * 
  * @openwire:marshaller code="28"
@@ -61,6 +60,10 @@
     
     public byte getDataStructureType() {
         return DATA_STRUCTURE_TYPE;
+    }
+    
+    public String getJMSXMimeType() {
+        return "jms/text-message";
     }
 
     public void setText(String text) throws MessageNotWriteableException {

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/BrokerInfo.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/BrokerInfo.java?view=diff&rev=511598&r1=511597&r2=511598
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/BrokerInfo.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/BrokerInfo.java Sun Feb 25 12:31:23 2007
@@ -38,6 +38,8 @@
     BrokerInfo peerBrokerInfos[];
     String brokerName;
     long connectionId;
+    String brokerUploadUrl;
+
 
     public boolean isBrokerInfo(){
         return true;
@@ -184,5 +186,17 @@
 		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;
+    }
 }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/BrokerInfoMarshaller.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/BrokerInfoMarshaller.java?view=diff&rev=511598&r1=511597&r2=511598
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/BrokerInfoMarshaller.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/BrokerInfoMarshaller.java Sun Feb 25 12:31:23 2007
@@ -1 +1 @@
-/**
 *
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.activemq.openwire.v3;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

import org.apache.activemq.openwire.*;
import org.apache.activ
 emq.command.*;



/**
 * Marshalling code for Open Wire Format for BrokerInfoMarshaller
 *
 *
 * NOTE!: This file is auto generated - do not modify!
 *        if you need to make a change, please see the modify the groovy scripts in the
 *        under src/gram/script and then use maven openwire:generate to regenerate 
 *        this file.
 *
 * @version $Revision$
 */
public class BrokerInfoMarshaller extends BaseCommandMarshaller {

    /**
     * Return the type of Data Structure we marshal
     * @return short representation of the type data structure
     */
    public byte getDataStructureType() {
        return BrokerInfo.DATA_STRUCTURE_TYPE;
    }
    
    /**
     * @return a new object instance
     */
    public DataStructure createObject() {
        return new BrokerInfo();
    }

    /**
     * Un-marshal an object instance from the data input stream
     *
     * @param o the object to un-marshal
     * @param dataIn the data input stream to build the object fr
 om
     * @throws IOException
     */
    public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException {
        super.tightUnmarshal(wireFormat, o, dataIn, bs);

        BrokerInfo info = (BrokerInfo)o;
        info.setBrokerId((org.apache.activemq.command.BrokerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
        info.setBrokerURL(tightUnmarshalString(dataIn, bs));

        if (bs.readBoolean()) {
            short size = dataIn.readShort();
            org.apache.activemq.command.BrokerInfo value[] = new org.apache.activemq.command.BrokerInfo[size];
            for( int i=0; i < size; i++ ) {
                value[i] = (org.apache.activemq.command.BrokerInfo) tightUnmarsalNestedObject(wireFormat,dataIn, bs);
            }
            info.setPeerBrokerInfos(value);
        }
        else {
            info.setPeerBrokerInfos(null);
        }
        info.setBrokerName(tightUnmarshalString(dataIn, bs));
 
        info.setSlaveBroker(bs.readBoolean());
        info.setMasterBroker(bs.readBoolean());
        info.setFaultTolerantConfiguration(bs.readBoolean());
        info.setDuplexConnection(bs.readBoolean());
        info.setNetworkConnection(bs.readBoolean());
        info.setConnectionId(tightUnmarshalLong(wireFormat, dataIn, bs));

    }


    /**
     * Write the booleans that this object uses to a BooleanStream
     */
    public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {

        BrokerInfo info = (BrokerInfo)o;

        int rc = super.tightMarshal1(wireFormat, o, bs);
        rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getBrokerId(), bs);
        rc += tightMarshalString1(info.getBrokerURL(), bs);
        rc += tightMarshalObjectArray1(wireFormat, info.getPeerBrokerInfos(), bs);
        rc += tightMarshalString1(info.getBrokerName(), bs);
        bs.writeBoolean(info.isSlaveBroker());
        bs.wri
 teBoolean(info.isMasterBroker());
        bs.writeBoolean(info.isFaultTolerantConfiguration());
        bs.writeBoolean(info.isDuplexConnection());
        bs.writeBoolean(info.isNetworkConnection());
        rc+=tightMarshalLong1(wireFormat, info.getConnectionId(), bs);

        return rc + 0;
    }

    /**
     * Write a object instance to data output stream
     *
     * @param o the instance to be marshaled
     * @param dataOut the output stream
     * @throws IOException thrown if an error occurs
     */
    public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException {
        super.tightMarshal2(wireFormat, o, dataOut, bs);

        BrokerInfo info = (BrokerInfo)o;
        tightMarshalCachedObject2(wireFormat, (DataStructure)info.getBrokerId(), dataOut, bs);
        tightMarshalString2(info.getBrokerURL(), dataOut, bs);
        tightMarshalObjectArray2(wireFormat, info.getPeerBrokerInfos(), dataOut, bs);
   
      tightMarshalString2(info.getBrokerName(), dataOut, bs);
        bs.readBoolean();
        bs.readBoolean();
        bs.readBoolean();
        bs.readBoolean();
        bs.readBoolean();
        tightMarshalLong2(wireFormat, info.getConnectionId(), dataOut, bs);

    }

    /**
     * Un-marshal an object instance from the data input stream
     *
     * @param o the object to un-marshal
     * @param dataIn the data input stream to build the object from
     * @throws IOException
     */
    public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException {
        super.looseUnmarshal(wireFormat, o, dataIn);

        BrokerInfo info = (BrokerInfo)o;
        info.setBrokerId((org.apache.activemq.command.BrokerId) looseUnmarsalCachedObject(wireFormat, dataIn));
        info.setBrokerURL(looseUnmarshalString(dataIn));

        if (dataIn.readBoolean()) {
            short size = dataIn.readShort();
            org.apache.activemq.comman
 d.BrokerInfo value[] = new org.apache.activemq.command.BrokerInfo[size];
            for( int i=0; i < size; i++ ) {
                value[i] = (org.apache.activemq.command.BrokerInfo) looseUnmarsalNestedObject(wireFormat,dataIn);
            }
            info.setPeerBrokerInfos(value);
        }
        else {
            info.setPeerBrokerInfos(null);
        }
        info.setBrokerName(looseUnmarshalString(dataIn));
        info.setSlaveBroker(dataIn.readBoolean());
        info.setMasterBroker(dataIn.readBoolean());
        info.setFaultTolerantConfiguration(dataIn.readBoolean());
        info.setDuplexConnection(dataIn.readBoolean());
        info.setNetworkConnection(dataIn.readBoolean());
        info.setConnectionId(looseUnmarshalLong(wireFormat, dataIn));

    }


    /**
     * Write the booleans that this object uses to a BooleanStream
     */
    public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException {

        Brok
 erInfo info = (BrokerInfo)o;

        super.looseMarshal(wireFormat, o, dataOut);
        looseMarshalCachedObject(wireFormat, (DataStructure)info.getBrokerId(), dataOut);
        looseMarshalString(info.getBrokerURL(), dataOut);
        looseMarshalObjectArray(wireFormat, info.getPeerBrokerInfos(), dataOut);
        looseMarshalString(info.getBrokerName(), dataOut);
        dataOut.writeBoolean(info.isSlaveBroker());
        dataOut.writeBoolean(info.isMasterBroker());
        dataOut.writeBoolean(info.isFaultTolerantConfiguration());
        dataOut.writeBoolean(info.isDuplexConnection());
        dataOut.writeBoolean(info.isNetworkConnection());
        looseMarshalLong(wireFormat, info.getConnectionId(), dataOut);

    }
}
\ No newline at end of file
+/**
 *
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.activemq.openwire.v3;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

import org.apache.activemq.openwire.*;
import org.apache.activ
 emq.command.*;



/**
 * Marshalling code for Open Wire Format for BrokerInfoMarshaller
 *
 *
 * NOTE!: This file is auto generated - do not modify!
 *        if you need to make a change, please see the modify the groovy scripts in the
 *        under src/gram/script and then use maven openwire:generate to regenerate 
 *        this file.
 *
 * @version $Revision$
 */
public class BrokerInfoMarshaller extends BaseCommandMarshaller {

    /**
     * Return the type of Data Structure we marshal
     * @return short representation of the type data structure
     */
    public byte getDataStructureType() {
        return BrokerInfo.DATA_STRUCTURE_TYPE;
    }
    
    /**
     * @return a new object instance
     */
    public DataStructure createObject() {
        return new BrokerInfo();
    }

    /**
     * Un-marshal an object instance from the data input stream
     *
     * @param o the object to un-marshal
     * @param dataIn the data input stream to build the object fr
 om
     * @throws IOException
     */
    public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException {
        super.tightUnmarshal(wireFormat, o, dataIn, bs);

        BrokerInfo info = (BrokerInfo)o;
        info.setBrokerId((org.apache.activemq.command.BrokerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
        info.setBrokerURL(tightUnmarshalString(dataIn, bs));

        if (bs.readBoolean()) {
            short size = dataIn.readShort();
            org.apache.activemq.command.BrokerInfo value[] = new org.apache.activemq.command.BrokerInfo[size];
            for( int i=0; i < size; i++ ) {
                value[i] = (org.apache.activemq.command.BrokerInfo) tightUnmarsalNestedObject(wireFormat,dataIn, bs);
            }
            info.setPeerBrokerInfos(value);
        }
        else {
            info.setPeerBrokerInfos(null);
        }
        info.setBrokerName(tightUnmarshalString(dataIn, bs));
 
        info.setSlaveBroker(bs.readBoolean());
        info.setMasterBroker(bs.readBoolean());
        info.setFaultTolerantConfiguration(bs.readBoolean());
        info.setDuplexConnection(bs.readBoolean());
        info.setNetworkConnection(bs.readBoolean());
        info.setConnectionId(tightUnmarshalLong(wireFormat, dataIn, bs));
        info.setBrokerUploadUrl(tightUnmarshalString(dataIn, bs));

    }


    /**
     * Write the booleans that this object uses to a BooleanStream
     */
    public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {

        BrokerInfo info = (BrokerInfo)o;

        int rc = super.tightMarshal1(wireFormat, o, bs);
        rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getBrokerId(), bs);
        rc += tightMarshalString1(info.getBrokerURL(), bs);
        rc += tightMarshalObjectArray1(wireFormat, info.getPeerBrokerInfos(), bs);
        rc += tightMarshalString1(info.getBrokerName(),
  bs);
        bs.writeBoolean(info.isSlaveBroker());
        bs.writeBoolean(info.isMasterBroker());
        bs.writeBoolean(info.isFaultTolerantConfiguration());
        bs.writeBoolean(info.isDuplexConnection());
        bs.writeBoolean(info.isNetworkConnection());
        rc+=tightMarshalLong1(wireFormat, info.getConnectionId(), bs);
        rc += tightMarshalString1(info.getBrokerUploadUrl(), bs);

        return rc + 0;
    }

    /**
     * Write a object instance to data output stream
     *
     * @param o the instance to be marshaled
     * @param dataOut the output stream
     * @throws IOException thrown if an error occurs
     */
    public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException {
        super.tightMarshal2(wireFormat, o, dataOut, bs);

        BrokerInfo info = (BrokerInfo)o;
        tightMarshalCachedObject2(wireFormat, (DataStructure)info.getBrokerId(), dataOut, bs);
        tightMarsha
 lString2(info.getBrokerURL(), dataOut, bs);
        tightMarshalObjectArray2(wireFormat, info.getPeerBrokerInfos(), dataOut, bs);
        tightMarshalString2(info.getBrokerName(), dataOut, bs);
        bs.readBoolean();
        bs.readBoolean();
        bs.readBoolean();
        bs.readBoolean();
        bs.readBoolean();
        tightMarshalLong2(wireFormat, info.getConnectionId(), dataOut, bs);
        tightMarshalString2(info.getBrokerUploadUrl(), dataOut, bs);

    }

    /**
     * Un-marshal an object instance from the data input stream
     *
     * @param o the object to un-marshal
     * @param dataIn the data input stream to build the object from
     * @throws IOException
     */
    public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException {
        super.looseUnmarshal(wireFormat, o, dataIn);

        BrokerInfo info = (BrokerInfo)o;
        info.setBrokerId((org.apache.activemq.command.BrokerId) looseUnmarsalCachedObje
 ct(wireFormat, dataIn));
        info.setBrokerURL(looseUnmarshalString(dataIn));

        if (dataIn.readBoolean()) {
            short size = dataIn.readShort();
            org.apache.activemq.command.BrokerInfo value[] = new org.apache.activemq.command.BrokerInfo[size];
            for( int i=0; i < size; i++ ) {
                value[i] = (org.apache.activemq.command.BrokerInfo) looseUnmarsalNestedObject(wireFormat,dataIn);
            }
            info.setPeerBrokerInfos(value);
        }
        else {
            info.setPeerBrokerInfos(null);
        }
        info.setBrokerName(looseUnmarshalString(dataIn));
        info.setSlaveBroker(dataIn.readBoolean());
        info.setMasterBroker(dataIn.readBoolean());
        info.setFaultTolerantConfiguration(dataIn.readBoolean());
        info.setDuplexConnection(dataIn.readBoolean());
        info.setNetworkConnection(dataIn.readBoolean());
        info.setConnectionId(looseUnmarshalLong(wireFormat, dataIn));
        in
 fo.setBrokerUploadUrl(looseUnmarshalString(dataIn));

    }


    /**
     * Write the booleans that this object uses to a BooleanStream
     */
    public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException {

        BrokerInfo info = (BrokerInfo)o;

        super.looseMarshal(wireFormat, o, dataOut);
        looseMarshalCachedObject(wireFormat, (DataStructure)info.getBrokerId(), dataOut);
        looseMarshalString(info.getBrokerURL(), dataOut);
        looseMarshalObjectArray(wireFormat, info.getPeerBrokerInfos(), dataOut);
        looseMarshalString(info.getBrokerName(), dataOut);
        dataOut.writeBoolean(info.isSlaveBroker());
        dataOut.writeBoolean(info.isMasterBroker());
        dataOut.writeBoolean(info.isFaultTolerantConfiguration());
        dataOut.writeBoolean(info.isDuplexConnection());
        dataOut.writeBoolean(info.isNetworkConnection());
        looseMarshalLong(wireFormat, info.getConnectionId(), dataOu
 t);
        looseMarshalString(info.getBrokerUploadUrl(), dataOut);

    }
}
\ No newline at end of file

Modified: activemq/trunk/activemq-core/src/test/eclipse-resources/log4j.properties
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/eclipse-resources/log4j.properties?view=diff&rev=511598&r1=511597&r2=511598
==============================================================================
--- activemq/trunk/activemq-core/src/test/eclipse-resources/log4j.properties (original)
+++ activemq/trunk/activemq-core/src/test/eclipse-resources/log4j.properties Sun Feb 25 12:31:23 2007
@@ -20,7 +20,7 @@
 #
 log4j.rootLogger=WARN, out
 
-log4j.logger.org.apache.activemq=INFO
+log4j.logger.org.apache.activemq=DEBUG
 
 # CONSOLE appender not used by default
 log4j.appender.out=org.apache.log4j.ConsoleAppender

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTempDestinationTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTempDestinationTest.java?view=diff&rev=511598&r1=511597&r2=511598
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTempDestinationTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTempDestinationTest.java Sun Feb 25 12:31:23 2007
@@ -17,12 +17,21 @@
  */
 package org.apache.activemq;
 
-import java.util.ArrayList;
-import javax.jms.*;
-
-import org.apache.activemq.ActiveMQConnectionFactory;
-
 import junit.framework.TestCase;
+
+import javax.jms.BytesMessage;
+import javax.jms.Connection;
+import javax.jms.DeliveryMode;
+import javax.jms.InvalidDestinationException;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TemporaryQueue;
+import javax.jms.TextMessage;
+import java.util.ArrayList;
 
 /**
  * @version

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ZeroPrefetchConsumerTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ZeroPrefetchConsumerTest.java?view=diff&rev=511598&r1=511597&r2=511598
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ZeroPrefetchConsumerTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ZeroPrefetchConsumerTest.java Sun Feb 25 12:31:23 2007
@@ -21,7 +21,15 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import javax.jms.*;
+import javax.jms.Connection;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageListener;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
 
 /**
  * 

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v3/BrokerInfoTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v3/BrokerInfoTest.java?view=diff&rev=511598&r1=511597&r2=511598
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v3/BrokerInfoTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v3/BrokerInfoTest.java Sun Feb 25 12:31:23 2007
@@ -1 +1 @@
-/**
 *
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.activemq.openwire.v3;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;

import org.apache.activemq.openwire.*;
import org.a
 pache.activemq.command.*;


/**
 * Test case for the OpenWire marshalling for BrokerInfo
 *
 *
 * NOTE!: This file is auto generated - do not modify!
 *        if you need to make a change, please see the modify the groovy scripts in the
 *        under src/gram/script and then use maven openwire:generate to regenerate 
 *        this file.
 *
 * @version $Revision: $
 */
public class BrokerInfoTest extends BaseCommandTestSupport {


    public static BrokerInfoTest SINGLETON = new BrokerInfoTest();

    public Object createObject() throws Exception {
        BrokerInfo info = new BrokerInfo();
        populateObject(info);
        return info;
    }

    protected void populateObject(Object object) throws Exception {
        super.populateObject(object);
        BrokerInfo info = (BrokerInfo) object;

        info.setBrokerId(createBrokerId("BrokerId:1"));
        info.setBrokerURL("BrokerURL:2");
        {
            BrokerInfo value[] = new BrokerInfo[0];
            for
 ( int i=0; i < 0; i++ ) {
                value[i] = createBrokerInfo("PeerBrokerInfos:3");
            }
            info.setPeerBrokerInfos(value);
        }
        info.setBrokerName("BrokerName:4");
        info.setSlaveBroker(true);
        info.setMasterBroker(false);
        info.setFaultTolerantConfiguration(true);
        info.setDuplexConnection(false);
        info.setNetworkConnection(true);
        info.setConnectionId(1);
    }
}
\ No newline at end of file
+/**
 *
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.activemq.openwire.v3;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;

import org.apache.activemq.openwire.*;
import org.a
 pache.activemq.command.*;


/**
 * Test case for the OpenWire marshalling for BrokerInfo
 *
 *
 * NOTE!: This file is auto generated - do not modify!
 *        if you need to make a change, please see the modify the groovy scripts in the
 *        under src/gram/script and then use maven openwire:generate to regenerate 
 *        this file.
 *
 * @version $Revision: $
 */
public class BrokerInfoTest extends BaseCommandTestSupport {


    public static BrokerInfoTest SINGLETON = new BrokerInfoTest();

    public Object createObject() throws Exception {
        BrokerInfo info = new BrokerInfo();
        populateObject(info);
        return info;
    }

    protected void populateObject(Object object) throws Exception {
        super.populateObject(object);
        BrokerInfo info = (BrokerInfo) object;

        info.setBrokerId(createBrokerId("BrokerId:1"));
        info.setBrokerURL("BrokerURL:2");
        {
            BrokerInfo value[] = new BrokerInfo[0];
            for
 ( int i=0; i < 0; i++ ) {
                value[i] = createBrokerInfo("PeerBrokerInfos:3");
            }
            info.setPeerBrokerInfos(value);
        }
        info.setBrokerName("BrokerName:4");
        info.setSlaveBroker(true);
        info.setMasterBroker(false);
        info.setFaultTolerantConfiguration(true);
        info.setDuplexConnection(false);
        info.setNetworkConnection(true);
        info.setConnectionId(1);
        info.setBrokerUploadUrl("BrokerUploadUrl:5");
    }
}
\ No newline at end of file



Mime
View raw message