Package org.eclipse.jetty.util.component
Interface Container
-
- All Known Subinterfaces:
Connector
,NetworkConnector
- All Known Implementing Classes:
AbstractConnectionFactory
,AbstractConnectionPool
,AbstractConnector
,AbstractConnectorHttpClientTransport
,AbstractConnectorHttpClientTransport.ClientSelectorManager
,AbstractHandler
,AbstractHandler.ErrorDispatchHandler
,AbstractHandlerContainer
,AbstractHTTP2ServerConnectionFactory
,AbstractHttpClientTransport
,AbstractLoginService
,AbstractNCSARequestLog
,AbstractNetworkConnector
,AbstractSessionCache
,AbstractSessionDataStore
,ALPNServerConnectionFactory
,AntWebAppContext
,AntWebAppContext.AntServletHandler
,AsyncDelayHandler
,AsyncNCSARequestLog
,AttributeContainerMap
,BufferedResponseHandler
,CachingSessionDataStore
,ClientContainer
,ConfigurableSpnegoLoginService
,ConnectHandler
,ConnectHandler.ConnectManager
,ConnectionManager
,ConstraintSecurityHandler
,ContainerLifeCycle
,ContextHandler
,ContextHandlerCollection
,CustomRequestLog
,DataSourceLoginService
,DebugHandler
,DefaultHandler
,DefaultSessionCache
,DefaultSessionIdManager
,DelegatingThreadPool
,DeploymentManager
,DetectorConnectionFactory
,DuplexConnectionPool
,EatWhatYouKill
,ErrorHandler
,ErrorPageErrorHandler
,ExecutorSizedThreadPool
,ExecutorThreadPool
,ExtensionStack
,FileBufferedResponseHandler
,FileSessionDataStore
,GCloudSessionDataStore
,GzipHandler
,HandlerCollection
,HandlerList
,HandlerWrapper
,HashLoginService
,HazelcastSessionDataStore
,HelloHandler
,HelloWorld
,HotSwapHandler
,HTTP2Client
,HTTP2ClientSession
,HTTP2CServerConnectionFactory
,HTTP2ServerConnectionFactory
,HTTP2ServerSession
,HTTP2Session
,HttpClient
,HttpClientTransportOverFCGI
,HttpClientTransportOverHTTP
,HttpClientTransportOverHTTP2
,HttpClientTransportOverUnixSockets
,HttpClientTransportOverUnixSockets.UnixSocketSelectorManager
,HttpConnectionFactory
,HttpDestination
,HttpDestinationOverFCGI
,HttpDestinationOverHTTP
,HttpDestinationOverHTTP2
,HttpServiceErrorPageErrorHandler
,HttpSpiContextHandler
,IdleTimeoutHandler
,InetAccessHandler
,InfinispanSessionDataStore
,IPAccessHandler
,JAASLoginService
,JDBCLoginService
,JDBCSessionDataStore
,JettyWebAppContext
,JsrSession
,KeyStoreScanner
,LeakTrackingByteBufferPool
,LeakTrackingConnectionPool
,LocalConnector
,LowResourceMonitor
,ManagedSelector
,ManyHandlers.ParamHandler
,ManyHandlers.WelcomeWrapHandler
,MavenServerConnector
,MongoSessionDataStore
,MonitoredQueuedThreadPool
,MovedContextHandler
,MultiplexConnectionPool
,MultiplexHttpDestination
,MultiplexHttpDestinationOverFCGI
,NativeWebSocketConfiguration
,NCSARequestLog
,NegotiatingServerConnectionFactory
,NetworkTrafficSelectChannelConnector
,NetworkTrafficServerConnector
,NoSqlSessionDataStore
,NullSessionCache
,NullSessionDataStore
,OpenIdConfiguration
,OpenIdLoginService
,OptionalSslConnectionFactory
,PoolingHttpDestination
,ProxyConnectionFactory
,QueuedThreadPool
,QuickStartWebApp
,RandomConnectionPool
,RawHTTP2ServerConnectionFactory
,RequestLogHandler
,ResourceHandler
,RewriteHandler
,RoundRobinConnectionPool
,ScopedHandler
,SecuredRedirectHandler
,SecurityHandler
,SelectorManager
,Server
,ServerConnector
,ServerConnector.ServerConnectorManager
,ServerContainer
,ServerFCGIConnectionFactory
,ServletContextHandler
,ServletHandler
,SessionHandler
,ShutdownHandler
,SimpleContainerScope
,SizeLimitHandler
,Slf4jRequestLog
,SslConnectionFactory
,StatisticsHandler
,ThreadLimitHandler
,UnixSocketConnector
,UnixSocketConnector.UnixSocketConnectorManager
,ValidatingConnectionPool
,WebAppContext
,WebSocketClient
,WebSocketHandler
,WebSocketHandler.Simple
,WebSocketServerFactory
,WebSocketSession
,WebSocketUpgradeHandlerWrapper
public interface Container
A Container
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
Container.InheritedListener
Inherited Listener.static interface
Container.Listener
A listener for Container events.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
addBean(java.lang.Object o)
Add a bean.boolean
addBean(java.lang.Object o, boolean managed)
Adds the given bean, explicitly managing it or not.void
addEventListener(Container.Listener listener)
Add an event listener.<T> T
getBean(java.lang.Class<T> clazz)
java.util.Collection<java.lang.Object>
getBeans()
<T> java.util.Collection<T>
getBeans(java.lang.Class<T> clazz)
<T> java.util.Collection<T>
getContainedBeans(java.lang.Class<T> clazz)
boolean
isManaged(java.lang.Object bean)
Test if this container manages a beanvoid
manage(java.lang.Object bean)
Manages a bean already contained by this aggregate, so that it is started/stopped/destroyed with this aggregate.boolean
removeBean(java.lang.Object o)
Removes the given bean.void
removeEventListener(Container.Listener listener)
Remove an event listener.void
unmanage(java.lang.Object bean)
Unmanages a bean already contained by this aggregate, so that it is not started/stopped/destroyed with this aggregate.
-
-
-
Method Detail
-
addBean
boolean addBean(java.lang.Object o)
Add a bean. If the bean is-aContainer.Listener
, then also do an implicitaddEventListener(Listener)
.- Parameters:
o
- the bean object to add- Returns:
- true if the bean was added, false if it was already present
-
getBeans
java.util.Collection<java.lang.Object> getBeans()
- Returns:
- the collection of beans known to this aggregate, in the order they were added.
- See Also:
getBean(Class)
-
getBeans
<T> java.util.Collection<T> getBeans(java.lang.Class<T> clazz)
- Type Parameters:
T
- the Bean type- Parameters:
clazz
- the class of the beans- Returns:
- a list of beans of the given class (or subclass), in the order they were added.
- See Also:
getBeans()
,getContainedBeans(Class)
-
getBean
<T> T getBean(java.lang.Class<T> clazz)
- Type Parameters:
T
- the Bean type- Parameters:
clazz
- the class of the bean- Returns:
- the first bean (in order added) of a specific class (or subclass), or null if no such bean exist
-
removeBean
boolean removeBean(java.lang.Object o)
Removes the given bean. If the bean is-aContainer.Listener
, then also do an implicitremoveEventListener(Listener)
.- Parameters:
o
- the bean to remove- Returns:
- whether the bean was removed
-
addEventListener
void addEventListener(Container.Listener listener)
Add an event listener.- Parameters:
listener
- the listener to add- See Also:
addBean(Object)
-
removeEventListener
void removeEventListener(Container.Listener listener)
Remove an event listener.- Parameters:
listener
- the listener to remove- See Also:
removeBean(Object)
-
unmanage
void unmanage(java.lang.Object bean)
Unmanages a bean already contained by this aggregate, so that it is not started/stopped/destroyed with this aggregate.- Parameters:
bean
- The bean to unmanage (must already have been added).
-
manage
void manage(java.lang.Object bean)
Manages a bean already contained by this aggregate, so that it is started/stopped/destroyed with this aggregate.- Parameters:
bean
- The bean to manage (must already have been added).
-
isManaged
boolean isManaged(java.lang.Object bean)
Test if this container manages a bean- Parameters:
bean
- the bean to test- Returns:
- whether this aggregate contains and manages the bean
-
addBean
boolean addBean(java.lang.Object o, boolean managed)
Adds the given bean, explicitly managing it or not.- Parameters:
o
- The bean object to addmanaged
- whether to managed the lifecycle of the bean- Returns:
- true if the bean was added, false if it was already present
-
getContainedBeans
<T> java.util.Collection<T> getContainedBeans(java.lang.Class<T> clazz)
- Type Parameters:
T
- the Bean type- Parameters:
clazz
- the class of the beans- Returns:
- the list of beans of the given class from the entire Container hierarchy. The order is primarily depth first and secondarily added order.
-
-