com.bea.console.utils
Class HandleUtils
java.lang.Object
com.bea.console.utils.HandleUtils
public abstract class HandleUtils
- extends Object
Contains methods to support the use of handles, which are objects that
implement the Handle
interface and are used
to correlate a org.apache.struts.action.ActionForm bean with
an underlying artifact that the bean represents, such as an MBean.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SESSION_TYPED_HANDLES
public static final String SESSION_TYPED_HANDLES
- See Also:
- Constant Field Values
MAX_SESSION_HANDLES
public static final int MAX_SESSION_HANDLES
- See Also:
- Constant Field Values
HandleUtils
public HandleUtils()
getHandleContext
public static Handle getHandleContext(ActionForm actionForm,
HttpServletRequest request,
String objectType)
-
Searches an HttpServletRequest for an
ActionForm that contains a handle object whose
ObjectType
property
contains the specified value.
If this method does not find a match in the specified
ActionForm, it searches the handle object most recently
stored in the javax.servlet.http.HttpSession.
For example, if you specify getHandleContext(actionForm1,
request1, "myAppMBean"),
the method searces in request1 for actionForm1. If it finds actionForm1, it
searches actionForm1 for a handle object whose ObjectType
property contains "myAppMBean". If it does not find actionForm1, it
searches in the session context for a handle object whose
ObjectType property contains "myAppMBean".
- Parameters:
actionForm
- an org.apache.struts.action.ActionFormrequest
- a javax.servlet.http.HttpServletRequestobjectType
- a String describing an ObjectType value. This can be an explicit
value (like "myAppMBean"), "*" (which matches any ObjectType
value), or an expression like "typea|typeb|typec"
- Returns:
- Handle, which might be null if no context was available
getHandleContextFromForm
public static Handle getHandleContextFromForm(ActionForm actionForm,
String objectType)
-
Searches in the HttpSession for an
ActionForm that contains a handle object whose
ObjectType
property
contains the specified value.
For example, if you specify
getHandleContext(actionForm1, "myAppMBean"), the method
searces in the session for actionForm1. If it finds actionForm1, it
searches actionForm1 for a handle object whose ObjectType
property contains "myAppMBean".
- Parameters:
actionForm
- an org.apache.struts.action.ActionFormobjectType
- a String describing an ObjectType value. This can be an explicit
value (like "myAppMBean"), "*" (which matches any ObjectType
value), or an expression like "typea|typeb|typec"
- Returns:
- Handle, which might be null if no handles matching this type were
available
getHandleContextFromRequest
public static Handle getHandleContextFromRequest(HttpServletRequest request,
String objectType)
-
Searches in the HttpServletRequest for the
most recent handle object whose
ObjectType
property
contains the specified value.
- Parameters:
request
- a javax.servlet.http.HttpServletRequestobjectType
- a String describing an ObjectType value. This can be an explicit
value (like "myAppMBean"), "*" (which matches any ObjectType
value), or an expression like "typea|typeb|typec"
- Returns:
- Handle, which might be null if no handles matching this type were
available
clearHandlesInSession
public static void clearHandlesInSession(HttpServletRequest request)
- Clears any existing handles from session context.
- Parameters:
request
- the current HttpServletRequest
getHandleContextFromSession
public static Handle getHandleContextFromSession(HttpServletRequest request,
String objectType)
-
Searches in the session for the
most recent handle object whose
ObjectType
property
contains the specified value.
- Parameters:
request
- a javax.servlet.http.HttpServletRequestobjectType
- a String describing an ObjectType value. This can be an explicit
value (like "myAppMBean"), "*" (which matches any ObjectType
value), or an expression like "typea|typeb|typec"
- Returns:
- Handle, which might be null if no handles matching this type were
available
setHandleContextInSession
public static void setHandleContextInSession(HttpServletRequest request,
Handle handle)
- Stores the handle in the session context if it isn't already the
most recent handle.
- Parameters:
request
- an HttpServletRequesthandle
- a Handle to a management artifact