FileDocCategorySizeDatePackage
JmsConnectionRequestInfo.javaAPI DocJBoss 4.2.14624Fri Jul 13 21:01:16 BST 2007org.jboss.resource.adapter.jms

JmsConnectionRequestInfo

public class JmsConnectionRequestInfo extends Object implements javax.resource.spi.ConnectionRequestInfo
Request information used in pooling
author
Peter Antman.
author
Adrian Brock
version
$Revision: 57189 $

Fields Summary
private String
userName
private String
password
private String
clientID
private boolean
transacted
private int
acknowledgeMode
private int
type
Constructors Summary
public JmsConnectionRequestInfo(JmsMCFProperties prop)
Creats with the MCF configured properties.


             
     
   
      this.userName = prop.getUserName();
      this.password = prop.getPassword();
      this.clientID = prop.getClientID();
      this.type = prop.getType();
   
public JmsConnectionRequestInfo(boolean transacted, int acknowledgeMode, int type)
Create with specified properties.

      this.transacted = transacted;
      this.acknowledgeMode = acknowledgeMode;
      this.type = type;
   
Methods Summary
public booleanequals(java.lang.Object obj)

      if (obj == null) return false;
      if (obj instanceof JmsConnectionRequestInfo)
      {
         JmsConnectionRequestInfo you = (JmsConnectionRequestInfo) obj;
         return (this.transacted == you.isTransacted() &&
            this.acknowledgeMode == you.getAcknowledgeMode() &&
            this.type == you.getType() &&
            Strings.compare(userName, you.getUserName()) &&
            Strings.compare(password, you.getPassword()) &&
            Strings.compare(clientID, you.getClientID()));
      }
      else
         return false;
   
public intgetAcknowledgeMode()

      return acknowledgeMode;
   
public java.lang.StringgetClientID()

      return clientID;
   
public java.lang.StringgetPassword()

      return password;
   
public intgetType()

      return type;
   
public java.lang.StringgetUserName()

      return userName;
   
public inthashCode()

      int hashCode = 0;
      if (transacted)
         hashCode += 1;
      if (type == JmsConnectionFactory.QUEUE)
         hashCode += 3;
      else if (type == JmsConnectionFactory.TOPIC)
         hashCode += 5;
      if (acknowledgeMode == Session.AUTO_ACKNOWLEDGE)
         hashCode += 7;
      else if (acknowledgeMode == Session.DUPS_OK_ACKNOWLEDGE)
         hashCode += 11;
      if (userName != null)
         hashCode += userName.hashCode();
      if (password != null)
         hashCode += password.hashCode();
      if (clientID != null)
         hashCode += clientID.hashCode();
      
      return hashCode;
   
public booleanisTransacted()

      return transacted;
   
public voidsetClientID(java.lang.String clientID)

      this.clientID = clientID;
   
public voidsetDefaults(JmsMCFProperties prop)
Fill in default values if missing. Only applies to user and password.

      if (userName == null)
         userName = prop.getUserName();//May be null there to
      if (password == null) 
         password = prop.getPassword();//May be null there to
      if (clientID == null) 
         clientID = prop.getClientID();//May be null there to
   
public voidsetPassword(java.lang.String password)

      this.password = password;
   
public voidsetUserName(java.lang.String name)

      userName = name;