refContract.setInterface(Target.class);
Reference reference = systemFactory.createReference();
reference.setName("setTarget");
reference.setServiceContract(refContract);
componentType.getReferences().add(reference);
ConfiguredReference cReference = systemFactory.createConfiguredReference(reference.getName(), "target");
cReference.initialize(assemblyContext);
source.getConfiguredReferences().add(cReference);
// wire multiplicity using a setter
JavaServiceContract refContract2 = systemFactory.createJavaServiceContract();
refContract2.setInterface(Target.class);
Reference reference2 = systemFactory.createReference();
reference2.setName("setTargets");
reference2.setServiceContract(refContract2);
reference2.setMultiplicity(Multiplicity.ONE_N);
componentType.getReferences().add(reference2);
ConfiguredReference cReference2 = systemFactory.createConfiguredReference(reference2.getName(), "target");
cReference2.initialize(assemblyContext);
source.getConfiguredReferences().add(cReference2);
// wire multiplicity using a field
JavaServiceContract refContract3 = systemFactory.createJavaServiceContract();
refContract3.setInterface(Target.class);
Reference reference3 = systemFactory.createReference();
reference3.setName("targetsThroughField");
reference3.setServiceContract(refContract3);
reference3.setMultiplicity(Multiplicity.ONE_N);
componentType.getReferences().add(reference3);
ConfiguredReference cReference3 = systemFactory.createConfiguredReference(reference3.getName(), "target");
cReference3.initialize(assemblyContext);
source.getConfiguredReferences().add(cReference3);
// wire multiplicity using a array
JavaServiceContract refContract4 = systemFactory.createJavaServiceContract();
refContract4.setInterface(Target.class);
Reference reference4 = systemFactory.createReference();
reference4.setName("setArrayOfTargets");
reference4.setServiceContract(refContract4);
reference4.setMultiplicity(Multiplicity.ONE_N);
componentType.getReferences().add(reference4);
ConfiguredReference cReference4 = systemFactory.createConfiguredReference(reference4.getName(), "target");
cReference4.initialize(assemblyContext);
source.getConfiguredReferences().add(cReference4);
source.initialize(assemblyContext);
Module module = systemFactory.createModule();