本文整理汇总了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;
}
示例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());
}
}
示例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;
}
示例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;
}
示例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;
}
示例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
}
}
示例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;
}
示例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");
}
示例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");
}
示例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");
}
示例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();
}
示例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);
}
示例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();
}
示例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;
}
}
示例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);
}