T - The type of service.public abstract class AbstractServiceableComponent<T> extends net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent implements net.shibboleth.utilities.java.support.service.ServiceableComponent<T>, 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 ApplicationContext |
applicationContext
The context used to load this bean.
|
private 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() |
ApplicationContext |
getApplicationContext()
Get the context used to load this bean.
|
abstract T |
getComponent()
.
|
void |
pinComponent()
Grab the service lock shared.
|
void |
setApplicationContext(ApplicationContext context) |
void |
unloadComponent()
.
|
void |
unpinComponent()
drop the shared lock.
|
getId, setId@Nullable private ApplicationContext applicationContext
@Nonnull private final ReentrantReadWriteLock serviceLock
public void setApplicationContext(ApplicationContext context)
setApplicationContext in interface ApplicationContextAware@Nullable public ApplicationContext getApplicationContext()
@Nonnull public abstract T getComponent()
getComponent in interface net.shibboleth.utilities.java.support.service.ServiceableComponent<T>public void pinComponent()
unpinComponent() is called.pinComponent in interface net.shibboleth.utilities.java.support.service.ServiceableComponent<T>public void unpinComponent()
unpinComponent in interface net.shibboleth.utilities.java.support.service.ServiceableComponent<T>public void unloadComponent()
unloadComponent in interface net.shibboleth.utilities.java.support.service.ServiceableComponent<T>protected void doDestroy()
doDestroy in class net.shibboleth.utilities.java.support.component.AbstractInitializableComponentprotected void doInitialize()
throws net.shibboleth.utilities.java.support.component.ComponentInitializationException
doInitialize in class net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponentnet.shibboleth.utilities.java.support.component.ComponentInitializationExceptionCopyright © 1999–2016 Shibboleth Consortium. All rights reserved.