Package com.yworkflow.builder
Interface WorkflowEngineBuilderProvider
public interface WorkflowEngineBuilderProvider
Provider interface for creating WorkflowEngineBuilder instances. WorkflowEngineBuilderProvider
serves as a factory for WorkflowEngineBuilder instances, enabling dependency injection and
service provider * pattern for workflow engine creation.
WorkflowEngineBuilderProvider is used to create WorkflowEngineBuilder instances in a pluggable way, allowing different implementations to be used based on the runtime environment or configuration. It supports both automatic discovery via ServiceLoader and manual registration for environments where ServiceLoader is unreliable.
Key features:
- Service Provider Pattern - Pluggable provider implementations
- Automatic Discovery - ServiceLoader-based provider discovery
- Manual Registration - Programmatic provider registration
- Builder Factory - Creates WorkflowEngineBuilder instances
- Environment Flexibility - Works in various deployment environments
- Since:
- 1.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA private static class to hold the mutable provider instance. -
Method Summary
Modifier and TypeMethodDescriptionCreates a new WorkflowEngineBuilder instance.provider()Gets the current WorkflowEngineBuilderProvider instance.static voidManually registers a provider instance.
-
Method Details
-
createBuilder
WorkflowEngineBuilder createBuilder()Creates a new WorkflowEngineBuilder instance.- Returns:
- a new WorkflowEngineBuilder instance
-
registerProvider
Manually registers a provider instance. This is the recommended approach for environments where ServiceLoader is unreliable or unavailable.- Parameters:
provider- The provider implementation to use.
-
provider
Gets the current WorkflowEngineBuilderProvider instance. This method first checks for a manually registered provider, then falls back to ServiceLoader-based discovery.- Returns:
- the current WorkflowEngineBuilderProvider instance
- Throws:
IllegalStateException- if no provider is found and none is registered
-