Package com.centraview.ejb

Examples of com.centraview.ejb.EJBHomeCache


   *           NamingException will be thrown also.
   * @author Kevin McAllister <kevin@centraview.com>
   */
  public static Object getHomeObject(String homeClassName, String beanJndiName) throws CommunicationException, NamingException
  {
    EJBHomeCache homeCache = EJBHomeCache.getInstance();
    Class homeClass = null;
    Object homeObject = null;
    try {
      homeClass = Class.forName(homeClassName);
    } catch (ClassNotFoundException e) {
      logger.error("[getHomeObject] There are classpath/classloader issues.  I can't do Class.forName(" + homeClassName + ");", e);
      // This kinda sucks, because you are losing information.
      // but for now it wasn't worthwhile for me to go through and make sure
      // ClassNotFoundException was also handled in some way by all the calling
      // classes.
      throw new NamingException("ClassNotFoundException!");
    }
    homeObject = homeCache.getHome(homeClass);
    if (homeObject == null) {
      Object tmpObj = Settings.getInstance().getInitCtx().lookup(beanJndiName);
      homeObject = PortableRemoteObject.narrow(tmpObj, homeClass);
      homeCache.putHome(homeClass, homeObject);
    }
    return homeObject;
  }
View Full Code Here

TOP

Related Classes of com.centraview.ejb.EJBHomeCache

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.