FileDocCategorySizeDatePackage
ReadOnlyBeanHelper.javaAPI DocGlassfish v2 API3693Fri May 04 22:32:52 BST 2007com.sun.appserv.ejb

ReadOnlyBeanHelper

public class ReadOnlyBeanHelper extends Object
Class that is used to obtain ReadOnlyBeanNotifier and ReadOnlyBeanLocalNotifier.
author
Mahesh Kannan

Fields Summary
protected static final Logger
_logger
Constructors Summary
Methods Summary
public static ReadOnlyBeanLocalNotifiergetReadOnlyBeanLocalNotifier(java.lang.String ejbName)

        try {
            Context ctx = new InitialContext();
            ReadOnlyEJBLocalHome home = 
                (ReadOnlyEJBLocalHome) ctx.lookup(ejbName);
            return home.getReadOnlyBeanLocalNotifier();
        } catch (Exception ex) {
            if(_logger.isLoggable(Level.SEVERE)) {
                _logger.log(Level.SEVERE, "ejb.remote_exception",ex);
            }
        }
        return null;
    
public static ReadOnlyBeanNotifiergetReadOnlyBeanNotifier(java.lang.String ejbName)


         
        try {
            Context ctx = new InitialContext();
            Object obj = ctx.lookup(ejbName);
            ReadOnlyEJBHome home = (ReadOnlyEJBHome) 
                PortableRemoteObject.narrow(obj, ReadOnlyEJBHome.class);
            return new ReadOnlyBeanNotifierImpl(home);
        } catch (Exception ex) {
            if(_logger.isLoggable(Level.SEVERE)) {
                _logger.log(Level.SEVERE, "ejb.remote_exception", ex);
            }
        }
        return null;