Re: FYI, playing with Sling, GraalVM and native images

2019-07-03 Thread Paul Bjorkstrand
you can get native-image to work properly. That effort, while probably huge, may be easier than getting Felix to work with native-image. Paul Bjorkstrand On Wed, Jul 3, 2019 at 6:08 AM Robert Munteanu wrote: > On Wed, 2019-07-03 at 13:00 +0200, Bertrand Delacretaz wrote: > &g

Re: [DISCUSS] Automatic Mapping of URIs in HTL

2020-09-11 Thread Paul Bjorkstrand
I like your idea of hooking into the existing URI context processing, especially because you would want to have the mapping occur after URL manipulation (I think). My thoughts based on what has been said above: 1. Hook into the existing URI context, and implement the processing wherever URIs are

Re: [models] declaring constants for injectors

2020-09-01 Thread Paul Bjorkstrand
If the goal is to dissuade the use of the @Source, it might be worthwhile to deprecate the annotation, and come up with a new one that is only allowed on ElementType.ANNOTATION_TYPE. The deprecation, along with the mentioned documentation changes, would signal that @Source should not be used, and

Re: [DISCUSS] New Content API/Modules

2020-08-13 Thread Paul Bjorkstrand
Glad to see that :-) I am a big fan of the promise-like feel of CompletableFuture (at least until Project Loom [1] is complete). -Paul [1]: https://openjdk.java.net/projects/loom/ On Tue, Aug 11, 2020 at 1:35 PM Oliver Lietz wrote: > On Tuesday, August 11, 2020 6:42:32 PM CEST Paul Bjorkstr

Re: [DISCUSS] New Content API/Modules

2020-08-11 Thread Paul Bjorkstrand
If I may suggest, use CompletableFuture instead of Future. IMO it is a more natural API, and helps to steer people away from using the blocking method Future.get(). It's hard enough to ensure features are developed properly for a multithreaded application without adding in thread-blocking "async"

Re: Cache objects retrieved/derived from a ResourceResolver

2021-10-17 Thread Paul Bjorkstrand
As far as I understand, thread locals' storage is an implementation detail in the JVM. There isn't an API to clear all/arbitrary thread locals. Thread pools, or applications that use thread pools, need to provide hooks to do that, so that code can do its own cleanup. This is exactly what the

Re: Cache objects retrieved/derived from a ResourceResolver

2021-10-18 Thread Paul Bjorkstrand
:26 -0500, Paul Bjorkstrand wrote: > > As far as I understand, thread locals' storage is an implementation > > detail > > in the JVM. There isn't an API to clear all/arbitrary thread locals. > > Thread > > pools, or applications that use thread pools, need to provide

Re: Cache objects retrieved/derived from a ResourceResolver

2021-10-16 Thread Paul Bjorkstrand
On Sat, Oct 16, 2021 at 9:42 AM Jörg Hoh wrote: > Hi Carsten, > > Am Sa., 16. Okt. 2021 um 09:41 Uhr schrieb Carsten Ziegeler < > cziege...@apache.org>: > > > I don't think that the RR is the right place for this. > > > > If the use case is that during a request the exact same query is > >

Re: Discuss removing synchronized blocks from injection points within sling-models-impl

2021-12-06 Thread Paul Bjorkstrand
t; On Sat, 2021-12-04 at 21:38 -0600, Paul Bjorkstrand wrote: > > I added in using MethodHandles in the tests, just to show the > > difference. > > When Sling stops supporting Java 8, we can move to MethodHandle which > > has > > significantly better performance chara

Re: Discuss removing synchronized blocks from injection points within sling-models-impl

2021-12-06 Thread Paul Bjorkstrand
we can start with the simple code by removing synchronized and > reset. > Using MethodHandle should be treated separately (in a dedicated ticket and > PR). > > Konrad > > > On 6. Dec 2021, at 16:03, Paul Bjorkstrand > wrote: > > > > It may be possible to

Discuss removing synchronized blocks from injection points within sling-models-impl

2021-12-04 Thread Paul Bjorkstrand
In light of discussion on a recently merged PR [1], I raised the question 'do we need to "reset" the accessible flag for reflective injectables (fields, methods, constructors)?' The sole purpose of synchronized around the injection logic (including constructor instantiation) seems to surround

Re: Discuss removing synchronized blocks from injection points within sling-models-impl

2021-12-04 Thread Paul Bjorkstrand
va 9, so that we can use MethodHandles.privateLookupIn(..) [2]. Regardless, you can see the significant difference between synchronized vs non-synchronized: synchronizing is 3-8x slower than not, when under contention with multiple threads. [1]: https://gist.github.com/paul-bjorkst

Introducing Lombok to Sling?

2021-12-23 Thread Paul Bjorkstrand
I am not a huge fan of boilerplate code, and getters/setters are my biggest pet peeve. I searched the dev archives and found nothing that referenced Lombok. Is there a reason it has not yet been introduced that I am not aware of? If not, what is everyone's opinion around using Lombok within Sling?

Re: Introducing Lombok to Sling?

2022-01-03 Thread Paul Bjorkstrand
the corporate world works. Thanks for your inputs! -Paul On Mon, Jan 3, 2022 at 5:24 AM Stefan Seifert wrote: > i would also favor to *not* add Lombok to any sling modules. > > stefan > > >-----Original Message- > >From: Paul Bjorkstrand > >Sen

Re: Question about org.apache.sling.models.spi.DisposalCallbackRegistry & related

2023-07-26 Thread Paul Bjorkstrand
ps://sling.apache.org/apidocs/sling12/org/apache/sling/api/request/builder/SlingHttpServletRequestBuilder.html > > > > On Wed, 19 Jul 2023 at 22:11, Paul Bjorkstrand > > wrote: > >> > >> I'm looking into a potential refactor of the Sling Models Impl to make >

Re: Question about org.apache.sling.models.spi.DisposalCallbackRegistry & related

2023-07-28 Thread Paul Bjorkstrand
com/apache/sling-org-apache-sling-api/blob/master/src/main/java/org/apache/sling/api/resource/ResourceResolver.java#L883 > > Regards > Carsten > > On 27.07.2023 21:10, Paul Bjorkstrand wrote: > > If anything, I would question the use of the servlet request life cycle > a

Re: Question about org.apache.sling.models.spi.DisposalCallbackRegistry & related

2023-07-27 Thread Paul Bjorkstrand
hether this is still the same or not. But I think getting > >> the listener support into the Engine is not that complicated and it > >> avoids the queue. > >> > >> Regards > >> Carsten > >> > >> On 26.07.2023 21:17, Paul Bjorkstrand wrote: >

Re: Sling Model Exporter: Prevent serializing of a ResourceResolver

2023-06-27 Thread Paul Bjorkstrand
Could you do something like [1] and [2] and just write out JSON null or some other value that makes sense? That would avoid trying to serialize the ResourceResolver (and potentially Resource as well), at the expense of a remaining null. There also may be other features of the StdSerializer [3]

Re: Sling Model Caching & GC problems

2024-01-23 Thread Paul Bjorkstrand
Hi Jörg, My guess is that you are running up against the problem where the Model is referencing its adaptable, directly or indirectly. In that situation, the model would not be collectable because it is referenced more strongly than by weak reference. The reference path of these might look like

Re: Sling Model Caching & GC problems

2024-03-30 Thread Paul Bjorkstrand
resolvers as the cache would never be released. However, I guess thats > >> not worse than what we have today. And long running resource resolvers > >> are an anti-pattern anyway. > >> > >> Regards > >> Carsten > >> > >> On 23

Re: Sling Model Caching & GC problems

2024-03-30 Thread Paul Bjorkstrand
Oops, in that last line I meant to say "then the original caching behavior is preserved." instead of "then the original caching implementation is preserved." // Paul On Sat, Mar 30, 2024 at 4:35 PM Paul Bjorkstrand wrote: > I didn't see any (public) activity on th

Re: [Vote] Release Apache Sling Engine 2.15.12

2024-04-18 Thread Paul Bjorkstrand
-1 (non-binding) I have a concern with one change that was merged recently. I added a comment, but it was already merged by the time I read through it. I think a recent log addition [1] is incorrect. I think this logging addition will not log what is desired. [1]:

[jira] [Created] (SLING-7549) tag is not being treated as "self closing" when used in conjunction with HTL block statements

2018-03-19 Thread Paul Bjorkstrand (JIRA)
Paul Bjorkstrand created SLING-7549: --- Summary: tag is not being treated as "self closing" when used in conjunction with HTL block statements Key: SLING-7549 URL: https://issues.apache.org/jira/br

[jira] [Created] (SLING-8069) Sling Models: Enable constructor injection to use non-public constructors

2018-11-02 Thread Paul Bjorkstrand (JIRA)
Paul Bjorkstrand created SLING-8069: --- Summary: Sling Models: Enable constructor injection to use non-public constructors Key: SLING-8069 URL: https://issues.apache.org/jira/browse/SLING-8069

[jira] [Commented] (SLING-8069) Sling Models: Enable constructor injection to use non-public constructors

2018-11-02 Thread Paul Bjorkstrand (JIRA)
[ https://issues.apache.org/jira/browse/SLING-8069?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16673606#comment-16673606 ] Paul Bjorkstrand commented on SLING-8069: - Added Github PR link since it didn't link

[jira] [Commented] (SLING-8425) NPE in SlingScriptEngineManager when Sling is run on GraalVM

2019-05-22 Thread Paul Bjorkstrand (JIRA)
[ https://issues.apache.org/jira/browse/SLING-8425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16846018#comment-16846018 ] Paul Bjorkstrand commented on SLING-8425: - Thanks for the assist [~radu.cotescu]. I can confirm

[jira] [Commented] (SLING-8425) NPE in SlingScriptEngineManager when Sling is run on GraalVM

2019-05-20 Thread Paul Bjorkstrand (JIRA)
[ https://issues.apache.org/jira/browse/SLING-8425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16844221#comment-16844221 ] Paul Bjorkstrand commented on SLING-8425: - I found it equally weird. I opened  [https

[jira] [Commented] (SLING-8425) NPE in SlingScriptEngineManager when Sling is run on GraalVM

2019-05-20 Thread Paul Bjorkstrand (JIRA)
[ https://issues.apache.org/jira/browse/SLING-8425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16844047#comment-16844047 ] Paul Bjorkstrand commented on SLING-8425: - I have a proposed fix in the works, and will submit

[jira] [Created] (SLING-8425) NPE in SlingScriptEngineManager when Sling is run on GraalVM

2019-05-20 Thread Paul Bjorkstrand (JIRA)
Paul Bjorkstrand created SLING-8425: --- Summary: NPE in SlingScriptEngineManager when Sling is run on GraalVM Key: SLING-8425 URL: https://issues.apache.org/jira/browse/SLING-8425 Project: Sling

[jira] [Created] (SLING-9314) HTL null pointer in ObjectModel.toBoolean(Object) when object.toString() returns null

2020-03-31 Thread Paul Bjorkstrand (Jira)
Paul Bjorkstrand created SLING-9314: --- Summary: HTL null pointer in ObjectModel.toBoolean(Object) when object.toString() returns null Key: SLING-9314 URL: https://issues.apache.org/jira/browse/SLING-9314

[jira] [Created] (SLING-9715) Sling models JavaUseProvider does not properly handle the adaptable argument for Sling Model classes

2020-08-31 Thread Paul Bjorkstrand (Jira)
Paul Bjorkstrand created SLING-9715: --- Summary: Sling models JavaUseProvider does not properly handle the adaptable argument for Sling Model classes Key: SLING-9715 URL: https://issues.apache.org/jira/browse

[jira] [Comment Edited] (SLING-9829) data-sly-element should correctly handle void elements

2020-10-15 Thread Paul Bjorkstrand (Jira)
[ https://issues.apache.org/jira/browse/SLING-9829?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17214717#comment-17214717 ] Paul Bjorkstrand edited comment on SLING-9829 at 10/15/20, 2:00 PM

[jira] [Commented] (SLING-9829) data-sly-element should correctly handle void elements

2020-10-15 Thread Paul Bjorkstrand (Jira)
[ https://issues.apache.org/jira/browse/SLING-9829?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17214717#comment-17214717 ] Paul Bjorkstrand commented on SLING-9829: - Though it would be bead form, I am curious how you

[jira] [Commented] (SLING-9314) HTL null pointer in ObjectModel.toBoolean(Object) when object.toString() returns null

2020-08-25 Thread Paul Bjorkstrand (Jira)
[ https://issues.apache.org/jira/browse/SLING-9314?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17184103#comment-17184103 ] Paul Bjorkstrand commented on SLING-9314: - That works too, [~radu]. This was mainly a "quic

[jira] [Comment Edited] (SLING-9314) NPE in ObjectModel.toBoolean(Object) when object.toString() returns null

2020-08-26 Thread Paul Bjorkstrand (Jira)
[ https://issues.apache.org/jira/browse/SLING-9314?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17185209#comment-17185209 ] Paul Bjorkstrand edited comment on SLING-9314 at 8/26/20, 2:56 PM

[jira] [Commented] (SLING-9314) NPE in ObjectModel.toBoolean(Object) when object.toString() returns null

2020-08-26 Thread Paul Bjorkstrand (Jira)
[ https://issues.apache.org/jira/browse/SLING-9314?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17185209#comment-17185209 ] Paul Bjorkstrand commented on SLING-9314: - [~radu], I add a comment (rather lengthy, sorry

[jira] [Commented] (SLING-8706) Injections for java.util.Optional<> should be automatic optional

2020-06-22 Thread Paul Bjorkstrand (Jira)
[ https://issues.apache.org/jira/browse/SLING-8706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17142358#comment-17142358 ] Paul Bjorkstrand commented on SLING-8706: - I agree with [~justinedelson] on the HTL side. Just

[jira] [Commented] (SLING-10011) Use javax.jcr.Item.getParent() when resolving parent JCR node in JcrResourceProvider#getParent

2020-12-22 Thread Paul Bjorkstrand (Jira)
[ https://issues.apache.org/jira/browse/SLING-10011?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17253778#comment-17253778 ] Paul Bjorkstrand commented on SLING-10011: -- I think the point that [~cziegeler] and [~jsedding

[jira] [Commented] (SLING-9829) data-sly-element should correctly handle void elements

2020-10-22 Thread Paul Bjorkstrand (Jira)
[ https://issues.apache.org/jira/browse/SLING-9829?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17219080#comment-17219080 ] Paul Bjorkstrand commented on SLING-9829: - Thanks for the explanation. Even if it were just

[jira] [Created] (SLING-9849) Add logging functionality to the compiler and runtime to support better error notification for the developer

2020-10-22 Thread Paul Bjorkstrand (Jira)
Paul Bjorkstrand created SLING-9849: --- Summary: Add logging functionality to the compiler and runtime to support better error notification for the developer Key: SLING-9849 URL: https://issues.apache.org/jira

[jira] [Commented] (SLING-10113) data-sly-resource throwing RecursionTooDeepException

2021-02-01 Thread Paul Bjorkstrand (Jira)
[ https://issues.apache.org/jira/browse/SLING-10113?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17276645#comment-17276645 ] Paul Bjorkstrand commented on SLING-10113: -- Does {{targetPagePath}} start with a slash

[jira] [Commented] (SLING-10150) Sling Resource Merger completely hides parent when whitelisting in combination with asterisk is used for sling:hideChildren

2021-02-19 Thread Paul Bjorkstrand (Jira)
[ https://issues.apache.org/jira/browse/SLING-10150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17287319#comment-17287319 ] Paul Bjorkstrand commented on SLING-10150: -- Just a question for [~Henry Kuijpers], have you

[jira] [Commented] (SLING-10969) Remove synchronized & rest of accessible flag during injection

2021-12-06 Thread Paul Bjorkstrand (Jira)
[ https://issues.apache.org/jira/browse/SLING-10969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17454090#comment-17454090 ] Paul Bjorkstrand commented on SLING-10969: -- [~sseifert], [~rombert], [~kwin] PR: https

[jira] [Created] (SLING-10969) Remove synchronized & rest of accessible flag during injection

2021-12-06 Thread Paul Bjorkstrand (Jira)
Paul Bjorkstrand created SLING-10969: Summary: Remove synchronized & rest of accessible flag during injection Key: SLING-10969 URL: https://issues.apache.org/jira/browse/SLING-10969 Pro

[jira] [Commented] (SLING-10946) slingsettings deprecated what should i now use?

2021-11-29 Thread Paul Bjorkstrand (Jira)
[ https://issues.apache.org/jira/browse/SLING-10946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17450780#comment-17450780 ] Paul Bjorkstrand commented on SLING-10946: -- [~paul@gmail.com], the [SlingSettingsService

[jira] [Commented] (SLING-10947) Sling Models Unit Tests do not compile with Java 11

2021-11-30 Thread Paul Bjorkstrand (Jira)
[ https://issues.apache.org/jira/browse/SLING-10947?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17451275#comment-17451275 ] Paul Bjorkstrand commented on SLING-10947: -- I had an inspiration, so this evening became

[jira] [Commented] (SLING-10947) Sling Models Unit Tests do not compile with Java 11

2021-11-30 Thread Paul Bjorkstrand (Jira)
[ https://issues.apache.org/jira/browse/SLING-10947?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17451277#comment-17451277 ] Paul Bjorkstrand commented on SLING-10947: -- I just noticed, this ticket is somewhat a duplicate

[jira] [Commented] (SLING-10947) Sling Models Unit Tests do not compile with Java 11

2021-11-30 Thread Paul Bjorkstrand (Jira)
[ https://issues.apache.org/jira/browse/SLING-10947?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17451242#comment-17451242 ] Paul Bjorkstrand commented on SLING-10947: -- Having been the one to write that test, I think we

[jira] [Commented] (SLING-8069) Sling Models: Enable constructor injection to use non-public constructors

2021-12-14 Thread Paul Bjorkstrand (Jira)
[ https://issues.apache.org/jira/browse/SLING-8069?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17459254#comment-17459254 ] Paul Bjorkstrand commented on SLING-8069: - Absolutely, [~kwin]. PR coming shortly for sling-site

[jira] [Created] (SLING-12279) Move Sling Model cache holder for Resource and ResourceResolver adaptables into the resource resolver property map

2024-03-30 Thread Paul Bjorkstrand (Jira)
Paul Bjorkstrand created SLING-12279: Summary: Move Sling Model cache holder for Resource and ResourceResolver adaptables into the resource resolver property map Key: SLING-12279 URL: https

[jira] [Commented] (SLING-12300) Provide a way to retrieve a JCR backed resource by its node identifier

2024-04-19 Thread Paul Bjorkstrand (Jira)
[ https://issues.apache.org/jira/browse/SLING-12300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17839116#comment-17839116 ] Paul Bjorkstrand commented on SLING-12300: -- I'm leaning towards [~joerghoh]'s opinion as well

[jira] [Commented] (SLING-12300) Provide a way to retrieve a JCR backed resource by its node identifier

2024-04-23 Thread Paul Bjorkstrand (Jira)
[ https://issues.apache.org/jira/browse/SLING-12300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17840127#comment-17840127 ] Paul Bjorkstrand commented on SLING-12300: -- That's a good analysis, [~radu], thanks for sharing

[jira] [Commented] (SLING-12300) Provide a way to retrieve a JCR backed resource by its node identifier

2024-04-21 Thread Paul Bjorkstrand (Jira)
[ https://issues.apache.org/jira/browse/SLING-12300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17839397#comment-17839397 ] Paul Bjorkstrand commented on SLING-12300: -- To clarify my position: I am not against having

[jira] [Commented] (SLING-12279) Move Sling Model cache holder for Resource and ResourceResolver adaptables into the resource resolver property map

2024-04-26 Thread Paul Bjorkstrand (Jira)
[ https://issues.apache.org/jira/browse/SLING-12279?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17841341#comment-17841341 ] Paul Bjorkstrand commented on SLING-12279: -- [~joerghoh], can you take a look at this and see

[jira] [Commented] (SLING-12300) Provide a way to retrieve a JCR backed resource by its node identifier

2024-04-21 Thread Paul Bjorkstrand (Jira)
[ https://issues.apache.org/jira/browse/SLING-12300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17839419#comment-17839419 ] Paul Bjorkstrand commented on SLING-12300: -- I apologize if I am perceived as trivializing; I am

[jira] [Commented] (SLING-12279) Move Sling Model cache holder for Resource and ResourceResolver adaptables into the resource resolver property map

2024-05-15 Thread Paul Bjorkstrand (Jira)
[ https://issues.apache.org/jira/browse/SLING-12279?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17846767#comment-17846767 ] Paul Bjorkstrand commented on SLING-12279: -- [~pakira], you are correct that this does not fix