本文整理汇总了Java中org.apache.cxf.service.model.OperationInfo类的典型用法代码示例。如果您正苦于以下问题:Java OperationInfo类的具体用法?Java OperationInfo怎么用?Java OperationInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OperationInfo类属于org.apache.cxf.service.model包,在下文中一共展示了OperationInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getInParameterName
import org.apache.cxf.service.model.OperationInfo; //导入依赖的package包/类
@Override
public QName getInParameterName(OperationInfo op, Method method, int paramNumber)
{
Annotation[][] annos = method.getParameterAnnotations();
if( annos.length > paramNumber )
{
Annotation[] paramAnnos = annos[paramNumber];
for( Annotation anno : paramAnnos )
{
if( anno instanceof WebParam )
{
WebParam webParam = (WebParam) anno;
String targetNs = webParam.targetNamespace();
if( Check.isEmpty(targetNs) )
{
targetNs = op.getName().getNamespaceURI();
}
return new QName(targetNs, webParam.name());
}
}
}
return new QName(op.getName().getNamespaceURI(), "in" + paramNumber);
}
示例2: handleMessage
import org.apache.cxf.service.model.OperationInfo; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
public void handleMessage(Message message)
throws Fault
{
OperationInfo operation = message.get(MessageInfo.class).getOperation();
String inputName = operation.getInputName();
if("login".equals(inputName) || "getPublicKey".equals(inputName))
{
Map headers = (Map)message.get(Message.PROTOCOL_HEADERS);
List msgSession = (List)headers.get("Set-Cookie");
if(msgSession != null && !msgSession.isEmpty())
{
MsgSessionHolder.getInstance().setSession(msgSession);
}
}
}
示例3: handleMessage
import org.apache.cxf.service.model.OperationInfo; //导入依赖的package包/类
@SuppressWarnings({"unchecked", "rawtypes"})
public void handleMessage(Message message)
throws Fault
{
OperationInfo operation = message.get(MessageInfo.class).getOperation();
String inputName = operation.getInputName();
if (!"getPublicKey".equals(inputName))
{
List session = MsgSessionHolder.getInstance().getSession();
if (session != null && !session.isEmpty())
{
Map headers = (Map)message.get(Message.PROTOCOL_HEADERS);
headers.put("Cookie", session);
}
}
}
示例4: importService
import org.apache.cxf.service.model.OperationInfo; //导入依赖的package包/类
protected WSService importService(ServiceInfo service) {
String name = service.getName().getLocalPart();
String location = "";
for (EndpointInfo endpoint : service.getEndpoints()) {
location = endpoint.getAddress();
}
WSService wsService = new WSService(this.namespace + name, location, this.wsdlLocation);
for (OperationInfo operation : service.getInterface().getOperations()) {
WSOperation wsOperation = this.importOperation(operation, wsService);
wsService.addOperation(wsOperation);
this.wsOperations.put(this.namespace + operation.getName().getLocalPart(), wsOperation);
}
return wsService;
}
示例5: resolveOperations
import org.apache.cxf.service.model.OperationInfo; //导入依赖的package包/类
/**
* Resolve the possible operations for the current request
*/
private ServiceOperation[] resolveOperations(final SoapMessage message) {
final MessageInfo messageInfo = message.get(MessageInfo.class);
final OperationInfo operation = messageInfo.getOperation();
final QName operationQName = operation.getName();
// Try to find the operations in the cache
ServiceOperation[] operations = cachedOperations.get(operationQName);
if (operations == null) {
// Cache miss... find the interface method
final String operationName = operationQName.getLocalPart();
final String serviceName = operation.getInterface().getService().getName().getLocalPart();
final Class<?> serviceInterface = CyclosWebServicesClientFactory.serviceInterfaceForName(serviceName);
for (final Method m : serviceInterface.getMethods()) {
if (m.getName().equals(operationName)) {
final Permission permission = m.getAnnotation(Permission.class);
operations = permission == null ? new ServiceOperation[0] : permission.value();
break;
}
}
// Store the operations on the cache for further access
cachedOperations.put(operationQName, operations);
}
return operations;
}
示例6: getTestExchange
import org.apache.cxf.service.model.OperationInfo; //导入依赖的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;
}
示例7: importService
import org.apache.cxf.service.model.OperationInfo; //导入依赖的package包/类
private WSService importService(ServiceInfo service) {
String name = service.getName().getLocalPart();
String location = "";
for (EndpointInfo endpoint : service.getEndpoints()) {
location = endpoint.getAddress();
}
WSService wsService = new WSService(this.namespace + name, location, this.wsdlLocation);
for (OperationInfo operation : service.getInterface().getOperations()) {
WSOperation wsOperation = this.importOperation(operation, wsService);
wsService.addOperation(wsOperation);
this.wsOperations.put(this.namespace + operation.getName().getLocalPart(), wsOperation);
}
return wsService;
}
示例8: setParameterOrder
import org.apache.cxf.service.model.OperationInfo; //导入依赖的package包/类
private void setParameterOrder(Method method, Class[] paramClasses, OperationInfo op) {
if (isRPC(method) || !isWrapped(method)) {
List<String> paramOrdering = new LinkedList<String>();
boolean hasOut = false;
for (int j = 0; j < paramClasses.length; j++) {
if (Exchange.class.equals(paramClasses[j])) {
continue;
}
if (isInParam(method, j)) {
paramOrdering.add(getInPartName(op, method, j).getLocalPart());
if (isOutParam(method, j)) {
hasOut = true;
}
} else if (isOutParam(method, j)) {
hasOut = true;
paramOrdering.add(getOutPartName(op, method, j).getLocalPart());
}
}
if (!paramOrdering.isEmpty() && hasOut) {
op.setParameterOrdering(paramOrdering);
}
}
}
示例9: setParameterOrder
import org.apache.cxf.service.model.OperationInfo; //导入依赖的package包/类
private void setParameterOrder(Method method, Class[] paramClasses, OperationInfo op) {
if (isRPC(method) || !isWrapped(method)) {
List<String> paramOrdering = new LinkedList<String>();
boolean hasOut = false;
for (int j = 0; j < paramClasses.length; j++) {
if (Exchange.class.equals(paramClasses[j])) {
continue;
}
if (isInParam(method, j)) {
paramOrdering.add(getInPartName(op, method, j).getLocalPart());
if (isOutParam(method, j)) {
hasOut = true;
}
} else if (isOutParam(method, j)) {
hasOut = true;
paramOrdering.add(getOutPartName(op, method, j).getLocalPart());
}
}
if (!paramOrdering.isEmpty() && hasOut) {
op.setParameterOrdering(paramOrdering);
}
}
}
示例10: setup
import org.apache.cxf.service.model.OperationInfo; //导入依赖的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);
}
示例11: setUp
import org.apache.cxf.service.model.OperationInfo; //导入依赖的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();
}
示例12: writerSoapEndpoint
import org.apache.cxf.service.model.OperationInfo; //导入依赖的package包/类
private void writerSoapEndpoint(PrintWriter writer,
String basePath,
AbstractDestination sd) {
String absoluteURL = getAbsoluteAddress(basePath, sd);
if (absoluteURL == null) {
return;
}
writer.write("<tr><td>");
writer.write("<span class=\"porttypename\">"
+ sd.getEndpointInfo().getInterface().getName().getLocalPart() + "</span>");
writer.write("<ul>");
for (OperationInfo oi : sd.getEndpointInfo().getInterface().getOperations()) {
if (!Boolean.TRUE.equals(oi.getProperty("operation.is.synthetic"))) {
writer.write("<li>" + oi.getName().getLocalPart() + "</li>");
}
}
writer.write("</ul>");
writer.write("</td><td>");
writer.write("<span class=\"field\">Endpoint address:</span> " + "<span class=\"value\">"
+ absoluteURL + "</span>");
writer.write("<br/><span class=\"field\">WSDL :</span> " + "<a href=\"" + absoluteURL
+ "?wsdl\">" + sd.getEndpointInfo().getService().getName() + "</a>");
writer.write("<br/><span class=\"field\">Target namespace:</span> "
+ "<span class=\"value\">"
+ sd.getEndpointInfo().getService().getTargetNamespace() + "</span>");
addAtomLinkIfNeeded(absoluteURL, atomMap, writer);
writer.write("</td></tr>");
}
示例13: setMessage
import org.apache.cxf.service.model.OperationInfo; //导入依赖的package包/类
private MessageInfo setMessage(Message message, BindingOperationInfo operation,
boolean requestor, ServiceInfo si) {
MessageInfo msgInfo = getMessageInfo(message, operation, requestor);
message.put(MessageInfo.class, msgInfo);
Exchange ex = message.getExchange();
ex.put(BindingOperationInfo.class, operation);
ex.put(OperationInfo.class, operation.getOperationInfo());
ex.setOneWay(operation.getOperationInfo().isOneWay());
//Set standard MessageContext properties required by JAX_WS, but not specific to JAX_WS.
message.put(Message.WSDL_OPERATION, operation.getName());
QName serviceQName = si.getName();
message.put(Message.WSDL_SERVICE, serviceQName);
QName interfaceQName = si.getInterface().getName();
message.put(Message.WSDL_INTERFACE, interfaceQName);
EndpointInfo endpointInfo = ex.get(Endpoint.class).getEndpointInfo();
QName portQName = endpointInfo.getName();
message.put(Message.WSDL_PORT, portQName);
URI wsdlDescription = endpointInfo.getProperty("URI", URI.class);
if (wsdlDescription == null) {
String address = endpointInfo.getAddress();
try {
wsdlDescription = new URI(address + "?wsdl");
} catch (URISyntaxException e) {
//do nothing
}
endpointInfo.setProperty("URI", wsdlDescription);
}
message.put(Message.WSDL_DESCRIPTION, wsdlDescription);
return msgInfo;
}
示例14: getBindingOperationInfo
import org.apache.cxf.service.model.OperationInfo; //导入依赖的package包/类
protected BindingOperationInfo getBindingOperationInfo(Exchange exchange, QName name,
boolean client) {
BindingOperationInfo bop = ServiceModelUtil.getOperationForWrapperElement(exchange, name, client);
if (bop == null) {
bop = super.getBindingOperationInfo(exchange, name, client);
}
if (bop != null) {
exchange.put(BindingOperationInfo.class, bop);
exchange.put(OperationInfo.class, bop.getOperationInfo());
}
return bop;
}
示例15: setFaultClassInfo
import org.apache.cxf.service.model.OperationInfo; //导入依赖的package包/类
private void setFaultClassInfo(OperationInfo o, Method selected) {
Class[] types = selected.getExceptionTypes();
for (int i = 0; i < types.length; i++) {
Class exClass = types[i];
Class beanClass = getBeanClass(exClass);
if (beanClass == null) {
continue;
}
QName name = getFaultName(o.getInterface(), o, exClass, beanClass);
for (FaultInfo fi : o.getFaults()) {
for (MessagePartInfo mpi : fi.getMessageParts()) {
String ns = null;
if (mpi.isElement()) {
ns = mpi.getElementQName().getNamespaceURI();
} else {
ns = mpi.getTypeQName().getNamespaceURI();
}
if (mpi.getConcreteName().getLocalPart().equals(name.getLocalPart())
&& name.getNamespaceURI().equals(ns)) {
fi.setProperty(Class.class.getName(), exClass);
mpi.setTypeClass(beanClass);
sendEvent(Event.OPERATIONINFO_FAULT, o, exClass, fi);
}
}
}
}
}