/** * Constructs the Endpoint implementation for the given OMNode. * * @param om OMNode containing endpoint configuration. This should be an OMElement. * @return Endpoint implementation for the given OMNode. */ public Object getObjectFromOMNode(OMNode om, Properties properties) { if (om instanceof OMElement) { OMElement epElement = (OMElement) om; return EndpointFactory.getEndpointFromElement(epElement, false, properties); } else { throw new SynapseException("Configuration is not in proper format."); } } }
/** * Core method which is exposed for the external use, and this will find the proper * {@link EndpointFactory} and create the endpoint which is of the format {@link Endpoint}.However * definition for this endpoint will be built using a custom Endpoint Defn factory. * * @param elem XML from which the endpoint will be built * @param factory custom definition factory which this endpoint will be used to build * @param isAnonymous whether this is an anonymous endpoint or not * @param properties bag of properties to pass in any information to the factory * @return created endpoint */ public static Endpoint getEndpointFromElement(OMElement elem,DefinitionFactory factory, boolean isAnonymous, Properties properties) { EndpointFactory fac = getEndpointFactory(elem); fac.setEndpointDefinitionFactory(factory); return fac.createEndpointWithName(elem, isAnonymous, properties); }
/** * 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; }
/** * Core method which is exposed for the external use, and this will find the proper * {@link EndpointFactory} and create the endpoint which is of the format {@link Endpoint}. * * @param elem XML from which the endpoint will be built * @param isAnonymous whether this is an anonymous endpoint or not * @param properties bag of properties to pass in any information to the factory * @return created endpoint */ public static Endpoint getEndpointFromElement(OMElement elem, boolean isAnonymous, Properties properties) { return getEndpointFactory(elem).createEndpointWithName(elem, isAnonymous, properties); }
/** * Creates the {@link Endpoint} object from the provided {@link OMNode} * * @param om XML node from which the endpoint will be built * @param properties bag of properties to pass in any information to the factory * @return created endpoint as an {@link Object} */ public Object getObjectFromOMNode(OMNode om, Properties properties) { if (om instanceof OMElement) { return createEndpointWithName((OMElement) om, false, properties); } else { handleException("Invalid XML configuration for an Endpoint. OMElement expected"); } return null; }
Properties properties) { Endpoint ep = createEndpoint(epConfig, anonymousEndpoint, properties); OMElement descriptionElem = epConfig.getFirstChildWithName(DESCRIPTION_Q); if (descriptionElem != null) {
handleException("Invalid endpoint configuration.");
/** * Core method which is exposed for the external use, and this will find the proper * {@link EndpointFactory} and create the endpoint which is of the format {@link Endpoint}. * * @param elem XML from which the endpoint will be built * @param isAnonymous whether this is an anonymous endpoint or not * @param properties bag of properties to pass in any information to the factory * @return created endpoint */ public static Endpoint getEndpointFromElement(OMElement elem, boolean isAnonymous, Properties properties) { return getEndpointFactory(elem).createEndpointWithName(elem, isAnonymous, properties); }
/** * Creates the {@link Endpoint} object from the provided {@link OMNode} * * @param om XML node from which the endpoint will be built * @param properties bag of properties to pass in any information to the factory * @return created endpoint as an {@link Object} */ public Object getObjectFromOMNode(OMNode om, Properties properties) { if (om instanceof OMElement) { return createEndpointWithName((OMElement) om, false, properties); } else { handleException("Invalid XML configuration for an Endpoint. OMElement expected"); } return null; }
Properties properties) { Endpoint ep = createEndpoint(epConfig, anonymousEndpoint, properties); OMElement descriptionElem = epConfig.getFirstChildWithName(DESCRIPTION_Q); if (descriptionElem != null) {
handleException("Invalid endpoint configuration.");
/** * Constructs the Endpoint implementation for the given OMNode. * * @param om OMNode containing endpoint configuration. This should be an OMElement. * @return Endpoint implementation for the given OMNode. */ public Object getObjectFromOMNode(OMNode om, Properties properties) { if (om instanceof OMElement) { OMElement epElement = (OMElement) om; return EndpointFactory.getEndpointFromElement(epElement, false, properties); } else { throw new SynapseException("Configuration is not in proper format."); } } }
/** * 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; }
/** * Core method which is exposed for the external use, and this will find the proper * {@link EndpointFactory} and create the endpoint which is of the format {@link Endpoint}.However * definition for this endpoint will be built using a custom Endpoint Defn factory. * * @param elem XML from which the endpoint will be built * @param factory custom definition factory which this endpoint will be used to build * @param isAnonymous whether this is an anonymous endpoint or not * @param properties bag of properties to pass in any information to the factory * @return created endpoint */ public static Endpoint getEndpointFromElement(OMElement elem,DefinitionFactory factory, boolean isAnonymous, Properties properties) { EndpointFactory fac = getEndpointFactory(elem); fac.setEndpointDefinitionFactory(factory); return fac.createEndpointWithName(elem, isAnonymous, properties); }
public Endpoint create(TemplateEndpoint templateEndpoint, Properties properties) { // first go through all the elements and replace with the parameters OMElement clonedElement = element.cloneOMElement(); replaceElement(templateEndpoint, clonedElement); return EndpointFactory.getEndpointFromElement(clonedElement, false, properties); }
public Endpoint create(TemplateEndpoint templateEndpoint, Properties properties) { // first go through all the elements and replace with the parameters OMElement clonedElement = element.cloneOMElement(); replaceElement(templateEndpoint, clonedElement); return EndpointFactory.getEndpointFromElement(clonedElement, false, properties); }
public static Endpoint defineEndpoint(SynapseConfiguration config, OMElement ele, Properties properties) { String name = ele.getAttributeValue(new QName(XMLConfigConstants.NULL_NAMESPACE, "name")); Endpoint endpoint = null; if (name != null) { try { endpoint = EndpointFactory.getEndpointFromElement(ele, false, properties); if (endpoint != null) { config.addEndpoint(name.trim(), endpoint); } } catch (Exception e) { String msg = "Endpoint configuration: " + name + " cannot be built"; handleConfigurationError(SynapseConstants.FAIL_SAFE_MODE_EP, msg, e); } return endpoint; } else { String msg = "Invalid endpoint definition without a name"; handleConfigurationError(SynapseConstants.FAIL_SAFE_MODE_EP, msg); } return null; }
public static Endpoint defineEndpoint(SynapseConfiguration config, OMElement ele, Properties properties) { String name = ele.getAttributeValue(new QName(XMLConfigConstants.NULL_NAMESPACE, "name")); Endpoint endpoint = null; if (name != null) { try { endpoint = EndpointFactory.getEndpointFromElement(ele, false, properties); if (endpoint != null) { config.addEndpoint(name.trim(), endpoint); } } catch (Exception e) { String msg = "Endpoint configuration: " + name + " cannot be built"; handleConfigurationError(SynapseConstants.FAIL_SAFE_MODE_EP, msg, e); } return endpoint; } else { String msg = "Invalid endpoint definition without a name"; handleConfigurationError(SynapseConstants.FAIL_SAFE_MODE_SEQUENCES, msg); } return null; }
Endpoint ep = EndpointFactory.getEndpointFromElement(artifactConfig, false, properties); if (ep != null) { ep.setFileName((new File(fileName)).getName());
Endpoint ep = EndpointFactory.getEndpointFromElement(artifactConfig, false, properties);