Source Code Cross Referenced for CartBean.java in  » IDE-Netbeans » usersguide » cart » 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 » IDE Netbeans » usersguide » cart 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (c) 2005 Sun Microsystems, Inc.  All rights reserved.  U.S.
003:         * Government Rights - Commercial software.  Government users are subject
004:         * to the Sun Microsystems, Inc. standard license agreement and
005:         * applicable provisions of the FAR and its supplements.  Use is subject
006:         * to license terms.
007:         *
008:         * This distribution may include materials developed by third parties.
009:         * Sun, Sun Microsystems, the Sun logo, Java and J2EE are trademarks
010:         * or registered trademarks of Sun Microsystems, Inc. in the U.S. and
011:         * other countries.
012:         *
013:         * Copyright (c) 2005 Sun Microsystems, Inc. Tous droits reserves.
014:         *
015:         * Droits du gouvernement americain, utilisateurs gouvernementaux - logiciel
016:         * commercial. Les utilisateurs gouvernementaux sont soumis au contrat de
017:         * licence standard de Sun Microsystems, Inc., ainsi qu'aux dispositions
018:         * en vigueur de la FAR (Federal Acquisition Regulations) et des
019:         * supplements a celles-ci.  Distribue par des licences qui en
020:         * restreignent l'utilisation.
021:         *
022:         * Cette distribution peut comprendre des composants developpes par des
023:         * tierces parties. Sun, Sun Microsystems, le logo Sun, Java et J2EE
024:         * sont des marques de fabrique ou des marques deposees de Sun
025:         * Microsystems, Inc. aux Etats-Unis et dans d'autres pays.
026:         */
027:
028:        package cart;
029:
030:        import exception.BookException;
031:        import java.util.Vector;
032:        import javax.ejb.*;
033:        import util.IdVerifier;
034:
035:        public class CartBean implements  SessionBean, CartRemoteBusiness,
036:                CartLocalBusiness {
037:            private SessionContext context;
038:            String customerName;
039:            String customerId;
040:            Vector contents;
041:
042:            // <editor-fold defaultstate="collapsed" desc="EJB infrastructure methods. Click the + sign on the left to edit the code.">
043:            // TODO Add code to acquire and use other enterprise resources (DataSource, JMS, enterprise bean, Web services)
044:            // TODO Add business methods
045:            /**
046:             * @see SessionBean#setSessionContext(SessionContext)
047:             */
048:            public void setSessionContext(SessionContext aContext) {
049:                context = aContext;
050:            }
051:
052:            /**
053:             * @see SessionBean#ejbActivate()
054:             */
055:            public void ejbActivate() {
056:
057:            }
058:
059:            /**
060:             * @see SessionBean#ejbPassivate()
061:             */
062:            public void ejbPassivate() {
063:
064:            }
065:
066:            /**
067:             * @see SessionBean#ejbRemove()
068:             */
069:            public void ejbRemove() {
070:
071:            }
072:
073:            // </editor-fold>
074:
075:            /**
076:             * See section 7.10.3 of the EJB 2.0 specification
077:             * See section 7.11.3 of the EJB 2.1 specification
078:             */
079:            public void ejbCreate() {
080:                // TODO implement ejbCreate if necessary, acquire resources
081:                // This method has access to the JNDI context so resource aquisition
082:                // spanning all methods can be performed here such as home interfaces
083:                // and data sources.
084:            }
085:
086:            // Enter business methods below. (Right-click in editor and choose
087:            // EJB Methods > Add Business Method)
088:
089:            public void ejbCreate(String person) throws CreateException {
090:                //TODO implement 
091:                if (person == null) {
092:                    throw new CreateException("Null person not allowed.");
093:                } else {
094:                    customerName = person;
095:                }
096:                customerId = "0";
097:                contents = new Vector();
098:            }
099:
100:            public void ejbCreate(String person, String id)
101:                    throws CreateException {
102:                //TODO implement 
103:                if (person == null) {
104:                    throw new CreateException("Null person not allowed.");
105:                } else {
106:                    customerName = person;
107:                }
108:
109:                IdVerifier idChecker = new IdVerifier();
110:                if (idChecker.validate(id)) {
111:                    customerId = id;
112:                } else {
113:                    throw new CreateException("Invalid id: " + id);
114:                }
115:                contents = new Vector();
116:            }
117:
118:            public void addBook(String title) {
119:                //TODO implement addBook
120:                contents.add(title);
121:            }
122:
123:            public void removeBook(String title) throws BookException {
124:                //TODO implement removeBook
125:                boolean result = contents.remove(title);
126:                if (result == false)
127:                    throw new BookException(title + " not in cart.");
128:            }
129:
130:            public Vector getContents() {
131:                //TODO implement getContents
132:                return contents;
133:            }
134:
135:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.