A lot of people probably already have implemented some sort of system like this, but it might be interesting enough for some others.
It's provides the ability for different threads to add jobs (a implementation of Runnable) which will then be run from a different context, for example from the jME one.
This should make it easier to do things like background loading of textures, since the OpenGL part of it can then be stuffed into a Runnable and then added as a synchronous or asynchronous job. The difference between asynchronous and synchronous jobs is that the latter one will block till the job has been executed. The oldest job in the queue will be run by calling runJob() (you can also run the oldest n by calling runJob(n)), preferably in update(int) or simpleUpdate().
Oh yeah, the design and idea of this is a shameless rip of what is done in SWT.
JobQueue.java
/*
* Copyright (c) 2003-2006 jMonkeyEngine
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'jMonkeyEngine' nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* <code>JobQueue</code> provides the ability for threads to run jobs in a
* different master thread. All jobs will be executed under that thread, which
* is the one calling {@link #runJob()} (or {@link #runJob(int)}). This class
* can be used to call OpenGL functions from other threads which enables things
* like background loading of textures. Jobs can be run in a asynchronous or
* synchronous manner. Asynchronous means that the thread adding the job will
* not wait for it to be executed. Adding synchronous jobs will block the
* current thread till the job has been executed.
*
* @author Frederik B