Class Container
- java.lang.Object
-
- com.sun.xml.ws.api.server.Container
-
- All Implemented Interfaces:
Component,ComponentEx,ComponentRegistry
public abstract class Container extends Object implements ComponentRegistry, ComponentEx
Root of the SPI implemented by the container (such as application server.)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:
- Negotiate an interface with the container and define it.
(let's call it
ContainerSecuritySPI.) - The container will implement
ContainerSecuritySPI. - At the runtime, a security pipe gets
WSEndpointand then toContainer. - It calls
container.getSPI(ContainerSecuritySPI.class) - The container returns an instance of
ContainerSecuritySPI. - The security pipe talks to the container through this SPI.
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 fromContainerResolver.getContainer()- Author:
- Kohsuke Kawaguchi
- See Also:
WSEndpoint
-
-
Field Summary
Fields Modifier and Type Field Description static ContainerNONEConstant that represents a "noContainer", which always returns null fromgetSPI(Class).
-
Constructor Summary
Constructors Modifier Constructor Description protectedContainer()For derived classes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<Component>getComponents()Returns the set ofComponents registered with this object<E> Iterable<E>getIterableSPI(Class<E> spiType)Gets an iterator of implementations of the specified SPI.<S> SgetSPI(Class<S> spiType)Gets the specified SPI.
-
-
-
Field Detail
-
NONE
public static final Container NONE
Constant that represents a "noContainer", which always returns null fromgetSPI(Class).
-
-
Method Detail
-
getSPI
public <S> S getSPI(Class<S> spiType)
Description copied from interface:ComponentGets the specified SPI.This method works as a kind of directory service for SPIs, allowing various components to define private contract and talk to each other.
-
getComponents
public Set<Component> getComponents()
Description copied from interface:ComponentRegistryReturns the set ofComponents registered with this object- Specified by:
getComponentsin interfaceComponentRegistry- Returns:
- set of registered components
-
getIterableSPI
@NotNull public <E> Iterable<E> getIterableSPI(Class<E> spiType)
Description copied from interface:ComponentExGets an iterator of implementations of the specified SPI.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(java.lang.Class), this method can support cases where there is an ordered collection (defined byIterableof implementations. The SPI contract should define whether lookups are for the first appropriate implementation or whether all returned implementations should be used.- Specified by:
getIterableSPIin interfaceComponentEx- Returns:
- non-null
Iterableof the SPI's provided by this object. Iterator may have no values.
-
-