Package org.copperengine.core.util
Interface Backchannel
-
- All Known Implementing Classes:
BackchannelDefaultImpl
public interface Backchannel
Utility that offers functionality to signal a response from within a persistent workflow to its originator. Intended usage as follows:The originator (e.g. a webservice input adapter) and its created workflow instance share a dependency to the same Backchannel. Furthermore, the originator creates a unique correlationId and passes this correlationId to the workflow instance.
The originator will then call
wait(String, long, TimeUnit)
to wait for a response for this correlationId}.The workflow instance will signal its response by calling
notify(String, Object)
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
notify(java.lang.String correlationId, java.lang.Object response)
Passes a response for the specified correlationId to the bachchannel.java.lang.Object
wait(java.lang.String correlationId, long timeout, java.util.concurrent.TimeUnit timeunit)
Waits for a response for the specified correlationId.
-
-
-
Method Detail
-
wait
java.lang.Object wait(java.lang.String correlationId, long timeout, java.util.concurrent.TimeUnit timeunit) throws java.lang.InterruptedException
Waits for a response for the specified correlationId.- Parameters:
correlationId
- unique correlation id to wait fortimeout
- timeouttimeunit
- timeunit of timeout- Returns:
- the response or
null
in case of a timeout. - Throws:
java.lang.InterruptedException
- Might be thrown from the internally used CountDownLatch await method.
-
notify
void notify(java.lang.String correlationId, java.lang.Object response)
Passes a response for the specified correlationId to the bachchannel.- Parameters:
correlationId
- unique correlation idresponse
- the response object -null
value is allowed
-
-