Kanzi  3.9.7
Java API
Domain Class Reference

Domain binds Kanzi subsystems and objects together. More...

Classes

interface  PluginHandler
 Plugin handler implements the functionality for loading a plugin from the associated plugin file. More...
 

Public Member Functions

ColorWorkflow getColorWorkflow ()
 Gets the currently configured color workflow. More...
 
MainLoopScheduler getMainLoopScheduler ()
 Returns the main loop scheduler that controls tasks and timers. More...
 
MetaclassRegistry getMetaclassRegistry ()
 Returns the metaclass registry that contains all available metadata in the domain. More...
 
long getNative ()
 Gets a pointer to the backing C++ instance. More...
 
Object getPlatformContext ()
 Returns the platform-specific context set by the active platform backend. More...
 
ResourceManager getResourceManager ()
 Returns the resource manager that contains all registered resources in the domain. More...
 
TaskDispatcher getTaskDispatcher ()
 Returns the task dispatcher of this domain. More...
 
void loadKzb (String fileName) throws FileNotFoundException
 Loads a kzb file from the file system, if the file is not already loaded. More...
 
void registerPlugin (Plugin plugin)
 Registers a plugin and the metadata it contains. More...
 
void registerPluginHandler (String protocol, PluginHandler handler)
 Registers a plugin handler for a given protocol. More...
 
void unregisterPluginHandler (String protocol)
 Unregisters existing plugin handler for a given protocol. More...
 

Detailed Description

Domain binds Kanzi subsystems and objects together.

All objects and subsystems in Kanzi are associated with a domain when created. Objects in the same domain share access to the same subsystems. Objects from different domains cannot be used together.

Member Function Documentation

ColorWorkflow getColorWorkflow ( )

Gets the currently configured color workflow.

Returns
ColorWorkflow in use.
MainLoopScheduler getMainLoopScheduler ( )

Returns the main loop scheduler that controls tasks and timers.

Returns
Instance of the main loop scheduler.
MetaclassRegistry getMetaclassRegistry ( )

Returns the metaclass registry that contains all available metadata in the domain.

Returns
Instance of the metaclass registry.
long getNative ( )

Gets a pointer to the backing C++ instance.

Returns
A pointer to the backing C++ instance. Type: kanzi::Domain*.
Object getPlatformContext ( )

Returns the platform-specific context set by the active platform backend.

On Android, this points to Android application context android.content.Context. On all other platforms, this is currently null.

Returns
Type-erased reference to platform-specific context.
ResourceManager getResourceManager ( )

Returns the resource manager that contains all registered resources in the domain.

Returns
Instance of the resource manager.
TaskDispatcher getTaskDispatcher ( )

Returns the task dispatcher of this domain.

You can use the task dispatcher returned by this function to dispatch tasks that the system executes on the thread of this domain.

Returns
Instance of the task dispatcher.
void loadKzb ( String  fileName) throws FileNotFoundException

Loads a kzb file from the file system, if the file is not already loaded.

You can also pass a cfg file that contains a list of kzb files that you want to load.

To load additional kzb files with the same name, use ResourceManager#addKzbFile(String).

Parameters
fileNameThe name of the kzb file or cfg file that contains a list of kzb files to load.
Exceptions
InvalidKzbFileExceptionThrows an InvalidKzbFileException when the kzb file is invalid.
FileNotFoundExceptionThrows a FileNotFoundException when the kzb file is not found.
void registerPlugin ( Plugin  plugin)

Registers a plugin and the metadata it contains.

Parameters
pluginPlugin to be registered.
void registerPluginHandler ( String  protocol,
PluginHandler  handler 
)

Registers a plugin handler for a given protocol.

Parameters
protocolThe format of the plugin file identified by its extension serves as a protocol. For example "dll" for windows shared libraries.
handlerA plugin handler that implements functionality for loading a plugin from the associated plugin file.
void unregisterPluginHandler ( String  protocol)

Unregisters existing plugin handler for a given protocol.

Parameters
protocolThe format of the plugin file identified by its extension serves as a protocol. For example "dll" for windows shared libraries.