org.apache.jackrabbit.decorator
Class ChainedDecoratorFactory

java.lang.Object
  extended byorg.apache.jackrabbit.decorator.ChainedDecoratorFactory
All Implemented Interfaces:
DecoratorFactory

public class ChainedDecoratorFactory
extends Object
implements DecoratorFactory

Creates a chain of decorator factories. Decorated classes extend this class which provides basic functinality for changing, especially the #chainedFactory which will be set automatically by the DecoratedRepositoryFactoryBean.

Author:
Costin Leau

Field Summary
protected  DecoratorFactory chainedFactory
           
 
Constructor Summary
ChainedDecoratorFactory()
           
 
Method Summary
 DecoratorFactory getChainedFactory()
           
 Item getItemDecorator(Session session, Item item)
          Creates an item decorator.
 Lock getLockDecorator(Node node, Lock lock)
          Creates a lock decorator.
 Node getNodeDecorator(Session session, Node node)
          Creates a node decorator.
 Property getPropertyDecorator(Session session, Property property)
          Creates a property decorator.
 Repository getRepositoryDecorator(Repository repository)
          Creates a repository decorator.
 Session getSessionDecorator(Repository repository, Session session)
          Creates a session decorator.
 Workspace getWorkspaceDecorator(Session session, Workspace workspace)
          Creates a workspace decorator.
 void setChainedFactory(DecoratorFactory factory)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

chainedFactory

protected DecoratorFactory chainedFactory
Constructor Detail

ChainedDecoratorFactory

public ChainedDecoratorFactory()
Method Detail

getRepositoryDecorator

public Repository getRepositoryDecorator(Repository repository)
Description copied from interface: DecoratorFactory
Creates a repository decorator.

Specified by:
getRepositoryDecorator in interface DecoratorFactory
Parameters:
repository - the underlying repository instance
Returns:
decorator for the given repository
See Also:
DecoratorFactory.getRepositoryDecorator(javax.jcr.Repository)

getSessionDecorator

public Session getSessionDecorator(Repository repository,
                                   Session session)
Description copied from interface: DecoratorFactory
Creates a session decorator. The created session decorator will return the given repository (decorator) instance from the getRepository() method to avoid breaking the decorator layer.

The following example code illustrates how this method should be used to implement the repository login methods.

     DecoratorFactory factory = ...; // The decorator factory
     Session session = ...;          // The underlying session instance
     return factory.getSessionDecorator(this, session);
 

Specified by:
getSessionDecorator in interface DecoratorFactory
Parameters:
repository - the repository (decorator) instance used to create the session decorator
session - the underlying session instance
Returns:
decorator for the given session
See Also:
DecoratorFactory.getSessionDecorator(javax.jcr.Repository, javax.jcr.Session)

getItemDecorator

public Item getItemDecorator(Session session,
                             Item item)
Description copied from interface: DecoratorFactory
Creates an item decorator.

Specified by:
getItemDecorator in interface DecoratorFactory
Parameters:
session - the session (decorator) instance used to create the item decorator
item - the underlying item instance
Returns:
item decorator
See Also:
DecoratorFactory.getItemDecorator(javax.jcr.Session, javax.jcr.Item)

getNodeDecorator

public Node getNodeDecorator(Session session,
                             Node node)
Description copied from interface: DecoratorFactory
Creates a node decorator.

Specified by:
getNodeDecorator in interface DecoratorFactory
Parameters:
session - the session (decorator) instance used to create the node decorator
node - the underlying node instance
Returns:
node decorator
See Also:
DecoratorFactory.getNodeDecorator(javax.jcr.Session, javax.jcr.Node)

getPropertyDecorator

public Property getPropertyDecorator(Session session,
                                     Property property)
Description copied from interface: DecoratorFactory
Creates a property decorator.

Specified by:
getPropertyDecorator in interface DecoratorFactory
Parameters:
session - the session (decorator) instance used to create the property decorator
property - the underlying property instance
Returns:
property decorator
See Also:
DecoratorFactory.getPropertyDecorator(javax.jcr.Session, javax.jcr.Property)

getWorkspaceDecorator

public Workspace getWorkspaceDecorator(Session session,
                                       Workspace workspace)
Description copied from interface: DecoratorFactory
Creates a workspace decorator.

Specified by:
getWorkspaceDecorator in interface DecoratorFactory
Parameters:
session - the session (decorator) instance used to create the workspace decorator
workspace - the underlying workspace instance
Returns:
workspace decorator
See Also:
DecoratorFactory.getWorkspaceDecorator(javax.jcr.Session, javax.jcr.Workspace)

getLockDecorator

public Lock getLockDecorator(Node node,
                             Lock lock)
Description copied from interface: DecoratorFactory
Creates a lock decorator.

Specified by:
getLockDecorator in interface DecoratorFactory
Parameters:
node - the node (decorator) instance to which the lock is bound
lock - the underlying lock instance
Returns:
lock decorator
See Also:
DecoratorFactory.getLockDecorator(Node, Lock)

getChainedFactory

public DecoratorFactory getChainedFactory()
Returns:
Returns the factory.

setChainedFactory

public void setChainedFactory(DecoratorFactory factory)
Parameters:
factory - The factory to set.


Copyright © 2004-2005 . All Rights Reserved.