Package org.apache.axis2.transport

Examples of org.apache.axis2.transport.TransportListener


          Runtime.getRuntime().removeShutdownHook(shutdownHookThread);
            shutdownHookThread = null;
        }

        for (Object o : startedTransports.values()) {
            TransportListener transportListener = (TransportListener)o;
            transportListener.stop();
        }

        // Stop the transport senders
        if(log.isDebugEnabled()){
            log.debug("Start invoke transport sender shutdown.");
View Full Code Here


     * @throws AxisFault will throw AxisFault if something goes wrong
     */
    public synchronized void addListener(TransportInDescription trsIn,
                                         boolean started) throws AxisFault {
        configctx.getAxisConfiguration().addTransportIn(trsIn);
        TransportListener transportListener = trsIn.getReceiver();
        if (transportListener != null) {
            if (!started) {
                transportListener.init(configctx, trsIn);
                transportListener.start();
                if (shutdownHookThread == null && isShutdownHookRequired()) {
                    shutdownHookThread = new ListenerManagerShutdownThread(this);
                    Runtime.getRuntime().addShutdownHook(shutdownHookThread);
                }
                stopped = false;
View Full Code Here

        // need to destory all the transports not only the started ones
        // most of the transports create the worker pool at the init method.
        TransportInDescription transportInDescription;
        for (Object o : configctx.getAxisConfiguration().getAxisConfiguration().getTransportsIn().values()) {
            transportInDescription = (TransportInDescription) o;
            TransportListener transportListener = transportInDescription.getReceiver();
            transportListener.destroy();
        }

        this.startedTransports.clear();
        this.configctx = null;
    }
View Full Code Here

            if (axisConfiguration != null) {
                try {
                    String serviceName = ((AxisService)parent).getName();
                    TransportInDescription in =
                            axisConfiguration.getTransportIn(transportInDescName);
                    TransportListener listener = in.getReceiver();
                    String ip;

                    if (hostIP != null) {
                        ip = hostIP;
                    } else {
                        ip = Utils.getIpAddress(axisConfiguration);
                    }

                    // we should pass [serviceName].[endpointName] instead of
                    // [endpointName]
                    String sDOTe = serviceName + "." + name;
                    EndpointReference[] eprsForService = listener.getEPRsForService(sDOTe, ip);
                    // we consider only the first address return by the listener
                    if (eprsForService != null && eprsForService.length > 0) {
                        return eprsForService[0].getAddress();
                    }
                } catch (SocketException e) {
View Full Code Here

        if (service == null) {
            throw new AxisFault(Messages.getMessage("unabletofindservice"));
        }
        SessionContext sessionContext = msgContext.getSessionContext();
        if (sessionContext == null) {
            TransportListener listener = msgContext.getTransportIn().getReceiver();
            sessionContext = listener.getSessionContext(msgContext);
            if (sessionContext == null) {
                createAndFillContexts(service, msgContext, sessionContext);
                return;
            }
        }
View Full Code Here

        Iterator i = values.iterator();

        while (i.hasNext()) {
            TransportInDescription ti = (TransportInDescription) i.next();

            TransportListener tl = ti.getReceiver();
            String tlClassName = tl.getClass().getName();

            if (tlClassName.equals(listenerClassName)) {
                // trace point
                if (log.isTraceEnabled()) {
                    log.trace("ObjectStateUtils:findTransportListener():  [" + listenerClassName
View Full Code Here

    private AxisServletListener getAxisServletListener(String name) {
        TransportInDescription desc = axisConfiguration.getTransportIn(name);
        if (desc == null) {
            return null;
        }
        TransportListener receiver = desc.getReceiver();
        if (receiver instanceof AxisServletListener) {
            return (AxisServletListener)receiver;
        } else {
            return null;
        }
View Full Code Here

                    String msg = "Protocol is not found for the trnasport object";
                    log.error(msg);
                    throw new RuntimeException(msg);
                }
                if (event.getType() == ServiceEvent.REGISTERED) {
                    TransportListener txListener =
                            (TransportListener) service;

                    TransportInDescription txInDes = new TransportInDescription(protocol);
                    txInDes.setReceiver(txListener);
                    String[] keys = reference.getPropertyKeys();
                    if (keys != null) {
                        for (String key : keys) {
                            if (key.equals(PROTOCOL)) {
                                continue;
                            }
                            //TODO: assume String properties at this moment.
                            try {
                                Object propObj = reference.getProperty(key);
                                if (propObj instanceof String) {
                                    String value = (String) propObj;
                                    Parameter param = new Parameter(key, value);
                                    txInDes.addParameter(param);
                                }
                            } catch (AxisFault e) {
                                String msg = "Error while reading transport properties from :" +
                                             txListener.toString();
                                log.error(msg, e);
                                throw new RuntimeException(msg, e);
                            }
                        }
                    }
View Full Code Here

        //means this transport not yet started, start the transport
        TransportInDescription tranportIn =
                configurationContext.getAxisConfiguration().getTransportIn(
                        new QName(transport));
        TransportListener listener = tranportIn.getReceiver();
        listener.start();
        TransportListenerState tsState = new TransportListenerState(listener);
        listeners.put(transport, tsState);

        tsState.waitingCalls++;
    }
View Full Code Here

                    try {
                        String clasName = trsClas.getAttributeValue();
                        Class receiverClass = Class.forName(clasName, true,
                                Thread.currentThread()
                                        .getContextClassLoader());
                        TransportListener receiver = (TransportListener) receiverClass.newInstance();
                        transportIN.setReceiver(receiver);
                    } catch (ClassNotFoundException e) {
                        throw new DeploymentException(e);
                    } catch (IllegalAccessException e) {
                        throw new DeploymentException(e);
View Full Code Here

TOP

Related Classes of org.apache.axis2.transport.TransportListener

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.