Source Code Cross Referenced for BOSelectorImpl.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.BOEntity;
027:        import com.metaboss.sdlctools.domains.enterprisemodel.BOSelector;
028:        import com.metaboss.sdlctools.domains.enterprisemodel.BOSelectorInputFieldList;
029:        import com.metaboss.sdlctools.domains.enterprisemodel.storage.PSEntity;
030:        import com.metaboss.sdlctools.domains.enterprisemodel.storage.STSelector;
031:        import com.metaboss.sdlctools.types.enterprisemodel.SelectorCardinality;
032:        import com.oldboss.framework.bo.BOTransaction;
033:        import com.oldboss.framework.bo.impl.BOObjectImpl;
034:
035:        public class BOSelectorImpl extends BOObjectImpl implements  BOSelector {
036:            private BOMetaBossDomainImpl mMetaBossDomainImpl = null;
037:            private BOEntity mEntity = null;
038:            private String mSelectorName = null;
039:            private STSelector mDetails = null;
040:
041:            /* Instance creator */
042:            public static BOSelector createInstanceForExisting(
043:                    BOMetaBossDomainImpl pMetaBossDomainImpl, BOEntity pEntity,
044:                    STSelector pDetails) throws BOException {
045:                BOSelectorImpl lImpl = new BOSelectorImpl();
046:                lImpl.mMetaBossDomainImpl = pMetaBossDomainImpl;
047:                lImpl.mEntity = pEntity;
048:                lImpl.mSelectorName = pDetails.Name;
049:                lImpl.mDetails = pDetails;
050:                lImpl.setupForExisting();
051:                return lImpl;
052:            }
053:
054:            /* Instance creator */
055:            public static BOSelector createInstanceForExisting(
056:                    BOMetaBossDomainImpl pMetaBossDomainImpl, BOEntity pEntity,
057:                    String pSelectorName) throws BOException {
058:                BOSelectorImpl lImpl = new BOSelectorImpl();
059:                lImpl.mMetaBossDomainImpl = pMetaBossDomainImpl;
060:                lImpl.mEntity = pEntity;
061:                lImpl.mSelectorName = pSelectorName;
062:                lImpl.mDetails = null;
063:                lImpl.setupForExisting();
064:                return lImpl;
065:            }
066:
067:            /* Instance creator */
068:            public static BOSelector createInstanceForNew(
069:                    BOTransaction pTransaction,
070:                    BOMetaBossDomainImpl pMetaBossDomainImpl, BOEntity pEntity,
071:                    String pSelectorName) throws BOException {
072:                BOSelectorImpl lImpl = new BOSelectorImpl();
073:                lImpl.mMetaBossDomainImpl = pMetaBossDomainImpl;
074:                lImpl.mEntity = pEntity;
075:                lImpl.mSelectorName = pSelectorName;
076:                lImpl.mDetails = new STSelector();
077:                lImpl.mDetails.Name = pSelectorName;
078:                lImpl.setupForNew(pTransaction);
079:                return lImpl;
080:            }
081:
082:            /* Private constructor restricts instance creation from outside */
083:            private BOSelectorImpl() throws BOException {
084:            }
085:
086:            /* Retrieves unique selector ref  */
087:            public String getRef() throws BOException {
088:                return mEntity.getRef() + "." + mSelectorName;
089:            }
090:
091:            /* Retrieves entity which owns this selector. */
092:            public BOEntity getEntity() throws BOException {
093:                return mEntity;
094:            }
095:
096:            /* Retrieves selector name - used to name resulting collection.
097:             * This name is always present  */
098:            public String getName() throws BOException {
099:                return mSelectorName;
100:            }
101:
102:            /* Retrieves description */
103:            public String getDescription() throws BOException {
104:                loadDetailsIfNecessary();
105:                return mDetails.Description;
106:            }
107:
108:            /* Sets description */
109:            public void setDescription(String pDescription) throws BOException {
110:                if (!isBeingEdited())
111:                    throw new BOInvalidOperationForReadOnlyObjectException();
112:                mDetails.Description = pDescription;
113:            }
114:
115:            /* Retireves the list of input fields */
116:            public BOSelectorInputFieldList getInputFields() throws BOException {
117:                return BOSelectorInputFieldListImpl.createInstanceForExisting(
118:                        mMetaBossDomainImpl, this );
119:            }
120:
121:            /* Retrieves cardinality for the return from this selector. */
122:            public SelectorCardinality getCardinality() throws BOException {
123:                loadDetailsIfNecessary();
124:                return mDetails.Cardinality;
125:            }
126:
127:            /* Sets cardinality for the return from this selector. */
128:            public void setCardinality(SelectorCardinality pCardinality)
129:                    throws BOException {
130:                if (!isBeingEdited())
131:                    throw new BOInvalidOperationForReadOnlyObjectException();
132:                mDetails.Cardinality = pCardinality;
133:            }
134:
135:            /* Retrieves text of java implementation template of the selector */
136:            public String getJavaSelector() throws BOException {
137:                loadDetailsIfNecessary();
138:                return mDetails.JavaSelector;
139:            }
140:
141:            /* Sets text of java implementation template of the selector */
142:            public void setJavaSelector(String pJavaSelector)
143:                    throws BOException {
144:                if (!isBeingEdited())
145:                    throw new BOInvalidOperationForReadOnlyObjectException();
146:                mDetails.JavaSelector = pJavaSelector;
147:            }
148:
149:            /* Retrieves text of SQL implementation template of the selector */
150:            public String getSQLSelector() throws BOException {
151:                loadDetailsIfNecessary();
152:                return mDetails.SQLSelector;
153:            }
154:
155:            /* Sets text of SQL implementation template of the selector */
156:            public void setSQLSelector(String pSQLSelector) throws BOException {
157:                if (!isBeingEdited())
158:                    throw new BOInvalidOperationForReadOnlyObjectException();
159:                mDetails.SQLSelector = pSQLSelector;
160:            }
161:
162:            /* Returns boolean flag indicating if this selector is an implicit selector */
163:            public boolean isImplicit() throws BOException {
164:                loadDetailsIfNecessary();
165:                return mDetails.IsImplicit;
166:
167:            }
168:
169:            /** Sets boolean flag indicating if this selector is an implicit selector */
170:            public void setIsImplicit(boolean isImplicit) throws BOException {
171:                if (!isBeingEdited())
172:                    throw new BOInvalidOperationForReadOnlyObjectException();
173:                mDetails.IsImplicit = isImplicit;
174:            }
175:
176:            protected void loadDetailsIfNecessary() throws BOException {
177:                if (mDetails == null) {
178:                    try {
179:                        // Get the instance of the enterprise ps home via jndi
180:                        Context ctx = new InitialContext();
181:                        PSEntity lPs = (PSEntity) ctx
182:                                .lookup(PSEntity.COMPONENT_URL);
183:
184:                        mDetails = lPs.getSelector(mEntity.getRef(),
185:                                mSelectorName);
186:                        if (mDetails == null)
187:                            throw new BOException(
188:                                    "Selector not found. (EntityRef:"
189:                                            + mEntity.getRef()
190:                                            + ", SelectorName:" + mSelectorName);
191:                    } catch (NamingException e) {
192:                        throw new BONamingAndDirectoryServiceInvocationException(
193:                                "", e);
194:                    } catch (PSException e) {
195:                        throw new BOPersistenceServiceInvocationException(
196:                                "Exception caught during processing of Selector. EntityRef:"
197:                                        + mEntity.getRef() + ", SelectorName:"
198:                                        + mSelectorName, e);
199:                    }
200:                }
201:            }
202:
203:            protected void onBeginEdit() throws BOException {
204:                // Fully load the object
205:                loadDetailsIfNecessary();
206:            }
207:
208:            /* Encapsulates commit action by this object */
209:            protected void onCommitCreation() throws BOException {
210:                try {
211:                    // Get the instance of the enterprise ps home via jndi
212:                    Context ctx = new InitialContext();
213:                    PSEntity lPs = (PSEntity) ctx
214:                            .lookup(PSEntity.COMPONENT_URL);
215:                    lPs.insertSelector(mEntity.getRef(), mDetails);
216:                } catch (NamingException e) {
217:                    throw new BONamingAndDirectoryServiceInvocationException(
218:                            "", e);
219:                } catch (PSException e) {
220:                    throw new BOPersistenceServiceInvocationException("", e);
221:                }
222:            }
223:
224:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.