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,ReadyAndReadyListener,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 TypeMethodDescriptionvoidaddViewClass(String name, Class<?> clazz) Add a custom view class.Gets the bean with the specified handle path.<T> TGets 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.voidremoveViewClass(String name) Remove a custom view class by the view name.Methods inherited from class com.tccc.kos.commons.core.service.AbstractService
getHandle, getHandlePrefixMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.tccc.kos.commons.core.context.CtxEventListener
onCtxAutowiringCompleted, onCtxDestroyed, onCtxPhaseCompletedMethods inherited from interface com.tccc.kos.commons.core.service.handle.HandleAware
addHandleChild, getName, getPathMethods inherited from interface com.tccc.kos.commons.util.ready.ReadyAndReadyListener
onBeanReady, onDependenciesReadyMethods 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:HandleGetterGets the bean of the specified type for the specified handle path.- Specified by:
getBeanin 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:HandleGetterGets the bean with the specified handle path.- Specified by:
getBeanin interfaceHandleGetter- Parameters:
path- the handle path for the bean- Returns:
- the bean for the specified path or null
-
getBeans
Description copied from interface:HandleGetterReturns a list of beans of the specified type from the cached set of beans.- Specified by:
getBeansin interfaceHandleGetter- Parameters:
clazz- the class of bean to return
-