ssglydelegateremote.java

来自「以前做的一个j2ee的项目」· Java 代码 · 共 75 行

JAVA
75
字号
package gov.gdlt.ssgly.taxcore.comm.bizdelegate;

import javax.naming.NamingException;
import javax.ejb.CreateException;
import gov.gdlt.ssgly.taxcore.comm.gateway.SsglyGateway;
import gov.gdlt.ssgly.taxcore.comm.gateway.SsglyGatewayHome;
import gov.gdlt.ssgly.taxcore.comm.servicelocator.EJBLocator;
import gov.gdlt.ssgly.taxcore.comm.event.RequestEvent;
import gov.gdlt.ssgly.taxcore.comm.event.ResponseEvent;
import java.rmi.RemoteException;

/**
 * Business Delegate 模式的实现。
 *
 * <p>Title: SsglyDelegateRemote</p>
 * <p>Description: 税收管理员系统</p>
 * <p>Copyright: Copyright (c) 2005 广州市地方税务局</p>
 * <p>Company: 信息中心</p>
 * @author Lemon
 * @version 1.0
 * @since 2005.8.8.
 */


public class SsglyDelegateRemote {

    private SsglyGateway ssglyService;

    public SsglyDelegateRemote() {
        init();
    }

    public void init() {
        // Look up and obtain our session bean
        try {

            SsglyGatewayHome ssglyHome = (SsglyGatewayHome)
                    EJBLocator.getRemoteInstance().
                    getRemoteHome(
                            "SsglyGateway", SsglyGatewayHome.class);
            ssglyService = ssglyHome.create();

        } catch (NamingException e) {
            throw new RuntimeException(e);
        } catch (CreateException e) {
            throw new RuntimeException(e);
        } catch (RemoteException e) {
            throw new RuntimeException(e);
        }

    }

    public ResponseEvent invokeTask(RequestEvent req) throws Exception {
        ResponseEvent response = null;
        try {
            response = ssglyService.invokeTask(req);
        } catch(RemoteException e) {
            throw new RuntimeException(e);
        }

        return response;
    }

    public String getVersion() {
        String response = null;
        try {
            response = ssglyService.getVersion();
        } catch(RemoteException e) {
            throw new RuntimeException(e);
        }

        return response;
    }
}

⌨️ 快捷键说明

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