Example usage for org.springframework.jms.remoting JmsInvokerProxyFactoryBean afterPropertiesSet

List of usage examples for org.springframework.jms.remoting JmsInvokerProxyFactoryBean afterPropertiesSet

Introduction

In this page you can find the example usage for org.springframework.jms.remoting JmsInvokerProxyFactoryBean afterPropertiesSet.

Prototype

@Override
    public void afterPropertiesSet() 

Source Link

Usage

From source file:org.nebulaframework.util.jms.JMSRemotingSupport.java

/**
 * Creates and returns a proxy object which can be
 * used to consume a remote service.//  www  .  j ava  2 s. c  o m
 * 
 * @param <T> Type of Service Interface
 * @param cf JMS Connection Factory
 * @param queueName Name of JMS Queue used for communication
 * @param serviceClass Service Interface Class
 * @return Proxy for the remote service
 */
@SuppressWarnings("unchecked")
/* Ignore Unchecked Cast */
public static <T> T createProxy(ConnectionFactory cf, String queueName, Class<T> serviceClass) {

    // Create Proxy Factory Instance
    JmsInvokerProxyFactoryBean proxyFactory = new JmsInvokerProxyFactoryBean();
    proxyFactory.setConnectionFactory(cf);
    proxyFactory.setQueueName(queueName);
    proxyFactory.setServiceInterface(serviceClass);
    proxyFactory.afterPropertiesSet();

    // Return Proxy
    return (T) proxyFactory.getObject();
}