Will register the bean definitions as primary beans. Optionally a list of the bean names that should be set primary can be defined.
Note that this will in fact modify the original BeanDefinition.
128129130131132133134135136137
Map<String, String> rename = new HashMap<String, String>(); rename.put( "myService", "someService" ); Collection<String> primaries = Arrays.asList( "myController" ); module.setExposeTransformer( new BeanDefinitionTransformerComposite( new PrimaryBeanTransformer( primaries ), new BeanRenameTransformer( rename, false ) ) ); return module; }
140141142143144145146147148149
public ExposingModule prefixedModule() { ExposingModule module = new ExposingModule( "prefixed" ); Collection<String> primaries = Arrays.asList( "myService" ); module.setExposeTransformer( new BeanDefinitionTransformerComposite( new PrimaryBeanTransformer( primaries ), new BeanPrefixingTransformer( "prefix" ) ) ); return module; }