// helper class that ensures certain steps get executed in sequence
Ensure e = new Ensure();
// create two service providers, each providing a different service interface
Component sp1 = m.createComponent().setImplementation(new ServiceProvider(e)).setInterface(ServiceInterface.class.getName(), null);
Component sp2 = m.createComponent().setImplementation(new ServiceProvider2(e)).setInterface(ServiceInterface2.class.getName(), null);
// create a dynamic proxy based aspect and hook it up to both services
Component a1 = m.createAspectService(ServiceInterface.class, null, 10, "m_service")
.setFactory(new Factory(e, ServiceInterface.class, "ServiceInterfaceProxy"), "create");
Component a2 = m.createAspectService(ServiceInterface2.class, null, 10, "m_service")