Package org.apache.axis.components.jms

Examples of org.apache.axis.components.jms.JMSVendorAdapter


                                    JMSConstants.DOMAIN_DEFAULT);

        if(cfConfig == null)
            throw new IllegalArgumentException("noCfConfig");

        JMSVendorAdapter adapter = JMSVendorAdapterFactory.getJMSVendorAdapter();
        if(domain.equals(JMSConstants.DOMAIN_QUEUE))
        {
            return new QueueConnector(adapter.getQueueConnectionFactory(cfConfig),
                                      numRetries, numSessions, connectRetryInterval,
                                      interactRetryInterval, timeoutTime,
                                      allowReceive, clientID, username, password,
                                      adapter);
        }
        else // domain is Topic
        {
            return new TopicConnector(adapter.getTopicConnectionFactory(cfConfig),
                                      numRetries, numSessions, connectRetryInterval,
                                      interactRetryInterval, timeoutTime,
                                      allowReceive, clientID, username, password,
                                      adapter);
        }
View Full Code Here


                                    JMSConstants.DOMAIN_DEFAULT);

        if(cfConfig == null)
            throw new IllegalArgumentException("noCfConfig");

        JMSVendorAdapter adapter = JMSVendorAdapterFactory.getJMSVendorAdapter();
        if(domain.equals(JMSConstants.DOMAIN_QUEUE))
        {
            return new QueueConnector(adapter.getQueueConnectionFactory(cfConfig),
                                      numRetries, numSessions, connectRetryInterval,
                                      interactRetryInterval, timeoutTime,
                                      allowReceive, clientID, username, password,
                                      adapter);
        }
        else // domain is Topic
        {
            return new TopicConnector(adapter.getTopicConnectionFactory(cfConfig),
                                      numRetries, numSessions, connectRetryInterval,
                                      interactRetryInterval, timeoutTime,
                                      allowReceive, clientID, username, password,
                                      adapter);
        }
View Full Code Here

        JMSConnector connector = null;
        HashMap connectorProperties = null;
        HashMap connectionFactoryProperties = null;

        JMSVendorAdapter vendorAdapter = null;
        JMSURLHelper jmsurl = null;

        // a security context is required to create/use JMSConnectors
        String username = message.getUsername();
        String password = message.getPassword();

        // the presence of an endpoint address indicates whether the client application
        //  is instantiating the JMSTransport directly (deprecated) or indirectly via JMS URL
        String endpointAddr = message.getTargetEndpointAddress();
        if (endpointAddr != null)
        {
            try
            {
                // performs minimal validation ('jms:/destination?...')
                jmsurl = new JMSURLHelper(new java.net.URL(endpointAddr));

                // lookup the appropriate vendor adapter
                String vendorId = jmsurl.getVendor();
                if (vendorId == null)
                    vendorId = JMSConstants.JNDI_VENDOR_ID;

                if (log.isDebugEnabled())
                    log.debug("JMSTransport.setupMessageContextImpl(): endpt=" + endpointAddr +
                              ", vendor=" + vendorId);

                vendorAdapter = JMSVendorAdapterFactory.getJMSVendorAdapter(vendorId);
                if (vendorAdapter == null)
                {
                    throw new AxisFault("cannotLoadAdapterClass:" + vendorId);
                }

                // populate the connector and connection factory properties tables
                connectorProperties = vendorAdapter.getJMSConnectorProperties(jmsurl);
                connectionFactoryProperties = vendorAdapter.getJMSConnectionFactoryProperties(jmsurl);
            }
            catch (java.net.MalformedURLException e)
            {
                log.error(Messages.getMessage("malformedURLException00"), e);
                throw new AxisFault(Messages.getMessage("malformedURLException00"), e);
            }
        }
        else
        {
            // the JMSTransport was instantiated directly, use the default adapter
            vendorAdapter = JMSVendorAdapterFactory.getJMSVendorAdapter();
            if (vendorAdapter == null)
            {
                throw new AxisFault("cannotLoadAdapterClass");
            }

            // use the properties passed in to the constructor
            connectorProperties = defaultConnectorProps;
            connectionFactoryProperties = defaultConnectionFactoryProps;
        }

        try
        {
            connector = JMSConnectorManager.getInstance().getConnector(connectorProperties, connectionFactoryProperties,
                                                           username, password, vendorAdapter);
        }
        catch (Exception e)
        {
            log.error(Messages.getMessage("cannotConnectError"), e);

            if(e instanceof AxisFault)
                throw (AxisFault)e;
            throw new AxisFault("cannotConnect", e);
        }

        // store these in the context for later use
        context.setProperty(JMSConstants.CONNECTOR, connector);
        context.setProperty(JMSConstants.VENDOR_ADAPTER, vendorAdapter);

        // vendors may populate the message context
        vendorAdapter.setupMessageContext(context, message, jmsurl);

        if (log.isDebugEnabled()) {
            log.debug("Exit: JMSTransport::setupMessageContextImpl");
        }
    }
View Full Code Here

        try
        {
            JMSURLHelper jmsurl = new JMSURLHelper(new java.net.URL(endpointAddr));
            String vendorId = jmsurl.getVendor();

            JMSVendorAdapter vendorAdapter = null;
            if (vendorId == null)
                vendorId = JMSConstants.JNDI_VENDOR_ID;
            vendorAdapter = JMSVendorAdapterFactory.getJMSVendorAdapter(vendorId);

            // the vendor adapter may not exist
            if (vendorAdapter == null)
                return;

            // determine the set of properties to be used for matching the connection
            HashMap connectorProps = vendorAdapter.getJMSConnectorProperties(jmsurl);
            HashMap cfProps = vendorAdapter.getJMSConnectionFactoryProperties(jmsurl);

            JMSConnectorManager.getInstance().closeMatchingJMSConnectors(connectorProps, cfProps,
                                                                         username, password,
                                                                         vendorAdapter);
        }
View Full Code Here

    {
        SimpleJMSListener.doThreads = doThreads;

        try {
            // create a JMS connector using the default vendor adapter
            JMSVendorAdapter adapter = JMSVendorAdapterFactory.getJMSVendorAdapter();
            connector = JMSConnectorFactory.createServerConnector(connectorMap,
                                                                  cfMap,
                                                                  username,
                                                                  password,
                                                                  adapter);
View Full Code Here

        JMSConnector connector = null;
        HashMap connectorProperties = null;
        HashMap connectionFactoryProperties = null;

        JMSVendorAdapter vendorAdapter = null;
        JMSURLHelper jmsurl = null;

        // a security context is required to create/use JMSConnectors
        String username = message.getUsername();
        String password = message.getPassword();

        // the presence of an endpoint address indicates whether the client application
        //  is instantiating the JMSTransport directly (deprecated) or indirectly via JMS URL
        String endpointAddr = message.getTargetEndpointAddress();
        if (endpointAddr != null)
        {
            try
            {
                // performs minimal validation ('jms:/destination?...')
                jmsurl = new JMSURLHelper(new java.net.URL(endpointAddr));

                // lookup the appropriate vendor adapter
                String vendorId = jmsurl.getVendor();
                if (vendorId == null)
                    vendorId = JMSConstants.JNDI_VENDOR_ID;

                if (log.isDebugEnabled())
                    log.debug("JMSTransport.setupMessageContextImpl(): endpt=" + endpointAddr +
                              ", vendor=" + vendorId);

                vendorAdapter = JMSVendorAdapterFactory.getJMSVendorAdapter(vendorId);
                if (vendorAdapter == null)
                {
                    throw new AxisFault("cannotLoadAdapterClass:" + vendorId);
                }

                // populate the connector and connection factory properties tables
                connectorProperties = vendorAdapter.getJMSConnectorProperties(jmsurl);
                connectionFactoryProperties = vendorAdapter.getJMSConnectionFactoryProperties(jmsurl);
            }
            catch (java.net.MalformedURLException e)
            {
                log.error(Messages.getMessage("malformedURLException00"), e);
                throw new AxisFault(Messages.getMessage("malformedURLException00"), e);
            }
        }
        else
        {
            // the JMSTransport was instantiated directly, use the default adapter
            vendorAdapter = JMSVendorAdapterFactory.getJMSVendorAdapter();
            if (vendorAdapter == null)
            {
                throw new AxisFault("cannotLoadAdapterClass");
            }

            // use the properties passed in to the constructor
            connectorProperties = defaultConnectorProps;
            connectionFactoryProperties = defaultConnectionFactoryProps;
        }

        try
        {
            connector = JMSConnectorManager.getInstance().getConnector(connectorProperties, connectionFactoryProperties,
                                                           username, password, vendorAdapter);
        }
        catch (Exception e)
        {
            log.error(Messages.getMessage("cannotConnectError"), e);

            if(e instanceof AxisFault)
                throw (AxisFault)e;
            throw new AxisFault("cannotConnect", e);
        }

        // store these in the context for later use
        context.setProperty(JMSConstants.CONNECTOR, connector);
        context.setProperty(JMSConstants.VENDOR_ADAPTER, vendorAdapter);

        // vendors may populate the message context
        vendorAdapter.setupMessageContext(context, message, jmsurl);

        if (log.isDebugEnabled()) {
            log.debug("Exit: JMSTransport::setupMessageContextImpl");
        }
    }
View Full Code Here

        try
        {
            JMSURLHelper jmsurl = new JMSURLHelper(new java.net.URL(endpointAddr));
            String vendorId = jmsurl.getVendor();

            JMSVendorAdapter vendorAdapter = null;
            if (vendorId == null)
                vendorId = JMSConstants.JNDI_VENDOR_ID;
            vendorAdapter = JMSVendorAdapterFactory.getJMSVendorAdapter(vendorId);

            // the vendor adapter may not exist
            if (vendorAdapter == null)
                return;

            // determine the set of properties to be used for matching the connection
            HashMap connectorProps = vendorAdapter.getJMSConnectorProperties(jmsurl);
            HashMap cfProps = vendorAdapter.getJMSConnectionFactoryProperties(jmsurl);

            JMSConnectorManager.getInstance().closeMatchingJMSConnectors(connectorProps, cfProps,
                                                                         username, password,
                                                                         vendorAdapter);
        }
View Full Code Here

    {
        SimpleJMSListener.doThreads = doThreads;

        try {
            // create a JMS connector using the default vendor adapter
            JMSVendorAdapter adapter = JMSVendorAdapterFactory.getJMSVendorAdapter();
            connector = JMSConnectorFactory.createServerConnector(connectorMap,
                                                                  cfMap,
                                                                  username,
                                                                  password,
                                                                  adapter);
View Full Code Here

TOP

Related Classes of org.apache.axis.components.jms.JMSVendorAdapter

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.