Skip to content

Instantly share code, notes, and snippets.

@vladdedita
Created November 29, 2023 08:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vladdedita/a86b06b3a8089be1a21f04ad8c94f87b to your computer and use it in GitHub Desktop.
Save vladdedita/a86b06b3a8089be1a21f04ad8c94f87b to your computer and use it in GitHub Desktop.
@Component
public abstract class SingletonService {
public void usePrototype() {
PrototypeService prototypeService = createPrototypeService();
prototypeService.doSomething();
}
@Lookup
public PrototypeService createPrototypeService() {
return null; //Spring will replace the implementation anyway
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment