Examples of TransportInDescription


Examples of org.apache.axis2.description.TransportInDescription

        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.
View Full Code Here

Examples of org.apache.axis2.description.TransportInDescription

                                          messageReciverMap,
                                          "http://business.org", "http://business.org",
                                          Services.class.getClassLoader());
        businessConfigCtx.getAxisConfiguration().addService(businessService);

        TransportInDescription synTrsIn = (TransportInDescription)
            synapseConfigCtx.getAxisConfiguration().getTransportsIn().get("http");
        synTrsIn.getParameter("port").setValue("10100");
        synTrsIn = (TransportInDescription)
            synapseConfigCtx.getAxisConfiguration().getTransportsIn().get("https");
        synTrsIn.getParameter("port").setValue("12100");
        startServer(synapseConfigCtx);

        TransportInDescription busTrsIn = (TransportInDescription)
            businessConfigCtx.getAxisConfiguration().getTransportsIn().get("http");
        busTrsIn.getParameter("port").setValue("10101");
        busTrsIn = (TransportInDescription)
            businessConfigCtx.getAxisConfiguration().getTransportsIn().get("https");
        busTrsIn.getParameter("port").setValue("12101");
        startServer(businessConfigCtx);
        System.out.println("");
    }
View Full Code Here

Examples of org.apache.axis2.description.TransportInDescription

        Iterator iter = configctx.getAxisConfiguration().
            getTransportsIn().keySet().iterator();
        while (iter.hasNext()) {
            String trp = (String) iter.next();
            TransportInDescription trsIn = (TransportInDescription)
                configctx.getAxisConfiguration().getTransportsIn().get(trp);
            listenerManager.addListener(trsIn, false);
        }
    }
View Full Code Here

Examples of org.apache.axis2.description.TransportInDescription

            Iterator iter = configctx.getAxisConfiguration().
                    getTransportsIn().keySet().iterator();
            while (iter.hasNext()) {
                String trp = (String) iter.next();
                TransportInDescription trsIn = (TransportInDescription)
                        configctx.getAxisConfiguration().getTransportsIn().get(trp);
                listenerManager.addListener(trsIn, false);
                String msg = "Starting transport " + trsIn.getName();
                if (trsIn.getParameter("port") != null) {
                    msg += " on port " + trsIn.getParameter("port").getValue();
                }
                log.info(msg);
            }

            // now initialize SynapseConfig
View Full Code Here

Examples of org.apache.axis2.description.TransportInDescription

     * Helper method to select a alternate port if the currently selected port is in use
     * @param configCtx configuration context
     */
    private static void selectPort(ConfigurationContext configCtx) {
        // check if configured port is available
        TransportInDescription trsIn = (TransportInDescription)
                configCtx.getAxisConfiguration().getTransportsIn().get("http");

        if (trsIn != null) {

            int port = 8080;

            String strPort = System.getProperty("port");
            if (strPort != null) {
                // port is specified as a VM parameter
                try {
                    port = new Integer(strPort).intValue();
                } catch (NumberFormatException e) {
                    // user supplied parameter is not a valid integer. so use the port in configuration.
                    log.error("Given port is not a valid integer. Port specified in the configuration is used for the server.");
                    port = Integer.parseInt(trsIn.getParameter("port").getValue().toString());
                }

            } else {
                port = Integer.parseInt(trsIn.getParameter("port").getValue().toString());
            }

            while (true) {
                ServerSocket sock = null;
                try {
                    sock = new ServerSocket(port);
                    trsIn.getParameter("port").setValue(Integer.toString(port));
                    break;
                } catch (Exception e) {
                    log.warn("Port " + port + " already in use. Trying alternate");
                    if (port == 8080) {
                        port = 8008;
View Full Code Here

Examples of org.apache.axis2.description.TransportInDescription

        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

Examples of org.apache.axis2.description.TransportInDescription

        AxisConfiguration axisConfig = cc.getAxisConfiguration();

        // We previously saved metaTransportIn; restore it
        if (metaTransportIn != null) {
            QName qin = metaTransportIn.getQName();
            TransportInDescription tmpIn = null;
            try {
                tmpIn = axisConfig.getTransportIn(qin.getLocalPart());
            }
            catch (Exception exin) {
                // if a fault is thrown, log it and continue
View Full Code Here

Examples of org.apache.axis2.description.TransportInDescription

                    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

Examples of org.apache.axis2.description.TransportInDescription

                                configuration.getAxis2Xml());

                // setting System.setProperty does not work since this all servers are run on same jvm
                configContext.setProperty("server_name", serverName);

                TransportInDescription httpTrsIn = configContext.getAxisConfiguration().
                        getTransportsIn().get("http");
                String httpPort = configuration.getHttpPort();
                if (httpPort != null && httpPort.length() > 0) {
                    try {
                        new Integer(httpPort);
                        httpTrsIn.getParameter("port").setValue(httpPort);
                    } catch (NumberFormatException e) {
                        log.error("Given port is not a valid integer. Using default value.");
                    }
                }

                TransportInDescription httpsTrsIn = configContext.getAxisConfiguration().
                        getTransportsIn().get("https");
                String httpsPort = configuration.getHttpsPort();
                if (httpsPort != null && httpsPort.length() > 0) {
                    try {
                        new Integer(httpsPort);
                        httpsTrsIn.getParameter("port").setValue(httpsPort);
                    } catch (NumberFormatException e) {
                        log.error("Given port is not a valid integer. Using default value.");
                    }
                }
View Full Code Here

Examples of org.apache.axis2.description.TransportInDescription

        }
      
            try {
        ListenerManager listenerManager =
            firstAplicationMsgCtx.getConfigurationContext().getListenerManager();
        TransportInDescription transportIn = firstAplicationMsgCtx.getConfigurationContext().getAxisConfiguration().getTransportIn(new QName(transportInProtocol));
        //if acksTo is not anonymous start the in-transport
        if (!listenerManager.isListenerRunning(transportIn.getName().getLocalPart())) {
          listenerManager.addListener(transportIn, false);
        }
      } catch (AxisFault e) {
        throw new SandeshaException ("Could not stast the transport listner",e);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.