StreamProtoReceiver

public class StreamProtoReceiver
extends Object implements Closeable

java.lang.Object
   ↳ com.android.tradefed.result.proto.StreamProtoReceiver


一种接收器,用于将接收到的 proto TestRecord 转换为 Tradefed 事件。

摘要

字段

protected AtomicBoolean mStopParsing

设置此属性后,停止解析事件。

公共构造函数

StreamProtoReceiver(ITestInvocationListener listener, IInvocationContext mainContext, boolean reportInvocation)

Ctor。

StreamProtoReceiver(ITestInvocationListener listener, IInvocationContext mainContext, boolean reportInvocation, boolean quietParsing)

Ctor。

StreamProtoReceiver(ITestInvocationListener listener, IInvocationContext mainContext, boolean reportInvocation, boolean quietParsing, boolean reportLogs, String logNamePrefix)
StreamProtoReceiver(ITestInvocationListener listener, IInvocationContext mainContext, boolean reportInvocation, boolean quietParsing, boolean reportLogs, String logNamePrefix, boolean mergeInvocationMetrics)

Ctor。

StreamProtoReceiver(ITestInvocationListener listener, IInvocationContext mainContext, boolean reportInvocation, boolean quietParsing, String logNamePrefix)

Ctor。

公共方法

void close()
void completeModuleEvents()

如果需要确保报告的一致性,请完成模块的事件。

Throwable getError()

返回接收器线程中捕获的错误。

int getSocketServerPort()

返回已打开的套接字接收器。

boolean hasInvocationFailed()

返回是否已报告调用失败。

boolean joinReceiver(long millis)

受保护的方法

long getJoinTimeout(long millis)

字段

mStopParsing

protected AtomicBoolean mStopParsing

设置此属性后,系统会停止解析事件。这样可以避免在不再需要事件时,线程仍在解析事件。

公共构造函数

StreamProtoReceiver

public StreamProtoReceiver (ITestInvocationListener listener, 
                IInvocationContext mainContext, 
                boolean reportInvocation)

Ctor.

参数
listener ITestInvocationListener:用于报告结果的 ITestInvocationListener

mainContext IInvocationContext

reportInvocation boolean:是否报告调用级事件。

抛出
java.io.IOException
IOException

StreamProtoReceiver

public StreamProtoReceiver (ITestInvocationListener listener, 
                IInvocationContext mainContext, 
                boolean reportInvocation, 
                boolean quietParsing)

Ctor.

参数
listener ITestInvocationListener:用于报告结果的 ITestInvocationListener

mainContext IInvocationContext

reportInvocation boolean:是否报告调用级事件。

quietParsing boolean:是否允许解析器记录调试信息。

抛出
java.io.IOException
IOException

StreamProtoReceiver

public StreamProtoReceiver (ITestInvocationListener listener, 
                IInvocationContext mainContext, 
                boolean reportInvocation, 
                boolean quietParsing, 
                boolean reportLogs, 
                String logNamePrefix)

参数
listener ITestInvocationListener

mainContext IInvocationContext

reportInvocation boolean

quietParsing boolean

reportLogs boolean

logNamePrefix String

抛出
IOException

StreamProtoReceiver

public StreamProtoReceiver (ITestInvocationListener listener, 
                IInvocationContext mainContext, 
                boolean reportInvocation, 
                boolean quietParsing, 
                boolean reportLogs, 
                String logNamePrefix, 
                boolean mergeInvocationMetrics)

Ctor.

参数
listener ITestInvocationListener:用于报告结果的 ITestInvocationListener

mainContext IInvocationContext

reportInvocation boolean:是否报告调用级事件。

quietParsing boolean:是否允许解析器记录调试信息。

reportLogs boolean:是否报告日志

logNamePrefix String:通过解析器记录的文件的前缀。

mergeInvocationMetrics boolean

抛出
java.io.IOException
IOException

StreamProtoReceiver

public StreamProtoReceiver (ITestInvocationListener listener, 
                IInvocationContext mainContext, 
                boolean reportInvocation, 
                boolean quietParsing, 
                String logNamePrefix)

Ctor.

参数
listener ITestInvocationListener:用于报告结果的 ITestInvocationListener

mainContext IInvocationContext

reportInvocation boolean:是否报告调用级事件。

quietParsing boolean:是否允许解析器记录调试信息。

logNamePrefix String:通过解析器记录的文件的前缀。

抛出
java.io.IOException
IOException

公共方法

关闭

public void close ()

抛出
IOException

completeModuleEvents

public void completeModuleEvents ()

如果需要确保报告的一致性,请完成模块中的所有活动。

getError

public Throwable getError ()

返回接收器线程中捕获的错误。如果没有,则返回 null。

返回
Throwable

getSocketServerPort

public int getSocketServerPort ()

返回已打开的套接字接收器。如果没有,则为 -1。

返回
int

hasInvocationFailed

public boolean hasInvocationFailed ()

返回是否已报告调用失败。

返回
boolean

joinReceiver

public boolean joinReceiver (long millis)

参数
millis long

返回
boolean

受保护的方法

getJoinTimeout

protected long getJoinTimeout (long millis)

参数
millis long

返回值
long