3.4. Exporting Beans for Remoting with @RemotingDestination

The @RemotingDestination annotation may be used as an alternative to the XML remoting-destination tag when using annotation-based Spring configuration. @RemotingDestination is used at the type level to indicate the class being exported. @RemotingInclude and @RemotingExclude are used at the method level to mark the methods that should be included and excluded for remoting.

The following example illustrates the productService bean configured exclusively through annotations:

package flex.samples.product;

import org.springframework.flex.remoting.RemotingDestination;
import org.springframework.flex.remoting.RemotingExclude;
import org.springframework.flex.remoting.RemotingInclude;
import org.springframework.stereotype.Service;

@Service("productService")
@RemotingDestination(channels={"my-amf","my-secure-amf"})
public class ProductServiceImpl implements ProductService {

	@RemotingInclude
	public Product read(String id) {
		...
	}
	
	@RemotingExclude
	public Product create(Product product){
		...
	}
	
	@RemotingInclude
	public Product update(Product product){
		...
	}
	
	@RemotingExclude
	public void delete(Product product) {
		...
	}
}