1 22 package org.jboss.jms.asf; 23 24 import java.io.Serializable ; 25 import java.security.AccessController ; 26 import java.security.PrivilegedAction ; 27 28 import javax.jms.Connection ; 29 import javax.jms.Destination ; 30 import javax.jms.JMSException ; 31 import javax.jms.MessageListener ; 32 import javax.jms.ServerSessionPool ; 33 import javax.transaction.TransactionManager ; 34 35 import org.jboss.tm.XidFactoryMBean; 36 37 45 public class StdServerSessionPoolFactory implements ServerSessionPoolFactory, Serializable 46 { 47 private static final long serialVersionUID = 4969432475779524576L; 48 49 public static final boolean USE_OLD; 50 51 static 52 { 53 USE_OLD = ((Boolean ) AccessController.doPrivileged(new PrivilegedAction () 54 { 55 public Object run() 56 { 57 return new Boolean (System.getProperty("org.jboss.jms.asf.useold", "false")); 58 } 59 })).booleanValue(); 60 } 61 62 63 private String name; 64 65 private XidFactoryMBean xidFactory; 66 67 private TransactionManager transactionManager; 68 69 public StdServerSessionPoolFactory() 70 { 71 super(); 72 } 73 74 public void setName(final String name) 75 { 76 this.name = name; 77 } 78 79 public String getName() 80 { 81 return name; 82 } 83 84 public void setXidFactory(final XidFactoryMBean xidFactory) 85 { 86 this.xidFactory = xidFactory; 87 } 88 89 public XidFactoryMBean getXidFactory() 90 { 91 return xidFactory; 92 } 93 94 public void setTransactionManager(TransactionManager transactionManager) 95 { 96 this.transactionManager = transactionManager; 97 } 98 99 public TransactionManager getTransactionManager() 100 { 101 return transactionManager; 102 } 103 104 public ServerSessionPool getServerSessionPool(Destination destination, Connection con, int minSession, int maxSession, long keepAlive, boolean isTransacted, int ack, boolean useLocalTX, MessageListener listener) throws JMSException 105 { 106 ServerSessionPool pool = new StdServerSessionPool(destination, con, isTransacted, ack, useLocalTX, listener, minSession, maxSession, keepAlive, xidFactory, transactionManager); 107 return pool; 108 } 109 } 110 | Popular Tags |