Source Code Cross Referenced for BOStructureImpl.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.BOServicemodule;
027:        import com.metaboss.sdlctools.domains.enterprisemodel.BOStructure;
028:        import com.metaboss.sdlctools.domains.enterprisemodel.BOStructureConstraintList;
029:        import com.metaboss.sdlctools.domains.enterprisemodel.BOStructureFieldList;
030:        import com.metaboss.sdlctools.domains.enterprisemodel.storage.PSStructure;
031:        import com.metaboss.sdlctools.domains.enterprisemodel.storage.STStructure;
032:        import com.oldboss.framework.bo.BOTransaction;
033:        import com.oldboss.framework.bo.impl.BOObjectImpl;
034:
035:        public class BOStructureImpl extends BOObjectImpl implements 
036:                BOStructure {
037:            protected BOMetaBossDomainImpl mMetaBossDomainImpl = null;
038:            private BOServicemodule mServicemodule = null;
039:            private String mStructureRef = null;
040:            private STStructure mDetails = null;
041:
042:            /* Instance creator */
043:            public static BOStructure createInstanceForExisting(
044:                    BOMetaBossDomainImpl pMetaBossDomainImpl,
045:                    String pStructureRef) throws BOException {
046:                BOStructureImpl lImpl = new BOStructureImpl();
047:                lImpl.mMetaBossDomainImpl = pMetaBossDomainImpl;
048:                lImpl.mStructureRef = pStructureRef;
049:                lImpl.setupForExisting();
050:                return lImpl;
051:            }
052:
053:            /* Instance creator */
054:            public static BOStructure createInstanceForNew(
055:                    BOTransaction pTransaction,
056:                    BOMetaBossDomainImpl pMetaBossDomainImpl,
057:                    String pStructureRef) throws BOException {
058:                BOStructureImpl lImpl = new BOStructureImpl();
059:                lImpl.mMetaBossDomainImpl = pMetaBossDomainImpl;
060:                lImpl.mStructureRef = pStructureRef;
061:                lImpl.mDetails = new STStructure();
062:                lImpl.mDetails.StructureRef = pStructureRef;
063:                lImpl.setupForNew(pTransaction);
064:                return lImpl;
065:            }
066:
067:            /* Private constructor restricts instance creation from outside */
068:            private BOStructureImpl() throws BOException {
069:            }
070:
071:            /* Retrieves unique reference */
072:            public String getRef() throws BOException {
073:                return mStructureRef;
074:            }
075:
076:            /* Retrieves entity name */
077:            public String getName() throws BOException {
078:                String lStructureRef = getRef();
079:                if (lStructureRef.lastIndexOf(".") < 0)
080:                    throw new BOException("Invalid BOStructure reference : "
081:                            + getRef());
082:                return lStructureRef
083:                        .substring(lStructureRef.lastIndexOf(".") + 1);
084:            }
085:
086:            /* Retrieves description */
087:            public String getDescription() throws BOException {
088:                loadDetailsIfNecessary();
089:                return mDetails.Description;
090:            }
091:
092:            /** Sets description */
093:            public void setDescription(String pDescription) throws BOException {
094:                if (!isBeingEdited())
095:                    throw new BOInvalidOperationForReadOnlyObjectException();
096:                mDetails.Description = pDescription;
097:            }
098:
099:            /* Retrieves parent servicemodule */
100:            public BOServicemodule getServicemodule() throws BOException {
101:                if (mServicemodule == null) {
102:                    String lStructureRef = getRef();
103:                    if (lStructureRef.lastIndexOf(".") < 0)
104:                        throw new BOException(
105:                                "Invalid BOStructure reference : " + getRef());
106:                    mServicemodule = BOServicemoduleImpl
107:                            .createInstanceForExisting(mMetaBossDomainImpl,
108:                                    lStructureRef.substring(0, lStructureRef
109:                                            .lastIndexOf(".")));
110:                }
111:                return mServicemodule;
112:            }
113:
114:            /* Retireves the list of fields */
115:            public BOStructureFieldList getFields() throws BOException {
116:                loadDetailsIfNecessary();
117:                return BOStructureFieldListImpl.createInstanceForExisting(
118:                        mMetaBossDomainImpl, this );
119:            }
120:
121:            /* Retireves the list of constraints */
122:            public BOStructureConstraintList getConstraints()
123:                    throws BOException {
124:                loadDetailsIfNecessary();
125:                return BOStructureConstraintListImpl.createInstanceForExisting(
126:                        mMetaBossDomainImpl, this );
127:            }
128:
129:            /* Overriden to provide check reference equality */
130:            public boolean equals(Object pOther) {
131:                if (pOther == null)
132:                    return false;
133:                if (!(pOther instanceof  BOStructureImpl))
134:                    return false;
135:                return ((BOStructureImpl) pOther).mStructureRef
136:                        .equals(mStructureRef);
137:            }
138:
139:            protected void loadDetailsIfNecessary() throws BOException {
140:                if (mDetails == null) {
141:                    try {
142:                        // Get the instance of the enterprise ps home via jndi
143:                        Context ctx = new InitialContext();
144:                        PSStructure lPs = (PSStructure) ctx
145:                                .lookup(PSStructure.COMPONENT_URL);
146:
147:                        mDetails = lPs.getStructure(mStructureRef);
148:                        if (mDetails == null)
149:                            throw new BOException(
150:                                    "Structure not found. StructureRef:"
151:                                            + mStructureRef);
152:                    } catch (NamingException e) {
153:                        throw new BONamingAndDirectoryServiceInvocationException(
154:                                "", e);
155:                    } catch (PSException e) {
156:                        throw new BOPersistenceServiceInvocationException("", e);
157:                    }
158:                }
159:            }
160:
161:            protected void onBeginEdit() throws BOException {
162:                // Fully load the object
163:                loadDetailsIfNecessary();
164:            }
165:
166:            /* Encapsulates commit action by this object */
167:            protected void onCommitCreation() throws BOException {
168:                try {
169:                    // Get the instance of the enterprise ps home via jndi
170:                    Context ctx = new InitialContext();
171:                    PSStructure lPs = (PSStructure) ctx
172:                            .lookup(PSStructure.COMPONENT_URL);
173:                    lPs.insert(new STStructure[] { mDetails });
174:                } catch (NamingException e) {
175:                    throw new BONamingAndDirectoryServiceInvocationException(
176:                            "", e);
177:                } catch (PSException e) {
178:                    throw new BOPersistenceServiceInvocationException("", e);
179:                }
180:            }
181:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.