protected Endpoint createEndpoint(OMElement epConfig, boolean anonymousEndpoint, Properties properties) { IndirectEndpoint indirectEndpoint = new IndirectEndpoint(); String ref = epConfig.getAttributeValue(new QName("key")); String name = epConfig.getAttributeValue(new QName("name")); if (name != null) { indirectEndpoint.setName(name); } indirectEndpoint.setKey(ref); // process the parameters processProperties(indirectEndpoint, epConfig); return indirectEndpoint; } }
/** * Send by calling to the real endpoint * @param synCtx the message to send */ public void send(MessageContext synCtx) { logSetter(); reLoadAndInitEndpoint(((Axis2MessageContext) synCtx). getAxis2MessageContext().getConfigurationContext()); if (realEndpoint != null) { realEndpoint.send(synCtx); } else { informFailure(synCtx, SynapseConstants.ENDPOINT_IN_DIRECT_NOT_READY, "Couldn't find the endpoint with the key : " + key); } }
public Endpoint getEndpoint(String name){ IndirectEndpoint iep = new IndirectEndpoint(); iep.setKey(name); return iep; } }
protected OMElement serializeEndpoint(Endpoint endpoint) { if (!(endpoint instanceof IndirectEndpoint)) { handleException("Invalid endpoint type."); } fac = OMAbstractFactory.getOMFactory(); OMElement endpointElement = fac.createOMElement("endpoint", SynapseConstants.SYNAPSE_OMNAMESPACE); IndirectEndpoint indirectEndpoint = (IndirectEndpoint) endpoint; String ref = indirectEndpoint.getKey(); if (ref != null) { endpointElement.addAttribute("key", ref, null); } // serialize the parameters serializeProperties(indirectEndpoint, endpointElement); return endpointElement; } }
/** * Send by calling to the real endpoint * @param synCtx the message to send */ public void send(MessageContext synCtx) { reLoadAndInitEndpoint(((Axis2MessageContext) synCtx). getAxis2MessageContext().getConfigurationContext()); if (realEndpoint != null) { realEndpoint.send(synCtx); } else { informFailure(synCtx, SynapseConstants.ENDPOINT_IN_DIRECT_NOT_READY, "Couldn't find the endpoint with the key : " + key); } }
@Override /** * Figure out the real endpoint we proxy for, and make sure its initialized */ public void init(SynapseEnvironment synapseEnvironment) { ConfigurationContext cc = ((Axis2SynapseEnvironment) synapseEnvironment).getAxis2ConfigurationContext(); reLoadAndInitEndpoint(cc); }
endpoint = ((IndirectEndpoint) endpoint).getRealEndpoint(synapseInMsgCtx);
/** * Helper method to construct children endpoints * * @param listEndpointElement OMElement representing the children endpoints * @param parent Parent endpoint * @param properties bag of properties to pass in any information to the factory * @return List of children endpoints */ protected ArrayList<Endpoint> getEndpoints(OMElement listEndpointElement, Endpoint parent, Properties properties) { ArrayList<Endpoint> endpoints = new ArrayList<Endpoint>(); ArrayList<String> keys = new ArrayList<String>(); Iterator iter = listEndpointElement.getChildrenWithName(XMLConfigConstants.ENDPOINT_ELT); while (iter.hasNext()) { OMElement endptElem = (OMElement) iter.next(); Endpoint endpoint = EndpointFactory.getEndpointFromElement(endptElem, true, properties); if (endpoint instanceof IndirectEndpoint) { String key = ((IndirectEndpoint) endpoint).getKey(); if (!keys.contains(key)) { keys.add(key); } else { handleException("Same endpoint definition cannot be used with in the siblings"); } } endpoint.setParentEndpoint(parent); endpoints.add(endpoint); } return endpoints; }
@Override /** * Figure out the real endpoint we proxy for, and make sure its initialized */ public void init(SynapseEnvironment synapseEnvironment) { ConfigurationContext cc = ((Axis2SynapseEnvironment) synapseEnvironment).getAxis2ConfigurationContext(); reLoadAndInitEndpoint(cc); }
protected Endpoint createEndpoint(OMElement epConfig, boolean anonymousEndpoint, Properties properties) { IndirectEndpoint indirectEndpoint = new IndirectEndpoint(); String ref = epConfig.getAttributeValue(new QName("key")); String name = epConfig.getAttributeValue(new QName("name")); if (name != null) { indirectEndpoint.setName(name); } indirectEndpoint.setKey(ref); // process the parameters processProperties(indirectEndpoint, epConfig); return indirectEndpoint; } }
protected OMElement serializeEndpoint(Endpoint endpoint) { if (!(endpoint instanceof IndirectEndpoint)) { handleException("Invalid endpoint type."); } fac = OMAbstractFactory.getOMFactory(); OMElement endpointElement = fac.createOMElement("endpoint", SynapseConstants.SYNAPSE_OMNAMESPACE); IndirectEndpoint indirectEndpoint = (IndirectEndpoint) endpoint; String ref = indirectEndpoint.getKey(); if (ref != null) { endpointElement.addAttribute("key", ref, null); } // serialize the parameters serializeProperties(indirectEndpoint, endpointElement); return endpointElement; } }
/** * Get the real endpoint * * @param synCtx Message Context * @return real endpoint which is referred by the indirect endpoint */ public Endpoint getRealEndpoint(MessageContext synCtx) { reLoadAndInitEndpoint(((Axis2MessageContext) synCtx). getAxis2MessageContext().getConfigurationContext()); return realEndpoint; }
private String getEndpointName(Endpoint endpoint) { if (endpoint == null) { handleException("Endpoint cannot be null."); } assert endpoint != null; String endpointName = endpoint.getName(); if (endpointName == null && endpoint instanceof IndirectEndpoint) { endpointName = ((IndirectEndpoint) endpoint).getKey(); } validateInput(endpointName); return endpointName; }
/** * Get the real endpoint * * @param synCtx Message Context * @return real endpoint which is referred by the indirect endpoint */ public Endpoint getRealEndpoint(MessageContext synCtx) { reLoadAndInitEndpoint(((Axis2MessageContext) synCtx). getAxis2MessageContext().getConfigurationContext()); return realEndpoint; }
/** * Helper method to construct children endpoints * * @param listEndpointElement OMElement representing the children endpoints * @param parent Parent endpoint * @param properties bag of properties to pass in any information to the factory * @return List of children endpoints */ protected ArrayList<Endpoint> getEndpoints(OMElement listEndpointElement, Endpoint parent, Properties properties) { ArrayList<Endpoint> endpoints = new ArrayList<Endpoint>(); ArrayList<String> keys = new ArrayList<String>(); Iterator iter = listEndpointElement.getChildrenWithName(XMLConfigConstants.ENDPOINT_ELT); while (iter.hasNext()) { OMElement endptElem = (OMElement) iter.next(); Endpoint endpoint = EndpointFactory.getEndpointFromElement(endptElem, true, properties); if (endpoint instanceof IndirectEndpoint) { String key = ((IndirectEndpoint) endpoint).getKey(); if (!keys.contains(key)) { keys.add(key); } else { handleException("Same endpoint definition cannot be used with in the siblings"); } } endpoint.setParentEndpoint(parent); endpoints.add(endpoint); } return endpoints; }
private String getEndpointName(Endpoint endpoint) { if (endpoint == null) { handleException("Endpoint cannot be null."); } assert endpoint != null; String endpointName = endpoint.getName(); if (endpointName == null && endpoint instanceof IndirectEndpoint) { endpointName = ((IndirectEndpoint) endpoint).getKey(); } validateInput(endpointName); return endpointName; }
public void setComponentStatisticsId(ArtifactHolder holder) { if (this instanceof IndirectEndpoint) { String sequenceId = StatisticIdentityGenerator .getIdReferencingComponent(((IndirectEndpoint) (this)).getKey(), ComponentType.ENDPOINT, holder); StatisticIdentityGenerator.reportingEndEvent(sequenceId, ComponentType.ENDPOINT, holder); } else { if (definition == null) { EndpointDefinition definition = new EndpointDefinition(); this.setDefinition(definition); } if (definition.getAspectConfiguration() == null) { definition.configure(new AspectConfiguration(getReportingName())); } String sequenceId = StatisticIdentityGenerator.getIdForComponent(getReportingName(), ComponentType.ENDPOINT, holder); definition.getAspectConfiguration().setUniqueId(sequenceId); StatisticIdentityGenerator.reportingEndEvent(sequenceId, ComponentType.ENDPOINT, holder); } } }
String endpointKey = ((IndirectEndpoint) endpoint).getKey(); endpoint = synapseInMsgCtx.getEndpoint(endpointKey);