org.apache.commons.scaffold.util
Class ProcessBeanBase

java.lang.Object
  extended by org.apache.commons.scaffold.util.ProcessBeanBase
All Implemented Interfaces:
ProcessBean
Direct Known Subclasses:
StorageBeanBase

public abstract class ProcessBeanBase
extends Object
implements ProcessBean

Base implementation of ProcessBean with default functionality. The only method that must be overridden is Object execute(Object). :TODO: Change from BeanUtil.populate to copyProperties in 1.1 version.

Version:
$Revision: 155464 $ $Date: 2005-02-26 13:26:54 +0000 (Sat, 26 Feb 2005) $
Author:
Ted Husted

Field Summary
 
Fields inherited from interface org.apache.commons.scaffold.util.ProcessBean
USER_PROFILE_KEY
 
Constructor Summary
ProcessBeanBase()
           
 
Method Summary
 Object execute()
          Perform business logic for this bean.
 Object execute(Object parameters)
          Perform business logic for this instance by obtaining any properties from the parameters object.
 Locale getLocale()
          Return the locale for this bean instance.
 String getParameter()
          Return the parameter.
 String getRemoteAddr()
          Return the String representation of an IP address expressed as an Integer, into the format usually given by the REMOTE_ADDR CGI variable, or ServletRequest.getRemoteAddr().
 Integer getRemoteNode()
          Return the network address of the client for this bean instance.
 Object getRemoteServer()
          The remote server object for this bean instance, if any.
 void setLocale(Locale locale)
          Set the locale for this bean instance.
 void setParameter(String parameter)
          Set the parameter.
 void setRemoteAddr(String remoteAddr)
          Set the remoteNode using a String in the format usually given by the REMOTE_ADDR CGI variable, or ServletRequest.getRemoteAddr().
 void setRemoteNode(Integer remoteNode)
          Set the network address of the client for this bean instance.
 void setRemoteServer(Object server)
          Set the remote server
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProcessBeanBase

public ProcessBeanBase()
Method Detail

getLocale

public Locale getLocale()
Description copied from interface: ProcessBean
Return the locale for this bean instance.

Specified by:
getLocale in interface ProcessBean
Returns:
the locale

setLocale

public void setLocale(Locale locale)
Description copied from interface: ProcessBean
Set the locale for this bean instance.

Specified by:
setLocale in interface ProcessBean
Parameters:
locale - The new locale

getRemoteNode

public Integer getRemoteNode()
Description copied from interface: ProcessBean
Return the network address of the client for this bean instance.

Specified by:
getRemoteNode in interface ProcessBean
Returns:
the network address.

setRemoteNode

public void setRemoteNode(Integer remoteNode)
Description copied from interface: ProcessBean
Set the network address of the client for this bean instance.

Specified by:
setRemoteNode in interface ProcessBean
Parameters:
remoteNode - The new remoteNode.

setRemoteAddr

public void setRemoteAddr(String remoteAddr)
Set the remoteNode using a String in the format usually given by the REMOTE_ADDR CGI variable, or ServletRequest.getRemoteAddr(). NOTE: not implemented; returns 0.


getRemoteAddr

public String getRemoteAddr()
Return the String representation of an IP address expressed as an Integer, into the format usually given by the REMOTE_ADDR CGI variable, or ServletRequest.getRemoteAddr(). NOTE: not implemented; returns zeros.

Returns:
An Integer value based on RemoteAddr string.

getRemoteServer

public Object getRemoteServer()
Description copied from interface: ProcessBean
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.

Specified by:
getRemoteServer in interface ProcessBean
Returns:
the remote server

setRemoteServer

public void setRemoteServer(Object server)
Description copied from interface: ProcessBean
Set the remote server

Specified by:
setRemoteServer in interface ProcessBean
Parameters:
server - The new server

getParameter

public String getParameter()
Description copied from interface: ProcessBean
Return the parameter.

Specified by:
getParameter in interface ProcessBean

setParameter

public void setParameter(String parameter)
Description copied from interface: ProcessBean
Set the parameter.

Specified by:
setParameter in interface ProcessBean
Parameters:
parameter - The new parameter

execute

public Object execute()
               throws Exception
Perform business logic for this bean. Called by other execute signatures (after populating subclass properties). The default implementation returns the bean instance (this). Subclasses should override to provide functionality.

Specified by:
execute in interface ProcessBean
Throws:
Subclasses - can throw any Exception
Exception

execute

public Object execute(Object parameters)
               throws Exception
Perform business logic for this instance by obtaining any properties from the parameters object. The base implementation casts the parameters as a Map, populates the bean, and returns execute().

Specified by:
execute in interface ProcessBean
Parameters:
parameters - The map or other object to use with this operation
Throws:
Subclasses - can throw any Exception
Exception


Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.