@Override /** * Ready to send, if the real endpoint is ready */ public boolean readyToSend() { return realEndpoint.readyToSend(); }
@Override /** * Ready to send, if the real endpoint is ready */ public boolean readyToSend() { try { return realEndpoint.readyToSend(); } catch (NullPointerException e) { log.info("Could not find endpoint with key " + this.key + ". Could not verify Endpoint ready to send status."); return false; } }
public boolean readyToSend() { for (Endpoint endpoint : getChildren()) { if (endpoint.readyToSend()) { currentEndpoint = endpoint; return true; } } return false; }
public boolean readyToSend() { if (realEndpoint != null && realEndpoint.readyToSend()) { if (log.isDebugEnabled()) { log.debug("Template Endpoint" + this.toString() + " is at ready state"); } return true; } log.warn("Template Endpoint " + this.toString() + " is not in a ready state to process message"); return false; } }
@Override public boolean readyToSend(){ for(Endpoint endpoint : getChildren()){ if(endpoint.readyToSend()){ if (log.isDebugEnabled()) { log.debug("Recipient List " + this.toString() + " has at least one endpoint at ready state"); } return true; } } return false; }
public boolean readyToSend() { if (realEndpoint != null && realEndpoint.readyToSend()) { if (log.isDebugEnabled()) { log.debug("Template Endpoint" + this.toString() + " is at ready state"); } return true; } if (log.isDebugEnabled()) { log.debug("Template Endpoint " + this.toString() + " is not in a ready state to process message"); } return false; }
/** * If this endpoint is in inactive state, checks if all immediate child endpoints are still * failed. If so returns false. If at least one child endpoint is in active state, sets this * endpoint's state to active and returns true. As this a sessionless load balancing endpoint * having one active child endpoint is enough to consider this as active. * * @return true if active. false otherwise. */ public boolean readyToSend() { for (Endpoint endpoint : getChildren()) { if (endpoint.readyToSend()) { if (log.isDebugEnabled()) { log.debug("Load-balance " + this.toString() + " has at least one endpoint at ready state"); } return true; } } log.warn("Load-balance " + this.toString() + " has no endpoints at ready state to process message"); return false; }
/** * Choose an active endpoint using the round robin algorithm. If there are no active endpoints * available, returns null. * * @param synCtx MessageContext instance which holds all per-message properties * @param algorithmContext The context in which holds run time states related to the algorithm * @return endpoint to send the next message */ public Endpoint getNextEndpoint(MessageContext synCtx, AlgorithmContext algorithmContext) { Endpoint nextEndpoint; int attempts = 0; synchronized (algorithmContext) { int currentEPR = algorithmContext.getCurrentEndpointIndex(); do { // two successive clients could get the same endpoint if not synchronized. nextEndpoint = (Endpoint) endpoints.get(currentEPR); if (currentEPR == endpoints.size() - 1) { currentEPR = 0; } else { currentEPR++; } algorithmContext.setCurrentEndpointIndex(currentEPR); attempts++; if (attempts > endpoints.size()) { return null; } } while (!nextEndpoint.readyToSend()); } return nextEndpoint; }
/** * Choose an active endpoint using the round robin algorithm. If there are no active endpoints * available, returns null. * * @param synCtx MessageContext instance which holds all per-message properties * @param algorithmContext The context in which holds run time states related to the algorithm * @return endpoint to send the next message */ public Endpoint getNextEndpoint(MessageContext synCtx, AlgorithmContext algorithmContext) { Endpoint nextEndpoint; int attempts = 0; synchronized (algorithmContext) { int currentEPR = algorithmContext.getCurrentEndpointIndex(); do { // two successive clients could get the same endpoint if not synchronized. nextEndpoint = (Endpoint) endpoints.get(currentEPR); if (currentEPR == endpoints.size() - 1) { currentEPR = 0; } else { currentEPR++; } algorithmContext.setCurrentEndpointIndex(currentEPR); attempts++; if (attempts > endpoints.size()) { return null; } } while (!nextEndpoint.readyToSend()); } return nextEndpoint; }
public boolean readyToSend() { if (getContext().isState(EndpointContext.ST_OFF)) { return false; } for (Endpoint endpoint : getChildren()) { if (endpoint.readyToSend()) { currentEndpoint = endpoint; return true; } } return false; }
@Override public boolean readyToSend(){ if (getContext().isState(EndpointContext.ST_OFF)) { return false; } for(Endpoint endpoint : getChildren()){ if(endpoint.readyToSend()){ if (log.isDebugEnabled()) { log.debug("Recipient List " + this.toString() + " has at least one endpoint at ready state"); } return true; } } return false; }
if (endpoint != null && endpoint.readyToSend()) { if (log.isDebugEnabled()) { log.debug("Using the endpoint " + endpoint + " for sending the message");
if (endpoint != null && endpoint.readyToSend()) { if (log.isDebugEnabled()) { log.debug("Using the endpoint " + endpoint + " for sending the message");
/** * If this endpoint is in inactive state, checks if all immediate child endpoints are still * failed. If so returns false. If at least one child endpoint is in active state, sets this * endpoint's state to active and returns true. As this a sessionless load balancing endpoint * having one active child endpoint is enough to consider this as active. * * @return true if active. false otherwise. */ public boolean readyToSend() { if (getContext().isState(EndpointContext.ST_OFF)) { return false; } for (Endpoint endpoint : getChildren()) { if (endpoint.readyToSend()) { if (log.isDebugEnabled()) { log.debug("Load-balance " + this.toString() + " has at least one endpoint at ready state"); } return true; } } log.warn("Load-balance " + this.toString() + " has no endpoints at ready state to process message"); return false; }
boolean foundEndpoint = false; for (Endpoint childEndpoint : children) { if (childEndpoint.readyToSend()) { foundEndpoint = true; MessageContext newCtx;
if (endpoint.readyToSend()) { foundEndpoint = true; if (isARetry && metricsMBean != null) { if (currentEndpoint.readyToSend()) { if (isARetry && metricsMBean != null) { metricsMBean.reportSendingFault(SynapseConstants.ENDPOINT_FO_FAIL_OVER); boolean foundEndpoint = false; for (Endpoint endpoint : getChildren()) { if (endpoint.readyToSend()) { foundEndpoint = true; currentEndpoint = endpoint;
if (childEndpoint.readyToSend()) { foundEndpoint = true; MessageContext newCtx = null;
if (endpoint.readyToSend()) { foundEndpoint = true; if (isARetry && metricsMBean != null) { if (currentEndpoint.readyToSend()) { if (isARetry && metricsMBean != null) { metricsMBean.reportSendingFault(SynapseConstants.ENDPOINT_FO_FAIL_OVER); boolean foundEndpoint = false; for (Endpoint endpoint : getChildren()) { if (endpoint.readyToSend()) { foundEndpoint = true; currentEndpoint = endpoint;