2011/08/05 - Jakarta Cactus has been retired.

For more information, please explore the Attic.

View Javadoc

1   /* 
2    * ========================================================================
3    * 
4    * Licensed to the Apache Software Foundation (ASF) under one or more
5    * contributor license agreements.  See the NOTICE file distributed with
6    * this work for additional information regarding copyright ownership.
7    * The ASF licenses this file to You under the Apache License, Version 2.0
8    * (the "License"); you may not use this file except in compliance with
9    * the License.  You may obtain a copy of the License at
10   * 
11   *   http://www.apache.org/licenses/LICENSE-2.0
12   * 
13   * Unless required by applicable law or agreed to in writing, software
14   * distributed under the License is distributed on an "AS IS" BASIS,
15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   * See the License for the specific language governing permissions and
17   * limitations under the License.
18   * 
19   * ========================================================================
20   */
21  package org.apache.cactus.spi.server;
22  
23  import javax.jms.Message;
24  import javax.jms.Queue;
25  import javax.ejb.MessageDrivenContext;
26  
27  import org.apache.cactus.JmsRequest;
28  
29  /**
30   * Implicit objects for the Message Driven Bean redirector.
31   *
32   * @author <a href="mailto:vmassol@apache.org">Vincent Massol</a>
33   *
34   * @version $Id$
35   */
36  public class MessageDrivenBeanImplicitObjects implements ImplicitObjects
37  {
38      /**
39       * The JMS Message to process.
40       */
41      private Message message;
42      
43      /**
44       * This is th JMS request instance that we use.
45       */
46      private JmsRequest request;
47      
48  
49      /**
50       * The Message Driven Bean context.
51       */
52      private MessageDrivenContext context;
53      
54      /**
55       * The queue that will be used to post the request to.
56       */
57      private Queue requestQueue;
58  
59      /**
60       * @return the queue that we are supposed to post our request to.
61       */
62      public Queue getRequestQueue() 
63      {
64          return requestQueue;
65      }
66  
67      /**
68       * Setter for the queue that we are about to post our request to.
69       * 
70       * @param requestQueue
71       */
72      public void setRequestQueue(Queue theRequestQueue) 
73      {
74          this.requestQueue = theRequestQueue;
75      }
76  
77      /**
78       * Sets the JMS Message as retrieved by the Cactus redirector.
79       *
80       * @param theMessage the JMS Message
81       */
82      public void setMessage(Message theMessage)
83      {
84          this.message = theMessage;
85      }
86  
87      /**
88       * @return the JMS Message as retrieved by the Cactus redirector.
89       */
90      public Message getMessage()
91      {
92          return this.message;
93      }
94  
95      /**
96       * Sets the Message Driven Bean context as set by the J2EE container.
97       *
98       * @param theContext the MDB context
99       */
100     public void setMessageDrivenBeanContext(MessageDrivenContext theContext)
101     {
102         this.context = theContext;
103     }
104 
105     /**
106      * @return the MDB context
107      */
108     public MessageDrivenContext getMessageDrivenBeanContext()
109     {
110         return this.context;
111     }
112 
113     /**
114      * Getter method for the request object.
115      * @return
116      */
117     public JmsRequest getRequest() 
118     {
119         return request;
120     }
121 
122     /**
123      * Setter method for the jms request object.
124      * @param theRequest
125      */
126     public void setRequest(JmsRequest theRequest) 
127     {
128         this.request = theRequest;
129     }
130 }