[Javassist Development] New message: "Re: Problems with proxy classes and a proposed resolution"
by Andrew Dinn
JBoss development,
A new message was posted in the thread "Problems with proxy classes and a proposed resolution":
http://community.jboss.org/message/532341#532341
Author : Andrew Dinn
Profile : http://community.jboss.org/people/adinn
Message:
--------------------------------------------------------------
Thanks for the feedback, David.
> my intent when I suggested subclassing OOS/OIS was that the read/writeClassDescriptor methods would be overridden such that javassist proxies are treated specially (similar to how reflection proxies are currently treated specially).
That's precisely what my prototype implementation does (your comments in JASSIST-42 were all the recipe I needed). It seemed to work ok so once I fixed writeClassDescriptor to return a class with the correct name. This allowed the writer and reader to use normal object serialization to write/read the proxy instance itself.
> Incidentally, it is possible that a writeReplace serialized proxy object could still be a viable solution. It would just have to be able to encapsulate the entire object state (basically reproducing the serialization spec behavior of OOS and OIS in terms of creating instances via the proprietary Sun API, initializing fields, dealing with read/writeObject, etc.).
Well, yes that's maybe so but I would not like to have to write and maintain code to do that. Your subclassed OOS/OIS solution achieves the same result with just a few calls to methods of OOS/OIS. That''s a big plus for your solution. My reasons for retaining the writeReplace version were i) retaining compatibility and ii) providing an option for code which has to use an OOS/OIS created by some other package rather than create its own subclass of OOS.This discussion is a way of polling to see how important these criteria are.
regards,
Andrew Dinn
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/532341#532341
16 years
[JBoss Microcontainer Development] New message: "Re: Issues with vfs30 MountHandle"
by Thomas Diesler
JBoss development,
A new message was posted in the thread "Issues with vfs30 MountHandle":
http://community.jboss.org/message/532322#532322
Author : Thomas Diesler
Profile : http://community.jboss.org/people/thomas.diesler@jboss.com
Message:
--------------------------------------------------------------
John says:
> When
> a URL points to a directory, you can not call InputStream.read and
> expect to get bytes back. Once the JAR is mounted in VFS it becomes a
> directory.
>
>
>
>
> If you need this to act as a File, then either:
>
>
> 1. Don't mount and use a JarFile
>
>
> 2. When mounting, retain the MountHandle and call getMountSource to get a handle to the actual file
>
>
>
>
>
>
>
>
> [ https://jira.jboss.org/jira/browse/JBVFS-147 ]
>
>
>
> https://jira.jboss.org/jira/secure/ViewProfile.jspa?name=johnbailey - 15/Mar/10 09:56 AM
> When a URL points to a directory, you can not call InputStream.read and
> expect to get bytes back. Once the JAR is mounted in VFS it becomes a
> directory. If you need this to act as a File, then either:
> 1. Don't mount and use a JarFile
> 2. When mounting, retain the MountHandle and call getMountSource to get
> a handle to the actual file
>
>
>
>
>
>
>
>
>
>
>
> This needs to be handled correctly by the caller.
>
>
Did you consider the case where I might not be the first who sees the file?
In case of the structure deployer processing there might be an AbstractVFSArchiveStructureDeployer processing the vfile before my AbstractVFSStructureDeployer sees it. When I see the vfile it might already be mounted. In that case how do I get hold of the MountHandle?
Generally, I believe that vfile.getChild(), vfile.openStream() and friends should behave in a deterministic way independent of what processing another component did previously.
One possible way out of this might be to always provide access to the "virgin" source of the vfile.
David says
> If
> you're not the first, then you do not have the right to access the
> archive, period. It's indistinguishable from a directory, and should be
> treated as such IMO.
>
>
>
>
>
>
>
>
> [ https://jira.jboss.org/jira/browse/JBVFS-147 ]
>
>
>
> https://jira.jboss.org/jira/secure/ViewProfile.jspa?name=david.lloyd%40jb... - 15/Mar/10 11:15 AM
> If you're not the first, then you do not have the right to access the
> archive, period. It's indistinguishable from a directory, and should be
> treated as such IMO.
>
>
AFAICS, I cannot control whether I am the first (nor should I). In case I am not the first, the deployment may already have been transformed into a directory and I cannot access the archive any more.
This seem to be a general issue of who comes fist + mounting prevents access to original archive.
[ https://jira.jboss.org/jira/browse/JBVFS-147 ]
https://jira.jboss.org/jira/secure/ViewProfile.jspa?name=david.lloyd%40jb... - 15/Mar/10 11:15 AM If you're not the first, then you do not have the right to access the archive, period. It's indistinguishable from a directory, and should be treated as such IMO.
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/532322#532322
16 years
[JBoss Tools Development] New message: "Re: create/extend a builder for hbm files?"
by Elhanan Maayan
JBoss development,
A new message was posted in the thread "create/extend a builder for hbm files?":
http://community.jboss.org/message/532321#532321
Author : Elhanan Maayan
Profile : http://community.jboss.org/people/Elhanan
Message:
--------------------------------------------------------------
actually this is what's happening rigit now, we have an ant script which runs on all the hbm's through xsl copies them to a build directory, the same scripts also bothers to compile our entire source, (again after eclipse did it) load it with aspectwerkz aspects, generate spring xml files contaning references to said hbm's, and then afterwords copies the entire thing again into a jboss ear.
pro's: IDE agnostic.
cons: takes mintues to do , frags the disk, creates a mismatch between my hbm and the actuall build (thus i cannot run immidiate junit tests, or launching) and unusable in a j2ee prespective with dynamic web project s and ear projects, and all for what?
build scripts are nice.. for CI server (if you have one), what i wanna do, is use aspectj instead of aspect werkz, just only incremental build aspects, not compile every source each time, and have eclipse append the fields i want to my actuall source, and i could use standard web projects for this, thus avoiding huge amount of needless overhead.
so how would i write a script to be called from a builder? (do you mean ant scripts configured form .projects?)
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/532321#532321
16 years
[Javassist Development] New message: "Re: Problems with proxy classes and a proposed resolution"
by David Lloyd
JBoss development,
A new message was posted in the thread "Problems with proxy classes and a proposed resolution":
http://community.jboss.org/message/532320#532320
Author : David Lloyd
Profile : http://community.jboss.org/people/david.lloyd@jboss.com
Message:
--------------------------------------------------------------
Excellent analysis, Andrew. The issue of differing default filters and handlers is something I was a little worried about. I think in hindsight that might have been a design flaw. Using an identifier seems like a good workaround to me.
In terms of differing class names - my intent when I suggested subclassing OOS/OIS was that the read/writeClassDescriptor methods would be overridden such that javassist proxies are treated specially (similar to how reflection proxies are currently treated specially). With reflection proxies, the implemented interface names are written; with Javassist, this information, plus the base class descriptor, plus the identifiers for the default filter and handler would all be part of the descriptor.
Once the proxy class is mapped, serializing the proxy instance +should+ work normally at that point. The only thing I'm not sure of off the top of my head is whether there's a way to get an ObjectStreamClass descriptor instance for the Javassist proxy when reading that descriptor. I seem to recall that this API is particularly moronic.
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/532320#532320
16 years