InterPSS-Project / ipss-plugin

InterPSS plugin projects
8 stars 11 forks source link

how to inject a custom DSLRunner #14

Closed thuang closed 9 years ago

thuang commented 9 years ago

For the details, please see my comment of the new update of ipss.pssl/src/org/interpss/pssl/plugin/cmd/CmdRunner.java
Check this link: https://github.com/InterPSS-Project/ipss-plugin/commit/be5847fae89f3256ff0dc9ebf8465333bc74ca77

jinjingfarm commented 9 years ago

We can do this in two steps:

1) Implement one DSLRunner for DStab 2) Refactor to define common interface for all DStab DSLRunner. The key for the injection implementation is to have a common interface.

thuang commented 9 years ago

I have updated the implementation. Please take a look the latest check in.

jinjingfarm commented 9 years ago

Now we have the following structure

HybridSimuDslRunner -> BaseDstabDslRunner

Let us create another DstabDslRunner for running normal DStab

HybridSimuDslRunner -> BaseDstabDslRunner DstabDslRunner ->

Although DstabDslRunner might be empty at this time. Then we can implement DI for plugin DstabDslRunner or HybridSimuDslRunner.

jinjingfarm commented 9 years ago

For using custom DslRunner, I implemented a relative simple approach, see update in the following class:

https://github.com/InterPSS-Project/ipss-plugin/blob/master/ipss.pssl/src/org/interpss/pssl/plugin/cmd/json/BaseJSONBean.java

in the JSON config file, user can define a different implementation,

"dslRunnerClassName":"org.interpss.pssl.plugin.cmd.AclfDslRunner",

as long as the user class implements the IDslRunner interface. The AclfDslRunner and AcscDslRunner have been updated. Please update the DStab part.