[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Controller's execution env
adrian@jboss.org
do-not-reply at jboss.com
Mon Aug 4 09:56:58 EDT 2008
"alesj" wrote : "adrian at jboss.org" wrote : "adrian at jboss.org" wrote : http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/Executor.html
| | | by "injection" on to the kernel.
| | |
| |
| | I meant controller. ;-)
| Do we even need a getExecutor method?
|
| | public interface Controller extends JBossInterface
| | {
| | ...
| |
| | /**
| | * Get the executor
| | *
| | * @return the executor
| | */
| | Executor getExecutor();
| |
| | /**
| | * Set the executor
| | *
| | * @param executor the executor
| | */
| | void setExecutor(Executor executor);
| | }
| |
| Allowing some other MC code to re-use Controller's execution env?
I'd include the getter, subject to the same security check as invoking the setter.
Otherwise somebody could do:
|
| @Inject(...from the controller...)
| public void setExectuor(Executor ex)
| {
| // Fill the queue with tasks that don't end, a denial of service attack
| while(true)
| {
| ex.execute(new Runnable()
| {
| public void run()
| {
| // sleep forever
| }
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4168454#4168454
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4168454
More information about the jboss-dev-forums
mailing list