Jwma

dtw.webmail.plugin.std
Class CastorHelper

java.lang.Object
  |
  +--dtw.webmail.plugin.std.CastorHelper

public class CastorHelper
extends java.lang.Object

An utility/helper class with common functionality for the standard Castor based plugin implementations.

Version:
0.9.7 07/02/2003
Author:
Dieter Wimberger

Method Summary
 CastorDatabasePool getDatabasePool()
          Returns the pool of Castor JDO Database instances.
 org.exolab.castor.jdo.Database getJDODatabase()
          Returns a Castor JDO database.
static CastorHelper getReference()
          Returns a reference to the singleton instance of the CastorHelper.
 void marshal(java.lang.Object object, java.io.Writer writer)
          Marshals an object to the given writer.
 void prepareJDO(java.lang.String configurl)
          Prepares Castor JDO, with configuration (i.e.
 java.lang.Object unmarshal(java.io.Reader reader)
          Unmarshalls an object from the given reader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

marshal

public void marshal(java.lang.Object object,
                    java.io.Writer writer)
             throws JwmaException
Marshals an object to the given writer.

Parameters:
object - the instance to be marshalled.
writer - the Writer.
Throws:
JwmaException - on failure.

unmarshal

public java.lang.Object unmarshal(java.io.Reader reader)
                           throws JwmaException
Unmarshalls an object from the given reader.

Parameters:
reader - the Reader.
JwmaException

prepareJDO

public void prepareJDO(java.lang.String configurl)
                throws JwmaException
Prepares Castor JDO, with configuration (i.e. database.xml) given as URL.

Parameters:
configurl - the URL to the configuration file.
JwmaException

getJDODatabase

public org.exolab.castor.jdo.Database getJDODatabase()
                                              throws JwmaException
Returns a Castor JDO database.

Returns:
a Castor JDO Database instance.
JwmaException

getDatabasePool

public CastorDatabasePool getDatabasePool()
Returns the pool of Castor JDO Database instances.

Returns:
the pool as CastorDatabasePool.

getReference

public static CastorHelper getReference()
Returns a reference to the singleton instance of the CastorHelper.

Returns:
the CastorHelper singleton.

Jwma

Copyright © 2000-2003 jwma team (All Rights Reserved.)