jp.terasoluna.fw.service.thin
Class BLogicResult

java.lang.Object
  Extend the abovejp.terasoluna.fw.service.thin.BLogicResult
All implemented interfaces:
java.io.Serializable

public class BLogicResult
extends java.lang.Object
implements java.io.Serializable

Business logic output information class.

Perform data mapping into Web tier such as form and session. Coding is not necessary since the BLogicMapper itself performs the mapping process. For each action, the contents of data to be mapped and the mapping destination into Web tier should be specified in blogic-io.xml. For these settings, refer to BLogicIOPlugIn
The information which should be set in this class is as follows.

At the time of using Struts in MVC, contents of BLogicMessages can be replaced by ActionMessages in the subsequent processes.
Following is an usage example of BLogicResult which is returned from BLogic implementation class.

Usage example of BLogicResult(Implement BLogic#execute())

 public BLogicResult execute(ParamsBean params) {

     // Perform new in BLogic and generate BLogicResult.
     BLogicResult result = new BLogicResult();
     ...
     //Business logic
     ...
     //Error result
     if (// Error condition ) {
         // Set the information that should be mapped into form and session.
         ResultBean bean = new ResultBean();
         bean.setUserId(userId);
         result.setResultObject(bean);
         // Specify "success" in the execution result
         result.setResultString("success");
         return result;
     } else {
         // Error occurs in business logic
         // For error,setBLogicMessages in BLogicResult
         result.setErrors(errorMessages);
         // Specify "failure" in execution result
         result.setResultString("failure");
         return result;
     }
 }
 

See Also:
BLogicIOPlugIn, AbstractBLogicMapper, BLogicMapper, BLogicIO, BLogicProperty, BLogicResources, AbstractBLogicAction, BLogicAction, Serialized form

Field Summary
private  BLogicMessages errors
          BLogicMessages for errors generated in business logic.
private  BLogicMessages messages
          BLogicMessages used for messages and generated in business logic.
private  java.lang.Object resultObject
          JavaBean wherein execution result of business logic is stored.
private  java.lang.String resultString
          String that displays the execution result of business logic.
private static long serialVersionUID
          Serial version ID
 
Constructor Summary
BLogicResult()
           
 
Method Summary
 BLogicMessages getErrors()
          Fetch the BLogicMessages for errors generated in business logic.
 BLogicMessages getMessages()
          Fetch the BLogicMessages used for messages and generated in business logic.
 java.lang.Object getResultObject()
          Fetch JavaBean wherein execution result of business logic is stored.
 java.lang.String getResultString()
          Fetch the string that displays the execution result of business logic.
 void setErrors(BLogicMessages paramErrors)
          Set BLogicMessages for the errros generated in business logic.
 void setMessages(BLogicMessages paramMessages)
          Set BLogicMessages used for messages and generated in business logic.
 void setResultObject(java.lang.Object resultObject)
          Set JavaBean wherein execution result of business logic is stored.
 void setResultString(java.lang.String resultString)
          Set the string that displays the execution result of business logic.
 
Method inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Details

serialVersionUID

private static final long serialVersionUID
Serial version ID

See Also:
Constant field value

resultObject

private java.lang.Object resultObject
JavaBean wherein execution result of business logic is stored.


resultString

private java.lang.String resultString
String that displays the execution result of business logic.


errors

private BLogicMessages errors
BLogicMessages for errors generated in business logic.


messages

private BLogicMessages messages
BLogicMessages used for messages and generated in business logic.

Constructor Details

BLogicResult

public BLogicResult()
Method Details

getErrors

public BLogicMessages getErrors()
Fetch BLogicMessages used for messages and generated in business logic.

Returns:
BLogicMessages BLogicMessages for errors generated in business logic

getMessages

public BLogicMessages getMessages()
Fetch BLogicMessages used for messages and generated in business logic.

Returns:
BLogicMessages used for messages and generated in business logic

setErrors

public void setErrors(BLogicMessages paramErrors)
Set BLogicMessages for errors generated in business logic.

Parameter:
paramErrors - BLogicMessages for errors generated in business logic

setMessages

public void setMessages(BLogicMessages paramMessages)
Set BLogicMessages used for messages and generated in business logic.

Parameter:
paramMessages - BLogicMessages used for messages and generated in business logic

getResultString

public java.lang.String getResultString()
Fetch string that displays the execution result of business logic.

Returns:
String that displays the execution result of business logic

setResultString

public void setResultString(java.lang.String resultString)
Set the string that displays the execution result of business logic.

Parameter:
resultString - String that displays the execution result of business logic

getResultObject

public java.lang.Object getResultObject()
Fetch JavaBean wherein execution result of business logic is stored.

Returns:
JavaBean wherein execution result of business logic is stored.

setResultObject

public void setResultObject(java.lang.Object resultObject)
Set JavaBean wherein execution result of business logic is stored.

Parameter:
resultObject - JavaBean wherein execution result of business logic is stored