Package org.jboss.soa.esb.addressing

Examples of org.jboss.soa.esb.addressing.EPR


  {
    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


                         */
                        throw new MissingServiceException("Registry details for service [" + service + "] could not be determined from the registry.") ;
                    }
                    staleEPRCache = false;
                }
                EPR epr;
                // Iterate over all the EPRs in the list until delivered
                while ((epr = loadBalancer.chooseEPR(serviceClusterInfo)) != null) {
                  try
                  {
                        Message replyMessage = null;
View Full Code Here

         *         without error, otherwise null.
         */
        private Message attemptDelivery(Message message, EPR epr) throws FaultMessageException, MalformedEPRException, MessageDeliverException {
            TwoWayCourier courier = null;

            final EPR targetEPR ;
            if ((extensions != null) && (extensions.size() > 0))
            {
                targetEPR = EPRHelper.copyEPR(epr, extensions) ;
            }
            else
            {
                targetEPR = epr ;
            }
            // Get a courier for the EPR...
            try {
                courier = getCourier(targetEPR);
            } catch (CourierException e) {
                if (logger.isDebugEnabled()) {
                    logger.debug("Courier lookup failed for EPR [" + targetEPR + "] for Service [" + service + "] and Message ["+message.getHeader()+"].", e);
                }
            } catch (MalformedEPRException e) {
              // probably an ESB-unaware EPR in the registry!!

                logger.info("Badly formed EPR [" + targetEPR + "] for Service [" + service + "] and Message ["+message.getHeader()+"]." + e.getMessage());

                throw e;
            } catch (Throwable t) {
                logger.warn("Unexpected exception during Courier lookup for EPR [" + targetEPR + "] for Service [" + service + "] and Message ["+message.getHeader()+"].", t);
            }

            // Try delivering the message using the courier we just looked up....

            if (courier != null) {
                // make sure the message header does not change when we exit
                final Call call = message.getHeader().getCall() ;
                final EPR currentToEpr = call.getTo() ;
                final EPR currentReplyToEpr = call.getReplyTo() ;

                try {
                    call.setTo(targetEPR);

                    final EPR replyToEPR ;
                    if (synchronous) {
                        /*
                         * Currently all couriers that have transactional semantics work in a manner similar
                         * to JMS, i.e., messages are not delivered on to a queue (or to an endpoint) until
                         * the enclosing transaction has committed. In a synchronous invocation this will
View Full Code Here

    public LogicalEPR() {
        super();
    }

    public LogicalEPR(PortReference addr) {
      this(new EPR(addr)) ;
    }
View Full Code Here

    public LogicalEPR(PortReference addr) {
      this(new EPR(addr)) ;
    }

    public LogicalEPR(URI uri) {
      this(new EPR(uri)) ;
    }
View Full Code Here

  }
   

  protected void setJMSReplyTo( final Message jmsMessage, final org.jboss.soa.esb.message.Message esbMessage ) throws URISyntaxException, JMSException, NamingException, ConnectionException, NamingContextException
  {
    EPR replyToEpr = esbMessage.getHeader().getCall().getReplyTo();
    if( !( replyToEpr instanceof JMSEpr) )
      return;
   
    JMSEpr jmsEpr = (JMSEpr) replyToEpr;
    String destinationType = jmsEpr.getDestinationType();
View Full Code Here

        if (isInitialised()) {
            throw new ManagedLifecycleException("Unexpected request to initialise JBoss Remoting Gateway listener '" + getConfig().getName() + "'.  Gateway already initialised.");
        }

        try {
            endpointReference = new EPR(getJbrServerLocatorURI());
            messageDeliveryAdapter = createDeliveryAdapter();
            initaliseJBRConnectorConfiguration(connectorConfig);

            String protocol = getConfig().getAttribute(JBR_SERVER_PROTOCOL);
            isHttp = (protocol.equals("http") || protocol.equals("https"));
View Full Code Here

    public Message process(final Message message)
        throws ActionProcessingException
    {
        final Call call = message.getHeader().getCall() ;
        final EPR toEPR = call.getTo() ;
        final Iterator<Extension> extensions = toEPR.getAddr().getExtensions() ;
        if (extensions.hasNext())
        {
            final StringBuilder sb = new StringBuilder() ;
            do
            {
View Full Code Here

        epr = new LogicalEPR(new PortReference("logical:My%20/%20Category#My%20/%20Name"));
        assertEquals("logical:My%20/%20Category#My%20/%20Name", epr.getAddr().getAddress());
        assertEquals("My / Category", epr.toService().getCategory());
        assertEquals("My / Name", epr.toService().getName());
       
        epr = new LogicalEPR(new EPR(URI.create("logical:My%20/%20Category#My%20/%20Name")));
        assertEquals("logical:My%20/%20Category#My%20/%20Name", epr.getAddr().getAddress());
        assertEquals("My / Category", epr.toService().getCategory());
        assertEquals("My / Name", epr.toService().getName());

        epr = new LogicalEPR(new EPR(new PortReference("logical:My%20/%20Category#My%20/%20Name")));
        assertEquals("logical:My%20/%20Category#My%20/%20Name", epr.getAddr().getAddress());
        assertEquals("My / Category", epr.toService().getCategory());
        assertEquals("My / Name", epr.toService().getName());

        epr = new LogicalEPR();
View Full Code Here

        } catch (IllegalArgumentException e) {
            assertEquals("'logical://a#b' is not a valid URI for a Logical EPR - URI must be opaque.", e.getMessage());
        }

        try {
            new LogicalEPR(new EPR(URI.create("xxxx:a#b")));
            fail("Expected IllegalArgumentException");
        } catch (IllegalArgumentException e) {
            assertEquals("'xxxx:a#b' is not a valid URI for a Logical EPR - URI scheme must be 'logical'.", e.getMessage());
        }

        try {
            new LogicalEPR(new EPR(new PortReference("logical://a#b")));
            fail("Expected IllegalArgumentException");
        } catch (IllegalArgumentException e) {
            assertEquals("'logical://a#b' is not a valid URI for a Logical EPR - URI must be opaque.", e.getMessage());
        }
View Full Code Here

TOP

Related Classes of org.jboss.soa.esb.addressing.EPR

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.