/** Returns the CDI BeanManager. * Default implementation use JNDI to lookup "java:comp/env/BeanManager". */ public static BeanManager getBeanManager() { if (_manager != null) return _manager; try { final InitialContext initialContext = new InitialContext(); _manager = (BeanManager) initialContext.lookup( Library.getProperty("org.zkoss.zkplus.cdi.beanManager.jndiName", "java:comp/env/BeanManager")); } catch (NamingException e) { // Error getting the home interface throw XelException.Aide.wrap(e, "Cannot locate the BeanManager for JavaEE 6."); } return _manager; } }
return expfcls.newInstance(); } catch (Throwable ex) { throw XelException.Aide.wrap(ex, "Unable to instantiate "+expfcls);
/** Loads function and class definitions from DOM. */ public void load(String prefix, Element root) throws XelException { if (prefix == null || root == null) throw new IllegalArgumentException("null"); if (_mtds != null && _mtds.containsKey(prefix)) throw new XelException("The prefix, "+prefix+", is already used"); try { load0(prefix, Taglibs.load(root)); } catch (Exception ex) { throw XelException.Aide.wrap(ex); } } private void load0(String prefix, TaglibDefinition loaded) {
/** Loads function and class definitions from taglib. */ public void load(String prefix, URL url) throws XelException { try { load0(prefix, Taglibs.load(url)); //load from cache } catch (Exception ex) { throw XelException.Aide.wrap(ex); } } /** Loads function and class definitions from taglib.