Package org.jboss.soa.esb.services.registry

Examples of org.jboss.soa.esb.services.registry.RegistryException


            {
                timeout = true ;
            }
            catch (final InterruptedException ie)
            {
                throw new RegistryException("Interrupted", ie) ;
            }
            catch (final BrokenBarrierException bbe)
            {
                throw new RegistryException("Broken barrier", bbe) ;
            }
        }
        return registry.findEPRs(serviceCategoryName, serviceName) ;
    }
View Full Code Here


  public static void registerEPR(JAXRRegistryImpl registry, Service service, EPR epr, String eprDescription)
    throws RegistryException, ConfigurationException
  {
    if (epr == null)
    {
      throw new RegistryException("Null EPR argument specified") ;
    }
    JAXRConnectionFactory jaxrConnectionFactory = new JAXRConnectionFactory();
    Connection connection = jaxrConnectionFactory.getConnection();
        try {
      final Concept jbossTModel = registry.getJBossESBTModel(connection);

      RegistryService rs = connection.getRegistryService();
            BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
            BusinessQueryManager bqm = rs.getBusinessQueryManager();
            ServiceBinding serviceBinding = blm.createServiceBinding();
            String xml = EPRHelper.toXMLString(epr);
            serviceBinding.setAccessURI(xml);
           
            ArrayList<ServiceBinding> serviceBindings = new ArrayList<ServiceBinding>();
            SpecificationLink sl = new SpecificationLinkImpl(blm);
            sl.setSpecificationObject(jbossTModel);
            serviceBinding.getSpecificationLinks().add(sl);
            if ("3.0".equals(Configuration.getRegistryUDDIVersion())) {
               if ((eprDescription == null) || ("".equals(eprDescription))) {
                   serviceBinding.setDescription(blm.createInternationalString(JAXRRegistryImpl.REGISTERED_BY_JBOSSESB));
               }
            } else {
               serviceBinding.setDescription(blm.createInternationalString(eprDescription));
            }
            serviceBindings.add(serviceBinding);
           
            service.addServiceBindings(serviceBindings);
            ClassificationScheme cScheme = registry.getClassificationScheme(bqm, blm);
            Classification classification = blm.createClassification(cScheme, "category", TEST_SERVICE_CATEGORY);
            service.addClassification(classification);
           
            registry.saveRegistryObject(serviceBinding, jaxrConnectionFactory);
        } catch (JAXRException je) {
            throw new RegistryException(je.getLocalizedMessage(), je);
        } catch (MarshalException me) {
            throw new RegistryException(me.getLocalizedMessage(), me);
        } finally {
            jaxrConnectionFactory.closeConnection(connection);
        }
  }
View Full Code Here

      BulkResponse response = bqm.findServices(null, findQualifiers,
          namePatterns, classifications, specifications);
      if (response.getStatus()==JAXRResponse.STATUS_SUCCESS) {
        return response.getCollection();
      } else {
        throw new RegistryException();
      }
    } finally {
      jaxrConnectionFactory.closeConnection(connection);
    }
  }
View Full Code Here

    private void registerEndpoint() throws ConfigurationException, RegistryException {
      try {
      endpointReference = new HTTPEpr(new URI(protocol + "://"+ address + ":" + port + this.httpContext));
      endpointReference.getAddr().addExtension("is-gateway", "true");
    } catch (Exception e) {
      throw new RegistryException("Tomcat gateway listener registration failed", e);
    }
      String serviceDescription = getConfig().getAttribute(ListenerTagNames.SERVICE_DESCRIPTION_TAG);
        RegistryFactory.getRegistry().registerEPR(serviceCategory, serviceName, serviceDescription,
                endpointReference, endpointReference.getAddr().getAddress());
    }
View Full Code Here

    throws RegistryException, MalformedEPRException, CourierException, CourierTimeoutException, ServiceNotFoundException
  {
    Call call  = message.getHeader().getCall();
    Collection<EPR> eprs = RegistryUtil.getEprs(category, name);
    if (null==eprs || eprs.size()<1)
      throw new RegistryException("No eprs found for <"+category+","+name+">");
    EPR service = eprs.iterator().next();
    call.setTo(service);
    return invokeAndAwaitResponse(message, maxWaitMillis);
  }
View Full Code Here

            BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
            Collection<Key> serviceKeys = new ArrayList<Key>();
            serviceKeys.add(service.getKey());
            blm.deleteServices(serviceKeys);
        } catch (JAXRException je) {
            throw new RegistryException(je.getLocalizedMessage(), je);
        } finally {
      JAXRConnectionSingleton.recycleConnection(jaxrConnectionFactory, connection);
        }
  }
View Full Code Here

  public void registerEPR(String category, String serviceName, String serviceDescription, EPR epr, String eprDescription)
    throws RegistryException
  {
    if (category == null)
    {
      throw new RegistryException("Null Category argument specified") ;
    }
    if (serviceName == null)
    {
      throw new RegistryException("Null Service Name argument specified") ;
    }
    if (epr == null)
    {
      throw new RegistryException("Null EPR argument specified") ;
    }
    Connection connection = JAXRConnectionSingleton.getConnection(jaxrConnectionFactory);
        try {
      final Concept jbossTModel = getJBossESBTModel(connection);
   
            //Find the service
            Service service = findService(category,serviceName);
            if (service==null) {
                logger.log(Level.DEBUG, "Service " + serviceName + " does not yet exist, creating now..");
                service = registerService(category, serviceName, serviceDescription);
            }

            RegistryService rs = connection.getRegistryService();
            BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
            BusinessQueryManager bqm = rs.getBusinessQueryManager();
            ServiceBinding serviceBinding = blm.createServiceBinding();
            String xml = EPRHelper.toXMLString(epr);
            serviceBinding.setAccessURI(xml);
           
            ArrayList<ServiceBinding> serviceBindings = new ArrayList<ServiceBinding>();
            SpecificationLink sl = new SpecificationLinkImpl(blm);
            sl.setSpecificationObject(jbossTModel);
            serviceBinding.getSpecificationLinks().add(sl);
            if (isV3 && ((eprDescription == null) || ("".equals(eprDescription)))) {
               serviceBinding.setDescription(blm.createInternationalString(REGISTERED_BY_JBOSSESB));
            } else {
               serviceBinding.setDescription(blm.createInternationalString(eprDescription));
            }
            serviceBindings.add(serviceBinding);
           
            service.addServiceBindings(serviceBindings);
            ClassificationScheme cScheme = getClassificationScheme(bqm, blm);
            Classification classification = blm.createClassification(cScheme, "category", category);
            service.addClassification(classification);
           
            saveRegistryObject(serviceBinding, jaxrConnectionFactory);
        } catch (JAXRException je) {
            throw new RegistryException(je.getLocalizedMessage(), je);
        } catch (MarshalException me) {
            throw new RegistryException(me.getLocalizedMessage(), me);
        } finally {
      JAXRConnectionSingleton.recycleConnection(jaxrConnectionFactory, connection);
        }
    }
View Full Code Here

                    serviceBindingKeys.add(serviceBinding.getKey());
                    blm.deleteServiceBindings(serviceBindingKeys);
                    return;
                }
            }
            throw new RegistryException("No such EPR found for service with name = "
                    + serviceName + " and EPR=" + toBeDeletedEPR);
        } catch (JAXRException je) {
            throw new RegistryException(je.getLocalizedMessage(), je);
        } catch (MarshalException me) {
            throw new RegistryException(me.getLocalizedMessage(), me);
        } finally {
      JAXRConnectionSingleton.recycleConnection(jaxrConnectionFactory, connection);
        }
    }
View Full Code Here

      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;
  }
View Full Code Here

      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;
  }
View Full Code Here

TOP

Related Classes of org.jboss.soa.esb.services.registry.RegistryException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.