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.Multicaster
Nested classes/interfaces inherited from interface de.grogra.persistence.SharedObjectProvider
SharedObjectProvider.Binding
Nested classes/interfaces inherited from interface de.grogra.persistence.Transaction.Consumer
Transaction.Consumer.Adapter, Transaction.Consumer.Multicaster
Nested classes/interfaces inherited from interface de.grogra.persistence.XAListener
XAListener.WeakDelegate
-
Field Summary
Modifier and TypeFieldDescriptionstatic final JoinedFileSystem
static final MimeType
static final String
static final JoinedFileSystem
static final String
static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
void
addContentDescription
(HashMap<String, ContentDescriptionType[]> contents) Add the ContentDescriptionTypes to the registry.void
addEdgeBits
(Node source, Node target, int mask) void
addSharedObject
(String directory, Shareable object, String name, boolean objDescribes) Adds aSharedObjectNode
forobject
to the meta-graph (seeGraphManager.META_GRAPH
) of the project graph (seegetProjectGraph()
), and creates a reference to this node in the specifieddirectory
of this registry.void
static int
void
begin()
final void
beginXA()
classForName
(String name) final void
commitXA
(boolean activateItems) static Registry
void
createXMLSource
(Collection requiredPlugins, XMLSerializer.Filter filter) static Registry
current()
void
dispose()
void
end()
boolean
Item[]
findAll
(ItemCriterion c, Object info, boolean resolve) findFirst
(ItemCriterion c, Object info, boolean resolve) findMax
(ItemComparator c, Object info, boolean resolve) void
forAll
(ItemCriterion c, Object info, ItemVisitor cb, Object cbInfo, boolean resolve) int
int
getChildCount
(Object parent) getDiffInfo
(Object node) getDirectory
(String path, PluginDescriptor plugin) Return the item specified by its absolutepath
or create such an item if does not yet exist.getFiles()
final String
getImportAttribute
(String key) int
getIndexOfChild
(Object parent, Object child) getLock()
final Object
getOrCreateProjectFile
(String systemId, Item[] path, boolean isDirectory) getPluginDescriptor
(String pluginId) final Item
final Object
getProjectFile
(String systemId) Returns theRegistry
which is linked with this instance.getRoot()
final Item
The static Directory contains the statics import that are added in RGG classes by defaults.final Transaction
getUserProperty
(int id) void
initFileSystem
(FileSystem fileSystem) void
void
insertComponent
(PersistenceCapable o, PersistenceField field, int[] indices, Transaction.Reader reader) final void
boolean
isActive()
boolean
final boolean
void
makePersistent
(long id, ManageableType type) void
void
readData
(PersistenceCapable o, Transaction.Reader reader) void
removeComponent
(PersistenceCapable o, PersistenceField field, int[] indices, Transaction.Reader reader) void
removeEdgeBits
(Node source, Node target, int mask) void
void
static void
setCurrent
(RegistryContext current) void
void
setField
(PersistenceCapable o, PersistenceField field, int[] indices, Transaction.Reader reader) void
setProjectName
(String projectName) setUserProperty
(int id, Object value) void
startup()
void
substituteFileSystem
(FileSystem newfs) void
transactionApplied
(Transaction.Data xa, boolean rollback) typeForName
(String name) void
valueForPathChanged
(TreePath path, Object newValue) void
writeObject
(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:
addTreeModelListener
in interfaceTreeModel
-
removeTreeModelListener
- Specified by:
removeTreeModelListener
in interfaceTreeModel
-
valueForPathChanged
- Specified by:
valueForPathChanged
in interfaceTreeModel
-
getChild
-
getChildCount
- Specified by:
getChildCount
in interfaceTreeModel
-
getIndexOfChild
- Specified by:
getIndexOfChild
in interfaceTreeModel
-
isLeaf
-
getRoot
-
create
-
createGraphs
-
initialize
public void initialize() -
getRegistry
Description copied from interface:RegistryContext
Returns theRegistry
which is linked with this instance.- Specified by:
getRegistry
in interfaceRegistryContext
- Returns:
- the registry linked with this instance
-
getLogger
-
addFileSystemListener
-
removeFileSystemListener
-
initFileSystem
-
substituteFileSystem
- Throws:
IOException
-
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 absolutepath
or create such an item if does not yet exist.plugin
is stored as the plugin that was responsible for creating the item (only if an item was created).plugin
may be null to signal that there is no responsible instance.- Parameters:
path
- absolute pathplugin
- descriptor of responsible plugin- Returns:
- item specified by path
-
getPluginDirectory
-
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:
transactionApplied
in interfaceXAListener
-
setField
public void setField(PersistenceCapable o, PersistenceField field, int[] indices, Transaction.Reader reader) - Specified by:
setField
in interfaceTransaction.Consumer
-
insertComponent
public void insertComponent(PersistenceCapable o, PersistenceField field, int[] indices, Transaction.Reader reader) - Specified by:
insertComponent
in interfaceTransaction.Consumer
-
removeComponent
public void removeComponent(PersistenceCapable o, PersistenceField field, int[] indices, Transaction.Reader reader) - Specified by:
removeComponent
in interfaceTransaction.Consumer
-
addEdgeBits
- Specified by:
addEdgeBits
in interfaceGraphTransaction.Consumer
-
removeEdgeBits
- Specified by:
removeEdgeBits
in interfaceGraphTransaction.Consumer
-
makePersistent
- Specified by:
makePersistent
in interfaceTransaction.Consumer
-
makeTransient
- Specified by:
makeTransient
in interfaceTransaction.Consumer
-
readData
- Specified by:
readData
in interfaceTransaction.Consumer
-
begin
public void begin()- Specified by:
begin
in interfaceTransaction.Consumer
-
end
public void end()- Specified by:
end
in interfaceTransaction.Consumer
-
lookup
- Specified by:
lookup
in interfaceSharedObjectProvider.Binding
-
getProviderName
- Specified by:
getProviderName
in interfaceSharedObjectProvider
-
readReference
- Specified by:
readReference
in interfaceSharedObjectProvider
- Throws:
IOException
-
createXMLSource
-
createXMLReader
-
equals
- Specified by:
equals
in interfaceTreeDiff.NodeModel
-
getDiffInfo
- Specified by:
getDiffInfo
in interfaceTreeDiff.NodeModel
-
getClassLoader
- Specified by:
getClassLoader
in interfaceTypeLoader
-
classForName
- Specified by:
classForName
in interfaceTypeLoader
- Throws:
ClassNotFoundException
-
typeForName
- Specified by:
typeForName
in 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
-
-