java.lang.Object
de.grogra.pf.registry.Registry
- All Implemented Interfaces:
GraphTransaction.Consumer,SharedObjectProvider,SharedObjectProvider.Binding,Transaction.Consumer,XAListener,RegistryContext,TypeLoader,TreeDiff.NodeModel,TreeModel
public final class Registry
extends Object
implements Transaction.Consumer, GraphTransaction.Consumer, XAListener, SharedObjectProvider, SharedObjectProvider.Binding, TreeModel, RegistryContext, TreeDiff.NodeModel, TypeLoader
The registry consists of a tree of items. Each item has a name and can be referenced
like in a file system. The path for selecting an item is similar to a unix path
(i. e. /ui/commands).
- Author:
- nmi
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.grogra.graph.impl.GraphTransaction.Consumer
GraphTransaction.Consumer.Adapter, GraphTransaction.Consumer.MulticasterNested classes/interfaces inherited from interface de.grogra.persistence.SharedObjectProvider
SharedObjectProvider.BindingNested classes/interfaces inherited from interface de.grogra.persistence.Transaction.Consumer
Transaction.Consumer.Adapter, Transaction.Consumer.MulticasterNested classes/interfaces inherited from interface de.grogra.persistence.XAListener
XAListener.WeakDelegate -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final JoinedFileSystemstatic final MimeTypestatic final Stringstatic final JoinedFileSystemstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanvoidaddContentDescription(HashMap<String, ContentDescriptionType[]> contents) Add the ContentDescriptionTypes to the registry.voidaddEdgeBits(Node source, Node target, int mask) voidaddSharedObject(String directory, Shareable object, String name, boolean objDescribes) Adds aSharedObjectNodeforobjectto the meta-graph (seeGraphManager.META_GRAPH) of the project graph (seegetProjectGraph()), and creates a reference to this node in the specifieddirectoryof this registry.voidstatic intvoidbegin()final voidbeginXA()classForName(String name) final voidcommitXA(boolean activateItems) static RegistryvoidcreateXMLSource(Collection requiredPlugins, XMLSerializer.Filter filter) static Registrycurrent()voiddispose()voidend()booleanItem[]findAll(ItemCriterion c, Object info, boolean resolve) findFirst(ItemCriterion c, Object info, boolean resolve) findMax(ItemComparator c, Object info, boolean resolve) voidforAll(ItemCriterion c, Object info, ItemVisitor cb, Object cbInfo, boolean resolve) intintgetChildCount(Object parent) getDiffInfo(Object node) getDirectory(String path, PluginDescriptor plugin) Return the item specified by its absolutepathor create such an item if does not yet exist.final ItemgetFiles()final StringgetImportAttribute(String key) intgetIndexOfChild(Object parent, Object child) getLock()final ObjectgetOrCreateProjectFile(String systemId, Item[] path, boolean isDirectory) getPluginDescriptor(String pluginId) final Itemfinal ObjectgetProjectFile(String systemId) Returns theRegistrywhich is linked with this instance.getRoot()final ItemThe static Directory contains the statics import that are added in RGG classes by defaults.final TransactiongetUserProperty(int id) voidinitFileSystem(FileSystem fileSystem) voidvoidinsertComponent(PersistenceCapable o, PersistenceField field, int[] indices, Transaction.Reader reader) final voidbooleanisActive()booleanfinal booleanvoidmakePersistent(long id, ManageableType type) voidvoidreadData(PersistenceCapable o, Transaction.Reader reader) voidremoveComponent(PersistenceCapable o, PersistenceField field, int[] indices, Transaction.Reader reader) voidremoveEdgeBits(Node source, Node target, int mask) voidvoidvoidstatic voidsetCurrent(RegistryContext current) voidvoidsetField(PersistenceCapable o, PersistenceField field, int[] indices, Transaction.Reader reader) voidsetProjectName(String projectName) setUserProperty(int id, Object value) voidstartup()voidsubstituteFileSystem(FileSystem newfs) voidtransactionApplied(Transaction.Data xa, boolean rollback) typeForName(String name) voidvalueForPathChanged(TreePath path, Object newValue) voidwriteObject(Shareable object, PersistenceOutput out)
-
Field Details
-
NAMESPACE
- See Also:
-
MIME_TYPE
-
PROJECT_GRAPH
- See Also:
-
REGISTRY_GRAPH
- See Also:
-
PLUGIN_FILE_SYSTEMS
-
ALL_FILE_SYSTEMS
-
-
Constructor Details
-
Registry
-
-
Method Details
-
allocatePropertyId
public static int allocatePropertyId() -
addTreeModelListener
- Specified by:
addTreeModelListenerin interfaceTreeModel
-
removeTreeModelListener
- Specified by:
removeTreeModelListenerin interfaceTreeModel
-
valueForPathChanged
- Specified by:
valueForPathChangedin interfaceTreeModel
-
getChild
-
getChildCount
- Specified by:
getChildCountin interfaceTreeModel
-
getIndexOfChild
- Specified by:
getIndexOfChildin interfaceTreeModel
-
isLeaf
-
getRoot
-
create
-
createGraphs
-
initialize
public void initialize() -
getRegistry
Description copied from interface:RegistryContextReturns theRegistrywhich is linked with this instance.- Specified by:
getRegistryin interfaceRegistryContext- Returns:
- the registry linked with this instance
-
getLogger
-
addFileSystemListener
-
removeFileSystemListener
-
initFileSystem
-
substituteFileSystem
- Throws:
IOException
-
restoreFileSystem
-
getFiles
-
getFileSystem
-
getProjectFile
-
getOrCreateProjectFile
public final Object getOrCreateProjectFile(String systemId, Item[] path, boolean isDirectory) throws IOException - Throws:
IOException
-
getFileSystemName
-
setProjectName
-
getProjectName
-
getImportAttribute
-
findFirst
-
forAll
-
findAll
-
findMax
-
setEmptyGraph
public void setEmptyGraph() -
getProjectGraph
-
getRegistryGraph
-
getParentRegistry
-
getRootRegistry
-
isRootRegistry
public final boolean isRootRegistry() -
getLock
-
getWriteLock
-
beginXA
public final void beginXA() -
getTransaction
-
invokeAfterCommit
-
commitXA
public final void commitXA(boolean activateItems) -
getItem
-
getDirectory
Return the item specified by its absolutepathor create such an item if does not yet exist.pluginis stored as the plugin that was responsible for creating the item (only if an item was created).pluginmay be null to signal that there is no responsible instance.- Parameters:
path- absolute pathplugin- descriptor of responsible plugin- Returns:
- item specified by path
-
getPluginDirectory
-
getExtensionDirectory
-
getPluginDescriptor
-
activateItems
public final boolean activateItems() -
getActivationStamp
public int getActivationStamp() -
startup
public void startup() -
isActive
public boolean isActive() -
dispose
public void dispose() -
setUserProperty
-
getUserProperty
-
transactionApplied
- Specified by:
transactionAppliedin interfaceXAListener
-
setField
public void setField(PersistenceCapable o, PersistenceField field, int[] indices, Transaction.Reader reader) - Specified by:
setFieldin interfaceTransaction.Consumer
-
insertComponent
public void insertComponent(PersistenceCapable o, PersistenceField field, int[] indices, Transaction.Reader reader) - Specified by:
insertComponentin interfaceTransaction.Consumer
-
removeComponent
public void removeComponent(PersistenceCapable o, PersistenceField field, int[] indices, Transaction.Reader reader) - Specified by:
removeComponentin interfaceTransaction.Consumer
-
addEdgeBits
- Specified by:
addEdgeBitsin interfaceGraphTransaction.Consumer
-
removeEdgeBits
- Specified by:
removeEdgeBitsin interfaceGraphTransaction.Consumer
-
makePersistent
- Specified by:
makePersistentin interfaceTransaction.Consumer
-
makeTransient
- Specified by:
makeTransientin interfaceTransaction.Consumer
-
readData
- Specified by:
readDatain interfaceTransaction.Consumer
-
begin
public void begin()- Specified by:
beginin interfaceTransaction.Consumer
-
end
public void end()- Specified by:
endin interfaceTransaction.Consumer
-
getResourceLibraryLoader
-
lookup
- Specified by:
lookupin interfaceSharedObjectProvider.Binding
-
getProviderName
- Specified by:
getProviderNamein interfaceSharedObjectProvider
-
readReference
- Specified by:
readReferencein interfaceSharedObjectProvider- Throws:
IOException
-
createXMLSource
-
createXMLReader
-
equals
- Specified by:
equalsin interfaceTreeDiff.NodeModel
-
getDiffInfo
- Specified by:
getDiffInfoin interfaceTreeDiff.NodeModel
-
getClassLoader
- Specified by:
getClassLoaderin interfaceTypeLoader
-
classForName
- Specified by:
classForNamein interfaceTypeLoader- Throws:
ClassNotFoundException
-
typeForName
- Specified by:
typeForNamein interfaceTypeLoader- Throws:
ClassNotFoundException
-
setCurrent
-
current
-
getStaticsDirectory
The static Directory contains the statics import that are added in RGG classes by defaults. This directory contains the sub directories /methods , /variables , and /classes. The elements from that directory are used for the function browser, and the autocompletion.- Returns:
-
addContentDescription
Add the ContentDescriptionTypes to the registry. These types are loaded into every rgg model by default. These elements can be used for the display in the FunctionBrowser and the AutoCompletors.- Parameters:
methods-
-