Re: Setting codebase on a per entry basis....
Dan Creswell <[email protected]>
| Newsgroups | gmane.comp.java.sun.javaspaces |
|---|---|
| Message-ID | <[email protected]> |
Ewan Silver wrote: > Hi all, > > I am having a little codebase issue and am looking for some > alternative viewpoints. My situation is as follows: > > I have multiple processes using a Javaspace to communicate. One of the > Entries that is passing through the space can be considered to be a > kind of FactoryEntry. Its role is to allow a generic JavaSpace process > to create (and then write back into a Space) multiple instances of an > Entry whose parent type is well known. The process that is using the > FactoryEntry does not need to know the what type of Entry has actually > been created. > > The generic process is able to retrieve and use the FactoryEntry in > the first instance because the codebase has been set properly by the > process that first placed the FactoryEntry into the space. The issue > is: how does the Generic process set the codebase for the new Entrys > that were created by the FactoryEntry? > Hmmm, not sure I'm fully understanding. Why wouldn't the FactoryEntry be responsible for setting the codebase? How does the FactoryEntry instantiate these other Entry's? How are the fields going to be populated? Does the Generic process know enough about the Entry (perhaps a common base class) to populate it or is that a responsibility of the Factory? Where are these new Entry's going to go next? I'd have thought you could get the Entry class name and codebase (from whereever) then instantiate a classloader with the codebase (use PreferredClassLoader?) and then ask that loader to load the class and instantiate it? I feel like I must be missing something....... Unsure, Dan. > One solution would be to ensure that the codebase of the generic > process always contains the details of any entry that it will ever > potentially see. This is not really feasible because it will involve > updating the codebase of many different generic processes everytime a > new Entry type is created. This will be an administrative nightmare. > > What I really need is a way to programmatically set the codebase on a > per Entry basis as it is written into the Space. > > It occurred to me that it might be possible to replace aspects of the > Marshalling code within the Jeri Exporter used by the Javaspace (most > notably MarshalOutputStreams and InvocationHandlers) with code that > dynamically allows me to set the codebase based on the type of Entry > that is passing through. This would have the advantage in that I would > only have to change code in a few places (notably the proxys generated > by the Javaspace implementations I have deployed). > > This was quickly a non starter - the MarshalOutputStreams, etc used by > the Jeri exporter are only for the PROXY - what I really need is a way > to be able to set the codebase INSIDE the proxy, not the codebase FOR > the proxy. > > I am left with the feeling that there is no way to programmatically > set per Entry codebases without going inside the JavaSpace > implementation and making internal proxy/server changes..... am I > right in thinking this? > > Cheers, > > Ewan > > =========================================================================== > To unsubscribe, send email to [email protected] and include in the body > of the message "signoff JAVASPACES-USERS". For general help, send email to > [email protected] and include in the body of the message "help". > > To view past JAVASPACES-USERS postings, please see: > http://archives.java.sun.com/archives/javaspaces-users.html > =========================================================================== To unsubscribe, send email to [email protected] and include in the body of the message "signoff JAVASPACES-USERS". For general help, send email to [email protected] and include in the body of the message "help". To view past JAVASPACES-USERS postings, please see: http://archives.java.sun.com/archives/javaspaces-users.html