FileDocCategorySizeDatePackage
ReadOnlyBeanHelper.javaAPI DocGlassfish v2 API4331Fri May 04 22:32:58 BST 2007com.sun.ejb.containers

ReadOnlyBeanHelper

public class ReadOnlyBeanHelper extends Object
Class that is used to obtain ReadOnlyBeanNotifier and ReadOnlyBeanLocalNotifier.
deprecated
New implementations must use com.sun.appserv.ejb.ReadOnlyBeanHelper
author
Mahesh Kannan

Fields Summary
private static final Logger
_logger
private static final boolean
debug
Constructors Summary
Methods Summary
public static com.sun.ejb.ReadOnlyBeanLocalNotifiergetReadOnlyBeanLocalNotifier(java.lang.String ejbName)
Get a ReadOnlyBeanLocalNotifier for a bean that can be "lookedup" using the ejbName

returns
a ReadOnlyBeanLocalNotifier or null if the lookup resulted in a NameNotFoundException

        try {
            Context ctx = new InitialContext();
            ReadOnlyEJBLocalHome home = 
                (ReadOnlyEJBLocalHome) ctx.lookup(ejbName);
            return (com.sun.ejb.ReadOnlyBeanLocalNotifier)
                home.getReadOnlyBeanLocalNotifier();
        } catch (Exception ex) {
            if(_logger.isLoggable(Level.SEVERE)) {
                _logger.log(Level.SEVERE,"ejb.remote_exception",ex);
            }
        }
        return null;
    
public static com.sun.ejb.ReadOnlyBeanNotifiergetReadOnlyBeanNotifier(java.lang.String ejbName)
Get a ReadOnlyBeanNotifier for a bean that can be "lookedup" using the ejbName

returns
a ReadOnlyBeanNotifier or null if the lookup resulted in a NameNotFoundException


                                     
      
         
    
        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;