T - The type of service.public abstract class AbstractServiceableComponent<T> extends AbstractIdentifiedInitializableComponent implements ServiceableComponent<T>, org.springframework.context.ApplicationContextAware
ServiceableComponent that does most of the work required. It leverages the spring
environment to allow easy cleanup.| Modifier and Type | Field and Description |
|---|---|
private org.springframework.context.ApplicationContext |
applicationContext
The context used to load this bean.
|
private org.slf4j.Logger |
log
Class logger.
|
private ReentrantReadWriteLock |
serviceLock
Lock for this service.
|
| Constructor and Description |
|---|
AbstractServiceableComponent()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
doDestroy()
.
|
protected void |
doInitialize() |
org.springframework.context.ApplicationContext |
getApplicationContext()
Get the context used to load this bean.
|
abstract T |
getComponent()
.
|
void |
pinComponent()
Grab the service lock shared.
|
void |
setApplicationContext(org.springframework.context.ApplicationContext context) |
void |
unloadComponent()
.
|
void |
unpinComponent()
drop the shared lock.
|
getId, setIddestroy, initialize, isDestroyed, isInitialized@Nonnull private final org.slf4j.Logger log
@Nullable private org.springframework.context.ApplicationContext applicationContext
@Nonnull private final ReentrantReadWriteLock serviceLock
public void setApplicationContext(org.springframework.context.ApplicationContext context)
setApplicationContext in interface org.springframework.context.ApplicationContextAware@Nullable public org.springframework.context.ApplicationContext getApplicationContext()
@Nonnull public abstract T getComponent()
getComponent in interface ServiceableComponent<T>public void pinComponent()
unpinComponent() is called.pinComponent in interface ServiceableComponent<T>public void unpinComponent()
unpinComponent in interface ServiceableComponent<T>public void unloadComponent()
unloadComponent in interface ServiceableComponent<T>protected void doDestroy()
doDestroy in class AbstractInitializableComponentprotected void doInitialize()
throws ComponentInitializationException
doInitialize in class AbstractIdentifiedInitializableComponentComponentInitializationExceptionCopyright © 1999–2019 Shibboleth Consortium. All rights reserved.