Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [servlet-dev] Big ticket items for Servlet 6 / Jakarta EE 10?

On Mon, Dec 14, 2020 at 12:17 PM Greg Wilkins <gregw@xxxxxxxxxxx> wrote:
On Thu, 3 Sept 2020 at 00:20, Stuart Douglas <sdouglas@xxxxxxxxxx> wrote:
CDI needs more than just the instance to destroy the object properly, and you really need to let CDI actually create the instance to get interceptors etc. 

Ideally you want an API that looks like the Undertow one:

public interface InstanceFactory<T> {
    InstanceHandle<T> createInstance();
}

public interface InstanceHandle<T> {
    T getInstance();
    void release();
}

The problem here is that we already have the factory methods `ServletContext.createServlet(Class) etc.

Note btw that there was already an issues in the tracker for this: https://github.com/eclipse-ee4j/servlet-api/issues/162

Kind regards,
Arjan Tijms



 

Back to the top