org.apache.jackrabbit.decorator
Interface DecoratorFactory

All Known Implementing Classes:
ChainedDecoratorFactory, SimpleDecoratorFactory

public interface DecoratorFactory

Factory interface for creating decorator instances. The decorator classes create new decorator instances using a factory to make it easier to customize the behaviour of a decorator layer.


Method Summary
 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.
 

Method Detail

getRepositoryDecorator

public Repository getRepositoryDecorator(Repository repository)
Creates a repository decorator.

Parameters:
repository - the underlying repository instance
Returns:
decorator for the given repository

getSessionDecorator

public Session getSessionDecorator(Repository repository,
                                   Session session)
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);
 

Parameters:
repository - the repository (decorator) instance used to create the session decorator
session - the underlying session instance
Returns:
decorator for the given session

getWorkspaceDecorator

public Workspace getWorkspaceDecorator(Session session,
                                       Workspace workspace)
Creates a workspace decorator.

Parameters:
session - the session (decorator) instance used to create the workspace decorator
workspace - the underlying workspace instance
Returns:
workspace decorator

getNodeDecorator

public Node getNodeDecorator(Session session,
                             Node node)
Creates a node decorator.

Parameters:
session - the session (decorator) instance used to create the node decorator
node - the underlying node instance
Returns:
node decorator

getPropertyDecorator

public Property getPropertyDecorator(Session session,
                                     Property property)
Creates a property decorator.

Parameters:
session - the session (decorator) instance used to create the property decorator
property - the underlying property instance
Returns:
property decorator

getItemDecorator

public Item getItemDecorator(Session session,
                             Item item)
Creates an item decorator.

Parameters:
session - the session (decorator) instance used to create the item decorator
item - the underlying item instance
Returns:
item decorator

getLockDecorator

public Lock getLockDecorator(Node node,
                             Lock lock)
Creates a lock decorator.

Parameters:
node - the node (decorator) instance to which the lock is bound
lock - the underlying lock instance
Returns:
lock decorator


Copyright © 2004-2005 . All Rights Reserved.