Source Code Cross Referenced for BSDomainStorageManagementImpl.java in  » UML » MetaBoss » com » metaboss » sdlctools » services » metadatamanagement » domainstoragemanagement » 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.services.metadatamanagement.domainstoragemanagement 
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.services.metadatamanagement.domainstoragemanagement;
016:
017:        import java.util.Properties;
018:
019:        import javax.naming.Context;
020:        import javax.naming.InitialContext;
021:        import javax.naming.NamingException;
022:
023:        import org.apache.commons.logging.Log;
024:        import org.apache.commons.logging.LogFactory;
025:
026:        import com.metaboss.enterprise.bo.BOException;
027:        import com.metaboss.enterprise.bo.BOUnexpectedProgramConditionException;
028:        import com.metaboss.enterprise.bs.BSDomainObjectInvocationException;
029:        import com.metaboss.enterprise.bs.BSException;
030:        import com.metaboss.enterprise.bs.BSNamingAndDirectoryServiceInvocationException;
031:        import com.metaboss.sdlctools.models.ModelRepository;
032:        import com.metaboss.sdlctools.models.metabossmodel.MetaBossModelPackage;
033:        import com.metaboss.sdlctools.models.metabossmodel.technologylibrarymodel.RelationalStorageTechnology;
034:        import com.metaboss.sdlctools.models.metabossmodel.technologylibrarymodel.StorageTechnology;
035:        import com.metaboss.sdlctools.services.metadatamanagement.BSDomainStorageManagement;
036:
037:        // The only implementation we can think of at the moment
038:        public class BSDomainStorageManagementImpl implements 
039:                BSDomainStorageManagement {
040:            // Commons Logging instance.
041:            private static final Log sLogger = LogFactory
042:                    .getLog(BSDomainStorageManagementImpl.class);
043:
044:            // Updates metadata describing domain storage at the particular technology.
045:            public void updateMetadataForDomain(String pStorageTechnologyRef,
046:                    String pDomainRef, String pReferenceModelName)
047:                    throws BSException {
048:                try {
049:                    sLogger
050:                            .info("Updating domain storage metadata for "
051:                                    + pDomainRef + " domain on "
052:                                    + pStorageTechnologyRef
053:                                    + " storage technology....");
054:                    // Get the referenced objects from the model
055:                    Context lContext = new InitialContext();
056:                    ModelRepository lModelRepository = (ModelRepository) lContext
057:                            .lookup(ModelRepository.COMPONENT_URL);
058:                    MetaBossModelPackage lMetaBossModelPackage = (MetaBossModelPackage) lModelRepository
059:                            .getDefaultModelExtent();
060:                    StorageTechnology lStorageTechnology = (StorageTechnology) lMetaBossModelPackage
061:                            .getModelElement().getByRef(pStorageTechnologyRef);
062:
063:                    lModelRepository.beginTransaction();
064:                    try {
065:                        // Call our generic implementation depending on type
066:                        if (lStorageTechnology instanceof  RelationalStorageTechnology)
067:                            RelationalDomainStorageManagement
068:                                    .updateMetadataForDomain(
069:                                            (RelationalStorageTechnology) lStorageTechnology,
070:                                            pDomainRef, pReferenceModelName);
071:                        else
072:                            throw new BOUnexpectedProgramConditionException(
073:                                    "Unsupported storage technology. StorageTechnologyRef : "
074:                                            + lStorageTechnology.getRef());
075:
076:                        // See if we need to call custom implementation and do it
077:                        String lOptionalMetadataGeneratorPackage = lStorageTechnology
078:                                .getMetadataGeneratorPackage();
079:                        if (lOptionalMetadataGeneratorPackage != null
080:                                && lOptionalMetadataGeneratorPackage.length() > 0) {
081:                            // Prepare the property based on implementation asked for
082:                            Properties lContextProps = new Properties();
083:                            lContextProps
084:                                    .setProperty(
085:                                            "com.metaboss.naming.component.com.metaboss.sdlctools.services.metadatamanagement.BSDomainStorageManagement",
086:                                            "com.metaboss.sdlctools.services.metadatamanagement.domainstoragemanagement."
087:                                                    + lOptionalMetadataGeneratorPackage);
088:                            Context ctx = new InitialContext(lContextProps);
089:                            BSDomainStorageManagement lCustomGenerator = (BSDomainStorageManagement) ctx
090:                                    .lookup(BSDomainStorageManagement.COMPONENT_URL);
091:                            lCustomGenerator.updateMetadataForDomain(
092:                                    pStorageTechnologyRef, pDomainRef,
093:                                    pReferenceModelName);
094:                        }
095:                        lModelRepository.commitTransaction();
096:                        lModelRepository.saveDefaultModel(true);
097:                        sLogger
098:                                .info("Done updating domain storage metadata for "
099:                                        + pDomainRef
100:                                        + " domain on "
101:                                        + pStorageTechnologyRef
102:                                        + " storage technology....");
103:                    } finally {
104:                        if (lModelRepository.isInTransaction())
105:                            lModelRepository.rollbackTransaction();
106:                    }
107:                } catch (NamingException e) {
108:                    throw new BSNamingAndDirectoryServiceInvocationException(e);
109:                } catch (BOException e) {
110:                    throw new BSDomainObjectInvocationException(
111:                            "Exception caught during updating of domain storage metadata.",
112:                            e);
113:                }
114:            }
115:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.