MyRESTApplication.class, MyExpertRestClass.class, HookedRest.class, RestWithInjections.class)).link());
Assembler assembler = new Assembler();
SystemInstance.get().setComponent(Assembler.class, assembler);
AnnotationDeployer annotationDeployer = new AnnotationDeployer();
ConfigurationFactory config = new ConfigurationFactory();
assembler.createProxyFactory(config.configureService(ProxyFactoryInfo.class));
assembler.createTransactionManager(config.configureService(TransactionServiceInfo.class));
assembler.createSecurityService(config.configureService(SecurityServiceInfo.class));
webModule = annotationDeployer.deploy(webModule);
EjbJar ejbJar = new EjbJar("ejb");
ejbJar.addEnterpriseBean(new StatelessBean(SimpleEJB.class));
ConfigurationFactory factory = new ConfigurationFactory(false);
AppModule appModule = new AppModule(Thread.currentThread().getContextClassLoader(), "foo");
appModule.setModuleId("rest");
appModule.getWebModules().add(webModule);
appModule.getEjbModules().add(new EjbModule(ejbJar));
annotationDeployer.deploy(appModule);
AppInfo appInfo = factory.configureApplication(appModule);
final AppContext application = assembler.createApplication(appInfo);
Context ctx = (Context) Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new Class<?>[]{Context.class}, new InvocationHandler() {