Examples of JmsEndpoint


Examples of org.apache.cxf.transport.jms.uri.JMSEndpoint

     */
    protected JMSEndpoint getExtensorsAndConfig(Bus bus,
                           EndpointInfo endpointInfo,
                           EndpointReferenceType target,
                           boolean isConduit) throws IOException {
        JMSEndpoint endpoint = null;
        String adr = target == null ? endpointInfo.getAddress() : target.getAddress().getValue();
        try {          
            endpoint = StringUtils.isEmpty(adr) || "jms://".equals(adr) || !adr.startsWith("jms")
                new JMSEndpoint()
                : JMSEndpointParser.createEndpoint(adr);               
        } catch (RuntimeException ex) {
            throw ex;
        } catch (Exception e) {
            IOException e2 = new IOException(e.getMessage());
View Full Code Here

Examples of org.apache.cxf.transport.jms.uri.JMSEndpoint

    public JMSConfiguration createJMSConfigurationFromEndpointInfo(Bus bus,
                                                                   EndpointInfo endpointInfo,
                                                                   EndpointReferenceType target,
                                                                   boolean isConduit)
        throws IOException {
        JMSEndpoint endpoint = getExtensorsAndConfig(bus, endpointInfo, target, isConduit);

        return configureEndpoint(isConduit, endpoint);
    }
View Full Code Here

Examples of org.apache.cxf.transport.jms.uri.JMSEndpoint

                if (headers == null) {
                    headers = new TreeMap<String, List<String>>();
                    inMessage.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, headers);
                }
                try {
                    JMSEndpoint endpoint = JMSEndpointParser.createEndpoint(jmsMessage
                        .getStringProperty(JMSSpecConstants.REQUESTURI_FIELD));
                    if (endpoint.getParameter(JMSSpecConstants.TARGETSERVICE_PARAMETER_NAME) != null) {
                        headers.put(JMSSpecConstants.TARGET_SERVICE_IN_REQUESTURI, Collections
                            .singletonList("true"));
                    }
                } catch (Exception e) {
                    headers.put(JMSSpecConstants.MALFORMED_REQUESTURI, Collections.singletonList("true"));
View Full Code Here

Examples of org.apache.cxf.transport.jms.uri.JMSEndpoint

    }
   
    @Test
    public void testReplyToConfig() throws Exception {
        JMSEndpoint endpoint = new JMSEndpoint();
        endpoint.setJndiInitialContextFactory("org.apache.activemq.jndi.ActiveMQInitialContextFactory");
        endpoint.setJndiURL("tcp://localhost:" + JMS_PORT);
        endpoint.setJndiConnectionFactoryName("ConnectionFactory");

        final JMSConfiguration jmsConfig = new JMSConfiguration();       
        JndiTemplate jt = new JndiTemplate();
       
        jt.setEnvironment(JMSOldConfigHolder.getInitialContextEnv(endpoint));
       
        JNDIConfiguration jndiConfig = new JNDIConfiguration();
        jndiConfig.setJndiConnectionFactoryName(endpoint.getJndiConnectionFactoryName());
        jmsConfig.setJndiTemplate(jt);
        jmsConfig.setJndiConfig(jndiConfig);
       
        jmsConfig.setTargetDestination("dynamicQueues/SoapService7.replyto.queue");
        jmsConfig.setReplyDestination("dynamicQueues/SoapService7.reply.queue");
View Full Code Here

Examples of org.apache.cxf.transport.jms.uri.JMSEndpoint

                                                boolean pubSubDomain) {
        return JMSFactory.resolveOrCreateDestination(jmsTemplate, destinationName, pubSubDomain);
    }

    public static JMSConfiguration getInitJMSConfiguration(String address) throws Exception {
        JMSEndpoint endpoint = JMSEndpointParser.createEndpoint(address);

        JMSConfiguration jmsConfig = new JMSConfiguration();

        if (endpoint.isSetDeliveryMode()) {
            int deliveryMode = endpoint.getDeliveryMode()
                .equals(JMSURIConstants.DELIVERYMODE_PERSISTENT)
                ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT;
            jmsConfig.setDeliveryMode(deliveryMode);
        }

        if (endpoint.isSetPriority()) {
            int priority = endpoint.getPriority();
            jmsConfig.setPriority(priority);
        }

        if (endpoint.isSetTimeToLive()) {
            long timeToLive = endpoint.getTimeToLive();
            jmsConfig.setTimeToLive(timeToLive);
        }

        if (jmsConfig.isUsingEndpointInfo()) {
            JndiTemplate jt = new JndiTemplate();
            jt.setEnvironment(JMSOldConfigHolder.getInitialContextEnv(endpoint));
            boolean pubSubDomain = false;
            pubSubDomain = endpoint.getJmsVariant().equals(JMSURIConstants.TOPIC);
            JNDIConfiguration jndiConfig = new JNDIConfiguration();
            jndiConfig.setJndiConnectionFactoryName(endpoint.getJndiConnectionFactoryName());
            jmsConfig.setJndiTemplate(jt);
            jmsConfig.setJndiConfig(jndiConfig);
            jmsConfig.setExplicitQosEnabled(true);
            jmsConfig.setPubSubDomain(pubSubDomain);
            jmsConfig.setPubSubNoLocal(true);
            boolean useJndi = endpoint.getJmsVariant().equals(JMSURIConstants.JNDI);
            if (useJndi) {
                // Setup Destination jndi destination resolver
                final JndiDestinationResolver jndiDestinationResolver = new JndiDestinationResolver();
                jndiDestinationResolver.setJndiTemplate(jt);
                jmsConfig.setDestinationResolver(jndiDestinationResolver);
                jmsConfig.setTargetDestination(endpoint.getDestinationName());
                jmsConfig.setReplyDestination(endpoint.getReplyToName());
            } else {
                // Use the default dynamic destination resolver
                jmsConfig.setTargetDestination(endpoint.getDestinationName());
                jmsConfig.setReplyDestination(endpoint.getReplyToName());
            }
        }
        return jmsConfig;
    }
View Full Code Here

Examples of org.apache.cxf.transport.jms.uri.JMSEndpoint

     */
    protected JMSEndpoint getExtensorsAndConfig(Bus bus,
                           EndpointInfo endpointInfo,
                           EndpointReferenceType target,
                           boolean isConduit) throws IOException {
        JMSEndpoint endpoint = null;
        String adr = target == null ? endpointInfo.getAddress() : target.getAddress().getValue();
        try {          
            endpoint = StringUtils.isEmpty(adr) || "jms://".equals(adr) || !adr.startsWith("jms")
                new JMSEndpoint()
                : JMSEndpointParser.createEndpoint(adr);               
        } catch (RuntimeException ex) {
            throw ex;
        } catch (Exception e) {
            IOException e2 = new IOException(e.getMessage());
View Full Code Here

Examples of org.apache.cxf.transport.jms.uri.JMSEndpoint

    public JMSConfiguration createJMSConfigurationFromEndpointInfo(Bus bus,
                                                                   EndpointInfo endpointInfo,
                                                                   EndpointReferenceType target,
                                                                   boolean isConduit)
        throws IOException {
        JMSEndpoint endpoint = getExtensorsAndConfig(bus, endpointInfo, target, isConduit);

        return configureEndpoint(isConduit, endpoint);
    }
View Full Code Here

Examples of org.apache.cxf.transport.jms.uri.JMSEndpoint

                if (headers == null) {
                    headers = new TreeMap<String, List<String>>();
                    inMessage.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, headers);
                }
                try {
                    JMSEndpoint endpoint = JMSEndpointParser.createEndpoint(jmsMessage
                        .getStringProperty(JMSSpecConstants.REQUESTURI_FIELD));
                    if (endpoint.getParameter(JMSSpecConstants.TARGETSERVICE_PARAMETER_NAME) != null) {
                        headers.put(JMSSpecConstants.TARGET_SERVICE_IN_REQUESTURI, Collections
                            .singletonList("true"));
                    }
                } catch (Exception e) {
                    headers.put(JMSSpecConstants.MALFORMED_REQUESTURI, Collections.singletonList("true"));
View Full Code Here

Examples of org.apache.cxf.transport.jms.uri.JMSEndpoint

     */
    private JMSEndpoint getExtensorsAndConfig(Bus bus,
                           EndpointInfo endpointInfo,
                           EndpointReferenceType target,
                           boolean isConduit) throws IOException {
        JMSEndpoint endpoint = null;
        String adr = target == null ? endpointInfo.getAddress() : target.getAddress().getValue();
        try {          
            endpoint = StringUtils.isEmpty(adr) || "jms://".equals(adr) || !adr.startsWith("jms")
                new JMSEndpoint()
                : JMSEndpointParser.createEndpoint(adr);               
        } catch (RuntimeException ex) {
            throw ex;
        } catch (Exception e) {
            IOException e2 = new IOException(e.getMessage());
View Full Code Here

Examples of org.apache.cxf.transport.jms.uri.JMSEndpoint

    public JMSConfiguration createJMSConfigurationFromEndpointInfo(Bus bus,
                                                                   EndpointInfo endpointInfo,
                                                                   EndpointReferenceType target,
                                                                   boolean isConduit)
        throws IOException {
        JMSEndpoint endpoint = getExtensorsAndConfig(bus, endpointInfo, target, isConduit);

        if (address != null) {
            mapAddressToEndpoint(address, endpoint);
        }
        if (jmsConfig == null) {
            jmsConfig = new JMSConfiguration();
        }

        if (endpoint.isSetDeliveryMode()) {
            int deliveryMode = endpoint.getDeliveryMode()
                .equals(JMSURIConstants.DELIVERYMODE_PERSISTENT)
                ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT;
            jmsConfig.setDeliveryMode(deliveryMode);
        }
       
        if (endpoint.isSetPriority()) {
            int priority = endpoint.getPriority();
            jmsConfig.setPriority(priority);
        }

        if (jmsConfig.isUsingEndpointInfo()) {
            JndiTemplate jt = new JndiTemplate();
            jt.setEnvironment(JMSOldConfigHolder.getInitialContextEnv(endpoint));
            boolean pubSubDomain = endpoint.getJmsVariant().contains(JMSURIConstants.TOPIC);
            JNDIConfiguration jndiConfig = new JNDIConfiguration();
            jndiConfig.setJndiConnectionFactoryName(endpoint.getJndiConnectionFactoryName());
            jmsConfig.setJndiTemplate(jt);
           
            jndiConfig.setConnectionUserName(endpoint.getUsername());
            jndiConfig.setConnectionPassword(endpoint.getPassword());
           
            jmsConfig.setJndiConfig(jndiConfig);
            if (endpoint.isSetReconnectOnException()) {
                jmsConfig.setReconnectOnException(endpoint.isReconnectOnException());
            }
            jmsConfig.setDurableSubscriptionName(serverBehavior.getDurableSubscriberName());
            jmsConfig.setExplicitQosEnabled(true);
            if (jmsConfig.getMessageSelector() == null) {
                jmsConfig.setMessageSelector(serverBehavior.getMessageSelector());
            }
            if (isConduit) {
                if (runtimePolicy.isSetMessageType()) {
                    jmsConfig.setMessageType(runtimePolicy.getMessageType().value());
                } else if (address == null) {
                    jmsConfig.setMessageType(JMSConstants.BYTE_MESSAGE_TYPE);
                }
            }
            jmsConfig.setPubSubDomain(pubSubDomain);
            jmsConfig.setPubSubNoLocal(true);
            if (clientConfig.isSetClientReceiveTimeout()) {
                jmsConfig.setReceiveTimeout(clientConfig.getClientReceiveTimeout());
            }
            if (clientConfig.isSetUseConduitIdSelector()) {
                jmsConfig.setUseConduitIdSelector(clientConfig.isUseConduitIdSelector());
            }
            if (clientConfig.isSetConduitSelectorPrefix()) {
                jmsConfig.setConduitSelectorPrefix(clientConfig.getConduitSelectorPrefix());
            }
            jmsConfig.setEnforceSpec(clientConfig.isEnforceSpec());
            jmsConfig.setSubscriptionDurable(serverBehavior.isSetDurableSubscriberName());
            jmsConfig.setDurableSubscriptionName(serverBehavior.getDurableSubscriberName());
            jmsConfig.setDurableSubscriptionClientId(serverConfig.getDurableSubscriptionClientId());
            if (sessionPool.isSetHighWaterMark()) {
                jmsConfig.setMaxConcurrentConsumers(sessionPool.getHighWaterMark());
            }
            if (sessionPool.isSetLowWaterMark()) {
                jmsConfig.setConcurrentConsumers(sessionPool.getLowWaterMark());
            }
            if (endpoint.isSetTimeToLive()) {
                long timeToLive = endpoint.getTimeToLive();
                jmsConfig.setTimeToLive(timeToLive);
            }
            if (endpoint.isSetUseJMS11()) {
                jmsConfig.setUseJms11(endpoint.isUseJMS11());
            }
            if (serverBehavior.isSetTransactional()) {
                jmsConfig.setSessionTransacted(serverBehavior.isTransactional());
            }
            boolean useJndi = endpoint.getJmsVariant().contains(JMSURIConstants.JNDI);
            if (useJndi) {
                // Setup Destination jndi destination resolver
                final JndiDestinationResolver jndiDestinationResolver = new JndiDestinationResolver();
                jndiDestinationResolver.setJndiTemplate(jt);
                jmsConfig.setDestinationResolver(jndiDestinationResolver);
                jmsConfig.setTargetDestination(endpoint.getDestinationName());
                jmsConfig.setReplyDestination(endpoint.getReplyToName());
                if (address != null) {
                    jmsConfig.setReplyToDestination(address.getJndiReplyToDestinationName());
                }
            } else {
                // Use the default dynamic destination resolver
                jmsConfig.setTargetDestination(endpoint.getDestinationName());
                jmsConfig.setReplyDestination(endpoint.getReplyToName());
                if (address != null) {
                    jmsConfig.setReplyToDestination(address.getJmsReplyToDestinationName());
                }
            }
        }
       
        String requestURI = endpoint.getRequestURI();
        jmsConfig.setRequestURI(requestURI);

        String targetService = endpoint.getParameter(JMSSpecConstants.TARGETSERVICE_PARAMETER_NAME);
        jmsConfig.setTargetService(targetService);
        return jmsConfig;
    }
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.