Hi all,
is there a possibility to generate a new URCapProgramNode with createURCapProgramNode()
that is defined in another URCaps OSGI bundle? WITHOUT knowing it on compile time?
Background : I want to add via URCaps new ProgramNode
to the ProgramTree
where the ProgramNodeService
and the ProgramNodeContribution
was defined in another URcaps bundle.
I am able to load the other Jar into my Classloader. But when i call createURCapProgramNode
i get the Exception
java.lang.IllegalArgumentException: Argument must implement ProgramNodeService or SwingProgramNodeService
at com.ur.urcap.domain.program.ProgramNodeFactoryImpl.createURCapProgramNode_aroundBody0(ProgramNodeFactoryImpl.java:131)
at com.ur.urcap.domain.program.ProgramNodeFactoryImpl$AjcClosure1.run(ProgramNodeFactoryImpl.java:1)
at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)
The loaded class definitly implements the ProgramNodeService interface.
I am not the experienced one in OSGI but is there a way to maybe resister the other osgi bundle in by own bundle context?
i Know this question is maybe more Java classloading and osgi related than urcaps but i also ton not understand how createURCapProgramNode()
determine it a loaded class implements the correct interface.
Thank You
Jan