private void addInvokeOperation(QName operationName, boolean oneWay) { ServiceInfo info = client.getEndpoint().getEndpointInfo().getService(); OperationInfo invokeOpInfo = info.getInterface() .getOperation(oneWay ? INVOKE_ONEWAY_QNAME : INVOKE_QNAME); OperationInfo opInfo = info.getInterface().addOperation(operationName); opInfo.setInput(invokeOpInfo.getInputName(), invokeOpInfo.getInput()); if (!oneWay) { opInfo.setOutput(invokeOpInfo.getOutputName(), invokeOpInfo.getOutput()); } for (BindingInfo bind : client.getEndpoint().getEndpointInfo().getService().getBindings()) { BindingOperationInfo bo = new BindingOperationInfo(bind, opInfo); bind.addOperation(bo); } }
OperationInfo op = bind.getInterface().getOperation(catchAll); if (op == null) { op = bind.getInterface().addOperation(catchAll);
@Override public QName getOperationName(InterfaceInfo service, Method method) { boolean fromWsdl = this.getServiceFactory().isFromWsdl(); String ns = service.getName().getNamespaceURI(); String local = method.getName(); QName name = new QName(ns, local); if (fromWsdl && service.getOperation(name) != null) { //just matching the ops in the class to the ops on the wsdl //probably should check the params and such return name; } if (service.getOperation(name) == null) { return name; } int i = 1; while (true) { name = new QName(ns, local + i); if (service.getOperation(name) == null) { return name; } i++; } }
@Override public QName getOperationName(InterfaceInfo service, Method method) { boolean fromWsdl = this.getServiceFactory().isFromWsdl(); String ns = service.getName().getNamespaceURI(); String local = method.getName(); QName name = new QName(ns, local); if (fromWsdl && service.getOperation(name) != null) { //just matching the ops in the class to the ops on the wsdl //probably should check the params and such return name; } if (service.getOperation(name) == null) { return name; } int i = 1; while (true) { name = new QName(ns, local + i); if (service.getOperation(name) == null) { return name; } else { i++; } } }
@Override public QName getOperationName(InterfaceInfo service, Method method) { boolean fromWsdl = this.getServiceFactory().isFromWsdl(); String ns = service.getName().getNamespaceURI(); String local = method.getName(); QName name = new QName(ns, local); if (fromWsdl && service.getOperation(name) != null) { //just matching the ops in the class to the ops on the wsdl //probably should check the params and such return name; } if (service.getOperation(name) == null) { return name; } int i = 1; while (true) { name = new QName(ns, local + i); if (service.getOperation(name) == null) { return name; } else { i++; } } }
void createSequenceResponse(final Object createResponse, ProtocolVariation protocol) throws RMException { LOG.fine("sending CreateSequenceResponse from client side"); RMConstants constants = protocol.getConstants(); final OperationInfo oi = reliableEndpoint.getEndpoint(protocol).getEndpointInfo().getService() .getInterface().getOperation(constants.getCreateSequenceResponseOnewayOperationName()); // TODO: need to set relatesTo invoke(oi, protocol, new Object[] {createResponse}); }
void acknowledge(DestinationSequence ds) throws RMException { final ProtocolVariation protocol = ds.getProtocol(); String address = ds.getAcksTo().getAddress().getValue(); if (RMUtils.getAddressingConstants().getAnonymousURI().equals(address)) { LOG.log(Level.WARNING, "STANDALONE_ANON_ACKS_NOT_SUPPORTED"); return; } RMConstants constants = protocol.getConstants(); OperationInfo oi = reliableEndpoint.getEndpoint(protocol).getEndpointInfo() .getService().getInterface().getOperation(constants.getSequenceAckOperationName()); invoke(oi, protocol, new Object[] {ds}, this.sequenceContext); }
void ackRequested(SourceSequence s) throws RMException { final ProtocolVariation protocol = s.getProtocol(); EndpointReferenceType target = s.getTarget(); AttributedURIType uri = null; if (null != target) { uri = target.getAddress(); } String addr = null; if (null != uri) { addr = uri.getValue(); } if (addr == null) { LOG.log(Level.WARNING, "STANDALONE_ACK_REQUESTED_NO_TARGET_MSG"); return; } if (RMUtils.getAddressingConstants().getAnonymousURI().equals(addr)) { LOG.log(Level.WARNING, "STANDALONE_ACK_REQUESTED_ANON_TARGET_MSG"); return; } RMConstants constants = protocol.getConstants(); OperationInfo oi = reliableEndpoint.getEndpoint(protocol).getEndpointInfo().getService() .getInterface().getOperation(constants.getAckRequestedOperationName()); invoke(oi, protocol, new Object[] {}); }
.getInterface().getOperation(constants.getCloseSequenceOperationName());
OperationInfo op = binding.getInterface().getOperation(bo.getName()); if (op.getInput() != null && op.getInput().getMessagePartsNumber() == 1) {
boolean needRootNode = false; for (BindingOperationInfo bo : bos) { OperationInfo op = binding.getInterface().getOperation(bo.getName()); needRootNode = false; if (op.getInput().getMessageParts().size() == 0
boolean needRootNode = false; for (BindingOperationInfo bo : bos) { OperationInfo op = binding.getInterface().getOperation(bo.getName()); needRootNode = false; final int inputPartsNum = op.getInput().getMessagePartsNumber();
void terminate(SourceSequence ss) throws RMException { ProtocolVariation protocol = ss.getProtocol(); RMConstants constants = protocol.getConstants(); OperationInfo oi = reliableEndpoint.getEndpoint(protocol).getEndpointInfo() .getService().getInterface().getOperation(constants.getTerminateSequenceOperationName()); TerminateSequenceType ts = new TerminateSequenceType(); ts.setIdentifier(ss.getIdentifier()); ts.setLastMsgNumber(ss.getCurrentMessageNr()); EncoderDecoder codec = protocol.getCodec(); invoke(oi, protocol, new Object[] {codec.convertToSend(ts)}, this.sequenceContext); }
void terminate(DestinationSequence ds) throws RMException { ProtocolVariation protocol = ds.getProtocol(); RMConstants constants = protocol.getConstants(); OperationInfo oi = reliableEndpoint.getEndpoint(protocol).getEndpointInfo() .getService().getInterface().getOperation(constants.getTerminateSequenceOperationName()); TerminateSequenceType ts = new TerminateSequenceType(); ts.setIdentifier(ds.getIdentifier()); ts.setLastMsgNumber(ds.getLastMessageNumber()); EncoderDecoder codec = protocol.getCodec(); invoke(oi, protocol, new Object[] {codec.convertToSend(ts)}, this.sequenceContext); }
private void addInvokeOperation(QName operationName, boolean oneWay) { ServiceInfo info = client.getEndpoint().getEndpointInfo().getService(); OperationInfo invokeOpInfo = info.getInterface() .getOperation(oneWay ? INVOKE_ONEWAY_QNAME : INVOKE_QNAME); OperationInfo opInfo = info.getInterface().addOperation(operationName); opInfo.setInput(invokeOpInfo.getInputName(), invokeOpInfo.getInput()); if (!oneWay) { opInfo.setOutput(invokeOpInfo.getOutputName(), invokeOpInfo.getOutput()); } for (BindingInfo bind : client.getEndpoint().getEndpointInfo().getService().getBindings()) { BindingOperationInfo bo = new BindingOperationInfo(bind, opInfo); bind.addOperation(bo); } }
OperationInfo op = bind.getInterface().getOperation(catchAll); if (op == null) { op = bind.getInterface().addOperation(catchAll);
RMConstants constants = codec.getConstants(); final OperationInfo oi = isServer ? ii.getOperation(constants.getCreateSequenceOnewayOperationName()) : ii.getOperation(constants.getCreateSequenceOperationName()); final Object send = codec.convertToSend(create);
public void addPolicyAttachments(Collection<PolicyAttachment> attachments) { for (PolicyAttachment pa : attachments) { boolean policyUsed = false; for (BindingOperationInfo boi : ei.getBinding().getOperations()) { BindingMessageInfo inputMessage = boi.getInput(); BindingMessageInfo outputMessage = boi.getOutput(); if (pa.appliesTo(boi)) { // Add wsp:PolicyReference to wsdl:binding/wsdl:operation addPolicyRef(boi, pa.getPolicy()); // Add it to wsdl:portType/wsdl:operation too // FIXME - since the appliesTo is for BindingOperationInfo, I think its dodgy // that the policy ref should also be associated with the port type addPolicyRef(ei.getInterface().getOperation(boi.getName()), pa.getPolicy()); policyUsed = true; } else if (pa.appliesTo(inputMessage)) { addPolicyRef(inputMessage, pa.getPolicy()); policyUsed = true; } else if (pa.appliesTo(outputMessage)) { addPolicyRef(outputMessage, pa.getPolicy()); policyUsed = true; } } // Add wsp:Policy to top-level wsdl:definitions if (policyUsed) { addPolicy(pa); } } }
public void addPolicyAttachments(Collection<PolicyAttachment> attachments) { for (PolicyAttachment pa : attachments) { boolean policyUsed = false; for (BindingOperationInfo boi : ei.getBinding().getOperations()) { BindingMessageInfo inputMessage = boi.getInput(); BindingMessageInfo outputMessage = boi.getOutput(); if (pa.appliesTo(boi)) { // Add wsp:PolicyReference to wsdl:binding/wsdl:operation addPolicyRef(boi, pa.getPolicy()); // Add it to wsdl:portType/wsdl:operation too // FIXME - since the appliesTo is for BindingOperationInfo, I think its dodgy // that the policy ref should also be associated with the port type addPolicyRef(ei.getInterface().getOperation(boi.getName()), pa.getPolicy()); policyUsed = true; } else if (pa.appliesTo(inputMessage)) { addPolicyRef(inputMessage, pa.getPolicy()); policyUsed = true; } else if (pa.appliesTo(outputMessage)) { addPolicyRef(outputMessage, pa.getPolicy()); policyUsed = true; } } // Add wsp:Policy to top-level wsdl:definitions if (policyUsed) { addPolicy(pa); } } }
private void setTerminateSequence(Message msg, Identifier identifier, ProtocolVariation protocol) throws RMException { TerminateSequenceType ts = new TerminateSequenceType(); ts.setIdentifier(identifier); MessageContentsList contents = new MessageContentsList(new Object[]{protocol.getCodec().convertToSend(ts)}); msg.setContent(List.class, contents); // create a new exchange for this output-only exchange Exchange newex = new ExchangeImpl(); Exchange oldex = msg.getExchange(); newex.put(Bus.class, oldex.getBus()); newex.put(Endpoint.class, oldex.getEndpoint()); newex.put(Service.class, oldex.getEndpoint().getService()); newex.put(Binding.class, oldex.getEndpoint().getBinding()); newex.setConduit(oldex.getConduit(msg)); newex.setDestination(oldex.getDestination()); //Setup the BindingOperationInfo RMEndpoint rmep = getManager().getReliableEndpoint(msg); OperationInfo oi = rmep.getEndpoint(protocol).getEndpointInfo().getService().getInterface() .getOperation(protocol.getConstants().getTerminateSequenceAnonymousOperationName()); BindingInfo bi = rmep.getBindingInfo(protocol); BindingOperationInfo boi = bi.getOperation(oi); newex.put(BindingInfo.class, bi); newex.put(BindingOperationInfo.class, boi); msg.setExchange(newex); newex.setOutMessage(msg); }