Author: chris.laprun(a)jboss.com
Date: 2007-03-18 19:25:36 -0400 (Sun, 18 Mar 2007)
New Revision: 6732
Added:
trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPExceptionFactory.java
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/BehaviorRegistry.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/BasicPortletManagementBehavior.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/DestroyClonesPortletManagementBehavior.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPUtils.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/ActionRequestProcessor.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/MarkupHandler.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/PortletManagementHandler.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RegistrationHandler.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RequestProcessor.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/ServiceDescriptionHandler.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java
Log:
JBPORTAL-1167:
- Extracted exception related methods from WSRPUtils to new WSRPExceptionFactory.
- Started implementing better Exception creation.
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/BehaviorRegistry.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/BehaviorRegistry.java 2007-03-18
23:12:54 UTC (rev 6731)
+++
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/BehaviorRegistry.java 2007-03-18
23:25:36 UTC (rev 6732)
@@ -23,7 +23,7 @@
package org.jboss.portal.test.wsrp.framework;
-import org.jboss.portal.wsrp.WSRPUtils;
+import org.jboss.portal.wsrp.WSRPExceptionFactory;
import org.jboss.portal.wsrp.core.InvalidHandleFault;
import java.util.HashMap;
@@ -65,7 +65,7 @@
{
return (MarkupBehavior)behaviors.get(handle);
}
- throw (InvalidHandleFault)WSRPUtils.createFaultFrom(InvalidHandleFault.class,
+ throw
(InvalidHandleFault)WSRPExceptionFactory.createFaultFrom(InvalidHandleFault.class,
new IllegalArgumentException("There is no registered MarkupBehavior for
handle '" + handle + "'"));
}
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/BasicPortletManagementBehavior.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/BasicPortletManagementBehavior.java 2007-03-18
23:12:54 UTC (rev 6731)
+++
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/BasicPortletManagementBehavior.java 2007-03-18
23:25:36 UTC (rev 6732)
@@ -26,8 +26,8 @@
import org.jboss.portal.test.wsrp.framework.BehaviorRegistry;
import org.jboss.portal.test.wsrp.framework.MarkupBehavior;
import org.jboss.portal.test.wsrp.framework.PortletManagementBehavior;
+import org.jboss.portal.wsrp.WSRPExceptionFactory;
import org.jboss.portal.wsrp.WSRPTypeFactory;
-import org.jboss.portal.wsrp.WSRPUtils;
import org.jboss.portal.wsrp.core.AccessDeniedFault;
import org.jboss.portal.wsrp.core.ClonePortlet;
import org.jboss.portal.wsrp.core.DestroyFailed;
@@ -76,12 +76,12 @@
OperationFailedFault, InvalidHandleFault, InvalidRegistrationFault,
InconsistentParametersFault,
MissingParametersFault, RemoteException
{
- WSRPUtils.throwOperationFailedFaultIfValueIsMissing(clonePortlet,
"ClonePortlet");
+ WSRPExceptionFactory.throwOperationFailedFaultIfValueIsMissing(clonePortlet,
"ClonePortlet");
String handle = getHandleFrom(clonePortlet.getPortletContext(),
"ClonePortlet");
if (!BasicMarkupBehavior.PORTLET_HANDLE.equals(handle))
{
- throw (InvalidHandleFault)WSRPUtils.createFaultFrom(InvalidHandleFault.class,
null);
+ throw
(InvalidHandleFault)WSRPExceptionFactory.createFaultFrom(InvalidHandleFault.class, null);
}
return WSRPTypeFactory.createPortletContext(CLONED_HANDLE);
@@ -92,7 +92,7 @@
throws AccessDeniedFault, InvalidHandleFault, InvalidUserCategoryFault,
InconsistentParametersFault,
MissingParametersFault, InvalidRegistrationFault, OperationFailedFault,
RemoteException
{
- WSRPUtils.throwOperationFailedFaultIfValueIsMissing(getPortletDescription,
"GetPortletDescription");
+
WSRPExceptionFactory.throwOperationFailedFaultIfValueIsMissing(getPortletDescription,
"GetPortletDescription");
String handle = getHandleFrom(getPortletDescription.getPortletContext(),
"GetPortletDescription");
// need to fake that the clone exists... so remove suffix to get the description of
the POP
@@ -117,7 +117,7 @@
public PropertyList getPortletProperties(GetPortletProperties getPortletProperties)
throws InvalidHandleFault, MissingParametersFault, InvalidRegistrationFault,
AccessDeniedFault, OperationFailedFault, InconsistentParametersFault,
InvalidUserCategoryFault, RemoteException
{
- WSRPUtils.throwOperationFailedFaultIfValueIsMissing(getPortletProperties,
"GetPortletProperties");
+
WSRPExceptionFactory.throwOperationFailedFaultIfValueIsMissing(getPortletProperties,
"GetPortletProperties");
String handle = getHandleFrom(getPortletProperties.getPortletContext(),
"GetPortletProperties");
PropertyList result = WSRPTypeFactory.createPropertyList();
if (BasicMarkupBehavior.PORTLET_HANDLE.equals(handle))
@@ -137,7 +137,7 @@
}
else
{
- throw (InvalidHandleFault)WSRPUtils.createFaultFrom(InvalidHandleFault.class,
+ throw
(InvalidHandleFault)WSRPExceptionFactory.createFaultFrom(InvalidHandleFault.class,
new IllegalArgumentException("Unknown handle '" + handle +
"'"));
}
@@ -150,12 +150,12 @@
InvalidHandleFault, MissingParametersFault, InconsistentParametersFault,
InvalidUserCategoryFault,
AccessDeniedFault, InvalidRegistrationFault, RemoteException
{
- WSRPUtils.throwOperationFailedFaultIfValueIsMissing(setPortletProperties,
"SetPortletProperties");
+
WSRPExceptionFactory.throwOperationFailedFaultIfValueIsMissing(setPortletProperties,
"SetPortletProperties");
String handle = getHandleFrom(setPortletProperties.getPortletContext(),
"SetPortletProperties");
if (!(CLONED_HANDLE).equals(handle))
{
- throw WSRPUtils.createOperationFailedFault(new
IllegalArgumentException("Cannot modify portlet '" + handle +
"'"));
+ throw WSRPExceptionFactory.createOperationFailedFault(new
IllegalArgumentException("Cannot modify portlet '" + handle +
"'"));
}
return setPortletProperties.getPortletContext();
@@ -163,12 +163,12 @@
private String getHandleFrom(PortletContext portletContext, String context) throws
MissingParametersFault, InvalidHandleFault
{
- WSRPUtils.throwMissingParametersFaultIfValueIsMissing(portletContext, "portlet
context", context);
+ WSRPExceptionFactory.throwMissingParametersFaultIfValueIsMissing(portletContext,
"portlet context", context);
String handle = portletContext.getPortletHandle();
- WSRPUtils.throwMissingParametersFaultIfValueIsMissing(handle, "portlet
handle", "PortletContext");
+ WSRPExceptionFactory.throwMissingParametersFaultIfValueIsMissing(handle,
"portlet handle", "PortletContext");
if (handle.length() == 0)
{
- throw (InvalidHandleFault)WSRPUtils.createFaultFrom(InvalidHandleFault.class,
null);
+ throw
(InvalidHandleFault)WSRPExceptionFactory.createFaultFrom(InvalidHandleFault.class, null);
}
return handle;
@@ -177,12 +177,12 @@
public DestroyPortletsResponse destroyPortlets(DestroyPortlets destroyPortlets) throws
InconsistentParametersFault, MissingParametersFault, InvalidRegistrationFault,
OperationFailedFault, RemoteException
{
- WSRPUtils.throwOperationFailedFaultIfValueIsMissing(destroyPortlets,
"DestroyPortlets");
+ WSRPExceptionFactory.throwOperationFailedFaultIfValueIsMissing(destroyPortlets,
"DestroyPortlets");
String[] handles = destroyPortlets.getPortletHandles();
- WSRPUtils.throwMissingParametersFaultIfValueIsMissing(handles, "portlet
handles", "DestroyPortlets");
+ WSRPExceptionFactory.throwMissingParametersFaultIfValueIsMissing(handles,
"portlet handles", "DestroyPortlets");
if (handles.length == 0)
{
- WSRPUtils.throwMissingParametersFaultIfValueIsMissing(handles, "portlet
handles", "DestroyPortlets");
+ WSRPExceptionFactory.throwMissingParametersFaultIfValueIsMissing(handles,
"portlet handles", "DestroyPortlets");
}
List failures = new ArrayList();
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/DestroyClonesPortletManagementBehavior.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/DestroyClonesPortletManagementBehavior.java 2007-03-18
23:12:54 UTC (rev 6731)
+++
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/DestroyClonesPortletManagementBehavior.java 2007-03-18
23:25:36 UTC (rev 6732)
@@ -24,7 +24,7 @@
package org.jboss.portal.test.wsrp.v1.consumer.behaviors;
import org.jboss.portal.test.wsrp.framework.BehaviorRegistry;
-import org.jboss.portal.wsrp.WSRPUtils;
+import org.jboss.portal.wsrp.WSRPExceptionFactory;
import org.jboss.portal.wsrp.core.AccessDeniedFault;
import org.jboss.portal.wsrp.core.GetPortletDescription;
import org.jboss.portal.wsrp.core.InconsistentParametersFault;
@@ -66,7 +66,7 @@
}
else
{
- throw (InvalidHandleFault)WSRPUtils.createFaultFrom(InvalidHandleFault.class,
+ throw
(InvalidHandleFault)WSRPExceptionFactory.createFaultFrom(InvalidHandleFault.class,
new IllegalArgumentException("Invalid portlet handle: "
+ getPortletDescription.getPortletContext().getPortletHandle()));
}
Added: trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPExceptionFactory.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPExceptionFactory.java
(rev 0)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPExceptionFactory.java 2007-03-18
23:25:36 UTC (rev 6732)
@@ -0,0 +1,140 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2007, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+
+package org.jboss.portal.wsrp;
+
+import org.jboss.portal.wsrp.core.Fault;
+import org.jboss.portal.wsrp.core.MissingParametersFault;
+import org.jboss.portal.wsrp.core.OperationFailedFault;
+import org.jboss.portal.wsrp.servlet.ServletAccess;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.soap.SOAPFaultException;
+import javax.xml.soap.Detail;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFactory;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ * @since 2.6
+ */
+public class WSRPExceptionFactory
+{
+
+ private static final String NS = "urn:oasis:names:tc:wsrp:c1:types";
+
+ public static final String ACCESS_DENIED = "AccessDenied";
+ public static final String INCONSISTENT_PARAMETERS =
"InconsistentParameters";
+ public static final String INVALID_REGISTRATION = "InvalidRegistration";
+ public static final String INVALID_COOKIE = "InvalidCookie";
+ public static final String INVALID_HANDLE = "InvalidHandle";
+ public static final String INVALID_SESSION = "InvalidSession";
+ public static final String INVALID_USER_CATEGORY = "InvalidUserCategory";
+ public static final String MISSING_PARAMETERS = "MissingParameters";
+ public static final String OPERATION_FAILED = "OperationFailed";
+ public static final String PORTLET_STATE_CHANGE_REQUIRED =
"PortletStateChangeRequired";
+ public static final String UNSUPPORTED_LOCALE = "UnsupportedLocale";
+ public static final String UNSUPPORTED_MIME_TYPE = "UnsupportedMimeType";
+ public static final String UNSUPPORTED_MODE = "UnsupportedMode";
+ public static final String UNSUPPORTED_WINDOW_STATE =
"UnsupportedWindowState";
+
+
+ /**
+ * Create a new OperationFailedFault based on the specified cause.
+ *
+ * @param cause the cause why the operation failed
+ * @return a new OperationFailedFault based on the specified cause.
+ */
+ public static OperationFailedFault createOperationFailedFault(Throwable cause)
+ {
+ return (OperationFailedFault)createFaultFrom(OperationFailedFault.class, cause);
+ }
+
+ public static Fault createFaultFrom(Class faultClass, Throwable cause)
+ {
+ Fault fault = null;
+ try
+ {
+ fault = (Fault)faultClass.newInstance();
+ fault.initCause(cause);
+ }
+ catch (Exception e)
+ {
+ // shouldn't happen
+ e.printStackTrace();
+ }
+ return fault;
+ }
+
+ public static void throwMissingParametersFaultIfValueIsMissing(Object valueToCheck,
String valueName, String context)
+ throws MissingParametersFault
+ {
+ if (valueToCheck == null)
+ {
+ throw (MissingParametersFault)
+ createFaultFrom(MissingParametersFault.class, new
NullPointerException("Missing required " + valueName
+ + (context != null ? " in " + context : "")));
+ }
+ }
+
+ public static void throwOperationFailedFaultIfValueIsMissing(Object valueToCheck,
String valueName)
+ throws OperationFailedFault
+ {
+ if (valueToCheck == null)
+ {
+ throw (OperationFailedFault)
+ createFaultFrom(OperationFailedFault.class, new
NullPointerException("Missing required " + valueName));
+ }
+ }
+
+
+ public static SOAPFaultException throwSOAPFaultException(String errorCode, String
message, Exception cause)
+ {
+ throw createSOAPFaultException(errorCode, message, cause);
+ }
+
+ private static SOAPFaultException createSOAPFaultException(String errorCode, String
message, Exception cause)
+ {
+ Detail detail = null;
+ if (cause != null)
+ {
+ try
+ {
+ detail = SOAPFactory.newInstance().createDetail();
+
detail.addChildElement("cause").addTextNode(cause.getLocalizedMessage());
+ }
+ catch (SOAPException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ HttpServletRequest req = ServletAccess.getRequest();
+ String actor = req.getScheme() + "://" + req.getServerName() +
":" + req.getServerPort() + "/" + req.getServletPath();
+
+
+ return new SOAPFaultException(new QName(NS, errorCode), message, actor, detail);
+ }
+}
\ No newline at end of file
Property changes on: trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPExceptionFactory.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPUtils.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPUtils.java 2007-03-18 23:12:54 UTC (rev
6731)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPUtils.java 2007-03-18 23:25:36 UTC (rev
6732)
@@ -32,10 +32,7 @@
import org.jboss.portal.portlet.PortletURL;
import org.jboss.portal.portlet.RenderURL;
import org.jboss.portal.portlet.state.AccessMode;
-import org.jboss.portal.wsrp.core.Fault;
-import org.jboss.portal.wsrp.core.MissingParametersFault;
import org.jboss.portal.wsrp.core.ModelDescription;
-import org.jboss.portal.wsrp.core.OperationFailedFault;
import org.jboss.portal.wsrp.core.PropertyDescription;
import org.jboss.portal.wsrp.core.StateChange;
import org.jboss.portal.wsrp.registration.LocalizedString;
@@ -251,54 +248,6 @@
}
/**
- * Create a new OperationFailedFault based on the specified cause.
- *
- * @param cause the cause why the operation failed
- * @return a new OperationFailedFault based on the specified cause.
- */
- public static OperationFailedFault createOperationFailedFault(Throwable cause)
- {
- return (OperationFailedFault)createFaultFrom(OperationFailedFault.class, cause);
- }
-
- public static Fault createFaultFrom(Class faultClass, Throwable cause)
- {
- Fault fault = null;
- try
- {
- fault = (Fault)faultClass.newInstance();
- fault.initCause(cause);
- }
- catch (Exception e)
- {
- // shouldn't happen
- e.printStackTrace();
- }
- return fault;
- }
-
- public static void throwMissingParametersFaultIfValueIsMissing(Object valueToCheck,
String valueName, String context)
- throws MissingParametersFault
- {
- if (valueToCheck == null)
- {
- throw (MissingParametersFault)
- createFaultFrom(MissingParametersFault.class, new
NullPointerException("Missing required " + valueName
- + (context != null ? " in " + context : "")));
- }
- }
-
- public static void throwOperationFailedFaultIfValueIsMissing(Object valueToCheck,
String valueName)
- throws OperationFailedFault
- {
- if (valueToCheck == null)
- {
- throw (OperationFailedFault)
- createFaultFrom(OperationFailedFault.class, new
NullPointerException("Missing required " + valueName));
- }
- }
-
- /**
* @param registrationInfo
* @return
* @since 2.6
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/ActionRequestProcessor.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/ActionRequestProcessor.java 2007-03-18
23:12:54 UTC (rev 6731)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/ActionRequestProcessor.java 2007-03-18
23:25:36 UTC (rev 6732)
@@ -23,6 +23,7 @@
package org.jboss.portal.wsrp.producer;
+import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.portlet.PortletParameters;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.invocation.ActionInvocation;
@@ -34,8 +35,7 @@
import org.jboss.portal.portlet.spi.UserContext;
import org.jboss.portal.portlet.spi.WindowContext;
import org.jboss.portal.portlet.state.AccessMode;
-import org.jboss.portal.common.util.ContentInfo;
-import org.jboss.portal.common.util.MarkupInfo;
+import org.jboss.portal.wsrp.WSRPExceptionFactory;
import org.jboss.portal.wsrp.WSRPTypeFactory;
import org.jboss.portal.wsrp.WSRPUtils;
import org.jboss.portal.wsrp.core.InteractionParams;
@@ -112,7 +112,7 @@
AccessMode getAccessMode() throws MissingParametersFault
{
StateChange stateChange = interactionParams.getPortletStateChange();
- WSRPUtils.throwMissingParametersFaultIfValueIsMissing(stateChange,
"portletStateChange", "InteractionParams");
+ WSRPExceptionFactory.throwMissingParametersFaultIfValueIsMissing(stateChange,
"portletStateChange", "InteractionParams");
return WSRPUtils.getAccessModeFromStateChange(stateChange);
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/MarkupHandler.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/MarkupHandler.java 2007-03-18
23:12:54 UTC (rev 6731)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/MarkupHandler.java 2007-03-18
23:25:36 UTC (rev 6732)
@@ -31,7 +31,7 @@
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.invocation.response.RenderResponse;
import org.jboss.portal.portlet.state.producer.PortletStateChangeRequiredException;
-import org.jboss.portal.wsrp.WSRPUtils;
+import org.jboss.portal.wsrp.WSRPExceptionFactory;
import org.jboss.portal.wsrp.core.AccessDeniedFault;
import org.jboss.portal.wsrp.core.BlockingInteractionResponse;
import org.jboss.portal.wsrp.core.GetMarkup;
@@ -88,7 +88,7 @@
OperationFailedFault, MissingParametersFault, InvalidUserCategoryFault,
InvalidRegistrationFault,
UnsupportedMimeTypeFault, RemoteException
{
- WSRPUtils.throwOperationFailedFaultIfValueIsMissing(getMarkup, GET_MARKUP);
+ WSRPExceptionFactory.throwOperationFailedFaultIfValueIsMissing(getMarkup,
GET_MARKUP);
RequestProcessor requestProcessor = new RenderRequestProcessor(producer,
getMarkup);
@@ -101,7 +101,7 @@
}
catch (PortletInvokerException e)
{
- throw WSRPUtils.createOperationFailedFault(e);
+ throw WSRPExceptionFactory.createOperationFailedFault(e);
}
checkForError(response);
@@ -115,15 +115,15 @@
InvalidRegistrationFault, MissingParametersFault, InvalidUserCategoryFault,
InconsistentParametersFault,
InvalidHandleFault, InvalidCookieFault, RemoteException
{
- WSRPUtils.throwOperationFailedFaultIfValueIsMissing(performBlockingInteraction,
PBI);
+
WSRPExceptionFactory.throwOperationFailedFaultIfValueIsMissing(performBlockingInteraction,
PBI);
final InteractionParams interactionParams =
performBlockingInteraction.getInteractionParams();
- WSRPUtils.throwMissingParametersFaultIfValueIsMissing(interactionParams,
"InteractionParams", PBI);
+ WSRPExceptionFactory.throwMissingParametersFaultIfValueIsMissing(interactionParams,
"InteractionParams", PBI);
// fix-me: upload contexts are not supported, fail fast!
UploadContext[] uploadContexts = interactionParams.getUploadContexts();
if (uploadContexts != null)
{
- throw WSRPUtils.createOperationFailedFault(new
UnsupportedOperationException("UploadContexts are not currently supported."));
+ throw WSRPExceptionFactory.createOperationFailedFault(new
UnsupportedOperationException("UploadContexts are not currently supported."));
}
@@ -138,11 +138,11 @@
}
catch (PortletStateChangeRequiredException e)
{
- throw
(PortletStateChangeRequiredFault)WSRPUtils.createFaultFrom(PortletStateChangeRequiredFault.class,
e);
+ throw
(PortletStateChangeRequiredFault)WSRPExceptionFactory.createFaultFrom(PortletStateChangeRequiredFault.class,
e);
}
catch (PortletInvokerException e)
{
- throw WSRPUtils.createOperationFailedFault(e);
+ throw WSRPExceptionFactory.createOperationFailedFault(e);
}
checkForError(response);
@@ -161,7 +161,7 @@
public ReturnAny initCookie(InitCookie initCookie)
throws AccessDeniedFault, OperationFailedFault, InvalidRegistrationFault,
RemoteException
{
- WSRPUtils.throwOperationFailedFaultIfValueIsMissing(initCookie,
"InitCookie");
+ WSRPExceptionFactory.throwOperationFailedFaultIfValueIsMissing(initCookie,
"InitCookie");
producer.checkRegistration(initCookie.getRegistrationContext());
// Force HTTP session creation... this is required for BEA Weblogic version <
9.2.
@@ -174,7 +174,7 @@
static void throwOperationFaultOnSessionOperation() throws OperationFailedFault
{
- throw WSRPUtils.createOperationFailedFault(new IllegalArgumentException("JBoss
Portal's Producer manages " +
+ throw WSRPExceptionFactory.createOperationFailedFault(new
IllegalArgumentException("JBoss Portal's Producer manages " +
"sessions completely on the server side, passing or trying to release
sessionIDs is therefore an error."));
}
@@ -187,12 +187,12 @@
Throwable throwable = errorResult.getThrowable();
if (throwable instanceof PortletModeException)
{
- throw
(UnsupportedModeFault)WSRPUtils.createFaultFrom(UnsupportedModeFault.class,
+ throw
(UnsupportedModeFault)WSRPExceptionFactory.createFaultFrom(UnsupportedModeFault.class,
new IllegalArgumentException("Unsupported mode: " +
((PortletModeException)throwable).getMode()));
}
if (throwable instanceof WindowStateException)
{
- throw
(UnsupportedWindowStateFault)WSRPUtils.createFaultFrom(UnsupportedWindowStateFault.class,
+ throw
(UnsupportedWindowStateFault)WSRPExceptionFactory.createFaultFrom(UnsupportedWindowStateFault.class,
new IllegalArgumentException("Unsupported window state: " +
((WindowStateException)throwable).getState()));
}
// todo: deal with other exceptions
@@ -203,13 +203,13 @@
}
// we're not sure what happened so throw an OperationFailedFault
- throw WSRPUtils.createOperationFailedFault(throwable);
+ throw WSRPExceptionFactory.createOperationFailedFault(throwable);
}
else
if (!(response instanceof HTTPRedirectionResponse || response instanceof
FragmentResponse || response instanceof RenderResponse))
{
- throw WSRPUtils.createOperationFailedFault(new
IllegalArgumentException("Unsupported result type: "
+ throw WSRPExceptionFactory.createOperationFailedFault(new
IllegalArgumentException("Unsupported result type: "
+ response.getClass().getName()));
}
}
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/PortletManagementHandler.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/PortletManagementHandler.java 2007-03-18
23:12:54 UTC (rev 6731)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/PortletManagementHandler.java 2007-03-18
23:25:36 UTC (rev 6732)
@@ -40,6 +40,7 @@
import org.jboss.portal.portlet.state.PropertyChange;
import org.jboss.portal.portlet.state.PropertyMap;
import org.jboss.portal.wsrp.WSRPConstants;
+import org.jboss.portal.wsrp.WSRPExceptionFactory;
import org.jboss.portal.wsrp.WSRPTypeFactory;
import org.jboss.portal.wsrp.WSRPUtils;
import org.jboss.portal.wsrp.core.AccessDeniedFault;
@@ -98,11 +99,11 @@
throws AccessDeniedFault, InvalidHandleFault, InvalidUserCategoryFault,
InconsistentParametersFault,
MissingParametersFault, InvalidRegistrationFault, OperationFailedFault,
RemoteException
{
- WSRPUtils.throwOperationFailedFaultIfValueIsMissing(getPortletDescription,
GET_PORTLET_DESCRIPTION);
+
WSRPExceptionFactory.throwOperationFailedFaultIfValueIsMissing(getPortletDescription,
GET_PORTLET_DESCRIPTION);
producer.checkRegistration(getPortletDescription.getRegistrationContext());
PortletContext portletContext = getPortletDescription.getPortletContext();
- WSRPUtils.throwMissingParametersFaultIfValueIsMissing(portletContext,
PORTLET_CONTEXT, GET_PORTLET_DESCRIPTION);
+ WSRPExceptionFactory.throwMissingParametersFaultIfValueIsMissing(portletContext,
PORTLET_CONTEXT, GET_PORTLET_DESCRIPTION);
UserContext userContext = getPortletDescription.getUserContext();
checkUserAuthorization(userContext);
@@ -114,10 +115,10 @@
throws MissingParametersFault, InconsistentParametersFault,
InvalidUserCategoryFault, InvalidRegistrationFault,
AccessDeniedFault, InvalidHandleFault, OperationFailedFault, RemoteException
{
- WSRPUtils.throwOperationFailedFaultIfValueIsMissing(getPortletPropertyDescription,
GET_PORTLET_PROPERTY_DESCRIPTION);
+
WSRPExceptionFactory.throwOperationFailedFaultIfValueIsMissing(getPortletPropertyDescription,
GET_PORTLET_PROPERTY_DESCRIPTION);
PortletContext portletContext = getPortletPropertyDescription.getPortletContext();
- WSRPUtils.throwMissingParametersFaultIfValueIsMissing(portletContext,
PORTLET_CONTEXT, GET_PORTLET_PROPERTY_DESCRIPTION);
+ WSRPExceptionFactory.throwMissingParametersFaultIfValueIsMissing(portletContext,
PORTLET_CONTEXT, GET_PORTLET_PROPERTY_DESCRIPTION);
producer.checkRegistration(getPortletPropertyDescription.getRegistrationContext());
@@ -159,10 +160,10 @@
OperationFailedFault, InvalidHandleFault, InvalidRegistrationFault,
InconsistentParametersFault,
MissingParametersFault, RemoteException
{
- WSRPUtils.throwOperationFailedFaultIfValueIsMissing(clonePortlet,
"ClonePortlet");
+ WSRPExceptionFactory.throwOperationFailedFaultIfValueIsMissing(clonePortlet,
"ClonePortlet");
PortletContext portletContext = clonePortlet.getPortletContext();
- WSRPUtils.throwMissingParametersFaultIfValueIsMissing(portletContext,
"PortletContext", "ClonePortlet");
+ WSRPExceptionFactory.throwMissingParametersFaultIfValueIsMissing(portletContext,
"PortletContext", "ClonePortlet");
producer.checkRegistration(clonePortlet.getRegistrationContext());
@@ -177,25 +178,25 @@
}
catch (NoSuchPortletException e)
{
- throw (InvalidHandleFault)WSRPUtils.createFaultFrom(InvalidHandleFault.class,
e);
+ throw
(InvalidHandleFault)WSRPExceptionFactory.createFaultFrom(InvalidHandleFault.class, e);
}
catch (InvalidPortletIdException e)
{
- throw (InvalidHandleFault)WSRPUtils.createFaultFrom(InvalidHandleFault.class,
e);
+ throw
(InvalidHandleFault)WSRPExceptionFactory.createFaultFrom(InvalidHandleFault.class, e);
}
catch (PortletInvokerException e)
{
- throw WSRPUtils.createOperationFailedFault(e);
+ throw WSRPExceptionFactory.createOperationFailedFault(e);
}
}
public DestroyPortletsResponse destroyPortlets(DestroyPortlets destroyPortlets) throws
InconsistentParametersFault,
MissingParametersFault, InvalidRegistrationFault, OperationFailedFault,
RemoteException
{
- WSRPUtils.throwOperationFailedFaultIfValueIsMissing(destroyPortlets,
"DestroyPortlets");
+ WSRPExceptionFactory.throwOperationFailedFaultIfValueIsMissing(destroyPortlets,
"DestroyPortlets");
String[] handles = destroyPortlets.getPortletHandles();
- WSRPUtils.throwMissingParametersFaultIfValueIsMissing(handles, "portlet
handles to be destroyed", "DestroyPortlets");
+ WSRPExceptionFactory.throwMissingParametersFaultIfValueIsMissing(handles,
"portlet handles to be destroyed", "DestroyPortlets");
producer.checkRegistration(destroyPortlets.getRegistrationContext());
@@ -229,7 +230,7 @@
}
catch (PortletInvokerException e)
{
- throw WSRPUtils.createOperationFailedFault(e);
+ throw WSRPExceptionFactory.createOperationFailedFault(e);
}
}
@@ -237,13 +238,13 @@
InvalidHandleFault, MissingParametersFault, InconsistentParametersFault,
InvalidUserCategoryFault,
AccessDeniedFault, InvalidRegistrationFault, RemoteException
{
- WSRPUtils.throwOperationFailedFaultIfValueIsMissing(setPortletProperties,
"SetPortletProperties");
+
WSRPExceptionFactory.throwOperationFailedFaultIfValueIsMissing(setPortletProperties,
"SetPortletProperties");
PortletContext portletContext = setPortletProperties.getPortletContext();
- WSRPUtils.throwMissingParametersFaultIfValueIsMissing(portletContext,
"PortletContext", "SetPortletProperties");
+ WSRPExceptionFactory.throwMissingParametersFaultIfValueIsMissing(portletContext,
"PortletContext", "SetPortletProperties");
PropertyList propertyList = setPortletProperties.getPropertyList();
- WSRPUtils.throwMissingParametersFaultIfValueIsMissing(propertyList,
"PropertyList", "SetPortletProperties");
+ WSRPExceptionFactory.throwMissingParametersFaultIfValueIsMissing(propertyList,
"PropertyList", "SetPortletProperties");
producer.checkRegistration(setPortletProperties.getRegistrationContext());
@@ -298,15 +299,15 @@
}
catch (NoSuchPortletException e)
{
- throw (InvalidHandleFault)WSRPUtils.createFaultFrom(InvalidHandleFault.class,
e);
+ throw
(InvalidHandleFault)WSRPExceptionFactory.createFaultFrom(InvalidHandleFault.class, e);
}
catch (InvalidPortletIdException e)
{
- throw
(InconsistentParametersFault)WSRPUtils.createFaultFrom(InconsistentParametersFault.class,
e);
+ throw
(InconsistentParametersFault)WSRPExceptionFactory.createFaultFrom(InconsistentParametersFault.class,
e);
}
catch (PortletInvokerException e)
{
- throw WSRPUtils.createOperationFailedFault(e);
+ throw WSRPExceptionFactory.createOperationFailedFault(e);
}
}
@@ -317,10 +318,10 @@
MissingParametersFault, InvalidRegistrationFault, AccessDeniedFault,
OperationFailedFault,
InconsistentParametersFault, InvalidUserCategoryFault, RemoteException
{
- WSRPUtils.throwOperationFailedFaultIfValueIsMissing(getPortletProperties,
GET_PORTLET_PROPERTIES);
+
WSRPExceptionFactory.throwOperationFailedFaultIfValueIsMissing(getPortletProperties,
GET_PORTLET_PROPERTIES);
PortletContext portletContext = getPortletProperties.getPortletContext();
- WSRPUtils.throwMissingParametersFaultIfValueIsMissing(portletContext,
PORTLET_CONTEXT, GET_PORTLET_PROPERTIES);
+ WSRPExceptionFactory.throwMissingParametersFaultIfValueIsMissing(portletContext,
PORTLET_CONTEXT, GET_PORTLET_PROPERTIES);
producer.checkRegistration(getPortletProperties.getRegistrationContext());
@@ -378,7 +379,7 @@
}
catch (PortletInvokerException e)
{
- throw (InvalidHandleFault)WSRPUtils.createFaultFrom(InvalidHandleFault.class,
e);
+ throw
(InvalidHandleFault)WSRPExceptionFactory.createFaultFrom(InvalidHandleFault.class, e);
}
}
@@ -430,7 +431,7 @@
}
catch (PortletInvokerException e)
{
- throw (InvalidHandleFault)WSRPUtils.createFaultFrom(InvalidHandleFault.class,
e);
+ throw
(InvalidHandleFault)WSRPExceptionFactory.createFaultFrom(InvalidHandleFault.class, e);
}
return portlet;
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RegistrationHandler.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RegistrationHandler.java 2007-03-18
23:12:54 UTC (rev 6731)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RegistrationHandler.java 2007-03-18
23:25:36 UTC (rev 6732)
@@ -33,6 +33,7 @@
import org.jboss.portal.registration.RegistrationLocal;
import org.jboss.portal.registration.RegistrationStatus;
import org.jboss.portal.registration.RegistrationUtils;
+import org.jboss.portal.wsrp.WSRPExceptionFactory;
import org.jboss.portal.wsrp.WSRPTypeFactory;
import org.jboss.portal.wsrp.WSRPUtils;
import org.jboss.portal.wsrp.core.InvalidRegistrationFault;
@@ -73,12 +74,12 @@
public RegistrationContext register(RegistrationData registrationData) throws
MissingParametersFault, OperationFailedFault,
RemoteException
{
- WSRPUtils.throwOperationFailedFaultIfValueIsMissing(registrationData,
"RegistrationData");
+ WSRPExceptionFactory.throwOperationFailedFaultIfValueIsMissing(registrationData,
"RegistrationData");
String consumerName = registrationData.getConsumerName();
- WSRPUtils.throwMissingParametersFaultIfValueIsMissing(consumerName, "consumer
name", "RegistrationData");
+ WSRPExceptionFactory.throwMissingParametersFaultIfValueIsMissing(consumerName,
"consumer name", "RegistrationData");
String consumerAgent = registrationData.getConsumerAgent();
- WSRPUtils.throwMissingParametersFaultIfValueIsMissing(consumerAgent, "consumer
agent", "RegistrationData");
+ WSRPExceptionFactory.throwMissingParametersFaultIfValueIsMissing(consumerAgent,
"consumer agent", "RegistrationData");
Registration registration;
try
@@ -94,7 +95,7 @@
catch (Exception e)
{
log.debug(e);
- throw WSRPUtils.createOperationFailedFault(e);
+ throw WSRPExceptionFactory.createOperationFailedFault(e);
}
RegistrationContext registrationContext =
WSRPTypeFactory.createRegistrationContext(registration.getId());
@@ -148,7 +149,7 @@
public ReturnAny deregister(RegistrationContext deregister) throws
OperationFailedFault, InvalidRegistrationFault,
RemoteException
{
- WSRPUtils.throwOperationFailedFaultIfValueIsMissing(deregister,
"RegistrationContext");
+ WSRPExceptionFactory.throwOperationFailedFaultIfValueIsMissing(deregister,
"RegistrationContext");
String registrationHandle = deregister.getRegistrationHandle();
if (ParameterValidation.isNullOrEmpty(registrationHandle))
@@ -171,7 +172,7 @@
catch (RegistrationException e)
{
log.debug(e);
- throw WSRPUtils.createOperationFailedFault(e);
+ throw WSRPExceptionFactory.createOperationFailedFault(e);
}
return new ReturnAny();
@@ -180,10 +181,10 @@
public RegistrationState modifyRegistration(ModifyRegistration modifyRegistration)
throws MissingParametersFault,
OperationFailedFault, InvalidRegistrationFault, RemoteException
{
- WSRPUtils.throwOperationFailedFaultIfValueIsMissing(modifyRegistration,
"ModifyRegistration");
+ WSRPExceptionFactory.throwOperationFailedFaultIfValueIsMissing(modifyRegistration,
"ModifyRegistration");
RegistrationContext registrationContext =
modifyRegistration.getRegistrationContext();
- WSRPUtils.throwMissingParametersFaultIfValueIsMissing(registrationContext,
"RegistrationContext", "ModifyRegistration");
+
WSRPExceptionFactory.throwMissingParametersFaultIfValueIsMissing(registrationContext,
"RegistrationContext", "ModifyRegistration");
String registrationHandle = registrationContext.getRegistrationHandle();
if (ParameterValidation.isNullOrEmpty(registrationHandle))
{
@@ -191,13 +192,13 @@
}
RegistrationData registrationData = modifyRegistration.getRegistrationData();
- WSRPUtils.throwMissingParametersFaultIfValueIsMissing(registrationData,
"RegistrationData", "ModifyRegistration");
+ WSRPExceptionFactory.throwMissingParametersFaultIfValueIsMissing(registrationData,
"RegistrationData", "ModifyRegistration");
String consumerName = registrationData.getConsumerName();
- WSRPUtils.throwMissingParametersFaultIfValueIsMissing(consumerName, "consumer
name", "RegistrationData");
+ WSRPExceptionFactory.throwMissingParametersFaultIfValueIsMissing(consumerName,
"consumer name", "RegistrationData");
String consumerAgent = registrationData.getConsumerAgent();
- WSRPUtils.throwMissingParametersFaultIfValueIsMissing(consumerAgent, "consumer
agent", "RegistrationData");
+ WSRPExceptionFactory.throwMissingParametersFaultIfValueIsMissing(consumerAgent,
"consumer agent", "RegistrationData");
log.debug("Attempting to modify registration with handle '" +
registrationHandle + "'");
try
@@ -214,7 +215,7 @@
catch (RegistrationException e)
{
log.debug(e);
- throw WSRPUtils.createOperationFailedFault(e);
+ throw WSRPExceptionFactory.createOperationFailedFault(e);
}
@@ -233,7 +234,7 @@
}
String regHandle = registrationContext.getRegistrationHandle();
- WSRPUtils.throwOperationFailedFaultIfValueIsMissing(regHandle,
"registration handle");
+ WSRPExceptionFactory.throwOperationFailedFaultIfValueIsMissing(regHandle,
"registration handle");
Registration reg;
try
@@ -242,7 +243,7 @@
}
catch (RegistrationException e)
{
- throw WSRPUtils.createOperationFailedFault(e);
+ throw WSRPExceptionFactory.createOperationFailedFault(e);
}
if (reg == null)
@@ -273,7 +274,7 @@
private boolean throwInvalidRegistrationFault(String message) throws
InvalidRegistrationFault
{
- throw
(InvalidRegistrationFault)WSRPUtils.createFaultFrom(InvalidRegistrationFault.class,
+ throw
(InvalidRegistrationFault)WSRPExceptionFactory.createFaultFrom(InvalidRegistrationFault.class,
new Exception("Invalid registration: " + message));
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RequestProcessor.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RequestProcessor.java 2007-03-18
23:12:54 UTC (rev 6731)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RequestProcessor.java 2007-03-18
23:25:36 UTC (rev 6732)
@@ -23,9 +23,9 @@
package org.jboss.portal.wsrp.producer;
+import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.common.util.MediaType;
import org.jboss.portal.common.util.Tools;
-import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.portlet.OpaqueStateString;
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletInvokerException;
@@ -37,8 +37,10 @@
import org.jboss.portal.portlet.spi.UserContext;
import org.jboss.portal.portlet.spi.WindowContext;
import org.jboss.portal.portlet.state.AccessMode;
+import org.jboss.portal.server.PortalConstants;
import org.jboss.portal.wsrp.UserContextConverter;
import org.jboss.portal.wsrp.WSRPConstants;
+import org.jboss.portal.wsrp.WSRPExceptionFactory;
import org.jboss.portal.wsrp.WSRPUtils;
import org.jboss.portal.wsrp.core.InvalidHandleFault;
import org.jboss.portal.wsrp.core.InvalidRegistrationFault;
@@ -53,7 +55,6 @@
import org.jboss.portal.wsrp.core.UnsupportedMimeTypeFault;
import org.jboss.portal.wsrp.core.UnsupportedModeFault;
import org.jboss.portal.wsrp.core.UnsupportedWindowStateFault;
-import org.jboss.portal.server.PortalConstants;
import javax.activation.MimeTypeParseException;
import java.security.Principal;
@@ -93,17 +94,17 @@
// get session information and deal with it
final RuntimeContext runtimeContext = getRuntimeContext();
- WSRPUtils.throwMissingParametersFaultIfValueIsMissing(runtimeContext,
"RuntimeContext", getContextName());
+ WSRPExceptionFactory.throwMissingParametersFaultIfValueIsMissing(runtimeContext,
"RuntimeContext", getContextName());
checkForSessionIDs(runtimeContext);
// get markup parameters
final MarkupParams params = getMarkupParams();
- WSRPUtils.throwMissingParametersFaultIfValueIsMissing(params,
"MarkupParams", getContextName());
+ WSRPExceptionFactory.throwMissingParametersFaultIfValueIsMissing(params,
"MarkupParams", getContextName());
// get portlet handle
PortletContext wsrpPC = getPortletContext();
- WSRPUtils.throwMissingParametersFaultIfValueIsMissing(wsrpPC,
"PortletContext", getContextName());
+ WSRPExceptionFactory.throwMissingParametersFaultIfValueIsMissing(wsrpPC,
"PortletContext", getContextName());
org.jboss.portal.portlet.PortletContext portletContext =
WSRPUtils.convertToPortalPortletContext(wsrpPC);
// retrieve the portlet
@@ -113,7 +114,7 @@
}
catch (PortletInvokerException e)
{
- throw WSRPUtils.createOperationFailedFault(e);
+ throw WSRPExceptionFactory.createOperationFailedFault(e);
}
// get portlet description for the desired portlet...
@@ -121,7 +122,7 @@
portletDescription = producer.getPortletDescription(portlet, desiredLocales);
if (Boolean.TRUE.equals(portletDescription.getUsesMethodGet()))
{
- throw WSRPUtils.createOperationFailedFault(
+ throw WSRPExceptionFactory.createOperationFailedFault(
new UnsupportedOperationException("Portlets using GET method in forms
are not currently supported."));
}
MarkupType[] markupTypes = portletDescription.getMarkupTypes();
@@ -199,7 +200,7 @@
// no MIME type was found: error!
if (markupType == null)
{
- throw
(UnsupportedMimeTypeFault)WSRPUtils.createFaultFrom(UnsupportedMimeTypeFault.class,
+ throw
(UnsupportedMimeTypeFault)WSRPExceptionFactory.createFaultFrom(UnsupportedMimeTypeFault.class,
new IllegalArgumentException("None of the specified MIME types are
supported by this Portlet."));
}
@@ -211,7 +212,7 @@
}
catch (IllegalArgumentException e)
{
- throw
(UnsupportedModeFault)WSRPUtils.createFaultFrom(UnsupportedModeFault.class, e);
+ throw
(UnsupportedModeFault)WSRPExceptionFactory.createFaultFrom(UnsupportedModeFault.class,
e);
}
// get the window state
@@ -222,7 +223,7 @@
}
catch (IllegalArgumentException e)
{
- throw
(UnsupportedWindowStateFault)WSRPUtils.createFaultFrom(UnsupportedWindowStateFault.class,
e);
+ throw
(UnsupportedWindowStateFault)WSRPExceptionFactory.createFaultFrom(UnsupportedWindowStateFault.class,
e);
}
// get the character set
@@ -283,7 +284,7 @@
{
if (wsrpUserContext != null)
{
-
WSRPUtils.throwMissingParametersFaultIfValueIsMissing(wsrpUserContext.getUserContextKey(),
"User Context Key", "UserContext");
+
WSRPExceptionFactory.throwMissingParametersFaultIfValueIsMissing(wsrpUserContext.getUserContextKey(),
"User Context Key", "UserContext");
}
}
@@ -400,7 +401,7 @@
}
catch (MimeTypeParseException e)
{
- throw
(UnsupportedMimeTypeFault)WSRPUtils.createFaultFrom(UnsupportedMimeTypeFault.class, e);
+ throw
(UnsupportedMimeTypeFault)WSRPExceptionFactory.createFaultFrom(UnsupportedMimeTypeFault.class,
e);
}
return markupInfo;
}
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/ServiceDescriptionHandler.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/ServiceDescriptionHandler.java 2007-03-18
23:12:54 UTC (rev 6731)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/ServiceDescriptionHandler.java 2007-03-18
23:25:36 UTC (rev 6732)
@@ -33,6 +33,7 @@
import org.jboss.portal.portlet.info.ModeInfo;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.info.WindowStateInfo;
+import org.jboss.portal.wsrp.WSRPExceptionFactory;
import org.jboss.portal.wsrp.WSRPTypeFactory;
import org.jboss.portal.wsrp.WSRPUtils;
import org.jboss.portal.wsrp.core.CookieProtocol;
@@ -78,7 +79,7 @@
public ServiceDescription getServiceDescription(GetServiceDescription gs)
throws InvalidRegistrationFault, OperationFailedFault, RemoteException
{
- WSRPUtils.throwOperationFailedFaultIfValueIsMissing(gs,
"GetServiceDescription");
+ WSRPExceptionFactory.throwOperationFailedFaultIfValueIsMissing(gs,
"GetServiceDescription");
if (!producer.isRegistrationValid(gs.getRegistrationContext()))
{
@@ -124,7 +125,7 @@
}
catch (PortletInvokerException e)
{
- throw WSRPUtils.createOperationFailedFault(e);
+ throw WSRPExceptionFactory.createOperationFailedFault(e);
}
return getPortletDescription(portlet, desiredLocales);
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java 2007-03-18
23:12:54 UTC (rev 6731)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java 2007-03-18
23:25:36 UTC (rev 6732)
@@ -32,8 +32,8 @@
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.registration.RegistrationManager;
import org.jboss.portal.wsrp.ResponseDebugFactory;
+import org.jboss.portal.wsrp.WSRPExceptionFactory;
import org.jboss.portal.wsrp.WSRPProducer;
-import org.jboss.portal.wsrp.WSRPUtils;
import org.jboss.portal.wsrp.core.AccessDeniedFault;
import org.jboss.portal.wsrp.core.BlockingInteractionResponse;
import org.jboss.portal.wsrp.core.ClonePortlet;
@@ -384,12 +384,12 @@
}
catch (NoSuchPortletException e)
{
- throw (InvalidHandleFault)WSRPUtils.createFaultFrom(InvalidHandleFault.class,
+ throw
(InvalidHandleFault)WSRPExceptionFactory.createFaultFrom(InvalidHandleFault.class,
new IllegalArgumentException("Couldn't find portlet with handle
'" + portletContext.getId() + "'"));
}
if (!isRemotable(portlet))
{
- throw (InvalidHandleFault)WSRPUtils.createFaultFrom(InvalidHandleFault.class,
+ throw
(InvalidHandleFault)WSRPExceptionFactory.createFaultFrom(InvalidHandleFault.class,
new IllegalArgumentException("Portlet '" +
portletContext.getId() + "' is not remotely available."));
}
@@ -442,7 +442,7 @@
{
IllegalArgumentException cause = new
IllegalArgumentException(registrationContext + " is not a valid
registration.");
log.debug(cause);
- throw
(InvalidRegistrationFault)WSRPUtils.createFaultFrom(InvalidRegistrationFault.class,
+ throw
(InvalidRegistrationFault)WSRPExceptionFactory.createFaultFrom(InvalidRegistrationFault.class,
cause);
}
}