org.apache.servicemix.eip
Class EIPEndpoint

java.lang.Object
  extended by org.apache.servicemix.common.endpoints.AbstractEndpoint
      extended by org.apache.servicemix.common.endpoints.SimpleEndpoint
          extended by org.apache.servicemix.common.endpoints.ProviderEndpoint
              extended by org.apache.servicemix.eip.EIPEndpoint
All Implemented Interfaces:
Endpoint
Direct Known Subclasses:
AbstractAggregator, AbstractContentBasedRouter, AbstractSplitter, AsyncBridge, ContentEnricher, MessageFilter, Pipeline, ResequencerBase, StaticRecipientList, StaticRoutingSlip, WireTap

public abstract class EIPEndpoint
extends ProviderEndpoint

Version:
$Revision: 376451 $
Author:
gnodet

Field Summary
protected  LockManager lockManager
          The lock manager.
protected  org.apache.servicemix.store.Store store
          The store to keep pending exchanges
protected  org.apache.servicemix.store.StoreFactory storeFactory
          The store factory.
protected  org.apache.servicemix.timers.TimerManager timerManager
          The timer manager.
protected  ExchangeTarget wsdlExchangeTarget
          The ExchangeTarget to use to get the WSDL
protected  org.springframework.core.io.Resource wsdlResource
          The resource pointing to the WSDL for this endpoint
 
Fields inherited from class org.apache.servicemix.common.endpoints.SimpleEndpoint
logger
 
Fields inherited from class org.apache.servicemix.common.endpoints.AbstractEndpoint
definition, description, endpoint, interfaceName, service, serviceUnit
 
Constructor Summary
EIPEndpoint()
           
 
Method Summary
protected  javax.jbi.servicedesc.ServiceEndpoint chooseFirstEndpointWithDescriptor(javax.jbi.servicedesc.ServiceEndpoint[] endpoints)
           
protected  void copyAttachments(javax.jbi.messaging.NormalizedMessage from, javax.jbi.messaging.NormalizedMessage to)
          Copies attachments from one message to another that do not already exist
protected  void copyProperties(javax.jbi.messaging.NormalizedMessage from, javax.jbi.messaging.NormalizedMessage to)
          Copies properties from one message to another that do not already exist
 javax.wsdl.Definition getDefinition()
          If the definition is not currently set, it tries to set it using the following sources in the order: description, wsdlResource, wsdlExchangeTarget
protected  javax.wsdl.Definition getDefinitionFromDescription()
           
protected  javax.wsdl.Definition getDefinitionFromWsdlExchangeTarget()
           
protected  javax.wsdl.Definition getDefinitionFromWsdlResource()
           
 org.w3c.dom.Document getDescription()
           
protected  org.w3c.dom.Document getDescriptionForExchangeTarget(ExchangeTarget match)
           
protected  javax.jbi.servicedesc.ServiceEndpoint[] getEndpointsForExchangeTarget(ExchangeTarget match)
           
 LockManager getLockManager()
          The lock manager to use for this endpoint.
 org.apache.servicemix.store.Store getStore()
           
 org.apache.servicemix.store.StoreFactory getStoreFactory()
           
 org.apache.servicemix.timers.TimerManager getTimerManager()
           
 ExchangeTarget getWsdlExchangeTarget()
           
 org.springframework.core.io.Resource getWsdlResource()
           
 void process(javax.jbi.messaging.MessageExchange exchange)
           
protected abstract  void processAsync(javax.jbi.messaging.MessageExchange exchange)
           
protected abstract  void processSync(javax.jbi.messaging.MessageExchange exchange)
           
 void setLockManager(LockManager lockManager)
           
 void setStore(org.apache.servicemix.store.Store store)
          Configure the store to use.
 void setStoreFactory(org.apache.servicemix.store.StoreFactory storeFactory)
          The store factory to use when creating a store.
 void setTimerManager(org.apache.servicemix.timers.TimerManager timerManager)
          The timer manager to use for this endpoint.
 void setWsdlExchangeTarget(ExchangeTarget wsdlExchangeTarget)
          An exchange target pointing to a JBI endpoint that will be used to load the WSDL describing this endpoint.
 void setWsdlResource(org.springframework.core.io.Resource wsdlResource)
          When specified, this spring resource will be used to load the WSDL that will be exposed as a description for this endpoint.
 void start()
           
 void stop()
           
 
Methods inherited from class org.apache.servicemix.common.endpoints.ProviderEndpoint
activate, deactivate, getRole, processInOnly, processInOut
 
Methods inherited from class org.apache.servicemix.common.endpoints.SimpleEndpoint
done, fail, getChannel, getContext, getExchangeFactory, send, sendSync
 
Methods inherited from class org.apache.servicemix.common.endpoints.AbstractEndpoint
getEndpoint, getInterfaceName, getKey, getService, getServiceUnit, isExchangeOkay, prepareExchange, setDefinition, setDescription, setEndpoint, setInterfaceName, setService, setServiceUnit, toString, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

wsdlResource

protected org.springframework.core.io.Resource wsdlResource
The resource pointing to the WSDL for this endpoint


store

protected org.apache.servicemix.store.Store store
The store to keep pending exchanges


storeFactory

protected org.apache.servicemix.store.StoreFactory storeFactory
The store factory.


lockManager

protected LockManager lockManager
The lock manager.


timerManager

protected org.apache.servicemix.timers.TimerManager timerManager
The timer manager.


wsdlExchangeTarget

protected ExchangeTarget wsdlExchangeTarget
The ExchangeTarget to use to get the WSDL

Constructor Detail

EIPEndpoint

public EIPEndpoint()
Method Detail

getStore

public org.apache.servicemix.store.Store getStore()
Returns:
Returns the store.

setStore

public void setStore(org.apache.servicemix.store.Store store)
Configure the store to use. If none is explicitely configured, the storeFactory will be used to create one.

Parameters:
store - The store to set.

getStoreFactory

public org.apache.servicemix.store.StoreFactory getStoreFactory()
Returns:
Returns the storeFactory.

setStoreFactory

public void setStoreFactory(org.apache.servicemix.store.StoreFactory storeFactory)
The store factory to use when creating a store. If no factory is explicitely defined, an in-memory only factory will be created.

Parameters:
storeFactory - The storeFactory to set.

getLockManager

public LockManager getLockManager()
The lock manager to use for this endpoint. If none is explicitely specified a default implementation will be provided.

Returns:
the lockManager

setLockManager

public void setLockManager(LockManager lockManager)
Parameters:
lockManager - the lockManager to set

getTimerManager

public org.apache.servicemix.timers.TimerManager getTimerManager()
Returns:
the timerManager

setTimerManager

public void setTimerManager(org.apache.servicemix.timers.TimerManager timerManager)
The timer manager to use for this endpoint. If none is explicitely configured, a default implementation will be provided.

Parameters:
timerManager - the timerManager to set

start

public void start()
           throws java.lang.Exception
Specified by:
start in interface Endpoint
Overrides:
start in class SimpleEndpoint
Throws:
java.lang.Exception

stop

public void stop()
          throws java.lang.Exception
Specified by:
stop in interface Endpoint
Overrides:
stop in class SimpleEndpoint
Throws:
java.lang.Exception

process

public void process(javax.jbi.messaging.MessageExchange exchange)
             throws java.lang.Exception
Specified by:
process in interface Endpoint
Overrides:
process in class ProviderEndpoint
Throws:
java.lang.Exception

getDescription

public org.w3c.dom.Document getDescription()
Specified by:
getDescription in interface Endpoint
Overrides:
getDescription in class AbstractEndpoint
Returns:
Returns the description.

getDefinition

public javax.wsdl.Definition getDefinition()
If the definition is not currently set, it tries to set it using the following sources in the order: description, wsdlResource, wsdlExchangeTarget

Overrides:
getDefinition in class AbstractEndpoint
Returns:
Returns the definition.

getDefinitionFromDescription

protected javax.wsdl.Definition getDefinitionFromDescription()

getDefinitionFromWsdlResource

protected javax.wsdl.Definition getDefinitionFromWsdlResource()

getDefinitionFromWsdlExchangeTarget

protected javax.wsdl.Definition getDefinitionFromWsdlExchangeTarget()

getWsdlResource

public org.springframework.core.io.Resource getWsdlResource()
Returns:
Returns the wsdl's Resource.

setWsdlResource

public void setWsdlResource(org.springframework.core.io.Resource wsdlResource)
When specified, this spring resource will be used to load the WSDL that will be exposed as a description for this endpoint. This property can be used to explicitely define the WSDL to be exposed by this endpoint. This property takes precedence over the wsdlExchangeTarget property.

Parameters:
wsdlResource -

getDescriptionForExchangeTarget

protected org.w3c.dom.Document getDescriptionForExchangeTarget(ExchangeTarget match)
                                                        throws javax.jbi.JBIException
Throws:
javax.jbi.JBIException

getEndpointsForExchangeTarget

protected javax.jbi.servicedesc.ServiceEndpoint[] getEndpointsForExchangeTarget(ExchangeTarget match)
                                                                         throws javax.jbi.JBIException
Parameters:
match -
Returns:
an ServiceEndpoint[] of all the endpoints that matched.
Throws:
javax.jbi.JBIException

chooseFirstEndpointWithDescriptor

protected javax.jbi.servicedesc.ServiceEndpoint chooseFirstEndpointWithDescriptor(javax.jbi.servicedesc.ServiceEndpoint[] endpoints)
                                                                           throws javax.jbi.JBIException
Throws:
javax.jbi.JBIException

processAsync

protected abstract void processAsync(javax.jbi.messaging.MessageExchange exchange)
                              throws java.lang.Exception
Throws:
java.lang.Exception

processSync

protected abstract void processSync(javax.jbi.messaging.MessageExchange exchange)
                             throws java.lang.Exception
Throws:
java.lang.Exception

getWsdlExchangeTarget

public ExchangeTarget getWsdlExchangeTarget()

setWsdlExchangeTarget

public void setWsdlExchangeTarget(ExchangeTarget wsdlExchangeTarget)
An exchange target pointing to a JBI endpoint that will be used to load the WSDL describing this endpoint. This can be used when the endpoint proxies another endpoint so that the same WSDL definition will be exposed."


copyProperties

protected void copyProperties(javax.jbi.messaging.NormalizedMessage from,
                              javax.jbi.messaging.NormalizedMessage to)
Copies properties from one message to another that do not already exist

Parameters:
from - the message containing the properties
to - the destination message where the properties are set

copyAttachments

protected void copyAttachments(javax.jbi.messaging.NormalizedMessage from,
                               javax.jbi.messaging.NormalizedMessage to)
                        throws javax.jbi.messaging.MessagingException
Copies attachments from one message to another that do not already exist

Parameters:
from - the message with the attachments
to - the destination message where the attachments are to be added
Throws:
javax.jbi.messaging.MessagingException - if an attachment could not be added


Copyright © 2005-2011 FuseSource. All Rights Reserved.