uk.co.lakesidetech.springxmldb.startup.exist
Class ExistEmbeddedServer

java.lang.Object
  extended byuk.co.lakesidetech.springxmldb.startup.exist.ExistEmbeddedServer
All Implemented Interfaces:
IXMLDBServerStartup
Direct Known Subclasses:
ExistStandaloneServer

public class ExistEmbeddedServer
extends java.lang.Object
implements IXMLDBServerStartup

The ExistEmbeddedServer will startup an embedded XML database which can be connected to in the same JVM be using a xmldb:$databasename:/// database uri for the database. This bean specifies the number of threads used in the database for connections to the underlying file collections and the location of the exist configuration file. it is also possible to specify a shutdown listener which will be called in event the database is shutdown.

The shutdown username and password is needed to initiate a shutdown. The default of admin can be used for a standard exist server

Author:
Stuart Eccles

Field Summary
protected  org.springframework.core.io.Resource configurationFile
           
protected  java.lang.String databaseName
           
protected  org.exist.xmldb.ShutdownListener shutdownListener
           
protected  java.lang.String shutdownPassword
           
protected  java.lang.String shutdownUser
           
protected  int threads
           
 
Constructor Summary
ExistEmbeddedServer()
           
 
Method Summary
protected  org.exist.util.Configuration createExistConfiguration()
          creates an exist configuration from the resource file specified in this bean configuration
 void setConfigurationFile(org.springframework.core.io.Resource configurationFile)
           
 void setDatabaseName(java.lang.String databaseName)
           
 void setShutdownListener(org.exist.xmldb.ShutdownListener shutdownListener)
           
 void setShutdownPassword(java.lang.String shutdownPassword)
           
 void setShutdownUser(java.lang.String shutdownUser)
           
 void setThreads(int threads)
           
 void shutdown()
          shuts down this data base created
 void startup()
          starts up a instance of the eXist embedded broker pool server using the configuration file specified
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

databaseName

protected java.lang.String databaseName

threads

protected int threads

configurationFile

protected org.springframework.core.io.Resource configurationFile

shutdownListener

protected org.exist.xmldb.ShutdownListener shutdownListener

shutdownUser

protected java.lang.String shutdownUser

shutdownPassword

protected java.lang.String shutdownPassword
Constructor Detail

ExistEmbeddedServer

public ExistEmbeddedServer()
Method Detail

setShutdownPassword

public void setShutdownPassword(java.lang.String shutdownPassword)
Parameters:
shutdownPassword - The shutdownPassword to set.

setShutdownUser

public void setShutdownUser(java.lang.String shutdownUser)
Parameters:
shutdownUser - The shutdownUser to set.

setConfigurationFile

public void setConfigurationFile(org.springframework.core.io.Resource configurationFile)

setDatabaseName

public void setDatabaseName(java.lang.String databaseName)
Parameters:
databaseName - The databaseName to set.

setShutdownListener

public void setShutdownListener(org.exist.xmldb.ShutdownListener shutdownListener)
Parameters:
shutdownListener - The shutdownListener to set.

setThreads

public void setThreads(int threads)
Parameters:
threads - The threads to set.

startup

public void startup()
starts up a instance of the eXist embedded broker pool server using the configuration file specified

Specified by:
startup in interface IXMLDBServerStartup
See Also:
IXMLDBServerStartup.startup()

shutdown

public void shutdown()
shuts down this data base created

Specified by:
shutdown in interface IXMLDBServerStartup
See Also:
IXMLDBServerStartup.shutdown()

createExistConfiguration

protected org.exist.util.Configuration createExistConfiguration()
                                                         throws org.exist.util.DatabaseConfigurationException
creates an exist configuration from the resource file specified in this bean configuration

Returns:
Throws:
org.exist.util.DatabaseConfigurationException