org.apache.commons.scaffold.util
Interface ProcessBean

All Known Subinterfaces:
StorageBean
All Known Implementing Classes:
ProcessBeanBase, StorageBeanBase

public interface ProcessBean

Simple helper bean that can be used to encapsulate a method representing a business process.

The business logic should be implemented in one of the supplied execute methods, or by another method called by one of these. A concrete subclass may return a default scope and attribute name to use when storing the bean (if applicable).

The preferred approach is to implement the Object execute(Object) signature, and use execute() to pass null, some other default value. If a default value is not possible, it is recommended that execute() throw an or throw a UnsupportedOperationException.

Known implementations: BusinessBeanBase.

Version:
$Revision: 1.9 $ $Date: 2004/03/21 21:10:10 $

Field Summary
static java.lang.String USER_PROFILE_KEY
          The session attribute key for our user profile bean ["userProfile"].
 
Method Summary
 java.lang.Object execute()
          Perform business logic for this bean, often by passing default values to the Object execute(Object) signature.
 java.lang.Object execute(java.lang.Object parameters)
          Perform business logic for this, by retrieving any settings from the parameters object and returning a result object.
 java.util.Locale getLocale()
          Return the locale for this bean instance.
 java.lang.String getParameter()
          Return the parameter.
 java.lang.Integer getRemoteNode()
          Return the network address of the client for this bean instance.
 java.lang.Object getRemoteServer()
          The remote server object for this bean instance, if any.
 void setLocale(java.util.Locale locale)
          Set the locale for this bean instance.
 void setParameter(java.lang.String parameter)
          Set the parameter.
 void setRemoteNode(java.lang.Integer remoteNode)
          Set the network address of the client for this bean instance.
 void setRemoteServer(java.lang.Object server)
          Set the remote server
 

Field Detail

USER_PROFILE_KEY

public static final java.lang.String USER_PROFILE_KEY
The session attribute key for our user profile bean ["userProfile"].

See Also:
Constant Field Values
Method Detail

getLocale

public java.util.Locale getLocale()
Return the locale for this bean instance.

Returns:
the locale

setLocale

public void setLocale(java.util.Locale locale)
Set the locale for this bean instance.

Parameters:
locale - The new locale

getRemoteNode

public java.lang.Integer getRemoteNode()
Return the network address of the client for this bean instance.

Returns:
the network address.

setRemoteNode

public void setRemoteNode(java.lang.Integer remoteNode)
Set the network address of the client for this bean instance.

Parameters:
remoteNode - The new remoteNode.

getRemoteServer

public java.lang.Object getRemoteServer()
The remote server object for this bean instance, if any.

This is often an application-scope object that can be used to process a JDBC query or equivalent. By default, the ProcessAction will set this to any application scope object found under the key BaseAction.REMOTE_SERVER or to null.

Returns:
the remote server

setRemoteServer

public void setRemoteServer(java.lang.Object server)
Set the remote server

Parameters:
server - The new server

getParameter

public java.lang.String getParameter()
Return the parameter.


setParameter

public void setParameter(java.lang.String parameter)
Set the parameter.

Parameters:
parameter - The new parameter

execute

public java.lang.Object execute()
                         throws java.lang.Exception
Perform business logic for this bean, often by passing default values to the Object execute(Object) signature. If there is no default, it is recommended that a subclass throw an UnsupportedOperationException instead.

Throws:
Throws - Exception on any error. A subclass of ChainedException is recommended.
java.lang.Exception

execute

public java.lang.Object execute(java.lang.Object parameters)
                         throws java.lang.Exception
Perform business logic for this, by retrieving any settings from the parameters object and returning a result object.

Parameters:
parameters - The map or other object to use with this operation
Throws:
Throws - Exception on any error. A subclass of ChainedException is recommended.
java.lang.Exception


Copyright © 2002-2005 The Apache Software Foundation. All Rights Reserved.