org.springframework.integration.endpoint
Class AbstractEndpoint

java.lang.Object
  extended by org.springframework.integration.endpoint.AbstractEndpoint
All Implemented Interfaces:
org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle, ChannelRegistryAware, MessageEndpoint, MessageTarget
Direct Known Subclasses:
SourceEndpoint, TargetEndpoint

public abstract class AbstractEndpoint
extends java.lang.Object
implements MessageEndpoint, org.springframework.beans.factory.BeanNameAware, org.springframework.context.Lifecycle

Base class for MessageEndpoint implementations.

Author:
Mark Fisher

Field Summary
private  boolean autoStartup
           
private  ChannelRegistry channelRegistry
           
private  MessageChannel inputChannel
           
private  java.lang.String inputChannelName
           
private  java.util.List<EndpointInterceptor> interceptors
           
private  java.lang.Object lifecycleMonitor
           
protected  org.apache.commons.logging.Log logger
           
private  java.lang.String name
           
private  MessageChannel outputChannel
           
private  java.lang.String outputChannelName
           
private  boolean running
           
private  Schedule schedule
           
private  EndpointTrigger trigger
           
 
Constructor Summary
AbstractEndpoint()
           
 
Method Summary
 void addInterceptor(EndpointInterceptor interceptor)
           
 void afterPropertiesSet()
           
private  boolean doSend(Message<?> message)
           
protected  ChannelRegistry getChannelRegistry()
           
 MessageChannel getInputChannel()
           
 java.lang.String getInputChannelName()
           
 java.util.List<EndpointInterceptor> getInterceptors()
           
 java.lang.String getName()
           
 MessageChannel getOutputChannel()
           
 java.lang.String getOutputChannelName()
           
 Schedule getSchedule()
           
 EndpointTrigger getTrigger()
           
protected abstract  boolean handleMessage(Message<?> message)
           
protected  void initialize()
           
 boolean isRunning()
           
 boolean send(Message<?> message)
           
private  boolean send(Message<?> message, int index)
           
 void setAutoStartup(boolean autoStartup)
           
 void setBeanName(java.lang.String beanName)
           
 void setChannelRegistry(ChannelRegistry channelRegistry)
          Set the channel registry to use for looking up channels by name.
 void setInputChannel(MessageChannel channel)
           
 void setInputChannelName(java.lang.String inputChannelName)
           
 void setInterceptors(java.util.List<EndpointInterceptor> interceptors)
           
 void setName(java.lang.String name)
           
 void setOutputChannel(MessageChannel outputChannel)
           
 void setOutputChannelName(java.lang.String outputChannelName)
          Set the name of the channel to which this endpoint should send reply messages.
 void setSchedule(Schedule schedule)
           
 void setTrigger(EndpointTrigger trigger)
           
 void start()
           
 void stop()
           
protected abstract  boolean supports(Message<?> message)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.springframework.integration.endpoint.MessageEndpoint
poll
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger

name

private volatile java.lang.String name

inputChannelName

private volatile java.lang.String inputChannelName

inputChannel

private MessageChannel inputChannel

outputChannelName

private volatile java.lang.String outputChannelName

outputChannel

private MessageChannel outputChannel

interceptors

private final java.util.List<EndpointInterceptor> interceptors

schedule

private volatile Schedule schedule

trigger

private volatile EndpointTrigger trigger

channelRegistry

private volatile ChannelRegistry channelRegistry

autoStartup

private volatile boolean autoStartup

running

private volatile boolean running

lifecycleMonitor

private final java.lang.Object lifecycleMonitor
Constructor Detail

AbstractEndpoint

public AbstractEndpoint()
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface MessageEndpoint

setName

public void setName(java.lang.String name)
Specified by:
setName in interface MessageEndpoint

setBeanName

public void setBeanName(java.lang.String beanName)
Specified by:
setBeanName in interface org.springframework.beans.factory.BeanNameAware

setSchedule

public void setSchedule(Schedule schedule)

getSchedule

public Schedule getSchedule()
Specified by:
getSchedule in interface MessageEndpoint

setTrigger

public void setTrigger(EndpointTrigger trigger)

getTrigger

public EndpointTrigger getTrigger()

setInputChannelName

public void setInputChannelName(java.lang.String inputChannelName)

getInputChannelName

public java.lang.String getInputChannelName()
Specified by:
getInputChannelName in interface MessageEndpoint

setInputChannel

public void setInputChannel(MessageChannel channel)

getInputChannel

public MessageChannel getInputChannel()
Specified by:
getInputChannel in interface MessageEndpoint

setOutputChannelName

public void setOutputChannelName(java.lang.String outputChannelName)
Set the name of the channel to which this endpoint should send reply messages.


getOutputChannelName

public java.lang.String getOutputChannelName()
Specified by:
getOutputChannelName in interface MessageEndpoint

setOutputChannel

public void setOutputChannel(MessageChannel outputChannel)

getOutputChannel

public MessageChannel getOutputChannel()
Specified by:
getOutputChannel in interface MessageEndpoint

setChannelRegistry

public void setChannelRegistry(ChannelRegistry channelRegistry)
Set the channel registry to use for looking up channels by name.

Specified by:
setChannelRegistry in interface ChannelRegistryAware

getChannelRegistry

protected ChannelRegistry getChannelRegistry()

setAutoStartup

public void setAutoStartup(boolean autoStartup)

addInterceptor

public void addInterceptor(EndpointInterceptor interceptor)

setInterceptors

public void setInterceptors(java.util.List<EndpointInterceptor> interceptors)

getInterceptors

public java.util.List<EndpointInterceptor> getInterceptors()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

initialize

protected void initialize()

isRunning

public boolean isRunning()
Specified by:
isRunning in interface org.springframework.context.Lifecycle

afterPropertiesSet

public void afterPropertiesSet()
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean

start

public void start()
Specified by:
start in interface org.springframework.context.Lifecycle

stop

public void stop()
Specified by:
stop in interface org.springframework.context.Lifecycle

send

public final boolean send(Message<?> message)
Specified by:
send in interface MessageTarget

send

private boolean send(Message<?> message,
                     int index)

doSend

private boolean doSend(Message<?> message)

supports

protected abstract boolean supports(Message<?> message)

handleMessage

protected abstract boolean handleMessage(Message<?> message)