public interface WebServiceContext
WebServiceContext使Web服务端点实现类可以相对于正在服务的请求访问消息上下文和安全信息。
通常, WebServiceContext注入到使用端点实现类Resource注解。
Resource
| Modifier and Type | Method and Description |
|---|---|
<T extends EndpointReference> |
getEndpointReference(类<T> clazz, Element... referenceParameters)
返回与此端点相关
EndpointReference EndpointReference。
|
EndpointReference |
getEndpointReference(Element... referenceParameters)
返回此端点的
EndpointReference 。
|
MessageContext |
getMessageContext()
返回在
MessageContext此方法时提供的请求的
MessageContext 。
|
Principal |
getUserPrincipal()
返回标识当前正在处理的请求的发件人的Principal。
|
boolean |
isUserInRole(String role)
返回一个布尔值,指示经过身份验证的用户是否包含在指定的逻辑角色中。
|
MessageContext getMessageContext()
MessageContext此方法时提供的请求的MessageContext 。
只有具有APPLICATION范围的属性才能对应用程序可见。
IllegalStateException - 如果在没有请求服务的情况下调用该方法,则抛出此异常。
MessageContext , MessageContext.Scope , IllegalStateException
Principal getUserPrincipal()
null 。
IllegalStateException - 如果在没有请求服务的情况下调用该方法,则抛出此异常。
Principal , IllegalStateException
boolean isUserInRole(String role)
false 。
role - A
String指定角色的名称
boolean指示请求的发送者是否属于给定的角色
IllegalStateException - 如果在没有请求服务的情况下调用该方法,则抛出此异常。
EndpointReference getEndpointReference(Element... referenceParameters)
EndpointReference 。
如果这个bindingProvider的bindingProvider是SOAP1.1 / HTTP或SOAP1.2 / HTTP,则必须返回一个W3CEndpointReference 。
referenceParameters - 与返回的
EndpointReference实例相关联的
EndpointReference参数。
WebServiceContext的端点的WebServiceContext 。
如果返回的EndpointReference是W3CEndpointReference那么它必须包含指定的referenceParameters 。
IllegalStateException - 如果在没有请求服务的情况下调用该方法,则抛出此异常。
W3CEndpointReference
<T extends EndpointReference> T getEndpointReference(类<T> clazz, Element... referenceParameters)
EndpointReference EndpointReference。
clazz - 必须返回的类型
EndpointReference 。
referenceParameters - 与返回的
EndpointReference实例相关联的
EndpointReference参数。
WebServiceContext实例clazz的端点类型为clazz的WebServiceContext 。
如果返回的EndpointReference是W3CEndpointReference那么它必须包含指定的referenceParameters 。
IllegalStateException - 如果在没有请求服务的情况下调用该方法,则抛出此异常。
WebServiceException -如果
clazz型
EndpointReference不支持。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.