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
Class PersistentBackingBean

    java.lang.Object
      org.apache.myfaces.orchestra.conversation.PersistentBackingBean

All Implemented Interfaces:
  org.apache.myfaces.orchestra.conversation.ConversationBindingListener

    public class PersistentBackingBean

extends java.lang.Object
implements org.apache.myfaces.orchestra.conversation.ConversationBindingListener

A backing bean for a view (ie a "view controller") that has an associated persistence context.

In real applications, the PersistenceContext is more likely to be on a DAO bean referenced from the backing bean than directly on the backing bean class. However that doesn't change the principles.

Constructor Summary
`PersistentBackingBean()`

Method Summary
`UserData` | `createUser()` Create a UserData object and commit it to the database.
`UserData` | `getRestartedUser()`
`void` | `invalidateAndRestartConversation()` Invalidate the conversation in which this bean lives, and then create a new bean instance (in a new conversation) and copy some data from the old to the new instance.
`void` | `invalidateConversation()` Invalidate the conversation in which this bean lives.
`UserData` | `readUser(java.lang.Long id)`
`void` | `setRestartedUser(java.lang.Long id)`
`void` | `updateUser(java.lang.Long id, java.lang.String username)`
`void` | `valueBound(org.apache.myfaces.orchestra.conversation.ConversationBindingEvent event)`
`void` | `valueUnbound(org.apache.myfaces.orchestra.conversation.ConversationBindingEvent event)`

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

Constructor Detail

### PersistentBackingBean

    public PersistentBackingBean()

Method Detail

### valueBound

    public void valueBound(org.apache.myfaces.orchestra.conversation.ConversationBindingEvent event)

  Specified by:
    `valueBound` in interface `org.apache.myfaces.orchestra.conversation.ConversationBindingListener`

### valueUnbound

    public void valueUnbound(org.apache.myfaces.orchestra.conversation.ConversationBindingEvent event)

  Specified by:
    `valueUnbound` in interface `org.apache.myfaces.orchestra.conversation.ConversationBindingListener`

### getRestartedUser

    public UserData getRestartedUser()

### createUser

    @Transactional
    public UserData createUser()

  Create a UserData object and commit it to the database.

  Because this method is marked with the Transactional annotation, a commit will be performed when the method returns successfully (without exception), and a rollback will be performed when the method throws an exception.

### readUser

    public UserData readUser(java.lang.Long id)

### invalidateConversation

    public void invalidateConversation()

  Invalidate the conversation in which this bean lives.

  This means that the next attempt to dereference a proxy or EL expression will cause a new instance of this bean to be created. A new Conversation instance will be created to hold that bean, and a new PersistenceContext object will also be created (and then injected into this instance).

### invalidateAndRestartConversation

    public void invalidateAndRestartConversation()

  Invalidate the conversation in which this bean lives, and then create a new bean instance (in a new conversation) and copy some data from the old to the new instance.

  Using invalidateAndRestart allows information to be communicated between one instance of this bean and its replacement.

### setRestartedUser

    public void setRestartedUser(java.lang.Long id)

### updateUser

    public void updateUser(java.lang.Long id,
                           java.lang.String username)

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.