|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.grogra.util.LockableImpl de.grogra.persistence.PersistenceManager de.grogra.graph.impl.GraphManager
public class GraphManager
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface de.grogra.util.Lockable |
---|
Lockable.DeadLockException |
Nested classes/interfaces inherited from interface de.grogra.persistence.SharedObjectProvider |
---|
SharedObjectProvider.Binding |
Field Summary | |
---|---|
LongToIntHashMap |
baseMap
A mapping of each node ID (participating in integration) to an index into the rate vector is stored here. |
static I18NBundle |
I18N
|
static java.lang.String |
META_GRAPH
|
double[] |
rate
Stores a reference to the rate vector. |
static GraphManager |
STATIC
|
static GraphState |
STATIC_STATE
|
Fields inherited from class de.grogra.persistence.PersistenceManager |
---|
makeLock |
Fields inherited from interface de.grogra.graph.Graph |
---|
BRANCH_EDGE, CONTAINMENT_EDGE, CONTAINMENT_END_EDGE, EDGENODE_IN_EDGE, EDGENODE_OUT_EDGE, ELLIPSE_SYMBOL, MAIN_GRAPH, MARK_EDGE, MIN_NORMAL_BIT_INDEX, MIN_UNUSED_EDGE, MIN_UNUSED_EDGE_BIT, NOTIFIES_EDGE, PERSISTENT, PERSISTENT_DELETED, RECTANGLE_SYMBOL, REFINEMENT_EDGE, RHOMBUS_SYMBOL, ROUND_RECTANGLE_SYMBOL, SPECIAL_EDGE_MASK, SPECIAL_EDGE_OF_SOURCE_BIT, STD_EDGE_5, STD_EDGE_6, SUCCESSOR_EDGE, TRANSIENT |
Constructor Summary | |
---|---|
GraphManager(PersistenceConnection cx,
java.lang.String key,
boolean logLifeCycle,
boolean checkLock)
|
Method Summary | ||
---|---|---|
void |
accept(java.lang.Object start,
Visitor v,
ArrayPath placeInPath)
|
|
static void |
acceptGraph(Node root,
Visitor v,
ArrayPath pathToUse)
|
|
void |
addAttributeChangeListener(AttributeChangeListener l)
|
|
void |
addAttributeChangeListener(java.lang.Object object,
boolean asNode,
AttributeChangeListener l)
|
|
void |
addChangeBoundaryListener(ChangeBoundaryListener l)
|
|
void |
addEdgeChangeListener(EdgeChangeListener l)
|
|
void |
addEdgeChangeListener(java.lang.Object object,
boolean asNode,
EdgeChangeListener l)
|
|
void |
addMetaNode(Node node,
Transaction t)
|
|
void |
addSharedObjectListener(java.beans.PropertyChangeListener l)
|
|
int |
allocateBitMark(boolean resetOnDispose)
|
|
int |
allocateObjectMark(boolean resetOnDispose)
|
|
void |
appendXLTo(java.lang.StringBuffer buf,
boolean qualified)
|
|
protected void |
completeTransaction(Transaction t,
boolean commit)
|
|
BooleanMap |
createBooleanMap()
|
|
|
createObjectMap()
|
|
GraphState |
createStaticState(ThreadContext tc)
|
|
protected Transaction |
createTransaction(java.lang.Thread thread)
|
|
protected TransactionApplier |
createXAApplier()
|
|
void |
disposeBitMark(int handle,
boolean resetAll)
|
|
void |
disposeBitMark(int handle,
boolean resetAll,
boolean onlyNodes)
|
|
void |
disposeObjectMark(int handle,
boolean resetAll)
|
|
void |
disposeObjectMark(int handle,
boolean resetAll,
boolean onlyNodes)
|
|
void |
dumpNodeStatistics(java.io.OutputStream out)
|
|
void |
dumpNodeStatistics(java.io.PrintWriter out)
|
|
protected void |
enterWriteLock()
|
|
protected void |
executeInAllowedThread(java.lang.Runnable r)
|
|
AttributeAccessor |
getAccessor(java.lang.Object object,
boolean asNode,
Attribute attribute)
Returns an attribute accessor for the given attribute on the given object. |
|
Attribute[] |
getAttributes(java.lang.Object object,
boolean asNode)
Returns the set of attributes which are available for the given object. |
|
int |
getColor(java.lang.Object object,
boolean asNode)
|
|
Attribute[] |
getDependent(java.lang.Object object,
boolean asNode,
Attribute a)
Returns the set of attributes whose values depend on the given attribute a for the given object . |
|
java.lang.Object |
getDescription(java.lang.Object object,
boolean asNode,
java.lang.String type)
Returns a description for the given object. |
|
int |
getEdgeBits(java.lang.Object edge)
Returns the edge bits of an edge. |
|
Extent |
getExtent(java.lang.Class type)
|
|
Extent |
getExtent(Type type)
|
|
java.lang.Object |
getFirstEdge(java.lang.Object node)
Returns the first edge of the linked list of edges of node . |
|
long |
getId(java.lang.Object node)
Returns a unique identifier for the given node . |
|
Instantiator |
getInstantiator(java.lang.Object node)
|
|
int |
getLifeCycleState(java.lang.Object object,
boolean asNode)
Returns the life cycle state of the given object as part of this graph. |
|
GraphState |
getMainState()
Returns the main graph state. |
|
java.lang.String |
getName(java.lang.Object object,
boolean asNode)
Returns a name for the given object. |
|
java.lang.Object |
getNextEdge(java.lang.Object edge,
java.lang.Object parentNode)
Returns the edge after edge in the linked list
of edges of node . |
|
java.lang.Object |
getNodeForId(long id)
Returns the node identified by id . |
|
Node |
getNodeForName(java.lang.String name)
|
|
Node |
getObject(long id)
|
|
java.lang.Object |
getObjectForName(boolean node,
java.lang.String name)
Returns the object with the given name. |
|
ObjectAttribute |
getParentAttribute()
Defines the derived attribute which has as value the parent object. |
|
java.lang.Object |
getProperty(java.lang.String key)
|
|
java.lang.String |
getProviderName()
|
|
Node |
getRoot()
Returns the root node of the Graph.MAIN_GRAPH of this graph. |
|
java.lang.Object |
getRoot(java.lang.String key)
Returns the root node for the given root key. |
|
java.lang.String[] |
getRootKeys()
Returns the root keys for the graph. |
|
java.lang.Object |
getSourceNode(java.lang.Object edge)
Returns the source node of edge . |
|
SpecialEdgeDescriptor[] |
getSpecialEdgeDescriptors(java.lang.Object node,
boolean asSource)
|
|
java.util.Map |
getStateMap()
|
|
int |
getSymbol(java.lang.Object object,
boolean asNode)
|
|
java.lang.Object |
getTargetNode(java.lang.Object edge)
Returns the target node of edge . |
|
EdgePattern |
getTreePattern()
Defines the pattern used for the construction of this graph's tree. |
|
void |
initMainState(java.util.concurrent.Executor sync)
|
|
protected void |
invokeRun(LockProtectedRunnable task,
boolean sameThread,
Lock lock)
|
|
protected boolean |
isAllowedThread(boolean write)
|
|
protected void |
leaveWriteLock()
|
|
void |
logDataOnPersistenceChange(boolean value)
|
|
protected void |
makePersistentImpl(PersistenceCapable o,
long id,
Transaction t)
|
|
protected void |
makeTransientImpl(PersistenceCapable o,
Transaction t)
|
|
protected void |
prepareCompletion(Transaction t,
boolean commit)
|
|
long |
prepareId(PersistenceCapable node)
|
|
void |
readExtent(PersistenceInputStream in)
|
|
ResolvableReference |
readReference(PersistenceInput in)
|
|
void |
rebuildExtents()
|
|
void |
removeAllFromExtent()
Removes all nodes in graph from extent. |
|
void |
removeAttributeChangeListener(AttributeChangeListener l)
|
|
void |
removeAttributeChangeListener(java.lang.Object object,
boolean asNode,
AttributeChangeListener l)
|
|
void |
removeChangeBoundaryListener(ChangeBoundaryListener l)
|
|
void |
removeEdgeChangeListener(EdgeChangeListener l)
|
|
void |
removeEdgeChangeListener(java.lang.Object object,
boolean asNode,
EdgeChangeListener l)
|
|
void |
removeMetaNode(Node node,
Transaction t)
|
|
void |
removeSharedObjectListener(java.beans.PropertyChangeListener l)
|
|
void |
setMakePersistentTransitive(boolean value)
|
|
void |
setProperty(java.lang.String key,
java.lang.Object value)
|
|
void |
setRoot(java.lang.String key,
Node root)
|
|
void |
suppressLogging(boolean value)
|
|
java.lang.String |
toXLString(boolean qualified)
|
|
protected void |
transactionApplied(Transaction.Data xa,
boolean rollback,
Transaction t)
|
|
void |
writeExtent(GraphOutput out,
Node root)
|
|
void |
writeExtent(PersistenceOutputStream out)
|
|
void |
writeObject(Shareable object,
PersistenceOutput out)
|
Methods inherited from class de.grogra.persistence.PersistenceManager |
---|
addXAListener, beginTransaction, close, getActiveTransaction, getBindings, getConnection, getId, getLocalLog, getStamp, getTransaction, getTransactionData, getTransactions, idUsed, initNonlocalTransactionNotifier, localTransactionCommitted, localTransactionRolledBack, makePersistent, makePersistent, makeTransient, nextId, removeXAListener, transactionCommitted |
Methods inherited from class de.grogra.util.LockableImpl |
---|
execute, execute, executeForcedly, executeForcedly, getMaxWaitingTime, getQueueLength, isLocked |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface de.grogra.graph.Graph |
---|
getStamp |
Methods inherited from interface de.grogra.util.Lockable |
---|
execute, execute, executeForcedly, executeForcedly, getMaxWaitingTime, getQueueLength, isLocked |
Field Detail |
---|
public final LongToIntHashMap baseMap
public static final I18NBundle I18N
public static final java.lang.String META_GRAPH
public double[] rate
de.grogra.rgg.model.PropertyRuntime.GraphProperty#defRateAssign()
public static final GraphManager STATIC
public static final GraphState STATIC_STATE
Constructor Detail |
---|
public GraphManager(PersistenceConnection cx, java.lang.String key, boolean logLifeCycle, boolean checkLock)
Method Detail |
---|
public final void accept(java.lang.Object start, Visitor v, ArrayPath placeInPath)
accept
in interface Graph
public static void acceptGraph(Node root, Visitor v, ArrayPath pathToUse)
public void addAttributeChangeListener(AttributeChangeListener l)
addAttributeChangeListener
in interface Graph
public void addAttributeChangeListener(java.lang.Object object, boolean asNode, AttributeChangeListener l)
addAttributeChangeListener
in interface Graph
public void addChangeBoundaryListener(ChangeBoundaryListener l)
addChangeBoundaryListener
in interface Graph
public void addEdgeChangeListener(EdgeChangeListener l)
addEdgeChangeListener
in interface Graph
public void addEdgeChangeListener(java.lang.Object object, boolean asNode, EdgeChangeListener l)
addEdgeChangeListener
in interface Graph
public void addMetaNode(Node node, Transaction t)
public void addSharedObjectListener(java.beans.PropertyChangeListener l)
public final int allocateBitMark(boolean resetOnDispose)
allocateBitMark
in class PersistenceManager
public final int allocateObjectMark(boolean resetOnDispose)
allocateObjectMark
in class PersistenceManager
public void appendXLTo(java.lang.StringBuffer buf, boolean qualified)
protected void completeTransaction(Transaction t, boolean commit)
completeTransaction
in class PersistenceManager
public BooleanMap createBooleanMap()
createBooleanMap
in interface Graph
public <V> ObjectMap<V> createObjectMap()
createObjectMap
in interface Graph
public GraphState createStaticState(ThreadContext tc)
protected Transaction createTransaction(java.lang.Thread thread)
createTransaction
in class PersistenceManager
protected TransactionApplier createXAApplier()
createXAApplier
in class PersistenceManager
public final void disposeBitMark(int handle, boolean resetAll)
disposeBitMark
in class PersistenceManager
public final void disposeBitMark(int handle, boolean resetAll, boolean onlyNodes)
public final void disposeObjectMark(int handle, boolean resetAll)
disposeObjectMark
in class PersistenceManager
public final void disposeObjectMark(int handle, boolean resetAll, boolean onlyNodes)
public void dumpNodeStatistics(java.io.OutputStream out)
public void dumpNodeStatistics(java.io.PrintWriter out)
protected void enterWriteLock()
enterWriteLock
in class LockableImpl
protected void executeInAllowedThread(java.lang.Runnable r)
executeInAllowedThread
in class LockableImpl
public AttributeAccessor getAccessor(java.lang.Object object, boolean asNode, Attribute attribute)
Graph
getAccessor
in interface Graph
object
- the objectasNode
- true
if object
is a node,
false
if object
is an edgeattribute
- the attribute
public Attribute[] getAttributes(java.lang.Object object, boolean asNode)
Graph
getAttributes
in interface Graph
object
- the objectasNode
- true
if object
is a node,
false
if object
is an edge
public int getColor(java.lang.Object object, boolean asNode)
getColor
in interface Graph
public Attribute[] getDependent(java.lang.Object object, boolean asNode, Attribute a)
Graph
a
for the given object
.
getDependent
in interface Graph
object
- the objectasNode
- true
if object
is a node,
false
if object
is an edgea
- the attribute
public java.lang.Object getDescription(java.lang.Object object, boolean asNode, java.lang.String type)
Graph
type
; it is interpreted as in
Described.getDescription(String)
.
getDescription
in interface Graph
object
- the objectasNode
- true
if object
is a node,
false
if object
is an edgetype
- the type of description
null
public int getEdgeBits(java.lang.Object edge)
Graph
getEdgeBits
in interface Graph
edge
- the edge
Graph
public Extent getExtent(java.lang.Class type)
public Extent getExtent(Type type)
public java.lang.Object getFirstEdge(java.lang.Object node)
Graph
node
.
getFirstEdge
in interface Graph
node
- the common node of the edges of the linked list
Graph
,
Graph.getNextEdge(Object, Object)
public long getId(java.lang.Object node)
Graph
node
.
getId
in interface Graph
node
- a node
Graph.getNodeForId(long)
public Instantiator getInstantiator(java.lang.Object node)
getInstantiator
in interface Graph
public int getLifeCycleState(java.lang.Object object, boolean asNode)
Graph
getLifeCycleState
in interface Graph
object
- the object to testasNode
- true
if object
is a node,
false
if object
is an edge
Graph.PERSISTENT
, Graph.PERSISTENT_DELETED
,
Graph.TRANSIENT
public GraphState getMainState()
Graph
getMainState
in interface Graph
Graph
public java.lang.String getName(java.lang.Object object, boolean asNode)
Graph
getName
in interface Graph
object
- the objectasNode
- true
if object
is a node,
false
if object
is an edge
Graph.getObjectForName(boolean, String)
public java.lang.Object getNextEdge(java.lang.Object edge, java.lang.Object parentNode)
Graph
edge
in the linked list
of edges of node
.
getNextEdge
in interface Graph
edge
- the previous edge in the linked listparentNode
- the common node of the edges of the linked list
Graph
,
Graph.getFirstEdge(Object)
public java.lang.Object getNodeForId(long id)
Graph
id
.
getNodeForId
in interface Graph
id
- an identifier
null
if id
identifies no nodeGraph.getId(Object)
public Node getNodeForName(java.lang.String name)
public Node getObject(long id)
getObject
in class PersistenceManager
public java.lang.Object getObjectForName(boolean node, java.lang.String name)
Graph
null
is returned.
getObjectForName
in interface Graph
node
- true
if a node of the given name is to be found,
false
if an edge is to be foundname
- the name of the object
null
if no such object existsGraph.getName(Object, boolean)
public ObjectAttribute getParentAttribute()
Graph
getParentAttribute
in interface Graph
Graph
,
Graph.getTreePattern()
public java.lang.Object getProperty(java.lang.String key)
public java.lang.String getProviderName()
getProviderName
in interface SharedObjectProvider
public Node getRoot()
Graph.MAIN_GRAPH
of this graph.
public java.lang.Object getRoot(java.lang.String key)
Graph
getRoot
in interface Graph
key
- a root key, one of Graph.getRootKeys()
key
,
or null
if no such root node existsGraph
public java.lang.String[] getRootKeys()
Graph
getRootKeys
in interface Graph
Graph
,
Graph.getRoot(String)
public java.lang.Object getSourceNode(java.lang.Object edge)
Graph
edge
.
getSourceNode
in interface Graph
edge
- an edge
Graph
public SpecialEdgeDescriptor[] getSpecialEdgeDescriptors(java.lang.Object node, boolean asSource)
getSpecialEdgeDescriptors
in interface Graph
public java.util.Map getStateMap()
getStateMap
in interface Graph
public int getSymbol(java.lang.Object object, boolean asNode)
getSymbol
in interface Graph
public java.lang.Object getTargetNode(java.lang.Object edge)
Graph
edge
.
getTargetNode
in interface Graph
edge
- an edge
Graph
public EdgePattern getTreePattern()
Graph
getTreePattern
in interface Graph
Graph
,
Graph.getParentAttribute()
public void initMainState(java.util.concurrent.Executor sync)
protected void invokeRun(LockProtectedRunnable task, boolean sameThread, Lock lock)
invokeRun
in class LockableImpl
protected boolean isAllowedThread(boolean write)
isAllowedThread
in class LockableImpl
protected void leaveWriteLock()
leaveWriteLock
in class LockableImpl
public void logDataOnPersistenceChange(boolean value)
protected void makePersistentImpl(PersistenceCapable o, long id, Transaction t)
makePersistentImpl
in class PersistenceManager
protected void makeTransientImpl(PersistenceCapable o, Transaction t)
makeTransientImpl
in class PersistenceManager
protected void prepareCompletion(Transaction t, boolean commit)
prepareCompletion
in class PersistenceManager
public long prepareId(PersistenceCapable node)
prepareId
in class PersistenceManager
public void readExtent(PersistenceInputStream in) throws java.io.IOException
readExtent
in class PersistenceManager
java.io.IOException
public ResolvableReference readReference(PersistenceInput in) throws java.io.IOException
readReference
in interface SharedObjectProvider
java.io.IOException
public void rebuildExtents()
public void removeAllFromExtent()
public void removeAttributeChangeListener(AttributeChangeListener l)
removeAttributeChangeListener
in interface Graph
public void removeAttributeChangeListener(java.lang.Object object, boolean asNode, AttributeChangeListener l)
removeAttributeChangeListener
in interface Graph
public void removeChangeBoundaryListener(ChangeBoundaryListener l)
removeChangeBoundaryListener
in interface Graph
public void removeEdgeChangeListener(EdgeChangeListener l)
removeEdgeChangeListener
in interface Graph
public void removeEdgeChangeListener(java.lang.Object object, boolean asNode, EdgeChangeListener l)
removeEdgeChangeListener
in interface Graph
public void removeMetaNode(Node node, Transaction t)
public void removeSharedObjectListener(java.beans.PropertyChangeListener l)
public void setMakePersistentTransitive(boolean value)
public void setProperty(java.lang.String key, java.lang.Object value)
public void setRoot(java.lang.String key, Node root)
public void suppressLogging(boolean value)
public java.lang.String toXLString(boolean qualified)
protected void transactionApplied(Transaction.Data xa, boolean rollback, Transaction t)
transactionApplied
in class PersistenceManager
public void writeExtent(GraphOutput out, Node root) throws java.io.IOException
java.io.IOException
public void writeExtent(PersistenceOutputStream out) throws java.io.IOException
writeExtent
in class PersistenceManager
java.io.IOException
public void writeObject(Shareable object, PersistenceOutput out) throws java.io.IOException
writeObject
in interface SharedObjectProvider
java.io.IOException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |