code: public static List<MessagingContext> forExportedVariables(
  			String domain,
  			String applicationName,
  			Instance instance,
  			Map<String,String> externalExports,
  			ThoseThat thoseThat ) {
  
  		List<MessagingContext> result = new ArrayList<> ();
  
  		// For inter-app messages, the real question is about whether we need
  		// to create a context for the application template.
  		Set<String> externalExportPrefixes = new HashSet<> ();
  		for( String varName : externalExports.keySet()) {
  			String prefix = VariableHelpers.parseVariableName( varName ).getKey();
  			externalExportPrefixes.add( prefix );
  		}
  
  		// Internal variables
  		boolean publishExternal = false;
  		for( String facetOrComponentName : VariableHelpers.findPrefixesForExportedVariables( instance )) {
  			MessagingContext ctx = new MessagingContext( RecipientKind.AGENTS, domain, facetOrComponentName, thoseThat, applicationName );
  			result.add( ctx );
  
  			if( externalExportPrefixes.contains( facetOrComponentName ))
  				publishExternal = true;
  		}
  
  		// External variables - they all have the same prefix, the application template's name
  		if( publishExternal ) {
  			String varName = externalExports.values().iterator().next();
  			String prefix = VariableHelpers.parseVariableName( varName ).getKey();
  
  			// We indicate the application name, but it will most likely not be used
  			// for inter-application messages.
  			MessagingContext ctx = new MessagingContext( RecipientKind.INTER_APP, domain, prefix, thoseThat, applicationName );
  			result.add( ctx );
  		}
  
  		return result;
  	}
docs: Builds a list of messaging contexts.
  @param domain the domain
  @param applicationName the name of the agent's application
  @param instance the current instance
  @param externalExports a non-null map that associates internal exported variables with global ones
  @param thoseThat whether we target "those that import" or "those that export"
  @return a non-null list