I have a bean that contains some web client implementation that can be REST or SOAP:
@Stateless
public class Service{
private Client client;
@PostConstruct
public void init() {
this.client = new RESTClient();
}
}
Is there a way that I can update the "client", for example in a JSF controller and this change persists in the context of the entire application?
@ViewScoped
@ManagedBean
public class ServiceController {
@EJB
private Service service;
public void updateClient() {
// code to update the client
// Service.client = new SOAPClient();
}
}