-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Tim,

The way that we're doing it¹ is to have a custom
DescribeHandlerFactory with a static block that hooks it into the
registry you talked about.

As we're using Fuseki, the class is stuck on the class path and
referenced using a 'ja:loadClass
"com.example.CustomDescribeHandlerFactory"' in the assembly file.
Here's the example code:

> package com.example;
> 
> import com.hp.hpl.jena.sparql.core.describe.DescribeHandler; import
> com.hp.hpl.jena.sparql.core.describe.DescribeHandlerFactory; import
> com.hp.hpl.jena.sparql.core.describe.DescribeHandlerRegistry;
> 
> public class CustomDescribeHandlerFactory implements
> DescribeHandlerFactory { static { DescribeHandlerRegistry registry
> = DescribeHandlerRegistry.get(); registry.clear(); registry.add(new
> CustomDescribeHandlerFactory()); } public DescribeHandler create()
> { return new CustomDescribeHandler(); } }

CustomDescribeHandler implements DescribeHandler, and needs to declare
start, describe and finish methods.

If you're doing something a bit more bespoke than just using Fuseki,
you'd probably want to grab the contents of the static block and put
it in your initialization somewhere, and forget about adding stuff to
an assembly file.

Hope this helps,

Alex

¹ Kudos to Damian Steer for telling me how in the first place!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6GR+QACgkQS0pRIabRbjAVsgCeIt35w4QH7XXFvZemYo9WW/O1
XPYAn3hbqNVZmP6eRSQCxlruE1901/Ee
=nkAB
-----END PGP SIGNATURE-----

Reply via email to