|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectde.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. |
|
int |
getGraphSize()
Number of nodes in the main graph. |
|
int |
getGraphSize(java.lang.String key)
Number of nodes of the specified graph. |
|
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. |
|
int |
getMetaGraphSize()
Number of nodes in the meta graph. |
|
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, getLog, getStamp, getTransaction, getTransactionData, getTransactions, idUsed, initNonlocalTransactionNotifier, localTransactionCommitted, localTransactionRolledBack, makePersistent, makePersistent, makeTransient, nextId, removeXAListener, transactionCommitted, undo |
| 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 Graphpublic void addChangeBoundaryListener(ChangeBoundaryListener l)
addChangeBoundaryListener in interface Graphpublic 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 PersistenceManagerpublic 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 PersistenceManagerpublic BooleanMap createBooleanMap()
createBooleanMap in interface Graphpublic <V> ObjectMap<V> createObjectMap()
createObjectMap in interface Graphpublic GraphState createStaticState(ThreadContext tc)
protected Transaction createTransaction(java.lang.Thread thread)
createTransaction in class PersistenceManagerprotected 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 LockableImplprotected 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 Graphobject - 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 Graphobject - 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)
Grapha for the given object.
getDependent in interface Graphobject - 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)
Graphtype; it is interpreted as in
Described.getDescription(String).
getDescription in interface Graphobject - the objectasNode - true if object is a node,
false if object is an edgetype - the type of description
nullpublic int getEdgeBits(java.lang.Object edge)
Graph
getEdgeBits in interface Graphedge - the edge
Graphpublic Extent getExtent(java.lang.Class type)
public Extent getExtent(Type type)
public java.lang.Object getFirstEdge(java.lang.Object node)
Graphnode.
getFirstEdge in interface Graphnode - the common node of the edges of the linked list
Graph,
Graph.getNextEdge(Object, Object)public int getGraphSize()
public int getGraphSize(java.lang.String key)
graph - identification key (one of: MAIN_GRAPH, COMPONENT_GRAPH, META_GRAPH)
public long getId(java.lang.Object node)
Graphnode.
getId in interface Graphnode - 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 Graphobject - the object to testasNode - true if object is a node,
false if object is an edge
Graph.PERSISTENT, Graph.PERSISTENT_DELETED,
Graph.TRANSIENTpublic GraphState getMainState()
Graph
getMainState in interface GraphGraphpublic int getMetaGraphSize()
public java.lang.String getName(java.lang.Object object,
boolean asNode)
Graph
getName in interface Graphobject - 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)
Graphedge in the linked list
of edges of node.
getNextEdge in interface Graphedge - 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)
Graphid.
getNodeForId in interface Graphid - 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)
Graphnull is returned.
getObjectForName in interface Graphnode - 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 GraphGraph,
Graph.getTreePattern()public java.lang.Object getProperty(java.lang.String key)
public java.lang.String getProviderName()
getProviderName in interface SharedObjectProviderpublic Node getRoot()
Graph.MAIN_GRAPH of this graph.
public java.lang.Object getRoot(java.lang.String key)
Graph
getRoot in interface Graphkey - a root key, one of Graph.getRootKeys()
key,
or null if no such root node existsGraphpublic java.lang.String[] getRootKeys()
Graph
getRootKeys in interface GraphGraph,
Graph.getRoot(String)public java.lang.Object getSourceNode(java.lang.Object edge)
Graphedge.
getSourceNode in interface Graphedge - an edge
Graph
public SpecialEdgeDescriptor[] getSpecialEdgeDescriptors(java.lang.Object node,
boolean asSource)
getSpecialEdgeDescriptors in interface Graphpublic java.util.Map getStateMap()
getStateMap in interface Graph
public int getSymbol(java.lang.Object object,
boolean asNode)
getSymbol in interface Graphpublic java.lang.Object getTargetNode(java.lang.Object edge)
Graphedge.
getTargetNode in interface Graphedge - an edge
Graphpublic EdgePattern getTreePattern()
Graph
getTreePattern in interface GraphGraph,
Graph.getParentAttribute()public void initMainState(java.util.concurrent.Executor sync)
protected void invokeRun(LockProtectedRunnable task,
boolean sameThread,
Lock lock)
invokeRun in class LockableImplprotected boolean isAllowedThread(boolean write)
isAllowedThread in class LockableImplprotected void leaveWriteLock()
leaveWriteLock in class LockableImplpublic 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 PersistenceManagerpublic long prepareId(PersistenceCapable node)
prepareId in class PersistenceManager
public void readExtent(PersistenceInputStream in)
throws java.io.IOException
readExtent in class PersistenceManagerjava.io.IOException
public ResolvableReference readReference(PersistenceInput in)
throws java.io.IOException
readReference in interface SharedObjectProviderjava.io.IOExceptionpublic 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 Graphpublic void removeChangeBoundaryListener(ChangeBoundaryListener l)
removeChangeBoundaryListener in interface Graphpublic 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 PersistenceManagerjava.io.IOException
public void writeObject(Shareable object,
PersistenceOutput out)
throws java.io.IOException
writeObject in interface SharedObjectProviderjava.io.IOException
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||