EmbeddedExtensionBuilder interface provides a fluent API for creating EmbeddedExtension instances with custom configuration.
Package
Interface Declaration
Methods
builder()
Creates a newEmbeddedExtensionBuilder instance.
EmbeddedExtensionBuilder- A new builder instance
withId()
Sets the unique ID of the extension.id(String) - The unique ID of the extension
EmbeddedExtensionBuilder- This builder instance for method chaining
withName()
Sets the human-readable name of the extension.name(String) - The name of the extension
EmbeddedExtensionBuilder- This builder instance for method chaining
withVersion()
Sets the version of the extension.version(String) - The version of the extension
EmbeddedExtensionBuilder- This builder instance for method chaining
withAuthor()
Sets the author of the extension.author(String) - The author of the extension, ornull
EmbeddedExtensionBuilder- This builder instance for method chaining
withPriority()
Sets the extension’s execution priority.priority(int) - The priority value. Extensions with higher priority are executed first.
EmbeddedExtensionBuilder- This builder instance for method chaining
0
Example:
withStartPriority()
Sets the extension’s start priority.startPriority(int) - The start priority value. Extensions with higher start priority are started first.
EmbeddedExtensionBuilder- This builder instance for method chaining
1000
Example:
withExtensionMain()
Sets the main class of the extension.extensionMain(ExtensionMain) - The extension main class that implementsextensionStart()andextensionStop()
EmbeddedExtensionBuilder- This builder instance for method chaining
build()
Creates anEmbeddedExtension instance with the configured values.
EmbeddedExtension- A new embedded extension instance
IllegalStateException- If any required parameter is missing
idnameversionextensionMain
Usage Examples
Minimal Extension
Full Configuration
Priority-Based Extensions
Validation Example
Required vs Optional Parameters
Required Parameters
The following parameters must be set before callingbuild(), or an IllegalStateException will be thrown:
withId()- Unique extension identifierwithName()- Human-readable namewithVersion()- Extension versionwithExtensionMain()- Extension main class
Optional Parameters
The following parameters have default values and are optional:withAuthor()- Default:nullwithPriority()- Default:0withStartPriority()- Default:1000
See Also
- EmbeddedExtension - The extension interface
- EmbeddedHiveMQBuilder - Add extensions to HiveMQ
- HiveMQ Extension SDK - Complete extension development guide