Package org.apache.axis2.engine

Examples of org.apache.axis2.engine.ListenerManager


        } else {
            this.configurationContext.setThreadPool(pool);
        }
        this.port = port;
        this.threadPool = pool;
        ListenerManager listenerManager = configurationContext.getListenerManager();
        TransportInDescription trsIn = new TransportInDescription(
                new QName(Constants.TRANSPORT_HTTP));
        trsIn.setReceiver(this);
        if (listenerManager == null) {
            listenerManager = new ListenerManager();
            listenerManager.init(configurationContext);
        }
        listenerManager.addListener(trsIn, true);
    }
View Full Code Here


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

        mc = null;
        completed = false;
    }

    public void complete(MessageContext msgCtxt) throws AxisFault {
        ListenerManager listenerManager =
                msgCtxt.getConfigurationContext().getListenerManager();
        if (listenerManager != null) {
            listenerManager.stop();
        }
    }
View Full Code Here

        String listenerTransportProtocol = options.getTransportInProtocol();
        TransportInDescription transportIn = null;
        if (options.isUseSeparateListener()) {
            if ((listenerTransportProtocol != null) && !"".equals(listenerTransportProtocol)) {
                transportIn = ac.getTransportIn(new QName(listenerTransportProtocol));
                ListenerManager listenerManager =
                        msgCtxt.getConfigurationContext().getListenerManager();
                if (transportIn == null) {
                    // TODO : User should not be mandated to give an IN transport. If it is not given, we should
                    // ask from the ListenerManager to give any available transport for this client.
                    throw new AxisFault(Messages.getMessage("unknownTransport",
                            listenerTransportProtocol));
                }
                if (!listenerManager.isListenerRunning(transportIn.getName().getLocalPart())) {
                    listenerManager.addListener(transportIn, false);
                }
            }
            if (msgCtxt.getAxisService() != null) {
                AxisService service = msgCtxt.getAxisService();
                Iterator itr = service.getEngagedModules().iterator();
View Full Code Here

            throw new AxisFault(e);
        }
    }

    private void initializeTransports(ConfigurationContext configContext) throws AxisFault {
        ListenerManager trsManager;
        if (configContext != null) {
            this.configContext = configContext;
            trsManager = configContext.getListenerManager();
            if (trsManager == null) {
                trsManager = new ListenerManager();
                trsManager.init(this.configContext);
            }
        } else {
            this.configContext = ConfigurationContextFactory.
                    createConfigurationContextFromFileSystem(null, null);
            trsManager = new ListenerManager();
            trsManager.init(this.configContext);
        }
    }
View Full Code Here

          .createConfigurationContextFromFileSystem(repoLocation,
              confLocation);

            configurePort(configctx);

            ListenerManager listenerManager =  new ListenerManager();
        listenerManager.init(configctx);
      listenerManager.start();
      log.info("[SimpleAxisServer] Started");
    } catch (Throwable t) {
            log.fatal("[SimpleAxisServer] Shutting down. Error starting SimpleAxisServer", t);
        }
    }
View Full Code Here

            configContext = initConfigContext(config);

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

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

            initParams();
View Full Code Here

            log.info("Sleeping for a bit to let the engine start up.");
            Thread.sleep(2000);
        } catch (InterruptedException e1) {
            log.debug(e1.getMessage(), e1);
        }
        ListenerManager listenerManager = configurationContext.getListenerManager();
        TransportInDescription trsIn = new TransportInDescription(
                new QName(Constants.TRANSPORT_MAIL));
        trsIn.setReceiver(this);
        if (listenerManager == null) {
            listenerManager = new ListenerManager();
            listenerManager.init(configurationContext);
        }
        listenerManager.addListener(trsIn, true);
    }
View Full Code Here

                    repositoryDirectory, axis2xml.getName());
        } else {
            throw new Exception("repository not found");
        }

        ListenerManager listenerManager = configurationContext.getListenerManager();
        TransportInDescription trsIn = new TransportInDescription(
                new QName(Constants.TRANSPORT_JMS));
        trsIn.setReceiver(this);
        if (listenerManager == null) {
            listenerManager = new ListenerManager();
            listenerManager.init(configurationContext);
        }
        listenerManager.addListener(trsIn, true);
        this.doThreads = doThreads;
        this.properties = new HashMap(connectorMap);
        this.properties.putAll(cfMap);
        this.destination = destination;
    }
View Full Code Here

    public TCPServer(int port, ConfigurationContext configContext) throws AxisFault {
        try {
            this.configContext = configContext;
            serversocket = new ServerSocket(port);

            ListenerManager listenerManager = configContext.getListenerManager();
            TransportInDescription trsIn = new TransportInDescription(
                    new QName(Constants.TRANSPORT_TCP));
            trsIn.setReceiver(this);
            if (listenerManager == null) {
                listenerManager = new ListenerManager();
                listenerManager.init(configContext);
            }
            listenerManager.addListener(trsIn, true);


        } catch (IOException e1) {
            throw new AxisFault(e1);
        }
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.