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

📄 standardejbeventlistenerfactory.java

📁 intra_mart是日本NDD公司开发的著名企业应用解决方案中间件。集成了J2ee服务器
💻 JAVA
字号:
/*
 * StandardEJBEventListenerFactory.java
 *
 * Created on 2002/03/24, 17:02
 */

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

import java.util.ResourceBundle;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;

import java.util.MissingResourceException;
import javax.naming.NamingException;

/**
 * 昗弨揑側EJB梡偺僀儀儞僩儕僗僫僼傽僋僩儕偱偡丅
 *
 * @author INTRAMART
 * @version 1.0
 */
public class StandardEJBEventListenerFactory extends EJBEventListenerFactory {

    /**
     * StandardEJBEventListener
     */
    private StandardEJBEventListener listener;

    /**
     * StandardEJBEventListenerFactory傪怴婯偵惗惉偟傑偡丅
     */
    public StandardEJBEventListenerFactory() {
        super();
    }

    /**
     * 僀儀儞僩儕僗僫傪惗惉偟傑偡丅
     *
     * @param event 僀儀儞僩
     * @return 僀儀儞僩儕僗僫
     * @throws EventListenerException 僀儀儞僩儕僗僫偺惗惉偵幐攕
     */
    public EventListener create(Event event) throws EventListenerException {
        if (this.listener == null) {
            synchronized(this) {
                if (this.listener == null) {
                    InitialContext context;
                    StandardEJBEventListenerAgentHome home;

                    try {
                        context = new InitialContext();
                        home = (StandardEJBEventListenerAgentHome)PortableRemoteObject.narrow(context.lookup(getJNDIName()), StandardEJBEventListenerAgentHome.class);
                    } catch (NamingException e) {
                        throw new EventListenerException(e.getMessage(), e);
                    } catch (ClassCastException e) {
                        throw new EventListenerException(e.getMessage(), e);
                    }
                    this.listener = new StandardEJBEventListener(home);
                }
            }
        }

        return this.listener;
    }

    /**
     * 弶婜僷儔儊乕僞傪愝掕偟傑偡丅
     * 暋悢偺僷儔儊乕僞偑愝掕偝傟傞応崌丄偦偺弴斣偼曐徹偝傟傑偣傫丅
     *
     * @param name 僷儔儊乕僞柤
     * @param value 僷儔儊乕僞偺抣
     * @throws EventListenerException 僷儔儊乕僞偺愝掕帪偵椺奜偑敪惗
     */
    public void initParam(String name, String value) throws EventListenerException {
        if (name.equals(HOME_PARAM)) {
            if (value == null || value.equals("")) {
                String message = null;
                try {
                    message = ResourceBundle.getBundle("jp.co.intra_mart.framework.base.event.i18n").getString("Common.IllegalInitParameter");
                } catch (MissingResourceException e) {
                }
                throw new EventListenerException(message + " : " + HOME_PARAM);
            }
            setJNDIName(value);
        }
    }
}

⌨️ 快捷键说明

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