Top Description Inners Fields Constructors Methods
org.eclipse.jetty.ee10.servlet

public Class ServletContainerInitializerHolder

extends BaseHolder<ServletContainerInitializer>
Class Inheritance
Imports
java.util.Arrays, .Collections, .HashSet, .Objects, .Set, java.util.regex.Matcher, .Pattern, jakarta.servlet.ServletContainerInitializer, .ServletContext, .ServletException, org.eclipse.jetty.server.Context, org.eclipse.jetty.server.handler.ContextHandler, org.eclipse.jetty.util.Loader, .NanoTime, .StringUtil, org.slf4j.Logger, .LoggerFactory

Holds a ServletContainerInitializer.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
ServletContainerInitializerHolder.WrapFunction

Experimental Wrapper mechanism for ServletContainerInitializer objects.

public static class

Field Summary

Modifier and TypeField and Description
public static final Pattern
protected Set<Class<?>>
protected Set<String>
private static final Logger

Constructor Summary

AccessConstructor and Description
protected
public
public
public
ServletContainerInitializerHolder(Class<? extends ServletContainerInitializer> sciClass, Class<?>... startupClasses)

public
public

Method Summary

Modifier and TypeMethod and Description
public void
addStartupClasses(String...
the names of classes which should be passed to the SCI onStartup method
names
)

Add the names of classes which should be passed to the SCI onStartup method.

public void
addStartupClasses(Class<?>...
classes that should be passed to the SCI onStartup method
clazzes
)

Add classes that should be passed to the SCI onStartup method.

public void
doStart()

Overrides org.eclipse.jetty.ee10.servlet.BaseHolder.doStart.

Method to override to start the lifecycle
public static ServletContainerInitializerHolder

Returns:

a new ServletContainerInitializerHolder instance populated by the info in the string
fromString
(ClassLoader
the classloader to use to load the startup classes
loader
,
String
the stringified representation of the ServletContainerInitializerHolder
string
)

Re-inflate a stringified ServletContainerInitializerHolder.

protected Set<Class<?>>
public String
toString()

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.toString.

Returns a string representation of the object.
Inherited from org.eclipse.jetty.ee10.servlet.BaseHolder:
createInstancedoStopdumpdumpgetClassNamegetHeldClassgetInstancegetServletContextgetServletContextHandlergetServletHandlergetSourceillegalStateIfContextStartedinitializeisInstancelocklockIsHeldByCurrentThreadsetClassNamesetHeldClasssetInstancesetServletHandlerunwrapwrap

Field Detail

__patternback to summary
public static final Pattern __pattern
_startupClassesback to summary
protected Set<Class<?>> _startupClasses
_startupClassNamesback to summary
protected Set<String> _startupClassNames
LOGback to summary
private static final Logger LOG

Hides org.eclipse.jetty.ee10.servlet.BaseHolder.LOG.

Constructor Detail

ServletContainerInitializerHolderback to summary
protected ServletContainerInitializerHolder(Source source)
ServletContainerInitializerHolderback to summary
public ServletContainerInitializerHolder()
ServletContainerInitializerHolderback to summary
public ServletContainerInitializerHolder(Class<? extends ServletContainerInitializer> sciClass)
ServletContainerInitializerHolderback to summary
public ServletContainerInitializerHolder(Class<? extends ServletContainerInitializer> sciClass, Class<?>... startupClasses)
ServletContainerInitializerHolderback to summary
public ServletContainerInitializerHolder(ServletContainerInitializer sci, Class<?>... startupClasses)
ServletContainerInitializerHolderback to summary
public ServletContainerInitializerHolder(Source source, ServletContainerInitializer sci, Class<?>... startupClasses)

Method Detail

addStartupClassesback to summary
public void addStartupClasses(String... names)

Add the names of classes which should be passed to the SCI onStartup method.

Parameters
names:String[]

the names of classes which should be passed to the SCI onStartup method

addStartupClassesback to summary
public void addStartupClasses(Class<?>... clazzes)

Add classes that should be passed to the SCI onStartup method.

Parameters
clazzes:Class<?>[]

classes that should be passed to the SCI onStartup method

doStartback to summary
public void doStart() throws Exception

Overrides org.eclipse.jetty.ee10.servlet.BaseHolder.doStart.

Doc from org.eclipse.jetty.util.component.AbstractLifeCycle.doStart.

Method to override to start the lifecycle

Annotations
@Override
Exceptions
Exception:
If there was a problem starting. Will cause a transition to FAILED state
fromStringback to summary
public static ServletContainerInitializerHolder fromString(ClassLoader loader, String string)

Re-inflate a stringified ServletContainerInitializerHolder.

Parameters
loader:ClassLoader

the classloader to use to load the startup classes

string:String

the stringified representation of the ServletContainerInitializerHolder

Returns:ServletContainerInitializerHolder

a new ServletContainerInitializerHolder instance populated by the info in the string

resolveStartupClassesback to summary
protected Set<Class<?>> resolveStartupClasses() throws Exception
toStringback to summary
public String toString()

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
org.eclipse.jetty.ee10.servlet back to summary

public Interface ServletContainerInitializerHolder.WrapFunction


Experimental Wrapper mechanism for ServletContainerInitializer objects.

Beans in ServletContextHandler or WebAppContext that implement this interface will be called to optionally wrap any newly created ServletContainerInitializers (before their onStartup method is called)

Method Summary

Modifier and TypeMethod and Description
public ServletContainerInitializer

Returns:

the sci(extend from Wrapper if you do wrap the ServletContainerInitializer)
wrapServletContainerInitializer
(ServletContainerInitializer
the ServletContainerInitializer being passed in.
sci
)

Optionally wrap the ServletContainerInitializer.

Method Detail

wrapServletContainerInitializerback to summary
public ServletContainerInitializer wrapServletContainerInitializer(ServletContainerInitializer sci)

Optionally wrap the ServletContainerInitializer.

Parameters
sci:ServletContainerInitializer

the ServletContainerInitializer being passed in.

Returns:ServletContainerInitializer

the sci(extend from Wrapper if you do wrap the ServletContainerInitializer)

org.eclipse.jetty.ee10.servlet back to summary

public Class ServletContainerInitializerHolder.Wrapper

extends Object
implements ServletContainerInitializer, BaseHolder.Wrapped<ServletContainerInitializer>
Class Inheritance
  • java.lang.Object
  • org.eclipse.jetty.ee10.servlet.ServletContainerInitializerHolder.Wrapper
All Implemented Interfaces
org.eclipse.jetty.ee10.servlet.BaseHolder.Wrapped, jakarta.servlet.ServletContainerInitializer

Field Summary

Modifier and TypeField and Description
private final ServletContainerInitializer

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public ServletContainerInitializer
public void
onStartup(Set<Class<?>>
the Set of application classes that extend, implement, or have been annotated with the class types specified by the HandlesTypes annotation, or null if there are no matches, or this ServletContainerInitializer has not been annotated with HandlesTypes
c
,
ServletContext
the ServletContext of the web application that is being started and in which the classes contained in c were found
ctx
)

Implements jakarta.servlet.ServletContainerInitializer.onStartup.

Notifies this ServletContainerInitializer of the startup of the application represented by the given ServletContext.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

_wrappedSCIback to summary
private final ServletContainerInitializer _wrappedSCI

Constructor Detail

Wrapperback to summary
public Wrapper(ServletContainerInitializer sci)

Method Detail

getWrappedback to summary
public ServletContainerInitializer getWrapped()

Implements org.eclipse.jetty.ee10.servlet.BaseHolder.Wrapped.getWrapped.

Annotations
@Override
onStartupback to summary
public void onStartup(Set<Class<?>> c, ServletContext ctx) throws ServletException

Implements jakarta.servlet.ServletContainerInitializer.onStartup.

Doc from jakarta.servlet.ServletContainerInitializer.onStartup.

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 as described above, its onStartup method will be invoked every time an application is started.

Parameters
c:Set<Class<?>>

the Set of application classes that extend, implement, or have been annotated with the class types specified by the HandlesTypes annotation, or null if there are no matches, or this ServletContainerInitializer has not been annotated with HandlesTypes

ctx:ServletContext

the ServletContext of the web application that is being started and in which the classes contained in c were found

Annotations
@Override
Exceptions
ServletException:
if an error has occurred
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override