Package javax.xml.rpc.server
Interface ServletEndpointContext
public interface ServletEndpointContext
The
ServletEndpointContext provides an endpoint
context maintained by the underlying servlet container based
Jakarta XML RPC runtime system. For service endpoints deployed on a
servlet container based Jakarta XML RPC runtime system, the context
parameter in the ServiceLifecycle.init method is
required to be of the Java type
javax.xml.rpc.server.ServletEndpointContext.
A servlet container based Jakarta XML RPC runtime system implements
the ServletEndpointContext interface. The Jakarta XML RPC
runtime system is required to provide appropriate session,
message context, servlet context and user principal information
per method invocation on the endpoint class.
- Version:
- 1.1
- Author:
- Rahul Sharma, Roberto Chinnici
-
Method Summary
Modifier and TypeMethodDescriptionjavax.servlet.http.HttpSessionThegetHttpSessionmethod returns the current HTTP session (as ajavax.servlet.http.HTTPSession).The methodgetMessageContextreturns theMessageContexttargeted for this endpoint instance.javax.servlet.ServletContextThe methodgetServletContextreturns theServletContext associated with the web application that contain this endpoint.Returns ajava.security.Principalinstance that contains the name of the authenticated user for the current method invocation on the endpoint instance.booleanisUserInRole(String role) Returns a boolean indicating whether the authenticated user for the current method invocation on the endpoint instance is included in the specified logical "role".
-
Method Details
-
getMessageContext
MessageContext getMessageContext()The methodgetMessageContextreturns theMessageContexttargeted for this endpoint instance. This enables the service endpoint instance to acccess theMessageContextpropagated by requestHandlerChain(and its containedHandlerinstances) to the target endpoint instance and to share any SOAP message processing related context. The endpoint instance can access and manipulate theMessageContextand share the SOAP message processing related context with the responseHandlerChain.- Returns:
- MessageContext; If there is no associated
MessageContext, this method returnsnull. - Throws:
IllegalStateException- if this method is invoked outside a remote method implementation by a service endpoint instance.- See Also:
-
getUserPrincipal
Principal getUserPrincipal()Returns ajava.security.Principalinstance that contains the name of the authenticated user for the current method invocation on the endpoint instance. This method returnsnullif there is no associated principal yet. The underlying Jakarta XML RPC runtime system takes the responsibility of providing the appropriate authenticated principal for a remote method invocation on the service endpoint instance.- Returns:
- A
java.security.Principalfor the authenticated principal associated with the current invocation on the servlet endpoint instance; Returnsnullif there no authenticated user associated with a method invocation. - See Also:
-
getHttpSession
javax.servlet.http.HttpSession getHttpSession()ThegetHttpSessionmethod returns the current HTTP session (as ajavax.servlet.http.HTTPSession). When invoked by the service endpoint within a remote method implementation, thegetHttpSessionreturns the HTTP session associated currently with this method invocation. This method returnsnullif there is no HTTP session currently active and associated with this service endpoint. An endpoint class should not rely on an active HTTP session being always there; the underlying Jakarta XML RPC runtime system is responsible for managing whether or not there is an active HTTP session.The getHttpSession method throws
JAXRPCExceptionif invoked by an non HTTP bound endpoint.- Returns:
- The HTTP session associated with the current
invocation or
nullif there is no active session. - Throws:
JAXRPCException- If this method invoked by any non-HTTP bound endpoint- See Also:
-
HttpSession
-
getServletContext
javax.servlet.ServletContext getServletContext()The methodgetServletContextreturns theServletContext associated with the web application that contain this endpoint. According to the Servlet specification, There is one context per web application (installed as a WAR) per JVM . A servlet based service endpoint is deployed as part of a web application.- Returns:
ServletContext- See Also:
-
ServletContext
-
isUserInRole
Returns a boolean indicating whether the authenticated user for the current method invocation on the endpoint instance is included in the specified logical "role".- Parameters:
role- aStringspecifying the name of the role- Returns:
- a
booleanindicating whether the authenticated user associated with the current method invocation belongs to a given role;falseif the user has not been authenticated
-