You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Bertrand Delacretaz (JIRA)" <ji...@apache.org> on 2010/07/16 14:54:49 UTC

[jira] Created: (SLING-1603) SlingServlet service

SlingServlet service
--------------------

                 Key: SLING-1603
                 URL: https://issues.apache.org/jira/browse/SLING-1603
             Project: Sling
          Issue Type: Improvement
          Components: Engine
    Affects Versions: Engine 2.0.6
            Reporter: Bertrand Delacretaz
            Assignee: Bertrand Delacretaz
            Priority: Minor


For SLING-550 I need to call the SlingMainServlet outside of the web container's request/response cycle.

I'll attach a patch that introduces a new SlingServlet interface that SlingMainServlet implements.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-1603) SlingServlet service

Posted by "Bertrand Delacretaz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1603?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12889156#action_12889156 ] 

Bertrand Delacretaz commented on SLING-1603:
--------------------------------------------

With this patch the background test servlet of revision 964790 works (start with http://localhost:8080/system/bgservlets/test?sling:bg=true and watch http://localhost:8080/system/console/bgservlets), but I had to do the following in the code that uses the SlingServlet service:


		// In a normal request the ResourceResolver is added to the request attributes
		// by the authentication service, need to do the same here as we can't reuse the
		// original one which is closed once main request is done
		final AuthenticationInfo aa = (AuthenticationInfo)request.getAttribute(AuthenticationInfo.class.getName());
		if(aa == null) {
			throw new IllegalArgumentException("Missing AuthenticationInfo attribute");
		}
		final ResourceResolver rr = rrf.getResourceResolver(aa);
		this.request.setAttribute(SlingAuthenticator.REQUEST_ATTRIBUTE_RESOLVER, rr);

As the SlingMainServlet needs the ResourceResolver as a request attribute.

Maybe we should add an AuthenticationInfo parameter to the SlingServlet.processRequest method, to make this more explicit?

> SlingServlet service
> --------------------
>
>                 Key: SLING-1603
>                 URL: https://issues.apache.org/jira/browse/SLING-1603
>             Project: Sling
>          Issue Type: Improvement
>          Components: Engine
>    Affects Versions: Engine 2.0.6
>            Reporter: Bertrand Delacretaz
>            Assignee: Bertrand Delacretaz
>            Priority: Minor
>         Attachments: SLING-1603.patch
>
>
> For SLING-550 I need to call the SlingMainServlet outside of the web container's request/response cycle.
> I'll attach a patch that introduces a new SlingServlet interface that SlingMainServlet implements.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-1603) SlingServlet service

Posted by "Bertrand Delacretaz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1603?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12889852#action_12889852 ] 

Bertrand Delacretaz commented on SLING-1603:
--------------------------------------------

I did think about leaving the SlingServlet interface in the engine bundle, and you're right that it's more "reversible" than putting it into Sling API:

What made me wonder is that all interfaces in the org.apache.sling.engine package are @deprecated - IIUC that's a coincidence, not a willingness to have the engine bundle export no interfaces.

I this case, I'll move the SlingServlet interface to org.apache.sling.engine, I agree with your point.

> SlingServlet service
> --------------------
>
>                 Key: SLING-1603
>                 URL: https://issues.apache.org/jira/browse/SLING-1603
>             Project: Sling
>          Issue Type: Improvement
>          Components: Engine
>    Affects Versions: Engine 2.0.6
>            Reporter: Bertrand Delacretaz
>            Assignee: Bertrand Delacretaz
>            Priority: Minor
>         Attachments: SLING-1603.patch
>
>
> For SLING-550 I need to call the SlingMainServlet outside of the web container's request/response cycle.
> I'll attach a patch that introduces a new SlingServlet interface that SlingMainServlet implements.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-1603) SlingServlet service

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1603?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12889521#action_12889521 ] 

Carsten Ziegeler commented on SLING-1603:
-----------------------------------------

I'm not sure what the best way is, but I think that adding the AuthenticationInfo as a third parameter makes sense. If it is missing, the SlingServlet should try to use the request (maybe the request is already authenticated and can be used). If both is missing, throw an exception

> SlingServlet service
> --------------------
>
>                 Key: SLING-1603
>                 URL: https://issues.apache.org/jira/browse/SLING-1603
>             Project: Sling
>          Issue Type: Improvement
>          Components: Engine
>    Affects Versions: Engine 2.0.6
>            Reporter: Bertrand Delacretaz
>            Assignee: Bertrand Delacretaz
>            Priority: Minor
>         Attachments: SLING-1603.patch
>
>
> For SLING-550 I need to call the SlingMainServlet outside of the web container's request/response cycle.
> I'll attach a patch that introduces a new SlingServlet interface that SlingMainServlet implements.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-1603) SlingServlet service

Posted by "Bertrand Delacretaz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1603?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12890701#action_12890701 ] 

Bertrand Delacretaz commented on SLING-1603:
--------------------------------------------

Branch created as discussed on dev list:
http://svn.apache.org/repos/asf/sling/branches/SLING-1603-engine
revision 966198 includes the above patch.

> SlingServlet service
> --------------------
>
>                 Key: SLING-1603
>                 URL: https://issues.apache.org/jira/browse/SLING-1603
>             Project: Sling
>          Issue Type: Improvement
>          Components: Engine
>    Affects Versions: Engine 2.0.6
>            Reporter: Bertrand Delacretaz
>            Assignee: Bertrand Delacretaz
>            Priority: Minor
>         Attachments: SLING-1603.patch, SLING-1603.patch
>
>
> For SLING-550 I need to call the SlingMainServlet outside of the web container's request/response cycle.
> I'll attach a patch that introduces a new SlingServlet interface that SlingMainServlet implements.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-1603) SlingServlet service

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1603?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12889847#action_12889847 ] 

Felix Meschberger commented on SLING-1603:
------------------------------------------

Comment to the patch (other comments on the dev list): I would not define the SlingServlet interface in the Sling API for now: besides the API spec being far from being complete I think it is an implementation detail of the Engine bundle and not a feature of the Sling proper.

> SlingServlet service
> --------------------
>
>                 Key: SLING-1603
>                 URL: https://issues.apache.org/jira/browse/SLING-1603
>             Project: Sling
>          Issue Type: Improvement
>          Components: Engine
>    Affects Versions: Engine 2.0.6
>            Reporter: Bertrand Delacretaz
>            Assignee: Bertrand Delacretaz
>            Priority: Minor
>         Attachments: SLING-1603.patch
>
>
> For SLING-550 I need to call the SlingMainServlet outside of the web container's request/response cycle.
> I'll attach a patch that introduces a new SlingServlet interface that SlingMainServlet implements.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-1603) SlingServlet service

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1603?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12906794#action_12906794 ] 

Felix Meschberger commented on SLING-1603:
------------------------------------------

Fixed missing service registration of the SlingResourceProcessor service (as well as some minor cleanup) in Rev. 993307.

> SlingServlet service
> --------------------
>
>                 Key: SLING-1603
>                 URL: https://issues.apache.org/jira/browse/SLING-1603
>             Project: Sling
>          Issue Type: Improvement
>          Components: Engine
>    Affects Versions: Engine 2.0.6
>            Reporter: Bertrand Delacretaz
>            Assignee: Felix Meschberger
>            Priority: Minor
>             Fix For: Engine 2.1.2
>
>         Attachments: SLING-1603-fmeschbe.patch, SLING-1603.patch, SLING-1603.patch
>
>
> For SLING-550 I need to call the SlingMainServlet outside of the web container's request/response cycle.
> I'll attach a patch that introduces a new SlingServlet interface that SlingMainServlet implements.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-1603) SlingServlet service

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1603?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12904976#action_12904976 ] 

Felix Meschberger commented on SLING-1603:
------------------------------------------

Thanks for the feedback.

@Celemens: I in fact considered the name RequestProcessor, But in the end I went for Engine because it is the main driver in the Sling "Engine" of the Sling "Engine" module. But then, I would also be fine with RequestProcessor.

@Bertrand: Probably right. Or, combined with Clemens' comment: SlingRequestProcessor.

Re: SLING-1213: The main refactoring of the filter handling is due to splitting tasks of the SlingMainServlet. As a consequence a disctinct patch for SLING-1213 based on the attached patch would just add more values to the FilterChainType enum and a fews ifs here and there. That's why I thouhgt it would be ok to mix. But if you think it is important I can split this up.


> SlingServlet service
> --------------------
>
>                 Key: SLING-1603
>                 URL: https://issues.apache.org/jira/browse/SLING-1603
>             Project: Sling
>          Issue Type: Improvement
>          Components: Engine
>    Affects Versions: Engine 2.0.6
>            Reporter: Bertrand Delacretaz
>            Assignee: Bertrand Delacretaz
>            Priority: Minor
>         Attachments: SLING-1603-fmeschbe.patch, SLING-1603.patch, SLING-1603.patch
>
>
> For SLING-550 I need to call the SlingMainServlet outside of the web container's request/response cycle.
> I'll attach a patch that introduces a new SlingServlet interface that SlingMainServlet implements.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-1603) SlingServlet service

Posted by "Clemens Wyss (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1603?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12904934#action_12904934 ] 

Clemens Wyss commented on SLING-1603:
-------------------------------------

I guess Engine is implemented with the strategy pattern in mind? Strategies for request processing? 
If so, I would call the interface "Engine" more appropriately "RequestProcessing", or "RequestProcessor" and hence EngineImpl would become "SlingRequestProcessing" or "SlingRequestProcessor". #processRequest could then become #process. 
As this is only a naming-issue it's not really that important... :-)

> SlingServlet service
> --------------------
>
>                 Key: SLING-1603
>                 URL: https://issues.apache.org/jira/browse/SLING-1603
>             Project: Sling
>          Issue Type: Improvement
>          Components: Engine
>    Affects Versions: Engine 2.0.6
>            Reporter: Bertrand Delacretaz
>            Assignee: Bertrand Delacretaz
>            Priority: Minor
>         Attachments: SLING-1603-fmeschbe.patch, SLING-1603.patch, SLING-1603.patch
>
>
> For SLING-550 I need to call the SlingMainServlet outside of the web container's request/response cycle.
> I'll attach a patch that introduces a new SlingServlet interface that SlingMainServlet implements.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-1603) SlingServlet service

Posted by "Bertrand Delacretaz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1603?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12904949#action_12904949 ] 

Bertrand Delacretaz commented on SLING-1603:
--------------------------------------------

Refactoring looks good to me (haven't looked at the code, just Felix's description).

Maybe "SlingEngine" would be a better, more specific name than just "Engine"? Not terribly important.

It would be better IMO to have a distinct patch for SLING-1213

> SlingServlet service
> --------------------
>
>                 Key: SLING-1603
>                 URL: https://issues.apache.org/jira/browse/SLING-1603
>             Project: Sling
>          Issue Type: Improvement
>          Components: Engine
>    Affects Versions: Engine 2.0.6
>            Reporter: Bertrand Delacretaz
>            Assignee: Bertrand Delacretaz
>            Priority: Minor
>         Attachments: SLING-1603-fmeschbe.patch, SLING-1603.patch, SLING-1603.patch
>
>
> For SLING-550 I need to call the SlingMainServlet outside of the web container's request/response cycle.
> I'll attach a patch that introduces a new SlingServlet interface that SlingMainServlet implements.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SLING-1603) SlingServlet service

Posted by "Bertrand Delacretaz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-1603?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bertrand Delacretaz updated SLING-1603:
---------------------------------------

    Attachment: SLING-1603.patch

> SlingServlet service
> --------------------
>
>                 Key: SLING-1603
>                 URL: https://issues.apache.org/jira/browse/SLING-1603
>             Project: Sling
>          Issue Type: Improvement
>          Components: Engine
>    Affects Versions: Engine 2.0.6
>            Reporter: Bertrand Delacretaz
>            Assignee: Bertrand Delacretaz
>            Priority: Minor
>         Attachments: SLING-1603.patch
>
>
> For SLING-550 I need to call the SlingMainServlet outside of the web container's request/response cycle.
> I'll attach a patch that introduces a new SlingServlet interface that SlingMainServlet implements.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SLING-1603) SlingServlet service

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-1603?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger updated SLING-1603:
-------------------------------------

    Fix Version/s: Engine 2.1.2

> SlingServlet service
> --------------------
>
>                 Key: SLING-1603
>                 URL: https://issues.apache.org/jira/browse/SLING-1603
>             Project: Sling
>          Issue Type: Improvement
>          Components: Engine
>    Affects Versions: Engine 2.0.6
>            Reporter: Bertrand Delacretaz
>            Assignee: Felix Meschberger
>            Priority: Minor
>             Fix For: Engine 2.1.2
>
>         Attachments: SLING-1603-fmeschbe.patch, SLING-1603.patch, SLING-1603.patch
>
>
> For SLING-550 I need to call the SlingMainServlet outside of the web container's request/response cycle.
> I'll attach a patch that introduces a new SlingServlet interface that SlingMainServlet implements.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-1603) SlingServlet service

Posted by "Bertrand Delacretaz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1603?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12904978#action_12904978 ] 

Bertrand Delacretaz commented on SLING-1603:
--------------------------------------------

I like SlingRequestProcessor, it's very clear.

No strong opinions on the SLING-1213 thing, I trust you to do it right.

> SlingServlet service
> --------------------
>
>                 Key: SLING-1603
>                 URL: https://issues.apache.org/jira/browse/SLING-1603
>             Project: Sling
>          Issue Type: Improvement
>          Components: Engine
>    Affects Versions: Engine 2.0.6
>            Reporter: Bertrand Delacretaz
>            Assignee: Bertrand Delacretaz
>            Priority: Minor
>         Attachments: SLING-1603-fmeschbe.patch, SLING-1603.patch, SLING-1603.patch
>
>
> For SLING-550 I need to call the SlingMainServlet outside of the web container's request/response cycle.
> I'll attach a patch that introduces a new SlingServlet interface that SlingMainServlet implements.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SLING-1603) SlingServlet service

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-1603?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger updated SLING-1603:
-------------------------------------

    Attachment: SLING-1603-fmeschbe.patch

Untested prototype implementation for this enhancement:

  * Add a new Engine service interface (instead of SlingServlet)
  * Split the SlingMainServlet into 5 classes
       - SlingMainServlet is still the main servlet and registered as a DS component and controls the other classes
       - EngineImpl implements the Engine interface and contains the request processing machinery
       - SlingHttpContext is the OSGi HttpContext implementation used to register the SlingMainServlet with the HttpService
       - DefaultErrorHandler default implementation of the ErrorHandler interface if no other ErrorHandler is registered
  * Adapt all classes interacting with the former SlingMainServlet
  * Add support for the new filter scopes as proposed by SLING-1213 (though slightly different, to be discussed/fixed/changed).

> SlingServlet service
> --------------------
>
>                 Key: SLING-1603
>                 URL: https://issues.apache.org/jira/browse/SLING-1603
>             Project: Sling
>          Issue Type: Improvement
>          Components: Engine
>    Affects Versions: Engine 2.0.6
>            Reporter: Bertrand Delacretaz
>            Assignee: Bertrand Delacretaz
>            Priority: Minor
>         Attachments: SLING-1603-fmeschbe.patch, SLING-1603.patch, SLING-1603.patch
>
>
> For SLING-550 I need to call the SlingMainServlet outside of the web container's request/response cycle.
> I'll attach a patch that introduces a new SlingServlet interface that SlingMainServlet implements.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (SLING-1603) SlingServlet service

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-1603?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger reassigned SLING-1603:
----------------------------------------

    Assignee: Felix Meschberger  (was: Bertrand Delacretaz)

> SlingServlet service
> --------------------
>
>                 Key: SLING-1603
>                 URL: https://issues.apache.org/jira/browse/SLING-1603
>             Project: Sling
>          Issue Type: Improvement
>          Components: Engine
>    Affects Versions: Engine 2.0.6
>            Reporter: Bertrand Delacretaz
>            Assignee: Felix Meschberger
>            Priority: Minor
>         Attachments: SLING-1603-fmeschbe.patch, SLING-1603.patch, SLING-1603.patch
>
>
> For SLING-550 I need to call the SlingMainServlet outside of the web container's request/response cycle.
> I'll attach a patch that introduces a new SlingServlet interface that SlingMainServlet implements.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (SLING-1603) SlingServlet service

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-1603?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger resolved SLING-1603.
--------------------------------------

    Resolution: Fixed

Applied a modified version of the patch in Rev. 993280.

The main change is the rename of the interface Engine to SlingRequestProcessor as proposed.

Other modifications are related to fixes of bugs contained in the original patch.

> SlingServlet service
> --------------------
>
>                 Key: SLING-1603
>                 URL: https://issues.apache.org/jira/browse/SLING-1603
>             Project: Sling
>          Issue Type: Improvement
>          Components: Engine
>    Affects Versions: Engine 2.0.6
>            Reporter: Bertrand Delacretaz
>            Assignee: Felix Meschberger
>            Priority: Minor
>             Fix For: Engine 2.1.2
>
>         Attachments: SLING-1603-fmeschbe.patch, SLING-1603.patch, SLING-1603.patch
>
>
> For SLING-550 I need to call the SlingMainServlet outside of the web container's request/response cycle.
> I'll attach a patch that introduces a new SlingServlet interface that SlingMainServlet implements.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SLING-1603) SlingServlet service

Posted by "Bertrand Delacretaz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-1603?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bertrand Delacretaz updated SLING-1603:
---------------------------------------

    Attachment: SLING-1603.patch

Update patch, SlingServlet interface is now in the engine bundle with the following processRequest signature:

    void processRequest(HttpServletRequest request,
            HttpServletResponse resource, ResourceResolver resourceResolver)
            throws IOException;


> SlingServlet service
> --------------------
>
>                 Key: SLING-1603
>                 URL: https://issues.apache.org/jira/browse/SLING-1603
>             Project: Sling
>          Issue Type: Improvement
>          Components: Engine
>    Affects Versions: Engine 2.0.6
>            Reporter: Bertrand Delacretaz
>            Assignee: Bertrand Delacretaz
>            Priority: Minor
>         Attachments: SLING-1603.patch, SLING-1603.patch
>
>
> For SLING-550 I need to call the SlingMainServlet outside of the web container's request/response cycle.
> I'll attach a patch that introduces a new SlingServlet interface that SlingMainServlet implements.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.