You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bcel-user@jakarta.apache.org by Bjoern Wuest <bj...@gmx.net> on 2003/05/02 11:10:08 UTC
Getting JavaClass from class instance
Hello All
I am working on a runtime wrapper for object instances. While I get
everything working with classes available on secondary storage (file
system), I have problems to use the mechanism on wrapper objects created
in memory and now wrapped a second time.
To solve this, I would require a method looking like:
public JavaClass convert(Class MyClassInstance);
Unfortunately, I could not find some similar method. The only think I
found was the ClassLoaderRepository (CLR) of BCEL. However, this
mechanism does not work. The CLR will use the filesystem where the class
is not available since it is purely "in-memory".
Thanks for tips
Bjoern
---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-user-help@jakarta.apache.org
Re: Getting JavaClass from class instance
Posted by Juozas Baliuka <ba...@mwm.lt>.
I think it is no way to implement this with standard java API or custom
ClassLoder,
classes like java.lang.reflect.Proxy call native methods to define class,
use JNI hooks if possible.
----- Original Message -----
From: "Bjoern Wuest" <bj...@gmx.net>
To: "'BCEL Users List'" <bc...@jakarta.apache.org>;
<bj...@gmx.net>
Sent: Friday, May 02, 2003 11:10 AM
Subject: Getting JavaClass from class instance
> Hello All
>
> I am working on a runtime wrapper for object instances. While I get
> everything working with classes available on secondary storage (file
> system), I have problems to use the mechanism on wrapper objects created
> in memory and now wrapped a second time.
> To solve this, I would require a method looking like:
>
> public JavaClass convert(Class MyClassInstance);
>
> Unfortunately, I could not find some similar method. The only think I
> found was the ClassLoaderRepository (CLR) of BCEL. However, this
> mechanism does not work. The CLR will use the filesystem where the class
> is not available since it is purely "in-memory".
>
> Thanks for tips
> Bjoern
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: bcel-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: bcel-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-user-help@jakarta.apache.org
RE: Getting JavaClass from class instance
Posted by Bjoern Wuest <bj...@gmx.net>.
Hello All
I oversee a possibility with the ClassLoaderRepository. Now I am able to
get an instance of JavaClass for "in-memory" created objects (classes).
Currently I am fighting with the constructor (telling me something about
wrong arguments) but I am quite sure to fix this problem, too.
Regards
Bjoern
-----Original Message-----
From: Bjoern Wuest [mailto:bjoern.wuest@gmx.net]
Sent: Freitag, 2. Mai 2003 11:10
To: 'BCEL Users List'; bjoern.wuest@gmx.net
Subject: Getting JavaClass from class instance
Hello All
I am working on a runtime wrapper for object instances. While I get
everything working with classes available on secondary storage (file
system), I have problems to use the mechanism on wrapper objects created
in memory and now wrapped a second time.
To solve this, I would require a method looking like:
public JavaClass convert(Class MyClassInstance);
Unfortunately, I could not find some similar method. The only think I
found was the ClassLoaderRepository (CLR) of BCEL. However, this
mechanism does not work. The CLR will use the filesystem where the class
is not available since it is purely "in-memory".
Thanks for tips
Bjoern
---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-user-help@jakarta.apache.org