Package org.apache.axis2.engine

Examples of org.apache.axis2.engine.ListenerManager


                } else if (endpointURL.startsWith("jms")) {
                    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);

                    if (listenerManager == null) {
                        listenerManager = new ListenerManager();
                        listenerManager.init(configContext);
                    }
                    listenerManager.addListener(trsIn, true);
                    jmsSender.init(configContext, trsOut);
                    jmsListener.init(configContext, trsIn);
                    jmsListener.start();
                }
            }
View Full Code Here


        // remove http transport
        cfgCtx.getAxisConfiguration().getTransportsIn().remove("http");       

        // start given transport
        listnMgr = new ListenerManager();
        listnMgr.init(cfgCtx);
        cfgCtx.setTransportManager(listnMgr);
        //listnMgr.addListener(trpInDesc, false);

        trpDescOut.getSender().init(cfgCtx, trpDescOut);
View Full Code Here

            configctx = ConfigurationContextFactory.
                    createConfigurationContextFromFileSystem(axis2Repolocation, null);
           
            listenerManager = configctx.getListenerManager();
            if (listenerManager == null) {
                listenerManager = new ListenerManager();
                listenerManager.init(configctx);
            }
            // decide on HTTP port to execute
            selectPort(configctx);
View Full Code Here

            // tp.doStop();
            System.out.print("Server stopped .....");
        } else {
            count--;
        }
        ListenerManager listenerManager =
                receiver.getConfigurationContext().getListenerManager();
        if (listenerManager != null) {
            listenerManager.stop();
        }
    }
View Full Code Here

     */
    public EndpointReference getMyEPR(String transport) throws AxisFault {
        axisService.isEnableAllTransports();
        ConfigurationContext configctx = this.configContext;
        if (configctx != null) {
            ListenerManager lm = configctx.getListenerManager();
            if (!lm.isListenerRunning(transport)) {
                TransportInDescription trsin =
                        configctx.getAxisConfiguration().getTransportIn(transport);
                if (trsin != null) {
                    lm.addListener(trsin, false);
                } else {
                    throw new AxisFault(Messages.getMessage("transportnotfound",
                                                            transport));
                }
            }
            if (!lm.isStopped()) {
                return lm.getEPRforService(axisService.getName(), null, transport);
            }
        }
        return null;
    }
View Full Code Here

    public EndpointReference getMyEPR() {
        if (myEPR == null) {
            try {
                if (ListenerManager.defaultConfigurationContext != null) {
                    ListenerManager listenerManager =
                            ListenerManager.defaultConfigurationContext.getListenerManager();
                    myEPR = listenerManager.getEPRforService(axisService.getName(), null, null);
                }
            } catch (AxisFault axisFault) {
                // what else I can do
                myEPR = null;
            }
View Full Code Here

    /**
     * Return the configured listener manager or create and configure one with configurationContext
     */
    public ListenerManager getListenerManager() {
        ListenerManager lm = configurationContext.getListenerManager();
        if (lm == null) {
            lm = new ListenerManager();
            lm.init(configurationContext);
        }
        return lm;
    }
View Full Code Here

            Thread.sleep(2000);
        } catch (InterruptedException e1) {
            throw new AxisFault("Thread interuptted", e1);
        }
        receiver = new JMSListener();
        ListenerManager listenerManager = configurationContext.getListenerManager();
        TransportInDescription trsIn =
                configurationContext.getAxisConfiguration().getTransportIn(Constants.TRANSPORT_JMS);
        trsIn.setReceiver(receiver);
        if (listenerManager == null) {
            listenerManager = new ListenerManager();
            listenerManager.init(configurationContext);
        }
        listenerManager.addListener(trsIn, true);
        receiver.init(configurationContext, trsIn);
        receiver.start();
    }
View Full Code Here

                configContext = initConfigContext(config);
                config.getServletContext().setAttribute(CONFIGURATION_CONTEXT, configContext);
            }
            axisConfiguration = configContext.getAxisConfiguration();

            ListenerManager listenerManager = new ListenerManager();
            listenerManager.init(configContext);
            TransportInDescription transportInDescription = new TransportInDescription(
                    Constants.TRANSPORT_HTTP);
            transportInDescription.setReceiver(this);
            listenerManager.addListener(transportInDescription, true);
            listenerManager.start();
            ListenerManager.defaultConfigurationContext = configContext;
            agent = new ListingAgent(configContext);

            initParams();
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);
                System.out.print("Server started on port "
                        + TESTING_PORT + ".....");
            } catch (Exception e) {
                e.printStackTrace();
            }
View Full Code Here

TOP

Related Classes of org.apache.axis2.engine.ListenerManager

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.