FileDocCategorySizeDatePackage
JmsActivationSpec.javaAPI DocJBoss 4.2.115276Fri Jul 13 21:01:16 BST 2007org.jboss.resource.adapter.jms.inflow

JmsActivationSpec

public class JmsActivationSpec extends Object implements javax.resource.spi.ActivationSpec
A generic jms ActivationSpec.
author
Adrian Brock
version
$Revision: 60926 $

Fields Summary
private static final Logger
log
The log
private javax.resource.spi.ResourceAdapter
ra
The resource adapter
private String
destination
The destination
private boolean
isTopic
The destination type
private String
messageSelector
The message selector
private int
acknowledgeMode
The acknowledgement mode
private boolean
subscriptionDurability
The subscription durability
private String
clientId
The client id
private String
subscriptionName
The subscription name
private long
reconnectInterval
The reconnect interval in seconds
private String
providerAdapterJNDI
The jms provider adapter jndi name
private String
user
The user
private String
pass
The password
private int
maxMessages
The maximum number of messages
private int
minSession
The minimum number of sessions
private int
maxSession
The maximum number of sessions
private long
keepAlive
The keep alive time for sessions
private boolean
sessionTransacted
Is the session transacted
private String
dLQHandler
The DLQ handler class
private boolean
useDLQ
Whether to use a DLQ
private String
dLQJNDIName
The DLQ jndi binding
private String
dLQUser
The DLQ user
private String
dLQPassword
The DLQ password
private String
dLQClientID
The DLQ client id
private int
dLQMaxResent
The DLQ max resent
private boolean
redeliverUnspecified
private int
transactionTimeout
private Boolean
isSameRMOverrideValue
Constructors Summary
Methods Summary
public java.lang.StringgetAcknowledgeMode()

return
the acknowledgeMode.

   
          
     
   
      if (sessionTransacted)
         return "TRANSACTED";
      else if (Session.DUPS_OK_ACKNOWLEDGE == acknowledgeMode)
         return "DUPS_OK_ACKNOWLEDGE";
      else
         return "AUTO_ACKNOWLEDGE";
   
public intgetAcknowledgeModeInt()

return
the acknowledgement mode

      if (sessionTransacted)
         return Session.SESSION_TRANSACTED;
      return acknowledgeMode;
   
public java.lang.StringgetClientId()

return
the clientId.

      return clientId;
   
public java.lang.StringgetDLQClientID()

return
Returns the dLQClientID.

      return dLQClientID;
   
public java.lang.StringgetDLQHandler()

return
Returns the dLQHandler.

      return dLQHandler;
   
public java.lang.StringgetDLQJNDIName()

return
Returns the dLQJNDIName.

      return dLQJNDIName;
   
public intgetDLQMaxResent()

return
Returns the maxResent.

      return dLQMaxResent;
   
public java.lang.StringgetDLQPassword()

return
Returns the dLQPassword.

      return dLQPassword;
   
public java.lang.StringgetDLQUser()

return
Returns the dLQUser.

      return dLQUser;
   
public java.lang.StringgetDestination()

return
the destination.

      return destination;
   
public java.lang.StringgetDestinationType()

return
the destinationType.

      if (isTopic)
         return Topic.class.getName();
      else
         return Queue.class.getName();
   
public java.lang.BooleangetIsSameRMOverrideValue()

      return isSameRMOverrideValue;
   
public longgetKeepAlive()

return
the keepAlive.

      return keepAlive;
   
public longgetKeepAliveLong()

return
the keep alive time of the session

      return keepAlive;
   
public intgetMaxMessages()

return
the maxMessages.

      return maxMessages;
   
public intgetMaxMessagesInt()

return
the maximum number of messages

      return maxMessages;
   
public intgetMaxSession()

return
the maxSession.

      return maxSession;
   
public intgetMaxSessionInt()

return
the maximum number of sessions

      return maxSession;
   
public java.lang.StringgetMessageSelector()

return
the messageSelector.

      return messageSelector;
   
public intgetMinSession()

return
the minSession.

      return minSession;
   
public intgetMinSessionInt()

return
the minimum number of sessions

      return minSession;
   
public java.lang.StringgetPassword()

return
the password.

      return pass;
   
public java.lang.StringgetProviderAdapterJNDI()

return
the providerAdapterJNDI.

      return providerAdapterJNDI;
   
public longgetReconnectInterval()

return
the reconnectInterval.

      return reconnectInterval;
   
public longgetReconnectIntervalLong()

return
the reconnect interval

      return reconnectInterval * 1000;
   
public booleangetRedeliverUnspecified()

      return redeliverUnspecified;
   
public javax.resource.spi.ResourceAdaptergetResourceAdapter()

      return ra;
   
public booleangetSessionTransacted()

return
the sessionTransacted.

      return sessionTransacted;
   
public java.lang.StringgetSubscriptionDurability()

return
the subscriptionDurability.

      if (subscriptionDurability)
         return "Durable";
      else
         return "NonDurable";
   
public java.lang.StringgetSubscriptionName()

return
the subscriptionName.

      return subscriptionName;
   
public intgetTransactionTimeout()

      return transactionTimeout;
   
public booleangetUseDLQ()

return
Returns the useDLQ.

      return useDLQ;
   
public java.lang.StringgetUser()

return
the user.

      return user;
   
public booleanisDurable()

return
wether the subscription is durable.

      return subscriptionDurability;
   
public booleanisSessionTransacted()

return
whether the session is transaction

      return sessionTransacted;
   
public booleanisTopic()

return
whether this is for a topic.

      return isTopic;
   
public booleanisUseDLQ()
Whether we should use a DLQ

return
true when using a DLQ

      return useDLQ;
   
public voidsetAcknowledgeMode(java.lang.String acknowledgeMode)

param
acknowledgeMode The acknowledgeMode to set.

      if ("DUPS_OK_ACKNOWLEDGE".equals(acknowledgeMode))
         this.acknowledgeMode = Session.DUPS_OK_ACKNOWLEDGE;
      else if ("AUTO_ACKNOWLEDGE".equals(acknowledgeMode))
         this.acknowledgeMode = Session.AUTO_ACKNOWLEDGE;
      else if ("SESSION_TRANSACTED".equals(acknowledgeMode))
         this.acknowledgeMode = Session.SESSION_TRANSACTED;
      else
         throw new IllegalArgumentException("Unsupported acknowledgement mode " + acknowledgeMode);
   
public voidsetClientId(java.lang.String clientId)

param
clientId The clientId to set.

      this.clientId = clientId;
   
public voidsetDLQClientID(java.lang.String clientID)

param
clientID The dLQClientID to set.

      dLQClientID = clientID;
   
public voidsetDLQHandler(java.lang.String handler)

param
handler The dLQHandler to set.

      this.dLQHandler = handler;
   
public voidsetDLQJNDIName(java.lang.String name)

param
name The dLQJNDIName to set.

      dLQJNDIName = name;
   
public voidsetDLQMaxResent(int maxResent)

param
maxResent The maxResent to set.

      this.dLQMaxResent = maxResent;
   
public voidsetDLQPassword(java.lang.String password)

param
password The dLQPassword to set.

      dLQPassword = password;
   
public voidsetDLQUser(java.lang.String user)

param
user The dLQUser to set.

      dLQUser = user;
   
public voidsetDestination(java.lang.String destination)

param
destination The destination to set.

      this.destination = destination;
   
public voidsetDestinationType(java.lang.String destinationType)

param
destinationType The destinationType to set.

      if (Topic.class.getName().equals(destinationType))
         this.isTopic = true;
      else
         this.isTopic = false;
   
public voidsetIsSameRMOverrideValue(java.lang.Boolean isSameRMOverrideValue)

      this.isSameRMOverrideValue = isSameRMOverrideValue;
   
public voidsetKeepAlive(long keepAlive)

param
keepAlive The keepAlive to set.

      this.keepAlive = keepAlive;
   
public voidsetMaxMessages(int maxMessages)

param
maxMessages The maxMessages to set.

      this.maxSession = maxMessages;
   
public voidsetMaxSession(int maxSession)

param
maxSession The maxSession to set.

      this.maxSession = maxSession;
   
public voidsetMessageSelector(java.lang.String messageSelector)

param
messageSelector The messageSelector to set.

      this.messageSelector = messageSelector;
   
public voidsetMinSession(int minSession)

param
minSession The minSession to set.

      this.minSession = minSession;
   
public voidsetPassword(java.lang.String pass)

param
pass The password to set.

      this.pass = pass;
   
public voidsetProviderAdapterJNDI(java.lang.String providerAdapterJNDI)

param
providerAdapterJNDI The providerAdapterJNDI to set.

      this.providerAdapterJNDI = providerAdapterJNDI;
   
public voidsetReconnectInterval(long reconnectInterval)

param
reconnectInterval The reconnectInterval to set.

      this.reconnectInterval = reconnectInterval;
   
public voidsetRedeliverUnspecified(boolean redeliverUnspecified)

      this.redeliverUnspecified = redeliverUnspecified;
   
public voidsetResourceAdapter(javax.resource.spi.ResourceAdapter ra)

      this.ra = ra;
   
public voidsetSessionTransacted(boolean sessionTransacted)

param
sessionTransacted The sessionTransacted to set.

      this.sessionTransacted = sessionTransacted;
   
public voidsetSubscriptionDurability(java.lang.String subscriptionDurability)

param
subscriptionDurability The subscriptionDurability to set.

      this.subscriptionDurability = "Durable".equals(subscriptionDurability);
   
public voidsetSubscriptionName(java.lang.String subscriptionName)

param
subscriptionName The subscriptionName to set.

      this.subscriptionName = subscriptionName;
   
public voidsetTransactionTimeout(int transactionTimeout)

      this.transactionTimeout = transactionTimeout;
   
public voidsetUseDLQ(boolean useDLQ)

param
useDLQ The useDLQ to set.

      this.useDLQ = useDLQ;
   
public voidsetUser(java.lang.String user)

param
user The user to set.

      this.user = user;
   
public java.lang.StringtoString()

      StringBuffer buffer = new StringBuffer();
      buffer.append(Strings.defaultToString(this)).append('(");
      buffer.append("ra=").append(ra);
      buffer.append(" destination=").append(destination);
      buffer.append(" isTopic=").append(isTopic);
      if (messageSelector != null)
         buffer.append(" selector=").append(messageSelector);
      buffer.append(" tx=").append(sessionTransacted);
      if (sessionTransacted == false)
         buffer.append(" ack=").append(getAcknowledgeMode());
      buffer.append(" durable=").append(subscriptionDurability);
      if (clientId != null)
         buffer.append(" clientID=").append(clientId);
      if (subscriptionName != null)
         buffer.append(" subscription=").append(subscriptionName);
      buffer.append(" reconnect=").append(reconnectInterval);
      buffer.append(" provider=").append(providerAdapterJNDI);
      buffer.append(" user=").append(user);
      if (pass != null)
         buffer.append(" pass=").append("<not shown>");
      buffer.append(" maxMessages=").append(maxMessages);
      buffer.append(" minSession=").append(minSession);
      buffer.append(" maxSession=").append(maxSession);
      buffer.append(" keepAlive=").append(keepAlive);
      buffer.append(" useDLQ=").append(useDLQ);
      if (useDLQ)
      {
         buffer.append(" DLQHandler=").append(dLQHandler);
         buffer.append(" DLQJndiName=").append(dLQJNDIName);
         buffer.append(" DLQUser=").append(dLQUser);
         if (dLQPassword != null)
            buffer.append(" DLQPass=").append("<not shown>");
         if (dLQClientID != null)
            buffer.append(" DLQClientID=").append(dLQClientID);
         buffer.append(" DLQMaxResent=").append(dLQMaxResent);
      }
      buffer.append(')");
      return buffer.toString();
   
public voidvalidate()

      if (log.isTraceEnabled())
         log.trace("validate " + this);
      // TODO validate