Implementation of discardable events in Java?
<p>I would like to know are there something already available in Java, which will allow me to</p>

<ul>
<li>submit an action</li>
<li>if action doesn't match the constraint, then discard the action</li>
<li>otherwise execute the action</li>
</ul>

<p>constraint might be: "if the action with the same arguments was executed more than 5 seconds ago", and action itself "log the message to file" or "send message to the JMS queue"</p>

<p>It's easy to implement the solution, but I don't want to reinvent the wheel :)</p>
