public void endpointAdded(Endpoint endpoint) { log.info("Endpoint : " + endpoint.getName() + " was added " + "to the Synapse configuration successfully"); }
public void destroy() { if (endpoint != null) { endpoint.destroy(); } }
/** * Return the number of ready children for this endpoint * @return the number of ready children for this endpoint * @throws Exception */ public int getReadyChildren() throws Exception { if (endpoint.getChildren() == null) { return 0; } else { int readyCount = 0; for (Endpoint e : endpoint.getChildren()) { if (e.getContext().readyToSend()) { readyCount++; } } return readyCount; } }
public void endpointAdded(Endpoint endpoint) { if (endpoint.getArtifactContainerName() != null) { log.info("Endpoint : " + endpoint.getName() + " was added " + "to the Synapse configuration successfully - " + endpoint.getArtifactContainerName()); } else { log.info("Endpoint : " + endpoint.getName() + " was added " + "to the Synapse configuration successfully"); } }
public double getAvgSizeSent() { if (endpoint.getChildren() != null) { double avgSizeSent = 0; for (Endpoint e : endpoint.getChildren()) { double epValue = e.getMetricsMBean() == null ? 0 : e.getMetricsMBean().getAvgSizeSent(); if (epValue > 0) { avgSizeSent = (avgSizeSent == 0 ? epValue : (avgSizeSent + epValue) / 2); } } return avgSizeSent; } else { return avgSizeSent; } }
/** * Switch on a leaf endpoint, or all endpoints on a group - from maintenance * @throws Exception */ public void switchOn() throws Exception { if (endpoint.getChildren() != null) { for (Endpoint e : endpoint.getChildren()) { if (e.getMetricsMBean() != null) { e.getMetricsMBean().switchOn(); } } } else { if (endpoint.getContext() != null) { endpoint.getContext().switchOn(); } } }
return null; ep.setFileName(new File(fileName).getName()); log.debug("Endpoint: " + ep.getName() + " has been built from the file: " + fileName); ep.init(getSynapseEnvironment()); Endpoint existingEp = getSynapseConfiguration().getDefinedEndpoints().get(existingArtifactName); if (existingArtifactName.equals(ep.getName())) { getSynapseConfiguration().updateEndpoint(existingArtifactName, ep); } else { getSynapseConfiguration().addEndpoint(ep.getName(), ep); getSynapseConfiguration().removeEndpoint(existingArtifactName); log.info("Endpoint: " + existingArtifactName + " has been undeployed"); log.info("Endpoint: " + ep.getName() + " has been updated from the file: " + fileName); existingEp.destroy(); if (existingArtifactName.equals(ep.getName())) { ep.getMetricsMBean(), "Endpoint", ep.getName()); return ep.getName();
public Endpoint getEndpoint(String key) { Object o = localEntries.get(key); if (o != null && o instanceof Endpoint) { return (Endpoint) o; } else { Endpoint e = getConfiguration().getEndpoint(key); if (e != null) { if (!e.isInitialized()) { synchronized (e) { if (!e.isInitialized()) { e.init(synEnv); } } } localEntries.put(key, e); } return e; } }
public OMElement serializeEndpoint(Endpoint epr, SynapseConfiguration synapseConfig, OMElement parent) throws Exception { File eprDir = createDirectory(currentDirectory, MultiXMLConfigurationBuilder.ENDPOINTS_DIR); OMElement eprElem = EndpointSerializer.getElementFromEndpoint(epr); String fileName = epr.getFileName(); if (fileName != null) { if (currentDirectory == rootDirectory) { handleDeployment(eprDir, fileName, epr.getName(), synapseConfig.getArtifactDeploymentStore()); } File eprFile = new File(eprDir, fileName); writeToFile(eprElem, eprFile); } else if (parent != null) { parent.addChild(eprElem); } return eprElem; }
OMElement descriptionElem = epConfig.getFirstChildWithName(DESCRIPTION_Q); if (descriptionElem != null) { ep.setDescription(descriptionElem.getText()); if (anonymousEndpoint && ep.getName() == null) { String uuid = UIDGenerator.generateUID(); uuid = uuid.replace(':', '_'); ep.setName(ENDPOINT_NAME_PREFIX + uuid); if (ep instanceof AbstractEndpoint) { ((AbstractEndpoint) ep).setAnonymous(true); ep.setErrorHandler(onFaultAtt.getAttributeValue());
Endpoint ep = EndpointFactory.getEndpointFromElement(artifactConfig, false, properties); if (ep != null) { ep.setFileName((new File(fileName)).getName()); if (log.isDebugEnabled()) { log.debug("Endpoint named '" + ep.getName() + "' has been built from the file " + fileName); ep.init(getSynapseEnvironment()); if (log.isDebugEnabled()) { log.debug("Initialized the endpoint : " + ep.getName()); getSynapseConfiguration().addEndpoint(ep.getName(), ep); if (log.isDebugEnabled()) { log.debug("Endpoint Deployment from file : " + fileName + " : Completed"); log.info("Endpoint named '" + ep.getName() + "' has been deployed from file : " + fileName); return ep.getName(); } else { handleSynapseArtifactDeploymentError("Endpoint Deployment Failed. The artifact " +
@Override public void undeploySynapseArtifact(String artifactName) { if (log.isDebugEnabled()) { log.debug("Endpoint Undeployment of the endpoint named : " + artifactName + " : Started"); } try { Endpoint ep = getSynapseConfiguration().getDefinedEndpoints().get(artifactName); if (ep != null) { CustomLogSetter.getInstance().setLogAppender((ep != null) ? ep.getArtifactContainerName() : ""); getSynapseConfiguration().removeEndpoint(artifactName); if (log.isDebugEnabled()) { log.debug("Destroying the endpoint named : " + artifactName); } ep.destroy(); if (log.isDebugEnabled()) { log.debug("Endpoint Undeployment of the endpoint named : " + artifactName + " : Completed"); } log.info("Endpoint named '" + ep.getName() + "' has been undeployed"); } else if (log.isDebugEnabled()) { log.debug("Endpoint " + artifactName + " has already been undeployed"); } } catch (Exception e) { handleSynapseArtifactDeploymentError("Endpoint Undeployement of endpoint named : " + artifactName + " : Failed", e); } }
public void init(SynapseEnvironment synapseEnvironment) { if (endpoint != null) { endpoint.init(synapseEnvironment); } }
@Override public void undeploySynapseArtifact(String artifactName) { if (log.isDebugEnabled()) { log.debug("Endpoint Undeployment of the endpoint named : " + artifactName + " : Started"); } try { Endpoint ep = getSynapseConfiguration().getDefinedEndpoints().get(artifactName); if (ep != null) { getSynapseConfiguration().removeEndpoint(artifactName); if (log.isDebugEnabled()) { log.debug("Destroying the endpoint named : " + artifactName); } ep.destroy(); if (log.isDebugEnabled()) { log.debug("Endpoint Undeployment of the endpoint named : " + artifactName + " : Completed"); } log.info("Endpoint named '" + ep.getName() + "' has been undeployed"); } else if (log.isDebugEnabled()) { log.debug("Endpoint " + artifactName + " has already been undeployed"); } } catch (Exception e) { handleSynapseArtifactDeploymentError("Endpoint Undeployement of endpoint named : " + artifactName + " : Failed", e); } }
endpoint.send(synCtx); } else if (endpointRef != null) { ContinuationStackManager.removeReliantContinuationState(synCtx); log.debug("Sending using the endpoint named : " + endpointRef); if (!epr.isInitialized()) { epr.init(synCtx.getEnvironment()); // initializing registry epr.send(synCtx);
protected void serializeCommonAttributes(Endpoint endpoint, OMElement element) { String name = endpoint.getName(); boolean anon = ((AbstractEndpoint) endpoint).isAnonymous(); if (name != null && !anon) { element.addAttribute("name", name, null); } //serialize the message stores String messageStore = endpoint.getErrorHandler(); if (messageStore != null) { element.addAttribute(EndpointFactory.ON_FAULT_Q.getLocalPart(), messageStore, null); } }
public void destroy() { if (target != null) { Endpoint endpoint = target.getEndpoint(); if (endpoint != null && endpoint.isInitialized()) { endpoint.destroy(); } ManagedLifecycle seq = target.getSequence(); if (seq != null) { seq.destroy(); } } } }
@Override public void endpointAdded(Endpoint endpoint) { ArtifactHolder holder = new ArtifactHolder(); holder.setParent(endpoint.getName()); endpoint.setComponentStatisticsId(holder); ((AbstractEndpoint) endpoint).getDefinition().getAspectConfiguration() .setHashCode(holder.getHashCodeAsString()); StatisticIdentityGenerator.conclude(holder); }
@Override public EndpointContext getContext() { return realEndpoint.getContext(); }