Source Code Cross Referenced for BOMessageImpl.java in  » UML » MetaBoss » com » metaboss » sdlctools » domains » enterprisemodel » impl » 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 » UML » MetaBoss » com.metaboss.sdlctools.domains.enterprisemodel.impl 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // THIS SOFTWARE IS PROVIDED BY SOFTARIS PTY.LTD. AND OTHER METABOSS
002:        // CONTRIBUTORS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
003:        // BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
004:        // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SOFTARIS PTY.LTD.
005:        // OR OTHER METABOSS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
006:        // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
007:        // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
008:        // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
009:        // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
010:        // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
011:        // EVEN IF SOFTARIS PTY.LTD. OR OTHER METABOSS CONTRIBUTORS ARE ADVISED OF THE
012:        // POSSIBILITY OF SUCH DAMAGE.
013:        //
014:        // Copyright 2000-2005 © Softaris Pty.Ltd. All Rights Reserved.
015:        package com.metaboss.sdlctools.domains.enterprisemodel.impl;
016:
017:        import javax.naming.Context;
018:        import javax.naming.InitialContext;
019:        import javax.naming.NamingException;
020:
021:        import com.metaboss.enterprise.bo.BOException;
022:        import com.metaboss.enterprise.bo.BOInvalidOperationForReadOnlyObjectException;
023:        import com.metaboss.enterprise.bo.BONamingAndDirectoryServiceInvocationException;
024:        import com.metaboss.enterprise.bo.BOPersistenceServiceInvocationException;
025:        import com.metaboss.enterprise.ps.PSException;
026:        import com.metaboss.sdlctools.domains.enterprisemodel.BOMessage;
027:        import com.metaboss.sdlctools.domains.enterprisemodel.BOMessageFieldList;
028:        import com.metaboss.sdlctools.domains.enterprisemodel.BOServicemodule;
029:        import com.metaboss.sdlctools.domains.enterprisemodel.storage.PSMessage;
030:        import com.metaboss.sdlctools.domains.enterprisemodel.storage.STMessage;
031:        import com.metaboss.sdlctools.types.enterprisemodel.MessageType;
032:        import com.oldboss.framework.bo.BOTransaction;
033:        import com.oldboss.framework.bo.impl.BOObjectImpl;
034:
035:        public class BOMessageImpl extends BOObjectImpl implements  BOMessage {
036:            protected BOMetaBossDomainImpl mMetaBossDomainImpl = null;
037:            private BOServicemodule mServicemodule = null;
038:            private String mMessageRef = null;
039:            private STMessage mDetails = null;
040:
041:            /* Instance creator */
042:            public static BOMessage createInstanceForExisting(
043:                    BOMetaBossDomainImpl pMetaBossDomainImpl, String pMessageRef)
044:                    throws BOException {
045:                BOMessageImpl lImpl = new BOMessageImpl();
046:                lImpl.mMetaBossDomainImpl = pMetaBossDomainImpl;
047:                lImpl.mMessageRef = pMessageRef;
048:                lImpl.setupForExisting();
049:                return lImpl;
050:            }
051:
052:            /* Instance creator */
053:            public static BOMessage createInstanceForNew(
054:                    BOTransaction pTransaction,
055:                    BOMetaBossDomainImpl pMetaBossDomainImpl, String pMessageRef)
056:                    throws BOException {
057:                BOMessageImpl lImpl = new BOMessageImpl();
058:                lImpl.mMetaBossDomainImpl = pMetaBossDomainImpl;
059:                lImpl.mMessageRef = pMessageRef;
060:                lImpl.mDetails = new STMessage();
061:                lImpl.mDetails.MessageRef = pMessageRef;
062:                lImpl.setupForNew(pTransaction);
063:                return lImpl;
064:            }
065:
066:            /* Private constructor restricts instance creation from outside */
067:            private BOMessageImpl() throws BOException {
068:            }
069:
070:            /* Retrieves unique reference */
071:            public String getRef() throws BOException {
072:                return mMessageRef;
073:            }
074:
075:            /* Retrieves entity name */
076:            public String getName() throws BOException {
077:                String lMessageRef = getRef();
078:                if (lMessageRef.lastIndexOf(".") < 0)
079:                    throw new BOException("Invalid BOMessage reference : "
080:                            + getRef());
081:                return lMessageRef.substring(lMessageRef.lastIndexOf(".") + 1);
082:            }
083:
084:            /* Retrieves description */
085:            public String getDescription() throws BOException {
086:                loadDetailsIfNecessary();
087:                return mDetails.Description;
088:            }
089:
090:            /* Sets description */
091:            public void setDescription(String pDescription) throws BOException {
092:                if (!isBeingEdited())
093:                    throw new BOInvalidOperationForReadOnlyObjectException();
094:                mDetails.Description = pDescription;
095:            }
096:
097:            /* Retrieves message type */
098:            public MessageType getType() throws BOException {
099:                loadDetailsIfNecessary();
100:                return mDetails.Type;
101:            }
102:
103:            /** Sets message type */
104:            public void setType(MessageType pType) throws BOException {
105:                if (!isBeingEdited())
106:                    throw new BOInvalidOperationForReadOnlyObjectException();
107:                mDetails.Type = pType;
108:            }
109:
110:            /* Retrieves default text */
111:            public String getDefaultText() throws BOException {
112:                loadDetailsIfNecessary();
113:                return mDetails.DefaultText;
114:            }
115:
116:            /** Sets default text */
117:            public void setDefaultText(String pDefaultText) throws BOException {
118:                if (!isBeingEdited())
119:                    throw new BOInvalidOperationForReadOnlyObjectException();
120:                mDetails.DefaultText = pDefaultText;
121:            }
122:
123:            /* Retrieves parent servicemodule */
124:            public BOServicemodule getServicemodule() throws BOException {
125:                if (mServicemodule == null) {
126:                    String lMessageRef = getRef();
127:                    if (lMessageRef.lastIndexOf(".") < 0)
128:                        throw new BOException("Invalid MessageRef: " + getRef());
129:                    mServicemodule = BOServicemoduleImpl
130:                            .createInstanceForExisting(mMetaBossDomainImpl,
131:                                    lMessageRef.substring(0, lMessageRef
132:                                            .lastIndexOf(".")));
133:                }
134:                return mServicemodule;
135:            }
136:
137:            /* Retireves the list of input fields */
138:            public BOMessageFieldList getFields() throws BOException {
139:                loadDetailsIfNecessary();
140:                return BOMessageFieldListImpl.createInstanceForExisting(
141:                        mMetaBossDomainImpl, this );
142:            }
143:
144:            protected void loadDetailsIfNecessary() throws BOException {
145:                if (mDetails == null) {
146:                    try {
147:                        // Get the instance of the enterprise ps home via jndi
148:                        Context ctx = new InitialContext();
149:                        PSMessage lPs = (PSMessage) ctx
150:                                .lookup(PSMessage.COMPONENT_URL);
151:
152:                        mDetails = lPs.getMessage(mMessageRef);
153:                        if (mDetails == null)
154:                            throw new BOException(
155:                                    "Message not found. MessageRef:"
156:                                            + mMessageRef);
157:                    } catch (NamingException e) {
158:                        throw new BONamingAndDirectoryServiceInvocationException(
159:                                "", e);
160:                    } catch (PSException e) {
161:                        throw new BOPersistenceServiceInvocationException("", e);
162:                    }
163:                }
164:            }
165:
166:            protected void onBeginEdit() throws BOException {
167:                // Fully load the object
168:                loadDetailsIfNecessary();
169:            }
170:
171:            /* Encapsulates commit action by this object */
172:            protected void onCommitCreation() throws BOException {
173:                try {
174:                    // Get the instance of the enterprise ps home via jndi
175:                    Context ctx = new InitialContext();
176:                    PSMessage lPs = (PSMessage) ctx
177:                            .lookup(PSMessage.COMPONENT_URL);
178:                    lPs.insert(new STMessage[] { mDetails });
179:                } catch (NamingException e) {
180:                    throw new BONamingAndDirectoryServiceInvocationException(
181:                            "", e);
182:                } catch (PSException e) {
183:                    throw new BOPersistenceServiceInvocationException("", e);
184:                }
185:            }
186:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.