Source Code Cross Referenced for AxisServiceGroup.java in  » Web-Services-AXIS2 » kernal » org » apache » axis2 » description » 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 » Web Services AXIS2 » kernal » org.apache.axis2.description 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one
003:         * or more contributor license agreements. See the NOTICE file
004:         * distributed with this work for additional information
005:         * regarding copyright ownership. The ASF licenses this file
006:         * to you under the Apache License, Version 2.0 (the
007:         * "License"); you may not use this file except in compliance
008:         * with the License. You may obtain a copy of the License at
009:         *
010:         * http://www.apache.org/licenses/LICENSE-2.0
011:         *
012:         * Unless required by applicable law or agreed to in writing,
013:         * software distributed under the License is distributed on an
014:         * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015:         * KIND, either express or implied. See the License for the
016:         * specific language governing permissions and limitations
017:         * under the License.
018:         */
019:
020:        package org.apache.axis2.description;
021:
022:        import org.apache.axis2.AxisFault;
023:        import org.apache.axis2.engine.AxisConfiguration;
024:        import org.apache.axis2.engine.AxisEvent;
025:        import org.apache.axis2.i18n.Messages;
026:        import org.apache.axis2.modules.Module;
027:
028:        import java.util.ArrayList;
029:        import java.util.HashMap;
030:        import java.util.Iterator;
031:
032:        public class AxisServiceGroup extends AxisDescription {
033:
034:            //to check whether user has put WWW dir or not
035:            private boolean foundWebResources;
036:            // to store module ref at deploy time parsing
037:            private ArrayList modulesList = new ArrayList();
038:
039:            // to store modeule configuration info
040:            private HashMap moduleConfigmap;
041:
042:            // class loader
043:            private ClassLoader serviceGroupClassLoader;
044:
045:            // to keep name of the service group
046:            private String serviceGroupName;
047:
048:            public AxisServiceGroup() {
049:                moduleConfigmap = new HashMap();
050:            }
051:
052:            public AxisServiceGroup(AxisConfiguration axisDescription) {
053:                this ();
054:                setParent(axisDescription);
055:            }
056:
057:            /**
058:             * Adds module configuration, if there is moduleConfig tag in service.
059:             *
060:             * @param moduleConfiguration the ModuleConfiguration to add
061:             */
062:            public void addModuleConfig(ModuleConfiguration moduleConfiguration) {
063:                if (moduleConfigmap == null) {
064:                    moduleConfigmap = new HashMap();
065:                }
066:
067:                moduleConfigmap.put(moduleConfiguration.getModuleName(),
068:                        moduleConfiguration);
069:            }
070:
071:            public void addModuleref(String moduleref) {
072:                modulesList.add(moduleref);
073:            }
074:
075:            public void addService(AxisService service) throws AxisFault {
076:                if (service == null) {
077:                    return;
078:                }
079:
080:                if (serviceGroupName == null) {
081:                    // setup a temporary name based on the first service under this group
082:                    serviceGroupName = service.getName();
083:                }
084:
085:                service.setParent(this );
086:
087:                AxisConfiguration axisConfig = getAxisConfiguration();
088:
089:                if (axisConfig != null) {
090:                    for (Iterator iterator = getEngagedModules().iterator(); iterator
091:                            .hasNext();) {
092:                        Object o = iterator.next();
093:                        AxisModule axisModule;
094:                        if (o instanceof  AxisModule) {
095:                            axisModule = (AxisModule) o;
096:                        } else if (o instanceof  String) { //Should this be checked
097:                            String moduleName = (String) o;
098:                            axisModule = axisConfig.getModule(moduleName);
099:                            if (axisModule == null) {
100:                                throw new AxisFault(Messages.getMessage(
101:                                        "modulenotavailble", moduleName));
102:                            }
103:                        } else {
104:                            throw new AxisFault(Messages
105:                                    .getMessage("modulenotavailble"));
106:                        }
107:                        service.engageModule(axisModule);
108:                    }
109:
110:                }
111:                service.setLastupdate();
112:                addChild(service);
113:                if (axisConfig != null) {
114:                    axisConfig.addToAllServicesMap(service);
115:                }
116:            }
117:
118:            /**
119:             *
120:             * @param service
121:             * @throws Exception
122:             * @deprecated please use addService() instead
123:             */
124:            public void addToGroup(AxisService service) throws Exception {
125:                addService(service);
126:            }
127:
128:            /**
129:             * When a module gets engaged on a ServiceGroup, we have to engage it for each Service.
130:             *
131:             * @param module the newly-engaged AxisModule
132:             * @param engager
133:             * @throws AxisFault if there is a problem
134:             */
135:            protected void onEngage(AxisModule module, AxisDescription engager)
136:                    throws AxisFault {
137:                for (Iterator serviceIter = getServices(); serviceIter
138:                        .hasNext();) {
139:                    AxisService axisService = (AxisService) serviceIter.next();
140:                    axisService.engageModule(module, engager);
141:                }
142:            }
143:
144:            public void onDisengage(AxisModule module) throws AxisFault {
145:                for (Iterator serviceIter = getServices(); serviceIter
146:                        .hasNext();) {
147:                    AxisService axisService = (AxisService) serviceIter.next();
148:                    axisService.disengageModule(module);
149:                }
150:            }
151:
152:            public void removeService(String name) throws AxisFault {
153:                AxisService service = getService(name);
154:
155:                if (service != null) {
156:                    getAxisConfiguration().notifyObservers(
157:                            AxisEvent.SERVICE_REMOVE, service);
158:                }
159:
160:                removeChild(name);
161:            }
162:
163:            public ModuleConfiguration getModuleConfig(String moduleName) {
164:                return (ModuleConfiguration) moduleConfigmap.get(moduleName);
165:            }
166:
167:            public ArrayList getModuleRefs() {
168:                return modulesList;
169:            }
170:
171:            public AxisService getService(String name) throws AxisFault {
172:                return (AxisService) getChild(name);
173:            }
174:
175:            public ClassLoader getServiceGroupClassLoader() {
176:                return serviceGroupClassLoader;
177:            }
178:
179:            public String getServiceGroupName() {
180:                // Note: if the serviceGroupName is not set, then this could be null.
181:                // If the serviceGroupName has not been set and a service is added to this group,
182:                // then the serviceGroupName will default to the name of the first service
183:                return serviceGroupName;
184:            }
185:
186:            public Iterator getServices() {
187:                return getChildren();
188:            }
189:
190:            public void setAxisDescription(AxisConfiguration axisDescription) {
191:                setParent(axisDescription);
192:            }
193:
194:            public void setServiceGroupClassLoader(
195:                    ClassLoader serviceGroupClassLoader) {
196:                this .serviceGroupClassLoader = serviceGroupClassLoader;
197:            }
198:
199:            public void setServiceGroupName(String serviceGroupName) {
200:                this .serviceGroupName = serviceGroupName;
201:            }
202:
203:            public Object getKey() {
204:                // Note: if the serviceGroupName is not set, then this could be null.
205:                // If the serviceGroupName has not been set and a service is added to this group,
206:                // then the serviceGroupName will default to the name of the first service
207:                return this .serviceGroupName;
208:            }
209:
210:            public boolean isFoundWebResources() {
211:                return foundWebResources;
212:            }
213:
214:            public void setFoundWebResources(boolean foundWebResources) {
215:                this.foundWebResources = foundWebResources;
216:            }
217:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.