KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > iapi > sql > depend > Dependent


1 /*
2
3    Derby - Class org.apache.derby.iapi.sql.depend.Dependent
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to you under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20  */

21
22 package org.apache.derby.iapi.sql.depend;
23
24 import org.apache.derby.catalog.Dependable;
25
26 import org.apache.derby.iapi.error.StandardException;
27
28 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
29
30 /**
31     A dependent has the ability to know whether or not it
32     is valid and to mark itself as valid or invalid.
33     Marking itself as invalid usually means it cannot be used
34     in the system until it is revalidated, but this is in no
35     way enforced by this interface.
36  */

37 public interface Dependent extends Dependable
38 {
39
40     /**
41         Check that all of the dependent's dependencies are valid.
42
43         @return true if the dependent is currently valid
44      */

45     boolean isValid();
46
47     /**
48         Prepare to mark the dependent as invalid (due to at least one of
49         its dependencies being invalid).
50
51         @param action The action causing the invalidation
52         @param p the provider
53         @param lcc The LanguageConnectionContext
54
55         @exception StandardException thrown if unable to make it invalid
56      */

57     void prepareToInvalidate(Provider p, int action,
58                              LanguageConnectionContext lcc)
59         throws StandardException;
60
61     /**
62         Mark the dependent as invalid (due to at least one of
63         its dependencies being invalid).
64
65         @param action The action causing the invalidation
66         @param lcc The LanguageConnectionContext
67
68         @exception StandardException thrown if unable to make it invalid
69      */

70     void makeInvalid(int action,
71                      LanguageConnectionContext lcc)
72             throws StandardException;
73
74     /**
75         Attempt to revalidate the dependent. For prepared statements,
76         this could go through its dependencies and check that they
77         are up to date; if not, it would recompile the statement.
78         Any failure during this attempt should throw
79         DependencyStatementException.unableToRevalidate().
80
81         @param lcc The LanguageConnectionContext
82
83         @exception StandardException thrown if unable to make it valid
84      */

85     void makeValid(LanguageConnectionContext lcc)
86         throws StandardException;
87 }
88
Popular Tags