Package org.citrusframework.server
Class AbstractServer
java.lang.Object
org.citrusframework.endpoint.AbstractEndpoint
org.citrusframework.server.AbstractServer
- All Implemented Interfaces:
Runnable,InitializingPhase,Named,ShutdownPhase,Endpoint,Server,ReferenceResolverAware
public abstract class AbstractServer
extends AbstractEndpoint
implements Server, InitializingPhase, ShutdownPhase, ReferenceResolverAware
Abstract base class for
Server implementations.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()longGets the defaultTimeout for sending and receiving messages.Gets the message endpoint adapter.Gets the handler interceptors.voidbooleanGets the autoStart.booleanGets the debugLogging.booleanvoidjoin()Join server thread.voidrun()Subclasses may overwrite this method in order to add special execution logic.voidsetAutoStart(boolean autoStart) Enable/disable server auto startvoidsetDebugLogging(boolean debugLogging) Sets the debugLogging.voidsetDefaultTimeout(long defaultTimeout) Sets the defaultTimeout for sending and receiving messages..voidsetEndpointAdapter(EndpointAdapter endpointAdapter) Sets the message endpoint adapter.voidsetInterceptors(List<Object> interceptors) Sets the handler interceptors.voidsetReferenceResolver(ReferenceResolver referenceResolver) voidsetRunning(boolean running) Sets the running.protected abstract voidshutdown()Subclasses must implement this method called on server shutdown.voidstart()protected abstract voidstartup()Subclasses must implement this method called on server startup.voidstop()Methods inherited from class org.citrusframework.endpoint.AbstractEndpoint
getActor, getConsumerName, getName, getProducerName, setActor, setName
-
Field Details
-
DEFAULT_CHANNEL_ID_SUFFIX
Default in memory queue suffix- See Also:
-
-
Constructor Details
-
AbstractServer
public AbstractServer()Default constructor using endpoint configuration.
-
-
Method Details
-
start
public void start() -
stop
public void stop() -
run
public void run()Subclasses may overwrite this method in order to add special execution logic. -
startup
protected abstract void startup()Subclasses must implement this method called on server startup. -
shutdown
protected abstract void shutdown()Subclasses must implement this method called on server shutdown. -
initialize
public void initialize()- Specified by:
initializein interfaceInitializingPhase
-
destroy
public void destroy()- Specified by:
destroyin interfaceShutdownPhase
-
join
public void join()Join server thread. -
isRunning
public boolean isRunning() -
getEndpointConfiguration
- Specified by:
getEndpointConfigurationin interfaceEndpoint- Overrides:
getEndpointConfigurationin classAbstractEndpoint
-
createConsumer
- Specified by:
createConsumerin interfaceEndpoint
-
createProducer
- Specified by:
createProducerin interfaceEndpoint
-
setAutoStart
public void setAutoStart(boolean autoStart) Enable/disable server auto start- Parameters:
autoStart- the autoStart to set
-
isAutoStart
public boolean isAutoStart()Gets the autoStart.- Returns:
- the autoStart
-
setRunning
public void setRunning(boolean running) Sets the running.- Parameters:
running- the running to set
-
getReferenceResolver
-
setReferenceResolver
- Specified by:
setReferenceResolverin interfaceReferenceResolverAware
-
getEndpointAdapter
Gets the message endpoint adapter.- Returns:
-
setEndpointAdapter
Sets the message endpoint adapter.- Parameters:
endpointAdapter-
-
getInterceptors
Gets the handler interceptors.- Returns:
-
setInterceptors
Sets the handler interceptors.- Parameters:
interceptors-
-
getDefaultTimeout
public long getDefaultTimeout()Gets the defaultTimeout for sending and receiving messages.- Returns:
-
setDefaultTimeout
public void setDefaultTimeout(long defaultTimeout) Sets the defaultTimeout for sending and receiving messages..- Parameters:
defaultTimeout-
-
setDebugLogging
public void setDebugLogging(boolean debugLogging) Sets the debugLogging.- Parameters:
debugLogging-
-
isDebugLogging
public boolean isDebugLogging()Gets the debugLogging.- Returns:
-