public final class AttachableServiceContainer extends ServiceContainer implements IAttachable
Constructor and Description |
---|
AttachableServiceContainer() |
Modifier and Type | Method and Description |
---|---|
void |
attachTo(IServiceContainer parentServiceContainer)
Attaches this instance to the instance of
IServiceContainer |
void |
detach()
Detaches this instance from currently attached
IServiceContainer instance |
<T> T |
getService(java.lang.Class<T> classType)
Gets the esrvice instance registered by type
|
<T> boolean |
hasService(java.lang.Class<T> classType)
Determines whether this instance has the service of specified type.
|
boolean |
isAttached()
Gets whether this instance is attached on not
|
deregisterService, registerService
public void attachTo(@NonNull IServiceContainer parentServiceContainer)
IServiceContainer
attachTo
in interface IAttachable
parentServiceContainer
- The target IServiceContainer
instancepublic void detach()
IServiceContainer
instancedetach
in interface IAttachable
public boolean isAttached()
isAttached
in interface IAttachable
public <T> boolean hasService(java.lang.Class<T> classType)
hasService
in interface IServiceContainer
hasService
in class ServiceContainer
T
- The type of service.classType
- The type of service.public <T> T getService(java.lang.Class<T> classType)
getService
in interface IServiceContainer
getService
in class ServiceContainer
T
- The type of service.classType
- The service type to get.