org.ow2.opensuit.core.util
Class BeanUtils

java.lang.Object
  extended by org.ow2.opensuit.core.util.BeanUtils

public class BeanUtils
extends java.lang.Object

Helper class to manage beans in open SUIT applications.


Constructor Summary
BeanUtils()
           
 
Method Summary
static
<T> T
getBean(javax.servlet.http.HttpServletRequest iRequest, java.lang.Class<T> iClass, java.lang.String iName, org.ow2.opensuit.xml.base.enums.Scope iScope)
          Returns the bean instance with given name.
static java.lang.Object getOpenSuitBean(javax.servlet.http.HttpServletRequest iRequest, java.lang.String iBeanName)
          Returns the bean instance from the name declared in the open SUIT xml.
static void setBean(javax.servlet.http.HttpServletRequest iRequest, java.lang.Object iBean, java.lang.String iName, org.ow2.opensuit.xml.base.enums.Scope iScope)
          Sets a bean instance with given name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanUtils

public BeanUtils()
Method Detail

getOpenSuitBean

public static java.lang.Object getOpenSuitBean(javax.servlet.http.HttpServletRequest iRequest,
                                               java.lang.String iBeanName)
                                        throws java.lang.Exception
Returns the bean instance from the name declared in the open SUIT xml. If the bean isn't found, a new instance will be created and stored in its scope.

Parameters:
iRequest - The current Http request
iBeanName - The bean name registered in open SUIT configuration.
Returns:
The bean object.
Throws:
java.lang.Exception

getBean

public static <T> T getBean(javax.servlet.http.HttpServletRequest iRequest,
                            java.lang.Class<T> iClass,
                            java.lang.String iName,
                            org.ow2.opensuit.xml.base.enums.Scope iScope)
Returns the bean instance with given name. If bean is not found, return null.

Type Parameters:
T - The bean class.
Parameters:
iRequest - The current Http request
iClass - The bean class.
iName - The bean name.
iScope - The bean scope.
Returns:
The bean object.

setBean

public static void setBean(javax.servlet.http.HttpServletRequest iRequest,
                           java.lang.Object iBean,
                           java.lang.String iName,
                           org.ow2.opensuit.xml.base.enums.Scope iScope)
Sets a bean instance with given name.

Parameters:
iRequest - The current Http request
iBean - The bean instance.
iName - The bean name.
iScope - The bean scope.


Copyright © 2008-2012 OW2 Consortium. All Rights Reserved.