Class LocalizationService
java.lang.Object
com.tccc.kos.commons.util.ready.ReadyBean
com.tccc.kos.commons.core.service.AbstractService
com.tccc.kos.core.service.localization.LocalizationService
- All Implemented Interfaces:
CtxEventListener
,ContextHandleAware
,HandleAware
,Ready
,ReadyListener
Centralized localization service that provides discoverability of
registered
LocalizationContext
objects. This is designed to
work with the ui sdk.- Version:
- 2024-04-08
-
Method Summary
Modifier and TypeMethodDescriptionvoid
mount
(String path, LocalizationContext ctx) Register aLocalizationContext
with the service.boolean
Override in subclasses to be notified when all dependencies are ready.void
Unregister aLocalizationContext
from the service.void
Unregister aLocalizationContext
with the specified mount path.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, 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
-
onBeanReady
public boolean onBeanReady()Description copied from class:ReadyBean
Override in subclasses to be notified when all dependencies are ready. Return true to indicate that this bean is also ready. If the bean needs to callsetReady()
later due to some async processing, return false to preventsetReady()
from being called automatically.It is recommended to override this method rather than
onDependenciesReady()
as a majority of the time it requires callingsuper.onDependneciesReady()
or explicitly callingsetReady()
which defaults to a failure mode.- Overrides:
onBeanReady
in classReadyBean
- Returns:
-
mount
Register aLocalizationContext
with the service. This will make the context available in the VFS and discoverable via associated endpoints. Contexts must be unmounted in order for them to be removed from the VFS and garbage collected.- Parameters:
path
- a unique path used to mount the context within the VFSctx
- the context to mount
-
unmount
Unregister aLocalizationContext
from the service. This will unmount the context and allow it to be garbage collected.- Parameters:
ctx
- the context to unmount
-
unmount
Unregister aLocalizationContext
with the specified mount path.- Parameters:
path
- the path used to mount the context
-