KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > mq > MessagePool


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2005, JBoss Inc., and individual contributors as indicated
4 * by the @authors tag. See the copyright.txt in the distribution for a
5 * full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * 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.mq;
23
24 /**
25  * This class provides a pool of SpyMessages.
26  *
27  * This is an very simple implementation first up.
28  *
29  * @author David Maplesden (David.Maplesden@orion.co.nz)
30  * @author <a HREF="mailto:adrian@jboss.org">Adrian Brock</a>
31  * @version $Revision: 37459 $
32  */

33 public class MessagePool
34 {
35    // Constants -----------------------------------------------------
36

37    // Attributes ----------------------------------------------------
38

39    // Static --------------------------------------------------------
40

41    /**
42     * Gets a message
43     *
44     * @return a message
45     */

46    public static SpyMessage getMessage()
47    {
48       return new SpyMessage();
49    }
50
51    /**
52     * Gets a bytes message.
53     *
54     * @return a bytes message
55     */

56    public static SpyBytesMessage getBytesMessage()
57    {
58       return new SpyBytesMessage();
59    }
60
61    /**
62     * Gets a map message
63     *
64     * @return a map message
65     */

66    public static SpyMapMessage getMapMessage()
67    {
68       return new SpyMapMessage();
69    }
70
71    /**
72     * Gets a stream message.
73     *
74     * @return a stream message
75     */

76    public static SpyStreamMessage getStreamMessage()
77    {
78       return new SpyStreamMessage();
79    }
80
81    /**
82     * Gets an object message.
83     *
84     * @return an object message
85     */

86    public static SpyObjectMessage getObjectMessage()
87    {
88       return new SpyObjectMessage();
89    }
90
91    /**
92     * Gets a text message.
93     */

94    public static SpyTextMessage getTextMessage()
95    {
96       return new SpyTextMessage();
97    }
98
99    /**
100     * Gets a encapsulated message.
101     */

102    public static SpyEncapsulatedMessage getEncapsulatedMessage()
103    {
104       return new SpyEncapsulatedMessage();
105    }
106
107    /**
108     * Releases a SpyMessage.
109     */

110    public static void releaseMessage(SpyMessage message)
111    {
112       // Pooling is no longer used
113
}
114    
115    // Constructors --------------------------------------------------
116

117    // Public --------------------------------------------------------
118

119    // Package protected ---------------------------------------------
120

121    // Protected -----------------------------------------------------
122

123    // Private -------------------------------------------------------
124

125    // Inner classes -------------------------------------------------
126
}
Popular Tags