Class ElementManager
java.lang.Object
org.eclipse.handly.model.impl.support.ElementManager
Manages element handle/body relationships for a Handly-based model.
Generally, each model will have its own instance of the element manager.
An instance of this class is safe for use by multiple threads.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionElementManager
(IBodyCache cache) Constructs an element manager with the given body cache. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Attempts to close the given element according to options specified in the given context.final ISourceFile[]
Returns the working copies currently managed by this manager.
-
Field Details
-
cache
-
-
Constructor Details
-
ElementManager
Constructs an element manager with the given body cache.- Parameters:
cache
- the body cache to be used by the element manager (notnull
)
-
-
Method Details
-
getWorkingCopies
Returns the working copies currently managed by this manager. Performs atomically.Note that the result may immediately become stale if other threads can create or destroy working copies that are managed by this manager.
- Returns:
- the working copies currently managed by this manager
(never
null
)
-
close
Attempts to close the given element according to options specified in the given context. If the current state of an open element does not permit closing (e.g., a working copy), it remains open. Closing of an element generally involves closing its children and removal of its body from the body cache. This method is called under the element manager lock.Subclasses may override this method, but are not intended to invoke it.
This implementation invokes
((IElementImplExtension)element).
.close_
(context)- Parameters:
element
- the element that needs closing (nevernull
)context
- the operation context (nevernull
)
-