Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 175326

Usage of CurrentFactory with Spring Plugin API

$
0
0

I'm developing a plugin using the spring based plugin api, and have been taking a look at the source of the powershell plugin on github for some examples of how an implementation might work. I'm current confused about how to properly use CurrentFactory to get access to the factory from a scripting singleton.

 

I've got a resource which is configured as a scripting singleton and allows me creation of resource elements using a service that defers to AbstractResourceElementConfigPersister to create / update / delete resource elements on the db. This seems to be pretty much exactly what the powershell plugin is doing, however I'm unable to get it work. I see the following when doing logging of the code:

 

2013-11-17 20:22:14.024+0000 [WorkflowExecutorPool-Thread-1] INFO  {vcoadmin:Create Configuration:7f87ee56-8a5c-470a-9a87-32c305423a8f:402880e44267b880014267ba54690005} [Definitions] Adding mapper : ch.dunes.scripting.server.script.ServerScriptMapper@18632b7f

2013-11-17 20:22:14.050+0000 [WorkflowExecutorPool-Thread-1] INFO  {vcoadmin:Create Configuration:7f87ee56-8a5c-470a-9a87-32c305423a8f:402880e44267b880014267ba54690005} [ServerScriptMapper] Initialize Server Scripting Objects

2013-11-17 20:22:14.216+0000 [WorkflowExecutorPool-Thread-1] INFO  {vcoadmin:Create Configuration:7f87ee56-8a5c-470a-9a87-32c305423a8f:402880e44267b880014267ba54690005} [PluginFactory] find() --> ref: {ConfigurationType@Service1}

2013-11-17 20:22:14.221+0000 [WorkflowExecutorPool-Thread-1] INFO  {vcoadmin:Create Configuration:7f87ee56-8a5c-470a-9a87-32c305423a8f:402880e44267b880014267ba54690005} [ConfigurationService] createPersister() -> CurrentFactory com.vmware.o11n.plugin.sdk.spring.impl.CurrentFactoryImpl@79639fe5

2013-11-17 20:22:14.230+0000 [WorkflowExecutorPool-Thread-1] INFO  {vcoadmin:Create Configuration:7f87ee56-8a5c-470a-9a87-32c305423a8f:402880e44267b880014267ba54690005} [SCRIPTING_LOG] current value not set (Workflow:Create Configuration / Scriptable task (item1)#13)

2013-11-17 20:22:14.232+0000 [WorkflowExecutorPool-Thread-1] WARN  {vcoadmin:Create Configuration:7f87ee56-8a5c-470a-9a87-32c305423a8f:402880e44267b880014267ba54690005} [WorkflowItemTaskRunner] Script execution error on workflow : Create Configuration / 'Scriptable task'(item1) : current value not set (Workflow:Create Configuration / Scriptable task (item1)#13)

 

This indicates to me that the CurrentFactory instance is being injected into my service, but the thread local hasn't been set with an instance of the plugin factory. Is there something I'm missing about how the spring sdk works to have a plugin factory instance created?


If I manage the client connection myself the rest of my code works, I'm just at a loss on why I'm not getting an instance of the plugin factory. I couldn't find any documentation except for a PDF, so if there is documentation I've missed pointing me there would work as well.

 

Another question, is there any way to turn up logging during testing so stack traces don't get hidden? It's very painful to have to wrap and log those myself when debugging.


Viewing all articles
Browse latest Browse all 175326

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>