AssemblyFactory assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
JavaInterfaceFactory javaFactory = modelFactories.getFactory(JavaInterfaceFactory.class);
// Resource implementation always provide a single service exposing
// the Resource interface, and have no references and properties
widgetService = assemblyFactory.createService();
widgetService.setName("Widget");
// Create the Java interface contract for the Resource service
JavaInterface javaInterface;
try {