// Obtain SCA module context.
ModuleContext moduleContext = CurrentModuleContext.getContext();
// Locate the HelloWorld service component and invoke it
// Locate the CustomerComponent service component and invoke it
Customer customer = (Customer) moduleContext.locateService("CustomerComponent");
System.out.println("Main thread " + Thread.currentThread());
customer.purchaseGoods();
}