-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor the server task into several operation-specific tasks #3
Comments
Right now the 'server' task takes the 'operation' to execute as an attribute as well as several other attributes that are operation specific. For example, clean attribute can be set when executing the 'package' operation. The clean setting won't be used in this case.
or
or
|
Besides adding the operation-specific tasks we could also refactor the existing
The operation-specific tasks could of course reuse this server definition via the 'ref' attribute. The operation-specific tasks would provide additional value adds such as better error checking, etc. |
On my branch issue3, I created a class that extends ServerTask for each server operation. Each class only sets the operation attribute to its respective operation and executes the do-Operation()- method. This avoids the rewriting of the same code, lets the Maven and Gradle project still work with the ServerTask class and provides backwards compatibility. The inconvenient is that the issue is still present, the user can write something like this: <wlp:serverStop id="idMyServer" installDir="${wlp_install_dir}" template="notInUse" /> And I think there's no way to evade it without removing the compatibility with Maven and Gradle (Because both of them executes their operations using the setters of the ServerTask). Of course we could just hide the parameters not used in each operation in the README, what do you think? |
Also, I want to add the nested 'argument' element, but what if the user writes something like this: <wlp:server operation="create" template="someTemplate">
<argument>--template="someOtherTemplate"</argument>
</wlp:server> I think that the user shouldn't do both add arguments and parameters at the same time. |
No description provided.
The text was updated successfully, but these errors were encountered: