Author: chris.laprun(a)jboss.com
Date: 2007-05-04 23:23:14 -0400 (Fri, 04 May 2007)
New Revision: 7194
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/AbstractSOAPServiceFactory.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RemoteSOAPInvokerServiceFactory.java
Log:
- Improved behavior if WSDL is not available at startup.
- Now attempt to start the service factory if it hasn't been started already to
provide for better user experience in particular when refreshing the info.
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java 2007-05-04
16:08:59 UTC (rev 7193)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java 2007-05-05
03:23:14 UTC (rev 7194)
@@ -267,7 +267,8 @@
}
catch (ConsumerException e)
{
- // ignore and continue
+ producerInfo.setActive(false);
+ updateProducerInfo(producerInfo);
}
}
}
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java 2007-05-04
16:08:59 UTC (rev 7193)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java 2007-05-05
03:23:14 UTC (rev 7194)
@@ -191,7 +191,9 @@
this.persistentWsdlDefinitionURL = wsdlDefinitionURL;
// WSDL url is optional so can be null (and in particular, it is when loaded from
Hibernate most of the time)
- if (wsdlDefinitionURL != null)
+ // do not attempt to set the URL if the service factory hasn't been created yet
to avoid issues when
+ // ConsumerRegistry starts (in particular, raising an exception if the WSDL is not
available)
+ if (wsdlDefinitionURL != null && serviceFactory != null)
{
if (!(serviceFactory instanceof RemoteSOAPInvokerServiceFactory))
{
@@ -236,8 +238,24 @@
throw new IllegalStateException("Cannot initialize ServiceFactory:
missing either service description or markup URLs!");
}
}
+
+ startServiceFactoryIfNeeded();
}
+ }
+ private void startServiceFactoryIfNeeded()
+ {
+ if (!serviceFactory.isAvailable())
+ {
+ try
+ {
+ serviceFactory.start();
+ }
+ catch (Exception e)
+ {
+ throw new ConsumerException("Couldn't start ServiceFactory",
e);
+ }
+ }
}
private void internalSetWsdlURL()
@@ -255,7 +273,7 @@
public void start() throws Exception
{
- getServiceFactory().start();
+ initServiceFactoryIfNeeded();
}
public void stop() throws Exception
@@ -267,6 +285,7 @@
public ServiceFactory getServiceFactory()
{
initServiceFactoryIfNeeded();
+ startServiceFactoryIfNeeded();
return serviceFactory;
}
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/AbstractSOAPServiceFactory.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/AbstractSOAPServiceFactory.java 2007-05-04
16:08:59 UTC (rev 7193)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/AbstractSOAPServiceFactory.java 2007-05-05
03:23:14 UTC (rev 7194)
@@ -37,14 +37,11 @@
{
/** Cache the services. */
- private Map services;
+ private Map services = new ConcurrentReaderHashMap();
protected void createService() throws Exception
{
super.createService();
-
- //
- services = new ConcurrentReaderHashMap();
}
protected void destroyService() throws Exception
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RemoteSOAPInvokerServiceFactory.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RemoteSOAPInvokerServiceFactory.java 2007-05-04
16:08:59 UTC (rev 7193)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RemoteSOAPInvokerServiceFactory.java 2007-05-05
03:23:14 UTC (rev 7194)
@@ -72,7 +72,7 @@
return wsdlDefinitionURL;
}
- public void setWsdlDefinitionURL(String wsdlDefinitionURL) throws RuntimeException,
Exception
+ public void setWsdlDefinitionURL(String wsdlDefinitionURL) throws Exception
{
if (wsdlDefinitionURL == null || wsdlDefinitionURL.length() == 0)
{
Show replies by date