[keycloak-dev] Access datasource from a CLI

Stan Silvert ssilvert at redhat.com
Wed Oct 21 11:57:28 EDT 2015


On 10/21/2015 11:14 AM, Marko Strukelj wrote:
> I haven't taken a very close look at Swarm yet, but I assumed you 
> start Wildfly embedded in the same JVM as your Main class. If that is 
> the case, then there should be no problem communicating with any kind 
> of deployed component via heap directly - just lookup some singleton ...
Classloading constraints are what you usually run up against.  You can't 
use your own version of a class that was loaded from a different 
classloader.  I don't think Swarm helps you get around that, but just 
assumes you will access the WAR in the usual way through an HTTP port.  
But I could be wrong as I haven't worked with Swarm either.

Here is an explanation of the problem based on an old version of JBoss:
https://docs.jboss.org/jbossas/docs/Server_Configuration_Guide/4/html/JBoss_JMX_Implementation_Architecture-Class_Loading_and_Types_in_Java.html

With jboss-modules, it's easier to get around these problems, but you 
still run into the isolation built into the container itself, especially 
in the case of a WAR.
>
> If that is not the case, then we would need some kind of interprocess 
> communication going. With shell the roles of who connects where could 
> also be reversed, and a started up Wildfly instance could have a 
> service connecting out to local port bound by our CLI rather than the 
> other way around.
I don't think the direction of the connection matters so much as the 
fact that you need a serialized format to issue commands to a foreign 
container.

Or, as I mentioned, you need the CLI to actually live inside the container.
>
> I'm throwing out ideas here, not really knowing what are the hard 
> constraints that we don't want to violate ...
>



More information about the keycloak-dev mailing list