public void callEvent(Event event){
  if (event.isAsynchronous()) {
    if (Thread.holdsLock(this)) {
      throw new IllegalStateException(event.getEventName() + " cannot be triggered asynchronously from inside synchronized code.");
    }
    if (server.isPrimaryThread()) {
      throw new IllegalStateException(event.getEventName() + " cannot be triggered asynchronously from primary server thread.");
    }
    fireEvent(event);
  }
 else {
synchronized (this) {
      fireEvent(event);
    }
  }
}

public void callEvent ( Event event ) { if ( event . isAsynchronous ( ) ) { if ( Thread . holdsLock ( this ) ) { throw new IllegalStateException ( event . getEventName ( ) + " cannot be triggered asynchronously from inside synchronized code." ) ; } if ( server . isPrimaryThread ( ) ) { throw new IllegalStateException ( event . getEventName ( ) + " cannot be triggered asynchronously from primary server thread." ) ; } fireEvent ( event ) ; } else { synchronized ( this ) { fireEvent ( event ) ; } } }
calls an event with the given details . < p > this method only synchronizes when the event is not asynchronous .
