站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 connector API Documentation 英文版文档

AbstractDLQHandler (JBoss Connector API) - JBoss 4.0.1 sp1 connector API Documentation 英文版文档


org.jboss.resource.adapter.jms.inflow.dlq
Class AbstractDLQHandler

java.lang.Object
  extended byorg.jboss.resource.adapter.jms.inflow.dlq.AbstractDLQHandler
All Implemented Interfaces:
DLQHandler, javax.jms.ExceptionListener
Direct Known Subclasses:
JBossMQDLQHandler

public abstract class AbstractDLQHandler
extends Object
implements DLQHandler, javax.jms.ExceptionListener

An abstract DLQ handler.

Version:
$Revision: 1.1 $
Author:
Adrian Brock

Field Summary
protected  JmsActivation activation
          The activation
protected  javax.jms.QueueConnection connection
          The DLQ Connection
protected  javax.jms.Queue dlq
          The DLQ
protected static org.jboss.logging.Logger log
          The logger
 
Fields inherited from interface org.jboss.resource.adapter.jms.inflow.DLQHandler
JBOSS_ORIG_DESTINATION, JBOSS_ORIG_MESSAGEID
 
Constructor Summary
AbstractDLQHandler()
           
 
Method Summary
protected  void doSend(javax.jms.Message msg, int deliveryMode, int priority, long timeToLive)
          Do the message send
protected  int getDeliveryMode(javax.jms.Message msg)
          Get the delivery mode for the DLQ message
protected  int getPriority(javax.jms.Message msg)
          Get the priority for the DLQ message
protected  long getTimeToLive(javax.jms.Message msg)
          Get the time to live for the DLQ message
protected abstract  boolean handleDelivery(javax.jms.Message msg)
          Do we handle the message?
 boolean handleRedeliveredMessage(javax.jms.Message msg)
          Check whether the DLQ should handle the message
protected  void handleSendError(javax.jms.Message msg, Throwable t)
          Handle a failure to send the message to the dlq
protected  javax.jms.Message makeWritable(javax.jms.Message msg)
          Make a writable copy of the message
 void messageDelivered(javax.jms.Message msg)
          Notification that the message was delivered
 void onException(javax.jms.JMSException exception)
           
protected  void sendToDLQ(javax.jms.Message msg)
          Send the message to the dlq
 void setup(JmsActivation activation, Context ctx)
          Set up the DLQ
protected  void setupDLQConnection(Context ctx)
          Setup the DLQ Connection
protected  void setupDLQDestination(Context ctx)
          Setup the DLQ Destination
 void teardown()
          Tear down the DLQ
protected  void teardownDLQConnection()
          Teardown the DLQ Connection
protected  void teardownDLQDestination()
          Teardown the DLQ Destination
protected  void warnDLQ(javax.jms.Message msg, int count, int max)
          Warn that a message is being handled by the DLQ
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.jboss.logging.Logger log
The logger


activation

protected JmsActivation activation
The activation


dlq

protected javax.jms.Queue dlq
The DLQ


connection

protected javax.jms.QueueConnection connection
The DLQ Connection

Constructor Detail

AbstractDLQHandler

public AbstractDLQHandler()
Method Detail

handleRedeliveredMessage

public boolean handleRedeliveredMessage(javax.jms.Message msg)
Description copied from interface: DLQHandler
Check whether the DLQ should handle the message

Specified by:
handleRedeliveredMessage in interface DLQHandler
Returns:
true if the message is handled and should not be delivered

messageDelivered

public void messageDelivered(javax.jms.Message msg)
Description copied from interface: DLQHandler
Notification that the message was delivered

Specified by:
messageDelivered in interface DLQHandler

setup

public void setup(JmsActivation activation,
                  Context ctx)
           throws Exception
Description copied from interface: DLQHandler
Set up the DLQ

Specified by:
setup in interface DLQHandler
Parameters:
activation - the activation
Throws:
Exception - for any error

teardown

public void teardown()
Description copied from interface: DLQHandler
Tear down the DLQ

Specified by:
teardown in interface DLQHandler

onException

public void onException(javax.jms.JMSException exception)
Specified by:
onException in interface javax.jms.ExceptionListener

setupDLQDestination

protected void setupDLQDestination(Context ctx)
                            throws Exception
Setup the DLQ Destination

Parameters:
ctx - the naming context
Throws:
Exception - for any error

teardownDLQDestination

protected void teardownDLQDestination()
Teardown the DLQ Destination


setupDLQConnection

protected void setupDLQConnection(Context ctx)
                           throws Exception
Setup the DLQ Connection

Parameters:
ctx - the naming context
Throws:
Exception - for any error

teardownDLQConnection

protected void teardownDLQConnection()
Teardown the DLQ Connection


handleDelivery

protected abstract boolean handleDelivery(javax.jms.Message msg)
Do we handle the message?

Parameters:
msg - the message to handle
Returns:
true when we handle it

warnDLQ

protected void warnDLQ(javax.jms.Message msg,
                       int count,
                       int max)
Warn that a message is being handled by the DLQ

Parameters:
msg -
count - the number of redelivers
max - the maximum number of redeliveries

sendToDLQ

protected void sendToDLQ(javax.jms.Message msg)
Send the message to the dlq


getDeliveryMode

protected int getDeliveryMode(javax.jms.Message msg)
Get the delivery mode for the DLQ message

Parameters:
msg - the message
Returns:
the delivery mode

getPriority

protected int getPriority(javax.jms.Message msg)
Get the priority for the DLQ message

Parameters:
msg - the message
Returns:
the priority

getTimeToLive

protected long getTimeToLive(javax.jms.Message msg)
Get the time to live for the DLQ message

Parameters:
msg - the message
Returns:
the time to live

makeWritable

protected javax.jms.Message makeWritable(javax.jms.Message msg)
Make a writable copy of the message

Parameters:
msg - the message
Returns:
the copied message

doSend

protected void doSend(javax.jms.Message msg,
                      int deliveryMode,
                      int priority,
                      long timeToLive)
Do the message send

Parameters:
msg - the message

handleSendError

protected void handleSendError(javax.jms.Message msg,
                               Throwable t)
Handle a failure to send the message to the dlq

Parameters:
msg - the message
t - the error


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.