Author: chris.laprun(a)jboss.com
Date: 2009-04-02 14:14:35 -0400 (Thu, 02 Apr 2009)
New Revision: 13122
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java
Log:
- JBPORTAL-2367: should solve the infinite loop issue.
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java 2009-04-02
18:11:11 UTC (rev 13121)
+++
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java 2009-04-02
18:14:35 UTC (rev 13122)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2007, 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. *
@@ -252,7 +252,7 @@
return oldValue;
}
- private void initServiceFactoryIfNeeded() throws RuntimeException
+ private ServiceFactory initServiceFactoryIfNeeded() throws RuntimeException
{
if (serviceFactory == null)
{
@@ -279,6 +279,8 @@
startServiceFactoryIfNeeded();
}
+
+ return serviceFactory;
}
private void startServiceFactoryIfNeeded()
@@ -290,7 +292,7 @@
try
{
serviceFactory.start();
- refreshServices();
+ refreshServices(serviceFactory);
}
catch (Exception e)
{
@@ -390,16 +392,21 @@
private <T extends Remote> T getService(Class<T> clazz) throws
InvokerUnavailableException
{
+ return getService(clazz, getServiceFactory());
+ }
+
+ private <T extends Remote> T getService(Class<T> clazz, ServiceFactory
serviceFactory) throws InvokerUnavailableException
+ {
try
{
- T service = getServiceFactory().getService(clazz);
+ T service = serviceFactory.getService(clazz);
clean.set(getIndexFor(clazz));
return service;
}
catch (Exception e)
{
throw new InvokerUnavailableException("Couldn't access " +
clazz.getSimpleName() + " service. Cause: "
- + e.getLocalizedMessage(), e);
+ + e.getLocalizedMessage(), e);
}
}
@@ -445,7 +452,7 @@
private boolean areURLsDirty()
{
return !clean.get(SD) || !clean.get(M) || (persistentPortletManagementURL != null
&& !clean.get(PM))
- || (persistentRegistrationURL != null && !clean.get(R));
+ || (persistentRegistrationURL != null && !clean.get(R));
}
public void refresh() throws InvokerUnavailableException
@@ -458,23 +465,23 @@
void forceRefresh() throws InvokerUnavailableException
{
- initServiceFactoryIfNeeded();
- refreshServices();
+ ServiceFactory serviceFactory = initServiceFactoryIfNeeded();
+ refreshServices(serviceFactory);
}
- private void refreshServices() throws InvokerUnavailableException
+ private void refreshServices(ServiceFactory serviceFactory) throws
InvokerUnavailableException
{
if (areURLsDirty())
{
- getServiceDescriptionService();
- getMarkupService();
+ getService(WSRP_v1_ServiceDescription_PortType.class, serviceFactory);
+ getService(WSRP_v1_Markup_PortType.class, serviceFactory);
if (persistentPortletManagementURL != null)
{
- getPortletManagementService();
+ getService(WSRP_v1_PortletManagement_PortType.class, serviceFactory);
}
if (persistentRegistrationURL != null)
{
- getRegistrationService();
+ getService(WSRP_v1_Registration_PortType.class, serviceFactory);
}
}
}
Show replies by date