public class DefaultServiceInvoker extends ServiceInvoker
| Modifier and Type | Field and Description |
|---|---|
protected ContextFactory |
contextFactory |
protected java.util.function.Predicate<java.lang.Throwable> |
retryLogic |
protected ServiceRegistry |
serviceRegistry |
protected boolean |
writeErrorsToLog
Write exceptions into the log file
|
broker, logger, name| Constructor and Description |
|---|
DefaultServiceInvoker() |
| Modifier and Type | Method and Description |
|---|---|
io.datatree.Promise |
call(java.lang.String name,
io.datatree.Tree params,
CallOptions.Options opts,
PacketStream stream,
Context parent) |
protected io.datatree.Promise |
call(java.lang.String name,
io.datatree.Tree params,
CallOptions.Options opts,
PacketStream stream,
Context parent,
java.lang.String targetID,
int remaining) |
java.util.function.Predicate<java.lang.Throwable> |
getRetryLogic() |
boolean |
isWriteErrorsToLog() |
protected io.datatree.Promise |
retry(java.lang.Throwable cause,
java.lang.String name,
io.datatree.Tree params,
CallOptions.Options opts,
PacketStream stream,
Context parent,
java.lang.String targetID,
int remaining) |
void |
setRetryLogic(java.util.function.Predicate<java.lang.Throwable> retryLogic) |
void |
setWriteErrorsToLog(boolean writeErrorsToLog) |
void |
started(ServiceBroker broker) |
getBroker, getLogger, getName, stoppedprotected boolean writeErrorsToLog
protected ServiceRegistry serviceRegistry
protected ContextFactory contextFactory
protected java.util.function.Predicate<java.lang.Throwable> retryLogic
public void started(ServiceBroker broker) throws java.lang.Exception
started in class MoleculerComponentjava.lang.Exceptionpublic io.datatree.Promise call(java.lang.String name,
io.datatree.Tree params,
CallOptions.Options opts,
PacketStream stream,
Context parent)
call in class ServiceInvokerprotected io.datatree.Promise call(java.lang.String name,
io.datatree.Tree params,
CallOptions.Options opts,
PacketStream stream,
Context parent,
java.lang.String targetID,
int remaining)
protected io.datatree.Promise retry(java.lang.Throwable cause,
java.lang.String name,
io.datatree.Tree params,
CallOptions.Options opts,
PacketStream stream,
Context parent,
java.lang.String targetID,
int remaining)
public boolean isWriteErrorsToLog()
public void setWriteErrorsToLog(boolean writeErrorsToLog)
public java.util.function.Predicate<java.lang.Throwable> getRetryLogic()
public void setRetryLogic(java.util.function.Predicate<java.lang.Throwable> retryLogic)