コード例 #1
0
 static void prepareSharedChannelRegistry(
     SharedChannelRegistry sharedChannelRegistry,
     LinkedHashMap<Class<?>, String> appsWithNamespace) {
   int i = 0;
   SubscribableChannel sharedChannel = null;
   for (Entry<Class<?>, String> appEntry : appsWithNamespace.entrySet()) {
     String namespace = appEntry.getValue();
     if (i > 0) {
       sharedChannelRegistry.register(namespace + "." + INPUT_CHANNEL_NAME, sharedChannel);
     }
     sharedChannel = new DirectChannel();
     if (i < appsWithNamespace.size() - 1) {
       sharedChannelRegistry.register(namespace + "." + OUTPUT_CHANNEL_NAME, sharedChannel);
     }
     i++;
   }
 }
コード例 #2
0
 private MessageChannel locateSharedChannel(String name) {
   return sharedChannelRegistry != null
       ? sharedChannelRegistry.get(getNamespacePrefixedChannelName(name))
       : null;
 }