ConfiguredService targetService = entryPoint.getConfiguredReference().getTargetConfiguredServices().get(0);
Class serviceInterface = entryPoint.getConfiguredReference().getPort().getServiceContract().getInterface();
if (targetService.getPart() == null) {
// FIXME not correct
if (targetService.getPort() == null) {
BuilderInitException e = new BuilderInitException("No target service specified on ");
e.setIdentifier(entryPoint.getName());
}
targetName = targetService.getPort().getName();
} else {
targetName = targetService.getPart().getName();
}
SystemEntryPointContextFactory contextFactory = new SystemEntryPointContextFactory(entryPoint.getName(),
targetName, serviceInterface);
entryPoint.setContextFactory(contextFactory);
} catch (FactoryInitException e) {
e.addContextName(entryPoint.getName());
throw e;
}
}