本文整理了Java中org.jboss.wsf.spi.deployment.Endpoint.getSecurityDomainContext()
方法的一些代码示例,展示了Endpoint.getSecurityDomainContext()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Endpoint.getSecurityDomainContext()
方法的具体详情如下:
包路径:org.jboss.wsf.spi.deployment.Endpoint
类名称:Endpoint
方法名:getSecurityDomainContext
[英]Get security domain context
[中]获取安全域上下文
代码示例来源:origin: org.jboss.ws.cxf/jbossws-cxf-server
public static void callRequestHandler(HttpServletRequest req, HttpServletResponse res, ServletContext ctx, Bus bus,
Endpoint endpoint) throws ServletException
{
try
{
BusFactory.setThreadDefaultBus(bus);
//set the current endpoint into the threadlocal association that is later
//used by the EndpointAssociationInterceptor for linking the message exchange
//related to this invocation to the proper endpoint serving it (the bus, and
//hence the interceptor, can span multiple invocation related to multiple
//endpoints)
EndpointAssociation.setEndpoint(endpoint);
RequestHandler requestHandler = (RequestHandler) endpoint.getRequestHandler();
requestHandler.handleHttpRequest(endpoint, req, res, ctx);
}
catch (IOException ioe)
{
throw new ServletException(ioe);
}
finally
{
if (endpoint.getSecurityDomainContext() != null) {
endpoint.getSecurityDomainContext().cleanupSubjectContext();
}
EndpointAssociation.removeEndpoint();
BusFactory.setThreadDefaultBus(null);
}
}
}
代码示例来源:origin: org.jboss.eap/wildfly-webservices-server-integration
/**
* Invokes WS endpoint.
*
* @param endpoint WS endpoint
* @param wsInvocation web service invocation
* @throws Exception if any error occurs
*/
public void invoke(final Endpoint endpoint, final Invocation wsInvocation) throws Exception {
try {
if (!EndpointState.STARTED.equals(endpoint.getState())) {
throw WSLogger.ROOT_LOGGER.endpointAlreadyStopped(endpoint.getShortName());
}
SecurityDomainContext securityDomainContext = endpoint.getSecurityDomainContext();
securityDomainContext.runAs((Callable<Void>) () -> {
invokeInternal(endpoint, wsInvocation);
return null;
});
} catch (Throwable t) {
handleInvocationException(t);
} finally {
onAfterInvocation(wsInvocation);
}
}
代码示例来源:origin: org.wildfly/wildfly-webservices-server-integration
/**
* Invokes WS endpoint.
*
* @param endpoint WS endpoint
* @param wsInvocation web service invocation
* @throws Exception if any error occurs
*/
public void invoke(final Endpoint endpoint, final Invocation wsInvocation) throws Exception {
try {
if (!EndpointState.STARTED.equals(endpoint.getState())) {
throw WSLogger.ROOT_LOGGER.endpointAlreadyStopped(endpoint.getShortName());
}
SecurityDomainContext securityDomainContext = endpoint.getSecurityDomainContext();
securityDomainContext.runAs((Callable<Void>) () -> {
invokeInternal(endpoint, wsInvocation);
return null;
});
} catch (Throwable t) {
handleInvocationException(t);
} finally {
onAfterInvocation(wsInvocation);
}
}
代码示例来源:origin: org.jboss.ws.cxf/jbossws-cxf-server
@Override
public void handleMessage(SoapMessage msg) throws Fault {
Endpoint ep = msg.getExchange().get(Endpoint.class);
sdc.set(ep.getSecurityDomainContext());
try
{
SecurityToken token = msg.get(SecurityToken.class);
SecurityContext context = msg.get(SecurityContext.class);
if (token == null || context == null || context.getUserPrincipal() == null) {
super.handleMessage(msg);
return;
}
UsernameToken ut = (UsernameToken)token;
Subject subject = createSubject(ut.getName(), ut.getPassword(), ut.isHashed(),
ut.getNonce(), ut.getCreatedTime());
SecurityContext sc = doCreateSecurityContext(context.getUserPrincipal(), subject);
msg.put(SecurityContext.class, sc);
}
finally
{
if (sdc != null)
{
sdc.remove();
}
}
}
代码示例来源:origin: jboss-switchyard/release
ep.getSecurityDomainContext()));
代码示例来源:origin: org.switchyard/switchyard-deploy-jboss-as7
ep.getSecurityDomainContext()));
代码示例来源:origin: org.jboss.ws.cxf/jbossws-cxf-server
SecurityDomainContext sdc = ep.getSecurityDomainContext();
SecurityContext context = message.get(SecurityContext.class);
if (context == null || context.getUserPrincipal() == null)
内容来源于网络,如有侵权,请联系作者删除!