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

For more information, please explore the Attic.

View Javadoc

1   package org.apache.cactus.internal.server;
2   /* 
3    * ========================================================================
4    * 
5    * Licensed to the Apache Software Foundation (ASF) under one or more
6    * contributor license agreements.  See the NOTICE file distributed with
7    * this work for additional information regarding copyright ownership.
8    * The ASF licenses this file to You under the Apache License, Version 2.0
9    * (the "License"); you may not use this file except in compliance with
10   * the License.  You may obtain a copy of the License at
11   * 
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   * 
14   * Unless required by applicable law or agreed to in writing, software
15   * distributed under the License is distributed on an "AS IS" BASIS,
16   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17   * See the License for the specific language governing permissions and
18   * limitations under the License.
19   * 
20   * ========================================================================
21   */
22  import javax.ejb.CreateException;
23  import javax.ejb.SessionBean;
24  import javax.ejb.SessionContext;
25  import org.apache.cactus.EJBRequest;
26  import org.apache.commons.logging.Log;
27  import org.apache.commons.logging.LogFactory;
28  
29  /**
30   * Prototype of EJBRedirector for Cactus.
31   * @author Siddhartha P. Chandurkar (siddhartha@visioncodified.com)
32   */
33  public class EJBTestRedirectorBean implements SessionBean 
34  {
35  
36      /**
37       * The session context.
38       */
39      private SessionContext context;
40      
41      /**
42       * The logger.
43       */
44      private static final Log LOGGER = 
45          LogFactory.getLog(AbstractWebTestCaller.class);
46  
47      //METHODS
48  
49      /**
50       * The "main" method of the redirector object.
51       * @param theRequest
52       */
53      public void test(EJBRequest theRequest) 
54      {
55          try 
56          {
57              LOGGER.debug("Received request " + theRequest);
58              BeanImplicitObjects object = new BeanImplicitObjects();
59              object.setEJBContext(context);
60              object.setEJBRequest(theRequest);
61  
62              EJBTestController controller = new EJBTestController();
63              controller.handleRequest(object);
64          } 
65          catch (Exception e) 
66          {
67              e.printStackTrace();
68          }
69      }
70  
71      /**
72       * No argument constructor needed by the Container
73       */
74      public EJBTestRedirectorBean() 
75      {
76      }
77  
78      /**
79       * Create method specified in EJB 1.1 section 6.10.3.
80       * @throws CreateException in case an error occurs
81       */
82      public void ejbCreate() throws CreateException 
83      {
84      }
85  
86      /* Methods required by SessionBean Interface. EJB 1.1 section 6.5.1. */
87  
88      /**
89       * @see javax.ejb.SessionBean#setContext(javax.ejb.SessionContext)
90       */
91      public void setSessionContext(SessionContext context) 
92      {
93          this.context = context;
94      }
95  
96      /**
97       * @see javax.ejb.SessionBean#ejbActivate()
98       */
99      public void ejbActivate() 
100     {
101     }
102 
103     /**
104      * @see javax.ejb.SessionBean#ejbPassivate()
105      */
106     public void ejbPassivate() 
107     {
108     }
109 
110     /**
111      * @see javax.ejb.SessionBean#ejbRemove()
112      */
113     public void ejbRemove() 
114     {
115     }
116 }