Issue Details (XML | Word | Printable)

Key: WODEN-163
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: John Kaputin
Reporter: Peter Danielsen
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Woden

Provide a mechanism for registering extensions and their error message formats independently of the API.

Created: 10/May/07 12:57 PM   Updated: 20/Nov/07 02:40 PM
Return to search
Component/s: Parser
Affects Version/s: None
Fix Version/s: M8

Time Tracking:
Not Specified

File Attachments:
  Size
Java Archive File Licensed for inclusion in ASF works woden-extensions-example.jar 2007-05-10 12:59 PM Peter Danielsen 22 kB

Resolution Date: 20/Nov/07 02:40 PM


 Description  « Hide
Woden currently provides a means of registering extensions through methods of the ExtensionRegistry. An ExtensionRegistry is a member of a WSDLReader produced by a WSDLFactory. The current means of registering error message formats is to add them to the core Woden resource bundle in
org.apache.woden.internal.Messages.

As Woden is currently used in Axis2 codegen, it is not possible to access the WSDLReader and its ExtensionRegistry to register extensions before parsing begins. The way around this is to subclass WSDLFactory, register the extensions in the subclass, and set the "org.apache.woden.WSDLFactory" property to tell Woden to use the subclass. This works, but if multiple sets of independently-developed extensions (not part of the Woden distribution) need to be registered, a user will need to create a "composite" subclass that will register their extensions and those developed by others.

Woden needs a mechanism to allow the modularization of the registration of extensions and their error message formats. It should allow the registration of multiple sets of independently-developed extensions without requiring users to write code to perform the registration.

One Proposal

There are likely to be several implementation alternatives. Here's one.

Create a new interface, org.apache.woden.wsdl20.extensions.ExtensionRegistrar, with a single method:
   void registerExtensions(ExtensionRegistry registry)
Each set of extensions provides a class that implements this interface. The implementation registers all extensions belonging to its set. A new property, org.apache.woden.extensionregistrars, contains a list of ExtensionRegistrar classes whose "registerExtensions" methods are called by org.apache.woden.WSDLFactory's constructor after the standard PopulatedExtensionRegistry has been created. Using the property achieves the effect of the composite sub-class without having to write it.

A simple means of registering error message formats would be to modify org.apache.woden.internal.MessageFormatter to allow the registration of additional resource bundles. MessageFormatter's "formatMessage" method would look for the format key in each of the registered bundles. An ExtensionRegistrar would be responsible for registering the resource bundle for its extension set.

The net result of this implementation proposal is that a set of extensions could be packaged in a jar file containing:
- the extension set's classes
- the extension set's error message format resource bundle.
- the ExtensionRegistrar implementation




 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
No work has yet been logged on this issue.