# Creating Private Execution Managers

**URL:** <https://forum.inductiveautomation.com/t/creating-private-execution-managers/8185>\
**Category:** Module Development\
**Created:** [March 20, 2014, 5:08pm UTC](https://forum.inductiveautomation.com/t/creating-private-execution-managers/8185 "2014-03-20T17:08:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [March 20, 2014, 5:08pm UTC](https://forum.inductiveautomation.com/t/creating-private-execution-managers/8185/1 "2014-03-20T17:08:48Z")

</div>

solved

---

<div class="post-metadata">

**Author:** ![lisawas](https://avatars.discourse-cdn.com/v4/letter/l/4bbf92/32.png) [@lisawas](https://forum.inductiveautomation.com/u/lisawas)\
**Post date:** [March 21, 2014, 4:06pm UTC](https://forum.inductiveautomation.com/t/creating-private-execution-managers/8185/2 "2014-03-21T16:06:40Z")

</div>

Didn’t .register start the task?

---

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [October 26, 2014, 5:37am UTC](https://forum.inductiveautomation.com/t/creating-private-execution-managers/8185/3 "2014-10-26T05:37:00Z")

</div>

Do private execution managers created with void executeOnce(java.lang.Runnable command) method of ExecutionManager Interface need to be unRegistered after the execute once is completed during shutdown? My understanding is that the execuateOnce tasks will take care of freeing them selves after execution is completed. We need to unRegister only the continuously running execution managers in order to interrupt the continuously scheduled tasks. Your comments will be appreciated.  
Best Regards  
PRAMANJ

The reason I asked this question is that there is no suitable unRegister method for tasks without owner variable. The interface gives following methods for unregistering:

void shutdown()   
Stops all execution gracefully.  
void unRegister(java.lang.String owner, java.lang.String name)  
Unregisters a given command.  
void unRegisterAll(java.lang.String owner)  
Unregisters all commands for the given owner.

Only the first method void shutdown() looks applicable as the is no owner argument for an executeOnce task.  
Any help will be appreciated.

Best Regards  
[color=#0000BF]PRAMANJ[/color]

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [October 27, 2014, 12:57pm UTC](https://forum.inductiveautomation.com/t/creating-private-execution-managers/8185/4 "2014-10-27T12:57:32Z")

</div>

You don’t need to unregister a task unless you registered it first. Tasks submitted to executeOnce only run once and are not held on to.

---

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [October 27, 2014, 1:44pm UTC](https://forum.inductiveautomation.com/t/creating-private-execution-managers/8185/5 "2014-10-27T13:44:19Z")

</div>

Thanks a lot Kevin for the quick answer. One more thing can we have multiple executeOnce execution managers running in parallel? Can they be nested i.e. once execution manager thread creating another within its run function?  
Regards  
PRAMANJ

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [October 27, 2014, 2:17pm UTC](https://forum.inductiveautomation.com/t/creating-private-execution-managers/8185/6 "2014-10-27T14:17:58Z")

</div>

You can, but you shouldn’t need to. One ExecutionManager for your entire module should be more than enough.

---

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [October 27, 2014, 3:41pm UTC](https://forum.inductiveautomation.com/t/creating-private-execution-managers/8185/7 "2014-10-27T15:41:11Z")

</div>

Thanks a lot, it was a hypothetical question to check if my understanding was correct.  
best regards  
PRAMANJ
