- Type Parameters:
T- The underlying type of the component.
public interface ServiceableComponent<T>
Any component that wants to be reloaded via the Service interface and Spring implements this interface. The idea is that the attribute resolver will be
public class AttributeResolver extends AbstractServiceableComponent<AttributeResolver> implements AttributeResolver, ServiceableComponent<ServiceableComponent>.AbstractServiceableComponent will do all the work around reload and synchronization.
Method SummaryModifier and TypeMethodDescriptionExtract the component that does the actual work.
voidThis function takes a lock on the component which guarantees that it will not be disposed until the unpin call is made.
voidThis call will wait for all transient operations to complete and then calls dispose on the components.
getComponent@Nonnull T getComponent()Extract the component that does the actual work. Callers MUST have the ServiceableComponent pinned at this stage.
- the component.
pinComponentvoid pinComponent()This function takes a lock on the component which guarantees that it will not be disposed until the unpin call is made.
This method is typically only used during initialization of the component.
Every call to
pinComponent()must be matched by a call to
unloadComponentvoid unloadComponent()This call will wait for all transient operations to complete and then calls dispose on the components.
Implementations should avoid calling this with locks held.