Source Code Cross Referenced for ServiceLogicImpl.java in  » UML » AndroMDA-3.2 » org » andromda » metafacades » emf » uml2 » 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 » AndroMDA 3.2 » org.andromda.metafacades.emf.uml2 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.andromda.metafacades.emf.uml2;
002:
003:        import java.util.ArrayList;
004:        import java.util.Collection;
005:        import java.util.LinkedHashSet;
006:
007:        import org.andromda.metafacades.uml.DependencyFacade;
008:        import org.andromda.metafacades.uml.Entity;
009:        import org.andromda.metafacades.uml.FilteredCollection;
010:        import org.andromda.metafacades.uml.ModelElementFacade;
011:        import org.andromda.metafacades.uml.Role;
012:        import org.andromda.metafacades.uml.Service;
013:        import org.andromda.metafacades.uml.ServiceOperation;
014:        import org.apache.commons.collections.Closure;
015:        import org.apache.commons.collections.CollectionUtils;
016:        import org.apache.commons.collections.Predicate;
017:        import org.apache.commons.collections.Transformer;
018:
019:        /**
020:         * MetafacadeLogic implementation for org.andromda.metafacades.uml.Service.
021:         *
022:         * @see org.andromda.metafacades.uml.Service
023:         */
024:        public class ServiceLogicImpl extends ServiceLogic {
025:            public ServiceLogicImpl(final Object metaObject,
026:                    final String context) {
027:                super (metaObject, context);
028:            }
029:
030:            /**
031:             * @see org.andromda.metafacades.uml.Service#getServiceReferences()
032:             */
033:            protected java.util.Collection handleGetServiceReferences() {
034:                return new FilteredCollection(this .getSourceDependencies()) {
035:                    public boolean evaluate(final Object object) {
036:                        ModelElementFacade targetElement = ((DependencyFacade) object)
037:                                .getTargetElement();
038:                        return targetElement != null
039:                                && Service.class.isAssignableFrom(targetElement
040:                                        .getClass());
041:                    }
042:                };
043:            }
044:
045:            /**
046:             * @see org.andromda.metafacades.uml.Service#getEntityReferences()
047:             */
048:            protected java.util.Collection handleGetEntityReferences() {
049:                return new FilteredCollection(this .getSourceDependencies()) {
050:                    public boolean evaluate(final Object object) {
051:                        ModelElementFacade targetElement = ((DependencyFacade) object)
052:                                .getTargetElement();
053:                        return targetElement != null
054:                                && Entity.class.isAssignableFrom(targetElement
055:                                        .getClass());
056:                    }
057:                };
058:            }
059:
060:            /**
061:             * @see org.andromda.metafacades.uml.Service.getAllServiceReferences()
062:             */
063:            public Collection handleGetAllServiceReferences() {
064:                final Collection result = new ArrayList();
065:
066:                // get references of the service itself
067:                result.addAll(this .getServiceReferences());
068:
069:                // get references of all super classes
070:                CollectionUtils.forAllDo(this .getAllGeneralizations(),
071:                        new Closure() {
072:                            public void execute(final Object object) {
073:                                Service service = (Service) object;
074:                                result.addAll(service.getServiceReferences());
075:                            }
076:                        });
077:                return result;
078:            }
079:
080:            /**
081:             * @see org.andromda.metafacades.uml.Service#getRoles()
082:             */
083:            protected Collection handleGetRoles() {
084:                final Collection roles = new ArrayList(this 
085:                        .getTargetDependencies());
086:                CollectionUtils.filter(roles, new Predicate() {
087:                    public boolean evaluate(final Object object) {
088:                        DependencyFacade dependency = (DependencyFacade) object;
089:                        return dependency != null
090:                                && dependency.getSourceElement() instanceof  Role;
091:                    }
092:                });
093:                CollectionUtils.transform(roles, new Transformer() {
094:                    public Object transform(final Object object) {
095:                        return ((DependencyFacade) object).getSourceElement();
096:                    }
097:                });
098:
099:                final Collection allRoles = new LinkedHashSet(roles);
100:
101:                // add all roles which are generalizations of this one
102:                CollectionUtils.forAllDo(roles, new Closure() {
103:                    public void execute(final Object object) {
104:                        allRoles
105:                                .addAll(((Role) object).getAllSpecializations());
106:                    }
107:                });
108:                return allRoles;
109:            }
110:
111:            /**
112:             * @see org.andromda.metafacades.uml.Service#getAllRoles()
113:             */
114:            protected Collection handleGetAllRoles() {
115:                final Collection roles = new LinkedHashSet(this .getRoles());
116:                CollectionUtils.forAllDo(this .getOperations(), new Closure() {
117:                    public void execute(final Object object) {
118:                        if (object instanceof  ServiceOperation) {
119:                            roles
120:                                    .addAll(((ServiceOperation) object)
121:                                            .getRoles());
122:                        }
123:                    }
124:                });
125:                return roles;
126:            }
127:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.