DRAFT

javax.servlet
Interface ServletContainerInitializer


public interface ServletContainerInitializer

Interface which may be implemented by a library/runtime in order to be notified by the container of any of the classes/interfaces in which it has expressed interest via the HandlesTypes annotation.

If an implementation of this interface does not have any such annotation, the container must pass a null set of classes to its onStartup(java.util.Set>, javax.servlet.ServletContext) method.

Implementations of this interface may be declared by a JAR file resource located inside the META-INF/services directory and named for the fully qualified class name of this interface, and will be discovered using the runtime's service provider lookup mechanism.

Since:
Servlet 3.0
See Also:
HandlesTypes

Method Summary
 void onStartup(java.util.Set<java.lang.Class<?>> c, ServletContext ctx)
          Notifies this ServletContainerInitializer of the startup of the application represented by the given ServletContext.
 

Method Detail

onStartup

void onStartup(java.util.Set<java.lang.Class<?>> c,
               ServletContext ctx)
Notifies this ServletContainerInitializer of the startup of the application represented by the given ServletContext.

If this ServletContainerInitializer is bundled in a JAR file inside the WEB-INF/lib directory of an application, its onStartup method will be invoked only once during the startup of the bundling application. If this ServletContainerInitializer is bundled inside a JAR file outside of any WEB-INF/lib directory, but still discoverable by the runtime's service provider lookup mechanism, its onStartup method will be invoked every time an application is started.

Parameters:
c - The set of classes in which this ServletContainerInitializer has expressed interest via the HandlesTypes annotation, or null if this ServletContainerInitializer does not have any such annotation
ctx - The ServletContext instance in which the types defined via the HandlesTypes annotation were found.

DRAFT

Submit a bug or feature

Copyright © 2009 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.