User Tools

Site Tools


dev-guide:disposable-node

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dev-guide:disposable-node [2025/01/08 15:22] gaetandev-guide:disposable-node [2025/01/08 16:16] (current) gaetan
Line 4: Line 4:
  
 Once a Node is "transient" it will be automatically garbage collected by Java.  Once a Node is "transient" it will be automatically garbage collected by Java. 
-However, in some specific cases the Node can have attributes (fields in java) that require a specific dispose method (e.g [[:groimp-platform:pointcloud|cloud]] objects, or [[:groimp-platform:graphexplorerstructure|secondary graph]]).+However, Node can have attributes (fields in java) that require a specific dispose method (e.g [[:groimp-platform:pointcloud|cloud]] objects, or [[:groimp-platform:graphexplorerstructure|secondary graph]]). 
 + 
 +In most cases, the nodes are not "informed" that they are made transient, thus it is not convenient to add a listener on them (see the GraphManager's [[:dev-guide:base-objects:graph-listeners|listeners]]). Indeed, when a Node is deleted, if it has connected edges of Node that are not connected to the graph anymore, they all are deleted. But only the first one is visited.   
 + 
 +To ensure an object (that can be used as a Node's attribute) is disposed properly it should implements the [[https://javadoc.grogra.de/graph/de/grogra/persistence/DisposableField.html|DisposableField]] interface. 
 + 
 +==== DisposableField interface ====  
 + 
 +In order to make the GraphManager dispose an attribute of a Node it (the field) simply needs to implement DisposableField. 
  
-pointers or references from that Node to other objects might not be disposed properly. In that case, it is possible to manually define how a Node should  
dev-guide/disposable-node.1736346172.txt.gz · Last modified: 2025/01/08 15:22 by gaetan