Class HandleService
java.lang.Object
com.kosdev.kos.commons.core.service.handle.HandleService
- All Implemented Interfaces:
HandleGetter
System wrapper around
HandleMgr, as HandleMgr should only be used by internal KOS code.- Since:
- 1
- Version:
- 1
-
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.
-
Method Details
-
getRootHandle
Returns a root handle with the specified name, creating the instance if needed.- Since:
- 1
-
getHandles
Returns the list of handles in the cache.- Since:
- 1
-
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- Since:
- 1
-
removeViewClass
Remove a custom view class by the view name.- Since:
- 1
-
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
-