public abstract class AbstractServer extends AbstractEndpoint implements Server, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.BeanFactoryAware
Server implementations.| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_CHANNEL_ID_SUFFIX
Default channel suffix
|
| Constructor and Description |
|---|
AbstractServer()
Default constructor using endpoint configuration.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
Consumer |
createConsumer()
Creates a message consumer for this endpoint.
|
Producer |
createProducer()
Creates a message producer for this endpoint for sending messages
to this endpoint.
|
void |
destroy() |
org.springframework.beans.factory.BeanFactory |
getBeanFactory()
Gets the Spring bean factory.
|
long |
getDefaultTimeout()
Gets the defaultTimeout for sending and receiving messages.
|
EndpointAdapter |
getEndpointAdapter()
Gets the message endpoint adapter.
|
EndpointConfiguration |
getEndpointConfiguration()
Gets the endpoint configuration holding all endpoint specific properties such as
endpoint uri, connection timeout, ports, etc.
|
List<Object> |
getInterceptors()
Gets the handler interceptors.
|
boolean |
isAutoStart()
Gets the autoStart.
|
boolean |
isRunning()
Is server running.
|
void |
join()
Join server thread.
|
void |
run()
Subclasses may overwrite this method in order to add special execution logic.
|
void |
setAutoStart(boolean autoStart)
Enable/disable server auto start
|
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
Sets the Spring bean factory.
|
void |
setDefaultTimeout(long defaultTimeout)
Sets the defaultTimeout for sending and receiving messages..
|
void |
setEndpointAdapter(EndpointAdapter endpointAdapter)
Sets the message endpoint adapter.
|
void |
setInterceptors(List<Object> interceptors)
Sets the handler interceptors.
|
void |
setRunning(boolean running)
Sets the running.
|
protected abstract void |
shutdown()
Subclasses must implement this method called on server shutdown.
|
void |
start()
Start the server
|
protected abstract void |
startup()
Subclasses must implement this method called on server startup.
|
void |
stop()
Stop the server.
|
getActor, getConsumerName, getName, getProducerName, setActor, setBeanName, setNamepublic static final String DEFAULT_CHANNEL_ID_SUFFIX
public AbstractServer()
public void start()
Serverstart in interface ServerServer.start()public void stop()
Serverstop in interface ServerServer.stop()public void run()
protected abstract void startup()
protected abstract void shutdown()
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanExceptionInitializingBean.afterPropertiesSet()public void destroy()
throws Exception
destroy in interface org.springframework.beans.factory.DisposableBeanExceptionDisposableBean.destroy()public void join()
public boolean isRunning()
ServerisRunning in interface ServerServer.isRunning()public EndpointConfiguration getEndpointConfiguration()
EndpointgetEndpointConfiguration in interface EndpointgetEndpointConfiguration in class AbstractEndpointpublic Consumer createConsumer()
EndpointcreateConsumer in interface Endpointpublic Producer createProducer()
EndpointcreateProducer in interface Endpointpublic void setAutoStart(boolean autoStart)
autoStart - the autoStart to setpublic boolean isAutoStart()
public void setRunning(boolean running)
running - the running to setpublic org.springframework.beans.factory.BeanFactory getBeanFactory()
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAwarebeanFactory - public EndpointAdapter getEndpointAdapter()
public void setEndpointAdapter(EndpointAdapter endpointAdapter)
endpointAdapter - public void setInterceptors(List<Object> interceptors)
interceptors - public long getDefaultTimeout()
public void setDefaultTimeout(long defaultTimeout)
defaultTimeout - Copyright © 2008–2015 ConSol* Consulting&Solutions GmbH. All rights reserved.