Source Code Cross Referenced for BOSystemDatatypeListImpl.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.BOIllegalArgumentException;
023:        import com.metaboss.enterprise.bo.BOInvalidOperationForReadOnlyObjectException;
024:        import com.metaboss.enterprise.bo.BONamingAndDirectoryServiceInvocationException;
025:        import com.metaboss.enterprise.bo.BOPersistenceServiceInvocationException;
026:        import com.metaboss.enterprise.ps.PSException;
027:        import com.metaboss.sdlctools.domains.enterprisemodel.BODatatype;
028:        import com.metaboss.sdlctools.domains.enterprisemodel.BOSystem;
029:        import com.metaboss.sdlctools.domains.enterprisemodel.BOSystemDatatypeList;
030:        import com.metaboss.sdlctools.domains.enterprisemodel.storage.PSDatatype;
031:        import com.metaboss.sdlctools.domains.enterprisemodel.storage.PSSystem;
032:        import com.metaboss.sdlctools.domains.enterprisemodel.storage.STDatatype;
033:        import com.oldboss.framework.bo.impl.BOObjectImpl;
034:
035:        public class BOSystemDatatypeListImpl extends BOObjectImpl implements 
036:                BOSystemDatatypeList {
037:            private BOMetaBossDomainImpl mMetaBossDomainImpl = null;
038:            private BOSystem mSystem = null;
039:
040:            /* Instance creator */
041:            public static BOSystemDatatypeList createInstanceForExisting(
042:                    BOMetaBossDomainImpl pMetaBossDomainImpl, BOSystem pSystem)
043:                    throws BOException {
044:                BOSystemDatatypeListImpl lImpl = new BOSystemDatatypeListImpl();
045:                lImpl.mMetaBossDomainImpl = pMetaBossDomainImpl;
046:                lImpl.mSystem = pSystem;
047:                lImpl.setupForExisting();
048:                return lImpl;
049:            }
050:
051:            /* Private constructor restricts instance creation from outside */
052:            private BOSystemDatatypeListImpl() throws BOException {
053:            }
054:
055:            /** Retrieves all entities defined in this domain */
056:            public BODatatype[] getAllDatatypes() throws BOException {
057:                try {
058:                    // Get the instance of the enterprise ps home via jndi
059:                    Context ctx = new InitialContext();
060:                    PSSystem lPs = (PSSystem) ctx
061:                            .lookup(PSSystem.COMPONENT_URL);
062:
063:                    String[] lDatatypeRefs = lPs.getAllDatatypeRefs(mSystem
064:                            .getRef());
065:                    if (lDatatypeRefs == null || lDatatypeRefs.length == 0)
066:                        return new BODatatype[0];
067:                    BODatatype[] lReturn = new BODatatype[lDatatypeRefs.length];
068:                    for (int i = 0; i < lDatatypeRefs.length; i++) {
069:                        lReturn[i] = BODatatypeImpl.createInstanceForExisting(
070:                                mMetaBossDomainImpl, lDatatypeRefs[i]);
071:                    }
072:                    return lReturn;
073:                } catch (NamingException e) {
074:                    throw new BONamingAndDirectoryServiceInvocationException(
075:                            "Error while loading all datatypes. SystemRef: "
076:                                    + mSystem.getRef(), e);
077:                } catch (PSException e) {
078:                    throw new BOPersistenceServiceInvocationException(
079:                            "Error while loading all datatypes. SystemRef: "
080:                                    + mSystem.getRef(), e);
081:                }
082:            }
083:
084:            /** Retrieves the datatype corresponding to given reference from this enteprise */
085:            public BODatatype getDatatype(String pDatatypeRef)
086:                    throws BOException {
087:                if (pDatatypeRef == null
088:                        || pDatatypeRef.startsWith(mSystem.getRef() + ".") == false)
089:                    return null; // No way this enteprise has given datatype
090:                return BODatatypeImpl.createInstanceForExisting(
091:                        mMetaBossDomainImpl, pDatatypeRef);
092:            }
093:
094:            // Returns true if this enterprise contains this datatype
095:            public boolean containsDatatype(String pDatatypeRef)
096:                    throws BOException {
097:                if (pDatatypeRef == null
098:                        || pDatatypeRef.startsWith(mSystem.getRef() + ".") == false)
099:                    return false; // No way this enteprise has given datatype
100:                try {
101:                    // Get the instance of the enterprise ps home via jndi
102:                    Context ctx = new InitialContext();
103:                    PSDatatype lPs = (PSDatatype) ctx
104:                            .lookup(PSDatatype.COMPONENT_URL);
105:                    STDatatype lDetails = lPs.getDatatype(pDatatypeRef);
106:                    return lDetails != null;
107:                } catch (NamingException e) {
108:                    throw new BONamingAndDirectoryServiceInvocationException(
109:                            "", e);
110:                } catch (PSException e) {
111:                    throw new BOPersistenceServiceInvocationException("", e);
112:                }
113:            }
114:
115:            // Creates the datatype in this enterprise
116:            public BODatatype createDatatype(String pDatatypeRef)
117:                    throws BOException {
118:                if (!isBeingEdited())
119:                    throw new BOInvalidOperationForReadOnlyObjectException();
120:                if (pDatatypeRef == null
121:                        || pDatatypeRef.startsWith(mSystem.getRef() + ".") == false)
122:                    throw new BOIllegalArgumentException("Datatype with Ref "
123:                            + pDatatypeRef
124:                            + " can not be a part of this system. SystemRef : "
125:                            + mSystem.getRef());
126:                return BODatatypeImpl.createInstanceForNew(fetchTransaction(),
127:                        mMetaBossDomainImpl, pDatatypeRef);
128:            }
129:
130:            // Deletes the datatype from the enterprise.
131:            public void deleteDatatype(BODatatype pDatatype) throws BOException {
132:                if (!isBeingEdited())
133:                    throw new BOInvalidOperationForReadOnlyObjectException();
134:                if (pDatatype == null
135:                        || pDatatype.getRef()
136:                                .startsWith(mSystem.getRef() + ".") == false)
137:                    throw new BOIllegalArgumentException(
138:                            "Datatype with Ref "
139:                                    + pDatatype.getRef()
140:                                    + " is not part of this system and can not be deleted from it. SystemRef : "
141:                                    + mSystem.getRef());
142:                pDatatype.delete(fetchTransaction());
143:            }
144:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.