All Packages    This Package  Previous  Next  

Class sqlj.runtime.profile.ref.ProfileImpl

java.lang.Object
   |
   +----sqlj.runtime.profile.Profile
           |
           +----sqlj.runtime.profile.ref.ProfileImpl

public class ProfileImpl
extends Profile
The ProfileImpl class provides a concrete implementation of the Profile class. A profile is a resource which contains the "constant" information describing a set of sql operations. It also provides a mechanism to add a JDBC connection to a profile, and in so doing, create a "ConnectedProfile" which can be used to create executable statement objects corresponding to the sql statements contained within the profile.


Constructor Index

 o ProfileImpl(String, String, EntryInfo[], Loader, String)
Creates a new profile instance having the given profile name, context name, set of entries and loader.

Method Index

 o deregisterCustomization(Customization)
Drop a customization from the profile's list.
 o getConnectedProfile(Connection)
Resolves the contents of this profile with the passed JDBC connection and returns the result.
 o getContextName()
Returns the fully qualified name of the connection context for this profile.
 o getCustomizations()
 o getDefaultProfile(Connection, ProfileData)
Returns a default connected profile object.
 o getProfileData()
 o getProfileName()
 o getTimestamp()
Returns the creation time of the profile, as given by System.currentTimeMillis.
 o registerCustomization(Customization)
Registers a customization for this profile instance.
 o registerCustomization(Customization, Customization)
Registers a customization for this profile instance.
 o replaceCustomization(Customization, Customization)
Registers a customization for this profile instance.

Constructors

 o ProfileImpl
 public ProfileImpl(String profileName,
                    String contextName,
                    EntryInfo entries[],
                    Loader loader,
                    String sourceFile)
Creates a new profile instance having the given profile name, context name, set of entries and loader. The profile timestamp is created based on the current system time.

Note that this method should only be used to create new profiles. To instantiate an existing profile object, use the instantiate method. This constructor is used at translation time to create a new profile for serialization.

Parameters:
profileName - the fully qualified name of the profile
contextName - the fully qualified name of the connection context associated with the profile.
entries - the profile data contents for this profile
loader - the loader to associate with this instance of the profile
sourceFile - the name of the source file producing this profile, null if not available.
See Also:
instantiate, currentTimeMillis

Methods

 o getProfileName
 public String getProfileName()
Returns:
the fully qualified name of the profile.
Overrides:
getProfileName in class Profile
 o getContextName
 public String getContextName()
Returns the fully qualified name of the connection context for this profile.

Overrides:
getContextName in class Profile
See Also:
getContextName
 o getTimestamp
 public long getTimestamp()
Returns the creation time of the profile, as given by System.currentTimeMillis.

Returns:
the timestamp of the profile.
Overrides:
getTimestamp in class Profile
See Also:
getTimestamp
 o getProfileData
 public ProfileData getProfileData()
Returns:
a data object describing each of the sql operations contained in this profile.
Overrides:
getProfileData in class Profile
See Also:
getProfileData
 o getConnectedProfile
 public ConnectedProfile getConnectedProfile(Connection conn) throws SQLException
Resolves the contents of this profile with the passed JDBC connection and returns the result. The implementation of this method will return the connected-profile associated with the first registered customization that accepts the passed connection. If no customization is found that accepts the connection, a default connected-profile implementation based on JDBC dynamic sql will be returned.

Parameters:
conn - a jdbc Connection over which to perform operations.
Returns:
the result of attaching this profile to the given connection.
Throws: SQLException
if a connected-profile cannot be created for the supplied connection.
Overrides:
getConnectedProfile in class Profile
See Also:
Customization, getDefaultProfile, getConnectedProfile
 o getDefaultProfile
 public static ConnectedProfile getDefaultProfile(Connection conn,
                                                  ProfileData data)
Returns a default connected profile object. The passed JDBC connection parameter specifies the connection over which to execute operations. The passed ProfileData parameter specifies the data on which to operate.

The default connected profile has the following properties:

Note: A profile customization may create and maintain a modified version of the profile data object associated with a particular profile instance. In such cases, this method may be used to create a connected profile which applies the default semantics to custom data.

Parameters:
conn - the JDBC connection upon which to create the connected profile.
data - the profile data object upon which the resulting connected profile will operate.
Returns:
s a default connected profile object
See Also:
JDBCProfile, IterConvertProfile, UntypedSelectProfile, ParamRegProfile, TransactionControlProfile, PositionedProfile, IterConvertProfile
 o registerCustomization
 public void registerCustomization(Customization customization)
Registers a customization for this profile instance. The customization is added after all currently registered customizations.

Generally, a runtime environment will not call this method directly. Rather, this method may be called by customization utilities which operate on application profiles during an "installation" phase.

Throws: NullPointerException
if the customization argument is null
Overrides:
registerCustomization in class Profile
 o registerCustomization
 public void registerCustomization(Customization newCustomization,
                                   Customization nextCustomization)
Registers a customization for this profile instance. The new customization is added to the list just prior to the next customization argument. If the next customization is not currently registered, an exception is raised.

Generally, a runtime environment will not call this method directly. Rather, this method may be called by customization utilities which operate on application profiles during an "installation" phase.

Parameters:
newCustomization - the customization to register
nextCustomization - the customization before which to add the new customization
Throws: NullPointerException
if the new customization argument is null
Throws: IllegalArgumentException
if the next customization argument is not currently registered
Overrides:
registerCustomization in class Profile
 o replaceCustomization
 public void replaceCustomization(Customization newCustomization,
                                  Customization oldCustomization)
Registers a customization for this profile instance. The new customization is added to the list in place of the old customization argument. The new customization retains the position of the old customization. If the old customization is not currently registered, an exception is raised.

Generally, a runtime environment will not call this method directly. Rather, this method may be called by customization utilities which operate on application profiles during an "installation" phase.

Parameters:
newCustomization - the customization to register
oldCustomization - the customization to replace
Throws: NullPointerException
if the new customization argument is null
Throws: IllegalArgumentException
if the old customization argument is not currently registered
Overrides:
replaceCustomization in class Profile
 o deregisterCustomization
 public void deregisterCustomization(Customization customization)
Drop a customization from the profile's list.

Throws: IllegalArgumentException
if the customization argument is not currently registered
Overrides:
deregisterCustomization in class Profile
 o getCustomizations
 public Enumeration getCustomizations()
Returns:
an enumeration of all customizations currently registered with the profile.
Overrides:
getCustomizations in class Profile

All Packages    This Package  Previous  Next