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

Quick Search    Search Deep

Source code: org/apache/derby/iapi/sql/depend/Dependent.java


1   /*
2   
3      Derby - Class org.apache.derby.iapi.sql.depend.Dependent
4   
5      Copyright 1997, 2004 The Apache Software Foundation or its licensors, as applicable.
6   
7      Licensed under the Apache License, Version 2.0 (the "License");
8      you may not use this file except in compliance with the License.
9      You may obtain a copy of the License at
10  
11        http://www.apache.org/licenses/LICENSE-2.0
12  
13     Unless required by applicable law or agreed to in writing, software
14     distributed under the License is distributed on an "AS IS" BASIS,
15     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16     See the License for the specific language governing permissions and
17     limitations under the License.
18  
19   */
20  
21  package org.apache.derby.iapi.sql.depend;
22  
23  import  org.apache.derby.catalog.Dependable;
24  
25  import org.apache.derby.iapi.error.StandardException;
26  
27  import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
28  
29  /**
30    A dependent has the ability to know whether or not it
31    is valid and to mark itself as valid or invalid.
32    Marking itself as invalid usually means it cannot be used
33    in the system until it is revalidated, but this is in no
34    way enforced by this interface.
35   */
36  public interface Dependent  extends Dependable
37  {
38  
39    /**
40      Check that all of the dependent's dependencies are valid.
41  
42      @return true if the dependent is currently valid
43     */
44    boolean isValid();
45  
46    /**
47      Prepare to mark the dependent as invalid (due to at least one of
48      its dependencies being invalid).
49  
50      @param action  The action causing the invalidation
51      @param p    the provider
52      @param lcc    The LanguageConnectionContext
53  
54      @exception StandardException thrown if unable to make it invalid
55     */
56    void prepareToInvalidate(Provider p, int action, 
57                 LanguageConnectionContext lcc) 
58      throws StandardException;
59  
60    /**
61      Mark the dependent as invalid (due to at least one of
62      its dependencies being invalid).
63  
64      @param  action  The action causing the invalidation
65      @param lcc    The LanguageConnectionContext
66  
67      @exception StandardException thrown if unable to make it invalid
68     */
69    void makeInvalid(int action,
70             LanguageConnectionContext lcc) 
71        throws StandardException;
72  
73    /**
74      Attempt to revalidate the dependent. For prepared statements,
75      this could go through its dependencies and check that they
76      are up to date; if not, it would recompile the statement.
77      Any failure during this attempt should throw
78      DependencyStatementException.unableToRevalidate().
79  
80      @param lcc    The LanguageConnectionContext
81  
82      @exception StandardException thrown if unable to make it valid
83     */
84    void makeValid(LanguageConnectionContext lcc) 
85      throws StandardException;
86  }