- All Superinterfaces:
Broadcaster
,Listener
,NamedObject
,Receiver<Transmittable>
,Repeater
,Transceiver
,Transmitter<Transmittable>
- All Known Subinterfaces:
ComponentMixin
- All Known Implementing Classes:
Application
,BaseComponent
,Server
Interface to KivaKit component functionality, including easy access to settings (see
Settings
) and object
registries (see Registry
).
Packaging Methods
Classes implementing this interface are provided with easy access to packages and package resources relative to the class' package:
relativeResource(String)
- Returns aResource
for the given path relative to the class implementing this interfacerelativePackage(String)
- Returns a KivaKitPackage
for the given path relative to the class implementing this interface
Settings Registry Methods
Settings for a component can be retrieved with settings(Class)
. This provides a simplified interface to load
settings objects specified by the user while also allowing for default settings when they are not specified. See
Settings
for details.
require(Class)
- Gets the given settings object or failsrequire(Class, Enum)
- Gets the settings object of the given instance or failsrequire(Class, String)
- Gets the settings object of the given instance or failsrequire(Class, InstanceIdentifier)
- Gets the settings object of the given instance or failssettings(Class)
- A settings object of the specified class or null if none existssettings(Class, Enum)
- Get any given instance of the given settings object typesettings(Class, String)
- Get any given instance of the given settings object typesettings(Class, InstanceIdentifier)
- Get any given instance of the given settings object typesettingsRegistry()
- Retrieves theSettings
registry for this componentregisterDeployment(Deployment)
- Adds the settings objects for the given deploymentregisterAllSettings(Settings)
- Adds the settings objects in the given settings registryregisterSettingsObject(Object)
- Adds the given settings objectregisterSettingsObject(Object, InstanceIdentifier)
- Adds the given settings object under the given instance identifierregisterAllSettingsIn(Folder)
- Adds settings objects from the given folderregisterAllSettingsIn(Package)
- Adds settings objects from the given package
Object Lookup Registry
Access to this component's lookup Registry
is provided and fulfills basic needs for object wiring:
lookup(Class)
- Lookup the registered object of the given type, if anylookup(Class, String)
- Find the given instance of the given class, if anylookup(Class, Enum)
- Find the given instance of the given class, if anylookup(Class, InstanceIdentifier)
- Find the given instance of the given class, if anyregisterObject(Object)
- Register the given singleton object for lookupregisterObject(Object, String)
- Register the given instance of the given object for lookupregisterObject(Object, Enum)
- Register the given instance of the given object for lookupregisterObject(Object, InstanceIdentifier)
- Register the given instance of the given object for lookupregistry()
- Retrieves the lookupRegistry
for this component
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T> T
Convenience method<T> T
lookup(Class<T> type, InstanceIdentifier instance)
default <T> T
Convenience methoddefault <T> T
Convenience methoddefault Resource
packageResource(String path)
void
registerAllSettings(Settings settings)
Registers the settings from the given settings registry with the settings registry for this componentvoid
registerAllSettingsIn(Folder folder)
Registers the settings in the given folder with the settings registry for this componentvoid
registerAllSettingsIn(Package package_)
Registers the settings in the given package with the registry for this componentdefault void
registerDeployment(Deployment deployment)
Adds the settings objects from the givenDeployment
to the settings registry for this component.default <T> T
registerObject(T object)
Convenience method<T> T
registerObject(T object, InstanceIdentifier instance)
Registers the given object and instance in the global objectRegistry
default <T> T
registerObject(T object, Enum<?> instance)
Convenience methoddefault <T> T
registerObject(T object, String instance)
Convenience methoddefault void
registerSettingsObject(Object settings)
Convenience methodvoid
registerSettingsObject(Object settings, InstanceIdentifier instance)
Registers the given instance of the given settings object with the lookup registry for this componentdefault Registry
registry()
default Package
relativePackage(String path)
default Resource
relativeResource(String path)
default <T> T
Convenience method<T> T
require(Class<T> type, InstanceIdentifier instance)
default <T> T
Convenience methoddefault <T> T
Convenience methoddefault <T> T
Convenience method<T> T
settings(Class<T> type, InstanceIdentifier instance)
default <T> T
Convenience methoddefault <T> T
Convenience methoddefault Settings
Methods inherited from interface com.telenav.kivakit.kernel.messaging.Broadcaster
addListener, addListener, clearListeners, hasListeners, messageSource, messageSource, onTransmit, removeListener, silence, transmit, transmit, transmitAll
Methods inherited from interface com.telenav.kivakit.kernel.messaging.Listener
isDeaf, listenTo, listenTo, message, onMessage
Methods inherited from interface com.telenav.kivakit.kernel.interfaces.naming.NamedObject
objectName, objectName
Methods inherited from interface com.telenav.kivakit.kernel.messaging.Repeater
onHandle, onReceive, receive
Methods inherited from interface com.telenav.kivakit.kernel.messaging.Transceiver
announce, debug, debugClassContext, debugCodeContext, debugCodeContext, fatal, fatal, glitch, glitch, glitch, glitch, halt, halt, handle, ifDebug, illegalArgument, illegalState, illegalState, information, isDebugOn, isOn, narrate, problem, problem, problem, problem, quibble, quibble, quibble, quibble, trace, trace, trace, trace, warning, warning, warning, warning
-
Method Details
-
lookup
Convenience method -
lookup
Convenience method -
lookup
Convenience method -
packageResource
- Returns:
- The resource at the given path relative to this component's class
-
registerObject
default <T> T registerObject(T object)Convenience method -
registerObject
Convenience method -
registerObject
Convenience method -
registerSettingsObject
Convenience method -
registry
- Returns:
- The lookup registry for this component
-
relativePackage
-
relativeResource
-
require
Convenience method -
require
Convenience method -
require
Convenience method -
settings
Convenience method -
settings
Convenience method -
settings
Convenience method -
settingsRegistry
- Returns:
- The settings registry for this component
-