org.apache.jackrabbit.decorator
Class SimpleDecoratorFactory

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

public class SimpleDecoratorFactory
extends Object
implements DecoratorFactory

TODO


Constructor Summary
SimpleDecoratorFactory()
           
 
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. 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);
 
 Workspace getWorkspaceDecorator(Session session, Workspace workspace)
          Creates a workspace decorator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleDecoratorFactory

public SimpleDecoratorFactory()
Method Detail

getRepositoryDecorator

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

Specified by:
getRepositoryDecorator in interface DecoratorFactory
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);
 

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

getWorkspaceDecorator

public Workspace getWorkspaceDecorator(Session session,
                                       Workspace workspace)
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

getNodeDecorator

public Node getNodeDecorator(Session session,
                             Node node)
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

getPropertyDecorator

public Property getPropertyDecorator(Session session,
                                     Property property)
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

getItemDecorator

public Item getItemDecorator(Session session,
                             Item item)
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

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


Copyright © 2004-2005 . All Rights Reserved.