⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 transition.java

📁 intra_mart是日本NDD公司开发的著名企业应用解决方案中间件。集成了J2ee服务器
💻 JAVA
字号:
/*
 * Transition.java
 *
 * Created on 2001/12/25, 11:16
 */

package jp.co.intra_mart.framework.base.service;

import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import jp.co.intra_mart.foundation.http.MultipartFormData;
import jp.co.intra_mart.framework.base.session.SessionFactoryException;
import jp.co.intra_mart.framework.base.session.SessionManager;
import jp.co.intra_mart.framework.base.session.SessionManagerException;
import jp.co.intra_mart.framework.base.session.SessionObject;
import jp.co.intra_mart.framework.base.session.SessionPropertyException;
import jp.co.intra_mart.framework.system.exception.SystemException;

/**
 * 夋柺慗堏偵娭楢偡傞僋儔僗偺僀儞僞僼僃乕僗偱偡丅
 *
 * @author INTRAMART
 * @version 1.0
 */
public abstract class Transition {

    /**
     * 僒乕價僗儅僱乕僕儍
     */
    private ServiceManager manager;

    /**
     * 傾僾儕働乕僔儑儞ID
     */
    private String application;

    /**
     * 僒乕價僗ID
     */
    private String service;

    /**
     * 儕僋僄僗僩
     */
    private HttpServletRequest request;

    /**
     * 儗僗億儞僗
     */
    private HttpServletResponse response;

    /**
     * 僒乕價僗張棟寢壥
     */
    private ServiceResult result;

    /**
     * Transition傪怴婯偵惗惉偟傑偡丅
     */
    public Transition() {
        setApplication(null);
        setService(null);
        setServiceManager(null);
        setRequest(null);
        setResponse(null);
        setResult(null);
    }

    /**
     * 僒乕價僗儅僱乕僕儍傪愝掕偟傑偡丅
     *
     * @param manager 僒乕價僗儅僱乕僕儍
     */
    protected void setServiceManager(ServiceManager manager) {
        this.manager = manager;
    }

    /**
     * 僒乕價僗儅僱乕僕儍傪庢摼偟傑偡丅
     *
     * @return 僒乕價僗儅僱乕僕儍
     */
    protected ServiceManager getServiceManager() {
        return this.manager;
    }

    /**
     * 傾僾儕働乕僔儑儞ID傪愝掕偟傑偡丅
     *
     * @param application 傾僾儕働乕僔儑儞ID
     */
    void setApplication(String application) {
        this.application = application;
    }

    /**
     * 傾僾儕働乕僔儑儞ID傪庢摼偟傑偡丅
     *
     * @return 傾僾儕働乕僔儑儞ID
     */
    protected String getApplication() {
        return this.application;
    }

    /**
     * 僒乕價僗ID傪愝掕偟傑偡丅
     *
     * @param service 僒乕價僗ID
     */
    void setService(String service) {
        this.service = service;
    }

    /**
     * 僒乕價僗ID傪庢摼偟傑偡丅
     *
     * @return 僒乕價僗ID
     */
    protected String getService() {
        return this.service;
    }

    /**
     * 儕僋僄僗僩傪愝掕偟傑偡丅
     *
     * @param request 儕僋僄僗僩
     */
    public void setRequest(HttpServletRequest request) {
        this.request = request;
    }

    /**
     * 儕僋僄僗僩傪庢摼偟傑偡丅
     *
     * @return 儕僋僄僗僩
     */
    public HttpServletRequest getRequest() {
        return this.request;
    }

    /**
     * 儗僗億儞僗傪愝掕偟傑偡丅
     *
     * @param response 儗僗億儞僗
     */
    public void setResponse(HttpServletResponse response) {
        this.response = response;
    }

    /**
     * 儗僗億儞僗傪庢摼偟傑偡丅
     *
     * @return 儗僗億儞僗
     */
    public HttpServletResponse getResponse() {
        return this.response;
    }

    /**
     * 儕僋僄僗僩偐傜巜掕偝傟偨柤慜偵奩摉偡傞僄儞僥傿僥傿傪庢摼偟傑偡丅
     * 偙偺儊僜僢僪偼丄僼傽僀儖傾僢僾儘乕僪帪偵偦偺撪梕傪庢摼偡傞応崌側偳偵巊梡偟傑偡丅
     * 偙偺儊僜僢僪偼丄僼傽僀儖傾僢僾儘乕僪偺儕僋僄僗僩偑憲傜傟偨応崌偺傒巊梡偱偒傑偡丅
     * 偦傟埲奜偺儕僋僄僗僩偑憲傜傟偨応崌偵偙偺儊僜僢僪傪屇傇偲椺奜偑敪惗偟傑偡丅
     *
     * @param name 僷儔儊乕僞柤
     * @return 僷儔儊乕僞柤偵奩摉偡傞僄儞僥傿僥傿
     * @throws SystemException 僄儞僥傿僥傿偺庢摼偵幐攕
     * @since 3.2
     */
    public MultipartFormData.Entity getEntity(String name)
        throws SystemException {
        // 儕僋僄僗僩偺僠僃僢僋
        if (!(getRequest() instanceof FileUploadRequest)) {
            String message = null;
            try {
                message =
                    ResourceBundle
                        .getBundle("jp.co.intra_mart.framework.base.service.i18n")
                        .getString("Common.NotFileUpload");
            } catch (MissingResourceException e) {
            }
            throw new SystemException(message);
        }

        return ((FileUploadRequest)getRequest()).getEntity(name);
    }

    /**
     * 僙僢僔儑儞僆僽僕僃僋僩傪庢摼偟傑偡丅
     *
     * @return 僙僢僔儑儞僆僽僕僃僋僩
     * @throws SessionManagerException 僙僢僔儑儞儅僱乕僕儍偺庢摼帪偵椺奜偑敪惗
     * @throws SessionPropertyException 僙僢僔儑儞偺僾儘僷僥傿忣曬庢摼帪偵椺奜偑敪惗
     * @throws SessionFactoryException 僙僢僔儑儞僆僽僕僃僋僩偺惗惉帪偵椺奜偑敪惗
     * @deprecated 偙偺儊僜僢僪偱偼側偔javax.servlet.http.HttpServletRequest偺getSession儊僜僢僪傪棙梡偟偰偔偩偝偄丅
     */
    public SessionObject getSessionObject()
        throws
            SessionManagerException,
            SessionPropertyException,
            SessionFactoryException {
        return SessionManager.getSessionManager().getSessionObject(
            getRequest());
    }

    /**
     * 僒乕價僗張棟寢壥傪愝掕偟傑偡丅
     *
     * @param result 僒乕價僗張棟寢壥
     */
    public void setResult(ServiceResult result) {
        this.result = result;
    }

    /**
     * 僒乕價僗張棟寢壥傪庢摼偟傑偡丅
     *
     * @return 僒乕價僗張棟寢壥
     */
    public ServiceResult getResult() {
        return this.result;
    }

    /**
     * 偙偺僩儔儞僕僔儑儞偵愝掕偝傟偰偄傞傾僾儕働乕僔儑儞ID偲僒乕價僗ID偵奩摉偡傞師儁乕僕偺僷僗傪庢摼偟傑偡丅
     *
     * @return 師儁乕僕偺僷僗
     * @throws ServicePropertyException 僾儘僷僥傿偺庢摼帪偵椺奜偑敪惗
     */
    protected String getNextPagePath() throws ServicePropertyException {
        Locale locale =
            getServiceManager().getLocale(getRequest(), getResponse());
        
        return getServiceManager().getServicePropertyHandler().getNextPagePath(
            getApplication(),
            getService(),
            locale);
    }

    /**
     * 偙偺僩儔儞僕僔儑儞偵愝掕偝傟偰偄傞傾僾儕働乕僔儑儞ID偲僒乕價僗ID偲丄巜掕偝傟偨僉乕偵奩摉偡傞師儁乕僕偺僷僗傪庢摼偟傑偡丅
     *
     * @param key 僉乕
     * @return 師儁乕僕偺僷僗
     * @throws ServicePropertyException 僾儘僷僥傿偺庢摼帪偵椺奜偑敪惗
     */
    protected String getNextPagePath(String key)
        throws ServicePropertyException {

        Locale locale =
            getServiceManager().getLocale(getRequest(), getResponse());

        return getServiceManager().getServicePropertyHandler().getNextPagePath(
            getApplication(),
            getService(),
            key,
            locale);
    }

    /**
     * 擖椡僄儔乕偺儁乕僕傪庢摼偟傑偡丅
     *
     * @param e 擖椡帪偺椺奜
     * @return 擖椡僄儔乕儁乕僕
     * @throws ServicePropertyException 慗堏儁乕僕庢摼帪偵僒乕價僗僾儘僷僥傿椺奜偑敪惗
     * @throws TransitionException 慗堏儁乕僕庢摼帪偵椺奜偑敪惗
     */
    public abstract String getInputErrorPage(RequestException e)
        throws ServicePropertyException, TransitionException;

    /**
     * 僔僗僥儉僄儔乕偺儁乕僕傪庢摼偟傑偡丅
     *
     * @param e 張棟帪偺椺奜
     * @return 僔僗僥儉僄儔乕儁乕僕
     * @throws ServicePropertyException 慗堏儁乕僕庢摼帪偵僒乕價僗僾儘僷僥傿椺奜偑敪惗
     * @throws TransitionException 慗堏儁乕僕庢摼帪偵椺奜偑敪惗
     */
    public abstract String getSystemErrorPage(Exception e)
        throws ServicePropertyException, TransitionException;

    /**
     * 張棟僄儔乕偺儁乕僕傪庢摼偟傑偡丅
     *
     * @param e 張棟帪偺椺奜
     * @return 張棟僄儔乕儁乕僕
     * @throws ServicePropertyException 慗堏儁乕僕庢摼帪偵僒乕價僗僾儘僷僥傿椺奜偑敪惗
     * @throws TransitionException 慗堏儁乕僕庢摼帪偵椺奜偑敪惗
     */
    public abstract String getServiceErrorPage(Exception e)
        throws ServicePropertyException, TransitionException;

    /**
     * 師偺慗堏愭偵搉偡忣曬傪愝掕偟傑偡丅
     *
     * @throws TransitionException 忣曬愝掕帪偵椺奜偑敪惗
     */
    public abstract void setInformation() throws TransitionException;

    /**
     * 師偵慗堏偡傞儁乕僕傪庢摼偟傑偡丅
     *
     * @return 師偵慗堏偡傞儁乕僕
     * @throws ServicePropertyException 慗堏儁乕僕庢摼帪偵僒乕價僗僾儘僷僥傿椺奜偑敪惗
     * @throws TransitionException 慗堏儁乕僕庢摼帪偵椺奜偑敪惗
     */
    public abstract String getNextPage()
        throws ServicePropertyException, TransitionException;

    /**
     * 師偺儁乕僕偵慗堏偟傑偡丅
     * 慗堏偡傞曽朄偼師偺儁乕僕偱梫媮偝傟傞宍幃偵埶懚偟傑偡丅
     *
     * @throws SystemException 僔僗僥儉椺奜偑敪惗
     * @since 3.2
     */
    public abstract void transfer() throws SystemException;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -