New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ISPN-7714 Extend server configuration to allow easier deployment of user code #5535
ISPN-7714 Extend server configuration to allow easier deployment of user code #5535
Conversation
52f3b66
to
f1e5966
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some minor things. Tbh I am not that familiar with this code, if someone else could review :)
Also it seems the new test failed a couple runs ago http://ci.infinispan.org/job/Infinispan/job/PR-5535/2/
|
||
if (model.hasDefined(ModelKeys.MODULES) && model.get(ModelKeys.MODULES).hasDefined(ModelKeys.MODULES_NAME)) { | ||
ModelNode modulesModel = model.get(ModelKeys.MODULES, ModelKeys.MODULES_NAME); | ||
LinkedList<ModuleIdentifier> modules = new LinkedList<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason this is a LinkedList
? We could just initialize this as an ArrayList
with size equal to the size of the list returned from asList
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no particular reason. suggestion applied.
@@ -116,6 +120,18 @@ public ServiceName getServiceName() { | |||
.addDependency(ScheduledThreadPoolResource.EXPIRATION.getServiceName(this.name), ThreadPoolConfiguration.class, this.expirationThreadPool) | |||
.addDependency(ScheduledThreadPoolResource.REPLICATION_QUEUE.getServiceName(this.name), ThreadPoolConfiguration.class, this.replicationQueueThreadPool) | |||
; | |||
if (module != null) { | |||
if (!module.getName().equals("org.infinispan.extension")) { | |||
// todo [anistor] only works for dynamic modules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed these similar todos around. Is this something we need to do in this PR or do we need a different JIRA?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this should be a different JIRA, not reported yet. Will report it and update the comments with the id.
@@ -229,11 +245,34 @@ public GlobalConfiguration getValue() { | |||
return builder.build(); | |||
} | |||
|
|||
private ClassLoader makeAggregatedClassLoader(ModuleLoader moduleLoader, ModuleIdentifier cacheContainerModule, List<ModuleIdentifier> additionalModules) throws ModuleLoadException { | |||
if (additionalModules != null) { | |||
List<ClassLoader> classLoaders = new ArrayList<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could make this a ClassLoader[]
that is initialized to additionalModules.size
+1 if cacheContainerModule
wasn't null.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both could be null. Creating a list that will contain module
+ modules
will not look pretty, so I preferred to pass both module
and modules
as separate args to makeAggregatedClassLoader
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
additionalModules
in this section was already checked against null. But I am not picky about this, I am fine the way it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not understand what you mean.
@@ -245,6 +245,14 @@ private void parseContainer(XMLExtendedStreamReader reader, PathAddress subsyste | |||
} | |||
break; | |||
} | |||
case MODULES: { | |||
if (namespace.since(Namespace.INFINISPAN_SERVER_9_1)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be 9_2 right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed. solved.
f1e5966
to
d05bd28
Compare
The CI failures should be gone soon. I've pushed the fix. |
75a4f80
to
0a285d0
Compare
It looks like this is having issues with finishing the build http://ci.infinispan.org/job/Infinispan/job/PR-5535/8/console Postponing this until next build. |
It looks like the failures are no on master as well, so the issue seems unrelated. |
867be83
to
08226b6
Compare
This needs rebase so it can pass. |
08226b6
to
ecda69b
Compare
rebased |
605e05a
to
d567102
Compare
I have updates some test again. |
…ame() * getSimpleName() requires access to all outer classes of the service class in question, which might not be available when the service is an inner class defined in an arquillian test suite and this may result in java.lang.NoClassDefFoundError
Add more debug logging
d567102
to
e525044
Compare
…et of modules in server * add a 'modules' element under the cache container config element allowing the user to list all the extra modules to add to the global ClassLoader of this cache container * lookup Hibernate Search entities in the global classloader
e525044
to
0cf6a49
Compare
Integrated, thanks @anistor |
In this particular case it is just the analysers, but it can be anything else using classpath discovery via java.util.ServiceLoader mechanism or another configuration file.
https://issues.jboss.org/browse/ISPN-7714