org.springframework.ldap.transaction.compensating.manager
Class TransactionAwareContextSourceProxy

java.lang.Object
  extended by org.springframework.ldap.transaction.compensating.manager.TransactionAwareContextSourceProxy
All Implemented Interfaces:
ContextSource

public class TransactionAwareContextSourceProxy
extends java.lang.Object
implements ContextSource

A proxy for ContextSource to make sure that the returned DirContext objects are aware of the surrounding transactions. This makes sure that the DirContext is not closed during the transaction and that all modifying operations are recorded, keeping track of the corresponding rollback operations. All returned DirContext instances will be of the type TransactionAwareDirContextInvocationHandler.

Since:
1.2
Author:
Mattias Arthursson

Constructor Summary
TransactionAwareContextSourceProxy(ContextSource target)
          Constructor.
 
Method Summary
 javax.naming.directory.DirContext getReadOnlyContext()
          Gets a read-only DirContext.
 javax.naming.directory.DirContext getReadWriteContext()
          Gets a read-write DirContext.
 ContextSource getTarget()
          Get the target ContextSource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionAwareContextSourceProxy

public TransactionAwareContextSourceProxy(ContextSource target)
Constructor.

Parameters:
target - the target ContextSource.
Method Detail

getTarget

public ContextSource getTarget()
Get the target ContextSource.

Returns:
the target ContextSource.

getReadOnlyContext

public javax.naming.directory.DirContext getReadOnlyContext()
                                                     throws NamingException
Description copied from interface: ContextSource
Gets a read-only DirContext. The returned DirContext must be possible to perform read-only operations on.

Specified by:
getReadOnlyContext in interface ContextSource
Returns:
A DirContext instance, never null.
Throws:
NamingException - if some error occurs creating an DirContext.

getReadWriteContext

public javax.naming.directory.DirContext getReadWriteContext()
                                                      throws NamingException
Description copied from interface: ContextSource
Gets a read-write DirContext.

Specified by:
getReadWriteContext in interface ContextSource
Returns:
A DirContext instance, never null.
Throws:
NamingException - if some error occurs creating an DirContext.


Copyright (c) 2005-2007. All Rights Reserved.