当前位置: 首页>>代码示例>>Java>>正文


Java MethodDispatcher.getMethod方法代码示例

本文整理汇总了Java中org.apache.cxf.service.invoker.MethodDispatcher.getMethod方法的典型用法代码示例。如果您正苦于以下问题:Java MethodDispatcher.getMethod方法的具体用法?Java MethodDispatcher.getMethod怎么用?Java MethodDispatcher.getMethod使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.cxf.service.invoker.MethodDispatcher的用法示例。


在下文中一共展示了MethodDispatcher.getMethod方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getTargetMethod

import org.apache.cxf.service.invoker.MethodDispatcher; //导入方法依赖的package包/类
protected Method getTargetMethod(Message m) {
    // Used the SOAP
    BindingOperationInfo bop = m.getExchange().get(BindingOperationInfo.class);
    if (bop != null) {
        MethodDispatcher md = (MethodDispatcher)
                m.getExchange().get(Service.class).get(MethodDispatcher.class.getName());
        return md.getMethod(bop);
    }
    // Used for JAX-RS
    // This doesn't work for JAX-RS sub-resources as the lookup is only done on the original method, not the
    // sub-resource
    Method method = (Method) m.get("org.apache.cxf.resource.method");
    if (method != null) {
        return method;
    }
    throw new AccessDeniedException("Method is not available : Unauthorized");
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:18,代码来源:NetworkAddressValidatingInterceptor.java

示例2: getTargetMethod

import org.apache.cxf.service.invoker.MethodDispatcher; //导入方法依赖的package包/类
protected Method getTargetMethod(Message m)
{
    BindingOperationInfo bop = m.getExchange().get(BindingOperationInfo.class);
    if (bop != null)
    {
        MethodDispatcher md = (MethodDispatcher) m.getExchange().get(Service.class).get(MethodDispatcher.class.getName());

        return md.getMethod(bop);
    }

    Method method = (Method) m.get("org.apache.cxf.resource.method");
    if (method != null)
    {
        return method;
    }
    throw new AccessDeniedException("Method is not available : Unauthorized");
}
 
开发者ID:geoserver,项目名称:geofence,代码行数:18,代码来源:AuthorizationHandler.java

示例3: getServiceMethod

import org.apache.cxf.service.invoker.MethodDispatcher; //导入方法依赖的package包/类
/**
 * Extracts the Method that will be invoked by the service from the Message object
 *
 * @param message Message to extract the method from
 * @return Method that will be invoked by the service from the Message object
 */
private Method getServiceMethod(Message message) {
    Exchange exchange = message.getExchange();
    BindingOperationInfo bindingOperationInfo = exchange.get(BindingOperationInfo.class);
    MethodDispatcher methodDispatcher = (MethodDispatcher)
            exchange.get(Service.class).get(MethodDispatcher.class.getName());
    return methodDispatcher.getMethod(bindingOperationInfo);
}
 
开发者ID:jaffa-projects,项目名称:jaffa-framework,代码行数:14,代码来源:CxfFunctionGuardInterceptor.java

示例4: checkAuthorization

import org.apache.cxf.service.invoker.MethodDispatcher; //导入方法依赖的package包/类
protected void checkAuthorization(MessageContext ctx)
{
   if ((Boolean) ctx.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY))
   {
      return;
   }
   Message message = ((WrappedMessageContext) ctx).getWrappedMessage();
   Exchange exchange = message.getExchange();
   Endpoint ep = exchange.get(Endpoint.class);
   EJBMethodSecurityAttributeProvider attributeProvider = ep
         .getAttachment(EJBMethodSecurityAttributeProvider.class);
   if (attributeProvider != null) //ejb endpoints only can be associated with this...
   {
      SecurityContext secCtx = message.get(SecurityContext.class);
      BindingOperationInfo bop = exchange.getBindingOperationInfo();
      MethodDispatcher md = (MethodDispatcher) exchange.getService().get(MethodDispatcher.class.getName());
      Method method = md.getMethod(bop);

      EJBMethodSecurityAttribute attributes = attributeProvider.getSecurityAttributes(method);
      if (attributes == null || attributes.isPermitAll()) //no security requirement or method marked @PermitAll
      {
         return;
      }
      if (!attributes.isDenyAll())
      {
         if (attributes.getRolesAllowed() != null)
         {
            for (String role : attributes.getRolesAllowed())
            {
               if (secCtx.isUserInRole(role))
               {
                  return;
               }
            }
         }
      }
      final Principal p = secCtx.getUserPrincipal();
      ctx.put(KEY, true);
      throw MESSAGES.authorizationFailed(p != null ? p.getName() : null);
   }
}
 
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:42,代码来源:HandlerAuthInterceptor.java


注:本文中的org.apache.cxf.service.invoker.MethodDispatcher.getMethod方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。