com.taobao.metamorphosis.client.extension.spring
类 MetaqTemplate

java.lang.Object
  继承者 com.taobao.metamorphosis.client.extension.spring.MetaqTemplate
所有已实现的接口:
org.springframework.beans.factory.DisposableBean

public class MetaqTemplate
extends Object
implements org.springframework.beans.factory.DisposableBean

Helper class that simplifies synchronous MetaQ access code.

作者:
dennis

构造方法摘要
MetaqTemplate()
           
 
方法摘要
 void destroy()
           
 String getDefaultTopic()
          Returns the default topic for producers.
 MessageBodyConverter<?> getMessageBodyConverter()
          Returns the message body converter.The default is an instance of JavaSerializationMessageBodyConverter.
 MessageSessionFactory getMessageSessionFactory()
          Returns the associated message session factory.
 MessageProducer getOrCreateProducer(String topic)
          Returns or create a message producer for topic.
 boolean isShareProducer()
          returns if share a message producer between topics.It's false by default.
 SendResult send(MessageBuilder builder)
          Send message built by message builder.Returns the sent result.
 SendResult send(MessageBuilder builder, long timeout, TimeUnit unit)
          Send message built by message builder.Returns the sent result.
 void send(MessageBuilder builder, SendMessageCallback cb)
          Send message asynchronously with callback.
 void send(MessageBuilder builder, SendMessageCallback cb, long timeout, TimeUnit unit)
          Send message asynchronously with callback.
 void setDefaultTopic(String defaultTopic)
          Set the default topic for producers.
 void setMessageBodyConverter(MessageBodyConverter<?> messageBodyConverter)
          Set message body converter.
 void setMessageSessionFactory(MessageSessionFactory messageSessionFactory)
          Set message session factory fot this template.
 void setShareProducer(boolean producerPerTopic)
          If true, the template will share a message producer between topics.It's false by default.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

MetaqTemplate

public MetaqTemplate()
方法详细信息

isShareProducer

public boolean isShareProducer()
returns if share a message producer between topics.It's false by default.

返回:
从以下版本开始:
1.4.5

setShareProducer

public void setShareProducer(boolean producerPerTopic)
If true, the template will share a message producer between topics.It's false by default.

参数:
producerPerTopic -
从以下版本开始:
1.4.5

getDefaultTopic

public String getDefaultTopic()
Returns the default topic for producers.

返回:
从以下版本开始:
1.4.5

getMessageBodyConverter

public MessageBodyConverter<?> getMessageBodyConverter()
Returns the message body converter.The default is an instance of JavaSerializationMessageBodyConverter.

返回:

setMessageBodyConverter

public void setMessageBodyConverter(MessageBodyConverter<?> messageBodyConverter)
Set message body converter.

参数:
messageBodyConverter -
从以下版本开始:
1.4.5

setDefaultTopic

public void setDefaultTopic(String defaultTopic)
Set the default topic for producers.

参数:
defaultTopic -
从以下版本开始:
1.4.5

getMessageSessionFactory

public MessageSessionFactory getMessageSessionFactory()
Returns the associated message session factory.

返回:
从以下版本开始:
1.4.5

setMessageSessionFactory

public void setMessageSessionFactory(MessageSessionFactory messageSessionFactory)
Set message session factory fot this template.

参数:
messageSessionFactory -
从以下版本开始:
1.4.5

getOrCreateProducer

public MessageProducer getOrCreateProducer(String topic)
Returns or create a message producer for topic.

参数:
topic -
返回:
从以下版本开始:
1.4.5

send

public SendResult send(MessageBuilder builder,
                       long timeout,
                       TimeUnit unit)
                throws InterruptedException
Send message built by message builder.Returns the sent result.

参数:
builder -
返回:
抛出:
InterruptedException
从以下版本开始:
1.4.5

send

public SendResult send(MessageBuilder builder)
                throws InterruptedException
Send message built by message builder.Returns the sent result.

参数:
builder -
返回:
抛出:
InterruptedException
从以下版本开始:
1.4.5

send

public void send(MessageBuilder builder,
                 SendMessageCallback cb,
                 long timeout,
                 TimeUnit unit)
Send message asynchronously with callback.

参数:
builder -
cb -
timeout -
unit -
从以下版本开始:
1.4.5

destroy

public void destroy()
             throws Exception
指定者:
接口 org.springframework.beans.factory.DisposableBean 中的 destroy
抛出:
Exception

send

public void send(MessageBuilder builder,
                 SendMessageCallback cb)
Send message asynchronously with callback.

参数:
builder -
cb -
从以下版本开始:
1.4.5


Copyright © 2010–2013. All rights reserved.