Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.myfaces.orchestra.conversation.spring
Class PersistenceContextConversationInterceptor

    java.lang.Object
      org.apache.myfaces.orchestra.conversation.spring.PersistenceContextConversationInterceptor

All Implemented Interfaces:
  org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor

    public class PersistenceContextConversationInterceptor

extends java.lang.Object
implements org.aopalliance.intercept.MethodInterceptor

Maintain the appropriate persistence state for the current call-stack.

This class is a MethodInterceptor (an AOP Advice) which should be configured to intercept calls to all conversation-scoped beans. It ensures that the appropriate PersistenceContext object for this conversation is placed into the default location, by invoking the bind method on the persistence context object. Typically the bind method stores the persistence context into a thread-local variable, but that is implementation-specific.

When Spring code retrieves the persistence context in order to inject it into a bean, it then finds the correct context for the conversation that is associated with the nearest conversation-scoped bean in the callstack.

If no PersistenceContext yet exists for the conversation associated with the bean that is being invoked then one is created using `PersistenceContextFactory`.

A reference to the `PersistenceContext` is put into the conversation attribute map wrapped in an `PersistenceContextCloser` so that when the conversation ends a callback occurs on it which closes the underlying object.

Field Summary
`static java.lang.String` | `REQUEST_ATTRIBUTE`

Constructor Summary
`PersistenceContextConversationInterceptor()`

Method Summary
`java.lang.Object` | `invoke(org.aopalliance.intercept.MethodInvocation methodInvocation)`
`void` | `setPersistenceContextFactory(PersistenceContextFactory persistenceContextFactory)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### REQUEST_ATTRIBUTE

    public static final java.lang.String REQUEST_ATTRIBUTE

Constructor Detail

### PersistenceContextConversationInterceptor

    public PersistenceContextConversationInterceptor()

Method Detail

### setPersistenceContextFactory

    public void setPersistenceContextFactory(PersistenceContextFactory persistenceContextFactory)

### invoke

    public java.lang.Object invoke(org.aopalliance.intercept.MethodInvocation methodInvocation)
                            throws java.lang.Throwable

  Specified by:
    `invoke` in interface `org.aopalliance.intercept.MethodInterceptor`
  Throws:
    `java.lang.Throwable`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2009 The Apache Software Foundation. All Rights Reserved.