Package org.apache.dubbo.rpc.support
Class MockInvoker<T>
java.lang.Object
org.apache.dubbo.rpc.support.MockInvoker<T>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()get service interface.static ObjectgetMockObject(ExtensionDirector extensionDirector, String mockService, Class serviceType) static ThrowablegetThrowable(String throwstr) getUrl()invoke(Invocation invocation) invoke.booleanstatic StringnormalizeMock(String mock) Normalize mock string: return => return null fail => default force => default fail:throw/return foo => throw/return foo force:throw/return foo => throw/return foostatic ObjectparseMockValue(String mock) static ObjectparseMockValue(String mock, Type[] returnTypes)
-
Constructor Details
-
MockInvoker
-
-
Method Details
-
parseMockValue
- Throws:
Exception
-
parseMockValue
- Throws:
Exception
-
invoke
Description copied from interface:Invokerinvoke.- Specified by:
invokein interfaceInvoker<T>- Parameters:
invocation-- Returns:
- result
- Throws:
RpcException
-
getThrowable
-
getMockObject
public static Object getMockObject(ExtensionDirector extensionDirector, String mockService, Class serviceType) -
normalizeMock
Normalize mock string:- return => return null
- fail => default
- force => default
- fail:throw/return foo => throw/return foo
- force:throw/return foo => throw/return foo
- Parameters:
mock- mock string- Returns:
- normalized mock string
-
getUrl
-
isAvailable
public boolean isAvailable()- Specified by:
isAvailablein interfaceNode
-
destroy
public void destroy() -
getInterface
Description copied from interface:Invokerget service interface.- Specified by:
getInterfacein interfaceInvoker<T>- Returns:
- service interface.
-