diff --git a/server/src/main/java/com/hedera/block/server/BlockNodeAppInjectionComponent.java b/server/src/main/java/com/hedera/block/server/BlockNodeAppInjectionComponent.java index 05ed8be91..114bedc0d 100644 --- a/server/src/main/java/com/hedera/block/server/BlockNodeAppInjectionComponent.java +++ b/server/src/main/java/com/hedera/block/server/BlockNodeAppInjectionComponent.java @@ -45,29 +45,18 @@ public interface BlockNodeAppInjectionComponent { */ BlockNodeApp getBlockNodeApp(); - // @Component.Factory - // interface Factory { - // BlockNodeAppInjectionComponent create(@BindsInstance Configuration configuration); - // } - - /** Builder for the BlockNodeAppInjectionComponent. */ - @Component.Builder - interface Builder { - + /** + * Factory for the block node app injection component, needs a configuration to create the + * component and the block node app with all the wired dependencies. + */ + @Component.Factory + interface Factory { /** - * Bind the configuration to the BlockNodeAppInjectionComponent. + * Create the block node app injection component. * * @param configuration the configuration - * @return the BlockNodeAppInjectionComponentBuilder - */ - @BindsInstance - Builder configuration(Configuration configuration); - - /** - * Build the BlockNodeAppInjectionComponent. - * - * @return the BlockNodeAppInjectionComponent + * @return the block node app injection component */ - BlockNodeAppInjectionComponent build(); + BlockNodeAppInjectionComponent create(@BindsInstance Configuration configuration); } } diff --git a/server/src/main/java/com/hedera/block/server/Server.java b/server/src/main/java/com/hedera/block/server/Server.java index 4c8b0413e..51c8df1ee 100644 --- a/server/src/main/java/com/hedera/block/server/Server.java +++ b/server/src/main/java/com/hedera/block/server/Server.java @@ -55,10 +55,8 @@ public static void main(final String[] args) throws IOException { // Init Dagger DI Component, passing in the configuration. // this is where all the dependencies are wired up (magic happens) - // final BlockNodeAppInjectionComponent daggerComponent = - // DaggerBlockNodeAppInjectionComponent.factory().create(configuration); final BlockNodeAppInjectionComponent daggerComponent = - DaggerBlockNodeAppInjectionComponent.builder().configuration(configuration).build(); + DaggerBlockNodeAppInjectionComponent.factory().create(configuration); // Use Dagger DI Component to start the BlockNodeApp with all wired dependencies final BlockNodeApp blockNodeApp = daggerComponent.getBlockNodeApp();