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, setName
public static final String DEFAULT_CHANNEL_ID_SUFFIX
public AbstractServer()
public void start()
Server
start
in interface Server
Server.start()
public void stop()
Server
stop
in interface Server
Server.stop()
public void run()
protected abstract void startup()
protected abstract void shutdown()
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
public void destroy() throws Exception
destroy
in interface org.springframework.beans.factory.DisposableBean
Exception
DisposableBean.destroy()
public void join()
public boolean isRunning()
Server
isRunning
in interface Server
Server.isRunning()
public EndpointConfiguration getEndpointConfiguration()
Endpoint
getEndpointConfiguration
in interface Endpoint
getEndpointConfiguration
in class AbstractEndpoint
public Consumer createConsumer()
Endpoint
createConsumer
in interface Endpoint
public Producer createProducer()
Endpoint
createProducer
in interface Endpoint
public 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.BeanFactoryAware
beanFactory
- 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–2017 ConSol Software GmbH. All rights reserved.