Package org.onehippo.cms7.services
Class ServiceHolder<T>
- java.lang.Object
-
- org.onehippo.cms7.services.ServiceHolder<T>
-
- Direct Known Subclasses:
ProxiedServiceHolder
public class ServiceHolder<T> extends Object
The ServiceHolder holds a service object with its context classloader at the time of creating the holder.Service objects that are obtained in this way, e.g. through a
ServiceTracker
on aWhiteboardServiceRegistry
must be invoked with the context classloader set to thegetClassLoader()
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClassLoader
getClassLoader()
T
getServiceObject()
-
-
-
Method Detail
-
getClassLoader
public ClassLoader getClassLoader()
- Returns:
- the classloader from
Thread.currentThread().getContextClassLoader()
at the creation of this service holder.
-
getServiceObject
public T getServiceObject()
- Returns:
- the service object this holder was created for.
-
-