Source Code Cross Referenced for TestWSRPProducerImpl.java in  » Portal » jboss-portal-2.6.4 » org » jboss » portal » test » wsrp » framework » 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 » Portal » jboss portal 2.6.4 » org.jboss.portal.test.wsrp.framework 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /******************************************************************************
002:         * JBoss, a division of Red Hat                                               *
003:         * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
004:         * contributors as indicated by the @authors tag. See the                     *
005:         * copyright.txt in the distribution for a full listing of                    *
006:         * individual contributors.                                                   *
007:         *                                                                            *
008:         * This is free software; you can redistribute it and/or modify it            *
009:         * under the terms of the GNU Lesser General Public License as                *
010:         * published by the Free Software Foundation; either version 2.1 of           *
011:         * the License, or (at your option) any later version.                        *
012:         *                                                                            *
013:         * This software is distributed in the hope that it will be useful,           *
014:         * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
015:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
016:         * Lesser General Public License for more details.                            *
017:         *                                                                            *
018:         * You should have received a copy of the GNU Lesser General Public           *
019:         * License along with this software; if not, write to the Free                *
020:         * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
021:         * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
022:         ******************************************************************************/package org.jboss.portal.test.wsrp.framework;
023:
024:        import org.jboss.portal.jems.as.system.AbstractJBossService;
025:        import org.jboss.portal.registration.RegistrationManager;
026:        import org.jboss.portal.wsrp.WSRPTypeFactory;
027:        import org.jboss.portal.wsrp.core.AccessDeniedFault;
028:        import org.jboss.portal.wsrp.core.BlockingInteractionResponse;
029:        import org.jboss.portal.wsrp.core.ClonePortlet;
030:        import org.jboss.portal.wsrp.core.CookieProtocol;
031:        import org.jboss.portal.wsrp.core.DestroyPortlets;
032:        import org.jboss.portal.wsrp.core.DestroyPortletsResponse;
033:        import org.jboss.portal.wsrp.core.GetMarkup;
034:        import org.jboss.portal.wsrp.core.GetPortletDescription;
035:        import org.jboss.portal.wsrp.core.GetPortletProperties;
036:        import org.jboss.portal.wsrp.core.GetPortletPropertyDescription;
037:        import org.jboss.portal.wsrp.core.GetServiceDescription;
038:        import org.jboss.portal.wsrp.core.InconsistentParametersFault;
039:        import org.jboss.portal.wsrp.core.InitCookie;
040:        import org.jboss.portal.wsrp.core.InvalidCookieFault;
041:        import org.jboss.portal.wsrp.core.InvalidHandleFault;
042:        import org.jboss.portal.wsrp.core.InvalidRegistrationFault;
043:        import org.jboss.portal.wsrp.core.InvalidSessionFault;
044:        import org.jboss.portal.wsrp.core.InvalidUserCategoryFault;
045:        import org.jboss.portal.wsrp.core.MarkupResponse;
046:        import org.jboss.portal.wsrp.core.MissingParametersFault;
047:        import org.jboss.portal.wsrp.core.ModifyRegistration;
048:        import org.jboss.portal.wsrp.core.OperationFailedFault;
049:        import org.jboss.portal.wsrp.core.PerformBlockingInteraction;
050:        import org.jboss.portal.wsrp.core.PortletContext;
051:        import org.jboss.portal.wsrp.core.PortletDescriptionResponse;
052:        import org.jboss.portal.wsrp.core.PortletPropertyDescriptionResponse;
053:        import org.jboss.portal.wsrp.core.PortletStateChangeRequiredFault;
054:        import org.jboss.portal.wsrp.core.PropertyList;
055:        import org.jboss.portal.wsrp.core.RegistrationContext;
056:        import org.jboss.portal.wsrp.core.RegistrationData;
057:        import org.jboss.portal.wsrp.core.RegistrationState;
058:        import org.jboss.portal.wsrp.core.ReleaseSessions;
059:        import org.jboss.portal.wsrp.core.ReturnAny;
060:        import org.jboss.portal.wsrp.core.ServiceDescription;
061:        import org.jboss.portal.wsrp.core.SetPortletProperties;
062:        import org.jboss.portal.wsrp.core.UnsupportedLocaleFault;
063:        import org.jboss.portal.wsrp.core.UnsupportedMimeTypeFault;
064:        import org.jboss.portal.wsrp.core.UnsupportedModeFault;
065:        import org.jboss.portal.wsrp.core.UnsupportedWindowStateFault;
066:        import org.jboss.portal.wsrp.producer.config.ProducerConfiguration;
067:        import org.jboss.portal.wsrp.producer.config.ProducerRegistrationRequirements;
068:
069:        import java.rmi.RemoteException;
070:
071:        /**
072:         * This is dummy clone of org.jboss.portal.wsrp.producer.WSRPProducerImpl customizable from client side. Just for
073:         * consumer implementation testing purposes.
074:         *
075:         * @author <a href="mailto:Boleslaw.Dawidowicz@jboss.com">Boleslaw Dawidowicz</a>
076:         * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
077:         * @version $Revision: 8784 $
078:         * @since 2.4
079:         */
080:        public class TestWSRPProducerImpl extends AbstractJBossService
081:                implements  TestWSRPProducer {
082:            private int sessionExpirationTime = DEFAULT_SESSION_EXPIRATION_TIME;
083:
084:            private CookieProtocol requiresInitCookie = CookieProtocol.none;
085:
086:            private BehaviorRegistry behaviorRegistry = new BehaviorRegistry();
087:
088:            public static final String USER_COOKIE = "cookie";
089:
090:            public TestWSRPProducerImpl() {
091:                reset();
092:            }
093:
094:            public BehaviorRegistry getBehaviorRegistry() {
095:                return behaviorRegistry;
096:            }
097:
098:            public void reset() {
099:                requiresInitCookie = null;
100:                behaviorRegistry.clear();
101:            }
102:
103:            private MarkupBehavior getMarkupBehaviorFor(String portletHandle)
104:                    throws InvalidHandleFault {
105:                return behaviorRegistry.getMarkupBehaviorFor(portletHandle);
106:            }
107:
108:            private ServiceDescriptionBehavior getServiceDescriptionBehavior() {
109:                return behaviorRegistry.getServiceDescriptionBehavior();
110:            }
111:
112:            public PortletManagementBehavior getPortletManagementBehavior() {
113:                return behaviorRegistry.getPortletManagementBehavior();
114:            }
115:
116:            // ServiceDescription implementation ********************************************************************************
117:
118:            public ServiceDescription getServiceDescription(
119:                    GetServiceDescription gs) throws InvalidRegistrationFault,
120:                    OperationFailedFault, RemoteException {
121:                return getServiceDescriptionBehavior()
122:                        .getServiceDescription(gs);
123:            }
124:
125:            // MarkupService implementation *************************************************************************************
126:
127:            public MarkupResponse getMarkup(GetMarkup getMarkup)
128:                    throws UnsupportedWindowStateFault, InvalidCookieFault,
129:                    InvalidSessionFault, AccessDeniedFault,
130:                    InconsistentParametersFault, InvalidHandleFault,
131:                    UnsupportedLocaleFault, UnsupportedModeFault,
132:                    OperationFailedFault, MissingParametersFault,
133:                    InvalidUserCategoryFault, InvalidRegistrationFault,
134:                    UnsupportedMimeTypeFault, RemoteException {
135:
136:                return getMarkupBehaviorFor(
137:                        getMarkup.getPortletContext().getPortletHandle())
138:                        .getMarkup(getMarkup);
139:            }
140:
141:            public BlockingInteractionResponse performBlockingInteraction(
142:                    PerformBlockingInteraction performBlockingInteraction)
143:                    throws InvalidSessionFault, UnsupportedModeFault,
144:                    UnsupportedMimeTypeFault, OperationFailedFault,
145:                    UnsupportedWindowStateFault, UnsupportedLocaleFault,
146:                    AccessDeniedFault, PortletStateChangeRequiredFault,
147:                    InvalidRegistrationFault, MissingParametersFault,
148:                    InvalidUserCategoryFault, InconsistentParametersFault,
149:                    InvalidHandleFault, InvalidCookieFault, RemoteException {
150:
151:                return getMarkupBehaviorFor(
152:                        performBlockingInteraction.getPortletContext()
153:                                .getPortletHandle())
154:                        .performBlockingInteraction(performBlockingInteraction);
155:            }
156:
157:            public ReturnAny releaseSessions(ReleaseSessions releaseSessions)
158:                    throws InvalidRegistrationFault, OperationFailedFault,
159:                    MissingParametersFault, AccessDeniedFault, RemoteException {
160:                return null;
161:            }
162:
163:            public ReturnAny initCookie(InitCookie initCookie)
164:                    throws AccessDeniedFault, OperationFailedFault,
165:                    InvalidRegistrationFault, RemoteException {
166:                // should only be called if we required cookies to be initialized
167:                if (requiresInitCookie == null) {
168:                    throw new OperationFailedFault();
169:                }
170:
171:                return null;
172:            }
173:
174:            // Registration implementation **************************************************************************************
175:
176:            public RegistrationContext register(RegistrationData register)
177:                    throws MissingParametersFault, OperationFailedFault,
178:                    RemoteException {
179:                return WSRPTypeFactory
180:                        .createRegistrationContext("registration");
181:            }
182:
183:            public ReturnAny deregister(RegistrationContext deregister)
184:                    throws OperationFailedFault, InvalidRegistrationFault,
185:                    RemoteException {
186:                return null;
187:            }
188:
189:            public RegistrationState modifyRegistration(
190:                    ModifyRegistration modifyRegistration)
191:                    throws MissingParametersFault, OperationFailedFault,
192:                    InvalidRegistrationFault, RemoteException {
193:                return null;
194:            }
195:
196:            // PortletManagement implementation *********************************************************************************
197:
198:            public PortletDescriptionResponse getPortletDescription(
199:                    GetPortletDescription getPortletDescription)
200:                    throws AccessDeniedFault, InvalidHandleFault,
201:                    InvalidUserCategoryFault, InconsistentParametersFault,
202:                    MissingParametersFault, InvalidRegistrationFault,
203:                    OperationFailedFault, RemoteException {
204:                return getPortletManagementBehavior().getPortletDescription(
205:                        getPortletDescription);
206:            }
207:
208:            public PortletContext clonePortlet(ClonePortlet clonePortlet)
209:                    throws InvalidUserCategoryFault, AccessDeniedFault,
210:                    OperationFailedFault, InvalidHandleFault,
211:                    InvalidRegistrationFault, InconsistentParametersFault,
212:                    MissingParametersFault, RemoteException {
213:                return getPortletManagementBehavior()
214:                        .clonePortlet(clonePortlet);
215:            }
216:
217:            public DestroyPortletsResponse destroyPortlets(
218:                    DestroyPortlets destroyPortlets)
219:                    throws InconsistentParametersFault, MissingParametersFault,
220:                    InvalidRegistrationFault, OperationFailedFault,
221:                    RemoteException {
222:                return getPortletManagementBehavior().destroyPortlets(
223:                        destroyPortlets);
224:            }
225:
226:            public PortletContext setPortletProperties(
227:                    SetPortletProperties setPortletProperties)
228:                    throws OperationFailedFault, InvalidHandleFault,
229:                    MissingParametersFault, InconsistentParametersFault,
230:                    InvalidUserCategoryFault, AccessDeniedFault,
231:                    InvalidRegistrationFault, RemoteException {
232:                return getPortletManagementBehavior().setPortletProperties(
233:                        setPortletProperties);
234:            }
235:
236:            public PropertyList getPortletProperties(
237:                    GetPortletProperties getPortletProperties)
238:                    throws InvalidHandleFault, MissingParametersFault,
239:                    InvalidRegistrationFault, AccessDeniedFault,
240:                    OperationFailedFault, InconsistentParametersFault,
241:                    InvalidUserCategoryFault, RemoteException {
242:                return getPortletManagementBehavior().getPortletProperties(
243:                        getPortletProperties);
244:            }
245:
246:            public PortletPropertyDescriptionResponse getPortletPropertyDescription(
247:                    GetPortletPropertyDescription getPortletPropertyDescription)
248:                    throws MissingParametersFault, InconsistentParametersFault,
249:                    InvalidUserCategoryFault, InvalidRegistrationFault,
250:                    AccessDeniedFault, InvalidHandleFault,
251:                    OperationFailedFault, RemoteException {
252:                return getPortletManagementBehavior()
253:                        .getPortletPropertyDescription(
254:                                getPortletPropertyDescription);
255:            }
256:
257:            // Producer implementation ******************************************************************************************
258:
259:            public CookieProtocol getRequiresInitCookie() {
260:                return requiresInitCookie;
261:            }
262:
263:            public void setRequiresInitCookie(CookieProtocol requiresInitCookie) {
264:                this .requiresInitCookie = requiresInitCookie;
265:                getServiceDescriptionBehavior().setRequiresInitCookie(
266:                        requiresInitCookie);
267:            }
268:
269:            public int getSessionExpirationTime() {
270:                return sessionExpirationTime;
271:            }
272:
273:            public void setSessionExpirationTime(int sessionExpirationTime) {
274:                this .sessionExpirationTime = sessionExpirationTime;
275:            }
276:
277:            public ProducerRegistrationRequirements getProducerRegistrationRequirements() {
278:                throw new UnsupportedOperationException(
279:                        "getProducerRegistrationRequirements not implemented");
280:            }
281:
282:            public RegistrationManager getRegistrationManager() {
283:                throw new UnsupportedOperationException(
284:                        "getRegistrationManager not implemented");
285:            }
286:
287:            public ProducerConfiguration getProducerConfiguration() {
288:                throw new UnsupportedOperationException(
289:                        "getProducerConfiguration not implemented");
290:            }
291:
292:            public void setProducerConfiguration(
293:                    ProducerConfiguration producerConfiguration) {
294:                throw new UnsupportedOperationException(
295:                        "setProducerConfiguration not implemented");
296:            }
297:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.