Re: Scalabilty of EventListener

2013-10-26 Thread Justin Edelson
Hi,

On Fri, Oct 25, 2013 at 4:54 PM, Alexander Klimetschek
 wrote:
> On 24.10.2013, at 16:55, Justin Edelson  wrote:
>
>> Given that there's already an expression syntax defined in the
>> EventAdmin specification, wouldn't it make more sense for Oak to just
>> use OSGi Events? That's the only way I personally could forsee us
>> being in a position to deprecate/remote the JCR Observation/OSGi
>> EventAdmin bridge which we have in Sling today.
>
> I don't think Oak wants to be tied to OSGi, but the expression syntax could 
> maybe reused.

Better IMHO would be for Oak to use the event/messaging system
provided by the platform. In an OSGi environment, this would be
EventAdmin. In JavaEE, it would be JMS (for which message selectors
can be used for filtering).

>
>> FWIW, I'm not sure it's a straight comparison between the bridge we
>> have in Sling and the CQ Workflow engine. The CQ Workflow engine
>> *could* be implemented by registering specific OSGi event listeners
>> (one per launcher). It just isn't (or so your email implies :).
>
> Not really, because it has to make the decision on matching events *itself*. 
> Because of that, it is natural to only have one central listener (it quickly 
> forks off into separate jobs once a match for a certain entry has been found).

Why does the workflow engine have to make that decision itself? Can't
that decision be expressed declaratively? They are, after all, being
defined declaratively by the administrator, so it should just be a
matter of mapping the administrator's selections to a filter
expression and then letting the EventAdmin implementation handle the
filter. For example, you could have a workflow launcher expressed as a
listener with a filter of
"(&(resourceType=nt:file)(path=/content/dam/*/original))".

NOTE - I'm not necessarily saying that everything in CQ's workflow
engine is supported by Sling Resource events *today*; there might be a
need to add new event properties, but that's far from impossible.

My point is that it is in large part the lack of good filtering (which
is available in EventAdmin and JMS) is what leads to having multiple
dispatching systems in the same applicatio and that good filtering is
already available in Sling applications *because* of the
Observation/EventAdmin bridge.

Justin

>
> What I am asking for is that Oak provides those options (match on property 
> values etc.) directly and it can handled as early as possible, without Oak 
> having to call an event listener in the first place (and start a new thread 
> etc.) in case there is no match.
>
> Cheers,
> Alex
>


[jira] [Commented] (SLING-3206) Create an API to handle resource vanity paths

2013-10-26 Thread Gilles Knobloch (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13806073#comment-13806073
 ] 

Gilles Knobloch commented on SLING-3206:


I did not yet had a look at how vanity paths are evaluated (sorry), but in 
context of SLING-2986, I would need the vanity path to be set of the merged 
resource.

For instance, if you have {{sling:vanityPath}} = {{/mypath}} set on 
{{/libs/my/resource}}, the vanity path should actually go to 
{{/merge/my/resource}}. I could of course use request filters to redirect, but 
then the URL would change. I'd prefer if it's integrated in the vanity path 
evaluation.

> Create an API to handle resource vanity paths
> -
>
> Key: SLING-3206
> URL: https://issues.apache.org/jira/browse/SLING-3206
> Project: Sling
>  Issue Type: Improvement
>  Components: API
>Reporter: Carsten Ziegeler
>
> Right now vanity path handling is complicated, it would be nice to have a 
> central API which allows to set a vanity path for a resource and to query if 
> a vanity path for a resource is set.
> Maybe a method getting all vanity paths back could be added as well.
> The implementation would directly write into the mapping structure in the 
> resource tree. For the query part, it would mark its own entries to easily 
> identify them in contrast to entries created by other means



--
This message was sent by Atlassian JIRA
(v6.1#6144)