You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Costin Leau (JIRA)" <ji...@apache.org> on 2005/09/08 13:03:36 UTC

[jira] Created: (JCR-212) decorator enhancements

decorator enhancements
----------------------

         Key: JCR-212
         URL: http://issues.apache.org/jira/browse/JCR-212
     Project: Jackrabbit
        Type: Improvement
    Reporter: Costin Leau


added some decorating enhancements as we discussed on the mailing list (apparently there is nothing yet in the gmane /marc archives).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (JCR-212) decorator enhancements

Posted by "Costin Leau (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-212?page=all ]

Costin Leau updated JCR-212:
----------------------------

    Attachment: decorators.zip

I didn' made a patch against the subversion repository because the files are new. There is only one modificatin inside the RepositoryDecorator that's fairly simple.

> decorator enhancements
> ----------------------
>
>          Key: JCR-212
>          URL: http://issues.apache.org/jira/browse/JCR-212
>      Project: Jackrabbit
>         Type: Improvement
>     Reporter: Costin Leau
>  Attachments: decorators.zip
>
> added some decorating enhancements as we discussed on the mailing list (apparently there is nothing yet in the gmane /marc archives).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (JCR-212) decorator enhancements

Posted by "Costin Leau (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-212?page=comments#action_12322971 ] 

Costin Leau commented on JCR-212:
---------------------------------

FullChainedDecorator makes sense when you have more decorators.  A decorator contains a level of decorators (a repository decorator, a session, workspace and so on) and through the factory, the calls are made between components of the same level (same factory) - a repository login for example will return session decorator through it's factory.
When one uses multiple decorators factories (which most of the times are unaware of each others) you need a way to make sure the decorators before the current 'level' are executed (as the chain implementation only delegates to the factories which are after the current level).

Through FullChainedDecoratorFactory you have the topOfChain member (or utility methods) which can guarantee that the full chain will be used for the decoration of the new element returned.
Example:
Consider factory A which decorates the only some session methods (like getLockMethods) and factory B which decorates the repository and the session returned by login. If you are using the normal
chained factory the call to the repository is not decorated by factory A hits factory B, which decorated the login for example and return the decorated session from A but without the decorated session from A. By using the full chained factory, inside the decorated repository A on login method chainedFactory.getSessionDecorator can be removed with
topOfChain.getSessionDecorator - which will use all session decorators inside the chain (including A).
It's the difference between using the session decorators from this point on and apply all the decorators on this chain.

An alternative would be at level A to create a repository decorator which overrides login method to make sure it will apply the session decorator.

I implemented this factory because Session, Repository, Workspaces are related to each other but I wanted to create decorators only for the components I'm interested in not also in the ones that returned them (maybe I was/am confused by the 'calling' points to the JCR entities - (for example to a session can be obtain by Session.impersonate or by Repository.login).

> decorator enhancements
> ----------------------
>
>          Key: JCR-212
>          URL: http://issues.apache.org/jira/browse/JCR-212
>      Project: Jackrabbit
>         Type: Improvement
>     Reporter: Costin Leau
>     Assignee: Jukka Zitting
>  Attachments: decorators.zip
>
> added some decorating enhancements as we discussed on the mailing list (apparently there is nothing yet in the gmane /marc archives).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (JCR-212) decorator enhancements

Posted by "Costin Leau (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-212?page=all ]

Costin Leau updated JCR-212:
----------------------------

    Attachment: NoOpDecoratorFactory.java

Simple factory decorator which instead of delegating call the repository directly. This class is mainly an utility which helps in defining chains (should be placed at the end of the chain).

> decorator enhancements
> ----------------------
>
>          Key: JCR-212
>          URL: http://issues.apache.org/jira/browse/JCR-212
>      Project: Jackrabbit
>         Type: Improvement
>     Reporter: Costin Leau
>     Assignee: Jukka Zitting
>  Attachments: EventListenerDefinition.java, NoOpDecoratorFactory.java, decorators.zip
>
> added some decorating enhancements as we discussed on the mailing list (apparently there is nothing yet in the gmane /marc archives).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (JCR-212) decorator enhancements

Posted by "Costin Leau (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-212?page=all ]

Costin Leau updated JCR-212:
----------------------------

    Attachment: EventListenerDefinition.java

Container class which contains the params required for defining an event.

> decorator enhancements
> ----------------------
>
>          Key: JCR-212
>          URL: http://issues.apache.org/jira/browse/JCR-212
>      Project: Jackrabbit
>         Type: Improvement
>     Reporter: Costin Leau
>     Assignee: Jukka Zitting
>  Attachments: EventListenerDefinition.java, NoOpDecoratorFactory.java, decorators.zip
>
> added some decorating enhancements as we discussed on the mailing list (apparently there is nothing yet in the gmane /marc archives).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (JCR-212) decorator enhancements

Posted by "Costin Leau (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-212?page=comments#action_12322922 ] 

Costin Leau commented on JCR-212:
---------------------------------

Feel free also to change the package to which the classes belong - right now it's org.springmodules.jcr.jackrabbit.decorator but they don't belong to springmodules (I was planning to include them there at some point). Having these decorator packages inside the jackrabbit makes more sense however as they are build on the decorator classes inside the jackrabbit package.

> decorator enhancements
> ----------------------
>
>          Key: JCR-212
>          URL: http://issues.apache.org/jira/browse/JCR-212
>      Project: Jackrabbit
>         Type: Improvement
>     Reporter: Costin Leau
>  Attachments: decorators.zip
>
> added some decorating enhancements as we discussed on the mailing list (apparently there is nothing yet in the gmane /marc archives).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (JCR-212) decorator enhancements

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-212?page=comments#action_12323018 ] 

Jukka Zitting commented on JCR-212:
-----------------------------------

Yeah, sorry for the incomplete state... :-} I hope the recent commits and the above comment clarified the design goals.

> decorator enhancements
> ----------------------
>
>          Key: JCR-212
>          URL: http://issues.apache.org/jira/browse/JCR-212
>      Project: Jackrabbit
>         Type: Improvement
>     Reporter: Costin Leau
>     Assignee: Jukka Zitting
>  Attachments: EventListenerDefinition.java, NoOpDecoratorFactory.java, decorators.zip
>
> added some decorating enhancements as we discussed on the mailing list (apparently there is nothing yet in the gmane /marc archives).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (JCR-212) decorator enhancements

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-212?page=all ]
     
Jukka Zitting resolved JCR-212:
-------------------------------

    Resolution: Fixed

Closing this issue. Parts of the proposed changes were applied to JCR-EXT, while the other features are better implemented in client code. See the above discussion for details.

> decorator enhancements
> ----------------------
>
>          Key: JCR-212
>          URL: http://issues.apache.org/jira/browse/JCR-212
>      Project: Jackrabbit
>         Type: Improvement
>     Reporter: Costin Leau
>     Assignee: Jukka Zitting
>  Attachments: EventListenerDefinition.java, NoOpDecoratorFactory.java, decorators.zip
>
> added some decorating enhancements as we discussed on the mailing list (apparently there is nothing yet in the gmane /marc archives).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (JCR-212) decorator enhancements

Posted by "Costin Leau (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-212?page=comments#action_12323017 ] 

Costin Leau commented on JCR-212:
---------------------------------

I agree - this was one thing that was unclear to me (hence the FullChainedDecoratorFactory) that doesn't make sense on it's own. Anyways about SimpleDecoratorFactory - the way I got the file from the CVS it contained only null which doesn't make much sense (to me at least) - got the file on 31/08/2005.

> decorator enhancements
> ----------------------
>
>          Key: JCR-212
>          URL: http://issues.apache.org/jira/browse/JCR-212
>      Project: Jackrabbit
>         Type: Improvement
>     Reporter: Costin Leau
>     Assignee: Jukka Zitting
>  Attachments: EventListenerDefinition.java, NoOpDecoratorFactory.java, decorators.zip
>
> added some decorating enhancements as we discussed on the mailing list (apparently there is nothing yet in the gmane /marc archives).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Assigned: (JCR-212) decorator enhancements

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-212?page=all ]

Jukka Zitting reassigned JCR-212:
---------------------------------

    Assign To: Jukka Zitting

> decorator enhancements
> ----------------------
>
>          Key: JCR-212
>          URL: http://issues.apache.org/jira/browse/JCR-212
>      Project: Jackrabbit
>         Type: Improvement
>     Reporter: Costin Leau
>     Assignee: Jukka Zitting
>  Attachments: decorators.zip
>
> added some decorating enhancements as we discussed on the mailing list (apparently there is nothing yet in the gmane /marc archives).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (JCR-212) decorator enhancements

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-212?page=comments#action_12323013 ] 

Jukka Zitting commented on JCR-212:
-----------------------------------

Re: NoOpDecoratorFactory.java

There's a subtle reason for the DecoratorFactory interface and the functioning of some of the decorator methods. To decorate the entire JCR API you need to manage the various back-references between the decorated instances. For example the decorated Session.getRepository() method should return the *decorated* repository instance, not just the repository reference returned by the underlying session:

    Repository repository = decoratorFactory.getRepositoryDecorator(...);
    Session session = repository.login();
    assertTrue(repository == session.getRepository());

The DecoratorFactory implementation should make sure that all returned decorators honor this contract. The SimpleDecoratorFactory class binds the individiual decorator base classes together to implement the decorator layer for the entire JCR API. Thus the SimpleDecoratorFactory (or the ChainedDecoratorFactory) should always be used as a base class when adding custom decorator classes to the decorator layer.

Thus I see little use for the NoOpDecoratorFactory. Instead of doing NoOpDecoratorFactory.getRepositoryDecorator(repository) you could always just use the repository instance directly.


> decorator enhancements
> ----------------------
>
>          Key: JCR-212
>          URL: http://issues.apache.org/jira/browse/JCR-212
>      Project: Jackrabbit
>         Type: Improvement
>     Reporter: Costin Leau
>     Assignee: Jukka Zitting
>  Attachments: EventListenerDefinition.java, NoOpDecoratorFactory.java, decorators.zip
>
> added some decorating enhancements as we discussed on the mailing list (apparently there is nothing yet in the gmane /marc archives).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (JCR-212) decorator enhancements

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-212?page=comments#action_12322967 ] 

Jukka Zitting commented on JCR-212:
-----------------------------------

Thanks for the contribution! I've now committed the ChainedDecoratorFactory class and the RepositoryDecorator changes along with other pending JCR-EXT changes.

Comments about the other classes:

EventListenerDecoratorFactory - This might be better implemented as a RepositoryDecorator that overrides the login() method. The attached ZIP is also missing the referenced EventListenerDefinition class.

SessionListenerDecoratorFactory - As above, this might be better implemented as a RepositoryDecorator.

FullChainedDecoratorFactory - I don't see the use case for this class. Why/how would you use this?


> decorator enhancements
> ----------------------
>
>          Key: JCR-212
>          URL: http://issues.apache.org/jira/browse/JCR-212
>      Project: Jackrabbit
>         Type: Improvement
>     Reporter: Costin Leau
>     Assignee: Jukka Zitting
>  Attachments: decorators.zip
>
> added some decorating enhancements as we discussed on the mailing list (apparently there is nothing yet in the gmane /marc archives).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (JCR-212) decorator enhancements

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-212?page=all ]
     
Jukka Zitting closed JCR-212:
-----------------------------


> decorator enhancements
> ----------------------
>
>          Key: JCR-212
>          URL: http://issues.apache.org/jira/browse/JCR-212
>      Project: Jackrabbit
>         Type: Improvement
>     Reporter: Costin Leau
>     Assignee: Jukka Zitting
>  Attachments: EventListenerDefinition.java, NoOpDecoratorFactory.java, decorators.zip
>
> added some decorating enhancements as we discussed on the mailing list (apparently there is nothing yet in the gmane /marc archives).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira