org.mule.endpoint
Class DefaultEndpointFactory

java.lang.Object
  extended by org.mule.endpoint.DefaultEndpointFactory
All Implemented Interfaces:
MuleContextAware, EndpointFactory

public class DefaultEndpointFactory
extends Object
implements EndpointFactory


Field Summary
static String ENDPOINT_REGISTRY_PREFIX
           
protected static Log logger
          logger used by this class
protected  MuleContext muleContext
           
 
Constructor Summary
DefaultEndpointFactory()
           
 
Method Summary
protected  ImmutableEndpoint getEndpoint(EndpointURI uri, org.mule.endpoint.DefaultEndpointFactory.EndpointSource source)
           
 EndpointBuilder getEndpointBuilder(String uri)
          Used to retrieve the an EndpointBuilder equal to the one would be used to create an endpoint.

This is useful if you need to customize a builder before creation of an endpoint as you can use this method to obtain the endpoint builder, custommize it and then call the factory methods that take a EndpointBuilder rather than a String.
 InboundEndpoint getInboundEndpoint(EndpointBuilder builder)
          Creates an endpoint with the "INBOUND" role using the builder provided.
 InboundEndpoint getInboundEndpoint(EndpointURI uri)
           
 InboundEndpoint getInboundEndpoint(String uri)
          Creates an endpoint with the "INBOUND" role.
 OutboundEndpoint getOutboundEndpoint(EndpointBuilder builder)
          Creates an endpoint with the "OUTBOUND" role using the builder provided.
 OutboundEndpoint getOutboundEndpoint(EndpointURI uri)
           
 OutboundEndpoint getOutboundEndpoint(String uri)
          Creates an endpoint with the "OUTBOUND" role.
protected  EndpointBuilder lookupEndpointBuilder(String endpointName)
           
protected  ImmutableEndpoint registerEndpoint(ImmutableEndpoint endpoint)
           
 void setMuleContext(MuleContext context)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final Log logger
logger used by this class


ENDPOINT_REGISTRY_PREFIX

public static final String ENDPOINT_REGISTRY_PREFIX
See Also:
Constant Field Values

muleContext

protected MuleContext muleContext
Constructor Detail

DefaultEndpointFactory

public DefaultEndpointFactory()
Method Detail

getInboundEndpoint

public InboundEndpoint getInboundEndpoint(String uri)
                                   throws MuleException
Description copied from interface: EndpointFactory
Creates an endpoint with the "INBOUND" role.

The uri parameter can either be a uri, or a (global) endpoint identifier or name.

The InboundEndpoint interface is currently used as the return type but this will be replaces by and more specific interface. SEE MULE-2292

Specified by:
getInboundEndpoint in interface EndpointFactory
Parameters:
uri - endpoint identifier or uri
Returns:
Throws:
MuleException

getOutboundEndpoint

public OutboundEndpoint getOutboundEndpoint(String uri)
                                     throws MuleException
Description copied from interface: EndpointFactory
Creates an endpoint with the "OUTBOUND" role.

The uri parameter can either be a uri, or a (global) endpoint identifier or name.

The OutboundEndpoint interface is currently used as the return type but this will be replaces by and more specific interface. SEE MULE-2292

Specified by:
getOutboundEndpoint in interface EndpointFactory
Parameters:
uri - endpoint identifier or uri
Returns:
Throws:
MuleException

lookupEndpointBuilder

protected EndpointBuilder lookupEndpointBuilder(String endpointName)

getInboundEndpoint

public InboundEndpoint getInboundEndpoint(EndpointBuilder builder)
                                   throws MuleException
Description copied from interface: EndpointFactory
Creates an endpoint with the "INBOUND" role using the builder provided.

Specified by:
getInboundEndpoint in interface EndpointFactory
Returns:
Throws:
MuleException

getOutboundEndpoint

public OutboundEndpoint getOutboundEndpoint(EndpointBuilder builder)
                                     throws MuleException
Description copied from interface: EndpointFactory
Creates an endpoint with the "OUTBOUND" role using the builder provided.

Specified by:
getOutboundEndpoint in interface EndpointFactory
Returns:
Throws:
MuleException

registerEndpoint

protected ImmutableEndpoint registerEndpoint(ImmutableEndpoint endpoint)
                                      throws RegistrationException
Parameters:
endpoint -
Returns:
Throws:
RegistrationException

getEndpointBuilder

public EndpointBuilder getEndpointBuilder(String uri)
                                   throws MuleException
Description copied from interface: EndpointFactory
Used to retrieve the an EndpointBuilder equal to the one would be used to create an endpoint.

This is useful if you need to customize a builder before creation of an endpoint as you can use this method to obtain the endpoint builder, custommize it and then call the factory methods that take a EndpointBuilder rather than a String.

(Of course if you know the uri is a uri rather than a global endpoint identifier you could create your own EndpointURIEndpointBuilder locally, this method allows the uri to be substituted with a global endpoint name and returns it's builder if this is the case. allow the uri parameter to be either a uri or a global endpoint identifier you need this method.

Each and every call to this method, even if it is for the same uri/global endpoint name will return a new EndpoointBuilder instance.

Specified by:
getEndpointBuilder in interface EndpointFactory
Parameters:
uri - endpoint identifier or uri
Returns:
Throws:
MuleException
See Also:
EndpointBuilder, EndpointURIEndpointBuilder

setMuleContext

public void setMuleContext(MuleContext context)
Specified by:
setMuleContext in interface MuleContextAware

getInboundEndpoint

public InboundEndpoint getInboundEndpoint(EndpointURI uri)
                                   throws MuleException
Specified by:
getInboundEndpoint in interface EndpointFactory
Returns:
Throws:
MuleException

getOutboundEndpoint

public OutboundEndpoint getOutboundEndpoint(EndpointURI uri)
                                     throws MuleException
Specified by:
getOutboundEndpoint in interface EndpointFactory
Returns:
Throws:
MuleException

getEndpoint

protected ImmutableEndpoint getEndpoint(EndpointURI uri,
                                        org.mule.endpoint.DefaultEndpointFactory.EndpointSource source)
                                 throws MuleException
Throws:
MuleException


Copyright © 2003-2009 MuleSource, Inc.. All Rights Reserved.