cvs commit: jakarta-commons-sandbox/threadpool/src/java/org/apache/commons/threadpool CommonsLoggingThreadPoolMonitor.java NullThreadPoolMonitor.java ThreadPoolMonitor.java DefaultThreadPool.java
hammant 2003/11/09 04:18:19 Modified:threadpool/src/java/org/apache/commons/threadpool DefaultThreadPool.java Added: threadpool/src/java/org/apache/commons/threadpool CommonsLoggingThreadPoolMonitor.java NullThreadPoolMonitor.java ThreadPoolMonitor.java Log: Monitor added. Revision ChangesPath 1.3 +22 -18 jakarta-commons-sandbox/threadpool/src/java/org/apache/commons/threadpool/DefaultThreadPool.java Index: DefaultThreadPool.java === RCS file: /home/cvs/jakarta-commons-sandbox/threadpool/src/java/org/apache/commons/threadpool/DefaultThreadPool.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- DefaultThreadPool.java13 Oct 2003 08:32:59 - 1.2 +++ DefaultThreadPool.java9 Nov 2003 12:18:19 - 1.3 @@ -61,10 +61,7 @@ */ package org.apache.commons.threadpool; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -/** +/** * A default implementation of a ThreadPool * which is constructed with a given number of threads. * @@ -74,26 +71,39 @@ public class DefaultThreadPool implements Runnable, ThreadPool { /** The Log to which logging calls will be made. */ -private Log log = LogFactory.getLog(DefaultThreadPool.class); private MTQueue queue = new MTQueue(); private boolean stopped = false; +private final ThreadPoolMonitor monitor; + +public DefaultThreadPool(ThreadPoolMonitor monitor, + int numberOfThreads, int threadPriority) { +this.monitor = monitor; +for ( int i = 0; i numberOfThreads; i++ ) { +startThread(threadPriority); +} +} + +public DefaultThreadPool(ThreadPoolMonitor monitor, + int numberOfThreads) { +this.monitor = monitor; +for ( int i = 0; i numberOfThreads; i++ ) { +startThread(); +} +} public DefaultThreadPool() { +this.monitor = new CommonsLoggingThreadPoolMonitor(); // typically a thread pool should have at least 1 thread startThread(); } public DefaultThreadPool(int numberOfThreads) { -for ( int i = 0; i numberOfThreads; i++ ) { -startThread(); -} +this(new CommonsLoggingThreadPoolMonitor(), numberOfThreads); } public DefaultThreadPool(int numberOfThreads, int threadPriority) { -for ( int i = 0; i numberOfThreads; i++ ) { -startThread(threadPriority); -} +this(new CommonsLoggingThreadPoolMonitor(), numberOfThreads, threadPriority); } /** Start a new thread running */ @@ -146,15 +156,9 @@ task.run(); } catch (Throwable t) { -handleException(t); +monitor.handleThrowable(this.getClass(), task, t); } } } -} - -// Implementation methods -//- -protected void handleException(Throwable t) { -log.error( Caught: + t, t ); } } 1.1 jakarta-commons-sandbox/threadpool/src/java/org/apache/commons/threadpool/CommonsLoggingThreadPoolMonitor.java Index: CommonsLoggingThreadPoolMonitor.java === /* * $Header: /home/cvs/jakarta-commons-sandbox/threadpool/src/java/org/apache/commons/threadpool/CommonsLoggingThreadPoolMonitor.java,v 1.1 2003/11/09 12:18:19 hammant Exp $ * $Revision: 1.1 $ * $Date: 2003/11/09 12:18:19 $ * * * * The Apache Software License, Version 1.1 * * Copyright (c) 1999-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. The end-user documentation included with the redistribution, if *any, must include the following acknowlegement: * This product includes software developed by the *Apache Software Foundation (http://www.apache.org
Re: sandbox/ThreadPool change pending
Folks, I have commit access, but not inclination without discussion, to make some changes to sandbox/threadpool... Basically, I'd like make a _backwards_ _compatible_ change to ThreadPool that allows the user to choose not not in any way use Commons-Logging. As in not depend on the jar. The default operation would be to use commons logging of course, thus making this backwards compatible. The idea is best documented here by Leo Sutic :- http://nagoya.apache.org/wiki/apachewiki.cgi?AvalonNoLogging Note the change I have ready is not introducing a dependancy on Avalon or any other package to the codebase. Applied. - Paul -- http://www.thoughtworks.com - The art of heavy lifting. Home for many Agile practicing, Open Source activists... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: sandbox/ThreadPool change pending
I'll attach the source/patch to a following email. This one hopefully -- http://www.thoughtworks.com - The art of heavy lifting. Home for many Agile practicing, Open Source activists... tp.zip Description: Zip archive - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [VOTE] promote commons attributes to the commons proper
Jon, Paul - this is all seeming a little painful to make useful progress working within Jakarta Commons. Adding 1 non-apache committer to a sandbox project seems too hard right now - we're stuck in a chicken and egg - some don't want non-apache committers working in the sandbox and some don't want us promoting a project to commons proper so we can add a new committer. Why don't we just scrap commons-attributes in the sandbox and move the project over to codehaus.org instead? Its certainly the easiest option. We're using commons-attributes in AltRMI (Incubator). To switch and use a codehaus module is that OK politically? The solution is certainly viable though. The loss to Apache would be large. Cannot we try to persuade people here that the catch-22 is worth overcoming? - Paul __ Yahoo! Plus - For a better Internet experience http://uk.promotions.yahoo.com/yplus/yoffer.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [VOTE] promote commons attributes to the commons proper
+100. Count me in for coding, infrasctucture, encouragement and enthusiasm! Here's for one day seeing Nanning itself at Jakarta too (By way of Incubator of course). - Paul So that we can add some more committers to the commons-attributes projects to help unify the various attribute-replated projects out there (initially commons-attributes and Nanning but maybe eventually attrib4j too) I'd like to propose we promote commons-attributes to the commons proper. Then we can work on merging the code bases and patches and working towards an alpha release. __ Yahoo! Plus - For a better Internet experience http://uk.promotions.yahoo.com/yplus/yoffer.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Commons-Attributes (sandbox) and Jon Tirsén.
Jon has been working on attributes inside Nanning's CVS. The code we have (which is really) good is an earlier fork of that. Is there any way we can get Jon commit provs here? The version in Nanning is much more advanced than the version he donated to us earlier. If we can get some consensus, I think a vote may be a good idea. Surely he must qualify on the multi-month patch donator principle? - Paul __ Yahoo! Plus - For a better Internet experience http://uk.promotions.yahoo.com/yplus/yoffer.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re:_Commons-Attributes_(sandbox)_and_Jon_Tirsén.
Well I volunteer to help this get promoted out of sandbox. I've done work on it before (pairing with James Strachan - which he never committed - grumble grumble ;) Jon, that sound good to you ? - Paul --- robert burrell donkin [EMAIL PROTECTED] wrote: i'm against nominating committers for work on sandbox components. (apache committers should just be able to request karma and then check with the current committers that it's ok to join the fun.) if jon is an existing apache committer then he needs to post a request to the pmc cc'ing commons-dev giving some brief indications of his plans. we should then be able to sort out karma with infrastructure. IMHO if jon is not then the best solution would be for an existing apache committer to volunteer (yourself, maybe) to lead an effort to push attributes forward to a stage where it's ready for promotion to the common proper. BTW are there any copyright issues associated with the Nanning code? - robert On Sunday, June 8, 2003, at 11:33 AM, Paul Hammant wrote: Jon has been working on attributes inside Nanning's CVS. The code we have (which is really) good is an earlier fork of that. Is there any way we can get Jon commit provs here? The version in Nanning is much more advanced than the version he donated to us earlier. If we can get some consensus, I think a vote may be a good idea. Surely he must qualify on the multi-month patch donator principle? - Paul __ Yahoo! Plus - For a better Internet experience http://uk.promotions.yahoo.com/yplus/yoffer.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Yahoo! Plus - For a better Internet experience http://uk.promotions.yahoo.com/yplus/yoffer.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: _Commons-Attributes_(sandbox)_and_Jon_Tirsén.
Jon, My aim would be to see a merge of both forks of your work. Granted we have done work here, but then so have you. JSK 1.5 is not somthing I'd stop work here for. Nor would I think it is compelling to merge all OSS attrtibutes efforts. As I think is you opinion, lets just go for a update to c-a with nanning's features. Diversity, and multiple choices are great. QDox and XDoclet both exist for different niches, and high respect for each other. - Paul --- Jon Tirsén [EMAIL PROTECTED] wrote: Why implement something that's JSR175-compliant? That's gonna be part of JDK1.5 anyway. Besides it's probably not doable since it requires a language-change. Attrib4J and JSR175 has tons of extra stuff where I've always seen commons-attributes (and Nanning) as extremely simplistic, ie named attributes whose values are strings. In my experience this has been very useful and for a very small price-tag (both when it comes to learning the API, and of course implementing it). I don't see the point of putting commons-attributes in this direction (but it's not my decision to make). Why not just do it in attrib4j which has that intent? If it necessarily has to be a Jakarta-project why not start another one? On Sun, 2003-06-08 at 14:48, Ryan Hoegg wrote: I have e-mailed briefly with Mark Pollack of attrib4j.sourceforge.net. It seems some work needs to be done to support JSR175 for both commons-attributes and attrib4j. The main difference Jon and Mark have so far is the Attribute interface, where Mark would rather not have String properties for Name and Value. One interesting thing about attrib4j is that it stores its attributes in the class file instead of a separate properties file. I think that since the attribute storage mechanism is already abstracted in the current commons-attributes through the DefaultAttributeFinder and DefaultAttributeCompiler, it would make sense to agree on a common interface and create multiple implementations. I am currently a committer on ws.apache.org/xmlrpc. Can I help? -- Ryan Hoegg ISIS Networks http://www.isisnetworks.net Paul Hammant wrote: Well I volunteer to help this get promoted out of sandbox. I've done work on it before (pairing with James Strachan - which he never committed - grumble grumble ;) Jon, that sound good to you ? - Paul --- robert burrell donkin [EMAIL PROTECTED] wrote: i'm against nominating committers for work on sandbox components. (apache committers should just be able to request karma and then check with the current committers that it's ok to join the fun.) if jon is an existing apache committer then he needs to post a request to the pmc cc'ing commons-dev giving some brief indications of his plans. we should then be able to sort out karma with infrastructure. IMHO if jon is not then the best solution would be for an existing apache committer to volunteer (yourself, maybe) to lead an effort to push attributes forward to a stage where it's ready for promotion to the common proper. BTW are there any copyright issues associated with the Nanning code? - robert On Sunday, June 8, 2003, at 11:33 AM, Paul Hammant wrote: Jon has been working on attributes inside Nanning's CVS. The code we have (which is really) good is an earlier fork of that. Is there any way we can get Jon commit provs here? The version in Nanning is much more advanced than the version he donated to us earlier. If we can get some consensus, I think a vote may be a good idea. Surely he must qualify on the multi-month patch donator principle? - Paul __ Yahoo! Plus - For a better Internet experience http://uk.promotions.yahoo.com/yplus/yoffer.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Yahoo! Plus - For a better Internet experience http://uk.promotions.yahoo.com/yplus/yoffer.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Attributes] dependancy on Logging
Hi folks, Can we consider one of two solutions for this _single_ use of commons logging 1) Removal of the commons-logging from attributes? 2) Backwards compatible rework that will allow the application to run without commons logging in the classpath (or classloader tree for complex deployments). Can I have some opinions here, or should I just dive in, make a change and wait for the flak? Regards, - Paul Folks, In Attributes.java, there is a single use of commons logging : public static AttributeFinder getAttributeFinder() { } catch (Exception e) { logger.warn(failed to initialize specified implementation + of AttributeFinder, using default, e); } } Is there a chance that we could eliminate this use given that the system recovers with the instantiation of a default AttributeFinder ? It would be really useful :-) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Attributes] dependancy on Logging
Juozas, Can we consider one of two solutions for this _single_ use of commons logging 1) Removal of the commons-logging from attributes? 2) Backwards compatible rework that will allow the application to run without commons logging in the classpath (or classloader tree for complex deployments). I undersatnd this single use is not pragmatic, do you have problems with classloading in logging ? I have promissed to fix class loading in this component, it depends on ThreadContext classloader and it was a problem with this strategy in phoenix a year ago. logging works on phoenix at this time, does not it ? My problem is simple, I do not want to have to distribute commons-logging for because attributes depends on it. I do not want to distribute it becuase it will never get called. It is a compilation dependency only. - Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Attributes] dependancy on Logging
Juozas, Why does people get in to trouble when depending on ThreadContext classloader which is the correct way to load classes with (if one want to be container friendly :) Depending on ThreadContext classloader will work if the container follows the spec - and if there are no TCL, then use class.forname - but remmeber to do it from a method/class that is loaded with your classes own classloader /max I do not like this kind of workarounds too, but some containers heve problems with this, I do not have any problems myself, but there are a lot reports from users. Possible some users have problems to configure container and workarounds will not help. You guys chat amongst yourselves if you like. I don't want to use common logging for a _single_ (nearly-never-called) warning. That is my reason, and nothing to do with context-classloader. Regards, - Paul H - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Attributes] dependancy on Logging
Folks, In Attributes.java, there is a single use of commons logging : public static AttributeFinder getAttributeFinder() { } catch (Exception e) { logger.warn(failed to initialize specified implementation + of AttributeFinder, using default, e); } } Is there a chance that we could eliminate this use given that the system recovers with the instantiation of a default AttributeFinder ? It would be really useful :-) Regards, - Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [logging] Need interface...
Costin, What we need is a marker interface that indicates a tool wants a logger, and of course a method to give it the logger... I did a quick scan of the public API, and there doesn't seem to be one. So what I propose is to add an interface 'LogUser' or something like it (we can quibble about the name...) public interface LogUser { public void setCommonsLogger(Log log) } In other words, you also want a 'push' model for the logger. Curently each component is supposed to 'pull' the logger. Not wishing to be political, just to furnish you with info, the 'push' model is described as 'Inversion of Control' -- http://jakarta.apache.org/avalon/framework/inversion-of-control.html - Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/armi README.txt
hammant 02/04/03 19:52:01 Removed: armi README.txt Log: remove readme as the notice has existed ten times longer than the project did as'armi' -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test BeepClientTest.java BeepServerTest.java CodedProxyTest.java DirectMarshalledTest.java DirectTest.java DynamicProxy.java DynamicProxyTest.java MemoryLeak.java MemoryLeakClientTest.java MemoryLeakImpl.java MemoryLeakServerTest.java PipeTest.java ProConClientTest.java ProConServerTest.java RmiClientTest.java RmiServerTest.java SocketClientTest.java SocketClientTestJNDI.java SocketServerTest.java TestClient.java TestConsumer.java TestConsumerImpl.java TestInterface.java TestInterface2.java TestInterface2Impl.java TestInterfaceImpl.java TestObject.java TestProvider.java TestProviderImpl.java UnProxyTest.java
hammant 02/04/03 19:54:41 Modified:altrmi PROPOSAL Removed: altrmi LICENSE README.txt build.xml memleak.xml tests.xml tests2.xml altrmi/src/conf MANIFEST-client-impl.MF MANIFEST-client-interfaces.MF MANIFEST-common.MF MANIFEST-generator.MF MANIFEST-server-impl.MF MANIFEST-server-interfaces.MF altrmi/src/java/org/apache/commons/altrmi/client AltrmiClientInvocationHandler.java AltrmiConnectionListener.java AltrmiConnectionPinger.java AltrmiFactory.java AltrmiHostContext.java AltrmiInterfaceLookup.java AltrmiInterfaceLookupFactory.java AltrmiProxy.java altrmi/src/java/org/apache/commons/altrmi/client/impl AbstractAltrmiFactory.java AbstractClientInvocationHandler.java AbstractConnectionPinger.java AbstractFactoryHelper.java AbstractHostContext.java AbstractInterfaceLookupFactory.java BaseServedObject.java ClientClassAltrmiFactory.java DefaultConnectionListener.java DefaultConnectionPinger.java DefaultInterfaceLookupFactory.java PerpetualConnectionPinger.java ServerClassAltrmiFactory.java TransportedClassLoader.java altrmi/src/java/org/apache/commons/altrmi/client/impl/beep BEEPHostContext.java BEEPInvocationHandler.java altrmi/src/java/org/apache/commons/altrmi/client/impl/direct AbstractDirectInvocationHandler.java DirectHostContext.java DirectInvocationHandler.java DirectMarshalledHostContext.java DirectMarshalledInvocationHandler.java altrmi/src/java/org/apache/commons/altrmi/client/impl/multiple AbstractMultipleHostContext.java AbstractMultipleInvocationHandler.java RotatingMultipleHostContext.java RotatingMultipleInvocationHandler.java altrmi/src/java/org/apache/commons/altrmi/client/impl/naming DefaultAltrmiContext.java DefaultAltrmiInitialContextFactory.java altrmi/src/java/org/apache/commons/altrmi/client/impl/piped AbstractPipedStreamInvocationHandler.java PipedCustomStreamInvocationHandler.java PipedObjectStreamHostContext.java PipedObjectStreamInvocationHandler.java altrmi/src/java/org/apache/commons/altrmi/client/impl/rmi RmiFactoryHelper.java RmiHostContext.java RmiInvocationHandler.java altrmi/src/java/org/apache/commons/altrmi/client/impl/socket AbstractSocketStreamInvocationHandler.java SocketCustomStreamFactoryHelper.java SocketCustomStreamHostContext.java SocketCustomStreamInvocationHandler.java SocketObjectStreamFactoryHelper.java SocketObjectStreamHostContext.java SocketObjectStreamInvocationHandler.java altrmi/src/java/org/apache/commons/altrmi/client/impl/stream ClientCustomStreamReadWriter.java ClientObjectStreamReadWriter.java ClientStreamReadWriter.java StreamInvocationHandler.java altrmi/src/java/org/apache/commons/altrmi/common AbstractMethodHandler.java AltrmiAuthentication.java AltrmiAuthenticationException.java AltrmiConnectionClosedException.java AltrmiConnectionException.java AltrmiInvocationException.java AltrmiInvocationHandler.java AltrmiMarshalledInvocationHandler.java AltrmiReply.java AltrmiRequest.java ClassLoaderObjectInputStream.java ClassReply.java ClassRequest.java ClassRetrievalFailedReply.java EndConnectionReply.java ExceptionReply.java FacadeRefHolder.java GarbageCollectionReply.java GarbageCollectionRequest.java KeyAuthentication.java ListReply.java ListRequest.java LookupReply.java LookupRequest.java
cvs commit: jakarta-commons-sandbox/altrmi/lib avalon-framework-4.1.2.jar beepcore.jar
hammant 02/04/03 19:56:43 Removed: altrmi/lib avalon-framework-4.1.2.jar beepcore.jar Log: remove jars not needed after major package refactor -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/classretrievers PlainClassRetriever.java
hammant 02/04/02 14:04:49 Modified:altrmi/src/java/org/apache/commons/altrmi/server/impl/classretrievers PlainClassRetriever.java Log: Patch for null stream from Vinay Revision ChangesPath 1.4 +5 -6 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/classretrievers/PlainClassRetriever.java Index: PlainClassRetriever.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/classretrievers/PlainClassRetriever.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- PlainClassRetriever.java 27 Jan 2002 15:47:40 - 1.3 +++ PlainClassRetriever.java 2 Apr 2002 22:04:49 - 1.4 @@ -20,7 +20,8 @@ * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version $Revision: 1.3 $ + * @author Vinay Chandrasekharan a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a + * @version $Revision: 1.4 $ */ public class PlainClassRetriever extends AbstractClassRetriever { @@ -50,11 +51,9 @@ InputStream is = null; -try { -is = mClassLoader.getResourceAsStream(thingName); -} catch (Exception e) { -throw new ClassRetrievalException( -Generated class not found in classloader specified : + e.getMessage()); +is = mClassLoader.getResourceAsStream(thingName); +if(is==null) { +throw new ClassRetrievalException(Generated class for +thingName+ not found in specified classloader ); } ByteArrayOutputStream baos = new ByteArrayOutputStream(); -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: [ALTRMI] ClassRetriever patch
Vinay, Applied, thanks dude. - Paul Paul, Patch to generate the exception correctly from classretrievers. [ getResourceStream does NOT raise any exception but returns a 'null' InputStream on failure to find a resource ] Regards, V i n a y -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test MemoryLeakClientTest.java MemoryLeakImpl.java
hammant 02/04/01 01:10:42 Modified:altrmi/src/java/org/apache/commons/altrmi/test MemoryLeakClientTest.java MemoryLeakImpl.java Log: small changes to readability of memleak test Revision ChangesPath 1.5 +14 -3 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test/MemoryLeakClientTest.java Index: MemoryLeakClientTest.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test/MemoryLeakClientTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- MemoryLeakClientTest.java 31 Mar 2002 21:24:29 - 1.4 +++ MemoryLeakClientTest.java 1 Apr 2002 09:10:42 - 1.5 @@ -19,6 +19,7 @@ import org.apache.commons.altrmi.client.impl.ClientClassAltrmiFactory; import java.io.IOException; +import java.util.Vector; /** @@ -26,7 +27,7 @@ * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version $Revision: 1.4 $ + * @version $Revision: 1.5 $ */ public class MemoryLeakClientTest { @@ -39,10 +40,20 @@ */ public MemoryLeakClientTest(MemoryLeak ml) { +// if you enable the vector, then serverside +// memory usage ramps as MemoryLeak instances +// are not garbage collected. +//Vector v = new Vector(); + long start = System.currentTimeMillis(); for (int i = 0; i 1; i++) { -MemoryLeak tmpMl = ml.getNewMemoryLeak(); -ml.getHugeString(); // this does not seem to affect speed. +//v.add(ml); +ml = ml.getNewMemoryLeak(); +// this seems to halve the speed. +// but also is proven to be GC'd well for +// custom stream. For ObjectStream it is +// a different measure. +//ml.getHugeString(); System.gc(); // pointless ? if (i%100 == 0) { 1.4 +6 -11 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test/MemoryLeakImpl.java Index: MemoryLeakImpl.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test/MemoryLeakImpl.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- MemoryLeakImpl.java 31 Mar 2002 21:24:29 - 1.3 +++ MemoryLeakImpl.java 1 Apr 2002 09:10:42 - 1.4 @@ -15,11 +15,10 @@ * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version $Revision: 1.3 $ + * @version $Revision: 1.4 $ */ public class MemoryLeakImpl implements MemoryLeak { -private String mHugeStr = ; /** * Constructor MemoryLeakImpl @@ -27,14 +26,6 @@ * */ MemoryLeakImpl() { - -StringBuffer sb = new StringBuffer(); - -for (int i = 0; i 1000; i++) { -sb.append( + i); -} - -mHugeStr = sb.toString(); } /** @@ -59,7 +50,11 @@ * */ public String getHugeString() { -return mHugeStr; +StringBuffer sb = new StringBuffer(); +for (int i = 0; i 1000; i++) { +sb.append( + i); +} +return sb.toString(); } protected void finalize() throws Throwable { -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: [ALTRMI] ProxyGenerator patch
Vinay, No I think all of them dude Thats is what interfaces are all about yes? If you want to hide methods have them in different interfaces, and don't extend from them..? - Paul Paul, We should generate proxies for calls declared in the remote interface ONLY , and should NOT generate calls in proxies for methods inherited from the base interface(or class) . Am I right ..? [See attached patch ] Regards, V i n a y Index: ProxyGeneratorImpl.java === RCS file: /home/cvspublic/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/generator/ProxyGeneratorImpl.java,v retrieving revision 1.12 diff -r1.12 ProxyGeneratorImpl.java 252c252 Method[] methods = clazz.getMethods(); --- Method[] methods = clazz.getDeclaredMethods(); __ Do You Yahoo!? Yahoo! Movies - coverage of the 74th Academy Awards® http://movies.yahoo.com/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test MemoryLeakClientTest.java MemoryLeakImpl.java TestInterfaceImpl.java
hammant 02/03/31 13:24:29 Modified:altrmi/src/java/org/apache/commons/altrmi/server MethodInvocationHandler.java altrmi/src/java/org/apache/commons/altrmi/server/impl DefaultMethodInvocationHandler.java altrmi/src/java/org/apache/commons/altrmi/server/impl/adapters InvocationHandlerAdapter.java PublicationAdapter.java altrmi/src/java/org/apache/commons/altrmi/test MemoryLeakClientTest.java MemoryLeakImpl.java TestInterfaceImpl.java Added: altrmi/src/java/org/apache/commons/altrmi/server/impl AltrmiSession.java Log: Distributed Garbage Collection is working ... but still leaking a little memory. Revision ChangesPath 1.3 +15 -15 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/MethodInvocationHandler.java Index: MethodInvocationHandler.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/MethodInvocationHandler.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- MethodInvocationHandler.java 30 Mar 2002 08:55:45 - 1.2 +++ MethodInvocationHandler.java 31 Mar 2002 21:24:28 - 1.3 @@ -8,9 +8,8 @@ */ package org.apache.commons.altrmi.server; - - -import org.apache.commons.altrmi.common.AltrmiInvocationHandler; +import org.apache.commons.altrmi.common.AltrmiReply; +import org.apache.commons.altrmi.common.MethodRequest; /** @@ -18,9 +17,20 @@ * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ */ -public interface MethodInvocationHandler extends AltrmiInvocationHandler { +public interface MethodInvocationHandler { + +/** + * Method handleMethodInvocation + * + * + * @param request + * + * @return + * + */ +AltrmiReply handleMethodInvocation(MethodRequest request); /** * Method addImplementationBean @@ -50,14 +60,4 @@ * */ Long getOrMakeReferenceIDForBean(Object implBean); - -/** - * Method garbageCollectionRequest - * - * - * @param sessionID - * @param refereinceID - * - */ -void garbageCollectionRequest(Long sessionID, Long refereinceID); } 1.7 +33 -32 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/DefaultMethodInvocationHandler.java Index: DefaultMethodInvocationHandler.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/DefaultMethodInvocationHandler.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- DefaultMethodInvocationHandler.java 30 Mar 2002 08:55:45 - 1.6 +++ DefaultMethodInvocationHandler.java 31 Mar 2002 21:24:28 - 1.7 @@ -26,9 +26,11 @@ import java.util.HashMap; import java.util.Iterator; import java.util.Collection; +import java.util.WeakHashMap; import java.lang.reflect.Method; import java.lang.reflect.InvocationTargetException; +import java.lang.ref.WeakReference; import java.io.Serializable; @@ -39,16 +41,17 @@ * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a * @author Vinay Chandrasekharan a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version $Revision: 1.6 $ + * @version $Revision: 1.7 $ */ public class DefaultMethodInvocationHandler implements MethodInvocationHandler { -private HashMap mRefBeans = new HashMap(); -private HashMap mBeanRefs = new HashMap(); +private WeakHashMap mRefBeans = new WeakHashMap(); +private WeakHashMap mBeanRefs = new WeakHashMap(); private HashMap mMethodMap; private static int NEXT_REFERENCE = 1; private AltrmiPublisher mAltrmiPublisher; private String mPublishedThing; +private Object mBeanImpl; /** * Constructor DefaultMethodInvocationHandler @@ -76,7 +79,7 @@ * */ public String toString() { -return DIH: + mPublishedThing; +return DMIH: + mPublishedThing; } /** @@ -88,7 +91,11 @@ * */ public void addImplementationBean(Long referenceID, Object beanImpl) { -mRefBeans.put(referenceID, beanImpl); +if (referenceID.equals(new Long(0))) { +mBeanImpl = beanImpl; +} +WeakReference wr = new WeakReference(beanImpl); +mRefBeans.put
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl StreamServerConnection.java
hammant 02/03/29 01:03:22 Modified:altrmi/src/java/org/apache/commons/altrmi/server/impl StreamServerConnection.java Log: Fix NPE during broken connection (from Leif Mortenson) Revision ChangesPath 1.10 +6 -5 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/StreamServerConnection.java Index: StreamServerConnection.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/StreamServerConnection.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- StreamServerConnection.java 13 Mar 2002 08:30:30 - 1.9 +++ StreamServerConnection.java 29 Mar 2002 09:03:22 - 1.10 @@ -33,7 +33,7 @@ * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version $Revision: 1.9 $ + * @version $Revision: 1.10 $ */ public abstract class StreamServerConnection implements Runnable, AltrmiServerConnection, LogEnabled { @@ -95,10 +95,11 @@ } catch (IOException ioe) { more = false; if (ioe instanceof SocketException -| ioe.getClass().getName().equals(java.net.SocketTimeoutException) -| ioe instanceof InterruptedIOException -| ioe.getMessage().equals(Write end dead) -| ioe.getMessage().equals(Pipe broken)) { +|| ioe.getClass().getName().equals(java.net.SocketTimeoutException) +|| ioe instanceof InterruptedIOException +|| (ioe.getMessage() != null + (ioe.getMessage().equals(Write end dead) +|| ioe.getMessage().equals(Pipe broken { // TODO implement implementation indepandant logger mLogger.info(One Connection closed.); } else { -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/generator/ant AltrmiProxyTask.java
hammant 02/03/29 03:55:13 Modified:altrmi/src/java/org/apache/commons/altrmi/generator/ant AltrmiProxyTask.java Log: fixed annoying bug with generating proxies for recently compiled classes. Revision ChangesPath 1.3 +16 -13 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/generator/ant/AltrmiProxyTask.java Index: AltrmiProxyTask.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/generator/ant/AltrmiProxyTask.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- AltrmiProxyTask.java 28 Mar 2002 16:51:23 - 1.2 +++ AltrmiProxyTask.java 29 Mar 2002 11:55:13 - 1.3 @@ -30,7 +30,7 @@ * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ */ public class AltrmiProxyTask extends Task { @@ -203,10 +203,10 @@ throw new BuildException(Specify the name to use for lookup); } -ProxyGenerator sg; +ProxyGenerator proxyGenerator; try { -sg = (ProxyGenerator) Class +proxyGenerator = (ProxyGenerator) Class .forName(org.apache.commons.altrmi.generator.ProxyGeneratorImpl).newInstance(); } catch (Exception e) { e.printStackTrace(); @@ -215,21 +215,23 @@ } try { -sg.setSrcGenDir(mSrcGenDir.getAbsolutePath()); -sg.setClassGenDir(mClassGenDir.getAbsolutePath()); -sg.setGenName(mGenName); -sg.verbose(Boolean.valueOf(mVerbose).booleanValue()); -sg.setClasspath(mClasspath.concatSystemClasspath(ignore).toString()); +proxyGenerator.setSrcGenDir(mSrcGenDir.getAbsolutePath()); +proxyGenerator.setClassGenDir(mClassGenDir.getAbsolutePath()); +proxyGenerator.setGenName(mGenName); +proxyGenerator.verbose(Boolean.valueOf(mVerbose).booleanValue()); + proxyGenerator.setClasspath(mClasspath.concatSystemClasspath(ignore).toString()); Class[] interfacesToExpose = new Class[mInterfacesToExpose.length]; +ClassLoader cLoader = new AntClassLoader(getProject(), mClasspath); + for (int i = 0; i mInterfacesToExpose.length; i++) { String cn = mInterfacesToExpose[i]; -interfacesToExpose[i] = Class.forName(cn); +interfacesToExpose[i] = cLoader.loadClass(cn); } -sg.setInterfacesToExpose(interfacesToExpose); +proxyGenerator.setInterfacesToExpose(interfacesToExpose); if (mAdditionalFacades != null) { Class[] additionalFacades = new Class[mAdditionalFacades.length]; @@ -240,7 +242,7 @@ additionalFacades[i] = Class.forName(cn); } -sg.setAdditionalfacades(additionalFacades); +proxyGenerator.setAdditionalfacades(additionalFacades); } ClassLoader cL = null; @@ -251,9 +253,10 @@ cL = this.getClass().getClassLoader(); } -sg.generateSrc(cL); -sg.generateClass(cL); +proxyGenerator.generateSrc(cL); +proxyGenerator.generateClass(cL); } catch (ClassNotFoundException cnfe) { +cnfe.printStackTrace(); throw new BuildException(Class not found : + cnfe.getMessage()); } catch (ProxyGenerationException sge) { throw new BuildException(Proxy Gerneation error : + sge.getMessage()); -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/generator ProxyGeneratorImpl.java
hammant 02/03/29 22:40:51 Modified:altrmi/src/java/org/apache/commons/altrmi/generator ProxyGeneratorImpl.java Log: classloading fix from Vinay Revision ChangesPath 1.12 +2 -2 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/generator/ProxyGeneratorImpl.java Index: ProxyGeneratorImpl.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/generator/ProxyGeneratorImpl.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- ProxyGeneratorImpl.java 27 Mar 2002 21:12:33 - 1.11 +++ ProxyGeneratorImpl.java 30 Mar 2002 06:40:51 - 1.12 @@ -33,7 +33,7 @@ * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a * @author Mike Miller of www.gac.com - * @version $Revision: 1.11 $ + * @version $Revision: 1.12 $ */ public class ProxyGeneratorImpl extends AbstractMethodHandler implements ProxyGenerator { @@ -561,7 +561,7 @@ } for (int p = 0; p mAdditionalFacades.length; p++) { -if (clazz.equals(mAdditionalFacades[p])) { +if (clazz.getName().equals(mAdditionalFacades[p].getName())) { return true; } else if (clazz.getName().equals([L + mAdditionalFacades[p].getName() + ;)) { return true; -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: [ALTRMI] ProxyGenerator fix
Vinay, Applied. Thanks for that dude. - Paul Paul, The classloader fix sent proxy generation for a toss. :-) (we were using Class.equals(Class) . both loaded by diff classloader's) Here is the fix ... Regards, V i n a y Index: src/java/org/apache/commons/altrmi/generator/ProxyGeneratorImpl.java === RCS file: /home/cvspublic/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/generator/ProxyGeneratorImpl.java,v retrieving revision 1.11 diff -r1.11 ProxyGeneratorImpl.java 564c564 if (clazz.equals(mAdditionalFacades[p])) { --- if (clazz.getName().equals(mAdditionalFacades[p].getName())) { __ Do You Yahoo!? Yahoo! Greetings - send holiday greetings for Easter, Passover http://greetings.yahoo.com/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl AbstractAltrmiFactory.java BaseServedObject.java
hammant 02/03/29 23:49:13 Modified:altrmi/src/java/org/apache/commons/altrmi/client/impl AbstractAltrmiFactory.java BaseServedObject.java Log: Part two of DGC. Suggestions from Vinay Revision ChangesPath 1.17 +2 -23 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/AbstractAltrmiFactory.java Index: AbstractAltrmiFactory.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/AbstractAltrmiFactory.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- AbstractAltrmiFactory.java27 Mar 2002 21:12:33 - 1.16 +++ AbstractAltrmiFactory.java30 Mar 2002 07:49:13 - 1.17 @@ -27,8 +27,6 @@ import java.io.IOException; import java.lang.ref.WeakReference; -import java.lang.ref.ReferenceQueue; -import java.lang.ref.Reference; /** @@ -36,12 +34,11 @@ * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version $Revision: 1.16 $ + * @version $Revision: 1.17 $ */ public abstract class AbstractAltrmiFactory implements AltrmiFactory { protected AbstractHostContext mHostContext; -protected ReferenceQueue mDisposedFacadeQueue = new ReferenceQueue(); protected final HashMap mRefObjs = new HashMap(); private final boolean mBeanOnly; private transient String mTextToSign; @@ -118,7 +115,7 @@ * */ public final void registerReferenceObject(Object obj, Long referenceID) { -mRefObjs.put(referenceID, new WeakReference(obj, mDisposedFacadeQueue)); +mRefObjs.put(referenceID, new WeakReference(obj)); //Object o = mRefObjs.get(referenceID); } @@ -197,22 +194,4 @@ return new String[]{}; } } - -public Long[] getDisposedOfFacades() { -Vector vec = new Vector(); -try { -Reference wr = mDisposedFacadeQueue.remove(0); -while (wr != null) { -AltrmiProxy ap = (AltrmiProxy) wr.get(); -vec.add(ap.altrmiGetReferenceID(this)); -wr = mDisposedFacadeQueue.remove(0); -} -} catch (InterruptedException e) { -// do nothing -} -Long[] deadRefs = new Long[vec.size()]; -vec.copyInto(deadRefs); -return deadRefs; -} - } 1.15 +6 -1 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/BaseServedObject.java Index: BaseServedObject.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/BaseServedObject.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- BaseServedObject.java 27 Mar 2002 21:12:33 - 1.14 +++ BaseServedObject.java 30 Mar 2002 07:49:13 - 1.15 @@ -32,7 +32,7 @@ * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a * @author Vinay Chandrasekharan a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version $Revision: 1.14 $ + * @version $Revision: 1.15 $ */ public final class BaseServedObject { @@ -344,5 +344,10 @@ } else { return null; } +} + +protected void finalize() throws Throwable { +//System.out.println(BO finalizing); +super.finalize(); } } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test MemoryLeak.java MemoryLeakClientTest.java MemoryLeakImpl.java MemoryLeakServerTest.java
hammant 02/03/27 05:32:40 Added: altrmi/src/java/org/apache/commons/altrmi/test MemoryLeak.java MemoryLeakClientTest.java MemoryLeakImpl.java MemoryLeakServerTest.java Log: memory leak tests. Revision ChangesPath 1.1 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test/MemoryLeak.java Index: MemoryLeak.java === /* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE.txt file. */ package org.apache.commons.altrmi.test; public interface MemoryLeak { MemoryLeak getNewMemoryLeak(); } 1.1 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test/MemoryLeakClientTest.java Index: MemoryLeakClientTest.java === /* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE.txt file. */ package org.apache.commons.altrmi.test; import org.apache.commons.altrmi.client.AltrmiHostContext; import org.apache.commons.altrmi.client.AltrmiFactory; import org.apache.commons.altrmi.common.AltrmiConnectionException; import org.apache.commons.altrmi.client.impl.socket.SocketObjectStreamHostContext; import org.apache.commons.altrmi.client.impl.socket.SocketCustomStreamHostContext; import org.apache.commons.altrmi.client.impl.ServerClassAltrmiFactory; import org.apache.commons.altrmi.client.impl.ClientClassAltrmiFactory; import java.io.IOException; /** * Class MemoryLeakClientTest * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a * @version $Revision: 1.1 $ */ public class MemoryLeakClientTest { /** * Constructor MemoryLeakClientTest * * * @param ml * */ public MemoryLeakClientTest(MemoryLeak ml) { long start = System.currentTimeMillis(); for (int i = 0; i 1; i++) { MemoryLeak tmpMl = ml.getNewMemoryLeak(); System.gc(); // pointless ? if (( + i).endsWith(000)) { long end = System.currentTimeMillis(); System.out.println(Iter + i + , + (end-start) / 1000 + seconds, Tot Mem : + Runtime.getRuntime().totalMemory() + , Max Mem : + Runtime.getRuntime().maxMemory() + , Free Mem : + Runtime.getRuntime().freeMemory() ); end = start; } } } /** * Method main * * * @param args * * @throws Exception * */ public static void main(String[] args) throws Exception { System.out.println(Memory Leak Client); AltrmiFactory af = new ClientClassAltrmiFactory(false); af.setHostContext(new SocketCustomStreamHostContext(127.0.0.1, 1277)); MemoryLeak ml = (MemoryLeak) af.lookup(MemLeak); new MemoryLeakClientTest(ml); af.close(); } } 1.1 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test/MemoryLeakImpl.java Index: MemoryLeakImpl.java === /* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE.txt file. */ package org.apache.commons.altrmi.test; public class MemoryLeakImpl implements MemoryLeak { public MemoryLeak getNewMemoryLeak() { System.gc(); // pointless ? return new MemoryLeakImpl(); } } 1.1 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test/MemoryLeakServerTest.java Index: MemoryLeakServerTest.java === /* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE.txt file. */ package
cvs commit: jakarta-commons-sandbox/altrmi memleak.xml
hammant 02/03/27 05:32:56 Added: altrmi memleak.xml Log: Revision ChangesPath 1.1 jakarta-commons-sandbox/altrmi/memleak.xml Index: memleak.xml === project name=Alt (to) RMI default=generate basedir=. !-- Alt (to) RMI component of the Jakarta Commons Subproject $Id: memleak.xml,v 1.1 2002/03/27 13:32:56 hammant Exp $ -- !-- == Initialize Properties = -- property file=build.properties/!-- Component local -- property file=../build.properties/ !-- Commons local -- property file=${user.home}/build.properties/ !-- User local-- !-- == Component Declarations -- !-- The base directory for compilation targets -- property name=build.home value=build/ !-- == Compiler Defaults = -- !-- Should Java compilations set the 'debug' compiler option? -- property name=compile.debug value=true/ !-- Should Java compilations set the 'deprecation' compiler option? -- property name=compile.deprecation value=true/ !-- Should Java compilations set the 'optimize' compiler option? -- property name=compile.optimizevalue=true/ !-- Construct compile classpath -- path id=compile.classpath pathelement location=${build.home}/classes/ /path !-- For running of tests -- path id=testA.classpath pathelement location=${build.home}/classes/ pathelement location=${build.home}/classes2/ pathelement location=lib/avalon-framework-4.1.2.jar/ /path taskdef name=altrmiproxies classname=org.apache.commons.altrmi.generator.ant.AltrmiProxyTask classpath refid=compile.classpath / /taskdef !-- == Executable Targets -- target name=prepare description=Prepare build directory mkdir dir=${build.home}/ mkdir dir=${build.home}/classes2/ delete fileset dir=${build.home}/classes2 includes=* defaultexcludes=no/ /delete mkdir dir=${build.home}/genjava/ delete fileset dir=${build.home}/genjava includes=* defaultexcludes=no/ /delete mkdir dir=${build.home}/genjava2/ delete fileset dir=${build.home}/genjava2 includes=* defaultexcludes=no/ /delete mkdir dir=${build.home}/classes3/ delete fileset dir=${build.home}/classes3 includes=* defaultexcludes=no/ /delete /target target name=generate depends=prepare altrmiproxies genname=MemLeak srcgendir=${build.home}/genjava classgendir=${build.home}/classes2 verbose=true interfaces=org.apache.commons.altrmi.test.MemoryLeak additionalfacades=org.apache.commons.altrmi.test.MemoryLeak classpath pathelement location=${build.home}/classes/ /classpath /altrmiproxies /target target name=server description=Memory Leak test server java classname=org.apache.commons.altrmi.test.MemoryLeakServerTest fork=true classpath refid=testA.classpath/ /java /target target name=client description=Memory Leak test client depends=generate java classname=org.apache.commons.altrmi.test.MemoryLeakClientTest fork=true classpath refid=testA.classpath/ /java /target /project -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
[AltRMI] memory leak
Vinay, ant -buildfile memleak.xml server ant -buildfile memleak.xml client This demo shows a current bug that means that memory is eaten up as more and more pass-by-reference objects are referenced on the client. We'll need to solve this with WeakHashMap (I think). Regards, - Paul H -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl AbstractConnectionPinger.java DefaultConnectionPinger.java PerpetualConnectionPinger.java
hammant 02/03/27 13:51:57 Modified:altrmi/src/java/org/apache/commons/altrmi/client/impl DefaultConnectionPinger.java PerpetualConnectionPinger.java Added: altrmi/src/java/org/apache/commons/altrmi/client/impl AbstractConnectionPinger.java Log: refactoring of pingers Revision ChangesPath 1.5 +4 -82 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/DefaultConnectionPinger.java Index: DefaultConnectionPinger.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/DefaultConnectionPinger.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- DefaultConnectionPinger.java 27 Mar 2002 20:58:24 - 1.4 +++ DefaultConnectionPinger.java 27 Mar 2002 21:51:57 - 1.5 @@ -22,96 +22,18 @@ * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version * $Revision: 1.4 $ + * @version * $Revision: 1.5 $ */ -public class DefaultConnectionPinger implements AltrmiConnectionPinger, Runnable { +public class DefaultConnectionPinger extends AbstractConnectionPinger { -private AltrmiClientInvocationHandler mAltrmiInvocationHandler; -private boolean mContinue = true; -private Thread mThread; -private int mPingInterval; -private int mGiveupInterval; - -/** - * Constructor DefaultConnectionPinger - * - * - * @param pingIntervalSeconds - * @param giveupIntervalSeconds - * - */ public DefaultConnectionPinger(int pingIntervalSeconds, int giveupIntervalSeconds) { -mPingInterval = pingIntervalSeconds * 1000; -mGiveupInterval = giveupIntervalSeconds * 1000; +super(pingIntervalSeconds, giveupIntervalSeconds); } -/** - * Constructor DefaultConnectionPinger - * - * - */ public DefaultConnectionPinger() { -mPingInterval = 10 * 1000; // ten seconds -mGiveupInterval = 100 * 1000;// one hundred seconds. -} - -/** - * Method setAltrmiInvocationHandler - * - * - * - */ -public void setAltrmiInvocationHandler( -AltrmiClientInvocationHandler altrmiInvocationHandler) { -mAltrmiInvocationHandler = altrmiInvocationHandler; -} - -/** - * Method start - * - * - */ -public void start() { - -mThread = new Thread(this); - -mThread.start(); -} - -/** - * Method stop - * - * - */ -public void stop() { - -mContinue = false; -} - -/** - * Method run - * - * - */ -public void run() { - -try { -while (mContinue) { -Thread.sleep(mPingInterval); -ping(); -} -} catch (AltrmiConnectionClosedException cce) { -System.out.println(Pinger Connection closed); - -// no need to ping anymore. -} catch (InterruptedException e) { -System.out.println(Pinger Interrupted!); - -// do nothing. -} } -private void ping() { +protected void ping() { if (mAltrmiInvocationHandler.getLastRealRequest() (System.currentTimeMillis() - (mGiveupInterval))) { mAltrmiInvocationHandler.ping(); 1.2 +6 -40 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/PerpetualConnectionPinger.java Index: PerpetualConnectionPinger.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/PerpetualConnectionPinger.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- PerpetualConnectionPinger.java19 Jan 2002 15:06:58 - 1.1 +++ PerpetualConnectionPinger.java27 Mar 2002 21:51:57 - 1.2 @@ -23,53 +23,19 @@ * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version * $Revision: 1.1 $ + * @version * $Revision: 1.2 $ */ -public class PerpetualConnectionPinger implements AltrmiConnectionPinger, Runnable { +public class PerpetualConnectionPinger extends AbstractConnectionPinger { -private AltrmiClientInvocationHandler mAltrmiInvocationHandler; -private boolean mContinue = true; -private Thread mThread; - - -/** - * Method setAltrmiInvocationHandler - * - * - * - */ -public void setAltrmiInvocationHandler
Re: [Altrmi] Callback iteration
Vinay, This looks good. We will be able to keep the way it is now for people that do not need callback and have the alternate impls for that that need callback enabled. Keep up the good work! I'm about to change references of classOrInterfacesToExpose to interfacesToExpose as that is what we support and the whole design idea behind AltRMI because of our creation of proxies. I will commit the code and replicate it to EOB and Cornerstone, I hope there are not too many implications for your work in progress. Regards, - Paul Paul, Skeleton work on Callback It doesnt actually do the callback(:))) but just mocks the way we can acheive it. I have short-circuited the handling , and thus the tests work fine tooo (can you check the performance drop),only difference being the way data is read from the server. Thoughts ??? (Dont apply these to the CVS ) So does the client side also does a publish(..) call to export its client objects to its invocation handler . What is the deal?? Regards, V i n a y === Index: SocketClientTest.java === RCS file: /home/cvspublic/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test/SocketClientTest.java,v retrieving revision 1.10 diff -r1.10 SocketClientTest.java 13d12 import org.apache.commons.altrmi.client.AltrmiHostContext; 15,18c14 import org.apache.commons.altrmi.common.AltrmiConnectionException; import org.apache.commons.altrmi.client.impl.socket.SocketObjectStreamHostContext; import org.apache.commons.altrmi.client.impl.socket.SocketCustomStreamHostContext; import org.apache.commons.altrmi.client.impl.ServerClassAltrmiFactory; --- import org.apache.commons.altrmi.client.AltrmiHostContext; 20,21c16,21 import java.io.IOException; --- import org.apache.commons.altrmi.client.impl.ServerClassAltrmiFactory; import org.apache.commons.altrmi.client.impl.socket.CallbackEnabledCustomSocketStreamHostContext; import org.apache.commons.altrmi.client.impl.socket.SocketCustomStreamHostContext; import org.apache.commons.altrmi.client.impl.socket.SocketObjectStreamHostContext; import sun.security.krb5.internal.af; import sun.security.krb5.internal.i; 57c57,60 } else { --- } else if(args[1].equals(CallbackEnabledCustomSocketStream)){ System.out.println(Callback Enabled Custom Socket Stream); arhc= new CallbackEnabledCustomSocketStreamHostContext(127.0.0.1,1235); }else { == Index: tests.xml === RCS file: /home/cvspublic/jakarta-commons-sandbox/altrmi/tests.xml,v retrieving revision 1.12 diff -r1.12 tests.xml 141a142,150 target name=socketc-callback-client description=Socket Client (CustomStream, client side classes) depends=generate java classname=org.apache.commons.altrmi.test.SocketClientTest fork=true classpath refid=testA.classpath/ arg value=C/ arg value=CallbackEnabledCustomSocketStream/ /java /target === --- Paul Hammant [EMAIL PROTECTED] wrote: Vinay, I've committed your changes, In testing the performance drop for 'pipeda' was between 2 6%. This is not bad. For the direct types it would be a bit more. The benefit would outweigh the performace drop of course, but maybe we might revisit this in time... This email is a place marker for that :-) I've also formatted the source with JIndent, so there may be whitespace changes versus your local copy... - Paul hammant 02/03/22 14:51:37 Modified: altrmi/src/java/org/apache/commons/altrmi/client/impl BaseServedObject.java altrmi/src/java/org/apache/commons/altrmi/generator ProxyGeneratorImpl.java altrmi/src/java/org/apache/commons/altrmi/server AltrmiPublisher.java altrmi/src/java/org/apache/commons/altrmi/server/impl AbstractServer.java DefaultMethodInvocationHandler.java altrmi/src/java/org/apache/commons/altrmi/server/impl/adapters PublicationAdapter.java -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Yahoo! Movies - coverage of the 74th Academy Awards® http://movies.yahoo.com/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/classretrievers DynamicGeneratorClassRetriever.java
hammant 02/03/26 03:24:06 Modified:altrmi PROPOSAL tests.xml tests2.xml altrmi/src/java/org/apache/commons/altrmi/common ProxyGenerator.java altrmi/src/java/org/apache/commons/altrmi/generator ProxyGeneratorImpl.java altrmi/src/java/org/apache/commons/altrmi/server AltrmiProxyGenerator.java AltrmiPublisher.java PublicationDescription.java altrmi/src/java/org/apache/commons/altrmi/server/impl AbstractServer.java altrmi/src/java/org/apache/commons/altrmi/server/impl/adapters PublicationAdapter.java altrmi/src/java/org/apache/commons/altrmi/server/impl/classretrievers DynamicGeneratorClassRetriever.java Added: altrmi/src/java/org/apache/commons/altrmi/generator/ant AltrmiProxyTask.java Removed: altrmi/src/java/org/apache/commons/altrmi/generator/ant AltrmiInterfaceTask.java Log: classesOrInterfacesToExpose (etc) changes to interfacesToExpose Revision ChangesPath 1.16 +2 -2 jakarta-commons-sandbox/altrmi/PROPOSAL Index: PROPOSAL === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/PROPOSAL,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- PROPOSAL 12 Mar 2002 17:24:06 - 1.15 +++ PROPOSAL 26 Mar 2002 11:24:05 - 1.16 @@ -9,7 +9,7 @@ 1) Any interface publishing - - Any object via the interfaces it publishes can be published remotely. + - Any object via the interfaces it publishes, can be published remotely. - No transport lock-in : - No forcing of extension of java.rmi.Remote - No forced declarations of throws java.rmi.RemoteException @@ -176,7 +176,7 @@ - Other RMI (over IIOP, over HTTP) - JMS -2) BCEL for generated proxy class. +2) BCEL (or other) for generated proxy class - The current impl writes java source then compiles it. We could do this inline with BCEL. This as an heavier, but more design perfect 1.13 +5 -5 jakarta-commons-sandbox/altrmi/tests.xml Index: tests.xml === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/tests.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- tests.xml 21 Mar 2002 07:48:30 - 1.12 +++ tests.xml 26 Mar 2002 11:24:05 - 1.13 @@ -3,7 +3,7 @@ !-- Alt (to) RMI component of the Jakarta Commons Subproject -$Id: tests.xml,v 1.12 2002/03/21 07:48:30 hammant Exp $ +$Id: tests.xml,v 1.13 2002/03/26 11:24:05 hammant Exp $ -- @@ -66,7 +66,7 @@ - taskdef name=altrmiinterfaces classname=org.apache.commons.altrmi.generator.ant.AltrmiInterfaceTask + taskdef name=altrmiproxies classname=org.apache.commons.altrmi.generator.ant.AltrmiProxyTask classpath refid=compile.classpath / /taskdef @@ -96,14 +96,14 @@ target name=generate depends=prepare -altrmiinterfaces genname=Hello srcgendir=${build.home}/genjava +altrmiproxies genname=Hello srcgendir=${build.home}/genjava classgendir=${build.home}/classes2 verbose=true -classesorinterfaces=org.apache.commons.altrmi.test.TestInterface +interfaces=org.apache.commons.altrmi.test.TestInterface additionalfacades=org.apache.commons.altrmi.test.TestInterface2 classpath pathelement location=${build.home}/classes/ /classpath -/altrmiinterfaces +/altrmiproxies /target 1.4 +11 -11jakarta-commons-sandbox/altrmi/tests2.xml Index: tests2.xml === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/tests2.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- tests2.xml21 Mar 2002 07:48:30 - 1.3 +++ tests2.xml26 Mar 2002 11:24:05 - 1.4 @@ -3,7 +3,7 @@ !-- Alt (to) RMI component of the Jakarta Commons Subproject -$Id: tests2.xml,v 1.3 2002/03/21 07:48:30 hammant Exp $ +$Id: tests2.xml,v 1.4 2002/03/26 11:24:05 hammant Exp $ -- @@ -78,7 +78,7 @@ - taskdef name=altrmiinterfaces classname=org.apache.commons.altrmi.generator.ant.AltrmiInterfaceTask + taskdef name=altrmiproxies classname=org.apache.commons.altrmi.generator.ant.AltrmiProxyTask classpath refid=compile.classpath / /taskdef @@ -108,30 +108,30 @@ target name=generate depends=prepare
Re: [Altrmi] PATCH Passing pf remote obj ' ref
Vinay, Nice idea, but we would have to get the BEEP or homegrown multiplexer working first, yes? - Paul Paul, org.apache.commons.altrmi.client.impl.stream.StreamInvocationHandler has synchronized handleInvocation(...) . With little efforts I guess we can make this class ThreadSafe and thus get rid of sync block ... Maybe we can support async' calls with the altrmi too ??? (todo item maybe) Comments ...:-? Regards, Vinay --- vinaysahil chandran [EMAIL PROTECTED] wrote: Paul, I worked with a fresh CVS checkout and it (pipeda from tests.xml) target works well without any hiccups .. I wasn't able to reproduce it out at my machine . Morevoer the patch's that I sent second time doesn't seems to be commited(Passing_Facade.patch). Can you verify the way's I have employed there ??? Basically, I have tried to pass Remote ref wrapped inside FacadeREfHolder obj back to the Server. ( I think had written FacadeRefHolder for this purpose but missed out on using it to wrap arguments sent from the client.I have just written the function to wrapp the Facade with FacadeRefHolder at the client side .) I hope I have conveyed the stuff I did over the past 2 patchs well across to you... Regards, V i n a y --- Paul Hammant [EMAIL PROTECTED] wrote: Vinay, I have applied that too, and it is looking good. One problem, test 'pipeda' fails now with a NPE at this line in correct args : args[i] = asih.mRefBeans.get(frh.getReferenceID()); Can you take a look dude..? Regards, - Paul Paul, No excuses , I had NOT done *ant clean* before building the src after the changes .. Here is the patch that I missed ... But can you get the reason behind the getMethodInvocationHandler(MethodRequest mr,String objectName) .. Wont a more generic call like : getMethodInvocationHandler(String puslishedname) be better . Comments ? Sorry for this glitch, Vinay Index: AbstractServer.java === RCS file: /home/cvspublic/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/AbstractServer.java,v retrieving revision 1.21 diff -r1.21 AbstractServer.java 231a232,244 /** * Method getMethodInvocationHandler * * * @param publishedName * * @return * */ public MethodInvocationHandler getMethodInvocationHandler(String publishedName) { return mInovcationHandlerAdapter.getMethodInvocationHandler(publishedName); } __ Do You Yahoo!? Yahoo! Movies - coverage of the 74th Academy Awards® http://movies.yahoo.com/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Yahoo! Movies - coverage of the 74th Academy Awards® http://movies.yahoo.com/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Yahoo! Movies - coverage of the 74th Academy Awards® http://movies.yahoo.com/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: [Altrmi] PATCH Passing pf remote obj ' ref
Vinay, I am unsure whether this change is a modification to the one you sent me yesterday (redirect). If it is not, I am in trouble because I have applied all the patches locally, and it is still not compiling... PipedObjectStreamServer should be declared abstract; it does not define getMethodInvocationHandler(java.lang.String) ... .. (and others).. Regards, - Paul Paul, Client can now passes references of remote bak to server . So the example that was crafted earlier ,Consumer-Provider, works fine now . TestProvider tpi = (TestProvider) af.lookup(P); TestConsumer tci = (TestConsumer) af.lookup(C); tpi.getName(0); tci.getProviderName(tpi); /// works now This has been done by a hack in BaseServedObject. So you can try out the examples within tests2.xml , but I guess we still have to decorate this build script with the logger.jars . Comments.:-? Regards, V i n a y __ Do You Yahoo!? Yahoo! Movies - coverage of the 74th Academy Awards® http://movies.yahoo.com/ Index: src/java/org/apache/commons/altrmi/client/impl/BaseServedObject.java === RCS file: /home/cvspublic/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/BaseServedObject.java,v retrieving revision 1.12 diff -r1.12 BaseServedObject.java 195a196 marshallCorrection(args); 271d271 283a284,299 private void marshallCorrection(Object[] args) { for (int i = 0; i args.length; i++) { //check whether its one of those remote ref that we got from the server //TODO : todo if(mAltrmiFactory.getReferenceID(args[i])!=null) { String objName=args[i].getClass().getName().substring(16); args[i]=makeFacadeRefHolder(args[i],objName); } } } Index: src/java/org/apache/commons/altrmi/server/AltrmiPublisher.java === RCS file: /home/cvspublic/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/AltrmiPublisher.java,v retrieving revision 1.5 diff -r1.5 AltrmiPublisher.java 81a82,93 /** * Method getMethodInvocationHandler * * * @param publishedName * * @return * */ MethodInvocationHandler getMethodInvocationHandler(String publishedName); Index: src/java/org/apache/commons/altrmi/server/impl/DefaultMethodInvocationHandler.java === RCS file: /home/cvspublic/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/DefaultMethodInvocationHandler.java,v retrieving revision 1.4 diff -r1.4 DefaultMethodInvocationHandler.java 174d173 205,207c204,205 (DefaultMethodInvocationHandler) mAltrmiPublisher.getMethodInvocationHandler(mr, frh.getObjectName()); --- (DefaultMethodInvocationHandler) mAltrmiPublisher.getMethodInvocationHandler(frh.getObjectName()); 211a210,222 private void debug(Object[] args) { System.out.println(*); for (int i = 0; i args.length; i++) { Object arg = args[i]; System.out.println(i = + i + class= + args[i].getClass().getName() + + args[i].toString()); } System.out.println(*); } Index: src/java/org/apache/commons/altrmi/server/impl/adapters/PublicationAdapter.java === RCS file: /home/cvspublic/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/adapters/PublicationAdapter.java,v retrieving revision 1.2 diff -r1.2 PublicationAdapter.java 104d103 164a164,167 public MethodInvocationHandler getMethodInvocationHandler(String publishedName) { return (MethodInvocationHandler) mPublishedObjects.get(publishedName); } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/socket PartialSocketCustomStreamServer.java
hammant 02/03/13 04:21:17 Modified:altrmi/src/java/org/apache/commons/altrmi/server/impl/socket PartialSocketCustomStreamServer.java Log: Fix mismatch between custom and object streams. Revision ChangesPath 1.3 +5 -5 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/socket/PartialSocketCustomStreamServer.java Index: PartialSocketCustomStreamServer.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/socket/PartialSocketCustomStreamServer.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- PartialSocketCustomStreamServer.java 12 Mar 2002 17:05:19 - 1.2 +++ PartialSocketCustomStreamServer.java 13 Mar 2002 12:21:17 - 1.3 @@ -12,7 +12,7 @@ import org.apache.commons.altrmi.server.impl.AbstractServer; import org.apache.commons.altrmi.server.impl.ServerStreamReadWriter; -import org.apache.commons.altrmi.server.impl.ServerObjectStreamReadWriter; +import org.apache.commons.altrmi.server.impl.ServerCustomStreamReadWriter; import org.apache.commons.altrmi.server.impl.adapters.InvocationHandlerAdapter; import org.apache.commons.altrmi.server.AltrmiServerException; @@ -23,16 +23,16 @@ /** - * Class PartialSocketObjectStreamServer + * Class PartialSocketCustomStreamServer * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ */ public class PartialSocketCustomStreamServer extends AbstractServer { /** - * Constructor PartialSocketObjectStreamServer + * Constructor PartialSocketCustomStreamServer * * * @throws AltrmiServerException @@ -71,7 +71,7 @@ try { if (mState == STARTED) { -ServerStreamReadWriter ssrw = new ServerObjectStreamReadWriter(); +ServerStreamReadWriter ssrw = new ServerCustomStreamReadWriter(); ssrw.setStreams(sock.getInputStream(), sock.getOutputStream()); -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/socket SocketCustomStreamFactoryHelper.java SocketObjectStreamFactoryHelper.java
hammant 02/03/12 03:26:49 Modified:altrmi/src/java/org/apache/commons/altrmi/client AltrmiInterfaceLookupFactory.java altrmi/src/java/org/apache/commons/altrmi/client/impl AbstractFactoryHelper.java AbstractInterfaceLookupFactory.java altrmi/src/java/org/apache/commons/altrmi/client/impl/naming DefaultAltrmiContext.java altrmi/src/java/org/apache/commons/altrmi/client/impl/rmi RmiFactoryHelper.java RmiHostContext.java altrmi/src/java/org/apache/commons/altrmi/client/impl/socket SocketCustomStreamFactoryHelper.java SocketObjectStreamFactoryHelper.java Log: Changes to help JNDI lookup in servlets Revision ChangesPath 1.2 +20 -2 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/AltrmiInterfaceLookupFactory.java Index: AltrmiInterfaceLookupFactory.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/AltrmiInterfaceLookupFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- AltrmiInterfaceLookupFactory.java 5 Mar 2002 16:30:17 - 1.1 +++ AltrmiInterfaceLookupFactory.java 12 Mar 2002 11:26:48 - 1.2 @@ -1,5 +1,7 @@ package org.apache.commons.altrmi.client; + + import org.apache.commons.altrmi.common.AltrmiConnectionException; @@ -8,7 +10,7 @@ * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version * $Revision: 1.1 $ + * @version * $Revision: 1.2 $ */ public interface AltrmiInterfaceLookupFactory { @@ -32,5 +34,21 @@ * @return * */ -AltrmiInterfaceLookup getAltrmiInterfaceLookup(String factoryString) throws AltrmiConnectionException; +AltrmiInterfaceLookup getAltrmiInterfaceLookup(String factoryString) +throws AltrmiConnectionException; + +/** + * Method getAltrmiInterfaceLookup + * + * + * @param factoryString + * @param interfacesClassLoader + * + * @return + * + * @throws AltrmiConnectionException + * + */ +AltrmiInterfaceLookup getAltrmiInterfaceLookup( +String factoryString, ClassLoader interfacesClassLoader) throws AltrmiConnectionException; } 1.2 +19 -1 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/AbstractFactoryHelper.java Index: AbstractFactoryHelper.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/AbstractFactoryHelper.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- AbstractFactoryHelper.java5 Mar 2002 16:30:17 - 1.1 +++ AbstractFactoryHelper.java12 Mar 2002 11:26:48 - 1.2 @@ -12,6 +12,8 @@ import org.apache.commons.altrmi.client.AltrmiFactory; import org.apache.commons.altrmi.client.AltrmiInterfaceLookupFactory; +import org.apache.commons.altrmi.client.AltrmiInterfaceLookup; +import org.apache.commons.altrmi.common.AltrmiConnectionException; import java.util.Vector; import java.util.StringTokenizer; @@ -22,7 +24,7 @@ * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ */ public abstract class AbstractFactoryHelper implements AltrmiInterfaceLookupFactory { @@ -51,5 +53,21 @@ } else { return null; } +} + +/** + * Method getAltrmiInterfaceLookup + * + * + * @param factoryString + * + * @return + * + * @throws AltrmiConnectionException + * + */ +public final AltrmiInterfaceLookup getAltrmiInterfaceLookup(String factoryString) +throws AltrmiConnectionException { +return getAltrmiInterfaceLookup(factoryString, this.getClass().getClassLoader()); } } 1.2 +8 -4 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/AbstractInterfaceLookupFactory.java Index: AbstractInterfaceLookupFactory.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/AbstractInterfaceLookupFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- AbstractInterfaceLookupFactory.java 5 Mar 2002 16:30:17 - 1.1 +++ AbstractInterfaceLookupFactory.java 12 Mar 2002 11:26
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/socket AbstractCompleteSocketStreamServer.java CompleteSocketCustomStreamServer.java CompleteSocketObjectStreamServer.java PartialSocketCustomStreamServer.java PartialSocketObjectStreamServer.java SocketStreamServerConnection.java
hammant 02/03/12 09:05:20 Modified:altrmi tests.xml altrmi/src/java/org/apache/commons/altrmi/client/impl DefaultConnectionListener.java DefaultConnectionPinger.java altrmi/src/java/org/apache/commons/altrmi/client/impl/socket AbstractSocketStreamInvocationHandler.java altrmi/src/java/org/apache/commons/altrmi/client/impl/stream ClientCustomStreamReadWriter.java StreamInvocationHandler.java altrmi/src/java/org/apache/commons/altrmi/server/impl AbstractServer.java StreamServerConnection.java altrmi/src/java/org/apache/commons/altrmi/server/impl/beep BEEPServerConnection.java altrmi/src/java/org/apache/commons/altrmi/server/impl/piped AbstractPipedServer.java PipedObjectStreamServer.java altrmi/src/java/org/apache/commons/altrmi/server/impl/socket AbstractCompleteSocketStreamServer.java CompleteSocketCustomStreamServer.java CompleteSocketObjectStreamServer.java PartialSocketCustomStreamServer.java PartialSocketObjectStreamServer.java SocketStreamServerConnection.java Added: altrmi/lib avalon-framework-4.1.2.jar Log: Fixed reconnects for failing connections. Start of logging on server side. Revision ChangesPath 1.10 +2 -1 jakarta-commons-sandbox/altrmi/tests.xml Index: tests.xml === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/tests.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- tests.xml 11 Mar 2002 10:04:55 - 1.9 +++ tests.xml 12 Mar 2002 17:05:19 - 1.10 @@ -3,7 +3,7 @@ !-- Alt (to) RMI component of the Jakarta Commons Subproject -$Id: tests.xml,v 1.9 2002/03/11 10:04:55 hammant Exp $ +$Id: tests.xml,v 1.10 2002/03/12 17:05:19 hammant Exp $ -- @@ -44,6 +44,7 @@ pathelement location=${build.home}/classes/ pathelement location=${build.home}/classes2/ pathelement location=lib/JSX0.9.8.1.jar/ +pathelement location=lib/avalon-framework-4.1.2.jar/ /path path id=testB1.classpath 1.1 jakarta-commons-sandbox/altrmi/lib/avalon-framework-4.1.2.jar Binary file 1.2 +4 -4 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/DefaultConnectionListener.java Index: DefaultConnectionListener.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/DefaultConnectionListener.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- DefaultConnectionListener.java21 Jan 2002 15:38:20 - 1.1 +++ DefaultConnectionListener.java12 Mar 2002 17:05:19 - 1.2 @@ -21,7 +21,7 @@ * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version * $Revision: 1.1 $ + * @version * $Revision: 1.2 $ */ public class DefaultConnectionListener implements AltrmiConnectionListener { @@ -35,7 +35,6 @@ * */ public void methodCalled(final String methodSignature, final long duration) { - // do mothing in default impl, could do logging. } @@ -47,7 +46,7 @@ * */ public boolean methodLogging() { -return false; +return true; } /** @@ -75,7 +74,7 @@ try { Thread.sleep(suggestedWaitMillis); } catch (InterruptedException ie) { - +System.out.println(InterruptedException in Listener + ie.getMessage()); // TODO ? } } @@ -102,6 +101,7 @@ try { Thread.sleep((2 ^ attempt) * 500); } catch (InterruptedException ie) { +System.out.println(InterruptedException in Listener + ie.getMessage()); // TODO ? } 1.3 +48 -4 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/DefaultConnectionPinger.java Index: DefaultConnectionPinger.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/DefaultConnectionPinger.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- DefaultConnectionPinger.java 21 Jan 2002 20:10:34 - 1.2
cvs commit: jakarta-commons-sandbox/altrmi PROPOSAL
hammant 02/03/12 09:24:06 Modified:altrmi PROPOSAL Log: credit Vinay with his work Revision ChangesPath 1.15 +3 -2 jakarta-commons-sandbox/altrmi/PROPOSAL Index: PROPOSAL === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/PROPOSAL,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- PROPOSAL 11 Mar 2002 10:04:55 - 1.14 +++ PROPOSAL 12 Mar 2002 17:24:06 - 1.15 @@ -188,6 +188,7 @@ 3) Client and Server code for secure conversations. -Initial committers: +Initial developers: -Paul Hammant (hammant) +Paul Hammant ([EMAIL PROTECTED]) +Vinaysahil Chandran (not a committer yet) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Db bean issue
Jason, Juozas is indeed glueing the exellent SimpleStore library into one or more of the examples for EOB. One small correction it is AltRMI not ARMI that is the underlying RMI-less transport: SimpleStore : http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/simplestore/ AltRMI : http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/altrmi/ Enterprise Object Broker : http://eob.sourceforge.net/ - Paul Hi, We are working on simplestore in commons, it kind of "Transparent Persitence" ARMI is kind of "Transparent RPC", I work on integration for both projects. You can get the firs release of complete framework on sourceforge EOB. I am going to work on security and transaction then persitence in simplestore will be completed, It supports almost all CMP 2 features at this time, but not well tested. Then you use simplestore + ARMI you dont need "remote interface", "Home interface","Value Object", "Bussines Delegate", "Local interface" ... . Any class class or interface can be persitent,distributable (secure and transactional is the next step) Hello anyone who's out there, I have an 'issue' that is rearing its head again and wld like to get anyones take on it. It concerns beans db and the lack (or maybe not) of a kinda jakarta proj/framework like struts, but addresses the back end. I know, there's EJB, etc... But, after working on EJB and non-EJB projects, I'm not convinved EJB is any more scalable or distributable than a good implementation of data aware beans - or something along those lines. I helped design a quite popular, big air travel site that took a non-EJB approach and worked well and scaled across 15 Sun boxes without a hitch. However, the implementation was a little complex and now that I'm working on another project, I'd like to have the same thing at a simpler level. So I guess I'm just kinda saying hi to the Commons proj and trying to see if anyone has thought about this issue. Especially since there is no Jakarta sub-project or Commons portion addressing this issue. Thanks and hi, - Jason -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] This message was sent using DELFI MailMan - http://mailman.delfi.lt/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: [ALTRMI]-PATCH JNDI interface for Altrmi clients
Vinay, Paul, Did some prelim' JNDI bridge work for client-side lookup's and listing. skip/ Comments ?? I am over the moon I will put it in now! - Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/naming DefaultAltrmiContext.java DefaultAltrmiInitialContextFactory.java AltrmiContext.java
hammant 02/03/10 01:40:18 Modified:altrmi/src/java/org/apache/commons/altrmi/client/impl DefaultInterfaceLookupFactory.java Added: altrmi/src/java/org/apache/commons/altrmi/client/impl/naming DefaultAltrmiContext.java DefaultAltrmiInitialContextFactory.java Removed: altrmi/src/java/org/apache/commons/altrmi/client/impl/naming AltrmiContext.java Log: Start of JNDI by Vinay Revision ChangesPath 1.3 +9 -1 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/DefaultInterfaceLookupFactory.java Index: DefaultInterfaceLookupFactory.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/DefaultInterfaceLookupFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- DefaultInterfaceLookupFactory.java6 Mar 2002 16:11:02 - 1.2 +++ DefaultInterfaceLookupFactory.java10 Mar 2002 09:40:18 - 1.3 @@ -20,9 +20,17 @@ * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ */ public class DefaultInterfaceLookupFactory extends AbstractInterfaceLookupFactory { + +public static final String[] SUPPORTEDSTREAMS = new String[] { +SocketObjectStream, +SocketCustomStream, +RMI +}; + + /** * Constructor DefaultInterfaceLookupFactory 1.1 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/naming/DefaultAltrmiContext.java Index: DefaultAltrmiContext.java === /* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE.txt file. */ package org.apache.commons.altrmi.client.impl.naming; import java.util.Hashtable; import javax.naming.Context; import javax.naming.Name; import javax.naming.NameParser; import javax.naming.NamingEnumeration; import javax.naming.NamingException; import org.apache.commons.altrmi.client.AltrmiInterfaceLookup; import org.apache.commons.altrmi.client.AltrmiInterfaceLookupFactory; import org.apache.commons.altrmi.client.impl.DefaultInterfaceLookupFactory; import org.apache.commons.altrmi.common.AltrmiConnectionException; /** * Class DefaultAltrmiContext * * * @author Vinay Chandrasekharan a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a * @version $Revision: 1.1 $ */ public class DefaultAltrmiContext implements Context { AltrmiInterfaceLookupFactory altrmiInterfaceLookupFactory = new DefaultInterfaceLookupFactory(); AltrmiInterfaceLookup altrmiInterfaceLookup = null; /** * Constructor DefaultAltrmiContext * * * @param host * @param port * @param transportStream * @param env * * @throws NamingException * */ DefaultAltrmiContext(String host, String port, String transportStream, Hashtable env) throws NamingException { String proxyDetails = null; String beanDetails = null; proxyDetails = (String) env.get(proxy.type); beanDetails = (String) env.get(bean.type); if (proxyDetails == null) { proxyDetails = S; } if (beanDetails == null) { beanDetails = NBO; } try { System.out.println(iurl[ + transportStream + : + host + : + port + : + proxyDetails + : + beanDetails + ]); altrmiInterfaceLookup = altrmiInterfaceLookupFactory.getAltrmiInterfaceLookup(transportStream + : + host + : + port + : + proxyDetails + : + beanDetails); } catch (AltrmiConnectionException ace) { ace.printStackTrace(); throw new NamingException(ace.getMessage()); } } /** * Method lookup * * * @param name * * @return * * @throws NamingException * */ public Object lookup(Name name) throws NamingException { return null; } /** * Method lookup * * * @param name * * @return
Re: [ALTRMI]-PATCH JNDI interface for Altrmi clients
Vinay, Did some prelim' JNDI bridge work for client-side lookup's and listing. Yes it is good stuff. I have committed it. Some small changes : 1) names of clases have be prefixed with Default. Why? EOB is likely to re-implement to allow internal VM lookup when the client thinks it is doing an external socket lookup (the holy grail). 2) 'supportedstreams' is static so has gone uppercase and final 3) your name has replaced mine as auther of the smaller class, as i did nothing really. Thoughts.. 1) I hate the env.put() business of JNDI. Should we also provide a helper factory (optional use) that will make an InitialContext for comon types of transport? It would be a non-standard way of making an initial context but many people do this anyway in their code. 2) The URL naming scheme for JNDI is very different to the colon delimited design that I have started in InterfaceLookupFactory. Should we change that to look more like JNDI ? 3) Tests. I think some of the tests should be changed to use JNDI for the lookup. Not all, as we should show people that they have options... Your thoughts? - Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: [ARMI] ProxyGenrator
Juozas, Thanks for your continued thinking on this dude. Hi, ProxyGeneratorImpl and ClientClassAltrmiFactory use diferent ClassLoaders . We need to call generate in ClientClassAltrmiFactory not in ants task. I see BCEL is not very useful for ARMI if we are going to support only interfaces. skip/ I don't think that java.lang.reflect.Proxy is good enough for us. Why? 1) A scripting env like the excellent BeanShell cannot query the exposed methods and invoke them. 2) As we are not delegating immediately to a ral impl, we cannot have a single catch/throws block that suits all scenarios. If it were not for that it would be a good solution. BCEL almost certainly is (one of) the right tools to dynamic make proxies, the problem is it is Brain-Surgery to use. Anyone that can actually use it to make a proxy of the type we find easy via our javac route would be a god. I dream of a bytecode generator that allows me some natural java-like construction : JMethod ap = new JMethod(actionPerformed); ap.addArg(event, ActionEvent.class); ap.setVoidReturn(); // maybe this a default. InstructionList il = ap.getInstructionList(); Var txtVar = new NewVar(String,txt); ir.add(new JInstruction(txtVar, event,toString)); ir.add(new JInstruction(System.out, println, txtVar)); ap.generate(); Regards, - Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/classretrievers DynamicGeneratorClassRetriever.java
hammant 02/03/08 05:12:13 Modified:altrmi/src/java/org/apache/commons/altrmi/server/impl/classretrievers DynamicGeneratorClassRetriever.java Added: altrmi/src/java/org/apache/commons/altrmi/server ProxyGenerationEnvironmentException.java Log: Handles absense of tools.jar better. Revision ChangesPath 1.1 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/ProxyGenerationEnvironmentException.java Index: ProxyGenerationEnvironmentException.java === /* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE.txt file. */ package org.apache.commons.altrmi.server; /** * Class ProxyGenerationEnvironmentException * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a * @version $Revision: 1.1 $ */ public class ProxyGenerationEnvironmentException extends PublicationException { /** * Constructor ProxyGenerationEnvironmentException * * * @param s * */ public ProxyGenerationEnvironmentException(String s) { super(s); } } 1.5 +12 -1 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/classretrievers/DynamicGeneratorClassRetriever.java Index: DynamicGeneratorClassRetriever.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/classretrievers/DynamicGeneratorClassRetriever.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- DynamicGeneratorClassRetriever.java 24 Feb 2002 11:04:33 - 1.4 +++ DynamicGeneratorClassRetriever.java 8 Mar 2002 13:12:13 - 1.5 @@ -29,7 +29,7 @@ * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version $Revision: 1.4 $ + * @version $Revision: 1.5 $ */ public class DynamicGeneratorClassRetriever implements AltrmiProxyGenerator, ClassRetriever { @@ -270,6 +270,17 @@ try { proxyGenerator.generateClass(classLoader); } catch (Throwable t) { +if (t instanceof NoClassDefFoundError t.getMessage().equals(sun/tools/javac/Main)) { +System.out.println(***); +System.out.println(* *); +System.out.println(* AltRMI problem..*); +System.out.println(* Please copy JAVA_HOME/lib/tools.jar *); +System.out.println(* to your applications classpath so *); +System.out.println(* that proxys can be compiled.*); +System.out.println(* *); +System.out.println(***); +throw new ProxyGenerationEnvironmentException(tools.jar not found in classpath.); +} System.out.println(**); System.out.println(** Exception while making String : ); System.out.flush(); -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/altrmi tests.xml
hammant 02/03/08 22:29:35 Modified:altrmi tests.xml Log: Typo correction from Vinay Revision ChangesPath 1.8 +3 -3 jakarta-commons-sandbox/altrmi/tests.xml Index: tests.xml === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/tests.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- tests.xml 18 Feb 2002 21:40:28 - 1.7 +++ tests.xml 9 Mar 2002 06:29:35 - 1.8 @@ -3,7 +3,7 @@ !-- Alt (to) RMI component of the Jakarta Commons Subproject -$Id: tests.xml,v 1.7 2002/02/18 21:40:28 hammant Exp $ +$Id: tests.xml,v 1.8 2002/03/09 06:29:35 hammant Exp $ -- @@ -260,9 +260,9 @@ /target target name=directc depends=generate -java classname=org.apache.commons.altrmi.test.DirectTestC fork=true +java classname=org.apache.commons.altrmi.test.DirectTest fork=true classpath refid=testA.classpath/ - arg value=S/ + arg value=C/ /java /target -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl DefaultMethodInvocationHandler.java
hammant 02/03/08 22:46:33 Modified:altrmi/src/java/org/apache/commons/altrmi/server/impl DefaultMethodInvocationHandler.java Log: static scope for references - Vinay fixed Revision ChangesPath 1.4 +3 -3 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/DefaultMethodInvocationHandler.java Index: DefaultMethodInvocationHandler.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/DefaultMethodInvocationHandler.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- DefaultMethodInvocationHandler.java 6 Mar 2002 19:34:46 - 1.3 +++ DefaultMethodInvocationHandler.java 9 Mar 2002 06:46:33 - 1.4 @@ -38,14 +38,14 @@ * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version $Revision: 1.3 $ + * @version $Revision: 1.4 $ */ public class DefaultMethodInvocationHandler implements MethodInvocationHandler { private HashMap mRefBeans = new HashMap(); private HashMap mBeanRefs = new HashMap(); private HashMap mMethodMap; -private int mNextReference = 1; +private static int NEXT_REFERENCE = 1; private AltrmiPublisher mAltrmiPublisher; private String mPublishedThing; @@ -126,7 +126,7 @@ if (ref == null) { //ref = new Long((long) ((long) mNextReference++ 32) // + (long) Math.round(Math.random())); -ref = new Long(mNextReference++); +ref = new Long(NEXT_REFERENCE++); //mBeanRefs.put(implBean, ref); //mRefBeans.put(ref, implBean); -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: [ALTRMI]-PATCH DefaultMethodInvocationHandler,TestInterface*,SocketServerTest
Vinay, Paul, The referenceID that is generated from within DefaultMethodInvocationHandler must be class level variable. Done. The modified Testcases (I have done this excercise with only SocketServerTest , if you say I can do the same with other publish methods too) for the same also attached along with the new facade TestInterface3 (+impl) I have applied these but not committed them. My feeling is that TestInterface2 is exactly the same as TestInterface3 and offers nothing new by way of tests. It will complicate a person's view of AltRMI if they are trying to understand it via its tests. If we add tests, they should be for difficult usecases, not clones of existing tests.. What do you think? - Paul *PATCH** Index: DefaultMethodInvocationHandler.java === RCS file: /home/cvspublic/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/DefaultMethodInvocationHandler.java,v retrieving revision 1.3 diff -r1.3 DefaultMethodInvocationHandler.java 48c48 private int mNextReference = 1; --- private static int mNextReference = 1; 130d129 150a150 *PATCH** Index: TestInterfaceImpl.java === RCS file: /home/cvspublic/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test/TestInterfaceImpl.java,v retrieving revision 1.4 diff -r1.4 TestInterfaceImpl.java 29a30 Vector ti3Holder = new Vector(); 137a139,156 /** * Method makeTestInterface3 * * * @param thingName * * @return * */ public TestInterface3 makeTestInterface3(String thingName) { TestInterface3 ti3 = new TestInterface3Impl(thingName); ti3Holder.add(ti3); return ti3; } 195a215,234 } return retVal; } /** * Method getTestInterface3s * * * @return * */ public TestInterface3[] getTestInterface3s() { TestInterface3[] retVal = new TestInterface3[ti3Holder.size()]; for (int i = 0; i ti3Holder.size(); i++) { TestInterface3 interface3 = (TestInterface3) ti3Holder.elementAt(i); retVal[i] = interface3; * Index: TestInterface.java === RCS file: /home/cvspublic/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test/TestInterface.java,v retrieving revision 1.4 diff -r1.4 TestInterface.java 100a101,111 * Method makeTestInterface3 * * * @param thingName * * @return * */ TestInterface3 makeTestInterface3(String thingName); /** 127a139,147 /** * Method getTestInterface3s * * * @return * */ TestInterface3[] getTestInterface3s(); *** cvs -q diff TestClient.java (in directory C:\jcommons\cvs\jakarta-commons-sandbox\altrmi\src\java\org\apache\commons\altrmi\test) Index: TestClient.java === RCS file: /home/cvspublic/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test/TestClient.java,v retrieving revision 1.5 diff -r1.5 TestClient.java 92a93,107 System.out.println(CLT: Test Another Facade); TestInterface3 ti3One = ti.makeTestInterface3(One3); TestInterface3 ti3Two = ti.makeTestInterface3(Two3); System.out.println(CLT: One name = ' + ti3One.getName3() + '); System.out.println(CLT: Two name = ' + ti3Two.getName3() + '); TestInterface3[] ti3s = ti.getTestInterface3s(); for (int i = 0; i ti3s.length; i++) { TestInterface3 ti3 = ti3s[i]; System.out.println(CLT: .. name[+i+] = ' + ti3s[i].getName3() + '); } *** cvs -q diff SocketServerTest.java (in directory C:\jcommons\cvs\jakarta-commons-sandbox\altrmi\src\java\org\apache\commons\altrmi\test) Index: SocketServerTest.java === RCS file: /home/cvspublic/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test/SocketServerTest.java,v retrieving revision 1.8 diff -r1.8 SocketServerTest.java 66c66 as.publish(ti, Hello, new PublicationDescription(TestInterface.class, TestInterface2.class)); --- as.publish(ti, Hello, new PublicationDescription(TestInterface.class,new Class[]{TestInterface2.class,TestInterface3.class})); *** cvs -q diff tests.xml (in directory
Re: [ALTRMI]-PATCH tests.xml
Vinay, Applied. Cheers dude. - Paul a typo cvs -q diff tests.xml (in directory C:\jcommons\cvs\jakarta-commons-sandbox\altrmi) Index: tests.xml === RCS file: /home/cvspublic/jakarta-commons-sandbox/altrmi/tests.xml,v retrieving revision 1.7 diff -r1.7 tests.xml 263c263 java classname=org.apache.commons.altrmi.test.DirectTestC fork=true --- java classname=org.apache.commons.altrmi.test.DirectTest fork=true 265c265 arg value=S/ --- arg value=C/ __ Do You Yahoo!? Try FREE Yahoo! Mail - the world's greatest free email! http://mail.yahoo.com/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/socket SocketCustomStreamFactoryHelper.java SocketObjectStreamFactoryHelper.java
hammant 02/03/06 08:11:02 Modified:altrmi/src/java/org/apache/commons/altrmi/client/impl DefaultInterfaceLookupFactory.java altrmi/src/java/org/apache/commons/altrmi/client/impl/socket SocketObjectStreamFactoryHelper.java Added: altrmi/src/java/org/apache/commons/altrmi/client/impl/rmi RmiFactoryHelper.java altrmi/src/java/org/apache/commons/altrmi/client/impl/socket SocketCustomStreamFactoryHelper.java Log: More Factory helpers Revision ChangesPath 1.2 +5 -1 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/DefaultInterfaceLookupFactory.java Index: DefaultInterfaceLookupFactory.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/DefaultInterfaceLookupFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- DefaultInterfaceLookupFactory.java5 Mar 2002 16:30:17 - 1.1 +++ DefaultInterfaceLookupFactory.java6 Mar 2002 16:11:02 - 1.2 @@ -11,6 +11,8 @@ import org.apache.commons.altrmi.client.impl.socket.SocketObjectStreamFactoryHelper; +import org.apache.commons.altrmi.client.impl.socket.SocketCustomStreamFactoryHelper; +import org.apache.commons.altrmi.client.impl.rmi.RmiFactoryHelper; /** @@ -18,7 +20,7 @@ * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ */ public class DefaultInterfaceLookupFactory extends AbstractInterfaceLookupFactory { @@ -30,6 +32,8 @@ public DefaultInterfaceLookupFactory() { addFactory(SocketObjectStream:, new SocketObjectStreamFactoryHelper()); +addFactory(SocketCustomStream:, new SocketCustomStreamFactoryHelper()); +addFactory(RMI:, new RmiFactoryHelper()); // TODO - add the rest. } 1.1 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/rmi/RmiFactoryHelper.java Index: RmiFactoryHelper.java === /* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE.txt file. */ package org.apache.commons.altrmi.client.impl.rmi; import org.apache.commons.altrmi.client.impl.AbstractFactoryHelper; import org.apache.commons.altrmi.client.AltrmiInterfaceLookup; import org.apache.commons.altrmi.client.AltrmiHostContext; import org.apache.commons.altrmi.client.AltrmiFactory; import org.apache.commons.altrmi.common.AltrmiConnectionException; import java.io.IOException; /** * Class RmiFactoryHelper * * RMI:abcde.com:1234 *0 : 1 : 2 * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a * @version $Revision: 1.1 $ */ public class RmiFactoryHelper extends AbstractFactoryHelper { /** * Method getAltrmiInterfaceLookup * * * @param factoryString * * @return * */ public AltrmiInterfaceLookup getAltrmiInterfaceLookup(String factoryString) throws AltrmiConnectionException { // TODO maybe we should cache these. Or the abstract parent class should. String[] terms = processFactoryString(factoryString); AltrmiHostContext hc = new RmiHostContext(terms[1], Integer.parseInt(terms[2])); AltrmiFactory af = createAltrmiFactory(terms[3], terms[4].equalsIgnoreCase(bo)); try { af.setHostContext(hc); } catch (IOException e) { throw new AltrmiConnectionException(IO Exception during connection: + e.getMessage()); } return af; } } 1.2 +2 -2 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/socket/SocketObjectStreamFactoryHelper.java Index: SocketObjectStreamFactoryHelper.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/socket/SocketObjectStreamFactoryHelper.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- SocketObjectStreamFactoryHelper.java 5 Mar 2002 16:30:17 - 1.1 +++ SocketObjectStreamFactoryHelper.java 6 Mar 2002 16:11:02 - 1.2 @@ -27,12 +27,12
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/naming AltrmiContext.java
hammant 02/03/06 09:53:46 Added: altrmi/src/java/org/apache/commons/altrmi/client/impl/naming AltrmiContext.java Log: start of jndi Revision ChangesPath 1.1 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/naming/AltrmiContext.java Index: AltrmiContext.java === /* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE.txt file. */ package org.apache.commons.altrmi.client.impl.naming; import javax.naming.Context; import javax.naming.Name; import javax.naming.NamingException; import javax.naming.NamingEnumeration; import javax.naming.NameParser; import java.util.Hashtable; /** * Class AltrmiContext * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a * @version $Revision: 1.1 $ */ public class AltrmiContext implements Context { //TODO - It all! /** * Method lookup * * * @param name * * @return * * @throws NamingException * */ public Object lookup(Name name) throws NamingException { return null; } /** * Method lookup * * * @param name * * @return * * @throws NamingException * */ public Object lookup(String name) throws NamingException { return null; } /** * Method bind * * * @param name * @param obj * * @throws NamingException * */ public void bind(Name name, Object obj) throws NamingException {} /** * Method bind * * * @param name * @param obj * * @throws NamingException * */ public void bind(String name, Object obj) throws NamingException {} /** * Method rebind * * * @param name * @param obj * * @throws NamingException * */ public void rebind(Name name, Object obj) throws NamingException {} /** * Method rebind * * * @param name * @param obj * * @throws NamingException * */ public void rebind(String name, Object obj) throws NamingException {} /** * Method unbind * * * @param name * * @throws NamingException * */ public void unbind(Name name) throws NamingException {} /** * Method unbind * * * @param name * * @throws NamingException * */ public void unbind(String name) throws NamingException {} /** * Method rename * * * @param oldName * @param newName * * @throws NamingException * */ public void rename(Name oldName, Name newName) throws NamingException {} /** * Method rename * * * @param oldName * @param newName * * @throws NamingException * */ public void rename(String oldName, String newName) throws NamingException {} /** * Method list * * * @param name * * @return * * @throws NamingException * */ public NamingEnumeration list(Name name) throws NamingException { return null; } /** * Method list * * * @param name * * @return * * @throws NamingException * */ public NamingEnumeration list(String name) throws NamingException { return null; } /** * Method listBindings * * * @param name * * @return * * @throws NamingException * */ public NamingEnumeration listBindings(Name name) throws NamingException { return null; } /** * Method listBindings * * * @param name * * @return * * @throws NamingException * */ public NamingEnumeration listBindings(String name) throws NamingException { return null; } /** * Method destroySubcontext * * * @param name * * @throws NamingException * */ public void destroySubcontext(Name name) throws NamingException {} /** * Method destroySubcontext * * * @param name * * @throws NamingException
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/adapters InvocationHandlerAdapter.java
hammant 02/03/06 11:34:47 Modified:altrmi/src/java/org/apache/commons/altrmi/client/impl AbstractAltrmiFactory.java BaseServedObject.java altrmi/src/java/org/apache/commons/altrmi/client/impl/direct AbstractDirectInvocationHandler.java DirectInvocationHandler.java DirectMarshalledInvocationHandler.java altrmi/src/java/org/apache/commons/altrmi/client/impl/rmi RmiInvocationHandler.java altrmi/src/java/org/apache/commons/altrmi/client/impl/stream StreamInvocationHandler.java altrmi/src/java/org/apache/commons/altrmi/common NoSuchReferenceReply.java altrmi/src/java/org/apache/commons/altrmi/server/impl DefaultMethodInvocationHandler.java altrmi/src/java/org/apache/commons/altrmi/server/impl/adapters InvocationHandlerAdapter.java Added: altrmi/src/java/org/apache/commons/altrmi/common NoSuchReferenceException.java Removed: altrmi/src/java/org/apache/commons/altrmi/common NotSuchReferenceException.java Log: small bugs with null reply facades in arrays. Revision ChangesPath 1.15 +2 -1 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/AbstractAltrmiFactory.java Index: AbstractAltrmiFactory.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/AbstractAltrmiFactory.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- AbstractAltrmiFactory.java4 Mar 2002 12:10:48 - 1.14 +++ AbstractAltrmiFactory.java6 Mar 2002 19:34:46 - 1.15 @@ -31,7 +31,7 @@ * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version $Revision: 1.14 $ + * @version $Revision: 1.15 $ */ public abstract class AbstractAltrmiFactory implements AltrmiFactory { @@ -115,6 +115,7 @@ public final void registerReferenceObject(Object obj, Long referenceID) { mObjRefs.put(obj, referenceID); mRefObjs.put(referenceID, obj); +Object o = mRefObjs.get(referenceID); } /** 1.11 +19 -15 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/BaseServedObject.java Index: BaseServedObject.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/BaseServedObject.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- BaseServedObject.java 6 Mar 2002 12:52:07 - 1.10 +++ BaseServedObject.java 6 Mar 2002 19:34:46 - 1.11 @@ -30,7 +30,7 @@ * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version $Revision: 1.10 $ + * @version $Revision: 1.11 $ */ public final class BaseServedObject { @@ -143,23 +143,27 @@ for (int i = 0; i refs.length; i++) { Long ref = refs[i]; -implBeans[i] = mAltrmiFactory.getImplObj(refs[i]); -if (implBeans[i] == null) { -BaseServedObject bo2 = new BaseServedObject(mAltrmiFactory, mInvocationHandler, +if (ref == null) { +implBeans[i] = null; +} else { +implBeans[i] = mAltrmiFactory.getImplObj(ref); +if (implBeans[i] == null) { +BaseServedObject bo2 = new BaseServedObject(mAltrmiFactory, mInvocationHandler, mPublishedServiceName, objNameWithoutArray, refs[i], mSession); -Object retFacade = null; -try { -retFacade = mAltrmiFactory.getInstance(mPublishedServiceName, objNameWithoutArray, - bo2, mAltrmiFactory.isBeanOnly()); -} catch (Exception e) { -System.out.println(objNameWithoutArray= + objNameWithoutArray); -System.out.flush(); -e.printStackTrace(); -} +Object retFacade = null; +try { +retFacade = mAltrmiFactory.getInstance(mPublishedServiceName, objNameWithoutArray
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/beep AltrmiBEEPServerProfile.java CompleteBEEPServer.java ServerBEEPReadWriter.java
hammant 02/03/06 13:39:49 Modified:altrmi/lib beepcore.jar altrmi/src/java/org/apache/commons/altrmi/client/impl/beep BEEPInvocationHandler.java altrmi/src/java/org/apache/commons/altrmi/server/impl/beep AltrmiBEEPServerProfile.java CompleteBEEPServer.java ServerBEEPReadWriter.java Log: BEEP upgrade, hopefully to fix GUMP error Revision ChangesPath 1.2 +271 -322 jakarta-commons-sandbox/altrmi/lib/beepcore.jar Binary file 1.3 +10 -10 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/beep/BEEPInvocationHandler.java Index: BEEPInvocationHandler.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/beep/BEEPInvocationHandler.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- BEEPInvocationHandler.java4 Mar 2002 12:10:48 - 1.2 +++ BEEPInvocationHandler.java6 Mar 2002 21:39:49 - 1.3 @@ -21,19 +21,19 @@ import org.beepcore.beep.core.BEEPError; import org.beepcore.beep.core.BEEPException; import org.beepcore.beep.core.BEEPInterruptedException; -import org.beepcore.beep.core.ByteDataStream; import org.beepcore.beep.core.Channel; import org.beepcore.beep.core.MessageListener; import org.beepcore.beep.core.Message; -import org.beepcore.beep.core.DataStream; import org.beepcore.beep.core.ProfileRegistry; import org.beepcore.beep.core.Session; -import org.beepcore.beep.core.StringDataStream; import org.beepcore.beep.core.ReplyListener; +import org.beepcore.beep.core.StringOutputDataStream; +import org.beepcore.beep.core.InputDataStream; +import org.beepcore.beep.core.ByteOutputDataStream; import org.beepcore.beep.lib.NullReplyListener; import org.beepcore.beep.lib.MessageQueue; import org.beepcore.beep.profile.ProfileConfiguration; -import org.beepcore.beep.transport.tcp.AutomatedTCPSessionCreator; +import org.beepcore.beep.transport.tcp.TCPSessionCreator; @@ -43,7 +43,7 @@ * * * @author Vinay Chandrasekharana href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ */ public class BEEPInvocationHandler extends StreamInvocationHandler { @@ -74,7 +74,7 @@ //TODO: // Change here if the client needs to enable callbacks // Client will have a profiles too advertise -session = AutomatedTCPSessionCreator.initiate(mHost, mPort,new ProfileRegistry()); +session = TCPSessionCreator.initiate(mHost, mPort,new ProfileRegistry()); } catch (BEEPException e) { @@ -110,7 +110,7 @@ ClientBEEPReadWriter beepReadWriter =(ClientBEEPReadWriter )createClientStreamReadWriter(); - channel.setDataListener(beepReadWriter.mQueue); + channel.setMessageListener(beepReadWriter.mQueue); setObjectReadWriter(beepReadWriter); } @@ -173,7 +173,7 @@ byte[] aBytes = SerializationHelper.getBytesFromInstance(altrmiRequest); try { - channel.sendMSG(new ByteDataStream(aBytes),replyListener); + channel.sendMSG(new ByteOutputDataStream(aBytes),replyListener); } catch(BEEPException be) { @@ -205,8 +205,8 @@ try { Message message=mQueue.getNextMessage(); - message.sendRPY(new StringDataStream(OK)); - DataStream ds = message.getDataStream(); + message.sendRPY(new StringOutputDataStream(OK)); + InputDataStream ds = message.getDataStream(); InputStream is = ds.getInputStream(); byte[] buf = new byte[4096]; ByteArrayOutputStream data = new ByteArrayOutputStream(); 1.2 +2 -2 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/beep/AltrmiBEEPServerProfile.java Index: AltrmiBEEPServerProfile.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/beep/AltrmiBEEPServerProfile.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- AltrmiBEEPServerProfile.java 27 Feb 2002 14:47:36 - 1.1 +++ AltrmiBEEPServerProfile.java 6 Mar 2002 21:39:49 - 1.2 @@ -31,7 +31,7
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/socket SocketObjectStreamFactoryHelper.java
hammant 02/03/05 08:30:17 Added: altrmi/src/java/org/apache/commons/altrmi/client AltrmiInterfaceLookupFactory.java altrmi/src/java/org/apache/commons/altrmi/client/impl AbstractFactoryHelper.java AbstractInterfaceLookupFactory.java DefaultInterfaceLookupFactory.java altrmi/src/java/org/apache/commons/altrmi/client/impl/socket SocketObjectStreamFactoryHelper.java Removed: altrmi/src/java/org/apache/commons/altrmi/client AltrmiFactoryFactory.java Log: Start of work on String based lookup mechanism. Revision ChangesPath 1.1 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/AltrmiInterfaceLookupFactory.java Index: AltrmiInterfaceLookupFactory.java === package org.apache.commons.altrmi.client; import org.apache.commons.altrmi.common.AltrmiConnectionException; /** * Interface AltrmiInterfaceLookupFactory * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a * @version * $Revision: 1.1 $ */ public interface AltrmiInterfaceLookupFactory { /** * Method getAltrmiInterfaceLookup * * FactoryStrings as listed here should look like this: * * SocketObjectStream:abcde.com:1234:S:BO * SocketCustomStream:abcde.com:1235:C:NBO * RMI:abcde.com:1236:S:NBO * * S:BO and alike is *- S for server side proxy classes *- C for client side proxy classes *- BO is BeanOnly (not castable to the interface) *- NBO is NotBeanOnly (castable to the interface) * * @param factoryString * * @return * */ AltrmiInterfaceLookup getAltrmiInterfaceLookup(String factoryString) throws AltrmiConnectionException; } 1.1 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/AbstractFactoryHelper.java Index: AbstractFactoryHelper.java === /* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE.txt file. */ package org.apache.commons.altrmi.client.impl; import org.apache.commons.altrmi.client.AltrmiFactory; import org.apache.commons.altrmi.client.AltrmiInterfaceLookupFactory; import java.util.Vector; import java.util.StringTokenizer; /** * Class AbstractFactoryHelper * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a * @version $Revision: 1.1 $ */ public abstract class AbstractFactoryHelper implements AltrmiInterfaceLookupFactory { protected String[] processFactoryString(String factoryString) { Vector terms = new Vector(); StringTokenizer st = new StringTokenizer(factoryString, :); while (st.hasMoreTokens()) { terms.add(st.nextToken()); } String[] retval = new String[terms.size()]; terms.copyInto(retval); return retval; } protected AltrmiFactory createAltrmiFactory(String type, boolean beanOnly) { if (type.equalsIgnoreCase(s)) { return new ServerClassAltrmiFactory(beanOnly); } else if (type.equalsIgnoreCase(c)) { return new ClientClassAltrmiFactory(beanOnly); } else { return null; } } } 1.1 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/AbstractInterfaceLookupFactory.java Index: AbstractInterfaceLookupFactory.java === /* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE.txt file. */ package org.apache.commons.altrmi.client.impl; import org.apache.commons.altrmi.client.AltrmiInterfaceLookupFactory; import org.apache.commons.altrmi.client.AltrmiInterfaceLookup; import org.apache.commons.altrmi.common.AltrmiConnectionException; import java.util.Vector; /** * Class AbstractInterfaceLookupFactory * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a * @version $Revision: 1.1 $ */ public class AbstractInterfaceLookupFactory implements AltrmiInterfaceLookupFactory { private Vector
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/stream ClientCustomStreamReadWriter.java
hammant 02/03/04 08:08:54 Modified:altrmi/src/java/org/apache/commons/altrmi/client/impl/stream ClientCustomStreamReadWriter.java Log: better var names Revision ChangesPath 1.4 +5 -5 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/stream/ClientCustomStreamReadWriter.java Index: ClientCustomStreamReadWriter.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/stream/ClientCustomStreamReadWriter.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ClientCustomStreamReadWriter.java 4 Mar 2002 12:10:49 - 1.3 +++ ClientCustomStreamReadWriter.java 4 Mar 2002 16:08:54 - 1.4 @@ -25,13 +25,13 @@ * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version $Revision: 1.3 $ + * @version $Revision: 1.4 $ */ public class ClientCustomStreamReadWriter extends ClientStreamReadWriter { private DataInputStream mDataInputStream; private DataOutputStream mDataOutputStream; -private ClassLoader mClassLoader; +private ClassLoader mInterfacesClassLoader; /** * Constructor ClientCustomStreamReadWriter @@ -43,11 +43,11 @@ * @throws IOException * */ -public ClientCustomStreamReadWriter(InputStream inputStream, OutputStream outputStream, ClassLoader classLoader) +public ClientCustomStreamReadWriter(InputStream inputStream, OutputStream outputStream, ClassLoader interfacesClassLoader) throws IOException { mDataOutputStream = new DataOutputStream(new BufferedOutputStream(outputStream)); mDataInputStream = new DataInputStream(inputStream); -mClassLoader = classLoader; +mInterfacesClassLoader = interfacesClassLoader; } protected synchronized AltrmiReply postRequest(AltrmiRequest altrmiRequest) @@ -74,6 +74,6 @@ mDataInputStream.read(byteArray); -return (AltrmiReply) SerializationHelper.getInstanceFromBytes(byteArray, mClassLoader); +return (AltrmiReply) SerializationHelper.getInstanceFromBytes(byteArray, mInterfacesClassLoader); } } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: [AltRMI] What is the client/server connection life cycle?
Alvin, Hi, I think there is no ready-made here to increase the Ping duration. But one can do (for now) stop the pinger by doing something like: HostContext.getInvocationHandler().close() . Checkout the impl'n: *.altrmi.client.AbstractClientInvocationHandler.close() method ... What Viany says is true. But you have another option - you can if you want replace the DefaultConnectionPinger with PerpetualConnectionPinger or one that you write yourself in your codebase. It is designed to be settable. Maybe as you mentioned rightly , This should be implemented at each ConcreteInvocationHandler level too so that they can also close/release the socket connections to the server. A transport that establishes new connections per invocation ? I think that could work but be amazingly slow. Is not the proposition that it is some sort of thread sharing solution on the server side. A few other teams have done this sort of work on sockets at Apache, I'll see what code can be stolen.. How does the client indicate that there are no more requests for a long time [ie: waiting for the user's next command]? At the moment, the client does nothing proactive to say that the connection is idle. I am sure we could patch into the pinging mechanism so that the server could note that is the 20th ping without real method request. We are thinking about our distributed garbage collection needs. That is, when a client has truly finished with a proxy on the client side it is dropped by AltRMI on that side too and then communicated back to the server that it is no longer in use by that client. This could be done by something that is working like the pinger, in that periodically a weak hash map is perused looking for dead entries, elements are then trimmed from the map and reported as such to the server (or reported then trimmed). Maybe the last issue here is that we are still evolving AltRMI. We are pleased to a see others using it, but you must be aware that we have not tested this for bullet-proof-ness. That said we would welcome ideas, patches and even involvement from interested parties such as yourself. Regards, - Paul H -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: [GUMP] Build Failure - altrmi
Ted [javac] import org.beepcore.beep.core.BEEPException; [javac] ^ Thanks dude, but I cannot understand why GUMP is flagging this. The dependant jar was booked in too and implicated in the build file. - Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/beep - New directory
hammant 02/02/27 06:34:04 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/beep - New directory -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/beep - New directory
hammant 02/02/27 06:34:39 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/beep - New directory -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/altrmi/lib - New directory
hammant 02/02/27 06:45:08 jakarta-commons-sandbox/altrmi/lib - New directory -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test BeepClientTest.java BeepServerTest.java
hammant 02/02/27 06:47:36 Modified:altrmi build.xml tests2.xml Added: altrmi/lib beepcore.jar altrmi/src/java/org/apache/commons/altrmi/client/impl/beep BEEPHostContext.java BEEPInvocationHandler.java altrmi/src/java/org/apache/commons/altrmi/server/impl/beep AltrmiBEEPServerProfile.java BEEPServerConnection.java CompleteBEEPServer.java ServerBEEPReadWriter.java altrmi/src/java/org/apache/commons/altrmi/test BeepClientTest.java BeepServerTest.java Log: prototype BEEP usage Revision ChangesPath 1.8 +4 -1 jakarta-commons-sandbox/altrmi/build.xml Index: build.xml === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/build.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- build.xml 1 Feb 2002 00:17:00 - 1.7 +++ build.xml 27 Feb 2002 14:47:36 - 1.8 @@ -3,7 +3,7 @@ !-- Alternative (to) RMI component of the Jakarta Commons Subproject -$Id: build.xml,v 1.7 2002/02/01 00:17:00 hammant Exp $ +$Id: build.xml,v 1.8 2002/02/27 14:47:36 hammant Exp $ -- @@ -81,6 +81,9 @@ path id=compile.classpath pathelement location=${build.home}/classes/ pathelement location=${commons-collections.jar}/ +fileset dir=lib + include name=*.jar / +/fileset /path !-- == Test Execution Defaults === -- 1.2 +40 -5 jakarta-commons-sandbox/altrmi/tests2.xml Index: tests2.xml === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/tests2.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- tests2.xml18 Feb 2002 21:40:28 - 1.1 +++ tests2.xml27 Feb 2002 14:47:36 - 1.2 @@ -3,7 +3,7 @@ !-- Alt (to) RMI component of the Jakarta Commons Subproject -$Id: tests2.xml,v 1.1 2002/02/18 21:40:28 hammant Exp $ +$Id: tests2.xml,v 1.2 2002/02/27 14:47:36 hammant Exp $ -- @@ -48,7 +48,7 @@ path id=testB1.classpath pathelement location=${build.home}/classes/ -pathelement location=${build.home}/classes3/ +pathelement location=${build.home}/classes2/ /path path id=testB2.classpath @@ -57,9 +57,22 @@ path id=testC1.classpath pathelement location=${build.home}/classes/ -pathelement location=D:/jdk1.4/lib/tools.jar/ +pathelement location=${build.home}/classes2/ +!-- beep libraries -- +fileset dir=lib + include name=*.jar / +/fileset + /path - + path id=testC2.classpath +pathelement location=${build.home}/classes/ +!-- beep libraries -- +fileset dir=lib + include name=*.jar / +/fileset + + /path + @@ -110,7 +123,14 @@ pathelement location=${build.home}/classes/ /classpath /altrmiinterfaces - + altrmiinterfaces genname=Hello srcgendir=${build.home}/genjava +classgendir=${build.home}/classes2 +classesorinterfaces=org.apache.commons.altrmi.test.TestInterface +additionalfacades=org.apache.commons.altrmi.test.TestInterface2 + classpath +pathelement location=${build.home}/classes/ + /classpath +/altrmiinterfaces /target target name=procon-serve @@ -128,5 +148,20 @@ arg value=ObjectStream/ /java /target + + target name=beep-serve +java classname=org.apache.commons.altrmi.test.BeepServerTest fork=true + classpath refid=testC1.classpath/ + arg value=S/ +/java + /target + + target name=beep-client depends=generate +java classname=org.apache.commons.altrmi.test.BeepClientTest fork=true + classpath refid=testC2.classpath/ + arg value=S/ +/java + /target + /project 1.1 jakarta-commons-sandbox/altrmi/lib/beepcore.jar Binary file 1.1 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/beep/BEEPHostContext.java Index: BEEPHostContext.java === /* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE.txt file. */ package org.apache.commons.altrmi.client.impl.beep; import
Re: [AltRMI] (PATCH) BEEP wire
Vinay, Committed dude. When you next do a zip of source for me, can you leave out the cvs dirs ;-) Cheers dude :-) Hi Paul, Presenting the BEEP transport layer for AltRMI NEW PACKAGES: org.apache.commons.altrmi.client.impl.beep.* org.apache.commons.altrmi.server.impl.beep.* For now I have built an independent test suite(BeepClient/ServerTest), but I guess this can be merged onto SocketClient/ServerTest suite too Ant script puts the /lib folder into the classpath , and thats where the beep library (beepcore.jar) xerces wud go .. (Haven't attached the libraries here though .) tests2.xml have been updated with the 'beep-serve' and 'beep-client' targets too .. (This time I have NO batch files :-)) ) he he :-) We can benchmark it with Socket layer too. (It might performs well too compared to the '2 socket connection' approach when callbacks come into picture..) I see that you have a complete BEEP Factory and HostContext. That's a lot of work you have done. Some reading for me to do later! Question for others : If we include a BSD licensed jar (to compile against and resitribute) do we have to include it's license too... or just credit the origin. Regards, - Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: [AltRMI] multiplexing over single connection
Vinay, Paul, So would the right place to export an Object from an API standpoint be : AltrmiFactory.exposeObject(Object o); You mean in the context of BEEP and the layer it represents inside AltRMI ? I don't quite understand what you are asking here AltrmiFactory is a client-side class, you would not call anythin on it to publish (exposeObject is publishig right?). BEEP would be used to allow us to have listeners straddling two VMs. Consider the well understood PropertyChangeListener. Server side : interface XyzService { void addListener(PropertyChangeListener pcl); } Client side : class MyClient implements PropertyChangeListener { XyzService xyzService; public MyClient() { xyzService = lookup( // via AltRMI xyzService.addListener(this); } public void propertyChange(PropertyChangeEvent evt) { System.out.println(Server has performed callback - + evt.toString()); } } What we see there is the client reaching out to the server as usual (lookup), but then registering itself as a suitable listener. Completely asynchronously, the server can call the applicable method on the client, even if there is TCP/IP in the way. We need at least two channels open to do this. One (as we have now) to allow the client to invoke methods on the server and the second to allow async invokation of methods on the client from the server. - Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/generator ProxyGeneratorImpl.java
hammant 02/02/25 12:32:57 Modified:altrmi/src/java/org/apache/commons/altrmi/client/impl BaseServedObject.java altrmi/src/java/org/apache/commons/altrmi/generator ProxyGeneratorImpl.java Log: renames for simplicity Revision ChangesPath 1.9 +7 -7 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/BaseServedObject.java Index: BaseServedObject.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/BaseServedObject.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- BaseServedObject.java 2 Feb 2002 12:18:02 - 1.8 +++ BaseServedObject.java 25 Feb 2002 20:32:56 - 1.9 @@ -30,7 +30,7 @@ * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version $Revision: 1.8 $ + * @version $Revision: 1.9 $ */ public final class BaseServedObject { @@ -78,7 +78,7 @@ } /** - * Method altrmiProcessObjectRequest + * Method processObjectRequestGettingFacade * * * @param methodSignature @@ -90,7 +90,7 @@ * @throws Throwable * */ -public Object altrmiProcessObjectRequestGettingFacade( +public Object processObjectRequestGettingFacade( String methodSignature, Object[] args, String objectName) throws Throwable { boolean arrayRetVal = objectName.endsWith([]); @@ -168,7 +168,7 @@ } /** - * Method altrmiProcessObjectRequest + * Method processObjectRequest * * * @param methodSignature @@ -179,7 +179,7 @@ * @throws Throwable * */ -public Object altrmiProcessObjectRequest(String methodSignature, Object[] args) +public Object processObjectRequest(String methodSignature, Object[] args) throws Throwable { MethodRequest request = new MethodRequest(mPublishedServiceName, mObjectName, @@ -201,7 +201,7 @@ } /** - * Method altrmiProcessVoidRequest + * Method processVoidRequest * * * @param methodSignature @@ -210,7 +210,7 @@ * @throws Throwable * */ -public void altrmiProcessVoidRequest(String methodSignature, Object[] args) throws Throwable { +public void processVoidRequest(String methodSignature, Object[] args) throws Throwable { MethodRequest request = new MethodRequest(mPublishedServiceName, mObjectName, methodSignature, args, mReferenceID, mSession); 1.4 +4 -4 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/generator/ProxyGeneratorImpl.java Index: ProxyGeneratorImpl.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/generator/ProxyGeneratorImpl.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ProxyGeneratorImpl.java 24 Feb 2002 11:04:32 - 1.3 +++ ProxyGeneratorImpl.java 25 Feb 2002 20:32:56 - 1.4 @@ -32,7 +32,7 @@ * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version $Revision: 1.3 $ + * @version $Revision: 1.4 $ */ public class ProxyGeneratorImpl extends AbstractMethodHandler implements ProxyGenerator { @@ -277,21 +277,21 @@ mClassSource.println(try {); if (rClass.equals(void)) { -mClassSource.println( mBaseServedObject.altrmiProcessVoidRequest(\ +mClassSource.println( mBaseServedObject.processVoidRequest(\ + methodSignature.toString() + \,args);); } else { boolean isFacadeRetVal = isAdditionalFacade(method.getReturnType()); if (isFacadeRetVal) { mClassSource.println( - Object retVal = mBaseServedObject.altrmiProcessObjectRequestGettingFacade(\ + Object retVal = mBaseServedObject.processObjectRequestGettingFacade(\ + methodSignature.toString() + \,args,\ + encodeClassName(getClassType(rClass)) + \);); mClassSource.println( return ( + getClassType(rClass) + ) retVal;); } else { mClassSource.println
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client AltrmiFactoryFactory.java
hammant 02/02/25 13:27:18 Added: altrmi/src/java/org/apache/commons/altrmi/client AltrmiFactoryFactory.java Log: Initial design for FactoryFactory Revision ChangesPath 1.1 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/AltrmiFactoryFactory.java Index: AltrmiFactoryFactory.java === /* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE.txt file. */ package org.apache.commons.altrmi.client; import java.io.IOException; /** * Interface AltrmiFactory * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a * @version $Revision: 1.1 $ */ public interface AltrmiFactoryFactory { /** * Method getFactory * * * @param factoryString * * @return * * */ AltrmiFactory getFactory(String factoryString); } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
[AltRMI] Initial design for FactoryFactory
Vinay, Related to our need for a) JNDI lookup and b) server redirection Take a look org.apache.commons.altrmi.client.AltrmiFactoryFactory. A default impl of that interface could have a set of registered 'providers' that could could construct or reuse an AltrmiFactory for a given factory-string. Those factory strings could be like: altrmi:object-stream:hostname:1234 altrmi:custom-stream:hostname: altrmi:rmi:hostname The default impl of AltrmiFactoryFactory would use the existing AltrmiFactory impls, an alternate container like EOB could use it's own. Thoughts? - Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: [AltRMI] multiplexing over single connection
Vinay, Paul, I was aiming along the lines of UnicastRemoteObject.exportObject(Remote obj) . For the EventNotifier example I was trying to come with , the Subscriber exports itself and passes the reference of it to the Server. Subscriber: // SubscriberInterface.java public interface SubscriberInterface extends java.rmi.Remote { void inform(Event event) throws java.rmi.RemoteException; } Hey dude, you're scaring me with RMI interfaces! And ConcreteSubscriber does something like ConcreteSub() { UnicastRemoteObject.exportObject(this); } So what you are proposing with PropertyChangeListeners It was just an example of a use of call-back. would also work in my scenario too since there I would be passing the PropertyChangeListener objs to the server rather than a custom Subscriber_stub. But this was the direction I was coming from ... comments.? Publish/Subscriber heh? I think you know more about where you want to go with this than I do. Pub/Sub is just an fancy name for callbacks not so? Are we not talking about the same thing? - Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test DirectMarshalledTest.java DirectTest.java PipeTest.java RmiServerTest.java SocketServerTest.java
hammant 02/02/24 03:04:33 Modified:altrmi/src/java/org/apache/commons/altrmi/common ProxyGenerator.java altrmi/src/java/org/apache/commons/altrmi/generator ProxyGeneratorImpl.java altrmi/src/java/org/apache/commons/altrmi/server AltrmiProxyGenerator.java AltrmiPublisher.java altrmi/src/java/org/apache/commons/altrmi/server/impl AbstractServer.java altrmi/src/java/org/apache/commons/altrmi/server/impl/adapters PublicationAdapter.java altrmi/src/java/org/apache/commons/altrmi/server/impl/classretrievers DynamicGeneratorClassRetriever.java altrmi/src/java/org/apache/commons/altrmi/test DirectMarshalledTest.java DirectTest.java PipeTest.java RmiServerTest.java SocketServerTest.java Added: altrmi/src/java/org/apache/commons/altrmi/server PublicationDescription.java Log: Refactorings to allow more expansion in future Revision ChangesPath 1.2 +75 -2 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/common/ProxyGenerator.java Index: ProxyGenerator.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/common/ProxyGenerator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ProxyGenerator.java 30 Jan 2002 23:42:44 - 1.1 +++ ProxyGenerator.java 24 Feb 2002 11:04:32 - 1.2 @@ -9,21 +9,94 @@ package org.apache.commons.altrmi.common; + /** * Class ProxyGenerator * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ */ public interface ProxyGenerator { +/** + * Method setClassOrInterfacesToExpose + * + * + * @param classesOrInterfacesToExpose + * + */ public void setClassOrInterfacesToExpose(Class[] classesOrInterfacesToExpose); + +/** + * Method setAdditionalfacades + * + * + * @param additionalFacades + * + */ public void setAdditionalfacades(Class[] additionalFacades); + +/** + * Method setSrcGenDir + * + * + * @param srcGenDir + * + */ public void setSrcGenDir(String srcGenDir); + +/** + * Method setClasspath + * + * + * @param classpath + * + */ public void setClasspath(String classpath); + +/** + * Method setClassGenDir + * + * + * @param classGenDir + * + */ public void setClassGenDir(String classGenDir); + +/** + * Method setGenName + * + * + * @param genName + * + */ public void setGenName(String genName); + +/** + * Method generateSrc + * + * + * @param cL + * + * @throws ProxyGenerationException + * + */ public void generateSrc(ClassLoader cL) throws ProxyGenerationException; + +/** + * Method generateClass + * + * + * @param cL + * + */ public void generateClass(ClassLoader cL); -} \ No newline at end of file + +/** + * Method generateDeferredClasses + * + * + */ +public void generateDeferredClasses(); +} 1.3 +81 -22 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/generator/ProxyGeneratorImpl.java Index: ProxyGeneratorImpl.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/generator/ProxyGeneratorImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ProxyGeneratorImpl.java 1 Feb 2002 00:16:38 - 1.2 +++ ProxyGeneratorImpl.java 24 Feb 2002 11:04:32 - 1.3 @@ -32,7 +32,7 @@ * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ */ public class ProxyGeneratorImpl extends AbstractMethodHandler implements ProxyGenerator { @@ -67,14 +67,35 @@ mAdditionalFacades = additionalFacades; } +/** + * Method setSrcGenDir + * + * + * @param srcGenDir + * + */ public void setSrcGenDir(String srcGenDir) { mSrcGenDir = srcGenDir; } +/** + * Method setClasspath + * + * + * @param classpath + * + */ public void
[AltRMI] Changes to publication API
Folks, As per Vinay's suggestion of a couple of weeks ago, a PublicationDescription object is now passed in to the one of two paublish(..) methods rather than have this overloaded six or so times. - Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: [AltRMI] multiplexing over single connection
Vinay, Yes you are right BEEP looks better. There is a BSD impl on SF :- http://sourceforge.net/projects/beepcore-java/ I don't think it is an issue for Request/Reply as it is a layer between AltrmiInvocationHandler and the true streaming mechanism... - Paul Hi, dghmux seems kewl, However BEEP addresses this in a much broader and *standard* compliant way . It even has a tunnel 'profile' to take care of the NAT issues too . This might be viral to the Altrmi codebase as it might influence the way Request/Reply objects are sent across the wire ..(not sure though).. Any BEEP experts who can throw light here ?? Regards, V i n a y. --- Paul Hammant [EMAIL PROTECTED] wrote: Folks, To solve the callback feature for AltRMI This was the sourceforge project : http://dghmux-java.sourceforge.net/ It is LGPL which is OKish for Apache use. I kinda prefer two connections though, if the client opens both then there are no NAT problems. The OpenConnectionRequest class could be expanded to have a parameter that indicates server-is-listener or client-is-listener. Thoughts? - Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: [AltRMI] Event Notifier
Vinay, Anyways on another page , I feel it would be good exercise to have the Event Notifier pattern working over AltRMI transport, something along the lines of the same pattern over RMI .(ref http://www.javareport.com/html/from_pages/oldarticles.asp?ArticleID=132 ) This would neccessiate a form of callbacks to be made avaliable within the Altrmi realm. Maybe by keeping a Message-Loop Thread at the client-end Open for receipt of REQUEST messages back from the server. Essentially implying REQUEST messages can flow from the server to the client too :-) Yup this would be cool. The problem as I see is that we would have to have a second connection open. I am sure smarter people could get duplex working over one connection usine notify/wait etc, but I can't see the solution without two connections (one for the server to listen on and one for the client to listen on). Does anyone have any experience on duplex over one socket connection? There was also that (LGPL) project at sourceforge that could multiplex any traffic over one connection. It was very good in that it could shove data before it was even picked up at the other end. Not so relevent to us as we have multiple transports types... This can again form one those so called (non-junit) *test* cases which actually does more than *testing*. He he. - Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/common SerializationHelper.java
hammant 02/02/18 13:19:56 Modified:altrmi/src/java/org/apache/commons/altrmi/common SerializationHelper.java Log: correct header Revision ChangesPath 1.3 +6 -6 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/common/SerializationHelper.java Index: SerializationHelper.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/common/SerializationHelper.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- SerializationHelper.java 2 Feb 2002 23:39:41 - 1.2 +++ SerializationHelper.java 18 Feb 2002 21:19:56 - 1.3 @@ -1,10 +1,10 @@ + /* - * Created by IntelliJ IDEA. - * User: Administrator - * Date: Jan 26, 2002 - * Time: 2:36:56 PM - * To change template for new class use - * Code Style | Class Templates options (Tools | IDE Options). + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. */ package org.apache.commons.altrmi.common; -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
[AltRMI] Two way weak hashmap for distributed garbage collection
Folks, I have searched for, but cannot find, a posting in this mail list some while ago that offered a two way hashmap. We think we might be able to use it for distributed garbage collection. Background : AltRMI creates a clientside stub for each server side facade reference in use. On the client side this is two hash maps. One allowing lookup of instance based on reference key (a Long at the moment), and one that allows the reverse lookup. I'd like to move to some better design that will allow the client side garbage collector (I am on about the one built into the JVM) to allow purges from the map. Clearly we need to move to an impl based on Weak References and also to an impl that is more efficient that to mutually pointing hashmaps. Once that purging map were in place the clientside factory could invisibly communicate back to the server which references were no longer used by a session. Thus in some stuttering nature, the distributed garbage collection works. Does anyone know where that hash map impl is? Did it get combined into commons-collections? - Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: [AltRMI] Two way weak hashmap for distributed garbage collection
Juozas, Thanks but I have had an on/off relationshp with finalize() from 1998 onwards. Sun even give advice on why it should not be used. It is a WeakReference soltution I am looing for. - Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: [AltRMI] Two way weak hashmap for distributed garbage collection
Juozas, I 99% sure RMI distributed GC implementation baset on finalize(), Not in 1.3.1 nor in 1.4 (I have checked). There are some 20 other uses though. This bug http://developer.java.sun.com/developer/bugParade/bugs/4148454.html and others show why finalize() is dodgy. - Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: [AltRMI] Pass-by-reference redirection
Vinay, altrmi:transport-type:host-details:service-name:reference-id *Redirection* would also imply a protocol(REQUEST obj maybe ) which allows ServerB to tell ServerA to register a remote object for him . I was thinking of a solution for the immedate need (refer EOB people example) : Server 1 (Bean 1) Address Factory, Manages Address Server 2 (Bean 2) People Factory, Manages People and their addresses Client 1 (Bean 3) : Gets Bean1, makes a person. Gets Bean2 makes an address. For its person remote ref, on bean1 sets the address to that made above. In this case the ref the client has a problem in that it is trying to pass a remote ref from server 1 to server 2. Of course the client knows nothing of this. Anyway, to summarise, the two servers have instances already, it is just that for one setAddress method in server 2, the adress being used is also from a remote reference. This is the area that EJB steps into keys for to solve. Maybe this goal (to have a 100% reference solution) is impossible. So I don't think the immedaite need is for ServerA to register a remote object for him , but for serverA to tell server B that it has a remote inst that is being held for it . For the immediate need anyway. Regards, - Paul H -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/stream StreamInvocationHandler.java
hammant 02/02/04 13:07:07 Modified:altrmi/src/java/org/apache/commons/altrmi/client/impl AbstractHostContext.java altrmi/src/java/org/apache/commons/altrmi/client/impl/stream StreamInvocationHandler.java Log: small chages for EOB Revision ChangesPath 1.2 +2 -2 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/AbstractHostContext.java Index: AbstractHostContext.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/AbstractHostContext.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- AbstractHostContext.java 21 Jan 2002 15:38:20 - 1.1 +++ AbstractHostContext.java 4 Feb 2002 21:07:07 - 1.2 @@ -21,7 +21,7 @@ * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ */ public class AbstractHostContext implements AltrmiHostContext { @@ -37,7 +37,7 @@ */ public AbstractHostContext( AltrmiClientInvocationHandler altrmiClientInvocationHandler) { -this.mAltrmiClientInvocationHandler = altrmiClientInvocationHandler; +mAltrmiClientInvocationHandler = altrmiClientInvocationHandler; } /** 1.5 +2 -1 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/stream/StreamInvocationHandler.java Index: StreamInvocationHandler.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/stream/StreamInvocationHandler.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- StreamInvocationHandler.java 26 Jan 2002 13:51:34 - 1.4 +++ StreamInvocationHandler.java 4 Feb 2002 21:07:07 - 1.5 @@ -37,7 +37,7 @@ * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version $Revision: 1.4 $ + * @version $Revision: 1.5 $ */ public abstract class StreamInvocationHandler extends AbstractClientInvocationHandler { @@ -97,6 +97,7 @@ again = false; try { + long t1 = System.currentTimeMillis(); reply = (AltrmiReply) mObjectReadWriter.postRequest(request); -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl AbstractAltrmiFactory.java BaseServedObject.java ClientClassAltrmiFactory.java ServerClassAltrmiFactory.java
hammant 02/02/02 04:18:02 Modified:altrmi/src/java/org/apache/commons/altrmi/client/impl AbstractAltrmiFactory.java BaseServedObject.java ClientClassAltrmiFactory.java ServerClassAltrmiFactory.java Log: alternate facades as arrays/retval now works in a more classloader aware manner. Revision ChangesPath 1.13 +3 -1 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/AbstractAltrmiFactory.java Index: AbstractAltrmiFactory.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/AbstractAltrmiFactory.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- AbstractAltrmiFactory.java1 Feb 2002 00:16:38 - 1.12 +++ AbstractAltrmiFactory.java2 Feb 2002 12:18:02 - 1.13 @@ -31,7 +31,7 @@ * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version $Revision: 1.12 $ + * @version $Revision: 1.13 $ */ public abstract class AbstractAltrmiFactory implements AltrmiFactory { @@ -95,6 +95,8 @@ //TODO } } + +protected abstract Class getFacadeClass(String publishedServiceName, String objectName, boolean beanOnly) throws AltrmiConnectionException, ClassNotFoundException; protected abstract Object getInstance( String publishedServiceName, String objectName, BaseServedObject baseServedObject, 1.8 +3 -2 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/BaseServedObject.java Index: BaseServedObject.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/BaseServedObject.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- BaseServedObject.java 1 Feb 2002 00:16:38 - 1.7 +++ BaseServedObject.java 2 Feb 2002 12:18:02 - 1.8 @@ -30,7 +30,7 @@ * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version $Revision: 1.7 $ + * @version $Revision: 1.8 $ */ public final class BaseServedObject { @@ -130,7 +130,8 @@ } } else if (reply.getReplyCode() == AltrmiReply.METHODFACADEARRAYREPLY) { MethodFacadeArrayReply mfar = (MethodFacadeArrayReply) reply; -Class clazz = Class.forName(objNameWithoutArray.replace('$','.')); +Class clazz = mAltrmiFactory.getFacadeClass(mPublishedServiceName, objNameWithoutArray, + mAltrmiFactory.isBeanOnly()); Long[] refs = mfar.getReferenceIDs(); Object[] implBeans = (Object[]) Array.newInstance(clazz, refs.length); 1.9 +13 -7 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/ClientClassAltrmiFactory.java Index: ClientClassAltrmiFactory.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/ClientClassAltrmiFactory.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- ClientClassAltrmiFactory.java 30 Jan 2002 23:42:44 - 1.8 +++ ClientClassAltrmiFactory.java 2 Feb 2002 12:18:02 - 1.9 @@ -29,7 +29,7 @@ * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version $Revision: 1.8 $ + * @version $Revision: 1.9 $ */ public class ClientClassAltrmiFactory extends AbstractAltrmiFactory { @@ -92,6 +92,17 @@ return retVal; } +protected Class getFacadeClass(String publishedServiceName, String objectName, boolean beanOnly) throws AltrmiConnectionException, ClassNotFoundException { +String code = 2; + +if (beanOnly) { +code = ; +} + +return Class.forName(AltrmiGenerated + code + publishedServiceName + _ ++ objectName); +} + /** * Method getInstance * @@ -109,15 +120,10 @@ boolean beanOnly) throws AltrmiConnectionException { -String code = 2; -if (beanOnly) { -code = ; -} try { -Class clazz = Class.forName(AltrmiGenerated + code + publishedServiceName + _ -+ objectName); +Class clazz = getFacadeClass(publishedServiceName, objectName, beanOnly); Constructor[] constructors
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test TestClient.java TestInterface.java TestInterfaceImpl.java
hammant 02/01/31 16:16:38 Modified:altrmi/src/java/org/apache/commons/altrmi/client/impl AbstractAltrmiFactory.java BaseServedObject.java ServerClassAltrmiFactory.java altrmi/src/java/org/apache/commons/altrmi/common AltrmiReply.java MethodFacadeRequest.java altrmi/src/java/org/apache/commons/altrmi/generator ProxyGeneratorImpl.java altrmi/src/java/org/apache/commons/altrmi/server/impl DefaultMethodInvocationHandler.java altrmi/src/java/org/apache/commons/altrmi/server/impl/adapters InovcationHandlerAdapter.java altrmi/src/java/org/apache/commons/altrmi/test TestClient.java TestInterface.java TestInterfaceImpl.java Added: altrmi/src/java/org/apache/commons/altrmi/client AltrmiProxy.java altrmi/src/java/org/apache/commons/altrmi/common MethodFacadeArrayReply.java Log: alternate facades can be arrays in return types Revision ChangesPath 1.1 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/AltrmiProxy.java Index: AltrmiProxy.java === /* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE.txt file. */ package org.apache.commons.altrmi.client; /** * Interface AltrmiProxy * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a * @version $Revision: 1.1 $ */ public interface AltrmiProxy { } 1.12 +2 -14 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/AbstractAltrmiFactory.java Index: AbstractAltrmiFactory.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/AbstractAltrmiFactory.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- AbstractAltrmiFactory.java30 Jan 2002 23:42:44 - 1.11 +++ AbstractAltrmiFactory.java1 Feb 2002 00:16:38 - 1.12 @@ -31,7 +31,7 @@ * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version $Revision: 1.11 $ + * @version $Revision: 1.12 $ */ public abstract class AbstractAltrmiFactory implements AltrmiFactory { @@ -48,6 +48,7 @@ * * * @param beanOnly + * @param classLoader * */ public AbstractAltrmiFactory(boolean beanOnly, ClassLoader classLoader) { @@ -95,19 +96,6 @@ } } -/** - * Method getInstance - * - * - * @param publishedServiceName - * @param String objectName - * @param BaseServedObject baseServedObject - * - * @return - * - * @throws AltrmiConnectionException - * - */ protected abstract Object getInstance( String publishedServiceName, String objectName, BaseServedObject baseServedObject, boolean beanOnly) throws AltrmiConnectionException; 1.7 +47 -4 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/BaseServedObject.java Index: BaseServedObject.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/BaseServedObject.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- BaseServedObject.java 17 Jan 2002 12:14:28 - 1.6 +++ BaseServedObject.java 1 Feb 2002 00:16:38 - 1.7 @@ -20,6 +20,9 @@ import org.apache.commons.altrmi.common.MethodFacadeReply; import org.apache.commons.altrmi.common.MethodFacadeRequest; import org.apache.commons.altrmi.common.FacadeRefHolder; +import org.apache.commons.altrmi.common.MethodFacadeArrayReply; + +import java.lang.reflect.Array; /** @@ -27,7 +30,7 @@ * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version $Revision: 1.6 $ + * @version $Revision: 1.7 $ */ public final class BaseServedObject { @@ -90,9 +93,21 @@ public Object altrmiProcessObjectRequestGettingFacade( String methodSignature, Object[] args, String objectName) throws Throwable { -MethodFacadeRequest request = new MethodFacadeRequest(mPublishedServiceName, mObjectName
cvs commit: jakarta-commons-sandbox/altrmi build.xml tests.xml
hammant 02/01/31 16:17:00 Modified:altrmi build.xml tests.xml Log: alternate facades can be arrays in return types Revision ChangesPath 1.7 +6 -4 jakarta-commons-sandbox/altrmi/build.xml Index: build.xml === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/build.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- build.xml 30 Jan 2002 23:42:44 - 1.6 +++ build.xml 1 Feb 2002 00:17:00 - 1.7 @@ -3,7 +3,7 @@ !-- Alternative (to) RMI component of the Jakarta Commons Subproject -$Id: build.xml,v 1.6 2002/01/30 23:42:44 hammant Exp $ +$Id: build.xml,v 1.7 2002/02/01 00:17:00 hammant Exp $ -- @@ -177,8 +177,7 @@ /target - target name=dist depends=compile,javadoc - description=Create binary distribution + target name=jars depends=compile mkdir dir=${dist.home}/ copy file=../LICENSE todir=${dist.home}/ @@ -222,5 +221,8 @@ /jar /target - + + target name=dist depends=jars, javadoc + description=Create binary distribution + /target /project 1.6 +2 -4 jakarta-commons-sandbox/altrmi/tests.xml Index: tests.xml === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/tests.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- tests.xml 28 Jan 2002 10:27:06 - 1.5 +++ tests.xml 1 Feb 2002 00:17:00 - 1.6 @@ -3,7 +3,7 @@ !-- Alt (to) RMI component of the Jakarta Commons Subproject -$Id: tests.xml,v 1.5 2002/01/28 10:27:06 hammant Exp $ +$Id: tests.xml,v 1.6 2002/02/01 00:17:00 hammant Exp $ -- @@ -231,9 +231,7 @@ /target target name=pipedc depends=generate - -echoee ${java.home}/echo - + java classname=org.apache.commons.altrmi.test.PipeTest fork=true classpath refid=testC1.classpath/ arg value=D/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Commons/Avalon [was Re: [Logging] [VOTE] Commons Logging 1.0 Release]
Sam, Another perspective is that inter subproject sharing at a granularity lower than the subproject has rarely been successful. Things originally identified as reusable components often ended up getting dependencies on ever increasing portions of the subproject. At the time commons was created, Avalon was notorious for changing interfaces without even so much as a moments notice. The rationalle given was that Avalon was still in alpha - interminably so. I am not sure that is so correct. There have been refactorings, but old abstractions were kept as deprecated for quite while. The only way a developer who dependended on the component could get a say in the matter was to become a committer in the subproject at large. In the case of Avalon, this meant becoming a committer to the entire framework: jakarta-avalon, jakarta-avalon-testlet, jakarta-avalon-logkit, jakarta-avalon-phoenix, jakarta-avalon-cornerstone, jakarta-avalon-excalibur, and jakarta-avalon-site. In other words, they were required to follow an absurd rule allows people to vote on something they dont use/develope and never plant to use/develope. With respect, all the above are a single commit right. I could be wrong on jakarta-avalon-site through, but that is not relevant to this discussion. Avalon people willfully accomodate the needs of JAMES and Cocoon people inside Apache and plenty of those interested outside Apache. We frequently reach out to other teams in very polite, respectful and concilliatory terms. So commons was created. It is explicitly designed as a place for people who play well with others. And after some initial growing pains appears to be working. - Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Commons/Avalon [was Re: [Logging] [VOTE] Commons Logging 1.0 Release]
Folks, We frequently reach out to other teams in very polite, respectful and concilliatory terms. Time for a little commit relief: My name is Avalon Server Famework, Commander of the Servers of Java, General of the component Legions, loyal servant to the true emperor, Inversion of Control. Father to a lifecycled bean, husband to a lifecycled container. And I will have my vengeance, on this main() or the next. Yup a paraphrased Gladiator quote for some fun. The central idea is that apps that are only launchable by main() are not very embeddable in others. It is also a clearly a reminder of one of the main design patterns behind Avalon - Inversion of Control. Regards, - Paul H -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test DirectTest.java
hammant 02/01/29 02:05:00 Modified:altrmi/src/java/org/apache/commons/altrmi/server AltrmiPublisher.java altrmi/src/java/org/apache/commons/altrmi/server/impl AbstractServer.java altrmi/src/java/org/apache/commons/altrmi/server/impl/adapters InovcationHandlerAdapter.java altrmi/src/java/org/apache/commons/altrmi/test DirectTest.java Added: altrmi/src/java/org/apache/commons/altrmi/server MethodInvocationHandler.java altrmi/src/java/org/apache/commons/altrmi/server/impl DefaultMethodInvocationHandler.java altrmi/src/java/org/apache/commons/altrmi/server/impl/adapters PublicationAdapter.java Removed: altrmi/src/java/org/apache/commons/altrmi/server ServerInvocationHandler.java altrmi/src/java/org/apache/commons/altrmi/server/impl DefaultInvocationHandler.java Log: AbstractServer refactored into comps. Revision ChangesPath 1.4 +32 -11 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/AltrmiPublisher.java Index: AltrmiPublisher.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/AltrmiPublisher.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- AltrmiPublisher.java 25 Jan 2002 16:40:13 - 1.3 +++ AltrmiPublisher.java 29 Jan 2002 10:05:00 - 1.4 @@ -1,3 +1,4 @@ + /* * Copyright (C) The Apache Software Foundation. All rights reserved. * @@ -8,12 +9,16 @@ package org.apache.commons.altrmi.server; + +import org.apache.commons.altrmi.common.MethodRequest; + + /** * Interface AltrmiServer * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version * $Revision: 1.3 $ + * @version * $Revision: 1.4 $ */ public interface AltrmiPublisher { @@ -26,7 +31,8 @@ * @param classOrInterfaceToExpose * */ -void publish(Object impl, String asName, Class classOrInterfaceToExpose) throws PublicationException; +void publish(Object impl, String asName, Class classOrInterfaceToExpose) +throws PublicationException; /** * Method publish @@ -38,7 +44,9 @@ * @param additionalFacade * */ -void publish(Object impl, String asName, Class classOrInterfaceToExpose, Class additionalFacade) throws PublicationException; +void publish( +Object impl, String asName, Class classOrInterfaceToExpose, Class additionalFacade) +throws PublicationException; /** * Method publish @@ -50,8 +58,9 @@ * @param additionalFacades * */ -void publish(Object impl, String asName, Class classOrInterfaceToExpose, Class[] additionalFacades) throws PublicationException; - +void publish( +Object impl, String asName, Class classOrInterfaceToExpose, Class[] additionalFacades) +throws PublicationException; /** * Method publish @@ -62,7 +71,8 @@ * @param classesOrInterfacesToExpose * */ -void publish(Object impl, String asName, Class[] classesOrInterfacesToExpose) throws PublicationException; +void publish(Object impl, String asName, Class[] classesOrInterfacesToExpose) +throws PublicationException; /** * Method publish @@ -74,8 +84,9 @@ * @param additionalFacades * */ -void publish(Object impl, String asName, Class[] classesOrInterfacesToExpose, Class[] additionalFacades) throws PublicationException; - +void publish( +Object impl, String asName, Class[] classesOrInterfacesToExpose, +Class[] additionalFacades) throws PublicationException; /** * Method unPublish @@ -96,8 +107,18 @@ * @param withImpl * */ -void replacePublished(Object oldImpl, String asName, Object withImpl) throws PublicationException; - - +void replacePublished(Object oldImpl, String asName, Object withImpl) +throws PublicationException; +/** + * Method getMethodInvocationHandler + * + * + * @param mr + * @param objectName + * + * @return + * + */ +MethodInvocationHandler getMethodInvocationHandler(MethodRequest mr, String objectName); } 1.1 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/MethodInvocationHandler.java Index: MethodInvocationHandler.java
Re: [PATCH] for list() functionality for AltRMI
Vinay, Thanks for these. I have applied them and they work well. Regards, - Paul H -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test DirectMarshalledTest.java
hammant 02/01/29 02:42:18 Modified:altrmi/src/java/org/apache/commons/altrmi/server/impl AbstractServer.java altrmi/src/java/org/apache/commons/altrmi/server/impl/direct DirectMarshalledServer.java DirectServer.java altrmi/src/java/org/apache/commons/altrmi/test DirectMarshalledTest.java Log: Two direct servers more modular now, in that they can take preexiting invocation handlers. Revision ChangesPath 1.18 +5 -2 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/AbstractServer.java Index: AbstractServer.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/AbstractServer.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- AbstractServer.java 29 Jan 2002 10:05:00 - 1.17 +++ AbstractServer.java 29 Jan 2002 10:42:18 - 1.18 @@ -29,13 +29,13 @@ * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version $Revision: 1.17 $ + * @version $Revision: 1.18 $ */ public abstract class AbstractServer extends AbstractMethodHandler implements AltrmiServer { private Vector mConnections = new Vector(); -private InovcationHandlerAdapter mInovcationHandlerAdapter; +protected InovcationHandlerAdapter mInovcationHandlerAdapter; protected static final int SHUTTINGDOWN = 11; protected static final int STARTED = 22; protected static final int STOPPED = 33; @@ -46,6 +46,9 @@ mInovcationHandlerAdapter = new InovcationHandlerAdapter(); } +public AbstractServer(InovcationHandlerAdapter inovcationHandlerAdapter) { +mInovcationHandlerAdapter = inovcationHandlerAdapter; +} 1.3 +64 -2 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/direct/DirectMarshalledServer.java Index: DirectMarshalledServer.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/direct/DirectMarshalledServer.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- DirectMarshalledServer.java 28 Jan 2002 14:04:54 - 1.2 +++ DirectMarshalledServer.java 29 Jan 2002 10:42:18 - 1.3 @@ -1,3 +1,4 @@ + /* * Copyright (C) The Apache Software Foundation. All rights reserved. * @@ -10,10 +11,13 @@ import org.apache.commons.altrmi.server.impl.AbstractServer; +import org.apache.commons.altrmi.server.impl.adapters.InovcationHandlerAdapter; +import org.apache.commons.altrmi.server.impl.adapters.MarshalledInovcationHandlerAdapter; import org.apache.commons.altrmi.server.AltrmiServerException; import org.apache.commons.altrmi.common.AltrmiReply; import org.apache.commons.altrmi.common.AltrmiRequest; import org.apache.commons.altrmi.common.AltrmiInvocationException; +import org.apache.commons.altrmi.common.AltrmiMarshalledInvocationHandler; /** @@ -21,11 +25,52 @@ * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ */ -public class DirectMarshalledServer extends AbstractServer { +public class DirectMarshalledServer extends AbstractServer +implements AltrmiMarshalledInvocationHandler { + +MarshalledInovcationHandlerAdapter mMarshalledInovcationHandlerAdapter; + +/** + * Constructor DirectMarshalledServer makes a new InovcationHandlerAdapter. + * + * + */ +public DirectMarshalledServer() { +mMarshalledInovcationHandlerAdapter = new MarshalledInovcationHandlerAdapter(this); +} + +/** + * Constructor DirectMarshalledServer for use with pre-exiting InovcationHandlerAdapter. + * + * + * @param inovcationHandlerAdapter + * + */ +public DirectMarshalledServer(InovcationHandlerAdapter inovcationHandlerAdapter) { +super(inovcationHandlerAdapter); +mMarshalledInovcationHandlerAdapter = new MarshalledInovcationHandlerAdapter(this); +} + +/** + * Constructor DirectMarshalledServer for use with pre-exiting InovcationHandlerAdapter and MarshalledInvocationHandler + * + * + * @param inovcationHandlerAdapter + * @param marshalledInovcationHandlerAdapter + * + */ +public DirectMarshalledServer( +InovcationHandlerAdapter inovcationHandlerAdapter, +MarshalledInovcationHandlerAdapter marshalledInovcationHandlerAdapter
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test DirectMarshalledTest.java DirectTest.java
hammant 02/01/28 06:04:55 Modified:altrmi/src/java/org/apache/commons/altrmi/server AltrmiServer.java altrmi/src/java/org/apache/commons/altrmi/server/impl AbstractServer.java StreamServerConnection.java altrmi/src/java/org/apache/commons/altrmi/server/impl/direct DirectMarshalledServer.java DirectServer.java altrmi/src/java/org/apache/commons/altrmi/server/impl/rmi RmiInovcationAdapter.java altrmi/src/java/org/apache/commons/altrmi/test DirectMarshalledTest.java DirectTest.java Added: altrmi/src/java/org/apache/commons/altrmi/server/impl/adapters InovcationHandlerAdapter.java MarshalledInovcationHandlerAdapter.java Removed: altrmi/src/java/org/apache/commons/altrmi/server/impl/direct DirectInovcationAdapter.java DirectMarshalledInovcationAdapter.java Log: Start of refactor into layers Revision ChangesPath 1.5 +3 -13 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/AltrmiServer.java Index: AltrmiServer.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/AltrmiServer.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- AltrmiServer.java 27 Jan 2002 15:47:40 - 1.4 +++ AltrmiServer.java 28 Jan 2002 14:04:54 - 1.5 @@ -12,6 +12,7 @@ import org.apache.commons.altrmi.common.AltrmiReply; import org.apache.commons.altrmi.common.AltrmiRequest; +import org.apache.commons.altrmi.common.AltrmiInvocationHandler; /** @@ -19,9 +20,9 @@ * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version * $Revision: 1.4 $ + * @version * $Revision: 1.5 $ */ -public interface AltrmiServer extends AltrmiPublisher { +public interface AltrmiServer extends AltrmiPublisher, AltrmiInvocationHandler { /** * Method setClassRetriever @@ -41,17 +42,6 @@ * */ void setAuthenticator(AltrmiAuthenticator altrmiAuthenticator); - -/** - * Method processRequest - * - * - * @param request - * - * @return - * - */ -AltrmiReply processRequest(AltrmiRequest request); /** * Method suspend 1.15 +15 -126 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/AbstractServer.java Index: AbstractServer.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/AbstractServer.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- AbstractServer.java 28 Jan 2002 10:27:06 - 1.14 +++ AbstractServer.java 28 Jan 2002 14:04:54 - 1.15 @@ -41,6 +41,7 @@ import org.apache.commons.altrmi.server.ServerInvocationHandler; import org.apache.commons.altrmi.server.AltrmiAuthenticator; import org.apache.commons.altrmi.server.impl.classretrievers.NoClassRetriever; +import org.apache.commons.altrmi.server.impl.adapters.InovcationHandlerAdapter; import org.apache.commons.altrmi.generator.PrimarySourceGenerator; import org.apache.commons.altrmi.generator.SourceGenerationException; import org.apache.tools.ant.AntClassLoader; @@ -58,25 +59,27 @@ * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version $Revision: 1.14 $ + * @version $Revision: 1.15 $ */ public abstract class AbstractServer extends AbstractMethodHandler implements AltrmiServer { -private static int SESSION = 0; + private HashMap mPublishedObjects = new HashMap(); -private Vector mSessions = new Vector(); -private Long mLastSession = new Long(0); -private boolean mSuspend = false; + private Vector mConnections = new Vector(); private ClassRetriever mClassRetriever = new NoClassRetriever(); private AltrmiAuthenticator mAltrmiAuthenticator = new DefaultAuthenticator(); +private InovcationHandlerAdapter mInovcationHandlerAdapter; protected static final int SHUTTINGDOWN = 11; protected static final int STARTED = 22; protected static final int STOPPED = 33; protected static final int UNSTARTED = 44; protected int mState = UNSTARTED; +public AbstractServer() { +mInovcationHandlerAdapter = new InovcationHandlerAdapter(mAltrmiAuthenticator, mPublishedObjects, mClassRetriever); +} /** * Method publish @@ -255,7 +258,7
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/generator/ant AltrmiInterfaceTask.java
hammant 02/01/28 06:18:08 Modified:altrmi/src/java/org/apache/commons/altrmi/generator/ant AltrmiInterfaceTask.java Log: patch from Sam to aid gump Revision ChangesPath 1.6 +1 -1 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/generator/ant/AltrmiInterfaceTask.java Index: AltrmiInterfaceTask.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/generator/ant/AltrmiInterfaceTask.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- AltrmiInterfaceTask.java 27 Jan 2002 23:51:48 - 1.5 +++ AltrmiInterfaceTask.java 28 Jan 2002 14:18:07 - 1.6 @@ -104,7 +104,7 @@ sg.setSrcGenDir(new File(mSrcGenDir).getAbsolutePath()); sg.setClassGenDir(new File(mClassGenDir).getAbsolutePath()); sg.setGenName(mGenName); -sg.setClasspath(classpath.toString()); +sg.setClasspath(classpath.concatSystemClasspath(ignore).toString()); Class[] classesOrInterfaces = new Class[mClassOrInterfacesToExpose.length]; for (int i = 0; i mClassOrInterfacesToExpose.length; i++) { String cn = mClassOrInterfacesToExpose[i]; -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: [AltRMI] New Direct-Marshalled transport type
Juozas, skip But I don't know how to handle By Value. void myMethod( MyInterfaceType mt ){ mt.setSomething(X);//Don't understand how to handle this ( is X set on copy of Object ? ) } X will be a copy of the object if pass by value or over the wire. I'm not quite sure what your asking here. Yes, communication is my problem :( I try to see framework or API as user . I see two problems in transparence. Distributed and Persistent objects have problem with Fatal Errors like Connection is lost and By Value then users code tries to set something on copy of object. Transparent objects doe's not implement any Tag Interface and doe's not throw checked Exceptions specific for way they are marshaled. // Problem 1 : users code (Fatal Errors specific for framework implementation ) void myMethodUsesTransparentObject( Transparent transparent ){ try{ transaction.begin(); transparent.doSometing();//throws some App Exception transparent.setSomething(); . transaction.commit(); }catch(SomeCheckedAppException sce){ log(sce); transaction.rollback(); } // I forgot to handle Connection is lost and compiler says nothing. // My transaction is incomplete and it is very possible I have a Lock forever on some resource. // It can be impossible to find this bug for user. We need solution, I don't have it. For the connection failures issue, the client-side user is informed via a AltrmiInvocationException. This can be caught in a number of places. My preference would be in a single nexus : void initialize() { try { // method calls }catch ( AltrmiInvocationException ae ) { if (transaction != null) { transaction.rolback(); } getLogger().error(blah,ae); throw ae; // or a new one. }catch (Throwable) { // something similar. } } Of course with a bean container a policy can be set for a bean, so that predictable actions take place. } // Problem 2 : User calls my transparent objects he don't know marshaling stuff, implements callbacks sets Context ... . He knows : virtual void my_cpp_method( transparent object )=0;// By Value irtual void my_cpp_method1( transparent object )=0;// By Reference procedure MyPascalProcedure( var aObject : TTransparent ) virtual abstract; (* Always By Reference *) public void myJAVAMethod(Transparent transparent);// sometimes By value ? Transparent has no Tag interface User knows usual stuff, and Transparence must become usual. In this case, the class containing the method myJAVAMethod() is a facade and proxyed to an equivalent on the server. You are worried about Transparent class and how AltRMI knows whether it is pas by value or by reference (a facade). Easy, at time of publication, the developer designates a number of additional interfaces as facades rather than pass by value. If it is known that Transparent has setter functions that could cause problems make it an addition facade. There is no need for a Tag (Marker?) interface. The downside is that Transparent.class needs to be an interface with one or more impls. But then that is the same rule taht RMI has for solving the same issue. /// Very possible to train users, write books, documentation, I don't know is it solution or not. I have no solution for this two problems. It is because I trying to think as user, I must think about my team it is my job. I like transparence, but I think it can kill users project if will not solve my problems. I hope I have addressed your concerns Juazos. I think you know yourself that you're little hard to understand. Sadly so I am, but I don't have the excuse of having English as a first language ;-) Regards, - Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: [AltRMI] New Direct-Marshalled transport type
Juozas, Yes I see it is possible to solve problems this kind. I need transparent distributed objects in my projects, It is because I speak a lot about ARMI. I am afraid this can be difficult to understand for my coworkers, but will fink a lot about this before next project. I think Transparent Persistence will be the first revolution in my company. :-) BTW. I am not kidding about ARMI over DCOM I have spend 2 year with this stuff ( ActiveX, win32, IUnknown, IDispatch , ..,Ole Automation, ) and I can help to implement this. I am not sure what you are proposing AltRMI having DCOM transport types? Regards, - Paul H -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/classretrievers AbstractClassRetriever.java DynamicGeneratorClassRetriever.java JarFileClassRetriever.java NoClassRetriever.java PlainClassRetriever.java
hammant 02/01/27 07:47:40 Modified:altrmi build.xml altrmi/src/java/org/apache/commons/altrmi/client/impl/direct DirectMarshalledInvocationHandler.java altrmi/src/java/org/apache/commons/altrmi/server AltrmiServer.java altrmi/src/java/org/apache/commons/altrmi/server/impl AbstractServer.java altrmi/src/java/org/apache/commons/altrmi/server/impl/classretrievers JarFileClassRetriever.java NoClassRetriever.java PlainClassRetriever.java Added: altrmi/src/java/org/apache/commons/altrmi/server/impl/classretrievers AbstractClassRetriever.java DynamicGeneratorClassRetriever.java Removed: altrmi/src/java/org/apache/commons/altrmi/server/impl AbstractClassRetriever.java Log: rework of class retrievers Revision ChangesPath 1.5 +1 -3 jakarta-commons-sandbox/altrmi/build.xml Index: build.xml === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/build.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- build.xml 26 Jan 2002 13:51:34 - 1.4 +++ build.xml 27 Jan 2002 15:47:40 - 1.5 @@ -3,7 +3,7 @@ !-- Alternative (to) RMI component of the Jakarta Commons Subproject -$Id: build.xml,v 1.4 2002/01/26 13:51:34 hammant Exp $ +$Id: build.xml,v 1.5 2002/01/27 15:47:40 hammant Exp $ -- @@ -142,12 +142,10 @@ !-- includes=org/apache/commons/altrmi/server/impl/rmi/RmiAltrmiInovcationAdapter.class -- -echormic?/echo rmic base=${build.home}/classes includes=org/apache/commons/altrmi/common/RmiAltrmiInovcationHandler.class classpath refid=compile.classpath / /rmic -echormic!/echo /target 1.2 +15 -4 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/direct/DirectMarshalledInvocationHandler.java Index: DirectMarshalledInvocationHandler.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/direct/DirectMarshalledInvocationHandler.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- DirectMarshalledInvocationHandler.java26 Jan 2002 15:22:16 - 1.1 +++ DirectMarshalledInvocationHandler.java27 Jan 2002 15:47:40 - 1.2 @@ -24,6 +24,7 @@ import org.apache.commons.altrmi.common.NotSuchReferenceException; import org.apache.commons.altrmi.common.AltrmiMarshalledInvocationHandler; import org.apache.commons.altrmi.common.SerializationHelper; +import org.apache.commons.altrmi.common.RequestFailedReply; import org.apache.commons.altrmi.client.impl.AbstractClientInvocationHandler; import org.apache.commons.altrmi.client.AltrmiConnectionListener; @@ -35,7 +36,7 @@ * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ */ public final class DirectMarshalledInvocationHandler extends AbstractDirectInvocationHandler { @@ -57,9 +58,19 @@ } protected AltrmiReply performInvocation(AltrmiRequest request) throws IOException { -byte[] serRequest = SerializationHelper.getBytesFromInstance(request); -byte[] serReply = mAltrmiInvocationHandler.handleInvocation(serRequest); -return (AltrmiReply) SerializationHelper.getInstanceFromBytes(serReply); + +try { +byte[] serRequest = SerializationHelper.getBytesFromInstance(request); +byte[] serReply = mAltrmiInvocationHandler.handleInvocation(serRequest); +return (AltrmiReply) SerializationHelper.getInstanceFromBytes(serReply); +} catch (IOException e) { +e.printStackTrace(); +return new RequestFailedReply(Some IO Exception on server side : + e.getMessage()); +} catch (ClassNotFoundException e) { +e.printStackTrace(); +return new RequestFailedReply(Some Class not found Exception on server side : + e.getMessage()); +} + } } 1.4 +2 -2 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/AltrmiServer.java Index: AltrmiServer.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/AltrmiServer.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- AltrmiServer.java 25 Jan 2002 16:40:13
Re: Jasper's java compiler.
Geir, What we needed/need to do is have a JSR submitted for a compiler SPI (service provider interface). The current one is just an internal unpublished com.sun.x class -- there's no existing standard. Wanna start one? Indeed I do. I think it would help all around... Is there not a target of a dynamically invocable compiler or bytecode generator in JDK1.5 ? Regards, - Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/classretrievers JarFileClassRetriever.java
hammant 02/01/26 05:51:34 Modified:altrmi build.xml tests.xml altrmi/src/java/org/apache/commons/altrmi/client/impl/stream StreamInvocationHandler.java altrmi/src/java/org/apache/commons/altrmi/common ClassReply.java altrmi/src/java/org/apache/commons/altrmi/server/impl AbstractServer.java altrmi/src/java/org/apache/commons/altrmi/server/impl/classretrievers JarFileClassRetriever.java Log: Fixed remote class retrieval Revision ChangesPath 1.4 +2 -2 jakarta-commons-sandbox/altrmi/build.xml Index: build.xml === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/build.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- build.xml 25 Jan 2002 16:40:13 - 1.3 +++ build.xml 26 Jan 2002 13:51:34 - 1.4 @@ -3,7 +3,7 @@ !-- Alternative (to) RMI component of the Jakarta Commons Subproject -$Id: build.xml,v 1.3 2002/01/25 16:40:13 hammant Exp $ +$Id: build.xml,v 1.4 2002/01/26 13:51:34 hammant Exp $ -- @@ -220,7 +220,7 @@ basedir=${build.home}/classes manifest=src/conf/MANIFEST-generator.MF include name=org/apache/commons/altrmi/generator/**/ - include name=org/apache/commons/altrmi/compiler/**/ + include name=org/apache/commons/altrmi/javacompiler/**/ /jar /target 1.3 +1 -26 jakarta-commons-sandbox/altrmi/tests.xml Index: tests.xml === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/tests.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- tests.xml 25 Jan 2002 16:40:13 - 1.2 +++ tests.xml 26 Jan 2002 13:51:34 - 1.3 @@ -3,7 +3,7 @@ !-- Alt (to) RMI component of the Jakarta Commons Subproject -$Id: tests.xml,v 1.2 2002/01/25 16:40:13 hammant Exp $ +$Id: tests.xml,v 1.3 2002/01/26 13:51:34 hammant Exp $ -- @@ -95,31 +95,6 @@ pathelement location=${build.home}/classes/ /classpath /altrmiinterfaces - -!-- -javac srcdir=${build.home}/genjava - destdir=${build.home}/classes2 - debug=${compile.debug} - deprecation=${compile.deprecation} - optimize=${compile.optimize} - classpath refid=compile.classpath/ -/javac - - - -altrmiclassintern gendir=${build.home}/genjava2 -sourceclassdir=${build.home}/classes2/ -publishedname=Hello / - -javac srcdir=${build.home}/genjava2 - destdir=${build.home}/classes3 - debug=${compile.debug} - deprecation=${compile.deprecation} - optimize=${compile.optimize} - classpath refid=compile.classpath/ -/javac - --- /target 1.4 +2 -2 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/stream/StreamInvocationHandler.java Index: StreamInvocationHandler.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/stream/StreamInvocationHandler.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- StreamInvocationHandler.java 21 Jan 2002 20:10:34 - 1.3 +++ StreamInvocationHandler.java 26 Jan 2002 13:51:34 - 1.4 @@ -37,7 +37,7 @@ * * * @author Paul Hammant a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a - * @version $Revision: 1.3 $ + * @version $Revision: 1.4 $ */ public abstract class StreamInvocationHandler extends AbstractClientInvocationHandler { @@ -123,7 +123,7 @@ } catch (IOException ioe) { if (ioe instanceof SocketException | ioe instanceof EOFException -| ioe.getMessage().equals(Read end dead) +| (ioe.getMessage() != null ioe.getMessage().equals(Read end dead) ) ) { int retryConnectTries = 0; 1.4 +5 -5 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/common/ClassReply.java Index: ClassReply.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/common/ClassReply.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/directmarshalled - New directory
hammant 02/01/26 06:33:52 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/directmarshalled - New directory -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test DirectMarshalledTest.java
hammant 02/01/26 07:22:17 Modified:altrmi PROPOSAL tests.xml altrmi/src/java/org/apache/commons/altrmi/client/impl/direct DirectHostContext.java DirectInvocationHandler.java altrmi/src/java/org/apache/commons/altrmi/client/impl/stream ClientCustomStreamReadWriter.java altrmi/src/java/org/apache/commons/altrmi/server/impl ServerCustomStreamReadWriter.java Added: altrmi/src/java/org/apache/commons/altrmi/client/impl/direct AbstractDirectInvocationHandler.java DirectMarshalledHostContext.java DirectMarshalledInvocationHandler.java altrmi/src/java/org/apache/commons/altrmi/common AltrmiMarshalledInvocationHandler.java SerializationHelper.java altrmi/src/java/org/apache/commons/altrmi/server/impl/direct DirectMarshalledInovcationAdapter.java DirectMarshalledServer.java altrmi/src/java/org/apache/commons/altrmi/test DirectMarshalledTest.java Log: new direct-marshalled transport type Revision ChangesPath 1.12 +10 -7 jakarta-commons-sandbox/altrmi/PROPOSAL Index: PROPOSAL === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/PROPOSAL,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- PROPOSAL 25 Jan 2002 16:40:13 - 1.11 +++ PROPOSAL 26 Jan 2002 15:22:16 - 1.12 @@ -59,13 +59,16 @@ interfaces etc.. e) ObjectStream over Pipe #2 12095 4.48 -f) ObjectStream over Pipe #1 6116622.64 -g) Direct #32391498 885.08 +f) Direct Marshalled #3 20759 7.68 +g) ObjectStream over Pipe #1 6116622.64 +h) Direct Unmarshalled #2391498 885.08 #1 Without calling reset() as workaround to the ObjectStream bug #2 With calling reset() as workaround to the ObjectStream bug -#3 Marshalled but not streamed. Still as good as DynamicProxy -for separation. +#3 Completely separates classloaders of client and server. Requires + a thread for each though. +#4 Good as DynamicProxy for separation. Does not separate classloaders + of client and server. Non AltRMI types @@ -74,10 +77,10 @@ branches of classloader for these three. The same interfaces etc must be visible to both impl and proxy. -h) DyanmicProxy #4 +i) DyanmicProxy #5 (copied from Excalibur) 20282070 7506.32 -i) Hand-coded proxy #4 41214422 15253.30 -j) No Proxy #4 42384804 15686.46 +j) Hand-coded proxy #5 41214422 15253.30 +k) No Proxy #5 42384804 15686.46 #4 - For all of these three, the actual timing may slow down the test. 1.4 +8 -1 jakarta-commons-sandbox/altrmi/tests.xml Index: tests.xml === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/tests.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- tests.xml 26 Jan 2002 13:51:34 - 1.3 +++ tests.xml 26 Jan 2002 15:22:16 - 1.4 @@ -3,7 +3,7 @@ !-- Alt (to) RMI component of the Jakarta Commons Subproject -$Id: tests.xml,v 1.3 2002/01/26 13:51:34 hammant Exp $ +$Id: tests.xml,v 1.4 2002/01/26 15:22:16 hammant Exp $ -- @@ -170,6 +170,13 @@ target name=directa depends=generate description=Direct Server and Client (client side classes) java classname=org.apache.commons.altrmi.test.DirectTest fork=true + classpath refid=testA.classpath/ + arg value=C/ +/java + /target + + target name=directmarshalled depends=generate description=Direct Marshalled Server and Client (client side classes) +java classname=org.apache.commons.altrmi.test.DirectMarshalledTest fork=true classpath refid=testA.classpath/ arg value=C/ /java 1.2 +0 -1 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/direct/DirectHostContext.java Index: DirectHostContext.java === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/direct/DirectHostContext.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- DirectHostContext.java21 Jan 2002 15:38:20 - 1.1 +++ DirectHostContext.java
[AltRMI] New Direct-Marshalled transport type
Folks, I've coded another tranport type for AltRMI - Direct-Marshalled Here is a comparison of three similar AltRMI types: * Direct Marshalled Transport. - marshalling takes place. - instances passed by value between client and server may not be a mutually visible classloader. - does not need separate threads for client and server. * Direct Transport - no marshalling takes place in Direct Transport. - instances passed by value between client and server must be a mutually visible classloader. - does not need separate threads for client and server. * Piped Transport - marshalling takes place. - instances passed by value between client and server may not be a mutually visible classloader. - needs separate threads for client and server. I have coded it for Alt-EJB (now named Enterprise Object Broker and hosted on sourceforge and 10% coded). Regards, - Paul H -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: [AltRMI] New Direct-Marshalled transport type
Juozas, It is very interesting, does somebody works on persistence ? No yet. The example beans have no persistence. The idea is that the developer chooses what type of persistence they need. File, Store, JDBC, JDO. I know this stuff like JTA, JAAS, JDO ... . Thats good. Commons-Store would be cool for re-use in EOB. I work on persistence in the current project, I have plans to complete it next weak. Idea is like this : User defines some interfaces and optional mappings. Container or application Manages persistence and transactions , user defined interfaces can be reused for Value Objects,Remote/Local ... I will use simplestore for cache. :-) Do you need this kind of code ? But I don't know how to handle By Value. void myMethod( MyInterfaceType mt ){ mt.setSomething(X);//Don't understand how to handle this ( is X set on copy of Object ? ) } X will be a copy of the object if pass by value or over the wire. I'm not quite sure what your asking here. Consider : interface StockPortfolio { int getShareCount(String ticker); void addToPortfolio(String ticker, shareCount); void removeFromPortfolio(String ticker, shareCount); String[] getStocksHeld(); } class JDBCStockPortfilioImpl implements StockPortfolio { // all those methods implemented like in classic entity bean } class CommonsStoreStockPortfolioImpl extends org.apache.commons.simplestoreSynchronizedStore implements StockPortfolio { // or 'has a' in stead of 'extends' as it is final. // all those methods implemented and routing through to the store methods. } I have coded it for Alt-EJB (now named Enterprise Object Broker and hosted on sourceforge and 10% coded). I like this name :) In spoken form - 'Yob' It is a name that Gerhard and I though up after discussing over a couple of days - Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test DirectTest.java PipeTest.java RmiServerTest.java SocketServerTest.java
hammant 02/01/25 08:40:14 Modified:altrmi PROPOSAL build.xml tests.xml altrmi/src/java/org/apache/commons/altrmi/common AbstractMethodHandler.java altrmi/src/java/org/apache/commons/altrmi/generator PrimarySourceGenerator.java altrmi/src/java/org/apache/commons/altrmi/generator/ant AltrmiInterfaceTask.java altrmi/src/java/org/apache/commons/altrmi/server AltrmiPublisher.java AltrmiServer.java altrmi/src/java/org/apache/commons/altrmi/server/impl AbstractServer.java altrmi/src/java/org/apache/commons/altrmi/test DirectTest.java PipeTest.java RmiServerTest.java SocketServerTest.java Added: altrmi/src/java/org/apache/commons/altrmi/javacompiler JavaCompiler.java SunJavaCompiler.java altrmi/src/java/org/apache/commons/altrmi/server AltrmiProxyGenerator.java Removed: altrmi/src/java/org/apache/commons/altrmi/generator SecondarySourceGenerator.java altrmi/src/java/org/apache/commons/altrmi/generator/ant AltrmiClassInternTask.java altrmi/src/java/org/apache/commons/altrmi/server/impl/classretrievers BaseMobileClass.java BaseMobileClassRetriever.java Log: inline compilation of proxys now possible Revision ChangesPath 1.11 +8 -6 jakarta-commons-sandbox/altrmi/PROPOSAL Index: PROPOSAL === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/PROPOSAL,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- PROPOSAL 21 Jan 2002 21:19:49 - 1.10 +++ PROPOSAL 25 Jan 2002 16:40:13 - 1.11 @@ -9,13 +9,15 @@ 1) Any interface publishing - - no forcing of extension of java.rmi.Remote - - no forced declarations of throws RemoteException + - Any object via the interfaces it publishes can be published remotely. + - No transport lock-in : +- No forcing of extension of java.rmi.Remote +- No forced declarations of throws java.rmi.RemoteException - * These two features are part of the reason why Graham Glass's 'Glue' -product is so successful. His API goes several stages futher in that -it pubishes APIs via SOAP so that any language in any location can -use Glue published Java services. +* These two features are part of the reason why Graham Glass's 'Glue' + product is so successful. His API goes several stages futher in that + it pubishes APIs via SOAP so that any language in any location can + use Glue published Java services. 2) Multiple transports 1.3 +10 -5 jakarta-commons-sandbox/altrmi/build.xml Index: build.xml === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/build.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- build.xml 13 Jan 2002 19:25:20 - 1.2 +++ build.xml 25 Jan 2002 16:40:13 - 1.3 @@ -3,7 +3,7 @@ !-- Alternative (to) RMI component of the Jakarta Commons Subproject -$Id: build.xml,v 1.2 2002/01/13 19:25:20 hammant Exp $ +$Id: build.xml,v 1.3 2002/01/25 16:40:13 hammant Exp $ -- @@ -140,10 +140,14 @@ classpath refid=compile.classpath/ /javac +!-- includes=org/apache/commons/altrmi/server/impl/rmi/RmiAltrmiInovcationAdapter.class -- + +echormic?/echo rmic base=${build.home}/classes - includes=org/apache/commons/altrmi/server/impl/rmi/RmiAltrmiInovcationAdapter.class + includes=org/apache/commons/altrmi/common/RmiAltrmiInovcationHandler.class classpath refid=compile.classpath / -/rmic +/rmic +echormic!/echo /target @@ -216,8 +220,9 @@ basedir=${build.home}/classes manifest=src/conf/MANIFEST-generator.MF include name=org/apache/commons/altrmi/generator/**/ -/jar - + include name=org/apache/commons/altrmi/compiler/**/ +/jar + /target /project 1.2 +16 -9 jakarta-commons-sandbox/altrmi/tests.xml Index: tests.xml === RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/tests.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- tests.xml 21 Jan 2002 15:38:20 - 1.1 +++ tests.xml 25 Jan 2002 16:40:13 - 1.2 @@ -3,7 +3,7 @@ !-- Alt (to) RMI
Re: AltRMI Tasks if anyone want to take them
Sam, As near I I can tell, the charter of commons in this area is identical to the charter of avalon. A committer to avalon-any is a committer to avalon-all. I believe that I am even a committer to myrmidon. Peter has a point in that in commons there are 30-odd comunities. We all have too little time to actually fully appraise anything, there is naturely a tendancy to veto anything that /sounds/ daft. Avalon has four communities, and generally people don't vote of the community they are not active in. Thus people let me get on with insane stuff in Cornerstone ;-) - Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: AltRMI Tasks if anyone want to take them
Sam, Peter has a point in that in commons there are 30-odd comunities. We all have too little time to actually fully appraise anything, there is naturely a tendancy to veto anything that /sounds/ daft. Is this a hypothetical assumption? Or have you experienced it as a problem here? Bit of both. Also as much of a statement of self. I tend not to look at all the other commons projects, though I have read all the proposals. I'm polite enough to stay out of those that I'm not involved with. Maybe it is not that big a deal - the scenario where nay sayers veto some decisions from a position of ignorance. Not a big deal, in that a re-group re-propose can occur. - Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: AltRMI - Proposal request for help
James, The first thing to do is get it from CVS, compile and run it as per the README. Done. Nice, I'm impressed. Am digesting in more detail now. Very minor comment, how about renaming altrmi-tests.xml to be just tests.xml. It saves some typing when running stuff. Maybe it could set a new trend; build.xml is for building stuff and tests.xml is for various test programs. Rename : will do. It is separate primarily because there is an ant task created which cannot be used in the build file that creates it :-( As a complete aside, I'm interested in getting together at some point a kind of 'distributed JUnit' thing so that (say) client and server processes can be started (or even much more complex networks of clients and servers on a variety of machines platforms) and the collection of processes are started, coordinated and ran as a single JUnit test case. Then for example, all the pairs of clients and servers could all be run as part of a single JUnit test suite. I'm thinking Ant is the way to start processes (just like you're doing with altrmi-tests.xml) then some kind of JUnit-ish framework on top doing the distribution coordination. Anyways, back to the matter at hand... After that look at the classes in the test package to see how, from the user's point of view, it is used. I think you're brave taking on a JMS transport, but then perhaps if you know it well it might be quite easy. I know JMS well, I've used it quite a bit. Several years ago I even developed a JMS provider so it shouldn't be too hard. More later... AltRMI's magic (not) is that it transports method calls in serializable classes. There are quite a few communicated through a simple, single API... AltrmiReply handleInvocation(AltrmiRequest request); Consider... class MethodRequest extends AltrmiRequest { String methodSignature; Object[] args; Long referenceID; } class MethodReply extends AltrmiReply{ Object replyObj; } .. (and a few others). The handleInvocation() method, in the impls so far, can tranport itself over RMI, over plain sockets (using objectstreams and a custom solution). There are also very useful impls that transport/marshall within one JVM ('Piped' and 'Direct'). Looks cool. Another minor comment, some of the core APIs of AltRMI use Altrmi in the interface names; how about removing them, since afterall the classes/interfaces are in altrmi packages. True. There is always a compromise between namespace on classnames. My feeling is that Connection Component and Document are very over used as class names and should definately be prefixed for futher definitions. (Intellij's IDEA can be too suggestive for those). In short yes, Perhaps some of the Altrmi prefixes for class names should go. e.g. AltrmiInvocationHandler - InvocationHandler. Vote against as that's already used in the JDK. AltrmiRequest - Request No, because it's too simple a word. It was the firsat thing to be renamed from Request to AltrmiRequest. There are 20 others that are good candidates though you ust chose a couple that I'd resist on. :-) It just makes code that little bit easier to understand, and there's always fully qualified class names if ever there's a naming conflict issue. If the imports are specific (as per Apache rules) then the possibility is greatly diminished, but still possible. I'm motivated (for those two) by untellisense in IDEs Just out of interest, have you taking a look at JAX-RPC? It has a similar model which might give you some good ideas. From last time I looked the API of JAX-RPC looked like the transport was agnostic. Will do. For JMS, if it can transport classes like those above via an interface like that above, then it is fine. I'll have to read more. Specifically, I'm not sure how the asynchronous side of things will work. Just to save a bit of reading... JMS can send and receive a variety of different kinds of Message objects. The core Message interface provides various standard headers as well as allowing user defined headers (properties) on messages. Then there are various derivations of the core Message interface to provide various kinds of message body such as TextMessage where the body is a String, ObjectMessage where the body is a Serializable object, MapMessage where the body is somewhat like a Map (though unfortunately doesn't use a Java 2 Map interface) and some binary messages like BytesMessage and StreamMessage. Both synchronous and asynchronous communication models can be implemented quite straightforwardly, receiving supports push and pull models. Also JMS supports queue semantics, only one consumer receives the message (similar to connection-less point to point) and publish/subscribe semantics (all consumers interested receive a copy of the message). Finally JMS provides a variety of Quality of Services such as persistent messages, XA compliance etc. So I would think it should be fairly straightforward to implement AltRMI in
Re: AltRMI load balanced requets from client to server(s)
James, Just thought I'd mention, using JMS Queues is a great way of implementing load balancing server clusters. If servers fail messages are rerouted to other working servers. Messages can be stored persistently for full fault tolerance so that if there are no servers running messages are not lost and things will recover properly when servers are restarted. Though this requires a JMS provider though - and a decent one costs money these days. Yup those features or JMS would be good. Also a JNDI lookup that could return a different server each time would be cool. One design principle behind AltRMI is the rigid separation of interface, abstract parent classes and concrete impl. With this a completely standalone AltRMI client should be able to collaborate with a remote server who's functionality has been rewritten/extended/reimplemented for various reasons. All that is comon to all is in the common package. The point is that there could be two or three impls of the load balancing client factory :-) They may or may not share code. Regards, - Paul H -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]