KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > impl > sql > depend > BasicDependency


1 /*
2
3    Derby - Class org.apache.derby.impl.sql.depend.BasicDependency
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.impl.sql.depend;
23
24 import org.apache.derby.iapi.sql.depend.Dependency;
25 import org.apache.derby.iapi.sql.depend.Dependent;
26 import org.apache.derby.iapi.sql.depend.Provider;
27
28 import org.apache.derby.catalog.UUID;
29
30 import org.apache.derby.iapi.error.StandardException;
31
32 /**
33     A dependency represents a reliance of the dependent on
34     the provider for some information the dependent contains
35     or uses. In Language, the usual case is a prepared statement
36     using information about a schema object in its executable form.
37     It needs to be notified if the schema object changes, so that
38     it can recompile against the new information.
39  */

40 class BasicDependency implements Dependency {
41
42     //
43
// Dependency interface
44
//
45

46     /**
47         return the provider's key for this dependency.
48         @return the provider' key for this dependency
49      */

50     public UUID getProviderKey() {
51         return provider.getObjectID();
52     }
53
54     /**
55         return the provider for this dependency.
56         @return the provider for this dependency
57      */

58     public Provider getProvider() {
59         return provider;
60     }
61
62     /**
63         return the dependent for this dependency.
64         @return the dependent for this dependency
65      */

66     public Dependent getDependent() {
67         return dependent;
68     }
69
70     //
71
// class interface
72
//
73
BasicDependency(Dependent d, Provider p) {
74         dependent = d;
75         provider = p;
76     }
77
78     //
79
// class implementation
80
//
81
protected Provider provider;
82     protected Dependent dependent;
83 }
84
Popular Tags