Hi Stuart,
I am writing a Java-driven build system:
http://code.google.com/p/buildinjava/
I am trying to provide users with the ability to specify a custom
classpath for the build scripts. This is equivalent to setting Ant's
default classpath.
With respect to Ant's custom tasks, I am wondering whether I should
also provide users with the ability of specifying a separate classpath
per taskdef or whether this is overkill. I've often wondered why Ant
bothers with this level of granularity instead of setting a
project-level classpath instead.
Gili
Stuart McCulloch wrote:
> 2009/12/6 cowwoc <[email protected] <mailto:[email protected]>>
>
> Hi,
>
> What ClassLoader does Guice use by default when looking up classes?
> http://code.google.com/p/google-guice/wiki/ClassLoading talks about
> the "target class's class loader" but it doesn't specify what this
> refers to exactly. Are you referring to Class.getClassLoader()? I'm
> trying to programmatically append entries to the classpath...
>
>
> most types are already loaded by virtue of the module bindings,
> because Guice works primarily on type-literals and raw classes
>
> the only time Guice gets into classloading itself is:
>
> 1) creating proxies / enhanced classes / fast classes
>
> 2) loading classes referred to by strings (bindConstant)
>
> for 1) Guice takes the classloader of the type being proxied, etc.
> (Class.getClassLoader) but it might also use a custom "bridge"
> classloader for situations when Guice and the type cannot see
> each other (such as OSGi / J2EE).
>
> for 2) Guice uses a simple Class.forName - though I'm thinking
> it should also try the thread context classloader if there is one
>
> the best way to affect classloading is in the module where you're
> setting up the bindings - you shouldn't need to mess around with
> the internal stuff (at least once the patch for issue 343 is applied ;)
>
> can you explain more about what you're trying to do?
>
> Thanks,
> Gili
>
>
> --
> Cheers, Stuart
>
> --
>
> You received this message because you are subscribed to the Google
> Groups "google-guice" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-guice?hl=en.
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-guice?hl=en.