core/src/main/java/com/orientechnologies/orient/core/Orient.java
private void initShutdownQueue() {
    addShutdownHandler(new OShutdownWorkersHandler());
    addShutdownHandler(new OShutdownOrientDBInstancesHandler());
    addShutdownHandler(new OShutdownPendingThreadsHandler());
    addShutdownHandler(new OShutdownProfilerHandler());
    addShutdownHandler(new OShutdownCallListenersHandler());
  }
private void initShutdownQueue() {
    addShutdownHandler(new OShutdownWorkersHandler());
    addShutdownHandler(new OShutdownOrientDBInstancesHandler());
    addShutdownHandler(new OShutdownPendingThreadsHandler());
    addShutdownHandler(new OShutdownProfilerHandler());
    addShutdownHandler(new OShutdownCallListenersHandler());
  }
Adds shutdown handlers in order which will be used during execution of shutdown.