01: /*
02: * JBoss, Home of Professional Open Source.
03: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
04: * as indicated by the @author tags. See the copyright.txt file in the
05: * distribution for a full listing of individual contributors.
06: *
07: * This is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU Lesser General Public License as
09: * published by the Free Software Foundation; either version 2.1 of
10: * the License, or (at your option) any later version.
11: *
12: * This software is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * You should have received a copy of the GNU Lesser General Public
18: * License along with this software; if not, write to the Free
19: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21: */
22: package org.jboss.jms.asf;
23:
24: import java.io.Serializable;
25:
26: import javax.jms.Connection;
27: import javax.jms.Destination;
28: import javax.jms.JMSException;
29: import javax.jms.MessageListener;
30: import javax.jms.ServerSessionPool;
31: import javax.transaction.TransactionManager;
32:
33: import org.jboss.tm.XidFactoryMBean;
34:
35: /**
36: * An implementation of ServerSessionPoolFactory.
37: *
38: * @author <a href="mailto:peter.antman@tim.se">Peter Antman</a> .
39: * @author <a href="mailto:hiram.chirino@jboss.org">Hiram Chirino</a> .
40: * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
41: * @version $Revision: 57209 $
42: */
43: public class StdServerSessionPoolFactory implements
44: ServerSessionPoolFactory, Serializable {
45: private static final long serialVersionUID = 4969432475779524576L;
46:
47: /** The name of this factory. */
48: private String name;
49:
50: private XidFactoryMBean xidFactory;
51:
52: private TransactionManager transactionManager;
53:
54: public StdServerSessionPoolFactory() {
55: super ();
56: }
57:
58: public void setName(final String name) {
59: this .name = name;
60: }
61:
62: public String getName() {
63: return name;
64: }
65:
66: public void setXidFactory(final XidFactoryMBean xidFactory) {
67: this .xidFactory = xidFactory;
68: }
69:
70: public XidFactoryMBean getXidFactory() {
71: return xidFactory;
72: }
73:
74: public void setTransactionManager(
75: TransactionManager transactionManager) {
76: this .transactionManager = transactionManager;
77: }
78:
79: public TransactionManager getTransactionManager() {
80: return transactionManager;
81: }
82:
83: public ServerSessionPool getServerSessionPool(
84: Destination destination, Connection con, int minSession,
85: int maxSession, long keepAlive, boolean isTransacted,
86: int ack, boolean useLocalTX, MessageListener listener)
87: throws JMSException {
88: ServerSessionPool pool = new StdServerSessionPool(destination,
89: con, isTransacted, ack, useLocalTX, listener,
90: minSession, maxSession, keepAlive, xidFactory,
91: transactionManager);
92: return pool;
93: }
94: }
|