Examples of ServiceEndpoint


Examples of com.bazaarvoice.ostrich.ServiceEndPoint

                throw (lastException == null)
                        ? new OnlyBadHostsException()
                        : new OnlyBadHostsException(lastException);
            }

            ServiceEndPoint endPoint = chooseEndPoint(validEndPoints, partitionContext);
            if (endPoint == null) {
                throw (lastException == null)
                        ? new NoSuitableHostsException()
                        : new NoSuitableHostsException(lastException);
            }

            try {
                R result = executeOnEndPoint(endPoint, callback);
                _numExecuteSuccesses.mark();
                return result;
            } catch (Exception e) {
                _numExecuteAttemptFailures.mark();

                // Don't retry if exception is too severe.
                if (!isRetriableException(e)) {
                    throw Throwables.propagate(e);
                }

                LOG.info("Retriable exception from end point id: {}, {}", endPoint.getId(), e.toString());
                LOG.debug("Exception", e);
                lastException = e;
            }
        } while (retry.allowRetry(++numAttempts, sw.elapsedMillis()));
View Full Code Here

Examples of com.spotify.helios.common.descriptors.ServiceEndpoint

      throws InterruptedException {
    final ServiceRegistration.Builder builder = ServiceRegistration.newBuilder();

    for (final Map.Entry<ServiceEndpoint, ServicePorts> entry :
        job.getRegistration().entrySet()) {
      final ServiceEndpoint registration = entry.getKey();
      final ServicePorts servicePorts = entry.getValue();
      for (String portName : servicePorts.getPorts().keySet()) {
        final PortMapping mapping = job.getPorts().get(portName);
        if (mapping == null) {
          log.error("no '{}' port mapped for registration: '{}'", portName, registration);
          continue;
        }
        final Integer externalPort;
        if (mapping.getExternalPort() != null) {
          // Use the statically assigned port if one is specified
          externalPort = mapping.getExternalPort();
        } else {
          // Otherwise use the dynamically allocated port
          externalPort = ports.get(portName);
        }
        if (externalPort == null) {
          log.error("no external '{}' port for registration: '{}'", portName, registration);
          continue;
        }
        builder.endpoint(registration.getName(), registration.getProtocol(), externalPort,
            fullyQualifiedRegistrationDomain(), host);
      }
    }

    return builder.build();
View Full Code Here

Examples of javax.jbi.servicedesc.ServiceEndpoint

        try {
            CeltixServiceUnit csu = serviceUnits.get(suName);
            assert csu != null;
           
            if (csu.isServiceProvider()) {
                ServiceEndpoint ref = ctx.activateEndpoint(csu.getServiceName(), csu.getEndpointName());
                LOG.fine("activated endpoint: " + ref.getEndpointName()
                         + " service: " + ref.getServiceName());
                csuMap.put(ref, csu);
            }
        } catch (JBIException ex) {
            ex.printStackTrace();
        }
View Full Code Here

Examples of javax.jbi.servicedesc.ServiceEndpoint

                    MessageExchange exchange = channel.accept();
                    if (exchange != null) {
                        // REVISIT: serialized message handling not such a
                        // good idea.
                        // REVISIT: can there be more than one ep?
                        ServiceEndpoint ep = exchange.getEndpoint();
                        CeltixServiceUnit csu = suManager.getServiceUnitForEndpoint(ep);
                        ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
                       
                        try {
                            Thread.currentThread().setContextClassLoader(csu.getClassLoader());
View Full Code Here

Examples of javax.jbi.servicedesc.ServiceEndpoint

                // flow is deadlocked
                executor.execute(new Runnable() {
                    public void run() {
                        try {
                            if (me.getDestinationId() == null) {
                                ServiceEndpoint se = me.getEndpoint();
                                se = broker.getContainer().getRegistry().getInternalEndpoint(se.getServiceName(),
                                        se.getEndpointName());
                                me.setEndpoint(se);
                                me.setDestinationId(((InternalEndpoint) se).getComponentNameSpace());
                            }
                            AbstractJMSFlow.super.doRouting(me);
                        } catch (Throwable e) {
View Full Code Here

Examples of javax.jbi.servicedesc.ServiceEndpoint

    }

    protected boolean isClustered(MessageExchange me) {
        MessageExchangeImpl mei = (MessageExchangeImpl) me;
        if (mei.getDestinationId() == null) {
            ServiceEndpoint se = me.getEndpoint();
            if (se instanceof InternalEndpoint) {
                return ((InternalEndpoint) se).isClustered();
                // Unknown: assume this is not clustered
            } else {
                return false;
View Full Code Here

Examples of javax.jbi.servicedesc.ServiceEndpoint

                TransactionManager tm = (TransactionManager) getTransactionManager();
                if (tm != null) {
                    me.setTransactionContext(tm.getTransaction());
                }
                if (me.getDestinationId() == null) {
                    ServiceEndpoint se = me.getEndpoint();
                    se = broker.getContainer().getRegistry().getInternalEndpoint(se.getServiceName(), se.getEndpointName());
                    me.setEndpoint(se);
                    me.setDestinationId(((InternalEndpoint) se).getComponentNameSpace());
                }
                super.doRouting(me);
            }
View Full Code Here

Examples of javax.jbi.servicedesc.ServiceEndpoint

        start();
    }

    public void deactivate() throws Exception {
        stop();
        ServiceEndpoint ep = activated;
        activated = null;
        ComponentContext ctx = getServiceUnit().getComponent().getComponentContext();
        ctx.deactivateEndpoint(ep);
    }
View Full Code Here

Examples of javax.jbi.servicedesc.ServiceEndpoint

    }

    public void testSendingToDynamicEndpoint() throws Exception {
        ServiceMixClient client = new DefaultServiceMixClient(jbi);

        ServiceEndpoint se = client.resolveEndpointReference(dynamicURI);
        assertNotNull("We should find a service endpoint!", se);

        InOnly exchange = client.createInOnlyExchange();
        exchange.setEndpoint(se);
        exchange.getInMessage().setContent(new StringSource("<hello>world</hello>"));
View Full Code Here

Examples of javax.jbi.servicedesc.ServiceEndpoint

    }

    @Override
    protected void configureExchange(ServiceMixClient client,
            MessageExchange exchange) {
        ServiceEndpoint endpoint = client.getContext().getEndpoint(
                CamelJbiEndpoint.SERVICE_NAME, "cheese");
        assertNotNull("Should have a Camel endpoint exposed in JBI!", endpoint);
        exchange.setEndpoint(endpoint);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.