Source Code Cross Referenced for BODomainStorageImpl.java in  » UML » MetaBoss » com » metaboss » sdlctools » domains » storagemodel » 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.storagemodel.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.storagemodel.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.bo.BOUnexpectedProgramConditionException;
026:        import com.metaboss.enterprise.ps.PSException;
027:        import com.metaboss.sdlctools.domains.storagemodel.BODomainStorage;
028:        import com.metaboss.sdlctools.domains.storagemodel.BORelationalStorageTechnology;
029:        import com.metaboss.sdlctools.domains.storagemodel.BOStorageTechnology;
030:        import com.metaboss.sdlctools.domains.storagemodel.storage.PSDomainStorage;
031:        import com.metaboss.sdlctools.domains.storagemodel.storage.STDomainStorage;
032:        import com.metaboss.sdlctools.domains.storagemodel.storage.STDomainStorageKey;
033:        import com.metaboss.sdlctools.types.storagemodel.StorageTechnologyType;
034:        import com.oldboss.framework.bo.impl.BOObjectImpl;
035:
036:        public class BODomainStorageImpl extends BOObjectImpl implements 
037:                BODomainStorage {
038:            protected BOMetaBossDomainImpl mMetaBossDomainImpl = null;
039:            protected BOStorageTechnology mStorageTechnology = null;
040:            protected String mDomainRef = null;
041:            protected STDomainStorage mDomainStorageDetails = null;
042:
043:            /* Instance creator */
044:            public static BODomainStorage createInstanceForExisting(
045:                    BOMetaBossDomainImpl pMetaBossDomainImpl,
046:                    BOStorageTechnology pStorageTechnology, String pDomainRef)
047:                    throws BOException {
048:                if (pStorageTechnology.getType().equals(
049:                        StorageTechnologyType.RELATIONAL))
050:                    return BORelationalDomainStorageImpl
051:                            .createInstanceForExisting(
052:                                    pMetaBossDomainImpl,
053:                                    (BORelationalStorageTechnology) pStorageTechnology,
054:                                    pDomainRef);
055:                throw new BOUnexpectedProgramConditionException(
056:                        "Storage technology type is not supported. StorageTechnologyRef: "
057:                                + pStorageTechnology.getRef()
058:                                + " StorageTechnologyType: "
059:                                + pStorageTechnology.getType());
060:            }
061:
062:            /* Protect an access to this constructor */
063:            protected BODomainStorageImpl() throws BOException {
064:            }
065:
066:            // Sets up the instance to represent existing object
067:            protected void setupInstanceForExisting(
068:                    BOMetaBossDomainImpl pMetaBossDomainImpl,
069:                    BOStorageTechnology pStorageTechnology, String pDomainRef)
070:                    throws BOException {
071:                mMetaBossDomainImpl = pMetaBossDomainImpl;
072:                mStorageTechnology = pStorageTechnology;
073:                mDomainRef = pDomainRef;
074:            }
075:
076:            // Sets up the instance to represent new object
077:            protected void setupInstanceForNew(
078:                    BOMetaBossDomainImpl pMetaBossDomainImpl,
079:                    BOStorageTechnology pStorageTechnology, String pDomainRef)
080:                    throws BOException {
081:                mMetaBossDomainImpl = pMetaBossDomainImpl;
082:                mStorageTechnology = pStorageTechnology;
083:                mDomainRef = pDomainRef;
084:                mDomainStorageDetails = new STDomainStorage();
085:                mDomainStorageDetails.StorageTechnologyRef = pStorageTechnology
086:                        .getRef();
087:                mDomainStorageDetails.DomainRef = pDomainRef;
088:            }
089:
090:            /** Retrieves the storage technology this storage is based on */
091:            public BOStorageTechnology getStorageTechnology()
092:                    throws BOException {
093:                return mStorageTechnology;
094:            }
095:
096:            /** Retrieves domain reference this storage is for */
097:            public String getDomainRef() throws BOException {
098:                return mDomainRef;
099:            }
100:
101:            /* Retrieves description */
102:            public String getDescription() throws BOException {
103:                loadDetailsIfNecessary();
104:                return mDomainStorageDetails.Description;
105:            }
106:
107:            /* Sets description */
108:            public void setDescription(String pDescription) throws BOException {
109:                if (!isBeingEdited())
110:                    throw new BOInvalidOperationForReadOnlyObjectException();
111:                mDomainStorageDetails.Description = pDescription;
112:            }
113:
114:            private void loadDetailsIfNecessary() throws BOException {
115:                if (mDomainStorageDetails == null) {
116:                    try {
117:                        // Get the instance of the enterprise ps home via jndi
118:                        Context ctx = new InitialContext();
119:                        PSDomainStorage lPs = (PSDomainStorage) ctx
120:                                .lookup(PSDomainStorage.COMPONENT_URL);
121:                        STDomainStorageKey lKey = new STDomainStorageKey();
122:                        lKey.StorageTechnologyRef = mStorageTechnology.getRef();
123:                        lKey.DomainRef = mDomainRef;
124:                        mDomainStorageDetails = lPs.getDomainStorage(lKey);
125:                        if (mDomainStorageDetails == null)
126:                            throw new BOException(
127:                                    "DomainStorage not found. StorageTechnologyRef: "
128:                                            + mStorageTechnology.getRef()
129:                                            + " DomainRef: " + mDomainRef);
130:                    } catch (NamingException e) {
131:                        throw new BONamingAndDirectoryServiceInvocationException(
132:                                "", e);
133:                    } catch (PSException e) {
134:                        throw new BOPersistenceServiceInvocationException(
135:                                "Exception caught during loading of DomainStorage details. StorageTechnologyRef: "
136:                                        + mStorageTechnology.getRef()
137:                                        + " DomainRef: " + mDomainRef, e);
138:                    }
139:                }
140:            }
141:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.