Package org.apache.axis2.description

Examples of org.apache.axis2.description.TransportInDescription


            // use seperate listner option then it should work as an dual channel model.
            if ((replyToEPR == null) && firstAplicationMsgCtx.getOptions().isUseSeparateListener() &&
                    firstAplicationMsgCtx.getAxisOperation().getMessageExchangePattern().equals(WSDL2Constants.MEP_URI_OUT_ONLY)){

                // first check whether the transport in is set or not
                TransportInDescription transportIn = firstAplicationMsgCtx.getTransportIn();
                if (transportIn == null) {
                    transportIn = firstAplicationMsgCtx.getOptions().getTransportIn();
                }

                //If use seperate listner is false then we have to use the annonymous end point.
                if ((transportIn == null) && firstAplicationMsgCtx.getOptions().isUseSeparateListener()) {
                    try {
                        transportIn = ClientUtils.inferInTransport(
                                firstAplicationMsgCtx.getConfigurationContext().getAxisConfiguration(),
                                firstAplicationMsgCtx.getOptions(),
                                firstAplicationMsgCtx);
                        replyToEPR = firstAplicationMsgCtx.getConfigurationContext().getListenerManager().getEPRforService(
                            firstAplicationMsgCtx.getAxisService().getName(),
                            firstAplicationMsgCtx.getAxisOperation().getName().getLocalPart(),
                            transportIn.getName());
                    } catch (AxisFault axisFault) {
                        throw new SandeshaException("Can not infer replyToEPR from the first message context ", axisFault);
                    }
                }
            }
View Full Code Here


                    logger.log(Level.INFO,"Axis2 JMS URL=" + endpointURL);
                   
                    jmsListener = new JMSListener();
                    jmsSender = new JMSSender();
                    ListenerManager listenerManager = configContext.getListenerManager();
                    TransportInDescription trsIn = configContext.getAxisConfiguration().getTransportIn(Constants.TRANSPORT_JMS);
                                   
                    // get JMS transport parameters from the computed URL
                    Map<String, String> jmsProps = JMSUtils.getProperties(endpointURL);

                    // collect the parameters used to configure the JMS transport
                    OMFactory fac = OMAbstractFactory.getOMFactory();
                    OMElement parms = fac.createOMElement(DEFAULT_QUEUE_CONNECTION_FACTORY, null);                   

                    for ( String key : jmsProps.keySet() ) {
                        OMElement param = fac.createOMElement("parameter", null);
                        param.addAttribute( "name", key, null );
                        param.addChild(fac.createOMText(param, jmsProps.get(key)));
                        parms.addChild(param);
                    }
                   
                    Parameter queueConnectionFactory = new Parameter(DEFAULT_QUEUE_CONNECTION_FACTORY, parms);
                    trsIn.addParameter( queueConnectionFactory );
                   
                    trsIn.setReceiver(jmsListener);

                    configContext.getAxisConfiguration().addTransportIn( trsIn );
                    TransportOutDescription trsOut = configContext.getAxisConfiguration().getTransportOut(Constants.TRANSPORT_JMS);
                    //configContext.getAxisConfiguration().addTransportOut( trsOut );
                    trsOut.setSender(jmsSender);
View Full Code Here

            receiver = new SimpleHTTPServer(er, TESTING_PORT);

            try {
                receiver.start();
                ListenerManager listenerManager = er.getListenerManager();
                TransportInDescription trsIn = new TransportInDescription(Constants.TRANSPORT_HTTP);
                trsIn.setReceiver(receiver);
                if (listenerManager == null) {
                    listenerManager = new ListenerManager();
                    listenerManager.init(er);
                }
                listenerManager.addListener(trsIn, true);
View Full Code Here

            if (httpListener == null && httpsListener == null) {
                log.warn("No transportReceiver for " + AxisServletListener.class.getName() +
                        " found. An instance for HTTP will be configured automatically. " +
                        "Please update your axis2.xml file!");
                httpListener = new AxisServletListener();
                TransportInDescription transportInDescription = new TransportInDescription(
                        Constants.TRANSPORT_HTTP);
                transportInDescription.setReceiver(httpListener);
                axisConfiguration.addTransportIn(transportInDescription);
            } else if (httpListener != null && httpsListener != null
                    && httpListener.getPort() == -1 && httpsListener.getPort() == -1) {
                log.warn("If more than one transportReceiver for " +
                        AxisServletListener.class.getName() + " exists, then all instances " +
View Full Code Here

            throw new ServletException(e);
        }
    }
   
    private AxisServletListener getAxisServletListener(String name) {
        TransportInDescription desc = axisConfiguration.getTransportIn(name);
        if (desc == null) {
            return null;
        }
        TransportListener receiver = desc.getReceiver();
        if (receiver instanceof AxisServletListener) {
            return (AxisServletListener)receiver;
        } else {
            return null;
        }
View Full Code Here

    // to override this method because we don't make any guarantees as to when exactly this method
    // is called.
    private void preprocessRequest(HttpServletRequest req) throws ServletException {
        initContextRoot(req);

        TransportInDescription transportInDescription =
                req.isSecure()? this.axisConfiguration.getTransportIn(Constants.TRANSPORT_HTTPS) :
                        this.axisConfiguration.getTransportIn(Constants.TRANSPORT_HTTP);

        if (transportInDescription == null){
            throw new ServletException(req.getScheme() + " is forbidden");
        } else {
            if (transportInDescription.getReceiver() instanceof AxisServletListener){
                AxisServletListener listner = (AxisServletListener) transportInDescription.getReceiver();
                // Autodetect the port number if necessary
                if (listner.getPort() == -1){
                    listner.setPort(req.getServerPort());
                }
            }
View Full Code Here

            msgContext.setIncomingTransportName(trsPrefix);
        } else {
            msgContext.setIncomingTransportName(Constants.TRANSPORT_HTTP);
            trsPrefix = Constants.TRANSPORT_HTTP;
        }
        TransportInDescription transportIn =
                axisConfiguration.getTransportIn(msgContext.getIncomingTransportName());
        //set the default output description. This will be http

        TransportOutDescription transportOut = axisConfiguration.getTransportOut(trsPrefix);
        if (transportOut == null) {
View Full Code Here

    String serviceName = (String) message
        .getProperty(XMPPConstants.SERVICE_NAME);
    String action = (String) message.getProperty(XMPPConstants.ACTION);
    MessageContext msgContext = null;

    TransportInDescription transportIn = configurationContext
        .getAxisConfiguration().getTransportIn("xmpp");
    TransportOutDescription transportOut = configurationContext
        .getAxisConfiguration().getTransportOut("xmpp");
    if ((transportIn != null) && (transportOut != null)) {
      msgContext = configurationContext.createMessageContext();
View Full Code Here

        msgContext.setIncomingTransportName(Constants.TRANSPORT_HTTP);
        msgContext.setProperty(MessageContext.REMOTE_ADDR, request.getRemoteAddr());

        try {
            TransportOutDescription transportOut = this.configurationContext.getAxisConfiguration().getTransportOut(Constants.TRANSPORT_HTTP);
            TransportInDescription transportIn = this.configurationContext.getAxisConfiguration().getTransportIn(Constants.TRANSPORT_HTTP);

            msgContext.setConfigurationContext(this.configurationContext);

            //TODO: Port this segment for session support.
            //            String sessionKey = (String) this.httpcontext.getAttribute(HTTPConstants.COOKIE_STRING);
View Full Code Here

                logger.log(Level.INFO, "Axis2 JMS URL=" + deployedURI);

                jmsListener = new JMSListener();
                jmsSender = new JMSSender();
                ListenerManager listenerManager = configContext.getListenerManager();
                TransportInDescription trsIn =
                    configContext.getAxisConfiguration().getTransportIn(org.apache.axis2.Constants.TRANSPORT_JMS);

                // get JMS transport parameters from the computed URL
//not in Axis2 1.5.1                   
//                Map<String, String> jmsProps = JMSUtils.getProperties(endpointURL);

                // collect the parameters used to configure the JMS transport
                OMFactory fac = OMAbstractFactory.getOMFactory();
                OMElement parms = fac.createOMElement(DEFAULT_QUEUE_CONNECTION_FACTORY, null);
/*
                for (String key : jmsProps.keySet()) {
                    OMElement param = fac.createOMElement("parameter", null);
                    param.addAttribute("name", key, null);
                    param.addChild(fac.createOMText(param, jmsProps.get(key)));
                    parms.addChild(param);
                }
*/
                Parameter queueConnectionFactory = new Parameter(DEFAULT_QUEUE_CONNECTION_FACTORY, parms);
                trsIn.addParameter(queueConnectionFactory);

                trsIn.setReceiver(jmsListener);

                configContext.getAxisConfiguration().addTransportIn(trsIn);
                TransportOutDescription trsOut =
                    configContext.getAxisConfiguration().getTransportOut(org.apache.axis2.Constants.TRANSPORT_JMS);
                //configContext.getAxisConfiguration().addTransportOut( trsOut );
View Full Code Here

TOP

Related Classes of org.apache.axis2.description.TransportInDescription

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.