Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 47868 invoked from network); 1 Feb 2002 16:47:59 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 1 Feb 2002 16:47:59 -0000 Received: (qmail 28054 invoked by uid 97); 1 Feb 2002 16:47:51 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@jakarta.apache.org Received: (qmail 28000 invoked by uid 97); 1 Feb 2002 16:47:51 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 27966 invoked from network); 1 Feb 2002 16:47:50 -0000 Message-ID: <3C5AC6B3.8000300@yahoo.com> Date: Fri, 01 Feb 2002 16:47:47 +0000 From: Paul Hammant User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.7) Gecko/20011221 X-Accept-Language: en-us MIME-Version: 1.0 To: commons-dev@jakarta.apache.org Subject: Re: AltRMI chat (was: [OT] J2EE considered harmful) Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Paulo, >Moving this to the Commons. Please reply only in the commons-dev list. > >Sorry Paul, I meant AspectJ. > >I do not understand the incompatibility between Dynamic proxies and >BeanShell. What is it. > Well unless the interface it is implementing is also in beanshells classpath, beanshell won't know what the hell the object does. With Altrmi the objects are castable, via sleight of hand: This one implements the functionality and isn usable by beanshell ( getMethods() returns real methods ) without any other classes being in the Beanshell classpath. It can narrow to any service anywhere and use it. Peter Donald tells me there is a "enable scripting" method that Rhino likes to see in Java objects, but that's a step away from the dream IMHO. public class AltrmiGeneratedPersonFactory_Main implements org.apache.commons.altrmi.client.AltrmiProxy{ private transient org.apache.commons.altrmi.client.impl.BaseServedObject mBaseServedObject; public AltrmiGeneratedPersonFactory_Main (org.apache.commons.altrmi.client.impl.BaseServedObject baseServedObject) { mBaseServedObject = baseServedObject; } public org.enterpriseobjectbroker.examples.example1.interfaces.Person newPerson () { Object[] args = new Object[0]; try { Object retVal = mBaseServedObject.altrmiProcessObjectRequestGettingFacade("newPerson()",args,"org$enterpriseobjectbroker$examples$example1$interfaces$Person"); return (org.enterpriseobjectbroker.examples.example1.interfaces.Person) retVal; } catch (Throwable t) { if (t instanceof RuntimeException) { throw (RuntimeException) t; } else if (t instanceof Error) { throw (Error) t; } else { throw new org.apache.commons.altrmi.common.AltrmiInvocationException("Should never get here" + t.getMessage()); } } } } This one extends the first and allows it to be cast and used nearly perfectly on the client side by a true Java application (rather than a scripting env). public final class AltrmiGenerated2PersonFactory_Main extends AltrmiGeneratedPersonFactory_Main implements org.enterpriseobjectbroker.examples.example1.interfaces.PersonFactory { public AltrmiGenerated2PersonFactory_Main (org.apache.commons.altrmi.client.impl.BaseServedObject baseServedObject) { super(baseServedObject); } } >Did you try pnuts? I already found a documented way to run a pnuts >compiled class, although it demands the presence of some Runtime >support classes. > >Anyway, with pnuts you can generate/compile code in memory. > Actually no, I've not really looked at pnuts beyond its webdocs before, though it has been mentioned to me. If it can do the above, then I can use it. To be honest, I can leave it till later cos it works now and is easy to maintain at the moment. Perfection later. You interested in joining the EOB effort on sourceforge? All people are equal, Apache merit rules etc. Smart minds required. Regards, - Paul H -- To unsubscribe, e-mail: For additional commands, e-mail: