lundi 6 juillet 2015

In a CDI Passivation Capable bean, is it possible to have non-passivation capable dependencies be re-injected rather than passivated?

In a CDI Passivation Capable bean, is it possible to have non-passivation capable dependencies be re-injected rather than passivated?

Consider this code:

@SessionScoped
public class UserData implements Serializable {
  @Inject
  private Logger log;
  private String data;
}


@ApplicationScoped
public class LoggerFactory {
  @Produces
  public Logger getLogger(){
  ...
  }
}

public class Logger {
...
}

So Logger is not Serializable, but I really don't care. When UserData is deserialized, is it possible to have the producer for Logger called again somehow?

Aucun commentaire:

Enregistrer un commentaire