|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.struts.action.Action com.jcorporate.expresso.core.controller.Controller com.jcorporate.expresso.core.controller.DBController com.sri.common.controller.AbstractDBController com.sri.common.controller.AbstractComponentController
public abstract class AbstractComponentController
The component controller provides the home for two lightweight containers and a link to a third. They are shown here in the diagram:
The lowest level, the request container is build during the prePerform and postPerform states. The Request/Response objects are dumped in this particular container.
The next level up, the ControllerContainer contains all the step handlers and other appropriate classes for the controller component. This may include Monitor objects, etc.
The Controller-level container is first instantiated upon construction of the controller
The final level container is contained in the Schema and may be used as a factory for DataObjects, Controllers, and the like.
The Schema container is created at the startup of the servlet context
Field Summary | |
---|---|
static String |
REQUEST_CONTAINER
The mutable pico container is stored here. |
Fields inherited from class com.sri.common.controller.AbstractDBController |
---|
COLUMN, COMMON_FOOTER_HANDLER, COMMON_HEADER_HANDLER, DELIMIT, EDIT_GROUP_DISPLAY, EMBEDDED_MODE, FOOTER, MAX_CHARS_OUTPUT, MAX_TEXTAREA_LENGTH, MULTIPLE_TEXTAREA_NUM_LINES, ROW, ROW_BLOCK, SESSION_CONTAINER, SINGLE_TEXTAREA_NUM_LINES, TEXTAREA_NUM_COLS, WARNING_LIST |
Fields inherited from class com.jcorporate.expresso.core.controller.DBController |
---|
CACHE_NAME |
Fields inherited from class com.jcorporate.expresso.core.controller.Controller |
---|
CONTROLLER_PARAM_KEY, CTL_SUCC_CTL, CTL_SUCC_STATE, CTL_SUCC_TRAN, mLog, NEWSTATE_EXCEPTION_KEY, ORIGINAL_URL_KEY, REQUEST_KEY, RESPONSE_KEY, RETURN_TO_SENDER_TRAN, STATE_ERR_CTL, STATE_ERR_STATE, STATE_ERR_TRAN, STATE_PARAM_KEY, STATE_SUCC_CTL, STATE_SUCC_STATE, STATE_SUCC_TRAN |
Fields inherited from class org.apache.struts.action.Action |
---|
defaultLocale, servlet |
Constructor Summary | |
---|---|
AbstractComponentController(Class mySchemaClass)
Constructor that takes a concrete schema instance as its parameter. |
Method Summary | |
---|---|
protected State |
addStateHandler(String stateName,
String stateDescription,
Class stateHandler)
Allows adding a state handler by combining adding a state and registering the component instance in the container instance. |
protected void |
initializeControllerContainer(org.picocontainer.MutablePicoContainer container)
Template method that allows sub-controllers to register any particular objects they wish. |
Object |
locate(Object serviceKey)
Retrieves the desired service defined by the key. |
protected ComponentServiceLocator |
locator()
Retrieve the application locator. |
ExpressoResponse |
newExpressoState(String newState,
ExpressoRequest myRequest)
This is the method where all of the real work of the controller is done. |
protected void |
postPerform(State nextState,
ExpressoRequest request,
ExpressoResponse response)
Template Method, allowing a subclass to into actions after the invocation of any state in this controller. |
protected void |
prePerform(State nextState,
ExpressoRequest request,
ExpressoResponse response)
Template Method, allowing a subclass to do an action after any state in this controller is performed. |
Methods inherited from class com.sri.common.controller.AbstractDBController |
---|
addEmbeddedParameter, addWarning, addWarningList, getActionForwarding, getCheckbox, getPermsTrans, getPrettyXML, getTextArea, getTextArea, getWarningList, isEmbeddedMode, isValidAndPopulated, outputXML, populateDBObject, stateAllowed, str, strTrunc, trimAllTextFields |
Methods inherited from class com.jcorporate.expresso.core.controller.DBController |
---|
getString, isAllowed |
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, 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 |
---|
public static final String REQUEST_CONTAINER
Constructor Detail |
---|
public AbstractComponentController(Class mySchemaClass)
mySchemaClass
- ComponentSchemaMethod Detail |
---|
protected void initializeControllerContainer(org.picocontainer.MutablePicoContainer container)
container
- MutablePicoContainer the mutable pico container instance.protected State addStateHandler(String stateName, String stateDescription, Class stateHandler)
stateName
- String the name of the state.stateDescription
- String the name of the instance.stateHandler
- Class the handler instance.
protected void postPerform(State nextState, ExpressoRequest request, ExpressoResponse response) throws ControllerException
postPerform
in class AbstractDBController
nextState
- the state to be performedrequest
- the request objectresponse
- the response object
ControllerException
- upon error.protected void prePerform(State nextState, ExpressoRequest request, ExpressoResponse response) throws ControllerException
prePerform
in class AbstractDBController
nextState
- the state to be performedrequest
- the request objectresponse
- the response object
ControllerException
- upon error.public ExpressoResponse newExpressoState(String newState, ExpressoRequest myRequest) throws ControllerException
newExpressoState
in class Controller
newState
- The new state to transition tomyRequest
- The calling controllerRequest object.
ControllerException
- on Errorprotected ComponentServiceLocator locator()
this.locator().locate(Cache.class);
IllegalStateException
- if the attached schema does not implement
the ComponentServiceLocator interface.public Object locate(Object serviceKey) throws NoSuchServiceException, IllegalArgumentException
locate
in interface ComponentServiceLocator
serviceKey
- Object usually the service interface class, but may
be other object.
NoSuchServiceException
- if unable to locate the service.
IllegalArgumentException
- if service key is null.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |