com.alibaba.dubbo.rpc
Interface Result

All Known Implementing Classes:
DecodeableRpcResult, RpcResult

public interface Result

RPC invoke result. (API, Prototype, NonThreadSafe)

Author:
qianlei, william.liangf
See Also:
Invoker.invoke(Invocation), RpcResult

Method Summary
 String getAttachment(String key)
          get attachment by key.
 String getAttachment(String key, String defaultValue)
          get attachment by key with default value.
 Map<String,String> getAttachments()
          get attachments.
 Throwable getException()
          Get exception.
 Object getResult()
          Deprecated. Replace to getValue()
 Object getValue()
          Get invoke result.
 boolean hasException()
          Has exception.
 Object recreate()
          Recreate.
 

Method Detail

getValue

Object getValue()
Get invoke result.

Returns:
result. if no result return null.

getException

Throwable getException()
Get exception.

Returns:
exception. if no exception return null.

hasException

boolean hasException()
Has exception.

Returns:
has exception.

recreate

Object recreate()
                throws Throwable
Recreate.

if (hasException()) { throw getException(); } else { return getValue(); }

Returns:
result.
Throws:
if - has exception throw it.
Throwable

getResult

@Deprecated
Object getResult()
Deprecated. Replace to getValue()

See Also:
getValue()

getAttachments

Map<String,String> getAttachments()
get attachments.

Returns:
attachments.

getAttachment

String getAttachment(String key)
get attachment by key.

Returns:
attachment value.

getAttachment

String getAttachment(String key,
                     String defaultValue)
get attachment by key with default value.

Returns:
attachment value.


Copyright © 2012–2017 Alibaba. All rights reserved.