[jboss-svn-commits] JBL Code SVN: r25570 - in labs/jbossesb/trunk/product: rosetta/src/org/jboss/soa/esb/client and 4 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Mar 10 07:54:52 EDT 2009
Author: kevin.conner at jboss.com
Date: 2009-03-10 07:54:52 -0400 (Tue, 10 Mar 2009)
New Revision: 25570
Modified:
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryImpl.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/RegistryUtil.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/mina/MessageHandler.java
labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/MyFailingAsyncAction.java
labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/MyFailingSyncAction.java
Log:
Rollback JBESB-2097 and JBESB-2185
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryImpl.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryImpl.java 2009-03-10 09:39:34 UTC (rev 25569)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryImpl.java 2009-03-10 11:54:52 UTC (rev 25570)
@@ -68,47 +68,47 @@
*/
public class JAXRRegistryImpl implements Registry
{
- private static Logger logger = Logger.getLogger(JAXRRegistryImpl.class);
+ private static Logger logger = Logger.getLogger(JAXRRegistryImpl.class);
private JAXRConnectionFactory jaxrConnectionFactory;
- private static Organization jbossESBOrganization;
- public static final String JBOSS_ESB_CATEGORY = "org.jboss.soa.esb.:category";
-
+ private static Organization jbossESBOrganization;
+ public static final String JBOSS_ESB_CATEGORY = "org.jboss.soa.esb.:category";
+
public JAXRRegistryImpl() throws ConfigurationException {
jaxrConnectionFactory = new JAXRConnectionFactory();
}
/**
- * Publish an EPR to the Registry
- */
- protected Service registerService(String category, String serviceName, String serviceDescription) throws JAXRException
- {
- Service service =null;
- Organization organization = getJBossESBOrganization();
- Connection connection = jaxrConnectionFactory.getConnection();
- try {
- RegistryService rs = connection.getRegistryService();
+ * Publish an EPR to the Registry
+ */
+ protected Service registerService(String category, String serviceName, String serviceDescription) throws JAXRException
+ {
+ Service service =null;
+ Organization organization = getJBossESBOrganization();
+ Connection connection = jaxrConnectionFactory.getConnection();
+ try {
+ RegistryService rs = connection.getRegistryService();
BusinessQueryManager bqm = rs.getBusinessQueryManager();
- BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
- //Adding the category as prefix for the name
- service = blm.createService(blm.createInternationalString(serviceName));
- service.setDescription(blm.createInternationalString(serviceDescription));
+ BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
+ //Adding the category as prefix for the name
+ service = blm.createService(blm.createInternationalString(serviceName));
+ service.setDescription(blm.createInternationalString(serviceDescription));
Collection<String> findQualifiers = new ArrayList<String>();
findQualifiers.add(FindQualifier.AND_ALL_KEYS);
findQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
- ClassificationScheme cScheme = bqm.findClassificationSchemeByName(findQualifiers, JBOSS_ESB_CATEGORY);
+ ClassificationScheme cScheme = bqm.findClassificationSchemeByName(findQualifiers, JBOSS_ESB_CATEGORY);
Classification classification = blm.createClassification(cScheme, "category", category);
- service.addClassification(classification);
- organization.addService(service);
- saveRegistryObject(service, jaxrConnectionFactory);
- } finally {
- jaxrConnectionFactory.closeConnection(connection);
- }
- return service;
- }
- /**
- * Remove an EPR from the Registry
- */
- @SuppressWarnings("unchecked")
+ service.addClassification(classification);
+ organization.addService(service);
+ saveRegistryObject(service, jaxrConnectionFactory);
+ } finally {
+ jaxrConnectionFactory.closeConnection(connection);
+ }
+ return service;
+ }
+ /**
+ * Remove an EPR from the Registry
+ */
+ @SuppressWarnings("unchecked")
public void unRegisterService(String category, String serviceName) throws RegistryException, ServiceNotFoundException{
// first find the ServiceBindings for this service
Connection connection = jaxrConnectionFactory.getConnection();
@@ -128,13 +128,13 @@
} finally {
jaxrConnectionFactory.closeConnection(connection);
}
- }
- /**
- * Publish an EPR to the Registry
- */
- public void registerEPR(String category, String serviceName, String serviceDescription, EPR epr, String eprDescription)
- throws RegistryException
- {
+ }
+ /**
+ * Publish an EPR to the Registry
+ */
+ public void registerEPR(String category, String serviceName, String serviceDescription, EPR epr, String eprDescription)
+ throws RegistryException
+ {
Connection connection = jaxrConnectionFactory.getConnection();
try {
//Find the service
@@ -171,10 +171,10 @@
jaxrConnectionFactory.closeConnection(connection);
}
}
- /**
- * Remove an EPR from the Registry
- */
- public void unRegisterEPR(String category, String serviceName, EPR toBeDeletedEPR) throws RegistryException, ServiceNotFoundException{
+ /**
+ * Remove an EPR from the Registry
+ */
+ public void unRegisterEPR(String category, String serviceName, EPR toBeDeletedEPR) throws RegistryException, ServiceNotFoundException{
//first find the ServiceBindings for this service
Connection connection = jaxrConnectionFactory.getConnection();
Service service = null;
@@ -221,66 +221,66 @@
jaxrConnectionFactory.closeConnection(connection);
}
}
-
- /**
- * {@inheritDoc}
- * @return collection services
- */
- public List<String> findAllServices() throws RegistryException
- {
- List<String> serviceNames = new ArrayList<String>();
- try {
- Collection services = getJBossESBOrganization().getServices();
- for (Iterator i=services.iterator();i.hasNext();) {
- String serviceName = ((Service)i.next()).getName().getValue();
- serviceNames.add(serviceName);
- }
- } catch (JAXRException je) {
- throw new RegistryException(je.getLocalizedMessage(), je);
- }
- return serviceNames;
- }
- /**
- * Find Services based on a category ("transformation").
- *
- * @return collection services
- */
- public List<String> findServices(String category) throws RegistryException
- {
- List<String>serviceNames = new ArrayList<String>();
+
+ /**
+ * {@inheritDoc}
+ * @return collection services
+ */
+ public List<String> findAllServices() throws RegistryException
+ {
+ List<String> serviceNames = new ArrayList<String>();
+ try {
+ Collection services = getJBossESBOrganization().getServices();
+ for (Iterator i=services.iterator();i.hasNext();) {
+ String serviceName = ((Service)i.next()).getName().getValue();
+ serviceNames.add(serviceName);
+ }
+ } catch (JAXRException je) {
+ throw new RegistryException(je.getLocalizedMessage(), je);
+ }
+ return serviceNames;
+ }
+ /**
+ * Find Services based on a category ("transformation").
+ *
+ * @return collection services
+ */
+ public List<String> findServices(String category) throws RegistryException
+ {
+ List<String>serviceNames = new ArrayList<String>();
try {
- Collection<Service>services = findServicesForCategory(category);
- for (Iterator<Service> i=services.iterator();i.hasNext();) {
- String serviceName = i.next().getName().getValue();
- serviceNames.add(serviceName);
- }
- } catch (JAXRException je) {
- throw new RegistryException(je.getLocalizedMessage(), je);
- }
- return serviceNames;
- }
- /**
- *
- * @return
- */
- public List<EPR> findEPRs(String category, String serviceName) throws RegistryException, ServiceNotFoundException
- {
- List<EPR> eprs = new ArrayList<EPR>();
+ Collection<Service>services = findServicesForCategory(category);
+ for (Iterator<Service> i=services.iterator();i.hasNext();) {
+ String serviceName = i.next().getName().getValue();
+ serviceNames.add(serviceName);
+ }
+ } catch (JAXRException je) {
+ throw new RegistryException(je.getLocalizedMessage(), je);
+ }
+ return serviceNames;
+ }
+ /**
+ *
+ * @return
+ */
+ public List<EPR> findEPRs(String category, String serviceName) throws RegistryException, ServiceNotFoundException
+ {
+ List<EPR> eprs = new ArrayList<EPR>();
Connection connection = jaxrConnectionFactory.getConnection();
- try {
- Service service = findService(category, serviceName);
- if (service==null){
+ try {
+ Service service = findService(category, serviceName);
+ if (service==null){
throw new ServiceNotFoundException("Could not find service with category=" + category + " and serviceName=" + serviceName);
- }
- // Get registry service and business query manager
- Collection<ServiceBinding> serviceBindings = findServiceBindings(service);
- //Converting them to EPRs
- for (Iterator i=serviceBindings.iterator();i.hasNext();) {
- ServiceBinding serviceBinding = (ServiceBinding) i.next();
- @SuppressWarnings("unused")
- String eprXML = serviceBinding.getAccessURI();
+ }
+ // Get registry service and business query manager
+ Collection<ServiceBinding> serviceBindings = findServiceBindings(service);
+ //Converting them to EPRs
+ for (Iterator i=serviceBindings.iterator();i.hasNext();) {
+ ServiceBinding serviceBinding = (ServiceBinding) i.next();
+ @SuppressWarnings("unused")
+ String eprXML = serviceBinding.getAccessURI();
EPR epr = null;
//for backwards compatibility still have the decoder if
//unmarchalling fails
@@ -297,22 +297,22 @@
throw new UnmarshalException(ue.getMessage(), ue);
}
}
- }
- } catch (JAXRException je) {
- throw new RegistryException(je.getLocalizedMessage(), je);
+ }
+ } catch (JAXRException je) {
+ throw new RegistryException(je.getLocalizedMessage(), je);
} catch (UnmarshalException me) {
throw new RegistryException(me.getLocalizedMessage(), me);
- } finally {
- jaxrConnectionFactory.closeConnection(connection);
- }
- return eprs;
- }
- /**
- *
- * @return
- */
- public EPR findEPR(String category, String serviceName) throws RegistryException, ServiceNotFoundException
- {
+ } finally {
+ jaxrConnectionFactory.closeConnection(connection);
+ }
+ return eprs;
+ }
+ /**
+ *
+ * @return
+ */
+ public EPR findEPR(String category, String serviceName) throws RegistryException, ServiceNotFoundException
+ {
EPR epr = null ;
Connection connection = jaxrConnectionFactory.getConnection();
try {
@@ -348,75 +348,75 @@
}
return epr;
- }
+ }
/**
- * Find all Organizations with a name mathing the queryString parameter.
- *
- * @param organizationName used to match with the name of the organization.
- * @return the Organization.
- */
+ * Find all Organizations with a name mathing the queryString parameter.
+ *
+ * @param organizationName used to match with the name of the organization.
+ * @return the Organization.
+ */
public static Organization findOrganization(String organizationName, JAXRConnectionFactory jaxrConnectionFactory) throws JAXRException {
- if (organizationName==null) {
- organizationName="";
- }
- Connection connection = jaxrConnectionFactory.getConnection();
- try {
- // Get registry service and business query manager
- RegistryService rs = connection.getRegistryService();
- BusinessQueryManager bqm = rs.getBusinessQueryManager();
- // Define find qualifiers and name patterns
- Collection<String> findQualifiers = new ArrayList<String>();
- findQualifiers.add(FindQualifier.SORT_BY_NAME_ASC);
- Collection<String> namePatterns = new ArrayList<String>();
- namePatterns.add("%" + organizationName + "%");
- //Find based upon qualifier type and values
- logger.log(Level.DEBUG,"Going to query the registry for name pattern " + namePatterns);
- BulkResponse response = bqm.findOrganizations(findQualifiers,
- namePatterns, null, null, null, null);
- if (response.getStatus()==JAXRResponse.STATUS_SUCCESS) {
- for (Iterator orgIter = response.getCollection().iterator(); orgIter.hasNext();)
- {
- Organization org = (Organization) orgIter.next();
- logger.log(Level.DEBUG, "Organization name: " + org.getName().getValue());
- logger.log(Level.DEBUG, "Description: " + org.getDescription().getValue());
- logger.log(Level.DEBUG, "Key id: " + org.getKey().getId());
- User primaryContact = org.getPrimaryContact();
- logger.log(Level.DEBUG, "Primary Contact: " + primaryContact.getPersonName().getFullName());
- if (orgIter.hasNext()) {
- logger.log(Level.ERROR, "Found " + response.getCollection().size()
- + " Organization, while expecting only one of name " + organizationName);
- }
- return org;
- }
- }
- return null;
- } finally {
- jaxrConnectionFactory.closeConnection(connection);
- }
- }
+ if (organizationName==null) {
+ organizationName="";
+ }
+ Connection connection = jaxrConnectionFactory.getConnection();
+ try {
+ // Get registry service and business query manager
+ RegistryService rs = connection.getRegistryService();
+ BusinessQueryManager bqm = rs.getBusinessQueryManager();
+ // Define find qualifiers and name patterns
+ Collection<String> findQualifiers = new ArrayList<String>();
+ findQualifiers.add(FindQualifier.SORT_BY_NAME_ASC);
+ Collection<String> namePatterns = new ArrayList<String>();
+ namePatterns.add("%" + organizationName + "%");
+ //Find based upon qualifier type and values
+ logger.log(Level.DEBUG,"Going to query the registry for name pattern " + namePatterns);
+ BulkResponse response = bqm.findOrganizations(findQualifiers,
+ namePatterns, null, null, null, null);
+ if (response.getStatus()==JAXRResponse.STATUS_SUCCESS) {
+ for (Iterator orgIter = response.getCollection().iterator(); orgIter.hasNext();)
+ {
+ Organization org = (Organization) orgIter.next();
+ logger.log(Level.DEBUG, "Organization name: " + org.getName().getValue());
+ logger.log(Level.DEBUG, "Description: " + org.getDescription().getValue());
+ logger.log(Level.DEBUG, "Key id: " + org.getKey().getId());
+ User primaryContact = org.getPrimaryContact();
+ logger.log(Level.DEBUG, "Primary Contact: " + primaryContact.getPersonName().getFullName());
+ if (orgIter.hasNext()) {
+ logger.log(Level.ERROR, "Found " + response.getCollection().size()
+ + " Organization, while expecting only one of name " + organizationName);
+ }
+ return org;
+ }
+ }
+ return null;
+ } finally {
+ jaxrConnectionFactory.closeConnection(connection);
+ }
+ }
/**
- *
- * @param category
- * @param serviceName
- * @return Service
- */
- protected Service findService(String category, String serviceName) throws JAXRException
- {
- if (category==null) {
- category="";
- }
- if (serviceName==null) {
- serviceName="";
- }
- Connection connection = jaxrConnectionFactory.getConnection();
- try {
- // Get registry service and business query manager
- RegistryService rs = connection.getRegistryService();
- BusinessQueryManager bqm = rs.getBusinessQueryManager();
+ *
+ * @param category
+ * @param serviceName
+ * @return Service
+ */
+ protected Service findService(String category, String serviceName) throws JAXRException
+ {
+ if (category==null) {
+ category="";
+ }
+ if (serviceName==null) {
+ serviceName="";
+ }
+ Connection connection = jaxrConnectionFactory.getConnection();
+ try {
+ // Get registry service and business query manager
+ RegistryService rs = connection.getRegistryService();
+ BusinessQueryManager bqm = rs.getBusinessQueryManager();
BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
- // Define find qualifiers and name patterns
+ // Define find qualifiers and name patterns
Collection<String> findQualifiers = new ArrayList<String>();
findQualifiers.add(FindQualifier.AND_ALL_KEYS);
findQualifiers.add(FindQualifier.EXACT_NAME_MATCH);
@@ -425,67 +425,67 @@
Collection<Classification> classifications = new ArrayList<Classification>();
// If the scheme returned null, then we have to create a org.jboss.soa.esb.:category scheme to use
if (cScheme == null) {
- try {
- ClassificationScheme scheme = blm.createClassificationScheme(JBOSS_ESB_CATEGORY, JBOSS_ESB_CATEGORY);
- ArrayList<ClassificationScheme> cSchemes = new ArrayList<ClassificationScheme>();
+ try {
+ ClassificationScheme scheme = blm.createClassificationScheme(JBOSS_ESB_CATEGORY, JBOSS_ESB_CATEGORY);
+ ArrayList<ClassificationScheme> cSchemes = new ArrayList<ClassificationScheme>();
cSchemes.add(scheme);
BulkResponse br = blm.saveClassificationSchemes(cSchemes);
- } catch (Exception e) {
- throw new JAXRException(e);
- }
- cScheme = bqm.findClassificationSchemeByName(findQualifiers, JBOSS_ESB_CATEGORY);
+ } catch (Exception e) {
+ throw new JAXRException(e);
+ }
+ cScheme = bqm.findClassificationSchemeByName(findQualifiers, JBOSS_ESB_CATEGORY);
}
Classification classification =
blm.createClassification(
cScheme,
"category", category );
classifications.add(classification);
- Collection<String> namePatterns = new ArrayList<String>();
- namePatterns.add(serviceName);
- //Find based upon qualifier type and values
- logger.log(Level.DEBUG, "Going to query the registry for name pattern " + namePatterns);
- BulkResponse response = bqm.findServices(null, findQualifiers,
- namePatterns, classifications, null);
- if (response.getStatus()==JAXRResponse.STATUS_SUCCESS) {
- for (Iterator servIter = response.getCollection().iterator(); servIter.hasNext();)
- {
- Service service = (Service) servIter.next();
- logger.log(Level.DEBUG, "Service name: " + service.getName().getValue());
- if (service.getDescription()!=null) {
- logger.log(Level.DEBUG, "Description: " + service.getDescription().getValue());
- }
- logger.log(Level.DEBUG, "Key id: " + service.getKey().getId());
- if (servIter.hasNext()) {
- logger.log(Level.ERROR, "Found " + response.getCollection().size()
- + " Services, while expecting only one by the name of "
- + serviceName + " in category " + category);
- }
- return service;
- }
- }
- return null;
- } finally {
- jaxrConnectionFactory.closeConnection(connection);
- }
- }
+ Collection<String> namePatterns = new ArrayList<String>();
+ namePatterns.add(serviceName);
+ //Find based upon qualifier type and values
+ logger.log(Level.DEBUG, "Going to query the registry for name pattern " + namePatterns);
+ BulkResponse response = bqm.findServices(null, findQualifiers,
+ namePatterns, classifications, null);
+ if (response.getStatus()==JAXRResponse.STATUS_SUCCESS) {
+ for (Iterator servIter = response.getCollection().iterator(); servIter.hasNext();)
+ {
+ Service service = (Service) servIter.next();
+ logger.log(Level.DEBUG, "Service name: " + service.getName().getValue());
+ if (service.getDescription()!=null) {
+ logger.log(Level.DEBUG, "Description: " + service.getDescription().getValue());
+ }
+ logger.log(Level.DEBUG, "Key id: " + service.getKey().getId());
+ if (servIter.hasNext()) {
+ logger.log(Level.ERROR, "Found " + response.getCollection().size()
+ + " Services, while expecting only one by the name of "
+ + serviceName + " in category " + category);
+ }
+ return service;
+ }
+ }
+ return null;
+ } finally {
+ jaxrConnectionFactory.closeConnection(connection);
+ }
+ }
/**
- * Finds all services for a given category.
- * @param category
- * @return Service
- */
- @SuppressWarnings("unchecked")
- protected Collection<Service> findServicesForCategory(String category) throws JAXRException
- {
- Collection<Service> services = new ArrayList<Service>();
- if (category==null) {
- category="";
- }
- Connection connection = jaxrConnectionFactory.getConnection();
- try {
- // Get registry service and business query manager
- RegistryService rs = connection.getRegistryService();
- BusinessQueryManager bqm = rs.getBusinessQueryManager();
+ * Finds all services for a given category.
+ * @param category
+ * @return Service
+ */
+ @SuppressWarnings("unchecked")
+ protected Collection<Service> findServicesForCategory(String category) throws JAXRException
+ {
+ Collection<Service> services = new ArrayList<Service>();
+ if (category==null) {
+ category="";
+ }
+ Connection connection = jaxrConnectionFactory.getConnection();
+ try {
+ // Get registry service and business query manager
+ RegistryService rs = connection.getRegistryService();
+ BusinessQueryManager bqm = rs.getBusinessQueryManager();
BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
Collection<String> findQualifiers = new ArrayList<String>();
findQualifiers.add(FindQualifier.AND_ALL_KEYS);
@@ -497,197 +497,197 @@
cScheme,
"category", category );
- // Define find qualifiers and name patterns
- //Collection<String> findQualifiers = new ArrayList<String>();
- //findQualifiers.add(FindQualifier.AND_ALL_KEYS);
- findQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
- Collection<Classification> classifications = new ArrayList<Classification>();
+ // Define find qualifiers and name patterns
+ //Collection<String> findQualifiers = new ArrayList<String>();
+ //findQualifiers.add(FindQualifier.AND_ALL_KEYS);
+ findQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
+ Collection<Classification> classifications = new ArrayList<Classification>();
classifications.add(classification);
- //Find based upon qualifier type and values
- logger.log(Level.DEBUG, "Going to query the registry for classification " + classifications);
- BulkResponse response = bqm.findServices(null, findQualifiers,
- null, classifications, null);
- if (response.getStatus()==JAXRResponse.STATUS_SUCCESS) {
- services = (Collection<Service>) response.getCollection();
- }
- return services;
- } finally {
- jaxrConnectionFactory.closeConnection(connection);
- }
- }
+ //Find based upon qualifier type and values
+ logger.log(Level.DEBUG, "Going to query the registry for classification " + classifications);
+ BulkResponse response = bqm.findServices(null, findQualifiers,
+ null, classifications, null);
+ if (response.getStatus()==JAXRResponse.STATUS_SUCCESS) {
+ services = (Collection<Service>) response.getCollection();
+ }
+ return services;
+ } finally {
+ jaxrConnectionFactory.closeConnection(connection);
+ }
+ }
/**
- * Create a jbossesb organization under which we will register all our services.
- *
- * @return
- * @throws JAXRException
- */
+ * Create a jbossesb organization under which we will register all our services.
+ *
+ * @return
+ * @throws JAXRException
+ */
protected static Organization createJBossESBOrganization(JAXRConnectionFactory jaxrConnectionFactory) throws JAXRException
- {
-// Getting the connection to the Registry (reading config)
- Connection connection = jaxrConnectionFactory.getConnection();
- try {
- //Logging in
- RegistryService rs = connection.getRegistryService();
- //Building organization
- BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
- Organization organization = blm.createOrganization(blm.createInternationalString("Red Hat/JBossESB"));
- organization.setDescription(blm.createInternationalString("Red Hat/JBoss Professional Open Source, Services for the JBossESB"));
+ {
+// Getting the connection to the Registry (reading config)
+ Connection connection = jaxrConnectionFactory.getConnection();
+ try {
+ //Logging in
+ RegistryService rs = connection.getRegistryService();
+ //Building organization
+ BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
+ Organization organization = blm.createOrganization(blm.createInternationalString("Red Hat/JBossESB"));
+ organization.setDescription(blm.createInternationalString("Red Hat/JBoss Professional Open Source, Services for the JBossESB"));
- User user = blm.createUser();
- organization.setPrimaryContact(user);
- PersonName personName = blm.createPersonName("JBossESB");
- TelephoneNumber telephoneNumber = blm.createTelephoneNumber();
- telephoneNumber.setNumber("404 467-8555");
- telephoneNumber.setType(null);
- PostalAddress address = blm.createPostalAddress("3340",
- "Peachtree Road, NE, Suite 1200", "Atlanta", "GA", "USA",
- "30326", "");
- Collection<PostalAddress> postalAddresses = new ArrayList<PostalAddress>();
- postalAddresses.add(address);
- Collection<EmailAddress> emailAddresses = new ArrayList<EmailAddress>();
- EmailAddress emailAddress = blm
- .createEmailAddress("jbossesb at jboss.com");
- emailAddresses.add(emailAddress);
+ User user = blm.createUser();
+ organization.setPrimaryContact(user);
+ PersonName personName = blm.createPersonName("JBossESB");
+ TelephoneNumber telephoneNumber = blm.createTelephoneNumber();
+ telephoneNumber.setNumber("404 467-8555");
+ telephoneNumber.setType(null);
+ PostalAddress address = blm.createPostalAddress("3340",
+ "Peachtree Road, NE, Suite 1200", "Atlanta", "GA", "USA",
+ "30326", "");
+ Collection<PostalAddress> postalAddresses = new ArrayList<PostalAddress>();
+ postalAddresses.add(address);
+ Collection<EmailAddress> emailAddresses = new ArrayList<EmailAddress>();
+ EmailAddress emailAddress = blm
+ .createEmailAddress("jbossesb at jboss.com");
+ emailAddresses.add(emailAddress);
- Collection<TelephoneNumber> numbers = new ArrayList<TelephoneNumber>();
- numbers.add(telephoneNumber);
- user.setPersonName(personName);
- user.setPostalAddresses(postalAddresses);
- user.setEmailAddresses(emailAddresses);
- user.setTelephoneNumbers(numbers);
+ Collection<TelephoneNumber> numbers = new ArrayList<TelephoneNumber>();
+ numbers.add(telephoneNumber);
+ user.setPersonName(personName);
+ user.setPostalAddresses(postalAddresses);
+ user.setEmailAddresses(emailAddresses);
+ user.setTelephoneNumbers(numbers);
- // Scout does not support this (yet), so leaving it out for now.
- // ClassificationScheme cScheme = getClassificationScheme(blm,
- // blm.createInternationalString("uddi-org:general_keywords"), blm.createInternationalString(""));
- // Classification classification = blm.createClassification(cScheme,
- // blm.createInternationalString("JBoss ESB"), blm.createInternationalString("JBESB"));
- // org.addClassification(classification);
+ // Scout does not support this (yet), so leaving it out for now.
+ // ClassificationScheme cScheme = getClassificationScheme(blm,
+ // blm.createInternationalString("uddi-org:general_keywords"), blm.createInternationalString(""));
+ // Classification classification = blm.createClassification(cScheme,
+ // blm.createInternationalString("JBoss ESB"), blm.createInternationalString("JBESB"));
+ // org.addClassification(classification);
- saveRegistryObject(organization, jaxrConnectionFactory);
- return organization;
- } finally {
- jaxrConnectionFactory.closeConnection(connection);
- }
- }
+ saveRegistryObject(organization, jaxrConnectionFactory);
+ return organization;
+ } finally {
+ jaxrConnectionFactory.closeConnection(connection);
+ }
+ }
/**
- * Save Registry Object
- */
- private static void saveRegistryObject(RegistryObject registryObject, JAXRConnectionFactory jaxrConnectionFactory) throws JAXRException
- {
-// Getting the connection to the Registry (reading config)
- Connection connection = jaxrConnectionFactory.getConnection();
- try {
+ * Save Registry Object
+ */
+ private static void saveRegistryObject(RegistryObject registryObject, JAXRConnectionFactory jaxrConnectionFactory) throws JAXRException
+ {
+// Getting the connection to the Registry (reading config)
+ Connection connection = jaxrConnectionFactory.getConnection();
+ try {
- BulkResponse br = null;
- //Logging in
- RegistryService rs = connection.getRegistryService();
- //Building organization
- BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
+ BulkResponse br = null;
+ //Logging in
+ RegistryService rs = connection.getRegistryService();
+ //Building organization
+ BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
- Class[] interfaces = registryObject.getClass().getInterfaces();
- String interfaceName ="";
- for (int i=0; i<interfaces.length; i++) {
- interfaceName = interfaces[i].getName();
- if (interfaceName.equals("javax.xml.registry.infomodel.Organization")) {
+ Class[] interfaces = registryObject.getClass().getInterfaces();
+ String interfaceName ="";
+ for (int i=0; i<interfaces.length; i++) {
+ interfaceName = interfaces[i].getName();
+ if (interfaceName.equals("javax.xml.registry.infomodel.Organization")) {
Collection<Organization> orginations = new ArrayList<Organization>();
orginations.add((Organization) registryObject);
- br = blm.saveOrganizations(orginations);
- break;
- } else if (interfaceName.equals("javax.xml.registry.infomodel.Service")) {
+ br = blm.saveOrganizations(orginations);
+ break;
+ } else if (interfaceName.equals("javax.xml.registry.infomodel.Service")) {
Collection<Service> services = new ArrayList<Service>();
services.add((Service) registryObject);
- br = blm.saveServices(services);
- break;
- } else if (interfaceName.equals("javax.xml.registry.infomodel.ServiceBinding")) {
+ br = blm.saveServices(services);
+ break;
+ } else if (interfaceName.equals("javax.xml.registry.infomodel.ServiceBinding")) {
Collection<ServiceBinding> serviceBindings = new ArrayList<ServiceBinding>();
serviceBindings.add((ServiceBinding) registryObject);
br = blm.saveServiceBindings(serviceBindings);
- break;
- } else {
- logger.log(Level.ERROR, "Trying to save an unsupported RegistryObject");
- throw new JAXRException("Trying to save an unsupported RegistryObject");
- }
- }
+ break;
+ } else {
+ logger.log(Level.ERROR, "Trying to save an unsupported RegistryObject");
+ throw new JAXRException("Trying to save an unsupported RegistryObject");
+ }
+ }
//Verify the return
- if (br!=null && br.getStatus() == JAXRResponse.STATUS_SUCCESS) {
- logger.log(Level.DEBUG, interfaceName + " successfully saved");
- Collection coll = br.getCollection();
- Iterator iter = coll.iterator();
- while (iter.hasNext()) {
- Key key = (Key) iter.next();
- registryObject.setKey(key);
- logger.log(Level.DEBUG, "Saved Key=" + key.getId());
- }
- } else {
- logger.log(Level.ERROR, "Errors occurred during save.");
- if (br!=null) {
- Collection exceptions = br.getExceptions();
- Iterator iter = exceptions.iterator();
- String errors = "";
- JAXRException je = new JAXRException("JAXRExceptions occurred during save");
- while (iter.hasNext()) {
- Exception e = (Exception) iter.next();
- errors += e.getLocalizedMessage() + "\n";
- je.setStackTrace(e.getStackTrace());
- logger.log(Level.ERROR, e.getLocalizedMessage(), e);
- //if it's the last error, throw it now and set the current stacktrace
- if (!iter.hasNext()) {
- throw new JAXRException(errors, e);
- }
- }
- throw new JAXRException("Errors occurred during save. Response status=" + br.getStatus());
- }
- throw new JAXRException("Errors occurred during save");
- }
- } finally {
- jaxrConnectionFactory.closeConnection(connection);
- }
- }
+ if (br!=null && br.getStatus() == JAXRResponse.STATUS_SUCCESS) {
+ logger.log(Level.DEBUG, interfaceName + " successfully saved");
+ Collection coll = br.getCollection();
+ Iterator iter = coll.iterator();
+ while (iter.hasNext()) {
+ Key key = (Key) iter.next();
+ registryObject.setKey(key);
+ logger.log(Level.DEBUG, "Saved Key=" + key.getId());
+ }
+ } else {
+ logger.log(Level.ERROR, "Errors occurred during save.");
+ if (br!=null) {
+ Collection exceptions = br.getExceptions();
+ Iterator iter = exceptions.iterator();
+ String errors = "";
+ JAXRException je = new JAXRException("JAXRExceptions occurred during save");
+ while (iter.hasNext()) {
+ Exception e = (Exception) iter.next();
+ errors += e.getLocalizedMessage() + "\n";
+ je.setStackTrace(e.getStackTrace());
+ logger.log(Level.ERROR, e.getLocalizedMessage(), e);
+ //if it's the last error, throw it now and set the current stacktrace
+ if (!iter.hasNext()) {
+ throw new JAXRException(errors, e);
+ }
+ }
+ throw new JAXRException("Errors occurred during save. Response status=" + br.getStatus());
+ }
+ throw new JAXRException("Errors occurred during save");
+ }
+ } finally {
+ jaxrConnectionFactory.closeConnection(connection);
+ }
+ }
/**
- * finds the JBossESB Organizationa and creates one if it is not there.
- * @return JBossESB Organization
- * @throws JAXRException
- */
- private Organization getJBossESBOrganization() throws JAXRException
- {
- jbossESBOrganization = findOrganization("Red Hat/JBossESB", jaxrConnectionFactory);
- if (jbossESBOrganization==null) {
- jbossESBOrganization = createJBossESBOrganization(jaxrConnectionFactory);
- }
- return jbossESBOrganization;
- }
+ * finds the JBossESB Organizationa and creates one if it is not there.
+ * @return JBossESB Organization
+ * @throws JAXRException
+ */
+ private Organization getJBossESBOrganization() throws JAXRException
+ {
+ jbossESBOrganization = findOrganization("Red Hat/JBossESB", jaxrConnectionFactory);
+ if (jbossESBOrganization==null) {
+ jbossESBOrganization = createJBossESBOrganization(jaxrConnectionFactory);
+ }
+ return jbossESBOrganization;
+ }
/**
- * Find the ServiceBindings for a given Service
- * @param service
- * @return
- * @throws RegistryException
- */
- @SuppressWarnings("unchecked")
- private Collection<ServiceBinding> findServiceBindings(Service service) throws RegistryException
- {
- Collection<ServiceBinding> serviceBindings = new ArrayList<ServiceBinding>();
- Connection connection = jaxrConnectionFactory.getConnection();
- try {
- RegistryService rs = connection.getRegistryService();
- BusinessQueryManager bqm = rs.getBusinessQueryManager();
- Collection<String> findQualifiers = null;
- //Collection<String> findQualifiers = new ArrayList<String>();
- //findQualifiers.add(FindQualifier.SORT_BY_DATE_ASC);
- BulkResponse bulkResponse = bqm.findServiceBindings(service.getKey(),findQualifiers,null,null);
- if (bulkResponse.getStatus()==JAXRResponse.STATUS_SUCCESS){
- serviceBindings = (Collection<ServiceBinding>)bulkResponse.getCollection();
- }
- return serviceBindings;
- } catch (Exception je) {
- throw new RegistryException(je.getLocalizedMessage(), je);
- } finally {
- jaxrConnectionFactory.closeConnection(connection);
- }
- }
+ * Find the ServiceBindings for a given Service
+ * @param service
+ * @return
+ * @throws RegistryException
+ */
+ @SuppressWarnings("unchecked")
+ private Collection<ServiceBinding> findServiceBindings(Service service) throws RegistryException
+ {
+ Collection<ServiceBinding> serviceBindings = new ArrayList<ServiceBinding>();
+ Connection connection = jaxrConnectionFactory.getConnection();
+ try {
+ RegistryService rs = connection.getRegistryService();
+ BusinessQueryManager bqm = rs.getBusinessQueryManager();
+ Collection<String> findQualifiers = null;
+ //Collection<String> findQualifiers = new ArrayList<String>();
+ //findQualifiers.add(FindQualifier.SORT_BY_DATE_ASC);
+ BulkResponse bulkResponse = bqm.findServiceBindings(service.getKey(),findQualifiers,null,null);
+ if (bulkResponse.getStatus()==JAXRResponse.STATUS_SUCCESS){
+ serviceBindings = (Collection<ServiceBinding>)bulkResponse.getCollection();
+ }
+ return serviceBindings;
+ } catch (Exception je) {
+ throw new RegistryException(je.getLocalizedMessage(), je);
+ } finally {
+ jaxrConnectionFactory.closeConnection(connection);
+ }
+ }
}
-
+
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java 2009-03-10 09:39:34 UTC (rev 25569)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java 2009-03-10 11:54:52 UTC (rev 25570)
@@ -43,9 +43,9 @@
import org.jboss.soa.esb.couriers.Courier;
import org.jboss.soa.esb.couriers.CourierException;
import org.jboss.soa.esb.couriers.CourierFactory;
+import org.jboss.soa.esb.couriers.CourierTimeoutException;
import org.jboss.soa.esb.couriers.CourierMarshalUnmarshalException;
import org.jboss.soa.esb.couriers.CourierServiceBindException;
-import org.jboss.soa.esb.couriers.CourierTimeoutException;
import org.jboss.soa.esb.couriers.CourierTransportException;
import org.jboss.soa.esb.couriers.CourierUtil;
import org.jboss.soa.esb.couriers.FaultMessageException;
@@ -165,7 +165,7 @@
try {
Class c = ClassUtil.forName(lbClass, this.getClass());
loadBalancer = (LoadBalancePolicy) c.newInstance();
- tryLoadingServiceClusterInfoSilent();
+ loadServiceClusterInfo();
} catch (ClassNotFoundException clf) {
logger.error("No such LoadBalancePolicy class = " + lbClass);
throw new MessageDeliverException(clf.getMessage(), clf);
@@ -220,11 +220,7 @@
deliverToDeadLetterService(message);
}
-
- if (mde.getCause() instanceof ServiceNotFoundException)
- throw new RegistryException("Problem when using registry.", mde.getCause());
- else
- throw mde;
+ throw mde;
}
return message;
}
@@ -278,6 +274,7 @@
* For internal package use only.
*
* @param message The message to be delivered to the dead letter chennel.
+ * @throws RegistryException Service endpoint lookup failure.
* @throws MessageDeliverException Message delivery failure.
*/
protected static synchronized void deliverToDeadLetterService(Message message) throws MessageDeliverException {
@@ -324,8 +321,6 @@
message.getContext().setContext(SecurityService.AUTH_REQUEST, encryptedAuthRequest);
}
- boolean timedout = false;
-
try {
//We are removing dead EPRs from the serviceClusterInfo. *Previous* deliveries maybe have
//removed EPRs that have now come back to life. We should try once more to pull a fresh list of EPRS
@@ -360,23 +355,7 @@
while ((epr = loadBalancer.chooseEPR(serviceClusterInfo)) != null) {
try
{
- try
- {
- replyMessage = eprInvoker.attemptDelivery(message, epr);
- }
- catch (final ResponseTimeoutException ex)
- {
- // do this so we can loop through the list of eprs if there's more than one.
-
- if (serviceClusterInfo.getEPRs().size() == 1)
- throw ex;
- else
- {
- replyMessage = null;
- timedout = true;
- }
- }
-
+ replyMessage = eprInvoker.attemptDelivery(message, epr);
if (replyMessage != null) {
if(eprInvoker.synchronous) {
// remove the security context so that it is not exposed to the action pipeline.
@@ -413,7 +392,7 @@
*/
if (("true".equals(message.getProperties().getProperty(Environment.EXCEPTION_ON_DELIVERY_FAILURE, "false")) || exceptionOnDeliveryFailure))
- throw new MessageDeliverException("Failed to deliver message ["+message.getHeader()+"] to Service [" + service + "]. Told not to retry by 'exceptionOnDeliverFailure' property.");
+ throw new MessageDeliverException("Failed to deliver message ["+message.getHeader()+"] to Service [" + service + "]. Told not to retry.");
}
}
catch (MalformedEPRException ex) // so we can differentiate failure modes, since returning null is limiting
@@ -434,13 +413,8 @@
message.getContext().removeContext(SecurityService.AUTH_REQUEST);
}
- if (timedout)
- throw new ResponseTimeoutException("Failed to get response from service(s).");
- else
- {
- // Throw exception if delivery failed...
- throw new MessageDeliverException("Failed to deliver message ["+message.getHeader()+"] to Service [" + service + "]. Check for errors.");
- }
+ // Throw exception if delivery failed...
+ throw new MessageDeliverException("Failed to deliver message ["+message.getHeader()+"] to Service [" + service + "]. Check for errors.");
}
/**
@@ -507,65 +481,30 @@
* until we can expect to get updates from the registry. For now this should work
* just fine.
*
- * @throws MessageDeliverException some other error occurs.
+ * @throws MessageDeliverException Registry lookup failure.
*/
-
public void loadServiceClusterInfo() throws MessageDeliverException {
List<EPR> serviceEprs = new ArrayList<EPR>();
try {
- serviceEprs = getEPRs(service);
- } catch (final ServiceNotFoundException snfe) {
+ serviceEprs = RegistryUtil.getEprs(service.getCategory(), service.getName());
+ if (logger.isDebugEnabled()) {
+ for (EPR epr : serviceEprs) {
+ try {
+ logger.debug("EPR=" + epr + " XML=" + EPRHelper.toXMLString(epr));
+ } catch (Exception me) {
+ logger.error(me.getMessage(), me);
+ }
+ }
+ }
+ } catch (ServiceNotFoundException snfe) {
logger.info("Service: " + service + " not found in the registry");
-
- // yeuch - broken API that we have to live with for now.
-
- throw new MessageDeliverException("Service: " + service + " not found in the registry", snfe);
- } catch (final Exception e) {
+ } catch (RegistryException e) {
throw new MessageDeliverException(e.getMessage(), e);
}
- createClusterInfo(service, serviceEprs);
- }
-
- /*
- * If doing a load at construction time it's possible the registry may not
- * be set yet, so we ignore such faults.
- */
- private final void tryLoadingServiceClusterInfoSilent () throws MessageDeliverException
- {
- List<EPR> serviceEprs = new ArrayList<EPR>();
- try {
- serviceEprs = getEPRs(service);
- } catch (final ServiceNotFoundException snfe) {
- logger.info("Service: " + service + " not found in the registry but service might come online at a later point.");
- } catch (final Exception e) {
- throw new MessageDeliverException(e.getMessage(), e);
- }
- createClusterInfo(service, serviceEprs);
- }
-
- private void createClusterInfo(final Service service, final List<EPR> eprs)
- {
- serviceClusterInfo = new ServiceClusterInfoImpl(service.getName(), eprs);
+ serviceClusterInfo = new ServiceClusterInfoImpl(service.getName(), serviceEprs);
expirationDate = new Date(java.lang.System.currentTimeMillis() + registryCacheLife);
}
- private List<EPR> getEPRs(final Service service) throws RegistryException, ServiceNotFoundException
- {
- List<EPR> serviceEprs = new ArrayList<EPR>();
- serviceEprs = RegistryUtil.getEprs(service.getCategory(), service.getName());
- if (logger.isDebugEnabled()) {
- for (EPR epr : serviceEprs) {
- try {
- logger.debug("EPR=" + epr + " XML=" + EPRHelper.toXMLString(epr));
- } catch (Exception me) {
- logger.error(me.getMessage(), me);
- }
- }
- }
- return serviceEprs;
- }
-
-
/*
* Is redelivery overridden on a per message basis? If not, use the global setting.
*/
@@ -584,30 +523,6 @@
}
}
- private final void asyncDLQ (final Message message) throws MessageDeliverException
- {
- if (message.getProperties().getProperty(RedeliverStore.IS_REDELIVERY) == null
- && asyncRedelivery(message) && !service.equals(dlqService))
- {
- message.getProperties().setProperty(MessageStore.CLASSIFICATION,
- MessageStore.CLASSIFICATION_RDLVR);
- message.getProperties().setProperty(DELIVER_TO, service);
-
- try
- {
- logger.info("Delivering message [" + message.getHeader()
- + "] to RDLVRQ.");
-
- deliverToDeadLetterService(message);
- }
- finally
- {
- message.getProperties().remove(MessageStore.CLASSIFICATION);
- message.getProperties().remove(DELIVER_TO);
- }
- }
- }
-
private class EPRInvoker {
private boolean synchronous = false;
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/RegistryUtil.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/RegistryUtil.java 2009-03-10 09:39:34 UTC (rev 25569)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/RegistryUtil.java 2009-03-10 11:54:52 UTC (rev 25570)
@@ -129,33 +129,25 @@
final String eprDescription = config.getAttribute(ListenerTagNames.EPR_DESCRIPTION_TAG) ;
final Registry registry = RegistryFactory.getRegistry() ;
+ if (logger.isDebugEnabled())
+ {
+ logger.debug("Registering < " + name + ", " + epr + " >") ;
+ }
+
registryLock.lock();
try
{
- if ("true".equalsIgnoreCase(removeOldService)) {
- if (logger.isDebugEnabled()) {
- logger.debug("Unregistering ALL EPR's for service < " + category
- + ", " + name + " >.");
- }
- registry.registerEPR(category, name,
- serviceDescription, epr, eprDescription) ;
- } else {
- if (logger.isDebugEnabled()) {
- logger.debug("Unregistering any existing < " + name + ", " + epr + " >");
- }
- // https://jira.jboss.org/jira/browse/JBESB-866
- unregisterSilent(category, name, epr);
- }
-
- if (logger.isDebugEnabled()) {
- logger.debug("Registering < " + name + ", " + epr + " >");
- }
- registry.registerEPR(category, name, serviceDescription, epr,
- eprDescription);
- }
- catch (final Exception ex)
+ if ("true".equalsIgnoreCase(removeOldService))
+ registry.unRegisterService(category, name);
+
+ registry.registerEPR(category, name,
+ serviceDescription, epr, eprDescription) ;
+ }
+ catch (ServiceNotFoundException ex)
{
- logger.debug("Problem encountered while registering service < "+category+", "+name+" >.");
+ // ignore as it's possible another client just did the removal for us.
+
+ logger.debug("Could not unregister service < "+category+", "+name+" >.");
}
finally
{
@@ -198,34 +190,6 @@
}
}
}
-
- private static void unregisterSilent(final String category, final String name, final EPR epr)
- {
- if ("eprManager".equalsIgnoreCase(category))
- {
- unregister(name) ;
- }
- else
- {
- registryLock.lock() ;
- try
- {
- final Registry registry = RegistryFactory.getRegistry() ;
- registry.unRegisterEPR(category, name, epr) ;
- }
- catch (final ServiceNotFoundException snfe) {
- logger.debug("Failed to unregister service", snfe);
- }
- catch (final RegistryException re)
- {
- logger.debug("Failed to unregister service", re) ;
- }
- finally
- {
- registryLock.unlock() ;
- }
- }
- }
/**
* Get the EPRs associated with the specified service.
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java 2009-03-10 09:39:34 UTC (rev 25569)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java 2009-03-10 11:54:52 UTC (rev 25570)
@@ -140,7 +140,7 @@
try {
_serviceInvoker = new ServiceInvoker(_targetServiceCategory, _targetServiceName);
_serviceInvoker.loadServiceClusterInfo();
- } catch (final Exception mde) {
+ } catch (MessageDeliverException mde) {
throw new ManagedLifecycleException(mde);
}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/mina/MessageHandler.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/mina/MessageHandler.java 2009-03-10 09:39:34 UTC (rev 25569)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/mina/MessageHandler.java 2009-03-10 11:54:52 UTC (rev 25570)
@@ -33,7 +33,7 @@
public interface MessageHandler extends IoHandler {
/**
- * Set the {@link ServiceInvoker} instance to be used
+ * Set the {@link ServiceInoker} instance to be used
* to dispatch messages to the ESB Service
*
* @param invoker The ServiceInvoker instance.
Modified: labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/MyFailingAsyncAction.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/MyFailingAsyncAction.java 2009-03-10 09:39:34 UTC (rev 25569)
+++ labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/MyFailingAsyncAction.java 2009-03-10 11:54:52 UTC (rev 25570)
@@ -78,14 +78,7 @@
}
Service noneExistingService = new Service("none-exising-category", "none-existing-service-name");
ServiceInvoker si = new ServiceInvoker(noneExistingService);
- try
- {
- si.deliverAsync(message);
- }
- catch (final Exception ignore)
- {
- System.out.println("Ignoreing Exception " + ignore.getMessage());
- }
+ si.deliverAsync(message);
//Adding this control code to show where the message now is.
Map<URI, Message> rdlvrMessageMap = ms.getAllMessages(MessageStore.CLASSIFICATION_RDLVR);
Modified: labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/MyFailingSyncAction.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/MyFailingSyncAction.java 2009-03-10 09:39:34 UTC (rev 25569)
+++ labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/MyFailingSyncAction.java 2009-03-10 11:54:52 UTC (rev 25570)
@@ -82,7 +82,7 @@
si.deliverSync(message, 1000);
} catch (MessageStoreException mse) {
throw new ActionProcessingException(mse.getMessage(), mse);
- } catch (RegistryException e) {
+ } catch (MessageDeliverException mde) {
//Adding this control code to show where the message now is.
//We should get here on and we should have a message in the DLQ.
try {
@@ -107,8 +107,8 @@
} catch (MessageStoreException mse) {
throw new ActionProcessingException(mse.getMessage(), mse);
}
- } catch (MessageDeliverException e) {
- throw new ActionProcessingException(e.getMessage(), e);
+ } catch (RegistryException re) {
+ throw new ActionProcessingException(re.getMessage(), re);
} catch (FaultMessageException fme) {
throw new ActionProcessingException(fme.getMessage(), fme);
}
More information about the jboss-svn-commits
mailing list