Skip to content

Investigate generating a proxy for @Lazy annotated beans #830

Open
@SentryMan

Description

@SentryMan

I was thinking about how quarkus injects a proxy for lazy beans, and it seems pretty convenient.

Given a class:

@Lazy
@Singleton
class SomeClass {

   void something(){
    //something
   }

}

Something like the following should be work:

public class ExampleService {

  private final SomeClass some;

  public ExampleService(SomeClass some) {
    this.some = some; // a generated proxy class is wired
  }

  public void example() {
   some.something(); //someclass is initialized here
  }
}

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions