For both Composer and EDG Studio, it is now necessary to create an instance of org.topbraid.core.PluginActivator that registers the SPARQL function in the activate() method. For example:
public class MyPluginActivator implements PluginActivator {
@Override
public void activate() {
}
}
This method will be called during system startup. Any other initialisation code may be placed there as well. An optional deactivate() method for shutdown can also be provided.
Making this work in Composer 7.0 and 7.1:
The plugin activator, SPARQL function implementation, and any other supporting Java code and jar files need to be packaged in an Eclipse plugin. The plugin activator needs to be announced in the plugin.xml file using the org.topbraid.core.pluginActivators extension point, for example:
<plugin>
<extension point="org.topbraid.core.pluginActivators">
<activator class="org.example.MyPluginActivator"/>
</extension>
</plugin>
Note that these plugin activators are *not* OSGi/Eclipse bundle activators. They are our own homegrown mechanism for a similar purpose.
The Eclipse plugin needs to be placed in Composer's dropins folder. When Composer is running, the list of installed Eclipse plugins can be reviewed in the “About TopBraid Composer ME” window under “Installation Details” to verify that the plugin has been discovered.
Making this work in EDG Studio 7.1:
Plugin activator, SPARQL function implementation and any other supporting Java code need to be packaged in a normal jar file, and the plugin activator needs to be announced using Java's ServiceLoader mechanism. This means adding a file META-INF/services/org.topbraid.core.PluginActivator to the jar file, with its contents being the qualified class name of the plugin activator:
org.example.MyPluginActivator
The jar file should include one of the strings "edg", "topbraid" or "tq" in the name to mark it as an EDG extension. The jar file, along with any other required library jar files, needs to be placed in EDG Studio's lib directory.
If EDG Studio is launched with --verbose, all plugin activators are listed on the console during startup, so this is a way of verifying that it is being found. After startup, this information can also be viewed under Server Administration > Startup Sequence.
Making this work in production EDG 7.0 and 7.1 on Tomcat:
A jar file built for EDG Studio will work in production EDG. To deploy it, place it, along with any other required library jar files, in the WEB-INF/lib subdirectory within the directory where edg.war is unpacked, e.g., webapps/edg/WEB-INF/lib.
All found plugin activators are listed in the edg.log during startup. After startup, this information can also be viewed under Server Administration > Startup Sequence.
Hope this helps,
Richard