Class HandleService
java.lang.Object
com.tccc.kos.commons.util.ready.ReadyBean
com.tccc.kos.commons.core.service.AbstractService
com.tccc.kos.commons.core.service.handle.HandleService
- All Implemented Interfaces:
CtxEventListener
,ContextHandleAware
,HandleAware
,HandleGetter
,Ready
,ReadyListener
System wrapper around
HandleMgr
, as HandleMgr
should only be used by internal kOS code.- Since:
- 1.0
- Version:
- 2023-03-06
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addViewClass
(String name, Class<?> clazz) Add a custom view class.Gets the bean with the specified handle path.<T> T
Gets the bean of the specified type for the specified handle path.<T> List<T>
Returns a list of beans of the specified type from the cached set of beans.Returns the list of handles in the cache.getRootHandle
(String name) Returns a root handle with the specified name, creating the instance if needed.void
removeViewClass
(String name) Remove a custom view class by the view name.Methods inherited from class com.tccc.kos.commons.core.service.AbstractService
getHandle, getHandlePrefix
Methods inherited from class com.tccc.kos.commons.util.ready.ReadyBean
getReady, onBeanReady, onDependenciesReady
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.tccc.kos.commons.core.context.CtxEventListener
onCtxAutowiringCompleted, onCtxDestroyed, onCtxPhaseCompleted
Methods inherited from interface com.tccc.kos.commons.core.service.handle.HandleAware
addHandleChild, getName, getPath
Methods inherited from interface com.tccc.kos.commons.util.ready.ReadyListener
onDependenciesGroupReady
-
Method Details
-
getRootHandle
Returns a root handle with the specified name, creating the instance if needed. -
getHandles
Returns the list of handles in the cache. -
addViewClass
Add a custom view class. This can be accessed via the handles endpoint to return a custom view of any handle path bean.- Parameters:
name
- name of the viewclazz
- the class to use for json serialization
-
removeViewClass
Remove a custom view class by the view name. -
getBean
Description copied from interface:HandleGetter
Gets the bean of the specified type for the specified handle path.- Specified by:
getBean
in interfaceHandleGetter
- Type Parameters:
T
- the expected bean type- Parameters:
path
- the handle path of the beanclazz
- the expected bean class- Returns:
- the specified bean cast to the specified type
-
getBean
Description copied from interface:HandleGetter
Gets the bean with the specified handle path.- Specified by:
getBean
in interfaceHandleGetter
- Parameters:
path
- the handle path for the bean- Returns:
- the bean for the specified path or null
-
getBeans
Description copied from interface:HandleGetter
Returns a list of beans of the specified type from the cached set of beans.- Specified by:
getBeans
in interfaceHandleGetter
- Parameters:
clazz
- the class of bean to return
-