/** * Register fetch properties with container. */ @Override public void onLoad(PluginContainer container) { super.onLoad(container); container.registerProperties(this, "backgroundFetch", "deferredFetch"); }
@Override public void init() { registerBeanDefinitionParser("plugin", new PluginXmlParser()); }
/** * Sets the URL of the principal cwf page for the plugin. * * @param url The URL of the principal cwf page. */ public void setUrl(String url) { this.url = url; if (clazz == null && url != null) { setClazz(ElementPlugin.class); } }
@Override public void onUnload() { super.onUnload(); unloadCount++; }
@Override public void onActivate() { super.onActivate(); activateCount++; }
/** * Returns the plugin definition associated with the specified class. * * @param clazz The class whose plugin definition is sought. * @return The associated plugin definition, or null if not found. */ public static PluginDefinition getDefinition(Class<? extends ElementBase> clazz) { return PluginRegistry.getInstance().get(clazz); }
/** * Parses a plugin definition from an xml string. * * @param xml XML containing plugin definition. * @return A plugin definition instance. * @throws Exception Unspecified exception. */ public static PluginDefinition fromXml(String xml) throws Exception { return (PluginDefinition) new PluginXmlParser().fromXml(xml, "plugin"); }
/** * Lookup a plugin definition by its id. Raises a runtime exception if the plugin is not found. * * @param id Plugin id. * @return The plugin definition. */ private PluginDefinition pluginById(String id) { PluginDefinition def = pluginRegistry.get(id); if (def == null) { throw new PluginException(EXC_UNKNOWN_PLUGIN, null, null, id); } return def; }
/** * Call to update the disabled status for the bean. If the status has changed, all subscribing * containers will be notified. */ protected void updateDisabled() { initialized = true; setDisabled(checkDisabled()); }
/** * Unregisters a listener for the IPluginEvent callback event. * * @param listener Listener to be unregistered. */ public void unregisterListener(IPluginEventListener listener) { if (pluginEventListeners2 != null && pluginEventListeners2.contains(listener)) { pluginEventListeners2.remove(listener); listener.onPluginEvent(new PluginEvent(this, PluginAction.UNSUBSCRIBE)); } }
/** * Returns version information about the plugin. * * @return Version info. */ public String getVersion() { return getValueWithDefault(version, "Implementation-Version"); }
@Override protected Class<? extends ElementBase> getKey(PluginDefinition item) { return item.getClazz(); } };
/** * Initialize disabled flag. */ private void init() { if (!initialized) { initialized = true; disabled = checkDisabled(); } }
@Override public void onUnload() { abortBackgroundThreads(); }
@Override public void onInactivate() { super.onInactivate(); inactivateCount++; }
@Override public void onLoad(PluginContainer container) { super.onLoad(container); container.registerProperties(this, "format", "color"); }
/** * Returns the plugin definition associated with the specified xml tag (same as plugin id). * * @param tag XML tag (plugin id). * @return The associated plugin definition, or null if not found. */ public static PluginDefinition getDefinition(String tag) { return PluginRegistry.getInstance().get(tag); }
/** * Returns the source of the plugin. * * @return The plugin source. */ public String getSource() { return getValueWithDefault(source, "Implementation-Vendor"); }
/** * Register published properties. */ @Override public void onLoad(PluginContainer container) { super.onLoad(container); container.registerProperties(this, "mockupType", "mockupId"); }
@Override public void onLoad(PluginContainer container) { super.onLoad(container); container.registerProperties(this, "showUser"); }