Package org.codehaus.activemq.transport

Examples of org.codehaus.activemq.transport.TransportChannel


    protected TransportChannel createTransportChannel(String theURLString) throws JMSException {
        URI uri = createURI(theURLString);
        TransportChannelFactory factory = TransportChannelProvider.getFactory(uri);
        BrokerConnector brokerConnector = null;
        boolean created = false;
        TransportChannel transportChannel = null;
        boolean embedServer = isUseEmbeddedBroker() || factory.requiresEmbeddedBroker();
        if (embedServer) {
            synchronized (this) {
                if (factory.requiresEmbeddedBroker()) {
                    transportChannel = factory.create(getWireFormat(), uri);
                    brokerConnector = transportChannel.getEmbeddedBrokerConnector();
                }
                if (brokerConnector == null) {
                    brokerConnector = brokerContext.getConnectorByURL(theURLString);
                    if (brokerConnector == null) {
                        brokerConnector = createBrokerConnector(theURLString);
View Full Code Here


        }

        // now lets create a VM channel that the JMS client will use
        // to connect to the embedded brokerConnector
        URI localURI = createURI("vm", remoteLocation);
        TransportChannel localChannel = TransportChannelProvider.create(getWireFormat(), localURI);
        ensureVmServerIsAvailable(localChannel, brokerConnector);
        return localChannel;
    }
View Full Code Here

    protected TransportChannel createTransportChannel(String theURLString) throws JMSException {
        URI uri = createURI(theURLString);
        TransportChannelFactory factory = TransportChannelProvider.getFactory(uri);
        BrokerConnector brokerConnector = null;
        boolean created = false;
        TransportChannel transportChannel = null;
        boolean embedServer = isUseEmbeddedBroker() || factory.requiresEmbeddedBroker();
        if (embedServer) {
            synchronized (this) {
                if (factory.requiresEmbeddedBroker()) {
                    transportChannel = factory.create(getWireFormat(), uri);
                    brokerConnector = transportChannel.getEmbeddedBrokerConnector();
                }
                if (brokerConnector == null) {
                    brokerConnector = brokerContext.getConnectorByURL(theURLString);
                    if (brokerConnector == null) {
                        brokerConnector = createBrokerConnector(theURLString);
View Full Code Here

        }

        // now lets create a VM channel that the JMS client will use
        // to connect to the embedded brokerConnector
        URI localURI = createURI("vm", remoteLocation);
        TransportChannel localChannel = TransportChannelProvider.create(getWireFormat(), localURI);
        ensureVmServerIsAvailable(localChannel, brokerConnector);
        return localChannel;
    }
View Full Code Here

                    startedEmbeddedBrokers.add(theURLString);
                    created = true;
                }
            }
        }
        TransportChannel transportChannel = factory.create(getWireFormat(), uri);
        if (embedServer) {
            return ensureServerIsAvailable(uri, transportChannel, brokerConnector, created);
        }
        return transportChannel;
    }
View Full Code Here

        }

        // now lets create a VM channel that the JMS client will use
        // to connect to the embedded brokerConnector
        URI localURI = createURI("vm", remoteLocation);
        TransportChannel localChannel = TransportChannelProvider.create(getWireFormat(), localURI);
        ensureVmServerIsAvailable(localChannel, brokerConnector);
        return localChannel;
    }
View Full Code Here

     * @return receipt - or null
     * @throws JMSException
     */
    public Receipt send(Packet packet, int timeout) throws JMSException {
        do {
            TransportChannel tc = getEstablishedChannel(timeout);
            if (tc != null) {
                try {
                    return tc.send(packet, timeout);
                }
                catch (TimeoutExpiredException e) {
                    throw e;
                }
                catch (UnsupportedWireFormatException uwf) {
View Full Code Here

     * @throws JMSException
     */
    public void asyncSend(Packet packet) throws JMSException {
        long timeout = getEstablishConnectionTimeout();
        do {
            TransportChannel tc = getEstablishedChannel(timeout);
            if (tc != null) {
                try {
                    tc.asyncSend(packet);
                    break;
                }
                catch (TimeoutExpiredException e) {
                    throw e;
                }
View Full Code Here

     * handle exception from the embedded channel
     *
     * @param jmsEx
     */
    public void onException(JMSException jmsEx) {
        TransportChannel tc = this.channel;
        if (jmsEx instanceof UnsupportedWireFormatException) {
            fireException(jmsEx);
        }
        else {
            try {
View Full Code Here

    public TransportChannel create(WireFormat wireFormat, URI remoteLocation) throws JMSException {
        try {
            List uris = new ArrayList();
            String text = parseURIs(uris, remoteLocation);
            uris = randomizeURIs(uris);
            TransportChannel channel = new CompositeTransportChannel(wireFormat, uris);

            return populateProperties(channel, text);
        }
        catch (URISyntaxException e) {
            throw JMSExceptionHelper.newJMSException("Can't parse list of URIs for: " + remoteLocation + ". Reason: " + e, e);
View Full Code Here

TOP

Related Classes of org.codehaus.activemq.transport.TransportChannel

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.