public boolean readyToSend() { if (!initialized) { //can't send to a non-initialized endpoint. This is a program fault throw new IllegalStateException("not initialized, " + "endpoint must be in initialized state"); } return context != null && context.readyToSend(); }
/** * Endpoint has processed a message successfully */ public void onSuccess() { if (isClustered) { Integer state = (Integer) cfgCtx.getPropertyNonReplicable(STATE_KEY); if ((state != null) && ((state != ST_ACTIVE) && (state != ST_OFF))) { log.info("Endpoint : " + endpointName + printEndpointAddress() + " currently " + getStateAsString() + " will now be marked active since it processed its last message"); setState(ST_ACTIVE); } } else { if (localState != ST_ACTIVE && localState != ST_OFF) { log.info("Endpoint : " + endpointName + printEndpointAddress() + " currently " + getStateAsString() + " will now be marked active since it processed its last message"); setState(ST_ACTIVE); } } }
public void onSuccess() { getContext().onSuccess(); }
/** * Endpoint failed processing a message */ public void onFault() { log.warn("Endpoint : " + endpointName + printEndpointAddress() + " will be marked SUSPENDED as it failed"); setState(ST_SUSPENDED); }
/** * Endpoint has processed a message successfully */ public void onSuccess() { if (isClustered) { Integer state = (Integer) cfgCtx.getPropertyNonReplicable(STATE_KEY); if ((state != null) && ((state != ST_ACTIVE) && (state != ST_OFF))) { log.info("Endpoint : " + endpointName + " currently " + getStateAsString() + " will now be marked active since it processed its last message"); setState(ST_ACTIVE); } } else { if (localState != ST_ACTIVE && localState != ST_OFF) { log.info("Endpoint : " + endpointName + " currently " + getStateAsString() + " will now be marked active since it processed its last message"); setState(ST_ACTIVE); } } }
@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; }
public void onFault(MessageContext synCtx) { // is this really a fault or a timeout/connection close etc? if (isTimeout(synCtx)) { getContext().onTimeout(); } else if (isSuspendFault(synCtx)) { getContext().onFault(); } // this should be an ignored error if we get here setErrorOnMessage(synCtx, null, null); super.onFault(synCtx); }
recordStatistics(state); log.info("Endpoint : " + endpointName + printEndpointAddress() + " has been marked for SUSPENSION," + " but no further retries remain. Thus it will be SUSPENDED."); setState(ST_SUSPENDED); log.warn("Endpoint : " + endpointName + printEndpointAddress() + " is marked as TIMEOUT and " + "will be retried : " + (retries - 1) + " more time/s after : " + computeNextRetryTimeForSuspended(); break; log.info("Endpoint : " + endpointName + printEndpointAddress() + " has been marked for SUSPENSION, " + "but no further retries remain. Thus it will be SUSPENDED."); setState(ST_SUSPENDED); log.warn("Endpoint : " + endpointName + printEndpointAddress() + " is marked as TIMEOUT and " + "will be retried : " + localRemainingRetries + " more time/s " + computeNextRetryTimeForSuspended(); break;
recordStatistics(state); " but no further retries remain. Thus it will be SUSPENDED."); setState(ST_SUSPENDED); computeNextRetryTimeForSuspended(); break; + "but no further retries remain. Thus it will be SUSPENDED."); setState(ST_SUSPENDED); computeNextRetryTimeForSuspended(); break;
log.debug("Checking if endpoint : " + endpointName + printEndpointAddress() + " currently at state " + getStateAsString() + " can be used now?"); log.debug("Endpoint : " + endpointName + printEndpointAddress() + " which is currently in " + "timeout state is ready to be retried. Remaining retries " + log.debug("Endpoint : " + endpointName + printEndpointAddress() + " which is currently " + "SUSPENDED, is ready to be retried now"); log.debug("Endpoint : " + endpointName + printEndpointAddress() + " which is currently in timeout " + "state is ready to be retried. Remaining retries before " + log.debug("Endpoint : " + endpointName + printEndpointAddress() + " which is currently SUSPENDED," + " is ready to be retried now"); log.debug("Endpoint : " + endpointName + printEndpointAddress() + " not ready and is currently : " + getStateAsString() + ". Next retry will be after : " + new Date(localNextRetryTime));
public String toString() { StringBuffer sb = new StringBuffer(); sb.append("[ Name : ").append(endpointName). append(" ] [ State : ").append(getStateAsString()).append(" ]"); return sb.toString(); } }
public void init(SynapseEnvironment synapseEnvironment) { ConfigurationContext cc = ((Axis2SynapseEnvironment) synapseEnvironment).getAxis2ConfigurationContext(); if (!initialized) { // The check for clustering environment ClusteringAgent clusteringAgent = cc.getAxisConfiguration().getClusteringAgent(); if (clusteringAgent != null && clusteringAgent.getStateManager() != null) { isClusteringEnabled = Boolean.TRUE; } else { isClusteringEnabled = Boolean.FALSE; } context = new EndpointContext(getName(), getDefinition(), isClusteringEnabled, cc, metricsMBean); } initialized = true; if (children != null) { for (Endpoint e : children) { e.init(synapseEnvironment); } } contentAware = definition != null && ((definition.getFormat() != null && !definition.getFormat().equals(SynapseConstants.FORMAT_REST)) || definition.isSecurityOn() || definition.isAddressingOn()); }
if (endpointDefinition != null && !endpointDefinition.isReplicationDisabled()) { handleException("For proper clustered mode operation, all endpoints should " + "be uniquely named");
log.warn("Suspending endpoint : " + endpointName + printEndpointAddress() + (notYetSuspended ? " -" : " - last suspend duration was : " + lastSuspendDuration + "ms and") +
public boolean readyToSend() { if (getContext().isState(EndpointContext.ST_OFF)) { return false; } for (Endpoint endpoint : getChildren()) { if (endpoint.readyToSend()) { currentEndpoint = endpoint; return true; } } return false; }
public void onFault(MessageContext synCtx) { // is this really a fault or a timeout/connection close etc? if (isTimeout(synCtx)) { getContext().onTimeout(); } else if (isSuspendFault(synCtx)) { getContext().onFault(); } // this should be an ignored error if we get here setErrorOnMessage(synCtx, null, null); super.onFault(synCtx); }
/** * Activate this endpoint manually (i.e. from an automatic suspend or manual switch off) */ public void switchOn() { log.info("Manually activating endpoint : " + endpointName + printEndpointAddress()); setState(ST_ACTIVE); }
public String toString() { StringBuffer sb = new StringBuffer(); sb.append("[ Name : ").append(endpointName). append(" ] [ State : ").append(getStateAsString()).append(" ]"); return sb.toString(); }
public void init(SynapseEnvironment synapseEnvironment) { ConfigurationContext cc = ((Axis2SynapseEnvironment) synapseEnvironment).getAxis2ConfigurationContext(); if (!initialized) { // The check for clustering environment ClusteringAgent clusteringAgent = cc.getAxisConfiguration().getClusteringAgent(); if (clusteringAgent != null && clusteringAgent.getStateManager() != null) { isClusteringEnabled = Boolean.TRUE; } else { isClusteringEnabled = Boolean.FALSE; } context = new EndpointContext(getName(), getDefinition(), isClusteringEnabled, cc, metricsMBean); } initialized = true; if (children != null) { for (Endpoint e : children) { e.init(synapseEnvironment); } } contentAware = definition != null && ((definition.getFormat() != null && !definition.getFormat().equals(SynapseConstants.FORMAT_REST)) || definition.isSecurityOn() || definition.isReliableMessagingOn() || definition.isAddressingOn() || definition.isUseMTOM()|| definition.isUseSwa()); }
if (endpointDefinition != null && !endpointDefinition.isReplicationDisabled()) { handleException("For proper clustered mode operation, all endpoints should " + "be uniquely named");