[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-openjfx-dev
Subject:    FXML and Classloading
From:       greg.x.brown () oracle ! com (Greg Brown)
Date:       2012-05-31 16:11:32
Message-ID: 9B51790B-3C01-42DD-9EB5-CB674C287DB1 () oracle ! com
[Download RAW message or body]

> The problem is that if I'm using composition I don't get the correct
> classloader

Sure you do. You just need to propagate it to your nested builder factory.

> I think you should not set a default classloader at all but let the
> type-classloader be the default - it is the classloader used by the
> FXMLLoader while constructing the Object graph.

OK. I *think* the only real issue here is whether or not we truly need to pass a \
class loader to JavaFXBuilderFactory. The only place where we actually need the class \
loader in JavaFXBuilderFactory is when we are trying to load the generated builder \
class for a given type. If we assume that the builder class will be loaded by the \
same class loader that was used to load the original type, then you are right - we \
don't need to explicitly pass a class loader to the JavaFXBuilderFactory constructor. \
However, I'm not sure that is a safe assumption. But I also don't think it is a major \
inconvenience to have to do so - if you need to use a custom class loader in your \
app, you just need to make sure you pass it to your JavaFXBuilderFactory instance.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic