Examples of TransportInDescription


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

        if (className == null || "".equals(className)) {
            throw new DeploymentException("Class name is not specified in the receiver " +
                    "configuration");
        }

        TransportInDescription transportIn = new TransportInDescription(name);
        if (init) {
            try {
                Class clazz = TransportBuilderUtils.class.getClassLoader().loadClass(className);
                TransportListener listener = (TransportListener) clazz.newInstance();
                transportIn.setReceiver(listener);
            } catch (Exception e) {
                throw new DeploymentException("Error while initializing transport receiver", e);
            }
        }
View Full Code Here

Examples of org.apache.axis2.description.TransportInDescription

            TransportParameter[] params, boolean listener, ConfigurationContext cfgCtx) throws Exception {

        AxisConfiguration axisConfig = cfgCtx.getAxisConfiguration();
        TransportPersistenceManager transportPM = new TransportPersistenceManager(axisConfig);
        if (listener) {
            TransportInDescription transportIn = axisConfig.getTransportIn(transportName);
            if (transportIn != null) {
                transportIn.getReceiver().stop();
            } else {
                transportIn =
                        transportPM.getTransportListener(transportName, true);
                axisConfig.addTransportIn(transportIn);
            }
            setParameters(transportIn, params);

            try {
                transportIn.getReceiver().init(cfgCtx, transportIn);
                transportIn.getReceiver().start();
            } catch (Throwable t) {
                axisConfig.getTransportsIn().remove(transportName);
                String msg = "Error while initializing the " + transportName + " listener";
                log.error(msg, t);
                throw new AxisFault(msg, t);
View Full Code Here

Examples of org.apache.axis2.description.TransportInDescription

    }

    public void disableTransport(boolean listener, AxisConfiguration axisConfig) throws Exception {
        TransportPersistenceManager transportPM = new TransportPersistenceManager(axisConfig);
        if (listener) {
            TransportInDescription transport = axisConfig.getTransportIn(transportName);
            if (transport != null) {
                transport.getReceiver().stop();
                axisConfig.getTransportsIn().remove(transportName);
            } else {
                log.warn(transportName + " listener is already disabled");
            }
        } else {
            TransportOutDescription transport = axisConfig.getTransportOut(transportName);
            if (transport != null) {
                transport.getSender().stop();
                axisConfig.getTransportsOut().remove(transportName);
            } else {
                log.warn(transportName + " sender is already disabled");
            }
        }
View Full Code Here

Examples of org.apache.axis2.description.TransportInDescription

            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

Examples of org.apache.axis2.description.TransportInDescription

        if (buf == null) {
            ConfigurationContext configContext = null;
            configContext = CarbonUIServiceComponent
                    .getConfigurationContextService().getServerConfigContext();

            TransportInDescription inDescription = configContext.getAxisConfiguration().
                    getTransportIn(ServerConstants.HTTPS_TRANSPORT);
            Parameter proxyParameter = inDescription.getParameter("proxyPort");
            String httpsProxyPort = null;
            if (proxyParameter != null && !"-1".equals(proxyParameter.getValue())) {
                httpsProxyPort = (String) proxyParameter.getValue();
            }

            inDescription = configContext.getAxisConfiguration().
                    getTransportIn(ServerConstants.HTTP_TRANSPORT);
            proxyParameter = inDescription.getParameter("proxyPort");
            String httpProxyPort = null;
            if (proxyParameter != null && !"-1".equals(proxyParameter.getValue())) {
                httpProxyPort = (String) proxyParameter.getValue();
            }
            try {
View Full Code Here

Examples of org.apache.axis2.description.TransportInDescription

        try {
            ip = NetworkUtils.getLocalHostname();
        } catch (SocketException e) {
            throw new AxisFault("Cannot get local host name", e);
        }
        TransportInDescription http = axisConfig.getTransportIn("http");
        if (http != null) {
            EndpointReference epr =
                    http.getReceiver().getEPRForService(serviceName, ip);
            String wsdlUrlPrefix = epr.getAddress();
            if (wsdlUrlPrefix.endsWith("/")) {
                wsdlUrlPrefix = wsdlUrlPrefix.substring(0, wsdlUrlPrefix.length() - 1);
            }
            return new String[]{wsdlUrlPrefix + "?wsdl", wsdlUrlPrefix + "?wsdl2"};
View Full Code Here

Examples of org.apache.axis2.description.TransportInDescription

     * @param axisConfig
     * @return
     */
    private static boolean isServletTransport(AxisConfiguration axisConfig) {
        if (!isServletTransportSet) {
            TransportInDescription http = axisConfig.getTransportIn("http");
            if (http != null){
                if (http.getReceiver() instanceof HttpTransportListener) {
                    isServletTransport = true;
                }
            }
            isServletTransportSet = true;
        }
View Full Code Here

Examples of org.apache.axis2.description.TransportInDescription

                    .getTransportsIn();
            String[] transports = new String[transportsIn.size()];
            int i = 0;

            for (Object o : transportsIn.values()) {
                TransportInDescription tiDesc = (TransportInDescription) o;
                transports[i++] = tiDesc.getName();
            }

            return transports;
        }
    }
View Full Code Here

Examples of org.apache.axis2.description.TransportInDescription

        }
    }

    private static void configurePort(ConfigurationContext configCtx) {

        TransportInDescription trsIn = (TransportInDescription)
            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 = (TransportInDescription)
            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
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.