sqlj.runtime.ref
Class ProfileGroup

java.lang.Object
  |
  +--sqlj.runtime.ref.ProfileGroup

public class ProfileGroup
extends java.lang.Object

A profile group object manages a set of profiles and connected profiles. Each profile group instance contains a collection of profiles. Additionally it contains a collection of open connections. For each open connection it contains, there exists an instance of a connected group. A connected group instance manages a set of connected profiles, one for each profile in the containing profile group instance.

This class is created to encapsulate the management of profiles that must be handled by all connection context objects. It is intended for internal use by the reference runtime implementation and reference translator generated code, and is therefore not expected to be directly referenced by SQLJ programmers.


Constructor Summary
ProfileGroup()
           
 
Method Summary
 sqlj.runtime.ref.ProfileGroup.ConnectedGroup addConnection(ConnectionContext conn)
          Returns a connected group that manages the connected profiles associated with the passed connection and the current profile group's profiles.
 sqlj.runtime.profile.Profile getProfile(java.lang.Object key)
          Returns the profile associated with a particular key in this profile group.
 java.lang.Object getProfileKey(sqlj.runtime.profile.Loader loader, java.lang.String profileName)
          Returns key object for the profile of given a name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProfileGroup

public ProfileGroup()
Method Detail

getProfileKey

public java.lang.Object getProfileKey(sqlj.runtime.profile.Loader loader,
                                      java.lang.String profileName)
                               throws java.sql.SQLException
Returns key object for the profile of given a name. If a profile with the given name has not yet been instantiated by this profile group, then a new one is instantiated using the passed name and loader; a key associated with the newly instantiated profile is created and returned. If a profile with the given name is already known to the profile group, then its associated key is returned directly.
Throws:
java.sql.SQLException - if the profile cannot be instantiated
See Also:
Profile.instantiate(sqlj.runtime.profile.Loader, java.io.InputStream)

getProfile

public sqlj.runtime.profile.Profile getProfile(java.lang.Object key)
Returns the profile associated with a particular key in this profile group.
Throws:
java.lang.IllegalArgumentException - if the key is null or invalid

addConnection

public sqlj.runtime.ref.ProfileGroup.ConnectedGroup addConnection(ConnectionContext conn)
Returns a connected group that manages the connected profiles associated with the passed connection and the current profile group's profiles. Profiles registered after this call is made are automatically made known to the connected group returned.