Examples of TransportListener


Examples of org.apache.activemq.transport.TransportListener

            onException(IOExceptionSupport.create(e));
        }
    }

    public void sendToActiveMQ(Command command) {
        TransportListener l = transportListener;
        if (l != null) {
            l.onCommand(command);
        }
    }
View Full Code Here

Examples of org.apache.activemq.transport.TransportListener

     * @throws Exception
     * @throws URISyntaxException
     */
    private void startClient(String uri) throws Exception, URISyntaxException {
        clientTransport = TransportFactory.connect(new URI(uri));
        clientTransport.setTransportListener(new TransportListener() {
            public void onCommand(Object command) {
                if (command instanceof WireFormatInfo) {
                    clientWF.set((WireFormatInfo)command);
                    negociationCounter.countDown();
                }
View Full Code Here

Examples of org.apache.activemq.transport.TransportListener

        server.setAcceptListener(new TransportAcceptListener() {
            public void onAccept(Transport transport) {
                try {
                    LOG.info("[" + getName() + "] Server Accepted a Connection");
                    serverTransport = transport;
                    serverTransport.setTransportListener(new TransportListener() {
                        public void onCommand(Object command) {
                            if (command instanceof WireFormatInfo) {
                                serverWF.set((WireFormatInfo)command);
                                negociationCounter.countDown();
                            }
View Full Code Here

Examples of org.apache.activemq.transport.TransportListener

     * @throws Exception
     * @throws URISyntaxException
     */
    private void startClient() throws Exception, URISyntaxException {
        clientTransport = TransportFactory.connect(new URI("tcp://localhost:61616?trace=true&wireFormat.maxInactivityDuration=1000"));
        clientTransport.setTransportListener(new TransportListener() {
            public void onCommand(Object command) {
                clientReceiveCount.incrementAndGet();
                if (clientRunOnCommand != null) {
                    clientRunOnCommand.run();
                }
View Full Code Here

Examples of org.apache.activemq.transport.TransportListener

    public void onAccept(Transport transport) {
        try {
            LOG.info("[" + getName() + "] Server Accepted a Connection");
            serverTransport = transport;
            serverTransport.setTransportListener(new TransportListener() {
                public void onCommand(Object command) {
                    serverReceiveCount.incrementAndGet();
                    if (serverRunOnCommand != null) {
                        serverRunOnCommand.run();
                    }
View Full Code Here

Examples of org.apache.activemq.transport.TransportListener

        //
        // Manually create a client transport so that it does not send KeepAlive
        // packets.
        // this should simulate a client hang.
        clientTransport = new TcpTransport(new OpenWireFormat(), SocketFactory.getDefault(), new URI("tcp://localhost:61616"), null);
        clientTransport.setTransportListener(new TransportListener() {
            public void onCommand(Object command) {
                clientReceiveCount.incrementAndGet();
                if (clientRunOnCommand != null) {
                    clientRunOnCommand.run();
                }
View Full Code Here

Examples of org.apache.axis2.transport.TransportListener

            Map<String, TransportInDescription> trpIns
                    = configurationContext.getAxisConfiguration().getTransportsIn();

            for (TransportInDescription trpIn : trpIns.values()) {
                TransportListener trpLst = trpIn.getReceiver();
                if (trpLst instanceof ManagementSupport) {
                    try {
                        ((ManagementSupport) trpLst).pause();
                    } catch (AxisFault axisFault) {
                        log.error(new StringBuilder("Error putting transport listener for: ")
View Full Code Here

Examples of org.apache.axis2.transport.TransportListener

            Map<String, TransportInDescription> trpIns
                    = configurationContext.getAxisConfiguration().getTransportsIn();
   
            for (TransportInDescription trpIn : trpIns.values()) {
                TransportListener trpLst = trpIn.getReceiver();
                if (trpLst instanceof ManagementSupport) {
                    try {
                        ((ManagementSupport) trpLst).resume();
                    } catch (AxisFault axisFault) {
                        log.error(new StringBuilder("Error resuming transport listener for: ")
View Full Code Here

Examples of org.apache.axis2.transport.TransportListener

        int pendingThreads = 0;
        Map<String, TransportInDescription> trpIns
                = configurationContext.getAxisConfiguration().getTransportsIn();

        for (TransportInDescription trpIn : trpIns.values()) {
            TransportListener trpLst = trpIn.getReceiver();

            if (trpLst instanceof ManagementSupport) {
                int inUse = ((ManagementSupport) trpLst).getActiveThreadCount();
                int inQue = ((ManagementSupport) trpLst).getQueueSize();
View Full Code Here

Examples of org.apache.axis2.transport.TransportListener

        ArrayList eprList = new ArrayList();
        if (enableAllTransports) {
            Iterator transports = axisConfig.getTransportsIn().values().iterator();
            while (transports.hasNext()) {
                TransportInDescription transportIn = (TransportInDescription) transports.next();
                TransportListener listener = transportIn.getReceiver();
                if (listener != null) {
                    try {
                        EndpointReference[] eprsForService = listener.getEPRsForService(this.name, requestIP);
                        if (eprsForService != null) {
                            for (int i = 0; i < eprsForService.length; i++) {
                                EndpointReference endpointReference = eprsForService[i];
                                String address = endpointReference.getAddress();
                                if (address != null) {
                                    eprList.add(address);
                                }
                            }
                        }
                    } catch (AxisFault axisFault) {
                        log.warn(axisFault.getMessage());
                    }
                }
            }
        } else {
            List trs = this.exposedTransports;
            for (int i = 0; i < trs.size(); i++) {
                String trsName = (String) trs.get(i);
                TransportInDescription transportIn = axisConfig.getTransportIn(
                        new QName(trsName));
                if (transportIn != null) {
                    TransportListener listener = transportIn.getReceiver();
                    if (listener != null) {
                        try {
                            EndpointReference[] eprsForService = listener.getEPRsForService(this.name, requestIP);
                            if (eprsForService != null) {
                                for (int j = 0; j < eprsForService.length; j++) {
                                    EndpointReference endpointReference = eprsForService[j];
                                    String address = endpointReference.getAddress();
                                    if (address != null) {
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.