private static boolean isEntity(Object item) { return MscOpts.hasRapidoidJPA() && GuiJpaUtil.isEntity(item); }
private static Object getIdentifier(Object bean) { return MscOpts.hasRapidoidJPA() ? GuiJpaUtil.getIdentifier(bean) : null; }
private Object provideSpecialInstance(Class<?> type, String name) { String cls = type.getName(); if (type.equals(IoCContext.class)) { return U.or(wrapper, this); } if (cls.equals("javax.persistence.EntityManager") && MscOpts.hasRapidoidJPA()) { return OptionalJPAUtil.getSharedContextAwareEntityManagerProxy(); } if (cls.equals("javax.persistence.EntityManagerFactory") && MscOpts.hasRapidoidJPA()) { return OptionalJPAUtil.getSharedEntityManagerFactoryProxy(); } return null; }
private static synchronized void restartApp() { if (!MscOpts.hasRapidoidWatch()) { Log.warn("Cannot reload/restart the application, module rapidoid-watch is missing!"); } if (mainClassName == null) { Log.warn("Cannot reload/restart the application, the main app class couldn't be detected!"); } Msc.logSection("!Restarting the web application..."); restarted = true; notifyListenersBeforeRestart(); resetAppStateBeforeRestart(); if (MscOpts.hasRapidoidJPA()) { loader = ReloadUtil.reloader(); ClasspathUtil.setDefaultClassLoader(loader); } reloadAndRunMainClass(); restarted = true; notifyListenersAfterRestart(); Log.info("!Successfully restarted the application!"); }
private Object provideSpecialInstance(Class<?> type, String name) { String cls = type.getName(); if (type.equals(IoCContext.class)) { return U.or(wrapper, this); } if (cls.equals("javax.persistence.EntityManager") && MscOpts.hasRapidoidJPA()) { return OptionalJPAUtil.getSharedContextAwareEntityManagerProxy(); } if (cls.equals("javax.persistence.EntityManagerFactory") && MscOpts.hasRapidoidJPA()) { return OptionalJPAUtil.getSharedEntityManagerFactoryProxy(); } return null; }
private static synchronized void restartApp() { if (!MscOpts.hasRapidoidWatch()) { Log.warn("Cannot reload/restart the application, module rapidoid-watch is missing!"); } if (mainClassName == null) { Log.warn("Cannot reload/restart the application, the main app class couldn't be detected!"); } Msc.logSection("!Restarting the web application..."); restarted = true; notifyListenersBeforeRestart(); resetAppStateBeforeRestart(); if (MscOpts.hasRapidoidJPA()) { loader = ReloadUtil.reloader(); ClasspathUtil.setDefaultClassLoader(loader); } reloadAndRunMainClass(); restarted = true; notifyListenersAfterRestart(); Log.info("!Successfully restarted the application!"); }