Package dev.getelements.elements.sdk.spi
Class SharedElement
java.lang.Object
dev.getelements.elements.sdk.spi.SharedElement
- All Implemented Interfaces:
Element
,AutoCloseable
-
Constructor Summary
ConstructorsConstructorDescriptionSharedElement
(ElementRecord elementRecord, ServiceLocator serviceLocator, ElementRegistry parent) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes the element and releases any resources associated with the element.Attempts to find the current scope, returning anOptional
containing the scope, if present.Gets theElementDefinitionRecord
which providesGets theElementRegistry
which manages thisElement
.Gets theServiceLocator
associated with this element.void
Begins building theElementScope
for this thread.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.getelements.elements.sdk.Element
getCurrentScope
-
Constructor Details
-
SharedElement
public SharedElement(ElementRecord elementRecord, ServiceLocator serviceLocator, ElementRegistry parent)
-
-
Method Details
-
getElementRecord
Description copied from interface:Element
Gets theElementDefinitionRecord
which provides- Specified by:
getElementRecord
in interfaceElement
- Returns:
- the name of the element.
-
getServiceLocator
Description copied from interface:Element
Gets theServiceLocator
associated with this element.- Specified by:
getServiceLocator
in interfaceElement
- Returns:
- the
ServiceLocator
-
getElementRegistry
Description copied from interface:Element
Gets theElementRegistry
which manages thisElement
.- Specified by:
getElementRegistry
in interfaceElement
- Returns:
- the
ElementRegistry
-
withScope
Description copied from interface:Element
Begins building theElementScope
for this thread.- Specified by:
withScope
in interfaceElement
- Returns:
- the
ElementScope.Builder
to begin building the scope.
-
findCurrentScope
Description copied from interface:Element
Attempts to find the current scope, returning anOptional
containing the scope, if present.- Specified by:
findCurrentScope
in interfaceElement
- Returns:
- an
Optional
with theElementScope
-
publish
Description copied from interface:Element
-
close
public void close()Description copied from interface:Element
Closes the element and releases any resources associated with the element. Future calls to this instance will be undefined and may result in exceptions. The specific behavior is up to the element implementation.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceElement
-