org.apache.synapse.config.xml.endpoints
Class EndpointFactory

java.lang.Object
  extended by org.apache.synapse.config.xml.endpoints.EndpointFactory
All Implemented Interfaces:
XMLToObjectMapper
Direct Known Subclasses:
DefaultEndpointFactory, DynamicLoadbalanceEndpointFactory, FailoverEndpointFactory, IndirectEndpointFactory, LoadbalanceEndpointFactory, SALoadbalanceEndpointFactory

public abstract class EndpointFactory
extends Object
implements XMLToObjectMapper

All endpoint factories should extend from this abstract class. Use EndpointFactory to obtain the correct endpoint for particular endpoint configuration. As endpoints can be nested inside each other, EndpointFactory implementations may call other EndpointFactory implementations recursively to obtain the required endpoint hierarchy.

This also serves as the XMLToObjectMapper implementation for specific endpoint implementations. If the endpoint type is not known use XMLToEndpointMapper as the generic XMLToObjectMapper for all endpoints.


Field Summary
protected static org.apache.commons.logging.Log log
           
 
Constructor Summary
protected EndpointFactory()
           
 
Method Summary
protected abstract  Endpoint createEndpoint(OMElement epConfig, boolean anonymousEndpoint)
          Creates the Endpoint implementation for the given XML endpoint configuration.
protected  void extractCommonEndpointProperties(EndpointDefinition definition, OMElement elem)
          Extracts the QoS information from the XML which represents a WSDL/Address/Default endpoints
protected  void extractSpecificEndpointProperties(EndpointDefinition definition, OMElement elem)
           
static Endpoint getEndpointFromElement(OMElement elem, boolean isAnonymous)
          Core method which is exposed for the external use, and this will find the proper EndpointFactory and create the endpoint which is of the format Endpoint.
protected  ArrayList<Endpoint> getEndpoints(OMElement listEndpointElement, Endpoint parent)
          Helper method to construct children endpoints
 Object getObjectFromOMNode(OMNode om)
          Creates the Endpoint object from the provided OMNode
protected static void handleException(String msg)
           
protected static void handleException(String msg, Exception e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log
Constructor Detail

EndpointFactory

protected EndpointFactory()
Method Detail

getEndpointFromElement

public static Endpoint getEndpointFromElement(OMElement elem,
                                              boolean isAnonymous)
Core method which is exposed for the external use, and this will find the proper EndpointFactory and create the endpoint which is of the format Endpoint.

Parameters:
elem - XML from which the endpoint will be built
isAnonymous - whether this is an anonymous endpoint or not
Returns:
created endpoint

getObjectFromOMNode

public Object getObjectFromOMNode(OMNode om)
Creates the Endpoint object from the provided OMNode

Specified by:
getObjectFromOMNode in interface XMLToObjectMapper
Parameters:
om - XML node from which the endpoint will be built
Returns:
created endpoint as an Object

createEndpoint

protected abstract Endpoint createEndpoint(OMElement epConfig,
                                           boolean anonymousEndpoint)
Creates the Endpoint implementation for the given XML endpoint configuration. If the endpoint configuration is an inline one, it should be an anonymous endpoint. If it is defined as an immediate child element of the definitions tag it should have a name, which is used as the key in local registry.

Parameters:
epConfig - OMElement conatining the endpoint configuration.
anonymousEndpoint - false if the endpoint has a name. true otherwise.
Returns:
Endpoint implementation for the given configuration.

extractCommonEndpointProperties

protected void extractCommonEndpointProperties(EndpointDefinition definition,
                                               OMElement elem)
Extracts the QoS information from the XML which represents a WSDL/Address/Default endpoints

Parameters:
definition - to be filled with the extracted information
elem - XML which represents the endpoint with QoS information

extractSpecificEndpointProperties

protected void extractSpecificEndpointProperties(EndpointDefinition definition,
                                                 OMElement elem)

getEndpoints

protected ArrayList<Endpoint> getEndpoints(OMElement listEndpointElement,
                                           Endpoint parent)
Helper method to construct children endpoints

Parameters:
listEndpointElement - OMElement representing the children endpoints
parent - Parent endpoint
Returns:
List of children endpoints

handleException

protected static void handleException(String msg)

handleException

protected static void handleException(String msg,
                                      Exception e)


Copyright © 2005-2009 Apache Software Foundation. All Rights Reserved.