Author: chris.laprun(a)jboss.com
Date: 2007-02-28 00:24:40 -0500 (Wed, 28 Feb 2007)
New Revision: 6452
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/deployment/DeploymentTestCase.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/deployment/MockConsumerRegistry.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistry.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeployer.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeploymentFactory.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/AbstractJNDIServiceFactory.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RemoteSOAPInvokerServiceFactory.java
trunk/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/domain.hbm.xml
trunk/wsrp/src/resources/portal-wsrp-sar/wsrp-aop.xml
trunk/wsrp/src/resources/tests/test-deployment-lib-jar/test-wsrp.xml
Log:
- WSRPDeploymentFactory creates EndpoingConfigurationInfos instead of ServiceFactories for
better lazy loading.
- Added explicit activation method for Consumers on ConsumerRegistry and separated it from
Consumer creation.
- Moved default JNDI mapping information to AbstractJNDIServiceFactory.
- Added timeout in RemoteSOAPInvokerServiceFactory, better error reporting and better
isAvailable implementation.
- Only persist the consumer if the associated ServiceFactory is available since it means
that there might be a problem
with the configuration if the service factory is not available.
- Eager loading in Hibernate configuration: no need for lazy loading and makes for easier
code.
- activateConsumerWith is AOP-enhanced for transactional support.
- Updated test cases to test for unvailable URLs handling.
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/deployment/DeploymentTestCase.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/deployment/DeploymentTestCase.java 2007-02-28
02:44:26 UTC (rev 6451)
+++
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/deployment/DeploymentTestCase.java 2007-02-28
05:24:40 UTC (rev 6452)
@@ -41,6 +41,7 @@
import org.jboss.xb.binding.UnmarshallerFactory;
import java.net.URL;
+import java.util.Collection;
import java.util.List;
/**
@@ -55,16 +56,28 @@
URL wsrpXMLLocation =
Thread.currentThread().getContextClassLoader().getResource("test-wsrp.xml");
assertNotNull(wsrpXMLLocation);
Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- ObjectModelFactory factory = new WSRPDeploymentFactory(new
MockConsumerRegistry());
+ MockConsumerRegistry registry = new MockConsumerRegistry();
+ ObjectModelFactory factory = new WSRPDeploymentFactory(registry);
Object o = unmarshaller.unmarshal(wsrpXMLLocation.openStream(), factory, null);
assertNotNull(o);
assertTrue(o instanceof WSRPDeployment);
- //
+ Collection consumers = registry.getConfiguredConsumers();
+ assertNotNull(consumers);
+ assertEquals(7, consumers.size());
+ assertNotNull(registry.getConsumer("endpoint1"));
+ assertNotNull(registry.getConsumer("endpoint2"));
+ assertNotNull(registry.getConsumer("producer1"));
+ assertNotNull(registry.getConsumer("producer2"));
+ assertNotNull(registry.getConsumer("inDB"));
+ assertNotNull(registry.getConsumer("inDB2"));
+ assertNotNull(registry.getConsumer("unavailable"));
+
+ // deployment should only contain
WSRPDeployment deployment = (WSRPDeployment)o;
List services = deployment.getServices();
assertNotNull(services);
- assertEquals(4, services.size());
+ assertEquals(5, services.size());
//
Object service = services.get(0);
@@ -103,7 +116,21 @@
assertEquals("registration-2", serviceFactory2.getRegistrationURL());
assertEquals("portlet-management-2",
serviceFactory2.getPortletManagementURL());
+ // inDB2 is active and configured from the DB (configured in MockConsumerRegistry)
service = services.get(2);
+ consumer2 = ((WSRPConsumerService)service).getConsumer();
+ assertEquals("inDB2", consumer2.getProducerId());
+ assertNull(consumer2.getProducerInfo().getExpirationCacheSeconds());
+ assertNotNull(consumer2.getServiceFactory());
+ assertTrue(consumer2.getServiceFactory() instanceof
PerEndpointSOAPInvokerServiceFactory);
+ serviceFactory2 =
(PerEndpointSOAPInvokerServiceFactory)consumer2.getServiceFactory();
+ assertEquals("service-description-2",
serviceFactory2.getServiceDescriptionURL());
+ assertEquals("markup-2", serviceFactory2.getMarkupURL());
+ assertEquals("registration-2", serviceFactory2.getRegistrationURL());
+ assertEquals("portlet-management-2",
serviceFactory2.getPortletManagementURL());
+
+ //
+ service = services.get(3);
assertTrue(service instanceof WSRPConsumerService);
WSRPConsumerService service3 = (WSRPConsumerService)service;
assertEquals("producer1", service3.getId());
@@ -135,7 +162,7 @@
assertEquals("en-US", property.getLang());
assertEquals("value", property.getStringValue());
- service = services.get(3);
+ service = services.get(4);
service3 = (WSRPConsumerService)service;
assertEquals("producer2", service3.getId());
consumer3 = service3.getConsumer();
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/deployment/MockConsumerRegistry.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/deployment/MockConsumerRegistry.java 2007-02-28
02:44:26 UTC (rev 6451)
+++
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/deployment/MockConsumerRegistry.java 2007-02-28
05:24:40 UTC (rev 6452)
@@ -27,6 +27,7 @@
import org.jboss.portal.portlet.federation.FederatingPortletInvoker;
import org.jboss.portal.test.wsrp.framework.support.MockWSRPConsumer;
import org.jboss.portal.wsrp.WSRPConsumer;
+import org.jboss.portal.wsrp.consumer.ConsumerException;
import org.jboss.portal.wsrp.consumer.ConsumerRegistry;
import java.util.Collection;
@@ -46,7 +47,9 @@
public MockConsumerRegistry()
{
consumers.put("inDB", new MockWSRPConsumer("inDB"));
- consumers.put("inDB2", new MockWSRPConsumer("inDB2"));
+ MockWSRPConsumer consumer = new MockWSRPConsumer("inDB2");
+ consumer.getProducerInfo().setActive(true);
+ consumers.put("inDB2", consumer);
}
public Collection getConfiguredConsumers()
@@ -75,4 +78,8 @@
consumers.put(consumer.getProducerId(), consumer);
}
+ public void activateConsumerWith(String id) throws ConsumerException
+ {
+ // do nothing
+ }
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistry.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistry.java 2007-02-28
02:44:26 UTC (rev 6451)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistry.java 2007-02-28
05:24:40 UTC (rev 6452)
@@ -43,4 +43,6 @@
WSRPConsumer createConsumer(String id);
void persistConsumer(WSRPConsumer consumer);
+
+ void activateConsumerWith(String id) throws ConsumerException;
}
\ No newline at end of file
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java 2007-02-28
02:44:26 UTC (rev 6451)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java 2007-02-28
05:24:40 UTC (rev 6452)
@@ -29,6 +29,7 @@
import org.jboss.portal.jems.as.system.AbstractJBossService;
import org.jboss.portal.portlet.federation.FederatingPortletInvoker;
import org.jboss.portal.wsrp.WSRPConsumer;
+import org.jboss.portal.wsrp.deployment.WSRPConsumerService;
import javax.naming.InitialContext;
import java.util.Collection;
@@ -49,6 +50,8 @@
private SortedMap consumers;
+// private Set startedConsumerIds = new HashSet();
+
private SessionFactory sessionFactory;
private String sessionFactoryJNDIName;
@@ -74,7 +77,7 @@
session.persist(info);
- return createAndActivateConsumerIfNeeded(info);
+ return createConsumerFrom(info);
}
public void persistConsumer(WSRPConsumer consumer)
@@ -86,7 +89,7 @@
session.persist(info);
- createAndActivateConsumerIfNeeded(info);
+ createConsumerFrom(info);
}
public void setFederatingPortletInvoker(FederatingPortletInvoker
federatingPortletInvoker)
@@ -116,31 +119,60 @@
while (producerInfos.hasNext())
{
producerInfo = (ProducerInfo)producerInfos.next();
- createAndActivateConsumerIfNeeded(producerInfo);
+ createConsumerFrom(producerInfo);
+ activateConsumerWith(producerInfo.getId());
}
}
- private WSRPConsumer createAndActivateConsumerIfNeeded(ProducerInfo producerInfo)
+ private WSRPConsumer createConsumerFrom(ProducerInfo producerInfo)
{
WSRPConsumer consumer = new WSRPConsumerImpl();
consumer.setProducerInfo(producerInfo);
consumers.put(producerInfo.getId(), consumer);
- /*if (producerInfo.isActive())
+
+ return consumer;
+ }
+
+ public void activateConsumerWith(String id) throws ConsumerException
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(id, "Consumer
identifier", "activateConsumerWith");
+
+ // if the consumer associated with the given id is already registered, don't do
anything
+ if (federatingPortletInvoker.getFederatedInvoker(id) == null)
{
+ WSRPConsumer consumer = getConsumer(id);
+
+ if (consumer == null)
+ {
+ throw new ConsumerException("Consumer with id '" + id +
"' doesn't exist!");
+ }
+
WSRPConsumerService service = new WSRPConsumerService();
service.setConsumer(consumer);
service.setFederatingPortletInvoker(federatingPortletInvoker);
+
try
{
service.start();
}
catch (Exception e)
{
- throw new ConsumerException("Couldn't start Consumer service
'" + producerInfo.getId() + "'", e);
+ throw new ConsumerException("Couldn't start Consumer service
'" + id + "'", e);
}
- }*/
- return consumer;
+ // mark the consumer as active
+ ProducerInfo info = consumer.getProducerInfo();
+ info.setActive(true);
+
+ // update ProducerInfo
+ Session session = sessionFactory.getCurrentSession();
+ session.beginTransaction();
+
+ session.update(info);
+
+ session.getTransaction().commit();
+ }
+
}
protected void stopService() throws Exception
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeployer.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeployer.java 2007-02-28
02:44:26 UTC (rev 6451)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeployer.java 2007-02-28
05:24:40 UTC (rev 6452)
@@ -123,16 +123,8 @@
WSRPDeployment deployment = (WSRPDeployment)di.metaData;
for (Iterator i = deployment.getServices().iterator(); i.hasNext();)
{
- try
- {
- WSRPConsumerService service = (WSRPConsumerService)i.next();
-
service.setFederatingPortletInvoker(consumerRegistry.getFederatingPortletInvoker());
- service.start();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
+ WSRPConsumerService service = (WSRPConsumerService)i.next();
+ consumerRegistry.activateConsumerWith(service.getId());
}
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeploymentFactory.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeploymentFactory.java 2007-02-28
02:44:26 UTC (rev 6451)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeploymentFactory.java 2007-02-28
05:24:40 UTC (rev 6452)
@@ -30,16 +30,11 @@
import org.jboss.portal.wsrp.consumer.ProducerInfo;
import org.jboss.portal.wsrp.consumer.RegistrationInfo;
import org.jboss.portal.wsrp.consumer.WSRPConsumerImpl;
-import org.jboss.portal.wsrp.services.AbstractJNDIServiceFactory;
-import org.jboss.portal.wsrp.services.PerEndpointSOAPInvokerServiceFactory;
-import org.jboss.portal.wsrp.services.RemoteSOAPInvokerServiceFactory;
import org.jboss.util.StringPropertyReplacer;
import org.jboss.xb.binding.ObjectModelFactory;
import org.jboss.xb.binding.UnmarshallingContext;
import org.xml.sax.Attributes;
-import java.util.Properties;
-
/**
* Wire the mbeans to install
*
@@ -57,9 +52,6 @@
/** . */
private static final String WSRP_PRODUCER = "wsrp-producer";
- /** . */
- private static Properties serviceFactoryMapping;
-
public static class Property
{
String name;
@@ -67,26 +59,6 @@
String lang;
}
-
- static
- {
- // fix-me: this is hardcoded from values from
portal-wsrp-client.jar/META-INF/jboss-client.xml... NOT GOOD!
- serviceFactoryMapping = new Properties();
- serviceFactoryMapping.setProperty(
- "org.jboss.portal.wsrp.core.WSRP_v1_ServiceDescription_PortType",
- "wsrp-client/service/ServiceDescriptionService");
- serviceFactoryMapping.setProperty(
- "org.jboss.portal.wsrp.core.WSRP_v1_Markup_PortType",
- "wsrp-client/service/MarkupService");
- serviceFactoryMapping.setProperty(
- "org.jboss.portal.wsrp.core.WSRP_v1_Registration_PortType",
- "wsrp-client/service/RegistrationService");
- serviceFactoryMapping.setProperty(
- "org.jboss.portal.wsrp.core.WSRP_v1_PortletManagement_PortType",
- "wsrp-client/service/PortletManagementService");
- }
-
-
public WSRPDeploymentFactory(ConsumerRegistry consumerRegistry)
{
this.consumerRegistry = consumerRegistry;
@@ -175,31 +147,15 @@
ProducerInfo prodInfo = service.getConsumer().getProducerInfo();
- AbstractJNDIServiceFactory serviceFactory = null;
RegistrationInfo regInfo = null;
- if ("endpoint-config".equals(localName))
+ if ("endpoint-config".equals(localName) ||
"endpoint-wsdl-url".equals(localName))
{
- serviceFactory = new PerEndpointSOAPInvokerServiceFactory();
+ return new EndpointConfigurationInfo(prodInfo);
}
- else if ("endpoint-wsdl-url".equals(localName))
- {
- serviceFactory = new RemoteSOAPInvokerServiceFactory();
- }
else if ("registration-data".equals(localName))
{
- regInfo = new RegistrationInfo(prodInfo);
+ return new RegistrationInfo(prodInfo);
}
-
- if (serviceFactory != null)
- {
- serviceFactory.setPortJNDIMapping(serviceFactoryMapping);
- new EndpointConfigurationInfo(prodInfo, serviceFactory);
- return serviceFactory;
- }
- else if (regInfo != null)
- {
- return regInfo;
- }
else
{
return null;
@@ -221,46 +177,42 @@
return null;
}
- public void setValue(PerEndpointSOAPInvokerServiceFactory serviceFactory,
UnmarshallingContext nav, String nsURI,
+ public void setValue(EndpointConfigurationInfo endpointInfo, UnmarshallingContext nav,
String nsURI,
String localName, String value)
{
if (DEBUG)
{
- System.out.println("setvalue servicefactory " + localName);
+ System.out.println("setvalue endpointInfo " + localName);
}
if ("service-description-url".equals(localName))
{
// Resolve value that may contain properties for that one
value = StringPropertyReplacer.replaceProperties(value);
- serviceFactory.setServiceDescriptionURL(value);
+ endpointInfo.setServiceDescriptionURL(value);
}
else if ("markup-url".equals(localName))
{
// Resolve value that may contain properties for that one
value = StringPropertyReplacer.replaceProperties(value);
- serviceFactory.setMarkupURL(value);
+ endpointInfo.setMarkupURL(value);
}
else if ("registration-url".equals(localName))
{
// Resolve value that may contain properties for that one
value = StringPropertyReplacer.replaceProperties(value);
- serviceFactory.setRegistrationURL(value);
+ endpointInfo.setRegistrationURL(value);
}
else if ("portlet-management-url".equals(localName))
{
// Resolve value that may contain properties for that one
value = StringPropertyReplacer.replaceProperties(value);
- serviceFactory.setPortletManagementURL(value);
+ endpointInfo.setPortletManagementURL(value);
}
else if ("endpoint-wsdl-url".equals(localName))
{
- if (serviceFactory instanceof RemoteSOAPInvokerServiceFactory)
- {
- RemoteSOAPInvokerServiceFactory remoteSOAPInvokerServiceFactory =
(RemoteSOAPInvokerServiceFactory)serviceFactory;
- value = StringPropertyReplacer.replaceProperties(value);
- remoteSOAPInvokerServiceFactory.setWsdlDefinitionURL(value);
- }
+ value = StringPropertyReplacer.replaceProperties(value);
+ endpointInfo.setWsdlDefinitionURL(value);
}
}
@@ -327,8 +279,10 @@
if (service.getConsumer().getServiceFactory().isAvailable())
{
message = "Added consumer for producer '" + service.getId() +
"' from xml configuration.";
- service.getConsumer().getProducerInfo().setActive(true);
deployment.getServices().add(service);
+
+ // only persist the consumer if the service factory is available
+ consumerRegistry.persistConsumer(service.getConsumer());
}
else
{
@@ -336,9 +290,6 @@
+ service.getId() + "'. The consumer will NOT be available.";
}
- // persist consumer to the database now that it's complete
- consumerRegistry.persistConsumer(service.getConsumer());
-
log.info(message);
}
}
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/AbstractJNDIServiceFactory.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/AbstractJNDIServiceFactory.java 2007-02-28
02:44:26 UTC (rev 6451)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/AbstractJNDIServiceFactory.java 2007-02-28
05:24:40 UTC (rev 6452)
@@ -49,8 +49,29 @@
/** The JNDI configuration. */
private Properties env;
+ /** Default mapping between WSRP port type class and associated JNDI name */
+ private static Properties DEFAULT_FACTORY_MAPPING;
+
+ static
+ {
+ // fix-me: this is hardcoded from values from
portal-wsrp-client.jar/META-INF/jboss-client.xml... NOT GOOD!
+ DEFAULT_FACTORY_MAPPING = new Properties();
+ DEFAULT_FACTORY_MAPPING.setProperty(
+ "org.jboss.portal.wsrp.core.WSRP_v1_ServiceDescription_PortType",
+ "wsrp-client/service/ServiceDescriptionService");
+ DEFAULT_FACTORY_MAPPING.setProperty(
+ "org.jboss.portal.wsrp.core.WSRP_v1_Markup_PortType",
+ "wsrp-client/service/MarkupService");
+ DEFAULT_FACTORY_MAPPING.setProperty(
+ "org.jboss.portal.wsrp.core.WSRP_v1_Registration_PortType",
+ "wsrp-client/service/RegistrationService");
+ DEFAULT_FACTORY_MAPPING.setProperty(
+ "org.jboss.portal.wsrp.core.WSRP_v1_PortletManagement_PortType",
+ "wsrp-client/service/PortletManagementService");
+ }
+
/** A Map recording the mapping between WSRP port type class name and JDNI name of the
implementing service. */
- protected Properties portJNDIMapping;
+ protected Properties portJNDIMapping = DEFAULT_FACTORY_MAPPING;
protected void createService() 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-02-28
02:44:26 UTC (rev 6451)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RemoteSOAPInvokerServiceFactory.java 2007-02-28
05:24:40 UTC (rev 6452)
@@ -38,6 +38,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
+import java.net.Socket;
import java.net.URL;
import java.util.Collection;
import java.util.Iterator;
@@ -53,6 +54,8 @@
private String wsdlDefinitionURL;
+ private boolean available;
+
private static final String WSRP_URN = "urn:oasis:names:tc:wsrp:v1:wsdl";
private static final String DEFAULT_SERVICE_NAME = "WSRPService";
@@ -77,11 +80,32 @@
"services definition");
}
this.wsdlDefinitionURL = wsdlDefinitionURL;
- initServices();
+ try
+ {
+ initServices();
+ available = true;
+ }
+ catch (MalformedURLException e)
+ {
+ IllegalArgumentException iae = new IllegalArgumentException("Require a
well-formed URL specifying where to " +
+ "find the WSRP services definition");
+ iae.initCause(e);
+ throw iae;
+ }
+ catch (Exception e)
+ {
+ available = false;
+ }
}
- private void initServices()
+
+ public boolean isAvailable()
{
+ return available && super.isAvailable();
+ }
+
+ private void initServices() throws MalformedURLException
+ {
try
{
URL wsdlURL = new URL(wsdlDefinitionURL);
@@ -95,17 +119,10 @@
initServiceURL(port.getName(), getLocation(port));
}
}
- catch (MalformedURLException e)
+ catch (WSDLException e)
{
- IllegalArgumentException iae = new IllegalArgumentException("Require a
well-formed URL specifying where to " +
- "find the WSRP services definition");
- iae.initCause(e);
- throw iae;
+ throw new RuntimeException("Couldn't initialize services for WSDL at
'" + wsdlDefinitionURL + "'", e);
}
- catch (Exception e)
- {
- log.info("Couldn't initialize services for WSDL at '" +
wsdlDefinitionURL + "'", e);
- }
}
/**
@@ -154,6 +171,7 @@
//Requires wsdl4j
private Definition getWSDLDefinition(URL url) throws WSDLException
{
+ log.info("Retrieving WSDL from " + url);
WSDLFactory wsdlFactory = WSDLFactory.newInstance();
javax.wsdl.xml.WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
return wsdlReader.readWSDL(new WSDLLocatorImpl(url));
@@ -178,20 +196,28 @@
public InputSource getBaseInputSource()
{
- log.trace("getBaseInputSource [wsdlUrl=" + wsdlURL + "]");
+ log.info("getBaseInputSource [wsdlUrl=" + wsdlURL + "]");
try
{
- InputStream is = Tools.safeBufferedWrapper(wsdlURL.openStream());
+ Socket socket = new Socket(wsdlURL.getHost(), wsdlURL.getPort());
+ socket.setSoTimeout(10000);
+
+// url.setReadTimeout(10000); // would be nice but 1.5 only! :(
+ InputStream is = Tools.safeBufferedWrapper(socket.getInputStream());
if (is == null)
{
- throw new IllegalArgumentException("Cannot obtain wsdl from [" +
wsdlURL + "]");
+ String message = "Cannot retrieve WSDL: '" + wsdlURL +
"' is not a valid URL.";
+ log.info(message);
+ throw new IllegalArgumentException(message);
}
return new InputSource(is);
}
catch (IOException e)
{
- throw new RuntimeException("Cannot access wsdl from [" + wsdlURL +
"], " + e.getMessage());
+ String message = "Cannot access wsdl from [" + wsdlURL + "],
" + e.getMessage();
+ log.info(message);
+ throw new RuntimeException(message);
}
}
@@ -202,7 +228,7 @@
public InputSource getImportInputSource(String parent, String resource)
{
- log.trace("getImportInputSource [parent=" + parent +
",resource=" + resource + "]");
+ log.info("getImportInputSource [parent=" + parent +
",resource=" + resource + "]");
URL parentURL;
try
@@ -254,7 +280,7 @@
try
{
- log.trace("Resolved to: " + wsdlImport);
+ log.info("Resolved to: " + wsdlImport);
InputStream is = Tools.safeBufferedWrapper(new
URL(wsdlImport).openStream());
if (is == null)
{
Modified: trunk/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/domain.hbm.xml
===================================================================
---
trunk/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/domain.hbm.xml 2007-02-28
02:44:26 UTC (rev 6451)
+++
trunk/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/domain.hbm.xml 2007-02-28
05:24:40 UTC (rev 6452)
@@ -39,13 +39,15 @@
class="org.jboss.portal.wsrp.consumer.EndpointConfigurationInfo"
unique="true"
not-null="true"
- cascade="all"/>
+ cascade="all"
+ lazy="false"/>
<many-to-one name="registrationInfo"
column="REGISTRATION_ID"
class="org.jboss.portal.wsrp.consumer.RegistrationInfo"
unique="true"
not-null="false"
- cascade="all"/>
+ cascade="all"
+ lazy="false"/>
<property name="expirationCacheSeconds"
column="EXPIRATION_CACHE_SECONDS"/>
<property name="active" not-null="true"/>
<property name="id" not-null="true"
unique="true"/>
@@ -75,7 +77,7 @@
<property name="consumerName" column="CONSUMER_NAME"
type="java.lang.String" not-null="true"/>
<property name="registrationHandle" column="HANDLE"
type="java.lang.String"/>
<property name="registrationState" column="STATE"
type="binary"/>
- <map name="registrationProperties" cascade="all">
+ <map name="registrationProperties" cascade="all"
lazy="false">
<cache usage="@portal.hibernate.cache.usage(a)"/>
<key column="REG_PROP_PK"/>
<map-key type="string" column="NAME"/>
@@ -99,7 +101,8 @@
column="DESC_PK"
class="org.jboss.portal.wsrp.registration.RegistrationPropertyDescription"
unique="true"
- cascade="all"/>
+ cascade="all"
+ lazy="false"/>
</class>
<class
name="org.jboss.portal.wsrp.registration.RegistrationPropertyDescription"
table="JBP_REG_PROP_DESC">
<cache usage="@portal.hibernate.cache.usage(a)"/>
Modified: trunk/wsrp/src/resources/portal-wsrp-sar/wsrp-aop.xml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-sar/wsrp-aop.xml 2007-02-28 02:44:26 UTC (rev
6451)
+++ trunk/wsrp/src/resources/portal-wsrp-sar/wsrp-aop.xml 2007-02-28 05:24:40 UTC (rev
6452)
@@ -29,6 +29,9 @@
<method name="persistConsumer">
<trans-attribute>Required</trans-attribute>
</method>
+ <method name="activateConsumerWith">
+ <trans-attribute>Required</trans-attribute>
+ </method>
</metadata>
<!-- TRANSACTIONS -->
Modified: trunk/wsrp/src/resources/tests/test-deployment-lib-jar/test-wsrp.xml
===================================================================
--- trunk/wsrp/src/resources/tests/test-deployment-lib-jar/test-wsrp.xml 2007-02-28
02:44:26 UTC (rev 6451)
+++ trunk/wsrp/src/resources/tests/test-deployment-lib-jar/test-wsrp.xml 2007-02-28
05:24:40 UTC (rev 6452)
@@ -91,4 +91,9 @@
<registration-data/>
</wsrp-producer>
</deployment>
+ <deployment>
+ <wsrp-producer id="unavailable">
+ <endpoint-wsdl-url>http://localhost</endpoint-wsdl-url>
+ </wsrp-producer>
+ </deployment>
</deployments>
\ No newline at end of file