Protomatter Application Server v1.0

com.protomatter.pas.base
Class ProtoPASStartup

java.lang.Object
  |
  +--com.protomatter.pas.base.ProtoPASStartup
All Implemented Interfaces:
PASStartup

public abstract class ProtoPASStartup
extends java.lang.Object
implements PASStartup

A default implementation of the PASStartup interface. This class provides utility methods for working with JDBC.


Constructor Summary
ProtoPASStartup()
          Default constructor.
 
Method Summary
protected  void close(java.sql.Connection c)
          Cleanly close the given Connection.
protected  void close(java.sql.ResultSet r)
          Cleanly close the given ResultSet.
protected  void close(java.sql.Statement s)
          Cleanly close the given Statement.
protected  java.sql.Connection getConnection()
          Get a connection using the driver, URL and properties that were specified as startup arguments.
protected  java.lang.String getJDBCDriverClass()
          Get the class name of the JDBC driver that was specified as a startup argument.
protected  java.util.Properties getJDBCProperties()
          Get the properties that were specified as startup arguments for opening JDBC connections.
protected  java.lang.String getJDBCURL()
          Get the JDBC URL that will be used for opening connections.
protected  java.util.Properties getProperties(java.lang.String value)
          A utility method.
protected  void startup(java.util.Properties serverProps, java.util.Properties myProps, javax.naming.Context ctx)
          Default startup method.
abstract  java.lang.String startup(java.lang.String name, java.util.Properties serverProps, java.util.Properties myProps, javax.naming.Context ctx)
          This method must be implemented by sub-classes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProtoPASStartup

public ProtoPASStartup()
Default constructor.
Method Detail

getConnection

protected java.sql.Connection getConnection()
                                     throws java.sql.SQLException
Get a connection using the driver, URL and properties that were specified as startup arguments.

getJDBCDriverClass

protected java.lang.String getJDBCDriverClass()
Get the class name of the JDBC driver that was specified as a startup argument.

getJDBCProperties

protected java.util.Properties getJDBCProperties()
Get the properties that were specified as startup arguments for opening JDBC connections.

getJDBCURL

protected java.lang.String getJDBCURL()
Get the JDBC URL that will be used for opening connections.

close

protected void close(java.sql.ResultSet r)
Cleanly close the given ResultSet.

close

protected void close(java.sql.Statement s)
Cleanly close the given Statement.

close

protected void close(java.sql.Connection c)
Cleanly close the given Connection.

startup

protected void startup(java.util.Properties serverProps,
                       java.util.Properties myProps,
                       javax.naming.Context ctx)
                throws StartupException
Default startup method. Reads properties for JDBC drivers, URLs and connection properties. Reads the following properties:

jdbc.driver
Specify the class name of a JDBC driver to use. If this property is not present in the properties for this class, the global property global.jdbc.driver is used.

jdbc.URL
Specify the JDBC URL to use. If this property is not present in the properties for this class, the global property global.jdbc.URL is used.

jdbc.properties
Specify the connection properties for JDBC connections. If this property is not present in the properties for this class, the global property global.jdbc.properties is used. The value of this property should be formed like this: "key1=val1,key2=val2,...".


startup

public abstract java.lang.String startup(java.lang.String name,
                                         java.util.Properties serverProps,
                                         java.util.Properties myProps,
                                         javax.naming.Context ctx)
                                  throws StartupException
This method must be implemented by sub-classes. It is called by PAS when starting this class as a service. Implementors should call startup(serverprops, myProps, ctx) in their implementation of this method.
Specified by:
startup in interface PASStartup
See Also:
PASStartup

getProperties

protected java.util.Properties getProperties(java.lang.String value)
A utility method. Takes a string formatted like "foo=bar,bar=baz" and convert it to a Properties object.

Protomatter Application Server v1.0
Copyright 1998-2002 Nate Sammons

Protomatter Application Server v1.0 http://protomatter.sourceforge.net/pas/1.0