Source Code Cross Referenced for EasyBeansSessionContext.java in  » J2EE » ow2-easybeans » org » ow2 » easybeans » container » session » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » ow2 easybeans » org.ow2.easybeans.container.session 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * EasyBeans
003:         * Copyright (C) 2006 Bull S.A.S.
004:         * Contact: easybeans@ow2.org
005:         *
006:         * This library is free software; you can redistribute it and/or
007:         * modify it under the terms of the GNU Lesser General Public
008:         * License as published by the Free Software Foundation; either
009:         * version 2.1 of the License, or any later version.
010:         *
011:         * This library is distributed in the hope that it will be useful,
012:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
013:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014:         * Lesser General Public License for more details.
015:         *
016:         * You should have received a copy of the GNU Lesser General Public
017:         * License along with this library; if not, write to the Free Software
018:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
019:         * USA
020:         *
021:         * --------------------------------------------------------------------------
022:         * $Id$
023:         * --------------------------------------------------------------------------
024:         */package org.ow2.easybeans.container.session;
025:
026:        import javax.ejb.EJBLocalObject;
027:        import javax.ejb.EJBObject;
028:        import javax.ejb.SessionContext;
029:        import javax.transaction.Transaction;
030:
031:        import org.ow2.easybeans.api.bean.EasyBeansSB;
032:        import org.ow2.easybeans.api.container.EZBSessionContext;
033:        import org.ow2.easybeans.container.EasyBeansEJBContext;
034:
035:        /**
036:         * Defines the Session Context used by Stateless and Stateful beans.
037:         * @param <BeanType> Could be a stateless or stateful.
038:         * @author Florent Benoit
039:         */
040:        public class EasyBeansSessionContext<BeanType extends EasyBeansSB>
041:                extends EasyBeansEJBContext<BeanType> implements 
042:                EZBSessionContext<BeanType>, SessionContext {
043:
044:            /**
045:             * Reference to the bean.
046:             */
047:            private BeanType bean = null;
048:
049:            /**
050:             * Transaction used by this bean. (Used by stateful bean).
051:             */
052:            private Transaction beanTransaction = null;
053:
054:            /**
055:             * Gets the transaction used by this bean.
056:             * @return the bean transaction.
057:             */
058:            public Transaction getBeanTransaction() {
059:                return beanTransaction;
060:            }
061:
062:            /**
063:             * Sets the transaction used by this bean.
064:             * @param beanTransaction the bean transaction.
065:             */
066:            public void setBeanTransaction(final Transaction beanTransaction) {
067:                this .beanTransaction = beanTransaction;
068:            }
069:
070:            /**
071:             * Gets the bean of this context.
072:             * @return bean used by this context.
073:             */
074:            @Override
075:            public BeanType getBean() {
076:                return this .bean;
077:            }
078:
079:            /**
080:             * Build a new Session context.
081:             * @param bean the bean on which we are linked.
082:             */
083:            public EasyBeansSessionContext(final BeanType bean) {
084:                super (bean.getEasyBeansFactory());
085:                this .bean = bean;
086:            }
087:
088:            /**
089:             * Obtain a reference to the EJB local object that is associated with the
090:             * instance. An instance of a session enterprise Bean can call this method
091:             * at anytime between the ejbCreate() and ejbRemove() methods, including
092:             * from within the ejbCreate() and ejbRemove() methods. An instance can use
093:             * this method, for example, when it wants to pass a reference to itself in
094:             * a method argument or result.
095:             * @return The EJB local object currently associated with the instance.
096:             * @throws java.lang.IllegalStateException - Thrown if the instance invokes
097:             *         this method while the instance is in a state that does not allow
098:             *         the instance to invoke this method, or if the instance does not
099:             *         have a local interface.
100:             */
101:            public EJBLocalObject getEJBLocalObject()
102:                    throws java.lang.IllegalStateException {
103:                throw new UnsupportedOperationException();
104:            }
105:
106:            /**
107:             * Obtain a reference to the EJB object that is currently associated with
108:             * the instance. An instance of a session enterprise Bean can call this
109:             * method at anytime between the ejbCreate() and ejbRemove() methods,
110:             * including from within the ejbCreate() and ejbRemove() methods. An
111:             * instance can use this method, for example, when it wants to pass a
112:             * reference to itself in a method argument or result.
113:             * @return The EJB object currently associated with the instance.
114:             * @throws java.lang.IllegalStateException - Thrown if the instance invokes
115:             *         this method while the instance is in a state that does not allow
116:             *         the instance to invoke this method, or if the instance does not
117:             *         have a remote interface.
118:             */
119:            public EJBObject getEJBObject()
120:                    throws java.lang.IllegalStateException {
121:                throw new UnsupportedOperationException();
122:            }
123:
124:            /**
125:             * Obtain a reference to the JAX-RPC MessageContext. An instance of a
126:             * stateless session bean can call this method from any business method
127:             * invoked through its web service endpoint interface.
128:             * @return The MessageContext for this web service invocation.
129:             * @throws java.lang.IllegalStateException - Thrown if this method is
130:             *         invoked while the instance is in a state that does not allow
131:             *         access to this method.
132:             */
133:            public javax.xml.rpc.handler.MessageContext getMessageContext()
134:                    throws java.lang.IllegalStateException {
135:                throw new UnsupportedOperationException("Not implemented");
136:            }
137:
138:            /**
139:             * Obtain an object that can be used to invoke the current bean through the
140:             * given business interface.
141:             * @param <T> the interface of the bean
142:             * @param businessInterface One of the local business interfaces or remote
143:             *        business interfaces for this session bean.
144:             * @return The business object corresponding to the given business
145:             *         interface.
146:             * @throws IllegalStateException - Thrown if this method is invoked with an
147:             *         invalid business interface for the current bean.
148:             */
149:            public <T> T getBusinessObject(final Class<T> businessInterface)
150:                    throws IllegalStateException {
151:                throw new UnsupportedOperationException("Not implemented");
152:            }
153:
154:            /**
155:             * Obtain the business interface through which the current business method
156:             * invocation was made.
157:             * @return the business interface through which the current business method
158:             *         invocation was made.
159:             * @throws IllegalStateException - Thrown if this method is called and the
160:             *         bean has not been invoked through a business interface.
161:             */
162:            public Class getInvokedBusinessInterface()
163:                    throws IllegalStateException {
164:                throw new UnsupportedOperationException("Not implemented");
165:            }
166:
167:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.