|
||||||||||
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
The dependency manager tracks needs that dependents have of providers.
Field Summary | |
private DataDictionary |
dataDictionary
|
protected java.util.Hashtable |
dependents
|
private static ProviderInfo[] |
EMPTY_PROVIDER_INFO
|
protected java.util.Hashtable |
providers
|
Constructor Summary | |
BasicDependencyManager()
|
Method Summary | |
void |
addDependency(Dependent d,
Provider p,
ContextManager cm)
adds a dependency from the dependent on the provider. |
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 |
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. |
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 DataDictionary |
getDataDictionary()
Returns the DataDictionary to use. |
private java.util.List |
getDependencyDescriptorList(java.util.List storedList)
Replace the DependencyDescriptors in an List with Dependencys. |
protected 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()
Returns the LanguageConnectionContext to use. |
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. |
protected 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 static final ProviderInfo[] EMPTY_PROVIDER_INFO
private DataDictionary dataDictionary
protected java.util.Hashtable dependents
protected java.util.Hashtable providers
Constructor Detail |
public BasicDependencyManager()
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 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 dependent
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 java.lang.String getActionString(int action)
getActionString
in interface DependencyManager
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) throws StandardException
storedList
- The List of DependencyDescriptors representing
stored dependencies.
StandardException
- thrown if something goes wrongprivate DataDictionary getDataDictionary()
private LanguageConnectionContext getLanguageConnectionContext()
private LanguageConnectionContext getLanguageConnectionContext(ContextManager cm)
cm
- Current ContextManager
private void bubbleSort(UUID[] uuids)
uuids
- The array of UUIDs to sort.protected java.util.List getProviders(Dependent d) throws StandardException
d
- the dependent
StandardException
- thrown if something goes wrongprotected 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 Mon 2007-06-04 09:58:47+0400, from revision ??? | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |