// XmlLoadable implementation ---------------------------------------------- public void importXml(Element element) throws DeploymentException { // This one is mandatory String p = MetaData.getElementContent(MetaData.getUniqueChild(element, "cache-policy")); try { Class cls = SecurityActions.getContextClassLoader().loadClass(p); Constructor ctor = cls.getConstructor(new Class[] {AbstractInstanceCache.class}); m_cache = (CachePolicy) ctor.newInstance(new Object[] {this}); } catch (Exception x) { throw new DeploymentException("Can't create cache policy", x); } Element policyConf = MetaData.getOptionalChild(element, "cache-policy-conf"); if (policyConf != null) { if (m_cache instanceof XmlLoadable) { try { ((XmlLoadable) m_cache).importXml(policyConf); } catch (Exception x) { throw new DeploymentException("Can't import policy configuration", x); } } } }