public abstract class Container extends Object implements ComponentRegistry, ComponentEx
Often technologies that are built on top of JAX-WS
(such as Tango) needs to negotiate private contracts between
them and the container. This interface allows such technologies
to query the negotiated SPI by using the getSPI(Class)
.
For example, if a security pipe needs to get some information from a container, they can do the following:
WSEndpoint
and then to Container
.
This protects JAX-WS from worrying about the details of such contracts, while still providing the necessary service of hooking up those parties.
Technologies that run inside JAX-WS server runtime can access this object through
WSEndpoint.getContainer()
. In the client runtime, it can be accessed from
ContainerResolver.getContainer()
WSEndpoint
Modifier and Type | Field and Description |
---|---|
static Container |
NONE
Constant that represents a "no
Container ",
which always returns null from getSPI(Class) . |
Modifier | Constructor and Description |
---|---|
protected |
Container()
For derived classes.
|
Modifier and Type | Method and Description |
---|---|
Set<Component> |
getComponents()
Returns the set of
Component s registered with this object |
<E> Iterable<E> |
getIterableSPI(Class<E> spiType)
Gets an iterator of implementations of the specified SPI.
|
<S> S |
getSPI(Class<S> spiType)
Gets the specified SPI.
|
public static final Container NONE
Container
",
which always returns null from getSPI(Class)
.public <S> S getSPI(Class<S> spiType)
Component
This method works as a kind of directory service for SPIs, allowing various components to define private contract and talk to each other.
public Set<Component> getComponents()
ComponentRegistry
Component
s registered with this objectgetComponents
in interface ComponentRegistry
@NotNull public <E> Iterable<E> getIterableSPI(Class<E> spiType)
ComponentEx
This method works as a kind of directory service
for SPIs, allowing various components to define private contract
and talk to each other. However unlike Component.getSPI
, this
method can support cases where there is an ordered collection (defined
by Iterable
of implementations. The SPI contract should define
whether lookups are for the first appropriate implementation or whether
all returned implementations should be used.
getIterableSPI
in interface ComponentEx
Iterable
of the SPI's provided by this object. Iterator may have no values.Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.