com.consol.citrus.server
Class AbstractServer

java.lang.Object
  extended by com.consol.citrus.server.AbstractServer
All Implemented Interfaces:
Server, Runnable, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean
Direct Known Subclasses:
ActiveMQServer, CitrusSshServer, HttpServer, JettyServer

public abstract class AbstractServer
extends Object
implements Server, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.BeanNameAware

Abstract base class for Server implementations.

Author:
Christoph Deppisch

Constructor Summary
AbstractServer()
           
 
Method Summary
 void afterPropertiesSet()
           
 void destroy()
           
 String getName()
          Get server name.
 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 setBeanName(String name)
           
 void setName(String name)
          Sets the name.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractServer

public AbstractServer()
Method Detail

start

public void start()
Description copied from interface: Server
Start the server

Specified by:
start in interface Server
See Also:
Server.start()

stop

public void stop()
Description copied from interface: Server
Stop the server.

Specified by:
stop in interface Server
See Also:
Server.stop()

run

public void run()
Subclasses may overwrite this method in order to add special execution logic.

Specified by:
run in interface Runnable

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.


afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception
See Also:
InitializingBean.afterPropertiesSet()

destroy

public void destroy()
             throws Exception
Specified by:
destroy in interface org.springframework.beans.factory.DisposableBean
Throws:
Exception
See Also:
DisposableBean.destroy()

join

public void join()
Join server thread.


getName

public String getName()
Description copied from interface: Server
Get server name.

Specified by:
getName in interface Server
Returns:
See Also:
Server.getName()

isRunning

public boolean isRunning()
Description copied from interface: Server
Is server running.

Specified by:
isRunning in interface Server
Returns:
See Also:
Server.isRunning()

setBeanName

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

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

setName

public void setName(String name)
Sets the name.

Parameters:
name - the name to set

setRunning

public void setRunning(boolean running)
Sets the running.

Parameters:
running - the running to set


Copyright © 2008-2013 ConSol* Consulting&Solutions GmbH. All Rights Reserved.