Maybe this is not exactly what you want, but you could use the UUID generator for that.
UUIDs aren't simple numbers, they are generated using different kind of information. The generator generates a new, random id on every call, so there is no problem in clustered environments. Considering its size (128 bit per id), it is very unlikely that the same uuid is generated twice.
Have a look at >>> http://www.jboss.org/community/docs/DOC-11223 <<<, if you want to learn more.