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


Java OperationResourceInfo类代码示例

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


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

示例1: performInvocation

import org.apache.cxf.jaxrs.model.OperationResourceInfo; //导入依赖的package包/类
protected Object performInvocation(Exchange cxfExchange, final Object serviceObject, Method method,
                                   Object[] paramArray) throws Exception {
    Object response = null;
    if (endpoint.isPerformInvocation()) {
        response = super.performInvocation(cxfExchange, serviceObject, method, paramArray);
    }
    paramArray = insertExchange(method, paramArray, cxfExchange);
    OperationResourceInfo ori = cxfExchange.get(OperationResourceInfo.class);        
    if (ori.isSubResourceLocator()) {
        // don't delegate the sub resource locator call to camel processor
        return method.invoke(serviceObject, paramArray);
    }
    Continuation continuation;
    if (!endpoint.isSynchronous() && (continuation = getContinuation(cxfExchange)) != null) {
        LOG.trace("Calling the Camel async processors.");
        return asyncInvoke(cxfExchange, serviceObject, method, paramArray, continuation, response);
    } else {
        LOG.trace("Calling the Camel sync processors.");
        return syncInvoke(cxfExchange, serviceObject, method, paramArray, response);
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:22,代码来源:CxfRsInvoker.java

示例2: bind

import org.apache.cxf.jaxrs.model.OperationResourceInfo; //导入依赖的package包/类
@SuppressWarnings("UnusedDeclaration")
public static void bind(final Exchange exchange) {
    if (exchange == null) {
        return;
    }

    final ClassResourceInfo cri = exchange.get(OperationResourceInfo.class).getClassResourceInfo();

    // binding context fields
    final Set<Class<?>> types = new HashSet<>();
    for (final Field field : cri.getContextFields()) {
        types.add(field.getType());
    }

    bind(exchange, types);
}
 
开发者ID:apache,项目名称:tomee,代码行数:17,代码来源:Contexts.java

示例3: compare

import org.apache.cxf.jaxrs.model.OperationResourceInfo; //导入依赖的package包/类
@Override
public int compare(
    OperationResourceInfo oper1, OperationResourceInfo oper2,
    Message message) {

    return 0;
}
 
开发者ID:apache,项目名称:aries-jax-rs-whiteboard,代码行数:8,代码来源:CXFJaxRsServiceRegistrator.java

示例4: handleMessage

import org.apache.cxf.jaxrs.model.OperationResourceInfo; //导入依赖的package包/类
@Override
public void handleMessage(Message message) throws Fault {
    final OperationResourceInfo operationResource = message.getExchange().get(OperationResourceInfo.class);
    if (operationResource == null) {
        log.info("OperationResourceInfo is not available, skipping validation");
        return;
    }

    final ClassResourceInfo classResource = operationResource.getClassResourceInfo();
    if (classResource == null) {
        log.info("ClassResourceInfo is not available, skipping validation");
        return;
    }

    final ResourceProvider resourceProvider = classResource.getResourceProvider();
    if (resourceProvider == null) {
        log.info("ResourceProvider is not available, skipping validation");
        return;
    }

    final List<Object> arguments = MessageContentsList.getContentsList(message);
    final Method method = operationResource.getAnnotatedMethod();
    final Object instance = resourceProvider.getInstance(message);
    if (method != null && arguments != null) {
        //validate the parameters(arguments) over the invoked method
        validate(method, arguments.toArray(), instance);

        //validate the fields of each argument
        for (Object arg : arguments) {
            if (arg != null)
                validate(arg);
        }
    }

}
 
开发者ID:wso2,项目名称:carbon-device-mgt,代码行数:36,代码来源:ValidationInterceptor.java

示例5: handleMessage

import org.apache.cxf.jaxrs.model.OperationResourceInfo; //导入依赖的package包/类
@Override
public void handleMessage(XMLMessage message) throws Fault {
	Exchange exchange = message.getExchange();
	// TODO break out into a strategy (not JAXRS-specific)
	OperationResourceInfo operationResourceInfo = exchange.get(OperationResourceInfo.class);
	if (operationResourceInfo == null) {
		message.getInterceptorChain().doIntercept(message);
		return;
	}

	// TODO annotate with a better name?
	String methodName = operationResourceInfo.getMethodToInvoke().getName();
	// TODO annotate with a better name?
	Object key = operationResourceInfo.getClassResourceInfo().getResourceProvider()
			.getInstance();
	if (!(key instanceof Timeable)) {
		message.getInterceptorChain().doIntercept(message);
		return;
	}

	EventMetricCollector collector = timer.getCollector();
	collector.startTiming((Timeable) key, methodName);
	try {
		message.getInterceptorChain().doIntercept(message);
	} finally {
		collector.stopTiming();
	}
}
 
开发者ID:performancecopilot,项目名称:parfait,代码行数:29,代码来源:MonitoringInterceptor.java

示例6: handleResponse

import org.apache.cxf.jaxrs.model.OperationResourceInfo; //导入依赖的package包/类
@Override
public Response handleResponse(final Message m, final OperationResourceInfo ori, final Response response) {
    if(session!=null && session.isLive()) {
        session.logout();
        session = null;
    }
    return null;
}
 
开发者ID:jreijn,项目名称:hippo-addon-restful-webservices,代码行数:9,代码来源:HippoAuthenticationRequestHandler.java

示例7: getServiceObject

import org.apache.cxf.jaxrs.model.OperationResourceInfo; //导入依赖的package包/类
private Object getServiceObject(final Message message) {
    final OperationResourceInfo ori = message.getExchange().get(OperationResourceInfo.class);
    if (ori == null) {
        return null;
    }
    if (!ori.getClassResourceInfo().isRoot()) {
        return message.getExchange().get("org.apache.cxf.service.object.last");
    }
    final ResourceProvider resourceProvider = ori.getClassResourceInfo().getResourceProvider();
    if (resourceProvider.isSingleton()) {
        return resourceProvider.getInstance(message);
    }
    final Object o = message.getExchange().get(CdiResourceProvider.INSTANCE_KEY);
    return o != null || !OpenEJBPerRequestPojoResourceProvider.class.isInstance(resourceProvider) ? o : resourceProvider.getInstance(message);
}
 
开发者ID:apache,项目名称:tomee,代码行数:16,代码来源:CxfRsHttpListener.java

示例8: handleResponse

import org.apache.cxf.jaxrs.model.OperationResourceInfo; //导入依赖的package包/类
@Override
public Response handleResponse(Message message, OperationResourceInfo operationResourceInfo, Response response) {
    IdentityApplicationManagementUtil.resetThreadLocalProvisioningServiceProvider();
    return null;
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:6,代码来源:AuthenticationFilter.java


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