Package eu.ccvlab.mapi.core.payment
Class ErrorDelegateMulticaster
- java.lang.Object
-
- eu.ccvlab.mapi.core.payment.ErrorDelegateMulticaster
-
- All Implemented Interfaces:
ErrorDelegate
public class ErrorDelegateMulticaster extends java.lang.Object implements ErrorDelegate
ErrorDelegate that multicasts errors to a set of registered ErrorDelegates. This class takes care of distributing an error to a set of ErrorDelegates so it can be registered as a single instance and registeree classes do not have to take care of distributing to a set of observers themselves.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<ErrorDelegate>
delegates
-
Constructor Summary
Constructors Constructor Description ErrorDelegateMulticaster(ErrorDelegate... errorDelegates)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onError(Error error)
void
onError(MAPIError error)
void
registerDelegate(ErrorDelegate errorDelegate)
Adds an ErrorDelegate as registered delegate.
-
-
-
Field Detail
-
delegates
private final java.util.List<ErrorDelegate> delegates
-
-
Constructor Detail
-
ErrorDelegateMulticaster
public ErrorDelegateMulticaster(ErrorDelegate... errorDelegates)
-
-
Method Detail
-
registerDelegate
public void registerDelegate(ErrorDelegate errorDelegate)
Adds an ErrorDelegate as registered delegate.- Parameters:
errorDelegate
- AnotherErrorDelegate
that will be notified in case of error.
-
onError
public void onError(MAPIError error)
- Specified by:
onError
in interfaceErrorDelegate
-
onError
public void onError(Error error)
- Specified by:
onError
in interfaceErrorDelegate
-
-