org.milyn.javabean
Class BeanAccessor

java.lang.Object
  extended by org.milyn.javabean.BeanAccessor

Deprecated. Use the BeanContext to manager the beans

@Deprecated
public class BeanAccessor
extends Object

Bean Accessor.

This class provides support for saving and accessing Javabean instance.

Author:
maurice.zeijen@smies.com

Constructor Summary
BeanAccessor(ExecutionContext executionContext)
          Deprecated. Public default constructor.
BeanAccessor(ExecutionContext executionContext, Map<String,Object> resultMap)
          Deprecated. Public constructor.
 
Method Summary
static void addBean(ExecutionContext executionContext, String beanId, Object bean)
          Deprecated. Add a bean instance to the specified request under the specified beanId.
static void addBeanLifecycleObserver(ExecutionContext executionContext, String beanId, BeanLifecycle lifecycle, String observerId, boolean notifyOnce, BeanLifecycleObserver observer)
          Deprecated. Registers an observer which observers when a bean gets added.
static void associateLifecycles(ExecutionContext executionContext, String parentBean, String childBean)
          Deprecated. Associates the lifeCycle of the childBean with the parentBean.
static void changeBean(ExecutionContext executionContext, String beanId, Object bean)
          Deprecated. Changes a bean object of the given beanId.
static Object getBean(ExecutionContext executionContext, String beanId)
          Deprecated. Get the current bean, specified by the supplied beanId, from the supplied request.
static Object getBean(String beanId, ExecutionContext executionContext)
          Deprecated. Get the current bean, specified by the supplied beanId, from the supplied request.
static Map<String,Object> getBeanMap(ExecutionContext executionContext)
          Deprecated. Get the bean map associated with the supplied request instance.
static HashMap<String,Object> getBeans(ExecutionContext executionContext)
          Deprecated. Get the bean map associated with the supplied request instance.
static void removeBeanLifecycleObserver(ExecutionContext executionContext, String beanId, BeanLifecycle lifecycle, String observerId)
          Deprecated. Unregisters a bean observer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanAccessor

public BeanAccessor(ExecutionContext executionContext)
Deprecated. 
Public default constructor.


BeanAccessor

public BeanAccessor(ExecutionContext executionContext,
                    Map<String,Object> resultMap)
Deprecated. 
Public constructor.

Creates an accessor based on the supplied result Map.

Parameters:
resultMap - The result Map.
Method Detail

getBean

public static Object getBean(String beanId,
                             ExecutionContext executionContext)
Deprecated. 
Get the current bean, specified by the supplied beanId, from the supplied request.

If the specified beanId refers to a bean instance list, this method returns the last (current) bean from the list.

Parameters:
beanId - Bean Identifier.
executionContext - The request on which the bean instance is stored.
Returns:
The bean instance, or null if no such bean instance exists on the supplied request.

getBean

public static Object getBean(ExecutionContext executionContext,
                             String beanId)
Deprecated. 
Get the current bean, specified by the supplied beanId, from the supplied request.

If the specified beanId refers to a bean instance list, this method returns the last (current) bean from the list.

Parameters:
beanId - Bean Identifier.
executionContext - The request on which the bean instance is stored.
Returns:
The bean instance, or null if no such bean instance exists on the supplied request.

getBeans

public static HashMap<String,Object> getBeans(ExecutionContext executionContext)
Deprecated. 
Get the bean map associated with the supplied request instance.

Parameters:
executionContext - The execution context.
Returns:
The bean map associated with the supplied request.

getBeanMap

public static Map<String,Object> getBeanMap(ExecutionContext executionContext)
Deprecated. 
Get the bean map associated with the supplied request instance.

Parameters:
executionContext - The execution context.
Returns:
The bean map associated with the supplied request.

addBean

public static void addBean(ExecutionContext executionContext,
                           String beanId,
                           Object bean)
Deprecated. 
Add a bean instance to the specified request under the specified beanId.

Parameters:
executionContext - The execution context within which the bean is created.
beanId - The beanId under which the bean is to be stored.
bean - The bean instance to be stored.

changeBean

public static void changeBean(ExecutionContext executionContext,
                              String beanId,
                              Object bean)
Deprecated. 
Changes a bean object of the given beanId. The difference to addBean is that the bean must exist, the associated beans aren't removed and the observers of the BeanLifecycle.CHANGE event are notified.

Parameters:
executionContext - The execution context within which the bean is created.
beanId - The beanId under which the bean is to be stored.
bean - The bean instance to be stored.

associateLifecycles

public static void associateLifecycles(ExecutionContext executionContext,
                                       String parentBean,
                                       String childBean)
Deprecated. 
Associates the lifeCycle of the childBean with the parentBean. When the parentBean gets overwritten via the addBean method then the associated child beans will get removed from the bean map.

Parameters:
executionContext - The execution context within which the beans are located.
parentBean - The bean that controlles the lifecycle of its childs
childBean - The bean that will be associated to the parent
addToList - Is the child added to a bean list.

addBeanLifecycleObserver

public static void addBeanLifecycleObserver(ExecutionContext executionContext,
                                            String beanId,
                                            BeanLifecycle lifecycle,
                                            String observerId,
                                            boolean notifyOnce,
                                            BeanLifecycleObserver observer)
Deprecated. 
Registers an observer which observers when a bean gets added.

Parameters:
executionContext - The execution context in which the observer is registered
beanId - The bean id for which the observer is registered
observerId - The id of the observer. This is used to unregister the observer
observer - The actual BeanObserver object

removeBeanLifecycleObserver

public static void removeBeanLifecycleObserver(ExecutionContext executionContext,
                                               String beanId,
                                               BeanLifecycle lifecycle,
                                               String observerId)
Deprecated. 
Unregisters a bean observer

Parameters:
executionContext - The execution context in which the observer is registered
beanId - The bean id for which the observer is registered
observerId - The id of the observer to unregister


Copyright © 2010. All Rights Reserved.