[JBoss AS7 Development] - Re: model updates and references
by Emanuel Muckenhuber
Emanuel Muckenhuber [http://community.jboss.org/people/emuckenhuber] created the discussion
"Re: model updates and references"
To view the discussion, visit: http://community.jboss.org/message/560715#560715
--------------------------------------------------------------
I pushed some work regarding model references and validation in a 'model-ref' branch on github. I basically just copied a part of the domain model into the domain-controller module (since it was empty), since i want to discuss that before merging it into the actual model. At the moment it's just doing validation, but could also be used for decoupling model updates from the actual model using references. This however depends mostly on how much of the model we want to expose for runtime management. In general i think it would make sense to separate the runtime view on the domain from the model. Maybe you can briefly look at that and see if that makes sense and we can discuss where we are going with that.
I pushed some work regarding model references and validation in a 'model-ref' branch on github. I basically just copied a part of the domain model into the domain-controller module (as it was empty), since i want to discuss that before merging it into the actual model. At the moment it's just doing validation, but could also be used for decoupling model updates from the actual model using references. This however depends mostly on how much of the model we want to expose for runtime management. In general i think it would make sense to separate the runtime view on the domain from the model. Maybe you can briefly look at that and see if that makes sense and we can discuss further steps.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/560715#560715]
Start a new discussion in JBoss AS7 Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 8 months
[JBoss Microcontainer Development POJO Server] - Re: VFS doesn't support scanning
by Guillaume Grossetie
Guillaume Grossetie [http://community.jboss.org/people/grossetieg] created the discussion
"Re: VFS doesn't support scanning"
To view the discussion, visit: http://community.jboss.org/message/560683#560683
--------------------------------------------------------------
Hi,
What is the right way to scan classes in a package with VFS ?
I've tried something like :
List<Class<? extends Enum<?>>> result = new ArrayList<Class<? extends Enum<?>>>();
ClassLoader cld = Thread.currentThread().getContextClassLoader();
if (null != cld) {
final String pkgPath = packageName.replace('.', '/');
URL resource = cld.getResource(pkgPath);
VirtualFile file = VFS.getChild(resource);
List<VirtualFile> children = file.getChildrenRecursively();
for (VirtualFile child : children) {
if (child.isFile()) {
Class<?> clazz = Class.forName(packageName.concat(".").concat(child.getName().split("\\.")[0]));
if (clazz.isEnum()) {
result.add((Class<Enum<?>>) clazz);
}
}
}
}
But the package isn't a directory and getChildrenRecursively() return an empty list. We, previously in JBoss 4.2.3, used :
List<Class<? extends Enum<?>>> result = new ArrayList<Class<? extends Enum<?>>>();
ClassLoader cld = Thread.currentThread().getContextClassLoader();
if (null != cld) {
String pkgPath = packageName.replace('.', '/');
URL resource = cld.getResource(pkgPath);
if (null != resource) {
if (resource.getProtocol().equals("jar")) {
int index = resource.getPath().indexOf('!');
// on extrait le chemin du jar
String fullJarPathWithName = resource.getPath().substring(5, index);
List<Class<? extends Enum<?>>> classes = getEnumClassesFromJar(fullJarPathWithName, packageName, pkgPath);
if (null != classes) {
result.addAll(classes);
}
}
}
}
But with VFS the path doesn't contain ! anymore.
We also tried with a visitor pattern but without success. I've read the article at dzone but some classes doesn't exist anymore (SuffixVisitor in jboss-vfs.3.0.0.CR5.jar).
Thanks in advance.
Guillaume.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/560683#560683]
Start a new discussion in JBoss Microcontainer Development POJO Server at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 8 months