|Add New Resource Storage Mechanism [message #607533]
||Mon, 26 May 2008 19:46
| Martin Geisse
Registered: July 2009
I am currently writing a plug-in that adds a new mechanism for ecore
resource storage. Basically, I want to have EMF recognize a distinct
kind of URIs and redirect them to my plug-in. I do not require special
behaviour of the Resource instances, only custom input/output streams.
In fact, I want to re-use the behaviour of existing resource
implementations (and corresponding resource factories) such that they
impose "their" file format on the input/output streams that I provide.
To me it seems that the proper solution is a custom implementation of
either URIConverter or URIHandler.
However, I want the new kind of URI to be available for any entity that
resolves resources using URIs, without specific knowledge about my
plug-in. For instance, I want the example editors which are generated
from ecore models to be able to load resources using "my" URIs and point
ERereference variables to objects contained in them. This indicates that
my custom URI handling code must be registered globally in some way, but
I am unsure where the best place is for this.
I have found URIConverter.INSTANCE, but the documentation says that
"It's generally not a good idea to modify any aspect of this instance",
which rules it out for my purpose because adding a custom URI handler to
it is clearly modifying the instance.
I have found URIHandler.DEFAULT_HANDLER, but again the documentation
says that it is read-only.
I have found the "org.eclipse.emf.ecore.protocol_parser" extension
point, but this allows me to register a resource factory, not an URI
handler / converter, which is not what I want. Specifically, by using a
custom resource factory I would bypass the existing resource factories
that implement specific file formats for the various models, when in
reality I want to use those existing factories, only with custom code
for creating the raw data streams.
Can anyone point me to the right direction?
Thanks in advance,
Powered by FUDForum
. Page generated in 0.02361 seconds