Examples of ListenerManager


Examples of com.sun.mfwk.agent.appserv.lifecycle.ListenerManager

       
        // instrument all app server mbeans and setup relations
        load();
       
        // register dynamic config listener
        ListenerManager listenerManager = ListenerManagerFactory.getListenerManager();
        try {
            ListenerImpl listener = new ListenerImpl(_serverName, _domainName);
            listenerManager.addNotificationListener(_serverName, _domainName,
                    listener, null, null);
        } catch(Exception ex) {
             Utils.log(Level.SEVERE, "Error while registering dynamic config listener", ex);
        }
       
View Full Code Here

Examples of org.apache.axis2.engine.ListenerManager

    protected void tearDown() throws java.lang.Exception {
    }

    private void startServer(ConfigurationContext configctx) throws AxisFault {
        ListenerManager listenerManager = configctx.getListenerManager();
        if (listenerManager == null) {
            listenerManager = new ListenerManager();
            listenerManager.init(configctx);
        }

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

Examples of org.apache.axis2.engine.ListenerManager

                clusterManager.setConfigurationContext(configctx);
                clusterManager.init();
            }           

            // Finally start the transport listeners
            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

Examples of org.apache.axis2.engine.ListenerManager

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

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

Examples of org.apache.axis2.engine.ListenerManager

                    confLocation);

            configurePort(configCtx);

            // Start the transport listeners
            listenerManager = new ListenerManager();
            listenerManager.init(configCtx);
            listenerManager.start();

            // Need to initialize the cluster manager at last since we are changing the servers
            // HTTP/S ports above. In the axis2.xml file, we need to set the "AvoidInitiation" param
View Full Code Here

Examples of org.apache.axis2.engine.ListenerManager

        throw new SandeshaException(SandeshaMessageHelper
            .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.engine.ListenerManager

        }
     
        //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(
                SandeshaMessageKeys.cannotFindTransportInDesc,transportInProtocol);
            throw new AxisFault(message);
          }
View Full Code Here

Examples of org.apache.axis2.engine.ListenerManager

        try {
            ConfigurationContext configctx = ConfigurationContextFactory.
                createConfigurationContextFromFileSystem(args[0], null);

            ListenerManager listenerManager = configctx.getListenerManager();
            if (listenerManager == null) {
                listenerManager = new ListenerManager();
                listenerManager.init(configctx);
            }

            // decide on HTTP port to execute
            selectPort(configctx);

            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());
                }
View Full Code Here

Examples of org.apache.axis2.engine.ListenerManager

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

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

Examples of org.apache.axis2.engine.ListenerManager

        try {
            ConfigurationContext configctx = ConfigurationContextFactory.
                createConfigurationContextFromFileSystem(args[0], null);

            ListenerManager listenerManager = configctx.getListenerManager();
            if (listenerManager == null) {
                listenerManager = new ListenerManager();
                listenerManager.init(configctx);
            }

            // decide on HTTP port to execute
            selectPort(configctx);

            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());
                }
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.