com.xmlserv.main
Class BackendRepository

java.lang.Object
  |
  +--com.xmlserv.main.BackendRepository

public class BackendRepository
extends java.lang.Object

The container for all configured backends. The contents of the given InputStream are parsed and a BackendHandle is generated for each entry. URL Mapping is done by this class, Stylesheet mapping is implemented in BackendHandle

Version:
$Id: BackendRepository.java,v 1.14 2002/11/28 22:08:18 muecke Exp $
Author:
Wolfram Saringer
See Also:
BackendHandle

Constructor Summary
BackendRepository(java.io.InputStream configstream)
          Construct object by reading the given InputStream and parsing the <Backend> tags.
 
Method Summary
 void add(BackendHandle backend)
          Add a BackendHandle to the repository.
 void destroy()
          Destroy all BackendHandle objects giving them the opportunity to release any resources such as DB connections by calling their destroy() method.
 void dump()
          Dump contents of Repository to stdout.
 BackendHandle get(java.lang.String url)
          URL Mapping.
 java.lang.String getStatus()
          Return a system status report as a HTML fragment.
static void main(java.lang.String[] args)
          Test routine.
 void remove(java.lang.String url)
          Remove the Backend associated with the given URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BackendRepository

public BackendRepository(java.io.InputStream configstream)
                  throws java.io.IOException
Construct object by reading the given InputStream and parsing the <Backend> tags. The actual work after setting up a JDOM parser is done by load().
Method Detail

getStatus

public java.lang.String getStatus()
Return a system status report as a HTML fragment.

destroy

public void destroy()
Destroy all BackendHandle objects giving them the opportunity to release any resources such as DB connections by calling their destroy() method.

add

public void add(BackendHandle backend)
Add a BackendHandle to the repository. The URL configured in the handle is used for URL mapping.
Parameters:
backend - The BackendHandle to add.

remove

public void remove(java.lang.String url)
Remove the Backend associated with the given URL. This calls destroy() on the BackendHandle.
Parameters:
url - The URL to remove from the Repository.

get

public BackendHandle get(java.lang.String url)
URL Mapping. Get the BackendHandle associated with the given URL.
Returns:
BackendHandle matching given URL.

dump

public void dump()
Dump contents of Repository to stdout.

main

public static void main(java.lang.String[] args)
Test routine. Load the XML file given as an argument and dump the Repository.