org.apache.derby.iapi.sql.depend
Interface Dependent

All Superinterfaces:
Dependable
All Known Subinterfaces:
ExecPreparedStatement, PreparedStatement, StorablePreparedStatement
All Known Implementing Classes:
ConstraintDescriptor, DefaultDescriptor, GenericPreparedStatement, GenericStorablePreparedStatement, SPSDescriptor, TriggerDescriptor, ViewDescriptor

public interface Dependent
extends Dependable

A dependent has the ability to know whether or not it is valid and to mark itself as valid or invalid. Marking itself as invalid usually means it cannot be used in the system until it is revalidated, but this is in no way enforced by this interface.


Field Summary
 
Fields inherited from interface org.apache.derby.catalog.Dependable
ALIAS, COLUMNS_IN_TABLE, CONGLOMERATE, CONSTRAINT, DEFAULT, FILE, HEAP, INDEX, PREPARED_STATEMENT, SCHEMA, STORED_PREPARED_STATEMENT, TABLE, TRIGGER, VIEW
 
Method Summary
 boolean isValid()
          Check that all of the dependent's dependencies are valid.
 void makeInvalid(int action, LanguageConnectionContext lcc)
          Mark the dependent as invalid (due to at least one of its dependencies being invalid).
 void makeValid(LanguageConnectionContext lcc)
          Attempt to revalidate the dependent.
 void prepareToInvalidate(Provider p, int action, LanguageConnectionContext lcc)
          Prepare to mark the dependent as invalid (due to at least one of its dependencies being invalid).
 
Methods inherited from interface org.apache.derby.catalog.Dependable
getClassType, getDependableFinder, getObjectID, getObjectName, isPersistent
 

Method Detail

isValid

public boolean isValid()
Check that all of the dependent's dependencies are valid.

Returns:
true if the dependent is currently valid

prepareToInvalidate

public void prepareToInvalidate(Provider p,
                                int action,
                                LanguageConnectionContext lcc)
                         throws StandardException
Prepare to mark the dependent as invalid (due to at least one of its dependencies being invalid).

Parameters:
action - The action causing the invalidation
p - the provider
lcc - The LanguageConnectionContext
Throws:
StandardException - thrown if unable to make it invalid

makeInvalid

public void makeInvalid(int action,
                        LanguageConnectionContext lcc)
                 throws StandardException
Mark the dependent as invalid (due to at least one of its dependencies being invalid).

Parameters:
action - The action causing the invalidation
lcc - The LanguageConnectionContext
Throws:
StandardException - thrown if unable to make it invalid

makeValid

public void makeValid(LanguageConnectionContext lcc)
               throws StandardException
Attempt to revalidate the dependent. For prepared statements, this could go through its dependencies and check that they are up to date; if not, it would recompile the statement. Any failure during this attempt should throw DependencyStatementException.unableToRevalidate().

Parameters:
lcc - The LanguageConnectionContext
Throws:
StandardException - thrown if unable to make it valid


Apache Derby V10.0 Engine Documentation - Copyright © 1997,2004 The Apache Software Foundation or its licensors, as applicable.