Skip to content

Instantly share code, notes, and snippets.

@prashant4224
Created May 30, 2020 18:11
Show Gist options
  • Save prashant4224/f53698c49efe7dfcdf6abd30f2cd6c7e to your computer and use it in GitHub Desktop.
Save prashant4224/f53698c49efe7dfcdf6abd30f2cd6c7e to your computer and use it in GitHub Desktop.
@Component
public class RequestManager{
@Autowired
private RequestHandler requestHandler;
public void handleRequest(){
requestHandler.handleRequest();
}
}
import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;
import org.springframework.stereotype.Component;
@Component
@Scope(value = "prototype", proxyMode = ScopedProxyMode.TARGET_CLASS)
public class RequestHandler {
RequestHandler(){
System.out.println("In Request Handler Constructor");
}
public void handleRequest(){
System.out.println("Handling request");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment