= RunBackgroundCommandsJobListener
:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Listens to the processing of the _org.apache.causeway.extensions.commandlog.applib.job.RunBackgroundCommandsJob_ .

== API

[source,java]
.RunBackgroundCommandsJobListener.java
----
interface RunBackgroundCommandsJobListener {
  void executed(List<String> commandInteractionIds)     // <.>
}
----

<.> xref:#executed_List[executed(List)]
+
--
The _CommandDto#getInteractionId() interactionId_ s of the _CommandDto_ s that were executed.
--

== Members

[#executed_List]
=== executed(List)

The _CommandDto#getInteractionId() interactionId_ s of the _CommandDto_ s that were executed.

The commands thus identified may or may not have executed successfully; indeed if there was a deadlock then the transaction will have been rolled back and so the command may not even have been executed at all.

Implementation note: the _CommandDto_ s are not passed in, instead only the command's _CommandDto#getInteractionId() interactionId_ , to avoid issues and complications with the state of the in-memory _CommandDto_ ; is it in sync with the database if a deadlock occurred for example? Passing in just the identifier means that it's the responsibility of the listener to determine the state, typically by refetching the xref:refguide:extensions:index/commandlog/applib/dom/CommandLogEntry.adoc[CommandLogEntry] (that _CommandLogEntry#getCommandDto() contains_ the _CommandDto_ ) in a separate transaction.
