Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.clra.rowing
Class RowingUtils  view RowingUtils download RowingUtils.java

java.lang.Object
  extended bycom.clra.rowing.RowingUtils

public final class RowingUtils
extends java.lang.Object

Utilities for finding and creating "base" entities: Member, RowingSession, Boat, and Oarset. Other entities are created by operations on these base entities.

These utilities are implemented by calls to EJB's. They are appropriate where entities should be cached in memory, perhaps because the entities will be modified shortly.

The class RowingDBRead defines utilities with similar signatures that are implemented by directly reading from the database. These operations are faster if objects are not already in memory, and if the objects are not anticipated to require modification.

Version:
$Revision: 1.3 $ $Date: 2003/02/26 03:38:45 $

Field Summary
private static IParticipantHome _homeParticipant
           
private static IRowingSessionHome _homeRowingSession
           
private static java.lang.String base
           
private static org.apache.log4j.Category theLog
           
 
Constructor Summary
RowingUtils()
           
 
Method Summary
static IParticipant createParticipant(java.lang.Integer memberId, java.lang.Integer rowingId, SeatPreference seatPreference)
          Creates a participant
static IRowingSession createRowingSession(java.util.Date date, RowingSessionLevel level, RowingSessionType type)
          Creates a rowing session
static RowingSessionSnapshot createRowingSessionDefaults()
          Returns a "fake" rowing session, one which is neither persistent nor managed by the EJB container.
static IParticipant findParticipant(java.lang.Integer participantId)
          Returns the participant specified by the participant id
static IRowingSession findRowingSession(java.lang.Integer rowingId)
          Returns the rowing session specified by the rowing id
static IParticipantHome getParticipantHome()
          Returns the factory for Participant instances.
static IRowingSessionHome getRowingSessionHome()
          Returns the factory for RowingSession instances.
private static IParticipantHome lookupParticipantHome()
           
private static IRowingSessionHome lookupRowingSessionHome()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

base

private static final java.lang.String base

theLog

private static final org.apache.log4j.Category theLog

_homeRowingSession

private static IRowingSessionHome _homeRowingSession

_homeParticipant

private static IParticipantHome _homeParticipant
Constructor Detail

RowingUtils

public RowingUtils()
Method Detail

lookupRowingSessionHome

private static IRowingSessionHome lookupRowingSessionHome()
                                                   throws javax.naming.NamingException

lookupParticipantHome

private static IParticipantHome lookupParticipantHome()
                                               throws javax.naming.NamingException

getRowingSessionHome

public static IRowingSessionHome getRowingSessionHome()
                                               throws javax.naming.NamingException
Returns the factory for RowingSession instances.

Note: this operation should be used only by this class, unit tests, and the implementation class for IRowingSession


getParticipantHome

public static IParticipantHome getParticipantHome()
                                           throws javax.naming.NamingException
Returns the factory for Participant instances.

Note: this operation should be used only by this class, unit tests, and the implementation class for IParticipant


findRowingSession

public static IRowingSession findRowingSession(java.lang.Integer rowingId)
                                        throws java.rmi.RemoteException,
                                               javax.ejb.FinderException,
                                               javax.naming.NamingException
Returns the rowing session specified by the rowing id


createRowingSession

public static IRowingSession createRowingSession(java.util.Date date,
                                                 RowingSessionLevel level,
                                                 RowingSessionType type)
                                          throws java.rmi.RemoteException,
                                                 javax.ejb.CreateException,
                                                 javax.naming.NamingException
Creates a rowing session


findParticipant

public static IParticipant findParticipant(java.lang.Integer participantId)
                                    throws java.rmi.RemoteException,
                                           javax.ejb.FinderException,
                                           javax.naming.NamingException
Returns the participant specified by the participant id


createParticipant

public static IParticipant createParticipant(java.lang.Integer memberId,
                                             java.lang.Integer rowingId,
                                             SeatPreference seatPreference)
                                      throws java.rmi.RemoteException,
                                             javax.ejb.CreateException,
                                             javax.naming.NamingException
Creates a participant


createRowingSessionDefaults

public static RowingSessionSnapshot createRowingSessionDefaults()
Returns a "fake" rowing session, one which is neither persistent nor managed by the EJB container. The primary key of the session (the session id) is null. Other session accessors return valid default values.