You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by Eran Chinthaka <ch...@opensource.lk> on 2006/06/15 19:42:06 UTC

[Neethi] Proposal to add extensions support for Neethi

Hi,

Current Neethi implementation is such that, it builds the whole policy
model, even including domain specific policy assertions. But the current
implementation can be improved to register other domain specific
extensions, so that Neethi processor can hand over to the relevant
extensions for better processing.
For example, when Neethi is building the model, if its sees some ws
security policies, then it can hand over that part, as an OMElement, to
the security-neethi extension registered. Then its the security-neethi
extensions responsibility to interpret and build the model and to return
an instance of Assertion back.
This way the built tree is more useful than the generic one, but this
method, in any means will not harm the generic model as all the neethi
extensions should return an instance of Assertion to be plugged in to
Neethi model.

Here is how we can implement this.

public interface NeethiExtension {

    /**
     * Once the policy processor sees an element with unknown namespace,
it will try to map
     * it to an extension. This extension will be given the OMElement
and require to return
     * an Assertion after processing the given element in a domain
specific manner.
     * @param omElement - wrapping the domain specific element in the
policy hierarchy
     * @return an Assertion
     */
    public Assertion createAssertion(OMElement omElement);
}

public class ExtensionManager {

 public Assertion getAssertion(OMElement omElement) throws NeethiException {

 // code to get the correct policy extension from the namespace of the
given OMElement.
// then to call the createAssertion of that and return an Assertion
object, which can be plugged in Neethi model.
}

I already created a JIRA [1] on this and uploaded a patch.

Comments/Thoughts ?

Thanks,
Chinthaka


[1] : http://issues.apache.org/jira/browse/WSCOMMONS-42