|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.impl.sql.depend.BasicDependencyManager
public class BasicDependencyManager
The dependency manager tracks needs that dependents have of providers.
Field Summary | |
---|---|
private DataDictionary |
dd
DataDictionary for this database. |
private java.util.Hashtable |
dependents
Map of in-memory dependencies for Dependents. |
private static ProviderInfo[] |
EMPTY_PROVIDER_INFO
|
private java.util.Hashtable |
providers
Map of in-memory dependencies for Providers. |
Constructor Summary | |
---|---|
BasicDependencyManager(DataDictionary dd)
|
Method Summary | |
---|---|
void |
addDependency(Dependent d,
Provider p,
ContextManager cm)
adds a dependency from the dependent on the provider. |
private void |
addDependency(Dependent d,
Provider p,
ContextManager cm,
TransactionController tc)
|
private boolean |
addDependencyToTable(java.util.Hashtable table,
java.lang.Object key,
Dependency dy)
Add a new dependency to the specified table if it does not already exist in that table. |
private void |
bubbleSort(UUID[] uuids)
Do a bubble sort on the given array of UUIDs. |
void |
clearColumnInfoInProviders(ProviderList pl)
Clear the in memory column bit map information in any table descriptor provider in a provider list. |
void |
clearDependencies(LanguageConnectionContext lcc,
Dependent d)
Erases all of the dependencies the dependent has, be they valid or invalid, of any dependency type. |
void |
clearDependencies(LanguageConnectionContext lcc,
Dependent d,
TransactionController tc)
Erases all of the dependencies the dependent has, be they valid or invalid, of any dependency type. |
void |
clearInMemoryDependency(Dependency dy)
Clear the specified in memory dependency. |
protected void |
clearProviderDependency(UUID p,
Dependency d)
removes a dependency for a given provider. assumes that the dependent removal is being dealt with elsewhere. |
void |
copyDependencies(Dependent copy_From,
Dependent copyTo,
boolean persistentOnly,
ContextManager cm)
Copy dependencies from one dependent to another. |
void |
copyDependencies(Dependent copy_From,
Dependent copyTo,
boolean persistentOnly,
ContextManager cm,
TransactionController tc)
Copy dependencies from one dependent to another. |
private void |
coreInvalidateFor(Provider p,
int action,
LanguageConnectionContext lcc)
A version of invalidateFor that does not provide synchronization among invalidators. |
int |
countDependencies()
Count the number of active dependencies, both stored and in memory, in the system. |
private void |
dropDependency(LanguageConnectionContext lcc,
Dependent d,
Provider p)
drops a single dependency |
java.lang.String |
dumpDependencies()
Dump out debugging info on all of the dependencies currently within the system. |
java.lang.String |
getActionString(int action)
Returns a string representation of the SQL action, hence no need to internationalize, which is causing the invokation of the Dependency Manager. |
private java.util.List |
getDependencyDescriptorList(java.util.List storedList,
Provider providerForList)
Replace the DependencyDescriptors in an List with Dependencys. |
private java.util.List |
getDependents(Provider p)
Returns an enumeration of all dependencies that this provider is supporting for any dependent at all (even invalid ones). |
private LanguageConnectionContext |
getLanguageConnectionContext(ContextManager cm)
Returns the LanguageConnectionContext to use. |
ProviderInfo[] |
getPersistentProviderInfos(Dependent dependent)
Get a new array of ProviderInfos representing all the persistent providers for the given dependent. |
ProviderInfo[] |
getPersistentProviderInfos(ProviderList pl)
Get a new array of ProviderInfos representing all the persistent providers from the given list of providers. |
private java.util.List |
getProviders(Dependent d)
Returns an enumeration of all dependencies that this dependent has with any provider (even invalid ones). |
void |
invalidateFor(Provider p,
int action,
LanguageConnectionContext lcc)
mark all dependencies on the named provider as invalid. |
private static java.util.List |
newSList()
|
private static java.util.List |
newSList(java.util.List list)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final DataDictionary dd
private final java.util.Hashtable dependents
private final java.util.Hashtable providers
private static final ProviderInfo[] EMPTY_PROVIDER_INFO
Constructor Detail |
---|
public BasicDependencyManager(DataDictionary dd)
Method Detail |
---|
public void addDependency(Dependent d, Provider p, ContextManager cm) throws StandardException
Implementations of addDependency should be fast -- performing alot of extra actions to add a dependency would be a detriment.
addDependency
in interface DependencyManager
d
- the dependentp
- the providercm
- Current ContextManager
StandardException
- thrown if something goes wrongprivate void addDependency(Dependent d, Provider p, ContextManager cm, TransactionController tc) throws StandardException
StandardException
private void dropDependency(LanguageConnectionContext lcc, Dependent d, Provider p) throws StandardException
d
- the dependentp
- the provider
StandardException
- thrown if something goes wrongpublic void invalidateFor(Provider p, int action, LanguageConnectionContext lcc) throws StandardException
Implementations of this can take a little time, but are not really expected to recompile things against any changes made to the provider that caused the invalidation. The dependency system makes no guarantees about the state of the provider -- implementations can call this before or after actually changing the provider to its new state.
Implementations should throw StandardException if the invalidation should be disallowed.
invalidateFor
in interface DependencyManager
p
- the provideraction
- The action causing the invalidatelcc
- The LanguageConnectionContext
StandardException
- thrown if unable to make it invalidprivate void coreInvalidateFor(Provider p, int action, LanguageConnectionContext lcc) throws StandardException
p
- provideraction
- The action causing the invalidatelcc
- Language connection context
StandardException
- Thrown on error.public void clearDependencies(LanguageConnectionContext lcc, Dependent d) throws StandardException
There might be a future want to clear all dependencies for a particular provider, e.g. when destroying the provider. However, at present, they are assumed to stick around and it is the responsibility of the dependent to erase them when revalidating against the new version of the provider.
clearDependencies will delete dependencies if they are stored; the delete is finalized at the next commit.
clearDependencies
in interface DependencyManager
d
- the dependentlcc
- Compiler state
StandardException
- Thrown on failurepublic void clearDependencies(LanguageConnectionContext lcc, Dependent d, TransactionController tc) throws StandardException
DependencyManager
There might be a future want to clear all dependencies for a particular provider, e.g. when destroying the provider. However, at present, they are assumed to stick around and it is the responsibility of the dependent to erase them when revalidating against the new version of the provider.
clearDependencies will delete dependencies if they are stored; the delete is finalized at the next commit.
clearDependencies
in interface DependencyManager
lcc
- Compiler stated
- the dependenttc
- transaction controller
StandardException
- Thrown on failurepublic void clearInMemoryDependency(Dependency dy)
clearInMemoryDependency
in interface DependencyManager
public ProviderInfo[] getPersistentProviderInfos(Dependent dependent) throws StandardException
DependencyManager
getPersistentProviderInfos
in interface DependencyManager
StandardException
- Thrown on errorDependencyManager.getPersistentProviderInfos(org.apache.derby.iapi.sql.depend.Dependent)
public ProviderInfo[] getPersistentProviderInfos(ProviderList pl) throws StandardException
DependencyManager
getPersistentProviderInfos
in interface DependencyManager
StandardException
- Thrown on errorDependencyManager.getPersistentProviderInfos(org.apache.derby.iapi.sql.depend.Dependent)
public void clearColumnInfoInProviders(ProviderList pl) throws StandardException
DependencyManager
clearColumnInfoInProviders
in interface DependencyManager
pl
- provider list
StandardException
- Thrown on errorDependencyManager.clearColumnInfoInProviders(org.apache.derby.iapi.sql.depend.ProviderList)
public void copyDependencies(Dependent copy_From, Dependent copyTo, boolean persistentOnly, ContextManager cm) throws StandardException
copyDependencies
in interface DependencyManager
copy_From
- the dependent to copy fromcopyTo
- the dependent to copy topersistentOnly
- only copy persistent dependenciescm
- Current ContextManager
StandardException
- Thrown on error.public void copyDependencies(Dependent copy_From, Dependent copyTo, boolean persistentOnly, ContextManager cm, TransactionController tc) throws StandardException
DependencyManager
copyDependencies
in interface DependencyManager
copy_From
- the dependent to copy fromcopyTo
- the dependent to copy topersistentOnly
- only copy persistent dependenciescm
- Current ContextManagertc
- Transaction Controller
StandardException
- Thrown on error.public java.lang.String getActionString(int action)
getActionString
in interface DependencyManager
action
- The action
public int countDependencies() throws StandardException
countDependencies
in interface DependencyManager
StandardException
- thrown if something goes wrongpublic java.lang.String dumpDependencies() throws StandardException, java.sql.SQLException
dumpDependencies
in interface DependencyManager
StandardException
- thrown if something goes wrong
java.sql.SQLException
- thrown if something goes wrongprivate boolean addDependencyToTable(java.util.Hashtable table, java.lang.Object key, Dependency dy)
protected void clearProviderDependency(UUID p, Dependency d)
private java.util.List getDependencyDescriptorList(java.util.List storedList, Provider providerForList) throws StandardException
storedList
- The List of DependencyDescriptors representing
stored dependencies.providerForList
- The provider if this list is being created
for a list of dependents. Null otherwise.
StandardException
- thrown if something goes wrongprivate LanguageConnectionContext getLanguageConnectionContext(ContextManager cm)
cm
- Current ContextManager
private void bubbleSort(UUID[] uuids)
uuids
- The array of UUIDs to sort.private java.util.List getProviders(Dependent d) throws StandardException
d
- the dependent
StandardException
- thrown if something goes wrongprivate java.util.List getDependents(Provider p) throws StandardException
p
- the provider
StandardException
- thrown if something goes wrongprivate static java.util.List newSList()
private static java.util.List newSList(java.util.List list)
|
Built on Thu 2010-12-23 20:49:13+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |