jp.terasoluna.fw.web.struts.actions
Class BLogicAction<P>

java.lang.Object
  extended by org.apache.struts.action.Action
      extended by jp.terasoluna.fw.web.struts.actions.ActionEx
          extended by jp.terasoluna.fw.web.struts.actions.AbstractBLogicAction<P>
              extended by jp.terasoluna.fw.web.struts.actions.BLogicAction<P>
Type Parameters:
P - Specify JavaBean which is the input value to the business logic
Direct Known Subclasses:
DownloadBLogicAction

public class BLogicAction<P>
extends AbstractBLogicAction<P>

This class invokes BLogic.
It invokes BLogic directly from Action. This class is not supported in EJB.

To exeute BLogic implementation, specify the target business logic in the "business logic" property of <property> element in the bean definition of BLogicAction class. Refer the following example of bean definition file. The configuration example of struts-config.xml is also shown below.

Configuration of Bean definition file

 <bean name="/logon/logonAction" scope="singleton"
   class="jp.terasoluna.fw.web.struts.actions.BLogicAction">
   <property name="businessLogic">
     <ref bean="LogonBLogic"></ref>
   </property>
 </bean>
 <bean id="LogonBLogic" scope="prototype"
   class="jp.terasoluna.sample1.logon.blogic.LogonBLogic">
 </bean>
 

Configuration example of BLogicAction in struts-config.xml

    <action path="/logon/logonAction"
       name="_logonForm"
       validate="true"
       scope="session"
       input="/logon/logon.jsp">
    <forward name="success" path="/logon/selectGroupSCR.do"/>
    <forward name="failure" path="/logon/logonSCR.do"/>
  </action>
 

For each action path name in the blogic-io.xml, the description regarding the mapping between Web tier such as form and session and the I/O value of business logic, should be given . For the description method and detailed description, refer to BLogicIOPlugIn.

See Also:
BLogicIOPlugIn, BLogicResult

Field Summary
private  BLogic<P> businessLogic
          Business logic to be set.
private static org.apache.commons.logging.Log log
          Log class.
 
Fields inherited from class jp.terasoluna.fw.web.struts.actions.AbstractBLogicAction
BLOGIC_FORM_ILLEGAL_ERROR, BLOGIC_MAPPING_ILLEGAL_ERROR, BLOGIC_RESOURCES_ILLEGAL_ERROR, BLOGIC_RESULT_NULL_ERROR, NULL_MAPPER_KEY
 
Fields inherited from class jp.terasoluna.fw.web.struts.actions.ActionEx
FORWARD_TXTOKEN_ERROR
 
Fields inherited from class org.apache.struts.action.Action
defaultLocale, servlet
 
Constructor Summary
BLogicAction()
           
 
Method Summary
 BLogicResult doExecuteBLogic(P param)
          Invokes BLogic.
 BLogic<P> getBusinessLogic()
          Fetches business logic.
 void setBusinessLogic(BLogic<P> businessLogic)
          Sets business logic.
 
Methods inherited from class jp.terasoluna.fw.web.struts.actions.AbstractBLogicAction
convertMessages, doExecute, evaluateBLogicResult, getBLogicIO, getBLogicMapper, getBLogicParams, isErrorsEmpty, postDoExecuteBLogic, preDoExecuteBLogic, processBLogicResult, setSaveMessageScope
 
Methods inherited from class jp.terasoluna.fw.web.struts.actions.ActionEx
addErrors, addMessages, execute, isSaveToken, isTokenCheck, processTokenCheck, setSaveToken, setTokenCheck
 
Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, generateToken, getDataSource, getDataSource, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static org.apache.commons.logging.Log log
Log class.


businessLogic

private BLogic<P> businessLogic
Business logic to be set.

Constructor Detail

BLogicAction

public BLogicAction()
Method Detail

setBusinessLogic

public void setBusinessLogic(BLogic<P> businessLogic)
Sets business logic.

Parameters:
businessLogic - Sets businessLogic.

getBusinessLogic

public BLogic<P> getBusinessLogic()
Fetches business logic.

Returns:
Business logic

doExecuteBLogic

public BLogicResult doExecuteBLogic(P param)
                             throws java.lang.Exception
Invokes BLogic.

The condition is that, the class variable businessLogic should contain the class which implemented BLogic. Returns null when BLogic is null.

Specified by:
doExecuteBLogic in class AbstractBLogicAction<P>
Parameters:
param - BLogic input information
Returns:
BLogic output information
Throws:
java.lang.Exception - Unexpected exception