Class DBOSWorkflowRegistrar

java.lang.Object
dev.dbos.transact.spring.DBOSWorkflowRegistrar
All Implemented Interfaces:
org.springframework.beans.factory.SmartInitializingSingleton

public class DBOSWorkflowRegistrar extends Object implements org.springframework.beans.factory.SmartInitializingSingleton
Scans all Spring beans after singleton initialization and registers those containing @Workflow annotated methods with the DBOS workflow registry.

This runs via SmartInitializingSingleton.afterSingletonsInstantiated(), which is guaranteed to fire before any SmartLifecycle beans start. That ordering ensures workflows are registered before DBOS.launch() is called by DBOSAutoConfiguration.DBOSLifecycle.

The raw (unwrapped) bean target is registered with DBOS rather than the Spring proxy, because DBOS invokes workflow methods directly on the stored target during execution and recovery. Step and child-workflow calls within a workflow body must therefore go through a self-injected Spring proxy (see DBOSAspect) to be intercepted.

This bean is registered by DBOSAutoConfiguration; declare your own @Bean DBOSWorkflowRegistrar to replace it.

  • Constructor Details

    • DBOSWorkflowRegistrar

      public DBOSWorkflowRegistrar(dev.dbos.transact.DBOS dbos, org.springframework.context.ApplicationContext applicationContext)
  • Method Details

    • afterSingletonsInstantiated

      public void afterSingletonsInstantiated()
      Specified by:
      afterSingletonsInstantiated in interface org.springframework.beans.factory.SmartInitializingSingleton