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


Java AxisOperation.getParameter方法代码示例

本文整理汇总了Java中org.apache.axis2.description.AxisOperation.getParameter方法的典型用法代码示例。如果您正苦于以下问题:Java AxisOperation.getParameter方法的具体用法?Java AxisOperation.getParameter怎么用?Java AxisOperation.getParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.axis2.description.AxisOperation的用法示例。


在下文中一共展示了AxisOperation.getParameter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getUnmarshalInfoParameter

import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
/**
 * Register the unmarshalling information so that it can 
 * be used to speed up subsequent marshalling events.
 * @param mc
 * @param packages
 * @param packagesKey
 */
static Parameter getUnmarshalInfoParameter(MessageContext mc) throws AxisFault {
    
    // The information is registered on the AxisOperation.
    if (mc == null ||
        mc.getAxisMessageContext() == null ||
        mc.getAxisMessageContext().getAxisService() == null ||
        mc.getAxisMessageContext().getAxisOperation() == null) {
        return null;
    }
    
    // This needs to be stored on the AxisOperation as unmarshalling
    // info will be specific to a method and its parameters
    AxisOperation axisOp = mc.getAxisMessageContext().getAxisOperation();
    
    Parameter param = axisOp.getParameter(UnmarshalInfo.KEY);
    return param;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:25,代码来源:MethodMarshallerUtils.java

示例2: registerUnmarshalInfo

import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
/**
 * Register the unmarshalling information so that it can 
 * be used to speed up subsequent marshalling events.
 * @param mc
 * @param packages
 * @param packagesKey
 */
static void registerUnmarshalInfo(MessageContext mc, 
                             TreeSet<String> packages, 
                             String packagesKey) throws AxisFault {
    
    // The information is registered on the AxisOperation.
    if (mc == null ||
        mc.getAxisMessageContext() == null ||
        mc.getAxisMessageContext().getAxisService() == null ||
        mc.getAxisMessageContext().getAxisOperation() == null) {
        return;
    }
    
    // This needs to be stored on the AxisOperation as unmarshalling
    // info will be specific to a method and its parameters
    AxisOperation axisOp = mc.getAxisMessageContext().getAxisOperation();
    
    // There are two things that need to be saved.
    // 1) The UnmarshalInfo object containing the packages 
    //    (which will be used by the CustomBuilder)
    // 2) A MessageContextListener which (when triggered) registers
    //    the JAXBCustomBuilder
    Parameter param = axisOp.getParameter(UnmarshalInfo.KEY);
    if (param == null) {
        UnmarshalInfo info = new UnmarshalInfo(packages, packagesKey);
        axisOp.addParameter(UnmarshalInfo.KEY, info);
        param = axisOp.getParameter(UnmarshalInfo.KEY);
        param.setTransient(true);
        // Add a listener that will set the JAXBCustomBuilder
        UnmarshalMessageContextListener.
            create(mc.getAxisMessageContext().getServiceContext());
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:40,代码来源:MethodMarshallerUtils.java

示例3: testHeaderParameters

import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
public void testHeaderParameters() {
    // Test IN and INOUT header paramaters in SEI
    ServiceDescription svcDesc = DescriptionFactory.createServiceDescription(HeaderParameters.class);
    assertNotNull(svcDesc);
    EndpointDescription epDescs[] = svcDesc.getEndpointDescriptions();
    assertNotNull(epDescs);
    assertEquals(1, epDescs.length);
    EndpointInterfaceDescription epiDesc = epDescs[0].getEndpointInterfaceDescription();
    assertNotNull(epiDesc);
    
    OperationDescription opDescs[] = epiDesc.getOperations();
    assertNotNull(opDescs);
    assertEquals(1, opDescs.length);
    OperationDescription opDesc = opDescs[0];
    assertEquals("echoString", opDesc.getOperationName());
    
    AxisOperation axisOperation = opDesc.getAxisOperation();
    assertNotNull(axisOperation);
    Parameter understoodQNamesParameter = axisOperation.getParameter(OperationDescription.HEADER_PARAMETER_QNAMES);
    assertNotNull(understoodQNamesParameter);
    ArrayList understoodQNames = (ArrayList) understoodQNamesParameter.getValue();
    assertEquals(6, understoodQNames.size());
    
    assertTrue(understoodQNames.contains(new QName("webservice.namespace", "renamedParam1")));
    assertTrue(understoodQNames.contains(new QName("webservice.namespace", "arg1")));
    assertTrue(understoodQNames.contains(new QName("webparam.namespace", "arg2")));
    assertFalse(understoodQNames.contains(new QName("webservice.namespace", "outOnly")));
    assertTrue(understoodQNames.contains(new QName("webservice.namespace", "arg3")));
    assertTrue(understoodQNames.contains(new QName("webservice.namespace", "inOut")));
    assertFalse(understoodQNames.contains(new QName("webservice.namespace", "arg4")));
    assertFalse(understoodQNames.contains(new QName("webservice.namespace", "notInHeader")));
    assertFalse(understoodQNames.contains(new QName("webservice.namespace", "arg5")));
    assertTrue(understoodQNames.contains(new QName("webservice.namespace", "headerReturn")));
    
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:36,代码来源:MustUnderstandTests.java

示例4: getResponseTime

import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
private long getResponseTime(AxisOperation axisOp) {
    Parameter responseTimeParameter = axisOp.getParameter(
            StatisticsConstants.OPERATION_RESPONSE_TIME);
    if (responseTimeParameter != null) {
        Object value = responseTimeParameter.getValue();
        if (value instanceof Long) {
            return (Long) value;
        }
    }
    return 0;
}
 
开发者ID:wso2,项目名称:carbon-commons,代码行数:12,代码来源:SystemStatisticsUtil.java

示例5: getServiceRequestCount

import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
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;
}
 
开发者ID:wso2,项目名称:carbon-commons,代码行数:12,代码来源:SystemStatisticsUtil.java

示例6: getServiceFaultCount

import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
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;
}
 
开发者ID:wso2,项目名称:carbon-commons,代码行数:12,代码来源:SystemStatisticsUtil.java

示例7: getServiceResponseCount

import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
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;
}
 
开发者ID:wso2,项目名称:carbon-commons,代码行数:12,代码来源:SystemStatisticsUtil.java

示例8: getOperationRequestCount

import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
public int getOperationRequestCount(AxisOperation axisOperation) throws AxisFault {
    Parameter parameter =
            axisOperation.getParameter(StatisticsConstants.IN_OPERATION_COUNTER);
    if (parameter != null) {
        return ((AtomicInteger) parameter.getValue()).get();
    }
    return 0;
}
 
开发者ID:wso2,项目名称:carbon-commons,代码行数:9,代码来源:SystemStatisticsUtil.java

示例9: getOperationFaultCount

import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
public int getOperationFaultCount(AxisOperation axisOperation) throws AxisFault {
    Parameter parameter =
            axisOperation.getParameter(StatisticsConstants.OPERATION_FAULT_COUNTER);
    if (parameter != null) {
        return ((AtomicInteger) parameter.getValue()).get();
    }
    return 0;
}
 
开发者ID:wso2,项目名称:carbon-commons,代码行数:9,代码来源:SystemStatisticsUtil.java

示例10: getOperationResponseCount

import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
public int getOperationResponseCount(AxisOperation axisOperation) throws AxisFault {
    Parameter parameter =
            axisOperation.getParameter(StatisticsConstants.OUT_OPERATION_COUNTER);
    if (parameter != null) {
        return ((AtomicInteger) parameter.getValue()).get();
    }
    return 0;
}
 
开发者ID:wso2,项目名称:carbon-commons,代码行数:9,代码来源:SystemStatisticsUtil.java

示例11: getMaxOperationResponseTime

import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
public long getMaxOperationResponseTime(AxisOperation axisOperation) throws AxisFault {
    long max = 0;
    Parameter parameter =
            axisOperation.getParameter(StatisticsConstants.OPERATION_RESPONSE_TIME_PROCESSOR);
    if (parameter != null) {
        max = ((ResponseTimeProcessor) parameter.getValue()).getMaxResponseTime();
    }
    return max;
}
 
开发者ID:wso2,项目名称:carbon-commons,代码行数:10,代码来源:SystemStatisticsUtil.java

示例12: getMinOperationResponseTime

import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
public long getMinOperationResponseTime(AxisOperation axisOperation) throws AxisFault {
    long min = 0;
    Parameter parameter =
            axisOperation.getParameter(StatisticsConstants.OPERATION_RESPONSE_TIME_PROCESSOR);
    if (parameter != null) {
        min = ((ResponseTimeProcessor) parameter.getValue()).getMinResponseTime();
    }
    if (min == -1) {
        min = 0;
    }
    return min;
}
 
开发者ID:wso2,项目名称:carbon-commons,代码行数:13,代码来源:SystemStatisticsUtil.java

示例13: getAvgOperationResponseTime

import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
public double getAvgOperationResponseTime(AxisOperation axisOperation) throws AxisFault {
    double avg = 0;
    Parameter parameter =
            axisOperation.getParameter(StatisticsConstants.OPERATION_RESPONSE_TIME_PROCESSOR);
    if (parameter != null) {
        avg = ((ResponseTimeProcessor) parameter.getValue()).getAvgResponseTime();
    }
    return avg;
}
 
开发者ID:wso2,项目名称:carbon-commons,代码行数:10,代码来源:SystemStatisticsUtil.java

示例14: installJAXBCustomBuilder

import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
/**
 * Attach the JAXBCustomBuilder on the Axiom builder.
 * This will speedup the JAXB unmarshalling code
 * @param sc
 * @param mc
 */
private void installJAXBCustomBuilder(ServiceContext sc, MessageContext mc) {
    
    if (log.isDebugEnabled()) {
        log.debug("attachEvent for sc= " + sc.getName() + "and  mc=" + mc.getLogCorrelationID());
    }
    
    // Make sure the MessageContext has a SOAPEnvelope and Builder
    SOAPEnvelope envelope = mc.getEnvelope();
    
    if (envelope == null) {
        return;
    }
    if (!(envelope.getBuilder() instanceof StAXOMBuilder)) {
            return;
        }

    // Get the UnmarshalInfo object.
    // This contains information from prior unmarshalling
    AxisOperation axisOp = mc.getAxisOperation();
    if (axisOp == null) {
        return;
    }
    
    Parameter parameterInfo = axisOp.getParameter(UnmarshalInfo.KEY);
    if (parameterInfo == null) {
        return;
    }
    UnmarshalInfo info =  (UnmarshalInfo) parameterInfo.getValue();
    
    if (info == null) {
        return;
    }
    
    // Crate a JAXBCustomBuilder and register it on the Axiom StAXOMBuilder
    JAXBDSContext jaxbDSC = new JAXBDSContext(info.getPackages(), info.getPackagesKey());
    jaxbDSC.setMessageContext(mc);
    JAXBCustomBuilder jcb = new JAXBCustomBuilder(jaxbDSC);
    ((StAXOMBuilder) envelope.getBuilder()).registerCustomBuilderForPayload(jcb);
    if (log.isDebugEnabled()) {
        log.debug("Registering JAXBCustomBuilder: " + jcb + " for AxisOperation: " + axisOp.getName());
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:49,代码来源:UnmarshalMessageContextListener.java

示例15: flowComplete

import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
@Override
// Handle IN_ONLY operations
public void flowComplete(MessageContext msgContext) {
    if (msgContext.getEnvelope() == null) {
        return;
    }
    AxisService axisService = msgContext.getAxisService();
    if (axisService == null ||
        SystemFilter.isFilteredOutService(axisService.getAxisServiceGroup()) ||
        axisService.isClientSide()) {
        return;
    }

    try {
        // Process Request Counter
        OperationContext opContext = msgContext.getOperationContext();
        if (opContext != null && opContext.isComplete()) {
            AxisOperation axisOp = opContext.getAxisOperation();
            if (axisOp != null && axisOp.isControlOperation()) {
                return;
            }
            if (axisOp != null) {
                String mep = axisOp.getMessageExchangePattern();
                if (mep != null &&
                    (mep.equals(WSDL2Constants.MEP_URI_IN_ONLY) ||
                     mep.equals(WSDL2Constants.MEP_URI_ROBUST_IN_ONLY))) {

                    // Increment operation counter
                    final AxisOperation axisOperation = msgContext.getAxisOperation();
                    if (axisOperation != null) {
                        Parameter operationParameter =
                                axisOperation.getParameter(StatisticsConstants.IN_OPERATION_COUNTER);
                        if (operationParameter != null) {
                            ((AtomicInteger) operationParameter.getValue()).incrementAndGet();
                        } else {
                            log.error(StatisticsConstants.IN_OPERATION_COUNTER +
                                      " has not been set for operation " +
                                      axisService.getName() + "." + axisOperation.getName());
                            return;
                        }

                        // Calculate response times
                        try {
                            ResponseTimeCalculator.calculateResponseTimes(msgContext);
                        } catch (AxisFault axisFault) {
                            log.error("Cannot compute response times", axisFault);
                        }
                    }

                    // Increment global counter
                    Parameter globalRequestCounter =
                            msgContext.getParameter(StatisticsConstants.GLOBAL_REQUEST_COUNTER);
                    ((AtomicInteger) globalRequestCounter.getValue()).incrementAndGet();

                    updateCurrentInvocationGlobalStatistics(msgContext);
                }
            }
        }
    } catch (Throwable e) {  // Catching Throwable since exceptions here should not be propagated up
        log.error("Could not call InOnlyMEPHandler.flowComplete", e);
    }
}
 
开发者ID:wso2,项目名称:carbon-commons,代码行数:63,代码来源:InOnlyMEPHandler.java


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