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


Java TransportOutDescription.getSender方法代码示例

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


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

示例1: resumeSend

import org.apache.axis2.description.TransportOutDescription; //导入方法依赖的package包/类
/**
 * To resume the invocation at the send path , this is neened since it is require to call
 * TransportSender at the end
 *
 * @param msgContext
 * @return An InvocationResponse allowing the invoker to perhaps determine
 *         whether or not the message processing will ever succeed.
 * @throws AxisFault
 */
public static InvocationResponse resumeSend(MessageContext msgContext) throws AxisFault {
    if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
        log.trace(msgContext.getLogIDString() + " resumeSend:" + msgContext.getMessageID());
    }

    //REVIEW: This name is a little misleading, as it seems to indicate that there should be a resumeSendFault as well, when, in fact, this does both
    //REVIEW: Unlike with send, there is no wrapping try/catch clause which would
    //fire off the flowComplete on an error, as we have to assume that the
    //message will be resumed again, but perhaps we need to unwind back to
    //the point at which the message was resumed and provide another API
    //to allow the full unwind if the message is going to be discarded.
    //invoke the phases
    InvocationResponse pi = invoke(msgContext, RESUMING_EXECUTION);
    //Invoking Transport Sender
    if (pi.equals(InvocationResponse.CONTINUE)) {
        // write the Message to the Wire
        TransportOutDescription transportOut = msgContext.getTransportOut();
        TransportSender sender = transportOut.getSender();
        sender.invoke(msgContext);
        flowComplete(msgContext);
    }

    return pi;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:34,代码来源:AxisEngine.java

示例2: initTransportSenders

import org.apache.axis2.description.TransportOutDescription; //导入方法依赖的package包/类
/**
 * Initializes TransportSenders and TransportListeners with appropriate configuration information
 *
 * @param configContext : ConfigurationContext
 */
private static void initTransportSenders(ConfigurationContext configContext) {
    AxisConfiguration axisConf = configContext.getAxisConfiguration();

    // Initialize Transport Outs
    HashMap transportOuts = axisConf.getTransportsOut();

    Iterator values = transportOuts.values().iterator();

    while (values.hasNext()) {
        TransportOutDescription transportOut = (TransportOutDescription) values.next();
        TransportSender sender = transportOut.getSender();

        if (sender != null) {
            try {
                sender.init(configContext, transportOut);
            } catch (AxisFault axisFault) {
                log.info(Messages.getMessage("transportiniterror", transportOut.getName()));
            }
        }
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:27,代码来源:ConfigurationContextFactory.java

示例3: addTransportOut

import org.apache.axis2.description.TransportOutDescription; //导入方法依赖的package包/类
/**
 * Add an outgoing transport description (i.e. sender) to our configuration.
 *
 * @param transport TransportOutDescription to add.
 * @throws AxisFault
 */
public void addTransportOut(TransportOutDescription transport)
        throws AxisFault {
    if (transport.getSender() == null) {
        throw new AxisFault(
                "Transport sender can not be null for the transport "
                + transport.getName());
    }
    transportsOut.put(transport.getName(), transport);
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:16,代码来源:AxisConfiguration.java

示例4: send

import org.apache.axis2.description.TransportOutDescription; //导入方法依赖的package包/类
/**
 * This methods represents the outflow of the Axis, this could be either at the server side or the client side.
 * Here the <code>ExecutionChain</code> is created using the Phases. The Handlers at the each Phases is ordered in
 * deployment time by the deployment module
 *
 * @param msgContext
 * @throws AxisFault
 * @see MessageContext
 * @see Phase
 * @see Handler
 */
public static void send(MessageContext msgContext) throws AxisFault {
    if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
        log.trace(msgContext.getLogIDString() + " send:" + msgContext.getMessageID());
    }
    // find and invoke the Phases
    OperationContext operationContext = msgContext.getOperationContext();
    ArrayList executionChain = operationContext.getAxisOperation().getPhasesOutFlow();
    //rather than having two steps added both oparation and global chain together
    ArrayList outPhases = new ArrayList();
    outPhases.addAll(executionChain);
    outPhases.addAll(msgContext.getConfigurationContext().getAxisConfiguration().getOutFlowPhases());
    msgContext.setExecutionChain(outPhases);
    msgContext.setFLOW(MessageContext.OUT_FLOW);
    try {
        InvocationResponse pi = invoke(msgContext, NOT_RESUMING_EXECUTION);

        if (pi.equals(InvocationResponse.CONTINUE)) {
            // write the Message to the Wire
            TransportOutDescription transportOut = msgContext.getTransportOut();
            if (transportOut == null) {
                throw new AxisFault("Transport out has not been set");
            }
            TransportSender sender = transportOut.getSender();
            // This boolean property only used in client side fireAndForget invocation
            //It will set a property into message context and if some one has set the
            //property then transport sender will invoke in a diffrent thread
            if (Utils.isClientThreadNonBlockingPropertySet(msgContext)) {
                msgContext.getConfigurationContext().getThreadPool().execute(
                        new TransportNonBlockingInvocationWorker(msgContext, sender));
            } else {
                sender.invoke(msgContext);
            }
            //REVIEW: In the case of the TransportNonBlockingInvocationWorker, does this need to wait until that finishes?
            flowComplete(msgContext);
        } else if (pi.equals(InvocationResponse.SUSPEND)) {
        } else if (pi.equals(InvocationResponse.ABORT)) {
            flowComplete(msgContext);
        } else {
            String errorMsg =
                    "Unrecognized InvocationResponse encountered in AxisEngine.send()";
            log.error(msgContext.getLogIDString() + " " + errorMsg);
            throw new AxisFault(errorMsg);
        }
    } catch (AxisFault e) {
        msgContext.setFailureReason(e);
        flowComplete(msgContext);
        throw e;
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:61,代码来源:AxisEngine.java

示例5: stop

import org.apache.axis2.description.TransportOutDescription; //导入方法依赖的package包/类
/** Stop all the transports and notify modules of shutdown. */
public synchronized void stop() throws AxisFault {
    if (stopped) {
        return;
    }

    // Remove the shutdown hook
    if (shutdownHookThread != null && shutdownHookThread.getState() != Thread.State.RUNNABLE) {
    	Runtime.getRuntime().removeShutdownHook(shutdownHookThread);
        shutdownHookThread = null;
    }

    for (Object o : startedTransports.values()) {
        TransportListener transportListener = (TransportListener)o;
        transportListener.stop();
    }

    // Stop the transport senders
    if(log.isDebugEnabled()){
        log.debug("Start invoke transport sender shutdown.");
    }
    HashMap<String, TransportOutDescription> outTransports =
            configctx.getAxisConfiguration().getTransportsOut();
    if (outTransports.size() > 0) {
        Iterator<TransportOutDescription> trsItr = outTransports.values().iterator();
        while (trsItr.hasNext()) {
            TransportOutDescription outDescription = trsItr.next();
            TransportSender sender = outDescription.getSender();
            if (sender != null) {
                sender.stop();
            }
        }
    }
    if(log.isDebugEnabled()){
        log.debug("End Invoke transport sender shutdown.");
    }
    /*Shutdown modules and Services */
    if(log.isDebugEnabled()){
        log.debug("Start Invoke modules and services shutdown.");
    }
    configctx.shutdownModulesAndServices();
    if(log.isDebugEnabled()){
        log.debug("End Invoke modules and services shutdown.");
    }
    stopped = true;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:47,代码来源:ListenerManager.java


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