public void configureServicePolices(AxisService axisService) throws AxisFault { Iterator operations = axisService.getOperations(); while (operations.hasNext()) { AxisOperation axisOp = (AxisOperation) operations.next(); // TODO we support only operation level Policy now configureOperationPolices(axisOp); } }
public void configureServicePolices(AxisService axisService) throws AxisFault { Iterator operations = axisService.getOperations(); while (operations.hasNext()) { AxisOperation axisOp = (AxisOperation) operations.next(); // TODO we support only operation level Policy now configureOperationPolices(axisOp); } }
/** * Gets only the published operations. */ public ArrayList<AxisOperation> getPublishedOperations() { Iterator<AxisOperation> op_itr = getOperations(); ArrayList<AxisOperation> operationList = new ArrayList<AxisOperation>(); while (op_itr.hasNext()) { AxisOperation operation = (AxisOperation) op_itr.next(); if (!operation.isControlOperation()) { operationList.add(operation); } } return operationList; }
/** * Gets the control operation which are added by module like RM. */ public ArrayList<AxisOperation> getControlOperations() { Iterator<AxisOperation> op_itr = getOperations(); ArrayList<AxisOperation> operationList = new ArrayList<AxisOperation>(); while (op_itr.hasNext()) { AxisOperation operation = (AxisOperation) op_itr.next(); if (operation.isControlOperation()) { operationList.add(operation); } } return operationList; }
/** * Gets only the published operations. */ public ArrayList<AxisOperation> getPublishedOperations() { Iterator<AxisOperation> op_itr = getOperations(); ArrayList<AxisOperation> operationList = new ArrayList<AxisOperation>(); while (op_itr.hasNext()) { AxisOperation operation = (AxisOperation) op_itr.next(); if (!operation.isControlOperation()) { operationList.add(operation); } } return operationList; }
/** * Gets the control operation which are added by module like RM. */ public ArrayList<AxisOperation> getControlOperations() { Iterator<AxisOperation> op_itr = getOperations(); ArrayList<AxisOperation> operationList = new ArrayList<AxisOperation>(); while (op_itr.hasNext()) { AxisOperation operation = (AxisOperation) op_itr.next(); if (operation.isControlOperation()) { operationList.add(operation); } } return operationList; }
public int getServiceResponseCount(AxisService axisService) throws AxisFault { int count = 0; for (Iterator opIter = axisService.getOperations(); opIter.hasNext();) { AxisOperation axisOp = (AxisOperation) opIter.next(); Parameter parameter = axisOp.getParameter(StatisticsConstants.OUT_OPERATION_COUNTER); if (parameter != null) { count += ((AtomicInteger) parameter.getValue()).get(); } } return count; }
public int getServiceRequestCount(AxisService axisService) throws AxisFault { int count = 0; for (Iterator opIter = axisService.getOperations(); opIter.hasNext();) { AxisOperation axisOp = (AxisOperation) opIter.next(); Parameter parameter = axisOp.getParameter(StatisticsConstants.IN_OPERATION_COUNTER); if (parameter != null) { count += ((AtomicInteger) parameter.getValue()).get(); } } return count; }
public int getServiceFaultCount(AxisService axisService) throws AxisFault { int count = 0; for (Iterator opIter = axisService.getOperations(); opIter.hasNext();) { AxisOperation axisOp = (AxisOperation) opIter.next(); Parameter parameter = axisOp.getParameter(StatisticsConstants.OPERATION_FAULT_COUNTER); if (parameter != null) { count += ((AtomicInteger) parameter.getValue()).get(); } } return count; }
private AxisOperation getAxisOperation(AxisService axisService, String opName) { AxisOperation axisOperation = new OutInAxisOperation();//Default if(axisService != null) { for (Iterator<?> i = axisService.getOperations(); i.hasNext();) { AxisOperation axisOp = (AxisOperation) i.next(); if(axisOp.getName().getLocalPart().equals(opName)) { axisOperation = axisOp; break; } } } return axisOperation; }
/** * Engages a module. It is required to use this method. * * @param axisModule * @param engager */ public void onEngage(AxisModule axisModule, AxisDescription engager) throws AxisFault { // adding module operations addModuleOperations(axisModule); Iterator<AxisOperation> operations = getOperations(); while (operations.hasNext()) { AxisOperation axisOperation = (AxisOperation) operations.next(); axisOperation.engageModule(axisModule, engager); } }
/** * Engages a module. It is required to use this method. * * @param axisModule * @param engager */ public void onEngage(AxisModule axisModule, AxisDescription engager) throws AxisFault { // adding module operations addModuleOperations(axisModule); Iterator<AxisOperation> operations = getOperations(); while (operations.hasNext()) { AxisOperation axisOperation = (AxisOperation) operations.next(); axisOperation.engageModule(axisModule, engager); } }
private boolean generateWsdl(AxisService axisService) { Iterator operatins = axisService.getOperations(); if (operatins.hasNext()) { while (operatins.hasNext()) { AxisOperation axisOperation = (AxisOperation) operatins.next(); if (axisOperation.isControlOperation()) { continue; } if (axisOperation.getMessageReceiver() == null) { continue; } String messageReceiverClass = axisOperation .getMessageReceiver().getClass().getName(); if (!("org.apache.axis2.rpc.receivers.RPCMessageReceiver" .equals(messageReceiverClass) || "org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" .equals(messageReceiverClass) || "org.apache.axis2.rpc.receivers.RPCInOutAsyncMessageReceiver" .equals(messageReceiverClass) || "org.apache.axis2.jaxws.server.JAXWSMessageReceiver" .equals(messageReceiverClass))) { return false; } } } return true; }
/** * Gets an element representing the operation names * * @param doc * @return Returns Element. */ protected Element getOpNames(Document doc) { Element root = doc.createElement("opnames"); Element elt; for (Iterator operationsIterator = axisService.getOperations(); operationsIterator.hasNext();) { AxisOperation axisOperation = (AxisOperation) operationsIterator.next(); elt = doc.createElement("name"); String localPart = axisOperation.getName().getLocalPart(); elt.appendChild(doc.createTextNode(JavaUtils.xmlNameToJava(localPart))); //what needs to be put here as the opertation namespace is actually the //traget namespace of the service addAttribute(doc, "opnsuri", axisService.getTargetNamespace(), elt); root.appendChild(elt); } return root; }
/** * list all the operations in the service including both control and published operations * * @param serviceName * @return list of all operations * @throws AxisFault */ public OperationMetaData[] listAllOperations(String serviceName) throws AxisFault { AxisService axisService = getAxisConfig().getService(serviceName); List opList = new ArrayList(); for (Iterator operations = axisService.getOperations(); operations.hasNext();) { AxisOperation axisOperation = (AxisOperation) operations.next(); if (axisOperation.getName() != null) { opList.add(getOperationMetaData(serviceName, axisOperation.getName().getLocalPart())); } } Collections.sort(opList, new Comparator() { public int compare(Object arg0, Object arg1) { OperationMetaData a = (OperationMetaData) arg0; OperationMetaData b = (OperationMetaData) arg1; return a.getName().compareToIgnoreCase(b.getName()); } }); return (OperationMetaData[]) opList.toArray(new OperationMetaData[opList.size()]); }
private void setMessageReceivers(Wire wire, AxisService axisService) throws Exception { Map<String, InvocationChain> interceptors = new HashMap<String, InvocationChain>(); for (InvocationChain chain : wire.getInvocationChains()) { interceptors.put(chain.getPhysicalOperation().getName(), chain); } Utils.fillAxisService(axisService, configurationContext.getAxisConfiguration(), null, null); for (Iterator<?> i = axisService.getOperations(); i.hasNext();) { AxisOperation axisOp = (AxisOperation) i.next(); InvocationChain invocationChain = interceptors.get(axisOp.getName().getLocalPart()); MessageReceiver messageReceiver = null; if (WSDL2Constants.MEP_URI_IN_ONLY.equals(axisOp.getMessageExchangePattern()) || WSDL2Constants.MEP_URI_ROBUST_IN_ONLY.equals(axisOp.getMessageExchangePattern())) { messageReceiver = new InOnlyServiceProxyHandler(invocationChain); } else {//Default MEP is IN-OUT for backward compatibility messageReceiver = new InOutServiceProxyHandler(invocationChain); } axisOp.setMessageReceiver(messageReceiver); } }
public Map<String, AxisService> buildAxisServices(DeploymentFileData deploymentFileData) throws DeploymentException { ArchiveReader archiveReader = new ArchiveReader(); Map<String, AxisService> wsdlservices = archiveReader.processWSDLs(deploymentFileData); if (wsdlservices != null && wsdlservices.size() > 0) { for (AxisService service : wsdlservices.values()) { Iterator<AxisOperation> operations = service.getOperations(); while (operations.hasNext()) { AxisOperation axisOperation = operations.next(); try { getConfigurationContext().getAxisConfiguration().getPhasesInfo() .setOperationPhases(axisOperation); } catch (AxisFault e) { throw new DeploymentException(e); } } } } return wsdlservices; } }
public Map<String, AxisService> buildAxisServices(DeploymentFileData deploymentFileData) throws DeploymentException { ArchiveReader archiveReader = new ArchiveReader(); Map<String, AxisService> wsdlservices = archiveReader.processWSDLs(deploymentFileData); if (wsdlservices != null && wsdlservices.size() > 0) { for (AxisService service : wsdlservices.values()) { Iterator<AxisOperation> operations = service.getOperations(); while (operations.hasNext()) { AxisOperation axisOperation = operations.next(); try { getConfigurationContext().getAxisConfiguration().getPhasesInfo() .setOperationPhases(axisOperation); } catch (AxisFault e) { throw new DeploymentException(e); } } } } return wsdlservices; } }
private void applyPolicies(Axis2WireSourceDefinition pwsd, AxisService axisService) throws WiringException, AxisFault { for (Iterator<?> i = axisService.getOperations(); i.hasNext();) { AxisOperation axisOperation = (AxisOperation) i.next(); String operation = axisOperation.getName().getLocalPart(); Set<AxisPolicy> policies = pwsd.getPolicies(operation); if (policies == null || policies.size() == 0) { continue; } AxisDescription axisDescription = axisOperation; for (AxisPolicy axisPolicy : policies) { String message = axisPolicy.getMessage(); String module = axisPolicy.getModule(); Element opaquePolicy = axisPolicy.getOpaquePolicy(); AxisModule axisModule = f3Configurator.getModule(module); axisOperation.addModule(axisModule.getName()); axisOperation.engageModule(axisModule); if (message != null) { axisDescription = axisOperation.getMessage(message); } policyApplier.applyPolicy(axisDescription, opaquePolicy); } } }
public static void createAxisServiceProviders(AxisService axisService, RuntimeEndpoint endpoint, WebServiceBinding wsBinding, ExtensionPointRegistry extensionPoints) { for (Iterator<?> i = axisService.getOperations(); i.hasNext();) { AxisOperation axisOp = (AxisOperation)i.next(); Operation op = getOperation(axisOp, wsBinding); if (op != null) { if (op.isNonBlocking()) { axisOp.setMessageExchangePattern(WSDL2Constants.MEP_URI_IN_ONLY); } else { axisOp.setMessageExchangePattern(WSDL2Constants.MEP_URI_IN_OUT); } MessageReceiver msgrec = null; TuscanyServiceProvider serviceProvider = new TuscanyServiceProvider(extensionPoints, endpoint, wsBinding, op); if (op.isNonBlocking()) { msgrec = new Axis2ServiceInMessageReceiver(serviceProvider); } else { msgrec = new Axis2ServiceInOutSyncMessageReceiver(serviceProvider); } axisOp.setMessageReceiver(msgrec); } } }