Openfire plugin thread syncronization

I have an openfire plugin which makes system php calls. Somehow, I need to syncronize some of these php calls so that they do not overlap.

I think of locking a static object in Java but not very comfortable with this approach because I dont know how openfire will respond if my plugin gets deadlock or waits too long.

So my question is, does openfire provide a thread sync. mechanism (which is safe in terms of openfire performance) other then java monitors?

Also, any suggestion to solve sync. problem is welcome.