01: /*
02:
03: Derby - Class org.apache.derby.iapi.sql.depend.Dependent
04:
05: Licensed to the Apache Software Foundation (ASF) under one or more
06: contributor license agreements. See the NOTICE file distributed with
07: this work for additional information regarding copyright ownership.
08: The ASF licenses this file to you under the Apache License, Version 2.0
09: (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: 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) throws StandardException;
58:
59: /**
60: Mark the dependent as invalid (due to at least one of
61: its dependencies being invalid).
62:
63: @param action The action causing the invalidation
64: @param lcc The LanguageConnectionContext
65:
66: @exception StandardException thrown if unable to make it invalid
67: */
68: void makeInvalid(int action, LanguageConnectionContext lcc)
69: throws StandardException;
70:
71: /**
72: Attempt to revalidate the dependent. For prepared statements,
73: this could go through its dependencies and check that they
74: are up to date; if not, it would recompile the statement.
75: Any failure during this attempt should throw
76: DependencyStatementException.unableToRevalidate().
77:
78: @param lcc The LanguageConnectionContext
79:
80: @exception StandardException thrown if unable to make it valid
81: */
82: void makeValid(LanguageConnectionContext lcc)
83: throws StandardException;
84: }
|