@Override public void onDestroy(OrienteerWebApplication app, ODatabaseDocument db) { super.onDestroy(app, db); app.unmountPages("org.orienteer.camel.web"); //app.unregisterWidgets("org.orienteer.camel.widget"); OMethodsManager.get().removeModule(Module.class); OMethodsManager.get().reload(); }
@Override public void onInitialize(OrienteerWebApplication app, ODatabaseDocument db) { super.onInitialize(app, db); app.setMetaData(OIntegrationConfig.INTEGRATION_SESSIONS_KEY, new ConcurrentHashMap<String,CamelContext>()); app.mountPages("org.orienteer.camel.web"); //app.registerWidgets("org.orienteer.camel.widget"); OMethodsManager.get().addModule(Module.class); OMethodsManager.get().reload(); }
public <T> void populate(ICommandsSupportComponent<T> commandSupport, MethodPlace place, IModel<?> mainObjectModel, Component relatedComponent) { populateInternal(commandSupport, place, mainObjectModel, relatedComponent, null, false); }
@Test public void baseTest() throws Exception{ // MethodManager.get().reload(); List<IMethod> methods = OMethodsManager.get().getMethods(new EmptyMethodContext()); assertTrue(methods.size()>0); int equals = 0; for (IMethod iMethod : methods) { if (iMethod instanceof AnnotatedMethod || iMethod instanceof SimpleMethod){ equals++; } } assertEquals(1, equals); }
@SuppressWarnings("unchecked") private <T> void populateInternal(ICommandsSupportComponent<T> commandSupport, MethodPlace place, IModel<?> mainObjectModel, Component relatedComponent, BootstrapType bootstrapType, boolean overrideBootstrapType) { AbstractWidget<?> widget = getWidget(commandSupport); MethodContext ctx = new MethodContext(mainObjectModel, widget, place, relatedComponent); List<IMethod> methods = getMethods(ctx); for (IMethod method : methods) { Command<T> component = (Command<T>) method.createCommand(commandSupport.newCommandId()); if (component !=null){ if (overrideBootstrapType){ component.setBootstrapType(bootstrapType); } commandSupport.addCommand(component); } } }
private OMethodsManager() { methodStorage = new MethodStorage(); definitionsStorages = new HashSet<IMethodDefinitionStorage>(); addDefinitionsStorage(new JavaClassOMethodDefinitionStorage(methodStorage)); addDefinitionsStorage(new JavaMethodOMethodDefinitionStorage(methodStorage)); }
public synchronized <M extends IOrienteerModule> M unregisterModule(Class<M> moduleClass) { M module = getServiceInstance(moduleClass); if (registeredModules.containsKey(module.getName())) { OMethodsManager.get().removeModule(moduleClass); registeredModules.remove(module.getName()); OMethodsManager.get().reload(); return module; } else LOG.info("Orienteer application does not already registered module: " + module.getName()); return null; }
public synchronized <M extends IOrienteerModule> M registerModule(Class<M> moduleClass) { M module = getServiceInstance(moduleClass); registeredModules.put(module.getName(), getServiceInstance(moduleClass)); registeredModulesSorted = false; OMethodsManager.get().addModule(moduleClass); OMethodsManager.get().reload(); return module; }
public <T> void populate(ICommandsSupportComponent<T> commandSupport, MethodPlace place, IModel<?> mainObjectModel, Component relatedComponent, BootstrapType bootstrapType) { populateInternal(commandSupport, place, mainObjectModel, relatedComponent, bootstrapType, true); }
@Override protected void onInitialize() { super.onInitialize(); add(newIcon("icon")); add(new Label("title", getTitleModel())); add(createFooterPanel("widgetFooter")); getDashboardPanel().getDashboardSupport().initWidget(this); loadSettings(); OMethodsManager.get().populate(this, MethodPlace.ACTIONS, getModel(), null, null); }
public <T> void populate(ICommandsSupportComponent<T> commandSupport, MethodPlace place, IModel<?> mainObjectModel) { populateInternal(commandSupport, place, mainObjectModel, null, null, false); }