/** * 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); }