KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > ejb > MessageBeanProtocolManager


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 package com.sun.ejb;
25
26 import com.sun.enterprise.resource.ResourceHandle;
27 import java.lang.reflect.Method JavaDoc;
28
29 import com.sun.enterprise.deployment.runtime.BeanPoolDescriptor;
30
31 /**
32  * MessageBeanProtocolManager is implemented by the MessageBeanContainer
33  * and allows MessageBeanClients to create message bean listeners
34  * capable of receiving messages. Each MessageBeanListener logically
35  * represents a single message-driven bean instance, although there is
36  * no guarantee as to exactly when the container creates that instance.
37  * MessageBeanListeners are single-threaded. Each MessageBeanListener is
38  * held exclusively by a MessageBeanClient.
39  *
40  * @author Kenneth Saks
41  */

42 public interface MessageBeanProtocolManager {
43
44     /**
45      * Create a MessageBeanListener.
46      *
47      * @param resource handle associated with this listener. can be null.
48      *
49      * @throws Exception if the MessageBeanContainer was not able to create
50      * the MessageBeanListener
51      */

52     MessageBeanListener createMessageBeanListener(ResourceHandle resourceHandle)
53       throws ResourcesExceededException;
54
55     /**
56      * Return the MessageBeanListener to the container. Since a
57      * MessageBeanListener is typically associated with active resources
58      * in the MessageBeanContainer, it is the responsibility of the
59      * MessageBeanClient to manage them judiciously.
60      */

61     void destroyMessageBeanListener(MessageBeanListener listener);
62
63
64     /**
65      * This is used by the message provider to find out whether message
66      * deliveries will be transacted or not. The message delivery preferences
67      * must not change during the lifetime of a message endpoint. This
68      * information is only a hint and may be useful to perform optimizations
69      * on message delivery.
70      *
71      * @param method One of the methods used to deliver messages, e.g.
72      * onMessage method for javax.jms.MessageListener.
73      * Note that if the <code>method</code> is not one
74      * of the methods for message delivery, the behavior
75      * of this method is not defined.
76      */

77     boolean isDeliveryTransacted (Method JavaDoc method) ;
78
79
80     /**
81      * Returns the message-bean container's pool properties.
82      */

83     BeanPoolDescriptor getPoolDescriptor();
84
85 }
86
Popular Tags