Author: chris.laprun(a)jboss.com
Date: 2009-05-06 13:28:29 -0400 (Wed, 06 May 2009)
New Revision: 13313
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/endpoints/WSRPBaseEndpoint.java
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/services/ServiceWrapper.java
Log:
- Added timeout on WS operations so that we don't deadlock anymore when trying to
access a service that's not answering.
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/endpoints/WSRPBaseEndpoint.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/endpoints/WSRPBaseEndpoint.java 2009-05-06
17:25:19 UTC (rev 13312)
+++
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/endpoints/WSRPBaseEndpoint.java 2009-05-06
17:28:29 UTC (rev 13313)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, 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. *
@@ -52,7 +52,7 @@
public WSRPBaseEndpoint()
{
- producer = (WSRPProducer)JMX.getMBeanProxy(WSRPProducer.class,
WSRPConstants.WSRP_PRODUCER_OBJECT_NAME);
+ producer = JMX.getMBeanProxy(WSRPProducer.class,
WSRPConstants.WSRP_PRODUCER_OBJECT_NAME);
}
protected void forceSessionAccess()
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/services/ServiceWrapper.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/services/ServiceWrapper.java 2009-05-06
17:25:19 UTC (rev 13312)
+++
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/services/ServiceWrapper.java 2009-05-06
17:28:29 UTC (rev 13313)
@@ -28,6 +28,7 @@
import org.jboss.portal.wsrp.core.WSRP_v1_Registration_PortType;
import org.jboss.portal.wsrp.core.WSRP_v1_ServiceDescription_PortType;
+import javax.xml.rpc.Stub;
import javax.xml.rpc.soap.SOAPFaultException;
import java.lang.reflect.ParameterizedType;
import java.rmi.Remote;
@@ -44,6 +45,7 @@
{
protected T service;
protected ManageableServiceFactory parentFactory;
+ private static final String TIMEOUT_MS = "3000"; //todo: expose timeout so
that it can be changed from the GUI
protected ServiceWrapper(Object service, ManageableServiceFactory parentFactory)
{
@@ -53,6 +55,9 @@
}
Class serviceClass = service.getClass();
+
+ // org.jboss.ws.timeout corresponds to StubExt.PROPERTY_CLIENT_TIMEOUT, not using
it here to not be tied to implementation
+ ((Stub)service)._setProperty("org.jboss.ws.timeout", TIMEOUT_MS);
Class tClass =
(Class)((ParameterizedType)getClass().getGenericSuperclass()).getActualTypeArguments()[0];
if (tClass.isAssignableFrom(serviceClass))
{
Show replies by date