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


Java BindingOperationInfo类代码示例

本文整理汇总了Java中org.apache.cxf.service.model.BindingOperationInfo的典型用法代码示例。如果您正苦于以下问题:Java BindingOperationInfo类的具体用法?Java BindingOperationInfo怎么用?Java BindingOperationInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BindingOperationInfo类属于org.apache.cxf.service.model包,在下文中一共展示了BindingOperationInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getMockMessage

import org.apache.cxf.service.model.BindingOperationInfo; //导入依赖的package包/类
/**
 * Creates a mock message that is destined for a method called "test"on
 */
private Message getMockMessage() throws NoSuchMethodException {
    Message message = mock(Message.class);
    Exchange exchange = mock(Exchange.class);
    BindingOperationInfo bindingOperationInfo = mock(BindingOperationInfo.class);
    Service service = mock(Service.class);
    MethodDispatcher methodDispatcher = mock(MethodDispatcher.class);
    Method method = TestClass.class.getMethod("test");

    when(message.getExchange()).thenReturn(exchange);
    when(exchange.get(BindingOperationInfo.class)).thenReturn(bindingOperationInfo);
    when(exchange.get(Service.class)).thenReturn(service);
    when(service.get(MethodDispatcher.class.getName())).thenReturn(methodDispatcher);
    when(methodDispatcher.getMethod(bindingOperationInfo)).thenReturn(method);

    return message;
}
 
开发者ID:jaffa-projects,项目名称:jaffa-framework,代码行数:20,代码来源:CxfFunctionGuardInterceptorTest.java

示例2: resetPartTypes

import org.apache.cxf.service.model.BindingOperationInfo; //导入依赖的package包/类
private void resetPartTypes(BindingOperationInfo bop) {
    if (bop.isUnwrapped()) {
        bop = bop.getWrappedOperation();
    }
    if (bop.isUnwrappedCapable()) {
        resetPartTypeClass(bop.getWrappedOperation().getOperationInfo().getInput());
        resetPartTypeClass(bop.getWrappedOperation().getOperationInfo().getOutput());
        resetPartTypeClass(bop.getWrappedOperation().getInput());
        resetPartTypeClass(bop.getWrappedOperation().getOutput());
    } else {
        resetPartTypeClass(bop.getOperationInfo().getInput());
        resetPartTypeClass(bop.getOperationInfo().getOutput());
        resetPartTypeClass(bop.getInput());
        resetPartTypeClass(bop.getOutput());
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:17,代码来源:PayLoadDataFormatFeature.java

示例3: prepareBindingOperation

import org.apache.cxf.service.model.BindingOperationInfo; //导入依赖的package包/类
private BindingOperationInfo prepareBindingOperation(Exchange camelExchange, org.apache.cxf.message.Exchange cxfExchange) {
    // get binding operation info
    BindingOperationInfo boi = getBindingOperationInfo(camelExchange);
    ObjectHelper.notNull(boi, "BindingOperationInfo");
    
    // keep the message wrapper in PAYLOAD mode
    if (endpoint.getDataFormat() == DataFormat.PAYLOAD && boi.isUnwrapped()) {
        boi = boi.getWrappedOperation();
        cxfExchange.put(BindingOperationInfo.class, boi);
        
    } 
    
    // store the original boi in the exchange
    camelExchange.setProperty(BindingOperationInfo.class.getName(), boi);
    LOG.trace("Set exchange property: BindingOperationInfo: {}", boi);

    // Unwrap boi before passing it to make a client call
    if (endpoint.getDataFormat() != DataFormat.PAYLOAD && !endpoint.isWrapped() && boi != null) {
        if (boi.isUnwrappedCapable()) {
            boi = boi.getUnwrappedOperation();
            LOG.trace("Unwrapped BOI {}", boi);
        }
    }
    return  boi;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:26,代码来源:CxfProducer.java

示例4: getResponsePayloadList

import org.apache.cxf.service.model.BindingOperationInfo; //导入依赖的package包/类
protected MessageContentsList getResponsePayloadList(org.apache.cxf.message.Exchange exchange, 
                                                     List<Source> elements) {
    BindingOperationInfo boi = exchange.getBindingOperationInfo();

    if (boi.isUnwrapped()) {
        boi = boi.getWrappedOperation();
        exchange.put(BindingOperationInfo.class, boi);
    }
    
    MessageContentsList answer = new MessageContentsList();

    int i = 0;
    if (boi.getOutput() != null) {
        for (MessagePartInfo partInfo : boi.getOutput().getMessageParts()) {
            if (elements != null && elements.size() > i) {
                answer.put(partInfo, elements.get(i++));
            }
        }
    }

    return answer;
    
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:24,代码来源:DefaultCxfBinding.java

示例5: getMessageHeaderFilter

import org.apache.cxf.service.model.BindingOperationInfo; //导入依赖的package包/类
private MessageHeaderFilter getMessageHeaderFilter(Exchange exchange) {
    BindingOperationInfo boi = exchange.getProperty(BindingOperationInfo.class.getName(), 
                                                    BindingOperationInfo.class);
    String ns = null;
    if (boi != null) {
        BindingInfo b = boi.getBinding();
        if (b != null) {
            ns = b.getBindingId();
        }
    }
    
    MessageHeaderFilter answer = null;
    if (ns != null) {
        answer = messageHeaderFiltersMap.get(ns);
    }
    
    return answer;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:19,代码来源:CxfHeaderFilterStrategy.java

示例6: handleEvent

import org.apache.cxf.service.model.BindingOperationInfo; //导入依赖的package包/类
public void handleEvent(Event ev, AbstractServiceFactoryBean factory, Object... args)
{
   switch (ev)
   {
      case ENDPOINT_SELECTED : {
         Class<?> cls = (Class<?>) args[2];
         Class<?> implCls = (Class<?>) args[3];
         Endpoint ep = (Endpoint) args[1];
         addPolicies(factory, ep, cls, implCls);
         break;
      }
      case BINDING_OPERATION_CREATED :
         BindingOperationInfo boi = (BindingOperationInfo) args[1];
         Method m = (Method) args[2];
         addPolicies(factory, boi.getOperationInfo(), m);
         break;
      default :
         //ignore
   }
}
 
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:21,代码来源:PolicySetsAnnotationListener.java

示例7: getTestExchange

import org.apache.cxf.service.model.BindingOperationInfo; //导入依赖的package包/类
private Exchange getTestExchange() {
   Exchange exchange = new ExchangeImpl();
   Message message = new MessageImpl();
   message.setExchange(exchange);
   exchange.setInMessage(message);
   exchange.put(BindingOperationInfo.class, new BindingOperationInfo());
   Service service = new ServiceImpl();
   MethodDispatcher md = new MethodDispatcher() {
      @Override
      public Method getMethod(BindingOperationInfo op) {
         return this.getClass().getMethods()[0];
      }
      @Override
      public BindingOperationInfo getBindingOperation(Method m, Endpoint endpoint) {
         return null;
      }
      @Override
      public void bind(OperationInfo o, Method... methods) {
      }
   };
   service.put(MethodDispatcher.class.getName(), md);
   exchange.put(Service.class, service);
   return exchange;
}
 
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:25,代码来源:JBossWSInvokerTest.java

示例8: getTargetMethod

import org.apache.cxf.service.model.BindingOperationInfo; //导入依赖的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

示例9: getTargetMethod

import org.apache.cxf.service.model.BindingOperationInfo; //导入依赖的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

示例10: getTargetMethod

import org.apache.cxf.service.model.BindingOperationInfo; //导入依赖的package包/类
/**
 * Here we are getting the target invocation method. The method get set as a
 * properties in the
 * message by the
 * {@link org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor}
 *
 * @param message incoming message
 * @return
 */
protected Method getTargetMethod(Message message) {
    BindingOperationInfo bop = message.getExchange().get(BindingOperationInfo.class);
    if (bop != null) {
        MethodDispatcher md =
                (MethodDispatcher) message.getExchange().get(Service.class)
                        .get(MethodDispatcher.class.getName());
        return md.getMethod(bop);
    }
    Method method = (Method) message.get("org.apache.cxf.resource.method");
    if (method != null) {
        return method;
    }
    log.error("The requested resource is not found. Please check the resource path etc..");
    throw new AccessDeniedException("Method is not available : Unauthorized");
}
 
开发者ID:apache,项目名称:stratos,代码行数:25,代码来源:StratosAuthorizingHandler.java

示例11: convert

import org.apache.cxf.service.model.BindingOperationInfo; //导入依赖的package包/类
private Object[] convert(Endpoint endpoint, QName opName, Object... params) throws Exception {
	List<Object> listSoapObject = new ArrayList<Object>();
	BindingOperationInfo boi = endpoint.getEndpointInfo().getBinding().getOperation(opName); // Operation name is processOrder  
       BindingMessageInfo inputMessageInfo = null;
       if (!boi.isUnwrapped()) {
           inputMessageInfo = boi.getWrappedOperation().getInput();
       } else {
           inputMessageInfo = boi.getUnwrappedOperation().getInput();
       }
       List<MessagePartInfo> parts = inputMessageInfo.getMessageParts();
       
       int index = 0;
       for(Object obj : params){
       	MessagePartInfo partInfo = parts.get(index++);
       	Class<?> soapClass = partInfo.getTypeClass();
           Object soapObject = copytoSoapObject(obj, soapClass);
           listSoapObject.add(soapObject);
       }
       
       return listSoapObject.toArray();
}
 
开发者ID:yiyongfei,项目名称:jea,代码行数:22,代码来源:SoapClient.java

示例12: setup

import org.apache.cxf.service.model.BindingOperationInfo; //导入依赖的package包/类
@Before
public void setup() {
    exchange = mock(Exchange.class);
    BindingOperationInfo boi = mock(BindingOperationInfo.class);
    when(exchange.getBindingOperationInfo()).thenReturn(boi);
    OperationInfo oi = mock(OperationInfo.class);
    when(boi.getOperationInfo()).thenReturn(oi);
    invokerBuilder = new UnitOfWorkInvokerFactory();
    fooService = new FooService();
    sessionFactory = mock(SessionFactory.class);
    session = mock(Session.class);
    when(sessionFactory.openSession()).thenReturn(session);
    transaction = mock(Transaction.class);
    when(session.getTransaction()).thenReturn(transaction);
    when(transaction.getStatus()).thenReturn(TransactionStatus.ACTIVE);
}
 
开发者ID:roskart,项目名称:dropwizard-jaxws,代码行数:17,代码来源:UnitOfWorkInvokerFactoryTest.java

示例13: setUp

import org.apache.cxf.service.model.BindingOperationInfo; //导入依赖的package包/类
@Before
public void setUp() {
    exchange = mock(Exchange.class);

    BindingOperationInfo boi = mock(BindingOperationInfo.class);
    when(exchange.getBindingOperationInfo()).thenReturn(boi);

    OperationInfo oi = mock(OperationInfo.class);
    when(boi.getOperationInfo()).thenReturn(oi);

    testMetricRegistry = new MetricRegistry();
    mockMetricRegistry = mock(MetricRegistry.class);

    invokerBuilder = new InstrumentedInvokerFactory(mockMetricRegistry);
    instrumentedService = new InstrumentedService();
}
 
开发者ID:roskart,项目名称:dropwizard-jaxws,代码行数:17,代码来源:InstrumentedInvokerFactoryTest.java

示例14: doesOutboundMessageApply

import org.apache.cxf.service.model.BindingOperationInfo; //导入依赖的package包/类
@Override
protected boolean doesOutboundMessageApply(Message message) {
    BindingOperationInfo operationInfo = message.getExchange().getBindingOperationInfo();
    if (operationInfo != null && operationInfo.getName() != null) {
        if (operationInfo.getName().equals(AUTHENTICATE_USER_QNAME)) {
            LOG.debug("Matching operation:" + operationInfo.getName());
            return true;
        } else {
            LOG.debug("Skipped operation:" + operationInfo.getName());
            return false;
        }

    } else {
        LOG.warn("Unable to determine whether to apply canonicalization as operation info was null. Ensure the Phase is POST_PROTOCOL, and this is running on the inbound path. Returning false.");
        return false;
    }
}
 
开发者ID:NCIP,项目名称:cagrid2,代码行数:18,代码来源:OutboundSamlCanonicalizerInterceptor.java

示例15: getServiceMethod

import org.apache.cxf.service.model.BindingOperationInfo; //导入依赖的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


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