-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fixed cyclic dependency between api and impl forbidden by JPMS #56
Conversation
Signed-off-by: David Matějček <david.matejcek@omnifish.ee>
- GenericConstructor used reflection to get impl from the api module. - It is possible to use alternatives now, however I don't believe somebody would try that. Signed-off-by: David Matějček <david.matejcek@omnifish.ee>
@@ -46,8 +46,6 @@ | |||
<configuration> | |||
<instructions> | |||
<Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName> | |||
<Export-Package>org.glassfish.gmbal,org.glassfish.pfl.tf.timer.spi</Export-Package> |
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.
Not needed any more, felix see it very clear now
@@ -11,8 +11,12 @@ | |||
|
|||
module org.glassfish.gmbal.api { | |||
requires java.logging; | |||
requires transitive org.glassfish.external.management.api; |
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.
transitive is hiding information, it is better to have explicit list of my own dependencies.
requires org.glassfish.pfl.tf; | ||
|
||
exports org.glassfish.gmbal; | ||
|
||
uses org.glassfish.gmbal.ManagedObjectManagerService; |
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.
Declaration of the service extension point; with JPMS then you can provide its implementation. Using the jar without JPMS we still need the service file as specified in older Java versions.
*/ | ||
public final class ManagedObjectManagerFactory { | ||
private ManagedObjectManagerFactory() {} | ||
|
||
private static GenericConstructor<ManagedObjectManager> objectNameCons = |
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.
GenericConstructor class was very toxic hack how to mask out the cyclic dependency between API and IMPL. Api still required the impl, which was wrong, but the compiler did not see it through reflection.
} | ||
} | ||
} ) ; | ||
} catch (Exception exc) { |
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.
When GenericConstructor failed, it just logged the failure, yet just as FINE log, so in GlassFish you had no idea what happened, just that ORB doesn't work.
|
||
requires org.glassfish.gmbal.api; | ||
requires org.glassfish.pfl.basic; | ||
requires org.glassfish.pfl.tf; | ||
|
||
exports org.glassfish.gmbal.impl; | ||
exports org.glassfish.gmbal.typelib; | ||
|
||
provides org.glassfish.gmbal.ManagedObjectManagerService with org.glassfish.gmbal.impl.ManagedObjectManagerServiceImpl; |
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.
Now IMPL provides the service for the API.
Signed-off-by: David Matějček <david.matejcek@omnifish.ee>
Signed-off-by: David Matějček <david.matejcek@omnifish.ee>
ServiceLoader
instead of reflection and hardcoded class nameAMXClientTest
- initialization broke testsNote: I will restage 4.1.0 after merge.
EDIT: I have found also the stacktrace from GlassFish tests: