Author: chris.laprun(a)jboss.com
Date: 2007-02-21 13:28:18 -0500 (Wed, 21 Feb 2007)
New Revision: 6366
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/CachingServiceFactory.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RMIInvokerServiceFactory.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/SOAPInvokerServiceFactory.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/ServiceFactory.java
trunk/wsrp/src/resources/tests/test-wsrp-consumer-sar/META-INF/jboss-service.xml
trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml
Log:
- EndpointConfigurationInfo should now properly return the correct URLs and update the
associated ServiceFactory when needed.
- Added setters on ServiceFactory and updated ServiceFactory implementations accordingly.
- Thinking of phasing out SOAPInvokerServiceFactory and RMIInvokerServiceFactory (already,
replaced it in the test configuration).
- Tests all pass now.
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java 2007-02-21
18:23:06 UTC (rev 6365)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java 2007-02-21
18:28:18 UTC (rev 6366)
@@ -52,8 +52,6 @@
// transient variables
/** Access to the WS */
private ServiceFactory serviceFactory;
- /** Whether the service factory needs refreshing */
- private boolean dirty;
static final String SERVICE_DESCRIPTION = "service description";
static final String MARKUP = "markup";
@@ -90,99 +88,122 @@
public boolean usesWSDL()
{
- return wsdlDefinitionURL != null;
+ return serviceFactory instanceof RemoteSOAPInvokerServiceFactory ||
+ (wsdlDefinitionURL != null && serviceDescriptionURL == null &&
markupURL == null && portletManagementURL == null
+ && registrationURL == null);
}
public String getWsdlDefinitionURL()
{
+ if (serviceFactory instanceof RemoteSOAPInvokerServiceFactory)
+ {
+ wsdlDefinitionURL =
((RemoteSOAPInvokerServiceFactory)serviceFactory).getWsdlDefinitionURL();
+ }
+
return wsdlDefinitionURL;
}
public String getServiceDescriptionURL()
{
+ if (serviceFactory != null)
+ {
+ serviceDescriptionURL = serviceFactory.getServiceDescriptionURL();
+ }
return serviceDescriptionURL;
}
public String getMarkupURL()
{
+ if (serviceFactory != null)
+ {
+ markupURL = serviceFactory.getMarkupURL();
+ }
return markupURL;
}
public String getPortletManagementURL()
{
+ if (serviceFactory != null)
+ {
+ portletManagementURL = serviceFactory.getPortletManagementURL();
+ }
return portletManagementURL;
}
public String getRegistrationURL()
{
+ if (serviceFactory != null)
+ {
+ registrationURL = serviceFactory.getRegistrationURL();
+ }
return registrationURL;
}
public void setServiceDescriptionURL(String serviceDescriptionURL)
{
+ serviceFactory.setServiceDescriptionURL(serviceDescriptionURL);
this.serviceDescriptionURL = serviceDescriptionURL;
- dirty = true;
}
public void setMarkupURL(String markupURL)
{
+ serviceFactory.setMarkupURL(markupURL);
this.markupURL = markupURL;
- dirty = true;
}
public void setRegistrationURL(String registrationURL)
{
+ serviceFactory.setRegistrationURL(registrationURL);
this.registrationURL = registrationURL;
- dirty = true;
}
public void setPortletManagementURL(String portletManagementURL)
{
+ serviceFactory.setPortletManagementURL(portletManagementURL);
this.portletManagementURL = portletManagementURL;
- dirty = true;
}
public void setWsdlDefinitionURL(String wsdlDefinitionURL)
{
this.wsdlDefinitionURL = wsdlDefinitionURL;
- dirty = true;
+ if (!(serviceFactory instanceof RemoteSOAPInvokerServiceFactory))
+ {
+ serviceFactory = new RemoteSOAPInvokerServiceFactory();
+ }
+
((RemoteSOAPInvokerServiceFactory)serviceFactory).setWsdlDefinitionURL(wsdlDefinitionURL);
}
- public void refreshServiceFactory()
+ public void initServiceFactoryIfNeeded()
{
- if (dirty)
+ if (serviceFactory == null)
{
- // todo: implement update of service factory when URLs are changed...
- if (serviceFactory == null)
+ if (usesWSDL())
{
- if (usesWSDL())
- {
- serviceFactory = new RemoteSOAPInvokerServiceFactory();
-
((RemoteSOAPInvokerServiceFactory)serviceFactory).setWsdlDefinitionURL(wsdlDefinitionURL);
- }
- else
- {
- serviceFactory = new PerEndpointSOAPInvokerServiceFactory();
-
((PerEndpointSOAPInvokerServiceFactory)serviceFactory).setServiceDescriptionURL(serviceDescriptionURL);
-
((PerEndpointSOAPInvokerServiceFactory)serviceFactory).setMarkupURL(markupURL);
-
((PerEndpointSOAPInvokerServiceFactory)serviceFactory).setPortletManagementURL(portletManagementURL);
-
((PerEndpointSOAPInvokerServiceFactory)serviceFactory).setRegistrationURL(registrationURL);
- }
+ serviceFactory = new RemoteSOAPInvokerServiceFactory();
+
((RemoteSOAPInvokerServiceFactory)serviceFactory).setWsdlDefinitionURL(wsdlDefinitionURL);
}
+ else
+ {
+ serviceFactory = new PerEndpointSOAPInvokerServiceFactory();
+ serviceFactory.setServiceDescriptionURL(serviceDescriptionURL);
+ serviceFactory.setMarkupURL(markupURL);
+ serviceFactory.setPortletManagementURL(portletManagementURL);
+ serviceFactory.setRegistrationURL(registrationURL);
+ }
+ }
- dirty = false;
- }
}
ServiceFactory getServiceFactory()
{
- refreshServiceFactory();
+ initServiceFactoryIfNeeded();
return serviceFactory;
}
void setServiceFactory(ServiceFactory serviceFactory)
{
ParameterValidation.throwIllegalArgExceptionIfNull(serviceFactory,
"ServiceFactory");
+
this.serviceFactory = serviceFactory;
serviceDescriptionURL = serviceFactory.getServiceDescriptionURL();
markupURL = serviceFactory.getMarkupURL();
@@ -194,7 +215,6 @@
wsdlDefinitionURL =
((RemoteSOAPInvokerServiceFactory)serviceFactory).getWsdlDefinitionURL();
}
- dirty = false;
}
WSRP_v1_ServiceDescription_PortType getServiceDescriptionService() throws
InvokerUnavailableException
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2007-02-21
18:23:06 UTC (rev 6365)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2007-02-21
18:28:18 UTC (rev 6366)
@@ -386,8 +386,15 @@
public RegistrationContext getRegistrationContext()
{
- RegistrationContext registrationContext =
WSRPTypeFactory.createRegistrationContext(registrationHandle);
- registrationContext.setRegistrationState(registrationState);
- return registrationContext;
+ if (registrationHandle != null)
+ {
+ RegistrationContext registrationContext =
WSRPTypeFactory.createRegistrationContext(registrationHandle);
+ registrationContext.setRegistrationState(registrationState);
+ return registrationContext;
+ }
+ else
+ {
+ return null;
+ }
}
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/services/CachingServiceFactory.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/CachingServiceFactory.java 2007-02-21
18:23:06 UTC (rev 6365)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/CachingServiceFactory.java 2007-02-21
18:28:18 UTC (rev 6366)
@@ -47,7 +47,7 @@
{
if (delegate == null)
{
- throw new IllegalStateException("No static service factory");
+ throw new IllegalStateException("No delegate service factory");
}
if (clazz == null)
{
@@ -118,4 +118,41 @@
}
return null;
}
+
+
+ public void setServiceDescriptionURL(String serviceDescriptionURL)
+ {
+ if (delegate == null)
+ {
+ throw new IllegalStateException("No delegate service factory");
+ }
+ delegate.setServiceDescriptionURL(serviceDescriptionURL);
+ }
+
+ public void setMarkupURL(String markupURL)
+ {
+ if (delegate == null)
+ {
+ throw new IllegalStateException("No delegate service factory");
+ }
+ delegate.setMarkupURL(markupURL);
+ }
+
+ public void setRegistrationURL(String registrationURL)
+ {
+ if (delegate == null)
+ {
+ throw new IllegalStateException("No delegate service factory");
+ }
+ delegate.setRegistrationURL(registrationURL);
+ }
+
+ public void setPortletManagementURL(String portletManagementURL)
+ {
+ if (delegate == null)
+ {
+ throw new IllegalStateException("No delegate service factory");
+ }
+ delegate.setPortletManagementURL(portletManagementURL);
+ }
}
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RMIInvokerServiceFactory.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RMIInvokerServiceFactory.java 2007-02-21
18:23:06 UTC (rev 6365)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RMIInvokerServiceFactory.java 2007-02-21
18:28:18 UTC (rev 6366)
@@ -72,4 +72,20 @@
{
return null;
}
+
+ public void setServiceDescriptionURL(String serviceDescriptionURL)
+ {
+ }
+
+ public void setMarkupURL(String markupURL)
+ {
+ }
+
+ public void setRegistrationURL(String registrationURL)
+ {
+ }
+
+ public void setPortletManagementURL(String portletManagementURL)
+ {
+ }
}
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/SOAPInvokerServiceFactory.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/SOAPInvokerServiceFactory.java 2007-02-21
18:23:06 UTC (rev 6365)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/SOAPInvokerServiceFactory.java 2007-02-21
18:28:18 UTC (rev 6366)
@@ -109,4 +109,24 @@
{
return endpointURL + PORT_NAMES.get(WSRP_v1_PortletManagement_PortType.class);
}
+
+ public void setServiceDescriptionURL(String serviceDescriptionURL)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setMarkupURL(String markupURL)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setRegistrationURL(String registrationURL)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setPortletManagementURL(String portletManagementURL)
+ {
+ throw new UnsupportedOperationException();
+ }
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/services/ServiceFactory.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/services/ServiceFactory.java 2007-02-21
18:23:06 UTC (rev 6365)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/services/ServiceFactory.java 2007-02-21
18:28:18 UTC (rev 6366)
@@ -43,4 +43,12 @@
String getRegistrationURL();
String getPortletManagementURL();
+
+ void setServiceDescriptionURL(String serviceDescriptionURL);
+
+ void setMarkupURL(String markupURL);
+
+ void setRegistrationURL(String registrationURL);
+
+ void setPortletManagementURL(String portletManagementURL);
}
Modified:
trunk/wsrp/src/resources/tests/test-wsrp-consumer-sar/META-INF/jboss-service.xml
===================================================================
---
trunk/wsrp/src/resources/tests/test-wsrp-consumer-sar/META-INF/jboss-service.xml 2007-02-21
18:23:06 UTC (rev 6365)
+++
trunk/wsrp/src/resources/tests/test-wsrp-consumer-sar/META-INF/jboss-service.xml 2007-02-21
18:28:18 UTC (rev 6366)
@@ -64,12 +64,17 @@
<!-- -->
<mbean
- code="org.jboss.portal.wsrp.services.SOAPInvokerServiceFactory"
+
code="org.jboss.portal.wsrp.services.PerEndpointSOAPInvokerServiceFactory"
name="portal.wsrp:service=ServiceFactory"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <attribute
name="EndpointURL">http://localhost:8080/test-wsrp-consumer</attribute>
+ <attribute
+
name="ServiceDescriptionURL">http://localhost:8080/test-wsrp-consumer/ServiceDescriptionService</attribute>
+ <attribute
name="MarkupURL">http://localhost:8080/test-wsrp-consumer/MarkupService</attribute>
+ <attribute
name="RegistrationURL">http://localhost:8080/test-wsrp-consumer/RegistrationService</attribute>
+ <attribute
+
name="PortletManagementURL">http://localhost:8080/test-wsrp-consumer/PortletManagementService</attribute>
<attribute name="Env">
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=jnp://localhost:1099
@@ -97,7 +102,8 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="ServiceFactory"
proxy-type="attribute">portal.wsrp:service=CachingServiceFactory</depends>
+ <depends optional-attribute-name="ServiceFactory"
+
proxy-type="attribute">portal.wsrp:service=CachingServiceFactory</depends>
</mbean>
</server>
Modified:
trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml
===================================================================
---
trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml 2007-02-21
18:23:06 UTC (rev 6365)
+++
trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml 2007-02-21
18:28:18 UTC (rev 6366)
@@ -215,12 +215,17 @@
<!-- -->
<mbean
- code="org.jboss.portal.wsrp.services.SOAPInvokerServiceFactory"
+
code="org.jboss.portal.wsrp.services.PerEndpointSOAPInvokerServiceFactory"
name="portal.wsrp:service=ServiceFactory"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <attribute
name="EndpointURL">http://localhost:8080/test-wsrp-producer</attribute>
+ <attribute
+
name="ServiceDescriptionURL">http://localhost:8080/test-wsrp-producer/ServiceDescriptionService</attribute>
+ <attribute
name="MarkupURL">http://localhost:8080/test-wsrp-producer/MarkupService</attribute>
+ <attribute
name="RegistrationURL">http://localhost:8080/test-wsrp-producer/RegistrationService</attribute>
+ <attribute
+
name="PortletManagementURL">http://localhost:8080/test-wsrp-producer/PortletManagementService</attribute>
<attribute name="Env">
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=jnp://localhost:1099
Show replies by date