/** * Defines a class. This method needs to be synchronized to avoid that the classloader is created * twice. This method delegates the <code>define</code> method invocation to the factory * classloader. * * @param name the qualified name of the class * @param clazz the byte array of the class * @param domain the protection domain of the class * @return the defined class object */ public synchronized Class<? extends Object> defineClass( String name, byte[] clazz, ProtectionDomain domain) { if (!m_useFactoryClassloader) { m_logger.log( Log.WARNING, "A class definition was required even without the factory classloader enabled"); } if (m_classLoader == null) { m_classLoader = new FactoryClassloader(this); } return m_classLoader.defineClass(name, clazz, domain); }
/** * Defines a class. This method needs to be synchronized to avoid that the classloader is created * twice. This method delegate the <code>define</code> method invocation to the factory * classloader. * * @param name the qualified name of the class * @param clazz the byte array of the class * @param domain the protection domain of the class * @return the defined class object */ public synchronized Class defineClass(String name, byte[] clazz, ProtectionDomain domain) { if (m_classLoader == null) { m_classLoader = new FactoryClassloader(); } return m_classLoader.defineClass(name, clazz, domain); }