Package org.citrusframework.server
Class AbstractServer
java.lang.Object
org.citrusframework.endpoint.AbstractEndpoint
org.citrusframework.server.AbstractServer
- All Implemented Interfaces:
Runnable,org.citrusframework.common.InitializingPhase,org.citrusframework.common.Named,org.citrusframework.common.ShutdownPhase,org.citrusframework.endpoint.Endpoint,org.citrusframework.server.Server,org.citrusframework.server.ServerEndpoint,org.citrusframework.spi.ReferenceResolverAware
public abstract class AbstractServer
extends AbstractEndpoint
implements org.citrusframework.server.ServerEndpoint, org.citrusframework.common.InitializingPhase, org.citrusframework.common.ShutdownPhase, org.citrusframework.spi.ReferenceResolverAware
Abstract base class for
Server implementations.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.citrusframework.messaging.Consumerorg.citrusframework.messaging.Producervoiddestroy()longGets the defaultTimeout for sending and receiving messages.org.citrusframework.endpoint.EndpointAdapterGets the message endpoint adapter.org.citrusframework.endpoint.EndpointConfigurationGets the handler interceptors.org.citrusframework.spi.ReferenceResolvervoidbooleanGets 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(org.citrusframework.endpoint.EndpointAdapter endpointAdapter) Sets the message endpoint adapter.voidsetInterceptors(List<Object> interceptors) Sets the handler interceptors.voidsetReferenceResolver(org.citrusframework.spi.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, setNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.citrusframework.endpoint.Endpoint
getActor, getName, setActorMethods inherited from interface org.citrusframework.common.Named
setNameMethods inherited from interface org.citrusframework.server.Server
getName
-
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()- Specified by:
startin interfaceorg.citrusframework.server.Server
-
stop
public void stop()- Specified by:
stopin interfaceorg.citrusframework.server.Server
-
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 interfaceorg.citrusframework.common.InitializingPhase
-
destroy
public void destroy()- Specified by:
destroyin interfaceorg.citrusframework.common.ShutdownPhase
-
join
public void join()Join server thread. -
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceorg.citrusframework.server.Server
-
getEndpointConfiguration
public org.citrusframework.endpoint.EndpointConfiguration getEndpointConfiguration()- Specified by:
getEndpointConfigurationin interfaceorg.citrusframework.endpoint.Endpoint- Overrides:
getEndpointConfigurationin classAbstractEndpoint
-
createConsumer
public org.citrusframework.messaging.Consumer createConsumer()- Specified by:
createConsumerin interfaceorg.citrusframework.endpoint.Endpoint
-
createProducer
public org.citrusframework.messaging.Producer createProducer()- Specified by:
createProducerin interfaceorg.citrusframework.endpoint.Endpoint
-
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
public org.citrusframework.spi.ReferenceResolver getReferenceResolver() -
setReferenceResolver
public void setReferenceResolver(org.citrusframework.spi.ReferenceResolver referenceResolver) - Specified by:
setReferenceResolverin interfaceorg.citrusframework.spi.ReferenceResolverAware
-
getEndpointAdapter
public org.citrusframework.endpoint.EndpointAdapter getEndpointAdapter()Gets the message endpoint adapter.- Returns:
-
setEndpointAdapter
public void setEndpointAdapter(org.citrusframework.endpoint.EndpointAdapter endpointAdapter) 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:
-