The following code illustrates my problem.

        public void testClassCreation()
        {
                Registry registry=RegistryBuilder.constructDefaultRegistry();

                ClassPool pool = new ClassPool(ClassPool.getDefault());
                Class newClass=null;
                try
                {
                        String 
baseClassName="org.apache.tapestry.BaseComponent";
                        Class base=Class.forName(baseClassName);
                        pool.insertClassPath(new ClassClassPath(base));

                        // create the class
                        CtClass baseClass = pool.get(baseClassName);
                        CtClass cc = pool.makeClass("my.Component");
                        cc.setSuperclass(baseClass);
                        
                        // add constructor
                        
cc.addConstructor(CtNewConstructor.skeleton(null,null,cc));
                        
                        // make sure the new class can be found by others
                        
newClass=cc.toClass(registry.getClass().getClassLoader());
                } catch (Exception e) {
                        e.printStackTrace();
                }
                
                ClassFactory  
classFactory=(ClassFactory)registry.getService("hivemind.ClassFactory",ClassFactory.class);
                classFactory.newClass("my.other.Component",newClass);           
        }

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to