Examples of TransportInDescription


Examples of org.apache.axis2.description.TransportInDescription

    }


    private void configurePort(ConfigurationContext configCtx) {

        TransportInDescription trsIn = configCtx.getAxisConfiguration().getTransportsIn().get("http");

        if (trsIn != null) {
            String port = System.getProperty("http_port");
            if (port != null) {
                try {
                    new Integer(port);
                    trsIn.getParameter("port").setValue(port);
                } catch (NumberFormatException e) {
                    log.error("Given port is not a valid integer. Using 9000 for port.");
                    trsIn.getParameter("port").setValue("9000");
                }
            } else {
                trsIn.getParameter("port").setValue("9000");
            }
        }

        TransportInDescription httpsTrsIn = configCtx.getAxisConfiguration().
                getTransportsIn().get("https");

        if (httpsTrsIn != null) {
            String port = System.getProperty("https_port");
            if (port != null) {
                try {
                    new Integer(port);
                    httpsTrsIn.getParameter("port").setValue(port);
                } catch (NumberFormatException e) {
                    log.error("Given port is not a valid integer. Using 9000 for port.");
                    httpsTrsIn.getParameter("port").setValue("9002");
                }
            } else {
                httpsTrsIn.getParameter("port").setValue("9002");
            }
        }
    }
View Full Code Here

Examples of org.apache.axis2.description.TransportInDescription

            .getMessage(SandeshaMessageKeys.cannotStartListenerForIncommingMsgs));
      }

      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(SandeshaMessageHelper.getMessage(
            SandeshaMessageKeys.cannotStartTransportListenerDueToError, e.toString()), e);
View Full Code Here

Examples of org.apache.axis2.description.TransportInDescription

        //TODO following code was taken from ServiceContext.gegMyEPR method.
        //     When a listner-starting method becomes available from Axis2, use that.
        ConfigurationContext configctx = messageContext.getConfigurationContext();
        ListenerManager lm = configctx.getListenerManager();
        if (!lm.isListenerRunning(transportInProtocol)) {
          TransportInDescription trsin = configctx.getAxisConfiguration().
                          getTransportIn(new QName(transportInProtocol));
          if (trsin != null) {
            lm.addListener(trsin, false);
          } else {
            String message = SandeshaMessageHelper.getMessage(
View Full Code Here

Examples of org.apache.axis2.description.TransportInDescription

            Iterator iter = configctx.getAxisConfiguration().
                getTransportsIn().keySet().iterator();
            while (iter.hasNext()) {
                QName trp = (QName) iter.next();
                TransportInDescription trsIn = (TransportInDescription)
                    configctx.getAxisConfiguration().getTransportsIn().get(trp);
                listenerManager.addListener(trsIn, false);
                if (new QName("http").equals(trsIn.getName())) {
                 
                    System.out.println("[SynapseHTTPServer] Started HTTP on port : " +
                        trsIn.getParameter("port").getValue());
                }
            }
            System.out.println("[SynapseHTTPServer] Ready");

        } catch (Throwable t) {
View Full Code Here

Examples of org.apache.axis2.description.TransportInDescription

        }
    }

    private static void selectPort(ConfigurationContext configCtx) {
        // check if configured port is available
        TransportInDescription trsIn = (TransportInDescription)
            configCtx.getAxisConfiguration().getTransportsIn().get(new QName("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) {
                  System.out.println("[SynapseHTTPServer] Port "+port+" already in use. Trying alternate");
                    if (port == 8080) {
                        port = 8008;
View Full Code Here

Examples of org.apache.axis2.description.TransportInDescription

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

                // 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

            Iterator iter = configctx.getAxisConfiguration().
                getTransportsIn().keySet().iterator();
            while (iter.hasNext()) {
                QName trp = (QName) iter.next();
                TransportInDescription trsIn = (TransportInDescription)
                    configctx.getAxisConfiguration().getTransportsIn().get(trp);
                listenerManager.addListener(trsIn, false);
                if (new QName("http").equals(trsIn.getName())) {
                 
                    System.out.println("[SynapseHTTPServer] Started HTTP on port : " +
                        trsIn.getParameter("port").getValue());
                }
            }
            System.out.println("[SynapseHTTPServer] Ready");

        } catch (Throwable t) {
View Full Code Here

Examples of org.apache.axis2.description.TransportInDescription

        }
    }

    private static void selectPort(ConfigurationContext configCtx) {
        // check if configured port is available
        TransportInDescription trsIn = (TransportInDescription)
            configCtx.getAxisConfiguration().getTransportsIn().get(new QName("http"));

        if (trsIn != null) {

            int 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) {
                  System.out.println("[SynapseHTTPServer] Port "+port+" already in use. Trying alternate");
                    if (port == 8080) {
                        port = 8008;
View Full Code Here

Examples of org.apache.axis2.description.TransportInDescription

    }

    public AsyncHTTPListener(ConfigurationContext cfgCtx, int port) throws AxisFault {
        this.cfgCtx = cfgCtx;
        this.port = port;
        TransportInDescription httpDescription = new TransportInDescription(
                new QName(Constants.TRANSPORT_HTTP));
        httpDescription.setReceiver(this);

        ListenerManager listenerManager = cfgCtx.getListenerManager();
        if (listenerManager == null) {
            listenerManager = new ListenerManager();
            listenerManager.init(cfgCtx);
View Full Code Here

Examples of org.apache.axis2.description.TransportInDescription

        MessageContext msgContext = new MessageContext();
        msgContext.setIncomingTransportName(Constants.TRANSPORT_HTTP);
        try {
            TransportOutDescription transportOut = configurationContext.getAxisConfiguration()
                .getTransportOut(new QName(Constants.TRANSPORT_HTTP));
            TransportInDescription transportIn = configurationContext.getAxisConfiguration()
                .getTransportIn(new QName(Constants.TRANSPORT_HTTP));

            msgContext.setConfigurationContext(configurationContext);

            String sessionKey = request.getSession(true).getId();
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.