org.abstracthorizon.extend.support.spring.server
Class SpringBasedServer

java.lang.Object
  extended by org.abstracthorizon.extend.support.spring.server.SpringBasedServer

public class SpringBasedServer
extends Object

This class sets up the server.

Author:
Daniel Sendula

Field Summary
protected  ClassLoader classLoader
          Root class loader for server
protected  URL homeLocation
          Home location of server.
protected  org.slf4j.Logger logger
          Logger
protected  SpringBasedServerApplicationContext serverApplicationContext
          Server's configuration
protected  URL serverLocation
          Setver's location
 
Constructor Summary
SpringBasedServer()
          Empty constructor
SpringBasedServer(URL homeLocation, URL serverLocation)
          Constructgor.
 
Method Summary
 void bootstrapDeploy(BulkDeploy bulkDeploy)
          Deploys bootstrap modules from "/config/bootstrap.deploy" file.
 void create()
          This method sets up class loader and loads server context.
 void destroy()
          Closes server's context and clears down class loader
 ClassLoader getClassLoader()
          Returns class loader
 URL getHomeLocation()
          Returns home location
 SpringBasedServerApplicationContext getServerApplicationContext()
          Returns server application context
 URL getServerLocation()
          Returns server's location
 void registerBean(String name, Object bean)
          Helper method for registering singleton beans with the server's application context
 void setClassLoader(ClassLoader classLoader)
          Sets class loader
 void setHomeLocation(URL homeLocation)
          Sets home location
 void setServerLocation(URL serverLocation)
          Sets server's location
 void shutdown()
          Utility method that calls stop() method and then destroy() method.
 void start()
          This method deploys "deploy" directory.
 void stop()
          Does nothing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.slf4j.Logger logger
Logger


homeLocation

protected URL homeLocation
Home location of server. Roor path where bin directory is.


serverLocation

protected URL serverLocation
Setver's location


classLoader

protected ClassLoader classLoader
Root class loader for server


serverApplicationContext

protected SpringBasedServerApplicationContext serverApplicationContext
Server's configuration

Constructor Detail

SpringBasedServer

public SpringBasedServer()
Empty constructor


SpringBasedServer

public SpringBasedServer(URL homeLocation,
                         URL serverLocation)
Constructgor.

Parameters:
homeLocation - home locaiton of server. Root path where bin directory is.
serverLocation - server's location
Method Detail

create

public void create()
This method sets up class loader and loads server context.


start

public void start()
This method deploys "deploy" directory. Effectively this function starts up the server.


stop

public void stop()
Does nothing.


destroy

public void destroy()
Closes server's context and clears down class loader


shutdown

public void shutdown()
Utility method that calls stop() method and then destroy() method.


bootstrapDeploy

public void bootstrapDeploy(BulkDeploy bulkDeploy)
Deploys bootstrap modules from "/config/bootstrap.deploy" file.

Parameters:
bulkDeploy -

getServerLocation

public URL getServerLocation()
Returns server's location

Returns:
server's location

setServerLocation

public void setServerLocation(URL serverLocation)
Sets server's location

Parameters:
serverLocation - server's location

getHomeLocation

public URL getHomeLocation()
Returns home location

Returns:
home location

setHomeLocation

public void setHomeLocation(URL homeLocation)
Sets home location

Parameters:
homeLocation - home location

getClassLoader

public ClassLoader getClassLoader()
Returns class loader

Returns:
class loader

setClassLoader

public void setClassLoader(ClassLoader classLoader)
Sets class loader

Parameters:
classLoader - class loader

getServerApplicationContext

public SpringBasedServerApplicationContext getServerApplicationContext()
Returns server application context

Returns:
server application context

registerBean

public void registerBean(String name,
                         Object bean)
Helper method for registering singleton beans with the server's application context

Parameters:
name - bean name
bean - bean to be registered


Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.