During a discussion today, we (Sanjiva, Asanka, Srinath & I) thought that it
will be a good idea to use XPath-like syntax for selecting how to subscribe
to Registry resource paths. We could support only some simple scenarios, and
not the entire XPath syntax. Let me explain with an example.

The RegistrySynchronizer needs to be notified when deployable artifacts are
changed in the Registry. Let's say these artifacts are stored in
the _system/config/deployment/*server/* path. Shown below is how the
HelloService.aar is stored.

/_system/config/deployment/*server/service-groups/foo/bar/HelloService.aar*

These are the different way in which we can subscribe to different parts of
this hierarchy.

1. /_system/config/deployment/server
Selects *server* resource only [1]

2. /_system/config/deployment/server/descendant::*
Selects descendants of *server* only, does not select *server. *Selected
elements wil be server, service-groups, foo, bar, and HelloService.aar [1]

3. /_system/config/deployment/server/descendant-or-self::*
Selects *server* and descendants. Selected elements wil be server,
service-groups, foo, bar, and HelloService.aar [1]

So, this standard syntax allows us to simply select a node and its
descendants in different ways.

Thoughts welcome.


[1] XPath reference: http://zvon.org/comp/r/tut-XPath_1.html

-- 
*Afkham Azeez*
Senior Software Architect & Senior Manager; WSO2, Inc.; http://wso2.com,
*
*
*Member; Apache Software Foundation;
**http://www.apache.org/*<http://www.apache.org/>
*
email: **[email protected]* <[email protected]>* cell: +94 77 3320919
blog: **http://blog.afkham.org* <http://blog.afkham.org>*
twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
*
linked-in: **http://lk.linkedin.com/in/afkhamazeez*
*
*
*Lean . Enterprise . Middleware*
_______________________________________________
Carbon-dev mailing list
[email protected]
http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev

Reply via email to