Something alongs the lines of

```java
public void shutdown(@Disposes DelegatingGraphDatabase database) {
  database.getGraphDatabaseService().shutdown();
}
```

should do the trick.