You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wsrp4j-dev@portals.apache.org by dl...@apache.org on 2006/12/29 20:56:04 UTC
svn commit: r491081 -
/portals/wsrp4j/trunk/commons-consumer/src/java/org/apache/wsrp4j/commons/consumer/driver/producer/ProducerImpl.java
Author: dlouzan
Date: Fri Dec 29 11:56:03 2006
New Revision: 491081
URL: http://svn.apache.org/viewvc?view=rev&rev=491081
Log:
Modified Producer implementation so now the wsrp interfaces get initialized on the setXXX methods.
Modified:
portals/wsrp4j/trunk/commons-consumer/src/java/org/apache/wsrp4j/commons/consumer/driver/producer/ProducerImpl.java
Modified: portals/wsrp4j/trunk/commons-consumer/src/java/org/apache/wsrp4j/commons/consumer/driver/producer/ProducerImpl.java
URL: http://svn.apache.org/viewvc/portals/wsrp4j/trunk/commons-consumer/src/java/org/apache/wsrp4j/commons/consumer/driver/producer/ProducerImpl.java?view=diff&rev=491081&r1=491080&r2=491081
==============================================================================
--- portals/wsrp4j/trunk/commons-consumer/src/java/org/apache/wsrp4j/commons/consumer/driver/producer/ProducerImpl.java (original)
+++ portals/wsrp4j/trunk/commons-consumer/src/java/org/apache/wsrp4j/commons/consumer/driver/producer/ProducerImpl.java Fri Dec 29 11:56:03 2006
@@ -112,9 +112,7 @@
}
if (serviceDescriptionURL != null) {
-
- this.serviceDescriptionURL = serviceDescriptionURL;
- initServiceDescInterface(serviceDescriptionURL);
+ setServiceDescriptionInterfaceEndpoint(serviceDescriptionURL);
} else {
WSRPXHelper.throwX(log, ErrorCodes.MISSING_SERVICE_DESC_PORT);
@@ -138,14 +136,12 @@
if (registrationURL != null) {
- initRegistrationInterface(registrationURL);
- this.registrationURL = registrationURL;
+ setRegistrationInterfaceEndpoint(registrationURL);
this.consumerRegData = registrationData;
}
if (portletManagementURL != null) {
- this.portletManagementURL = portletManagementURL;
- initPortletManagementInterface(portletManagementURL);
+ setPortletManagementInterfaceEndpoint(portletManagementURL);
}
}
@@ -155,7 +151,7 @@
* @param serviceDescriptionURL The URL of the producers service
* description interface
**/
- public void initServiceDescInterface(String serviceDescriptionURL)
+ private void initServiceDescInterface(String serviceDescriptionURL)
throws WSRPException {
// just in case this has not been done before and for castor persistence
@@ -185,7 +181,7 @@
*
* @param registrationURL The URL of the producers registration interface
**/
- public void initRegistrationInterface(String registrationURL)
+ private void initRegistrationInterface(String registrationURL)
throws WSRPException {
// just in case this has not been done before and for castor persistence
@@ -225,6 +221,12 @@
**/
public void setServiceDescriptionInterfaceEndpoint(String url) {
serviceDescriptionURL = url;
+ try {
+ initServiceDescInterface(url);
+ } catch (WSRPException e) {
+ log.error("Error while initializing the new ServiceDescription " +
+ "interface endpoint", e);
+ }
stateChanged();
}
@@ -244,6 +246,12 @@
**/
public void setRegistrationInterfaceEndpoint(String url) {
registrationURL = url;
+ try {
+ initRegistrationInterface(url);
+ } catch (WSRPException e) {
+ log.error("Error while initializing the new Registration " +
+ "interface endpoint", e);
+ }
stateChanged();
}
@@ -560,6 +568,9 @@
if (registrationData == null) {
/* Either no registration data or producer does not support
in-band registration */
+ /* Take care with this throw; is disabled, with the current
+ * architecture of this class, wsrp4j proxyportlet will enter
+ * an infinite loop */
WSRPXHelper.throwX(log, ErrorCodes.INVALID_REGISTRATION_DATA);
} else if (registrationInterface == null) {
WSRPXHelper.throwX(log, ErrorCodes.INVALID_URL_OF_REGISTRATION_PORT);
@@ -676,10 +687,16 @@
*/
public void setPortletManagementInterfaceEndpoint(String url) {
portletManagementURL = url;
+ try {
+ initPortletManagementInterface(url);
+ } catch (WSRPException e) {
+ log.error("Error while initializing the new PortletManagement " +
+ "interface endpoint", e);
+ }
stateChanged();
}
- public void initPortletManagementInterface(String portletManagementURL)
+ private void initPortletManagementInterface(String portletManagementURL)
throws WSRPException {
final String MN = "initPortletManagementInterface";